diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 926e24fbd..6c000a22b 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2129,14 +2129,15 @@ "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" }, "@particle/device-constants": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@particle/device-constants/-/device-constants-1.3.0.tgz", - "integrity": "sha512-OI7K5yEsN8R/ommsM0IiFfQSEN0NhPFelQGLKIQ+yNXUVvEsZOW18QdZirLreKIheIrqsZOhuqppDp0orykL6g==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@particle/device-constants/-/device-constants-1.5.0.tgz", + "integrity": "sha512-0bTXbp2hSJQPxYT1/jxQ4hNsHftIllAPMZ6UvTh7htmEaQuL6tze/vPNaInV2/7afwGE/vCRMe/D8q6YcXWUgw==" }, "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=", + "optional": true }, "@protobufjs/base64": { "version": "1.1.2", @@ -2175,7 +2176,8 @@ "@protobufjs/inquire": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=", + "optional": true }, "@protobufjs/path": { "version": "1.1.2", @@ -2199,6 +2201,7 @@ "version": "8.0.4", "resolved": "https://registry.npmjs.org/@serialport/binding-abstract/-/binding-abstract-8.0.4.tgz", "integrity": "sha512-1/CWzAk0tIlaf+WkTYD9YogUi6RGurNSV78cHlpkwsJeLY7z3i1rtwapspV5lIziGT/UJPj8pNVcXrv3K2uKZQ==", + "optional": true, "requires": { "debug": "^4.1.1" }, @@ -2207,6 +2210,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "optional": true, "requires": { "ms": "^2.1.1" } @@ -2214,7 +2218,8 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "optional": true } } }, @@ -2222,6 +2227,7 @@ "version": "8.0.4", "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-8.0.4.tgz", "integrity": "sha512-n6XGkZQaEOZk+wvxKSCNwv9wopS3faD1nf97FJJwJXZdtKk7h2XFtScfrol3bBfHanDMLjwx8oLgs29Jtlxmwg==", + "optional": true, "requires": { "@serialport/binding-abstract": "^8.0.4", "debug": "^4.1.1" @@ -2231,6 +2237,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "optional": true, "requires": { "ms": "^2.1.1" } @@ -2238,7 +2245,8 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "optional": true } } }, @@ -2294,12 +2302,14 @@ "@serialport/parser-delimiter": { "version": "8.0.4", "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-8.0.4.tgz", - "integrity": "sha512-4XkOQD2uj7jj4q4CltAM74Rk3HNwCk8pqrgvfAtouA3Pmt0AdrC/n9OrpRY13ioZwv+Yjc54HWU2z9VOOGn45Q==" + "integrity": "sha512-4XkOQD2uj7jj4q4CltAM74Rk3HNwCk8pqrgvfAtouA3Pmt0AdrC/n9OrpRY13ioZwv+Yjc54HWU2z9VOOGn45Q==", + "optional": true }, "@serialport/parser-readline": { "version": "8.0.4", "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-8.0.4.tgz", "integrity": "sha512-STs0WnGKLBwlXbG3CnTiI+kuWxmHBzwcslrWA2su9G5pPYQJpKGCHs2URLDDhYKmGZtzTftCJXEXABpsTXfNxQ==", + "optional": true, "requires": { "@serialport/parser-delimiter": "^8.0.4" } @@ -3331,7 +3341,8 @@ "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "optional": true }, "convert-source-map": { "version": "1.6.0", @@ -4865,7 +4876,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -4886,12 +4898,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4906,17 +4920,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -5033,7 +5050,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -5045,6 +5063,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5059,6 +5078,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5066,12 +5086,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -5090,6 +5112,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -5170,7 +5193,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -5182,6 +5206,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -5267,7 +5292,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -5303,6 +5329,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5322,6 +5349,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -5365,12 +5393,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, diff --git a/package.json b/package.json index 2ec218ed8..48800c9dc 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ } ], "dependencies": { - "@particle/device-constants": "^1.3.0", + "@particle/device-constants": "^1.5.0", "binary-version-reader": "^1.1.1", "chalk": "^2.4.2", "cli-spinner": "^0.2.10", diff --git a/src/cmd/constants.js b/src/cmd/constants.js index 14862a4eb..2a4ba4efc 100644 --- a/src/cmd/constants.js +++ b/src/cmd/constants.js @@ -1,22 +1,14 @@ +const deviceConstants = require('@particle/device-constants'); + + module.exports.MAX_FILE_SIZE = 1024 * 1024 * 2; -module.exports.platformsById = { - 0: 'Core', - 6: 'Photon', - 8: 'P1', - 10: 'Electron', - 12: 'Argon', - 13: 'Boron', - 14: 'Xenon', - 22: 'A SoM', - 23: 'B SoM', - 24: 'X SoM', - 25: 'B5 SoM', - 26: 'Asset Tracker', - 31: 'Raspberry Pi', - 88: 'Duo', - 103: 'Bluz' -}; +module.exports.platformsById = Object.values(deviceConstants) + .filter(p => p.public) + .reduce((out, p) => { + out[p.id] = p.displayName; + return out; + }, {}); module.exports.notSourceExtensions = [ '.ds_store', diff --git a/src/lib/device-specs.test.js b/src/lib/device-specs.test.js index 733324a6a..72604e3c8 100644 --- a/src/lib/device-specs.test.js +++ b/src/lib/device-specs.test.js @@ -16,6 +16,7 @@ describe('Device Specs', () => { 'argon', 'boron', 'xenon', + 'esomx', 'bsom', 'b5som', 'tracker', @@ -71,7 +72,7 @@ describe('Device Specs', () => { describe('knownApps', () => { it('includes `tinker` in `known apps` for offical platforms', async () => { - const unsupported = ['Asset Tracker', 'P2']; + const unsupported = ['Asset Tracker', 'P2', 'E SoM X']; for (const specs of Object.values(deviceSpecs)){ const { productName, knownApps } = specs; diff --git a/src/lib/utilities.test.js b/src/lib/utilities.test.js index e85cad64d..cf36f4164 100644 --- a/src/lib/utilities.test.js +++ b/src/lib/utilities.test.js @@ -13,6 +13,7 @@ describe('Utilities', () => { 'argon': 12, 'boron': 13, 'xenon': 14, + 'esomx': 15, 'asom': 22, 'bsom': 23, 'xsom': 24, @@ -37,6 +38,7 @@ describe('Utilities', () => { 12: 'Argon', 13: 'Boron', 14: 'Xenon', + 15: 'E SoM X', 22: 'A SoM', 23: 'B SoM', 24: 'X SoM',