Merge pull request #1179 from balena-io/update-typings

Update types and fix issue with treating string as a number
This commit is contained in:
Page- 2020-01-17 15:32:13 +00:00 committed by GitHub
commit 340dac9069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 232 additions and 226 deletions

276
package-lock.json generated
View File

@ -198,15 +198,15 @@
"dev": true "dev": true
}, },
"@types/bluebird": { "@types/bluebird": {
"version": "3.5.25", "version": "3.5.29",
"resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.25.tgz", "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.29.tgz",
"integrity": "sha512-yfhIBix+AIFTmYGtkC0Bi+XGjSkOINykqKvO/Wqdz/DuXlAKK7HmhLAXdPIGsV4xzKcL3ev/zYc4yLNo+OvGaw==", "integrity": "sha512-kmVtnxTuUuhCET669irqQmPAez4KFnFVKvpleVRyfC3g+SHD1hIkFZcWLim9BVcwUBLO59o8VZE4yGCmTif8Yw==",
"dev": true "dev": true
}, },
"@types/body-parser": { "@types/body-parser": {
"version": "1.17.0", "version": "1.17.1",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.0.tgz", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.1.tgz",
"integrity": "sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w==", "integrity": "sha512-RoX2EZjMiFMjZh9lmYrwgoP9RTpAjSHiJxdp4oidAQVO02T7HER3xj9UKue5534ULWeqVEkujhWcyvUce+d68w==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/connect": "*", "@types/connect": "*",
@ -214,15 +214,15 @@
} }
}, },
"@types/caseless": { "@types/caseless": {
"version": "0.12.1", "version": "0.12.2",
"resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.1.tgz", "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.2.tgz",
"integrity": "sha512-FhlMa34NHp9K5MY1Uz8yb+ZvuX0pnvn3jScRSNAb75KHGB8d3rEU6hqMs3Z2vjuytcMfRg6c5CHMc3wtYyD2/A==", "integrity": "sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==",
"dev": true "dev": true
}, },
"@types/chai": { "@types/chai": {
"version": "4.1.7", "version": "4.2.7",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.7.tgz", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.7.tgz",
"integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==", "integrity": "sha512-luq8meHGYwvky0O7u0eQZdA7B4Wd9owUCqvbw2m3XCrCU8mplYOujMBbvyS547AxJkC+pGnd0Cm15eNxEUNU8g==",
"dev": true "dev": true
}, },
"@types/chai-as-promised": { "@types/chai-as-promised": {
@ -241,9 +241,9 @@
"dev": true "dev": true
}, },
"@types/connect": { "@types/connect": {
"version": "3.4.32", "version": "3.4.33",
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.32.tgz", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.33.tgz",
"integrity": "sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg==", "integrity": "sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/node": "*" "@types/node": "*"
@ -286,9 +286,9 @@
"dev": true "dev": true
}, },
"@types/express": { "@types/express": {
"version": "4.16.0", "version": "4.17.2",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.16.0.tgz", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.2.tgz",
"integrity": "sha512-TtPEYumsmSTtTetAPXlJVf3kEqb6wZK0bZojpJQrnD/djV4q1oB6QQ8aKvKqwNPACoe02GNiy5zDzcYivR5Z2w==", "integrity": "sha512-5mHFNyavtLoJmnusB8OKJ5bshSzw+qkMIBAobLrIM48HJvunFva9mOa6aBwh64lBFyNwBbs0xiEFuj4eU/NjCA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/body-parser": "*", "@types/body-parser": "*",
@ -297,25 +297,15 @@
} }
}, },
"@types/express-serve-static-core": { "@types/express-serve-static-core": {
"version": "4.16.0", "version": "4.17.1",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.0.tgz", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.1.tgz",
"integrity": "sha512-lTeoCu5NxJU4OD9moCgm0ESZzweAx0YqsAcab6OB0EB3+As1OaHtKnaGJvcngQxYsi9UNv0abn4/DRavrRxt4w==", "integrity": "sha512-9e7jj549ZI+RxY21Cl0t8uBnWyb22HzILupyHZjYEVK//5TT/1bZodU+yUbLnPdoYViBBnNWbxp4zYjGV0zUGw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/events": "*",
"@types/node": "*", "@types/node": "*",
"@types/range-parser": "*" "@types/range-parser": "*"
} }
}, },
"@types/form-data": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz",
"integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"@types/glob": { "@types/glob": {
"version": "5.0.36", "version": "5.0.36",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.36.tgz", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.36.tgz",
@ -346,9 +336,9 @@
"dev": true "dev": true
}, },
"@types/knex": { "@types/knex": {
"version": "0.14.26", "version": "0.15.2",
"resolved": "https://registry.npmjs.org/@types/knex/-/knex-0.14.26.tgz", "resolved": "https://registry.npmjs.org/@types/knex/-/knex-0.15.2.tgz",
"integrity": "sha512-BhtEH5PbB2kxuAwZ1w+KDNyL5NZXjTfoT6JtwnD3P/l3bqJJISCOAfPeH8O2aY66auscNIaCvIij/eONvlM4Cw==", "integrity": "sha512-mw8OT8v+FK0SsgDdmio2XSkEM/yLD7ybFtiqW7I65EDTlr2aZtG+p9FhryErpNJDJ2FEXgQhe3JVBG0Gh7YbvQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/bluebird": "*", "@types/bluebird": "*",
@ -356,15 +346,15 @@
} }
}, },
"@types/lockfile": { "@types/lockfile": {
"version": "1.0.0", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/@types/lockfile/-/lockfile-1.0.0.tgz", "resolved": "https://registry.npmjs.org/@types/lockfile/-/lockfile-1.0.1.tgz",
"integrity": "sha512-pD6JuijPmrfi84qF3/TzGQ7zi0QIX+d7ZdetD6jUA6cp+IsCzAquXZfi5viesew+pfpOTIdAVKuh1SHA7KeKzg==", "integrity": "sha512-65WZedEm4AnOsBDdsapJJG42MhROu3n4aSSiu87JXF/pSdlubxZxp3S1yz3kTfkJ2KBPud4CpjoHVAptOm9Zmw==",
"dev": true "dev": true
}, },
"@types/lodash": { "@types/lodash": {
"version": "4.14.122", "version": "4.14.149",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.122.tgz", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.149.tgz",
"integrity": "sha512-9IdED8wU93ty8gP06ninox+42SBSJHp2IAamsSYMUY76mshRTeUsid/gtbl8ovnOwy8im41ib4cxTiIYMXGKew==", "integrity": "sha512-ijGqzZt/b7BfzcK9vTrS6MFljQRPn5BFWOx8oE0GYxribu6uV+aA9zZuXI1zc/etK9E8nrgdoF2+LgUw7+9tJQ==",
"dev": true "dev": true
}, },
"@types/lodash.memoize": { "@types/lodash.memoize": {
@ -377,15 +367,15 @@
} }
}, },
"@types/memoizee": { "@types/memoizee": {
"version": "0.4.2", "version": "0.4.3",
"resolved": "https://registry.npmjs.org/@types/memoizee/-/memoizee-0.4.2.tgz", "resolved": "https://registry.npmjs.org/@types/memoizee/-/memoizee-0.4.3.tgz",
"integrity": "sha512-bhdZXZWKfpkQuuiQjVjnPiNeBHpIAC6rfOFqlJXKD3VC35mCcolfVfXYTnk9Ppee5Mkmmz3Llgec7xCdJAbzWw==", "integrity": "sha512-N6QT0c9ZbEKl33n1wyoTxZs4cpN+YXjs0Aqy5Qim8ipd9PBNIPqOh/p5Pixc4601tqr5GErsdxUbfqviDfubNw==",
"dev": true "dev": true
}, },
"@types/mime": { "@types/mime": {
"version": "2.0.0", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.0.tgz", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz",
"integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA==", "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==",
"dev": true "dev": true
}, },
"@types/minimatch": { "@types/minimatch": {
@ -410,9 +400,9 @@
"dev": true "dev": true
}, },
"@types/morgan": { "@types/morgan": {
"version": "1.7.35", "version": "1.7.37",
"resolved": "https://registry.npmjs.org/@types/morgan/-/morgan-1.7.35.tgz", "resolved": "https://registry.npmjs.org/@types/morgan/-/morgan-1.7.37.tgz",
"integrity": "sha512-E9qFi0seOkdlQnCTPv54brNfGWeFdRaEhI5tSue4pdx/V+xfxvMETsxXhOEcj1cYL+0n/jcTEmj/jD2gjzCwMg==", "integrity": "sha512-tIdEA10BcHcOumMmUiiYdw8lhiVVq62r0ghih5Xpp4WETkfsMiTUZL4w9jCI502BBOrKhFrAOGml9IeELvVaBA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/express": "*" "@types/express": "*"
@ -428,9 +418,9 @@
} }
}, },
"@types/node": { "@types/node": {
"version": "10.12.17", "version": "10.17.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.17.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.13.tgz",
"integrity": "sha512-umSCRkjWH70uNzFiOof5yxCqrMXIBJ9UJJUzbEsmtWt8apURQh06pylGMqnhdjHGJSeoBrhzk+mibu6NgL1oBA==", "integrity": "sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg==",
"dev": true "dev": true
}, },
"@types/optimist": { "@types/optimist": {
@ -452,15 +442,28 @@
"dev": true "dev": true
}, },
"@types/request": { "@types/request": {
"version": "2.48.1", "version": "2.48.4",
"resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.1.tgz", "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.4.tgz",
"integrity": "sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg==", "integrity": "sha512-W1t1MTKYR8PxICH+A4HgEIPuAC3sbljoEVfyZbeFJJDbr30guDspJri2XOaM2E+Un7ZjrihaDi7cf6fPa2tbgw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/caseless": "*", "@types/caseless": "*",
"@types/form-data": "*",
"@types/node": "*", "@types/node": "*",
"@types/tough-cookie": "*" "@types/tough-cookie": "*",
"form-data": "^2.5.0"
},
"dependencies": {
"form-data": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz",
"integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==",
"dev": true,
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
}
} }
}, },
"@types/rimraf": { "@types/rimraf": {
@ -486,9 +489,9 @@
"dev": true "dev": true
}, },
"@types/serve-static": { "@types/serve-static": {
"version": "1.13.2", "version": "1.13.3",
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.2.tgz", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.3.tgz",
"integrity": "sha512-/BZ4QRLpH/bNYgZgwhKEh+5AsboDBcUdlBYgzoLX0fpj3Y2gp6EApyOlM3bK53wQS/OE1SrdSYBAbux2D1528Q==", "integrity": "sha512-oprSwp094zOglVrXdlo/4bAHtKTAxX6VT8FOZlBKrmyLbNvE1zxZyJ6yikMVtHIvwP45+ZQGJn+FdXGKTozq0g==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/express-serve-static-core": "*", "@types/express-serve-static-core": "*",
@ -496,15 +499,15 @@
} }
}, },
"@types/shell-quote": { "@types/shell-quote": {
"version": "1.6.0", "version": "1.6.1",
"resolved": "https://registry.npmjs.org/@types/shell-quote/-/shell-quote-1.6.0.tgz", "resolved": "https://registry.npmjs.org/@types/shell-quote/-/shell-quote-1.6.1.tgz",
"integrity": "sha512-BFonQx849sYB2YOJZBUEfbWdaJcqRb6+ASvgUBtcmg2JRTjBaV2Wgn0SD0gWNIZ+rd7KPysPCjLUOUXnBDUlBg==", "integrity": "sha512-t0bxRLQ75MMF7EeICa1eYC//o1/6gPaUV7ELke4l4OkwpZ9apOzvv2oR5F2PmQJ3tM83Lo+MNKfAXn5gQRMcnA==",
"dev": true "dev": true
}, },
"@types/sinon": { "@types/sinon": {
"version": "7.0.13", "version": "7.5.1",
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.0.13.tgz", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.1.tgz",
"integrity": "sha512-d7c/C/+H/knZ3L8/cxhicHUiTDxdgap0b/aNJfsmLwFu/iOP17mdgbQsbHA3SJmrzsjD0l3UEE5SN4xxuz5ung==", "integrity": "sha512-EZQUP3hSZQyTQRfiLqelC9NMWd1kqLcmQE0dMiklxBkgi84T+cHOhnKpgk4NnOWpGX863yE6+IaGnOXUNFqDnQ==",
"dev": true "dev": true
}, },
"@types/sinon-chai": { "@types/sinon-chai": {
@ -524,9 +527,9 @@
"dev": true "dev": true
}, },
"@types/tough-cookie": { "@types/tough-cookie": {
"version": "2.3.4", "version": "2.3.6",
"resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.4.tgz", "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.6.tgz",
"integrity": "sha512-Set5ZdrAaKI/qHdFlVMgm/GsAv/wkXhSTuZFkJ+JI7HK+wIkIlOaUXSXieIvJ0+OvGIqtREFoE+NHJtEq0gtEw==", "integrity": "sha512-wHNBMnkoEBiRAd3s8KTKwIuO9biFtTf0LehITzBhSco+HQI0xkXZbLOD55SW3Aqw3oUkHstkm5SPv58yaAdFPQ==",
"dev": true "dev": true
}, },
"@webassemblyjs/ast": { "@webassemblyjs/ast": {
@ -1148,9 +1151,9 @@
} }
}, },
"arg": { "arg": {
"version": "4.1.0", "version": "4.1.2",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.2.tgz",
"integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==", "integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==",
"dev": true "dev": true
}, },
"argparse": { "argparse": {
@ -1303,7 +1306,7 @@
}, },
"util": { "util": {
"version": "0.10.3", "version": "0.10.3",
"resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz",
"integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -1331,7 +1334,7 @@
}, },
"async": { "async": {
"version": "1.5.2", "version": "1.5.2",
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz",
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
"dev": true "dev": true
}, },
@ -2503,7 +2506,7 @@
"dependencies": { "dependencies": {
"coffee-script": { "coffee-script": {
"version": "1.11.1", "version": "1.11.1",
"resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.11.1.tgz", "resolved": "http://registry.npmjs.org/coffee-script/-/coffee-script-1.11.1.tgz",
"integrity": "sha1-vxxHrWREOg2V0S3ysUfMCk2q1uk=", "integrity": "sha1-vxxHrWREOg2V0S3ysUfMCk2q1uk=",
"dev": true "dev": true
}, },
@ -2974,7 +2977,7 @@
}, },
"dbus-native": { "dbus-native": {
"version": "0.2.5", "version": "0.2.5",
"resolved": "http://registry.npmjs.org/dbus-native/-/dbus-native-0.2.5.tgz", "resolved": "https://registry.npmjs.org/dbus-native/-/dbus-native-0.2.5.tgz",
"integrity": "sha512-ocxMKCV7QdiNhzhFSeEMhj258OGtvpANSb3oWGiotmI5h1ZIse0TMPcSLiXSpqvbYvQz2Y5RsYPMNYLWhg9eBw==", "integrity": "sha512-ocxMKCV7QdiNhzhFSeEMhj258OGtvpANSb3oWGiotmI5h1ZIse0TMPcSLiXSpqvbYvQz2Y5RsYPMNYLWhg9eBw==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -3175,7 +3178,7 @@
"dependencies": { "dependencies": {
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true "dev": true
} }
@ -3517,7 +3520,7 @@
}, },
"readable-stream": { "readable-stream": {
"version": "1.0.34", "version": "1.0.34",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
"integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -3962,7 +3965,7 @@
}, },
"event-stream": { "event-stream": {
"version": "3.3.4", "version": "3.3.4",
"resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
"integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -4102,7 +4105,7 @@
"dependencies": { "dependencies": {
"array-flatten": { "array-flatten": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "resolved": "http://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=",
"dev": true "dev": true
}, },
@ -6129,13 +6132,13 @@
}, },
"lodash": { "lodash": {
"version": "3.10.1", "version": "3.10.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", "resolved": "http://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
"integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=",
"dev": true "dev": true
}, },
"onetime": { "onetime": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
"integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=",
"dev": true "dev": true
}, },
@ -6190,13 +6193,13 @@
"dependencies": { "dependencies": {
"bluebird": { "bluebird": {
"version": "2.11.0", "version": "2.11.0",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", "resolved": "http://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz",
"integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=", "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=",
"dev": true "dev": true
}, },
"lodash": { "lodash": {
"version": "3.10.1", "version": "3.10.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", "resolved": "http://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
"integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=",
"dev": true "dev": true
} }
@ -7548,7 +7551,7 @@
}, },
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true "dev": true
} }
@ -7887,7 +7890,7 @@
}, },
"map-stream": { "map-stream": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", "resolved": "http://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz",
"integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=",
"dev": true "dev": true
}, },
@ -8172,7 +8175,7 @@
"dependencies": { "dependencies": {
"commander": { "commander": {
"version": "2.15.1", "version": "2.15.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
"dev": true "dev": true
}, },
@ -8278,7 +8281,7 @@
}, },
"nan": { "nan": {
"version": "2.10.0", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", "resolved": "http://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
"integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
"dev": true "dev": true
}, },
@ -8371,7 +8374,7 @@
}, },
"next-tick": { "next-tick": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "http://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=",
"dev": true "dev": true
}, },
@ -8767,7 +8770,7 @@
}, },
"os-homedir": { "os-homedir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
}, },
"os-locale": { "os-locale": {
@ -8809,7 +8812,7 @@
}, },
"get-stream": { "get-stream": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
"dev": true "dev": true
} }
@ -8817,7 +8820,7 @@
}, },
"os-tmpdir": { "os-tmpdir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
}, },
"osenv": { "osenv": {
@ -8972,7 +8975,7 @@
}, },
"path-is-absolute": { "path-is-absolute": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
}, },
"path-is-inside": { "path-is-inside": {
@ -9468,7 +9471,7 @@
}, },
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true "dev": true
}, },
@ -9487,7 +9490,7 @@
}, },
"readable-stream": { "readable-stream": {
"version": "2.3.6", "version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"requires": { "requires": {
"core-util-is": "~1.0.0", "core-util-is": "~1.0.0",
@ -9640,7 +9643,7 @@
}, },
"require-npm4-to-publish": { "require-npm4-to-publish": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/require-npm4-to-publish/-/require-npm4-to-publish-1.0.0.tgz", "resolved": "http://registry.npmjs.org/require-npm4-to-publish/-/require-npm4-to-publish-1.0.0.tgz",
"integrity": "sha1-5Z7D5ikQFT3Fu90MpA20IrLE2ec=", "integrity": "sha1-5Z7D5ikQFT3Fu90MpA20IrLE2ec=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -9668,7 +9671,7 @@
"dependencies": { "dependencies": {
"bluebird": { "bluebird": {
"version": "2.11.0", "version": "2.11.0",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", "resolved": "http://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz",
"integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=", "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=",
"dev": true "dev": true
} }
@ -9717,7 +9720,7 @@
}, },
"lodash": { "lodash": {
"version": "3.10.1", "version": "3.10.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", "resolved": "http://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
"integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=",
"dev": true "dev": true
}, },
@ -9802,7 +9805,7 @@
}, },
"resin-register-device": { "resin-register-device": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/resin-register-device/-/resin-register-device-3.0.0.tgz", "resolved": "http://registry.npmjs.org/resin-register-device/-/resin-register-device-3.0.0.tgz",
"integrity": "sha1-PmyWJfOc8jR5K4uQlI8J7AO+JgM=", "integrity": "sha1-PmyWJfOc8jR5K4uQlI8J7AO+JgM=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -10503,7 +10506,7 @@
}, },
"split": { "split": {
"version": "0.3.3", "version": "0.3.3",
"resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", "resolved": "http://registry.npmjs.org/split/-/split-0.3.3.tgz",
"integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -10643,7 +10646,7 @@
}, },
"stream-browserify": { "stream-browserify": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz",
"integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -11224,9 +11227,9 @@
"dev": true "dev": true
}, },
"ts-loader": { "ts-loader": {
"version": "5.3.1", "version": "5.4.5",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-5.3.1.tgz", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-5.4.5.tgz",
"integrity": "sha512-fDDgpBH3SR8xlt2MasLdz3Yy611PQ/UY/KGyo7TgXhTRU/6sS8uGG0nJYnU1OdFBNKcoYbId1UTNaAOUn+i41g==", "integrity": "sha512-XYsjfnRQCBum9AMRZpk2rTYSVpdZBpZK+kDh0TeT3kxmQNBDVIeUjdPjY5RZry4eIAb8XHc4gYSUiUWPYvzSRw==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^2.3.0", "chalk": "^2.3.0",
@ -11234,56 +11237,25 @@
"loader-utils": "^1.0.2", "loader-utils": "^1.0.2",
"micromatch": "^3.1.4", "micromatch": "^3.1.4",
"semver": "^5.0.1" "semver": "^5.0.1"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"chalk": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
}
} }
}, },
"ts-node": { "ts-node": {
"version": "8.3.0", "version": "8.6.2",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.6.2.tgz",
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==", "integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==",
"dev": true, "dev": true,
"requires": { "requires": {
"arg": "^4.1.0", "arg": "^4.1.0",
"diff": "^4.0.1", "diff": "^4.0.1",
"make-error": "^1.1.1", "make-error": "^1.1.1",
"source-map-support": "^0.5.6", "source-map-support": "^0.5.6",
"yn": "^3.0.0" "yn": "3.1.1"
}, },
"dependencies": { "dependencies": {
"diff": { "diff": {
"version": "4.0.1", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
"dev": true "dev": true
} }
} }
@ -11456,9 +11428,9 @@
} }
}, },
"typescript": { "typescript": {
"version": "3.7.2", "version": "3.7.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz",
"integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==", "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==",
"dev": true "dev": true
}, },
"uglify-js": { "uglify-js": {
@ -12560,7 +12532,7 @@
}, },
"get-stream": { "get-stream": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
"dev": true "dev": true
}, },
@ -12671,7 +12643,7 @@
}, },
"wrap-ansi": { "wrap-ansi": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -12696,7 +12668,7 @@
}, },
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -12707,7 +12679,7 @@
}, },
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -12986,9 +12958,9 @@
"dev": true "dev": true
}, },
"yn": { "yn": {
"version": "3.1.0", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
"dev": true "dev": true
} }
} }

View File

@ -38,27 +38,27 @@
}, },
"devDependencies": { "devDependencies": {
"@balena/contrato": "^0.2.1", "@balena/contrato": "^0.2.1",
"@types/bluebird": "^3.5.25", "@types/bluebird": "^3.5.29",
"@types/chai": "^4.1.7", "@types/chai": "^4.2.7",
"@types/chai-as-promised": "^7.1.2", "@types/chai-as-promised": "^7.1.2",
"@types/common-tags": "^1.8.0", "@types/common-tags": "^1.8.0",
"@types/dockerode": "^2.5.21", "@types/dockerode": "^2.5.21",
"@types/event-stream": "^3.3.34", "@types/event-stream": "^3.3.34",
"@types/express": "^4.11.1", "@types/express": "^4.17.2",
"@types/knex": "^0.14.14", "@types/knex": "^0.15.2",
"@types/lockfile": "^1.0.0", "@types/lockfile": "^1.0.1",
"@types/lodash": "4.14.122", "@types/lodash": "^4.14.149",
"@types/memoizee": "^0.4.2", "@types/memoizee": "^0.4.3",
"@types/mkdirp": "^0.5.2", "@types/mkdirp": "^0.5.2",
"@types/mocha": "^5.2.7", "@types/mocha": "^5.2.7",
"@types/morgan": "^1.7.35", "@types/morgan": "^1.7.37",
"@types/mz": "0.0.32", "@types/mz": "0.0.32",
"@types/node": "^10.12.17", "@types/node": "^10.17.13",
"@types/request": "^2.48.1", "@types/request": "^2.48.4",
"@types/rimraf": "^2.0.3", "@types/rimraf": "^2.0.3",
"@types/rwlock": "^5.0.2", "@types/rwlock": "^5.0.2",
"@types/shell-quote": "^1.6.0", "@types/shell-quote": "^1.6.1",
"@types/sinon": "^7.0.13", "@types/sinon": "^7.5.1",
"@types/sinon-chai": "^3.2.3", "@types/sinon-chai": "^3.2.3",
"@types/tmp": "^0.1.0", "@types/tmp": "^0.1.0",
"balena-sync": "^10.0.0", "balena-sync": "^10.0.0",
@ -116,10 +116,10 @@
"strict-event-emitter-types": "^2.0.0", "strict-event-emitter-types": "^2.0.0",
"terser": "^3.14.1", "terser": "^3.14.1",
"tmp": "^0.1.0", "tmp": "^0.1.0",
"ts-loader": "^5.3.0", "ts-loader": "^5.4.5",
"ts-node": "^8.3.0", "ts-node": "^8.6.2",
"typed-error": "^2.0.0", "typed-error": "^2.0.0",
"typescript": "^3.7.0", "typescript": "^3.7.5",
"webpack": "^4.25.0", "webpack": "^4.25.0",
"webpack-cli": "^3.1.2", "webpack-cli": "^3.1.2",
"winston": "^3.2.1" "winston": "^3.2.1"

View File

@ -53,10 +53,6 @@ export interface Image {
downloadProgress: Nullable<number>; downloadProgress: Nullable<number>;
} }
// TODO: This is necessary for the format() method, but I'm not sure
// why, and it seems like a bad idea as it is. Fix the need for this.
type MaybeImage = { [key in keyof Image]: Image[key] | null };
// TODO: Remove the need for this type... // TODO: Remove the need for this type...
type NormalisedDockerImage = Docker.ImageInfo & { type NormalisedDockerImage = Docker.ImageInfo & {
NormalisedRepoTags: string[]; NormalisedRepoTags: string[];
@ -336,11 +332,11 @@ export class Images extends (EventEmitter as new () => ImageEventEmitter) {
} }
public async update(image: Image): Promise<void> { public async update(image: Image): Promise<void> {
image = this.format(image); const formattedImage = this.format(image);
await this.db await this.db
.models('image') .models('image')
.update(image) .update(formattedImage)
.where({ name: image.name }); .where({ name: formattedImage.name });
} }
public async save(image: Image): Promise<void> { public async save(image: Image): Promise<void> {
@ -577,17 +573,17 @@ export class Images extends (EventEmitter as new () => ImageEventEmitter) {
} }
private async markAsSupervised(image: Image): Promise<void> { private async markAsSupervised(image: Image): Promise<void> {
image = this.format(image); const formattedImage = this.format(image);
// TODO: Get rid of this janky cast once the database is
// more strongly typed
await this.db.upsertModel( await this.db.upsertModel(
'image', 'image',
image, formattedImage,
(image as unknown) as Dictionary<unknown>, // TODO: Upsert to new values only when they already match? This is likely a bug
// and currently acts like an "insert if not exists"
formattedImage,
); );
} }
private format(image: MaybeImage): Image { private format(image: Image): Omit<Image, 'id'> {
return _(image) return _(image)
.defaults({ .defaults({
serviceId: null, serviceId: null,
@ -598,7 +594,7 @@ export class Images extends (EventEmitter as new () => ImageEventEmitter) {
dockerImageId: null, dockerImageId: null,
}) })
.omit('id') .omit('id')
.value() as Image; .value();
} }
private async fetchDelta( private async fetchDelta(

View File

@ -47,7 +47,7 @@ export class DB {
public upsertModel( public upsertModel(
modelName: string, modelName: string,
obj: any, obj: any,
id: number | Dictionary<unknown>, id: Dictionary<unknown>,
trx?: Knex.Transaction, trx?: Knex.Transaction,
): Bluebird<any> { ): Bluebird<any> {
const knex = trx || this.knex; const knex = trx || this.knex;

View File

@ -27,9 +27,16 @@ export function createV2Api(router: Router, applications: ApplicationManager) {
res: Response, res: Response,
next: NextFunction, next: NextFunction,
action: any, action: any,
): Bluebird<void> => { ): Resolvable<void> => {
const { imageId, serviceName, force } = req.body; const { imageId, serviceName, force } = req.body;
const { appId } = req.params; const appId = checkInt(req.params.appId);
if (!appId) {
res.status(400).json({
status: 'failed',
message: 'Missing app id',
});
return;
}
return _lockingIfNecessary(appId, { force }, () => { return _lockingIfNecessary(appId, { force }, () => {
return applications return applications
@ -120,7 +127,13 @@ export function createV2Api(router: Router, applications: ApplicationManager) {
'/v2/applications/:appId/restart', '/v2/applications/:appId/restart',
(req: Request, res: Response, next: NextFunction) => { (req: Request, res: Response, next: NextFunction) => {
const { force } = req.body; const { force } = req.body;
const { appId } = req.params; const appId = checkInt(req.params.appId);
if (!appId) {
return res.status(400).json({
status: 'failed',
message: 'Missing app id',
});
}
return doRestart(applications, appId, force) return doRestart(applications, appId, force)
.then(() => { .then(() => {

View File

@ -1,6 +1,7 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
import { inspect } from 'util'; import { inspect } from 'util';
import { TargetState } from '../types/state';
import { EnvVarObject, LabelObject } from './types'; import { EnvVarObject, LabelObject } from './types';
import log from './supervisor-console'; import log from './supervisor-console';
@ -206,7 +207,7 @@ function undefinedOrValidEnv(val: EnvVarObject): boolean {
* *
* TODO: Type the input * TODO: Type the input
*/ */
export function isValidDependentAppsObject(apps: any): boolean { export function isValidDependentAppsObject(apps: unknown): boolean {
if (!_.isObject(apps)) { if (!_.isObject(apps)) {
log.debug( log.debug(
'Non-object passed to validation.isValidDependentAppsObject\nApps:', 'Non-object passed to validation.isValidDependentAppsObject\nApps:',
@ -215,8 +216,8 @@ export function isValidDependentAppsObject(apps: any): boolean {
return false; return false;
} }
return _.every(apps, (val, appId) => { return _.every(apps, (v, appId) => {
val = _.defaults(_.clone(val), { const val: TargetState['dependent']['apps'][any] = _.defaults(_.clone(v), {
config: undefined, config: undefined,
environment: undefined, environment: undefined,
commit: undefined, commit: undefined,
@ -366,7 +367,7 @@ export function isValidAppsObject(obj: any): boolean {
return false; return false;
} }
return _.every(obj, (val, appId) => { return _.every(obj, (v, appId) => {
if (!isValidShortText(appId) || !checkInt(appId)) { if (!isValidShortText(appId) || !checkInt(appId)) {
log.debug( log.debug(
'Invalid appId passed to validation.isValidAppsObject\nApp ID:', 'Invalid appId passed to validation.isValidAppsObject\nApp ID:',
@ -375,7 +376,13 @@ export function isValidAppsObject(obj: any): boolean {
return false; return false;
} }
return _.conformsTo(_.defaults(_.clone(val), { releaseId: undefined }), { // TODO: Remove this partial and validate the extra fields
const val: Partial<TargetState['local']['apps'][any]> = _.defaults(
_.clone(v),
{ releaseId: undefined },
);
return _.conformsTo(val, {
name: (n: any) => { name: (n: any) => {
if (!isValidShortText(n)) { if (!isValidShortText(n)) {
log.debug( log.debug(
@ -443,7 +450,7 @@ export function isValidDependentDevicesObject(devices: any): boolean {
return false; return false;
} }
return _.conformsTo(val, { return _.conformsTo(val as TargetState['dependent']['devices'][any], {
name: (n: any) => { name: (n: any) => {
if (!isValidShortText(n)) { if (!isValidShortText(n)) {
log.debug( log.debug(
@ -470,34 +477,37 @@ export function isValidDependentDevicesObject(devices: any): boolean {
return false; return false;
} }
return _.every(a, app => { return _.every(
app = _.defaults(_.clone(app), { a as TargetState['dependent']['devices'][any]['apps'],
config: undefined, app => {
environment: undefined, app = _.defaults(_.clone(app), {
}); config: undefined,
return _.conformsTo(app, { environment: undefined,
config: (c: any) => { });
if (!undefinedOrValidEnv(c)) { return _.conformsTo(app, {
log.debug( config: (c: any) => {
'Invalid config passed to validation.isValidDependentDevicesObject\nConfig:', if (!undefinedOrValidEnv(c)) {
inspect(c), log.debug(
); 'Invalid config passed to validation.isValidDependentDevicesObject\nConfig:',
return false; inspect(c),
} );
return true; return false;
}, }
environment: (e: any) => { return true;
if (!undefinedOrValidEnv(e)) { },
log.debug( environment: (e: any) => {
'Invalid environment passed to validation.isValidDependentDevicesObject\nConfig:', if (!undefinedOrValidEnv(e)) {
inspect(e), log.debug(
); 'Invalid environment passed to validation.isValidDependentDevicesObject\nConfig:',
return false; inspect(e),
} );
return true; return false;
}, }
}); return true;
}); },
});
},
);
}, },
}); });
}); });

View File

@ -86,9 +86,7 @@ export const startConnectivityCheck = _.once(
interval: 10 * 1000, interval: 10 * 1000,
}, },
connected => { connected => {
if (_.isFunction(onChangeCallback)) { onChangeCallback?.(connected);
onChangeCallback(connected);
}
if (connected) { if (connected) {
log.info('Internet Connectivity: OK'); log.info('Internet Connectivity: OK');
blink.pattern.stop(); blink.pattern.stop();

View File

@ -1,6 +1,7 @@
import { ComposeNetworkConfig } from '../compose/types/network'; import { ComposeNetworkConfig } from '../compose/types/network';
import { ServiceComposeConfig } from '../compose/types/service'; import { ServiceComposeConfig } from '../compose/types/service';
import { ComposeVolumeConfig } from '../compose/volume'; import { ComposeVolumeConfig } from '../compose/volume';
import { EnvVarObject, LabelObject } from '../lib/types';
export interface DeviceApplicationState { export interface DeviceApplicationState {
local?: { local?: {
@ -27,7 +28,7 @@ export interface DeviceApplicationState {
export interface TargetState { export interface TargetState {
local: { local: {
name: string; name: string;
config: Dictionary<string>; config: EnvVarObject;
apps: { apps: {
[appId: string]: { [appId: string]: {
name: string; name: string;
@ -35,12 +36,12 @@ export interface TargetState {
releaseId: number; releaseId: number;
services: { services: {
[serviceId: string]: { [serviceId: string]: {
labels: Dictionary<string>; labels: LabelObject;
imageId: number; imageId: number;
serviceName: string; serviceName: string;
image: string; image: string;
running: boolean; running: boolean;
environment: Dictionary<string>; environment: EnvVarObject;
} & ServiceComposeConfig; } & ServiceComposeConfig;
}; };
volumes: Dictionary<Partial<ComposeVolumeConfig>>; volumes: Dictionary<Partial<ComposeVolumeConfig>>;
@ -50,7 +51,22 @@ export interface TargetState {
}; };
// TODO: Correctly type this once dependent devices are // TODO: Correctly type this once dependent devices are
// actually properly supported // actually properly supported
dependent: Dictionary<any>; dependent: {
apps: Dictionary<{
name?: string;
image?: string;
commit?: string;
config?: EnvVarObject;
environment?: EnvVarObject;
}>;
devices: Dictionary<{
name?: string;
apps?: Dictionary<{
config?: EnvVarObject;
environment?: EnvVarObject;
}>;
}>;
};
} }
export type LocalTargetState = TargetState['local']; export type LocalTargetState = TargetState['local'];

1
typings/global.d.ts vendored
View File

@ -5,3 +5,4 @@ interface Dictionary<T> {
type Callback<T> = (err?: Error, res?: T) => void; type Callback<T> = (err?: Error, res?: T) => void;
type Nullable<T> = T | null | undefined; type Nullable<T> = T | null | undefined;
type Resolvable<T> = T | Promise<T>;