From 2bf7b8164514dc5a90a028f1326cb55504cde9fb Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Mon, 16 Sep 2024 10:50:48 -0400 Subject: [PATCH 01/34] Bump balena-sdk to 20.3.0 Change-type: patch --- npm-shrinkwrap.json | 523 +++++++++++++++++++++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 490 insertions(+), 35 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 2c91a0253..75c5fb66d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -21,7 +21,7 @@ "balena-errors": "^4.7.3", "balena-image-fs": "^7.0.6", "balena-preload": "^15.0.6", - "balena-sdk": "^19.7.3", + "balena-sdk": "^20.3.0", "balena-semver": "^2.3.0", "balena-settings-client": "^5.0.2", "balena-settings-storage": "^8.1.0", @@ -1398,6 +1398,50 @@ "node": ">=6.9.0" } }, + "node_modules/@balena/abstract-sql-compiler": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@balena/abstract-sql-compiler/-/abstract-sql-compiler-9.2.0.tgz", + "integrity": "sha512-sKSbGNcL19QvqUrslms/k8GsVWjq75g0b8uVh/jpZEUWHniixWq402b+OKs0wRIhtRMsWSVA3CLuC33tYj6KCA==", + "dependencies": { + "@balena/sbvr-types": "^7.0.1", + "lodash": "^4.17.21" + }, + "engines": { + "node": ">=16.13.0", + "npm": ">=8.1.0" + } + }, + "node_modules/@balena/abstract-sql-compiler/node_modules/@balena/sbvr-types": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@balena/sbvr-types/-/sbvr-types-7.1.3.tgz", + "integrity": "sha512-kizk+ClfYJVJidMx69BiFSFqtDE97R4JXRYrn1Ff/vK+ycN7Mj3HVObFk5DvckresiBI9S2mvZsysW+RVNmJsg==", + "license": "BSD", + "engines": { + "node": ">=16.13.0", + "npm": ">=8.1.0" + }, + "optionalDependencies": { + "bcrypt": "^5.1.1", + "bcryptjs": "^2.4.3", + "sha.js": "^2.4.11" + } + }, + "node_modules/@balena/abstract-sql-to-typescript": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@balena/abstract-sql-to-typescript/-/abstract-sql-to-typescript-3.3.1.tgz", + "integrity": "sha512-0I96tPXwznhNagnnD7rzE+0lb3O2cEmKPBbaktXn6hFZmrKmzG1lgNpc4czfCbrVtOsk+jReWx4wXPnxcu1yXA==", + "dependencies": { + "@balena/abstract-sql-compiler": "^9.2.0", + "@balena/odata-to-abstract-sql": "^6.2.7", + "@balena/sbvr-types": "^8.0.0", + "@types/node": "^20.14.8", + "common-tags": "^1.8.2" + }, + "engines": { + "node": ">=16.13.0", + "npm": ">=8.1.0" + } + }, "node_modules/@balena/apple-plist": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/@balena/apple-plist/-/apple-plist-0.0.3.tgz", @@ -1664,6 +1708,51 @@ "web-streams-polyfill": "^3.1.0" } }, + "node_modules/@balena/odata-parser": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@balena/odata-parser/-/odata-parser-3.0.8.tgz", + "integrity": "sha512-EhC7uYZUTIeoBPSAHRfL2tz4H2pfe9vO9U4jf/84NVnh6GKApA8Gfo4QQWwL/SHuz+KJI0LkhjU9yNqKCPE0kg==", + "license": "BSD", + "engines": { + "node": ">=16.13.0", + "npm": ">=8.1.0" + } + }, + "node_modules/@balena/odata-to-abstract-sql": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@balena/odata-to-abstract-sql/-/odata-to-abstract-sql-6.3.0.tgz", + "integrity": "sha512-T5GDWjDsl2vtPL3LFN59b/JuKbX48frdkeQ6QbQPiWUDQLltTp4piQFAxP6SMpXe/QdWsV9kbNN5yBdTm4PfwQ==", + "license": "BSD", + "dependencies": { + "@balena/abstract-sql-compiler": "^9.2.0", + "@balena/odata-parser": "^3.0.8", + "@types/lodash": "^4.17.7", + "@types/memoizee": "^0.4.11", + "@types/string-hash": "^1.1.3", + "lodash": "^4.17.21", + "memoizee": "^0.4.17", + "string-hash": "^1.1.3" + }, + "engines": { + "node": ">=16.13.0", + "npm": ">=8.1.0" + } + }, + "node_modules/@balena/sbvr-types": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@balena/sbvr-types/-/sbvr-types-8.0.0.tgz", + "integrity": "sha512-SDvbHOkav+rh9ahNSz6hYKGygK6r2pF8+sTRJ7fLhG4wT5LGmU+BZjjyf/bbuvihcW1fX/vm5WGbyXkFDsG/Qw==", + "license": "BSD", + "engines": { + "node": ">=16.13.0", + "npm": ">=8.1.0" + }, + "optionalDependencies": { + "bcrypt": "^5.1.1", + "bcryptjs": "^2.4.3", + "sha.js": "^2.4.11" + } + }, "node_modules/@balena/udif": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@balena/udif/-/udif-1.1.2.tgz", @@ -2237,6 +2326,103 @@ "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==" }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "license": "BSD-3-Clause", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3687,9 +3873,16 @@ } }, "node_modules/@types/lodash": { - "version": "4.17.6", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.6.tgz", - "integrity": "sha512-OpXEVoCKSS3lQqjx9GGGOapBeuW5eUboYHRlHP9urXPX25IKZ6AnP5ZRxtVf63iieUbsHxLn8NQ5Nlftc6yzAA==" + "version": "4.17.7", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.7.tgz", + "integrity": "sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==", + "license": "MIT" + }, + "node_modules/@types/memoizee": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/@types/memoizee/-/memoizee-0.4.11.tgz", + "integrity": "sha512-2gyorIBZu8GoDr9pYjROkxWWcFtHCquF7TVbN2I+/OvgZhnIGQS0vX5KJz4lXNKb8XOSfxFOSG5OLru1ESqLUg==", + "license": "MIT" }, "node_modules/@types/mime": { "version": "3.0.4", @@ -3958,6 +4151,12 @@ "@types/node": "*" } }, + "node_modules/@types/string-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/string-hash/-/string-hash-1.1.3.tgz", + "integrity": "sha512-p6skq756fJWiA59g2Uss+cMl6tpoDGuCBuxG0SI1t0NwJmYOU66LAMS6QiCgu7cUh3/hYCaMl5phcCW1JP5wOA==", + "license": "MIT" + }, "node_modules/@types/tar-stream": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/@types/tar-stream/-/tar-stream-2.2.2.tgz", @@ -4442,6 +4641,13 @@ "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==" }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC", + "optional": true + }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -5338,6 +5544,58 @@ "node": ">=18" } }, + "node_modules/balena-preload/node_modules/@types/node": { + "version": "18.19.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.50.tgz", + "integrity": "sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==", + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/balena-preload/node_modules/balena-sdk": { + "version": "19.10.0", + "resolved": "https://registry.npmjs.org/balena-sdk/-/balena-sdk-19.10.0.tgz", + "integrity": "sha512-9q+NzwTJgiTp6ucFA5wqbsqKQS0lFhFYsjGPyqkdQhjciPX7SyhUHlurHUsesDKhFbY0waFLelSIP5sKpN7z4Q==", + "license": "Apache-2.0", + "dependencies": { + "@balena/es-version": "^1.0.0", + "@types/json-schema": "^7.0.9", + "@types/node": "^18.0.0", + "abortcontroller-polyfill": "^1.7.1", + "balena-auth": "^6.0.1", + "balena-errors": "^4.9.0", + "balena-hup-action-utils": "~6.1.0", + "balena-register-device": "^9.0.2", + "balena-request": "^13.3.2", + "balena-semver": "^2.3.0", + "balena-settings-client": "^5.0.0", + "date-fns": "^3.0.5", + "handlebars": "^4.7.7", + "lodash": "^4.17.21", + "memoizee": "^0.4.15", + "mime": "^3.0.0", + "ndjson": "^2.0.0", + "p-throttle": "^4.1.1", + "pinejs-client-core": "~6.14.0", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=18.0" + } + }, + "node_modules/balena-preload/node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/balena-register-device": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/balena-register-device/-/balena-register-device-9.0.2.tgz", @@ -5380,13 +5638,13 @@ } }, "node_modules/balena-sdk": { - "version": "19.7.3", - "resolved": "https://registry.npmjs.org/balena-sdk/-/balena-sdk-19.7.3.tgz", - "integrity": "sha512-O7c+ZVZVSGOlECvkLvi1DWwbKb7bM3UgPaRlCfld0cOcp6X9S+6fcLt9ewOOhF3YsxrBksYOSYBnrmkW9VxqLQ==", + "version": "20.3.0", + "resolved": "https://registry.npmjs.org/balena-sdk/-/balena-sdk-20.3.0.tgz", + "integrity": "sha512-HN8sDLf3Jbl2UrI9UE0zFRf07XRcUh2VLsxsuZYGOi0LQ7aJ8FB6F0DRsPQIDLMuvzz18lnztvpEmgzvTE/P1A==", "dependencies": { "@balena/es-version": "^1.0.0", "@types/json-schema": "^7.0.9", - "@types/node": "^18.0.0", + "@types/node": "^18.19.50", "abortcontroller-polyfill": "^1.7.1", "balena-auth": "^6.0.1", "balena-errors": "^4.9.0", @@ -5402,7 +5660,7 @@ "mime": "^3.0.0", "ndjson": "^2.0.0", "p-throttle": "^4.1.1", - "pinejs-client-core": "~6.14.0", + "pinejs-client-core": "^6.15.0", "tslib": "^2.1.0" }, "engines": { @@ -5430,6 +5688,20 @@ "node": ">=10.0.0" } }, + "node_modules/balena-sdk/node_modules/pinejs-client-core": { + "version": "6.15.11", + "resolved": "https://registry.npmjs.org/pinejs-client-core/-/pinejs-client-core-6.15.11.tgz", + "integrity": "sha512-EUhXx+UpyKJnkw7E5Y5fEwYMNx6SstBJdE21Rwsvs783oXPeoQ1Gmo1Lh5Ct67YaDQLoA6Dab4KoqycwrZPGSA==", + "license": "MIT", + "dependencies": { + "@balena/abstract-sql-to-typescript": "^3.2.3", + "@balena/es-version": "^1.0.3" + }, + "engines": { + "node": ">=10.0.0", + "npm": ">=6.0.0" + } + }, "node_modules/balena-semver": { "version": "2.3.5", "resolved": "https://registry.npmjs.org/balena-semver/-/balena-semver-2.3.5.tgz", @@ -5499,6 +5771,21 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, + "node_modules/bcrypt": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.1.1.tgz", + "integrity": "sha512-AGBHOG5hPYZ5Xl9KXzU5iKq9516yEmvCKDg3ecP5kX2aB6UqTeXZxk2ELnDgDm6BQSMlLt9rDB4LoSMx0rYwww==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.11", + "node-addon-api": "^5.0.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -5507,6 +5794,20 @@ "tweetnacl": "^0.14.3" } }, + "node_modules/bcrypt/node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "license": "MIT", + "optional": true + }, + "node_modules/bcryptjs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", + "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==", + "license": "MIT", + "optional": true + }, "node_modules/binary": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", @@ -6283,6 +6584,16 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "optional": true, + "bin": { + "color-support": "bin.js" + } + }, "node_modules/colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -6852,12 +7163,16 @@ } }, "node_modules/d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz", + "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==", + "license": "ISC", "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" + "es5-ext": "^0.10.64", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.12" } }, "node_modules/dashdash": { @@ -8125,12 +8440,6 @@ "node": ">=0.10" } }, - "node_modules/esniff/node_modules/type": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", - "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", - "license": "ISC" - }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -8515,12 +8824,6 @@ "type": "^2.7.2" } }, - "node_modules/ext/node_modules/type": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", - "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", - "license": "ISC" - }, "node_modules/ext2fs": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/ext2fs/-/ext2fs-4.2.1.tgz", @@ -9152,6 +9455,32 @@ "node": ">=14.14" } }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -12020,18 +12349,22 @@ } }, "node_modules/memoizee": { - "version": "0.4.15", - "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", - "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==", + "version": "0.4.17", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.17.tgz", + "integrity": "sha512-DGqD7Hjpi/1or4F/aYAspXKNm5Yili0QDAFAY4QYvpqpgiY6+1jOfqpmByzjxbWd/T9mChbCArXAbDAsTm5oXA==", + "license": "ISC", "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.53", + "d": "^1.0.2", + "es5-ext": "^0.10.64", "es6-weak-map": "^2.0.3", "event-emitter": "^0.3.5", "is-promise": "^2.2.2", "lru-queue": "^0.1.0", "next-tick": "^1.1.0", "timers-ext": "^0.1.7" + }, + "engines": { + "node": ">=0.12" } }, "node_modules/merge-descriptors": { @@ -12147,6 +12480,33 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", + "optional": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/mkdirp": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", @@ -12827,6 +13187,22 @@ "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/normalize-package-data": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.2.tgz", @@ -15456,6 +15832,20 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "license": "(MIT AND BSD-3-Clause)", + "optional": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, "node_modules/shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -15996,6 +16386,12 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/string-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", + "integrity": "sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==", + "license": "CC0-1.0" + }, "node_modules/string-to-stream": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/string-to-stream/-/string-to-stream-3.0.1.tgz", @@ -16300,6 +16696,24 @@ "node": ">= 0.4.0" } }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", + "optional": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/tar-fs": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", @@ -16348,6 +16762,39 @@ "tar-stream": "^2.1.3" } }, + "node_modules/tar/node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "optional": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "optional": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/temp": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/temp/-/temp-0.6.0.tgz", @@ -16677,9 +17124,10 @@ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, "node_modules/type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", + "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", + "license": "ISC" }, "node_modules/type-check": { "version": "0.4.0", @@ -17541,6 +17989,13 @@ "node": ">=10" } }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", + "optional": true + }, "node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", diff --git a/package.json b/package.json index 0676a1648..c86b92e98 100644 --- a/package.json +++ b/package.json @@ -200,7 +200,7 @@ "balena-errors": "^4.7.3", "balena-image-fs": "^7.0.6", "balena-preload": "^15.0.6", - "balena-sdk": "^19.7.3", + "balena-sdk": "^20.3.0", "balena-semver": "^2.3.0", "balena-settings-client": "^5.0.2", "balena-settings-storage": "^8.1.0", From 2b656c23b3b0653c193210c255f0bcb1da8ce1de Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 17 Sep 2024 11:10:41 -0400 Subject: [PATCH 02/34] Update `@balena/compose` to 5.0.0 Change-type: patch --- npm-shrinkwrap.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 75c5fb66d..8067a8de0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@balena/compose": "^4.0.1", + "@balena/compose": "^5.0.0", "@balena/dockerignore": "^1.0.2", "@balena/env-parsing": "^1.1.8", "@balena/es-version": "^1.0.1", @@ -1454,9 +1454,9 @@ } }, "node_modules/@balena/compose": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@balena/compose/-/compose-4.0.1.tgz", - "integrity": "sha512-yUaML0V58nl7/3xbCJ5eDJyGMWL8H+iPHD6Fc4GkLco5kFMiySkvlGy7+7cJoBa/p2+7GggQO0vCaOKpI7+GJQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@balena/compose/-/compose-5.0.0.tgz", + "integrity": "sha512-jfp08uSw999cGX8v7tuO6cYD99Ge6yq1cIow1EvmRtKQ8PTkeUh5rxUbaMyUN8/meDnqlyAYpXgwwNUuuePKGQ==", "dependencies": { "ajv": "^6.12.3", "docker-file-parser": "^1.0.7", diff --git a/package.json b/package.json index c86b92e98..48611875c 100644 --- a/package.json +++ b/package.json @@ -189,7 +189,7 @@ "typescript": "^5.6.2" }, "dependencies": { - "@balena/compose": "^4.0.1", + "@balena/compose": "^5.0.0", "@balena/dockerignore": "^1.0.2", "@balena/env-parsing": "^1.1.8", "@balena/es-version": "^1.0.1", From 19be0fec1a99ae0076abc65cf40fb8c8168af734 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Mon, 16 Sep 2024 11:26:20 -0400 Subject: [PATCH 03/34] Replace device `should_be_running__release` with `is_pinned_on__release` --- src/commands/device/pin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/device/pin.ts b/src/commands/device/pin.ts index dae13ddf5..cbe896ded 100644 --- a/src/commands/device/pin.ts +++ b/src/commands/device/pin.ts @@ -56,7 +56,7 @@ export default class DevicePinCmd extends Command { const device = await balena.models.device.get(params.uuid, { $expand: { - should_be_running__release: { + is_pinned_on__release: { $select: 'commit', }, belongs_to__application: { @@ -66,7 +66,7 @@ export default class DevicePinCmd extends Command { }); const pinnedRelease = getExpandedProp( - device.should_be_running__release, + device.is_pinned_on__release, 'commit', ); const appSlug = getExpandedProp(device.belongs_to__application, 'slug'); From 61af57acc92169df7271219454aa5a4e95a0fb95 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 17 Sep 2024 07:11:05 -0400 Subject: [PATCH 04/34] Update `release.contract` type from `string` to `JsonType` --- src/utils/compose.ts | 2 +- src/utils/compose_ts.ts | 6 ++++-- src/utils/config.ts | 3 +-- src/utils/device/api.ts | 2 +- src/utils/device/deploy.ts | 1 + tests/commands/deploy.spec.ts | 16 ++++++++++------ 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/utils/compose.ts b/src/utils/compose.ts index ccbec3e26..d1c0178d9 100644 --- a/src/utils/compose.ts +++ b/src/utils/compose.ts @@ -127,7 +127,7 @@ export const createRelease = async function ( composition: Composition, draft: boolean, semver: string | undefined, - contract: string | undefined, + contract: import('@balena/compose/dist/release/models').ReleaseModel['contract'], ): Promise { const _ = require('lodash') as typeof import('lodash'); const crypto = require('crypto') as typeof import('crypto'); diff --git a/src/utils/compose_ts.ts b/src/utils/compose_ts.ts index 75b643332..bd021ebcf 100644 --- a/src/utils/compose_ts.ts +++ b/src/utils/compose_ts.ts @@ -1404,7 +1404,7 @@ export async function deployProject( composition, isDraft, contract?.version, - contract ? JSON.stringify(contract) : undefined, + contract, ), ); const { client: pineClient, release, serviceImages } = $release; @@ -1500,7 +1500,9 @@ export function createRunLoop(tick: (...args: any[]) => void) { async function getContractContent( filePath: string, -): Promise | undefined> { +): Promise< + import('@balena/compose/dist/release/models').ReleaseModel['contract'] +> { let fileContentAsString; try { fileContentAsString = await fs.readFile(filePath, 'utf8'); diff --git a/src/utils/config.ts b/src/utils/config.ts index 519482252..e3a91676f 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -208,9 +208,8 @@ export async function validateSecureBootOptionAndWarn( throw new ExpectedError(`Error: No ${version} release for ${slug}`); } - const contract = osRelease.contract ? JSON.parse(osRelease.contract) : null; if ( - contract?.provides.some((entry: Dictionary) => { + osRelease.contract?.provides.some((entry: Dictionary) => { return entry.type === 'sw.feature' && entry.slug === 'secureboot'; }) ) { diff --git a/src/utils/device/api.ts b/src/utils/device/api.ts index 7687ed255..0cf79a4a0 100644 --- a/src/utils/device/api.ts +++ b/src/utils/device/api.ts @@ -93,7 +93,7 @@ export class DeviceAPI { ); } - public async getTargetState(): Promise { + public async getTargetState() { const url = this.getUrlForAction('getTargetState'); return DeviceAPI.promisifiedRequest( diff --git a/src/utils/device/deploy.ts b/src/utils/device/deploy.ts index 9ead627a8..68b9145e6 100644 --- a/src/utils/device/deploy.ts +++ b/src/utils/device/deploy.ts @@ -636,6 +636,7 @@ export function generateTargetState( services[idx] = { ...defaults, ...opts, + // TODO: is this affected by the `contract` typing change? ...(contract != null ? { contract } : {}), ...{ imageId: idx, diff --git a/tests/commands/deploy.spec.ts b/tests/commands/deploy.spec.ts index cff67b75e..4f5364c7e 100644 --- a/tests/commands/deploy.spec.ts +++ b/tests/commands/deploy.spec.ts @@ -183,9 +183,11 @@ describe('balena deploy', function () { api.expectPostRelease({ inspectRequest: (_uri: string, requestBody: nock.Body) => { const body = requestBody.valueOf() as Partial; - expect(body.contract).to.be.equal( - '{"name":"testContract","type":"sw.application","version":"1.5.2"}', - ); + expect(body.contract).to.deep.equal({ + name: 'testContract', + type: 'sw.application', + version: '1.5.2', + }); expect(body.is_final).to.be.true; }, }); @@ -232,9 +234,11 @@ describe('balena deploy', function () { api.expectPostRelease({ inspectRequest: (_uri: string, requestBody: nock.Body) => { const body = requestBody.valueOf() as Partial; - expect(body.contract).to.be.equal( - '{"name":"testContract","type":"sw.application","version":"1.5.2"}', - ); + expect(body.contract).to.deep.equal({ + name: 'testContract', + type: 'sw.application', + version: '1.5.2', + }); expect(body.semver).to.be.equal('1.5.2'); expect(body.is_final).to.be.false; }, From 37e08e4667a2042629f9cbe12e91eeb0ad9c5d53 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 17 Sep 2024 07:19:36 -0400 Subject: [PATCH 05/34] Update `actor` to use `PineDeferred` type --- src/commands/api-key/list.ts | 2 +- tests/nock/balena-api-mock.ts | 4 ++-- .../application-GET-v6-expanded-app-type-cpu-arch.json | 2 +- .../api-response/application-GET-v6-expanded-app-type.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commands/api-key/list.ts b/src/commands/api-key/list.ts index cecbcdfa2..4087e3d91 100644 --- a/src/commands/api-key/list.ts +++ b/src/commands/api-key/list.ts @@ -51,7 +51,7 @@ export default class APIKeyListCmd extends Command { await getApplication(getBalenaSdk(), options.fleet, { $select: 'actor', }) - ).actor + ).actor.__id : await getBalenaSdk().auth.getActorId(); const keys = await getBalenaSdk().pine.get({ resource: 'api_key', diff --git a/tests/nock/balena-api-mock.ts b/tests/nock/balena-api-mock.ts index add690e96..89cd0150e 100644 --- a/tests/nock/balena-api-mock.ts +++ b/tests/nock/balena-api-mock.ts @@ -416,11 +416,11 @@ export class BalenaAPIMock extends NockMock { * Mocks balena-release call */ public expectGetUser(opts: ScopeOpts = {}) { - this.optGet(/^\/v6\/user/, opts).reply(200, { + this.optGet(/^\/v7\/user/, opts).reply(200, { d: [ { id: 99999, - actor: 1234567, + actor: { __id: 1234567 }, username: 'gh_user', created_at: '2018-08-19T13:55:04.485Z', __metadata: { diff --git a/tests/test-data/api-response/application-GET-v6-expanded-app-type-cpu-arch.json b/tests/test-data/api-response/application-GET-v6-expanded-app-type-cpu-arch.json index 62fe7329d..0cee06592 100644 --- a/tests/test-data/api-response/application-GET-v6-expanded-app-type-cpu-arch.json +++ b/tests/test-data/api-response/application-GET-v6-expanded-app-type-cpu-arch.json @@ -23,7 +23,7 @@ } ], "depends_on__application": null, - "actor": 3423895, + "actor": { "__id": 3423895 }, "app_name": "testApp", "slug": "gh_user/testApp", "should_be__running_release": [ diff --git a/tests/test-data/api-response/application-GET-v6-expanded-app-type.json b/tests/test-data/api-response/application-GET-v6-expanded-app-type.json index 6708b2f18..9f6d194fc 100644 --- a/tests/test-data/api-response/application-GET-v6-expanded-app-type.json +++ b/tests/test-data/api-response/application-GET-v6-expanded-app-type.json @@ -23,7 +23,7 @@ } ], "depends_on__application": null, - "actor": 3423895, + "actor": { "__id": 3423895 }, "app_name": "testApp", "slug": "gh_user/testApp", "should_be__running_release": [ From afd14794f5d8565a9c6e4a203246a454b3de3a91 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 17 Sep 2024 07:29:41 -0400 Subject: [PATCH 06/34] git mv v6 test-data api-responses to v7 --- ...ch.json => application-GET-v7-expanded-app-type-cpu-arch.json} | 0 ...ed-app-type.json => application-GET-v7-expanded-app-type.json} | 0 .../{device-type-GET-v6.json => device-type-GET-v7.json} | 0 .../api-response/{image-POST-v6.json => image-POST-v7.json} | 0 ...release-POST-v6.json => image-is-part-of-release-POST-v7.json} | 0 .../{image-label-POST-v6.json => image-label-POST-v7.json} | 0 .../api-response/{release-GET-v6.json => release-GET-v7.json} | 0 .../api-response/{release-POST-v6.json => release-POST-v7.json} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename tests/test-data/api-response/{application-GET-v6-expanded-app-type-cpu-arch.json => application-GET-v7-expanded-app-type-cpu-arch.json} (100%) rename tests/test-data/api-response/{application-GET-v6-expanded-app-type.json => application-GET-v7-expanded-app-type.json} (100%) rename tests/test-data/api-response/{device-type-GET-v6.json => device-type-GET-v7.json} (100%) rename tests/test-data/api-response/{image-POST-v6.json => image-POST-v7.json} (100%) rename tests/test-data/api-response/{image-is-part-of-release-POST-v6.json => image-is-part-of-release-POST-v7.json} (100%) rename tests/test-data/api-response/{image-label-POST-v6.json => image-label-POST-v7.json} (100%) rename tests/test-data/api-response/{release-GET-v6.json => release-GET-v7.json} (100%) rename tests/test-data/api-response/{release-POST-v6.json => release-POST-v7.json} (100%) diff --git a/tests/test-data/api-response/application-GET-v6-expanded-app-type-cpu-arch.json b/tests/test-data/api-response/application-GET-v7-expanded-app-type-cpu-arch.json similarity index 100% rename from tests/test-data/api-response/application-GET-v6-expanded-app-type-cpu-arch.json rename to tests/test-data/api-response/application-GET-v7-expanded-app-type-cpu-arch.json diff --git a/tests/test-data/api-response/application-GET-v6-expanded-app-type.json b/tests/test-data/api-response/application-GET-v7-expanded-app-type.json similarity index 100% rename from tests/test-data/api-response/application-GET-v6-expanded-app-type.json rename to tests/test-data/api-response/application-GET-v7-expanded-app-type.json diff --git a/tests/test-data/api-response/device-type-GET-v6.json b/tests/test-data/api-response/device-type-GET-v7.json similarity index 100% rename from tests/test-data/api-response/device-type-GET-v6.json rename to tests/test-data/api-response/device-type-GET-v7.json diff --git a/tests/test-data/api-response/image-POST-v6.json b/tests/test-data/api-response/image-POST-v7.json similarity index 100% rename from tests/test-data/api-response/image-POST-v6.json rename to tests/test-data/api-response/image-POST-v7.json diff --git a/tests/test-data/api-response/image-is-part-of-release-POST-v6.json b/tests/test-data/api-response/image-is-part-of-release-POST-v7.json similarity index 100% rename from tests/test-data/api-response/image-is-part-of-release-POST-v6.json rename to tests/test-data/api-response/image-is-part-of-release-POST-v7.json diff --git a/tests/test-data/api-response/image-label-POST-v6.json b/tests/test-data/api-response/image-label-POST-v7.json similarity index 100% rename from tests/test-data/api-response/image-label-POST-v6.json rename to tests/test-data/api-response/image-label-POST-v7.json diff --git a/tests/test-data/api-response/release-GET-v6.json b/tests/test-data/api-response/release-GET-v7.json similarity index 100% rename from tests/test-data/api-response/release-GET-v6.json rename to tests/test-data/api-response/release-GET-v7.json diff --git a/tests/test-data/api-response/release-POST-v6.json b/tests/test-data/api-response/release-POST-v7.json similarity index 100% rename from tests/test-data/api-response/release-POST-v6.json rename to tests/test-data/api-response/release-POST-v7.json From f0e0c0d7280b8bec2448559d6b984033030e0419 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 17 Sep 2024 07:59:06 -0400 Subject: [PATCH 07/34] Update all API queries to use the v7 model --- src/utils/compose.ts | 3 +-- tests/commands/deploy.spec.ts | 2 +- tests/commands/device/device.spec.ts | 10 ++++---- tests/nock/balena-api-mock.ts | 38 ++++++++++++++-------------- 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/utils/compose.ts b/src/utils/compose.ts index d1c0178d9..3b38f658a 100644 --- a/src/utils/compose.ts +++ b/src/utils/compose.ts @@ -152,8 +152,7 @@ export const createRelease = async function ( }, }, { - // @balena/compose atm works with v6, bump it once @balena/compose moves to v7. - apiVersion: 'v6', + apiVersion: 'v7', }, ); diff --git a/tests/commands/deploy.spec.ts b/tests/commands/deploy.spec.ts index 4f5364c7e..27926c42e 100644 --- a/tests/commands/deploy.spec.ts +++ b/tests/commands/deploy.spec.ts @@ -388,7 +388,7 @@ describe('balena deploy', function () { let failedImagePatchRequests = 0; let succesfullImagePatchRequests = 0; api - .optPatch(/^\/v6\/image($|[(?])/, { times: maxRequestRetries }) + .optPatch(/^\/v7\/image($|[(?])/, { times: maxRequestRetries }) .reply((_uri, requestBody) => { const imageBody = requestBody as Partial< import('@balena/compose/dist/release/models').ImageModel diff --git a/tests/commands/device/device.spec.ts b/tests/commands/device/device.spec.ts index 78b3b3a81..3f283a2db 100644 --- a/tests/commands/device/device.spec.ts +++ b/tests/commands/device/device.spec.ts @@ -46,7 +46,7 @@ describe('balena device', function () { it('should list device details for provided uuid', async () => { api.scope .get( - /^\/v6\/device\?.+&\$expand=belongs_to__application\(\$select=app_name,slug\)/, + /^\/v7\/device\?.+&\$expand=belongs_to__application\(\$select=app_name,slug\)/, ) .replyWithFile(200, path.join(apiResponsePath, 'device.json'), { 'Content-Type': 'application/json', @@ -64,7 +64,7 @@ describe('balena device', function () { it.skip('correctly handles devices with missing fields', async () => { api.scope .get( - /^\/v6\/device\?.+&\$expand=belongs_to__application\(\$select=app_name,slug\)/, + /^\/v7\/device\?.+&\$expand=belongs_to__application\(\$select=app_name,slug\)/, ) .replyWithFile( 200, @@ -88,7 +88,7 @@ describe('balena device', function () { // e.g. When user has a device associated with app that user is no longer a collaborator of. api.scope .get( - /^\/v6\/device\?.+&\$expand=belongs_to__application\(\$select=app_name,slug\)/, + /^\/v7\/device\?.+&\$expand=belongs_to__application\(\$select=app_name,slug\)/, ) .replyWithFile( 200, @@ -109,7 +109,7 @@ describe('balena device', function () { it('outputs device as JSON with the -j/--json flag', async () => { api.scope - .get(/^\/v6\/device\?.+&\$expand=device_tag\(\$select=tag_key,value\)/) + .get(/^\/v7\/device\?.+&\$expand=device_tag\(\$select=tag_key,value\)/) .replyWithFile(200, path.join(apiResponsePath, 'device.json'), { 'Content-Type': 'application/json', }); @@ -125,7 +125,7 @@ describe('balena device', function () { it('should list devices from own and collaborator apps', async () => { api.scope .get( - '/v6/device?$orderby=device_name%20asc&$select=id,uuid,device_name,status,is_online,supervisor_version,os_version&$expand=belongs_to__application($select=app_name,slug),is_of__device_type($select=slug),is_running__release($select=commit)', + '/v7/device?$orderby=device_name%20asc&$select=id,uuid,device_name,status,is_online,supervisor_version,os_version&$expand=belongs_to__application($select=app_name,slug),is_of__device_type($select=slug),is_running__release($select=commit)', ) .replyWithFile(200, path.join(apiResponsePath, 'devices.json'), { 'Content-Type': 'application/json', diff --git a/tests/nock/balena-api-mock.ts b/tests/nock/balena-api-mock.ts index 89cd0150e..d0ce59b66 100644 --- a/tests/nock/balena-api-mock.ts +++ b/tests/nock/balena-api-mock.ts @@ -39,7 +39,7 @@ export class BalenaAPIMock extends NockMock { times = undefined as number | undefined, expandArchitecture = false, } = {}) { - const interceptor = this.optGet(/^\/v6\/application($|[(?])/, { + const interceptor = this.optGet(/^\/v7\/application($|[(?])/, { optional, persist, times, @@ -52,8 +52,8 @@ export class BalenaAPIMock extends NockMock { path.join( apiResponsePath, !expandArchitecture - ? 'application-GET-v6-expanded-app-type.json' - : 'application-GET-v6-expanded-app-type-cpu-arch.json', + ? 'application-GET-v7-expanded-app-type.json' + : 'application-GET-v7-expanded-app-type-cpu-arch.json', ), jHeader, ); @@ -87,7 +87,7 @@ export class BalenaAPIMock extends NockMock { } public expectGetMyApplication(opts: ScopeOpts = {}) { - this.optGet(/^\/v6\/my_application($|[(?])/, opts).reply( + this.optGet(/^\/v7\/my_application($|[(?])/, opts).reply( 200, JSON.parse(`{"d": [{ "organization": [{ "handle": "bob", "__metadata": {} }], @@ -109,7 +109,7 @@ export class BalenaAPIMock extends NockMock { persist = false, times = undefined as number | undefined, } = {}) { - const interceptor = this.optGet(/^\/v6\/release($|[(?])/, { + const interceptor = this.optGet(/^\/v7\/release($|[(?])/, { persist, optional, times, @@ -117,12 +117,12 @@ export class BalenaAPIMock extends NockMock { if (notFound) { interceptor.reply(200, { d: [] }); } else { - this.optGet(/^\/v6\/release($|[(?])/, { + this.optGet(/^\/v7\/release($|[(?])/, { persist, optional, }).replyWithFile( 200, - path.join(apiResponsePath, 'release-GET-v6.json'), + path.join(apiResponsePath, 'release-GET-v7.json'), jHeader, ); } @@ -139,7 +139,7 @@ export class BalenaAPIMock extends NockMock { persist = false, times = undefined as number | undefined, }) { - this.optPatch(/^\/v6\/release($|[(?])/, { optional, persist, times }).reply( + this.optPatch(/^\/v7\/release($|[(?])/, { optional, persist, times }).reply( statusCode, this.getInspectedReplyBodyFunction(inspectRequest, replyBody), ); @@ -155,11 +155,11 @@ export class BalenaAPIMock extends NockMock { persist = false, times = undefined as number | undefined, }) { - this.optPost(/^\/v6\/release($|[(?])/, { optional, persist, times }).reply( + this.optPost(/^\/v7\/release($|[(?])/, { optional, persist, times }).reply( statusCode, this.getInspectedReplyFileFunction( inspectRequest, - path.join(apiResponsePath, 'release-POST-v6.json'), + path.join(apiResponsePath, 'release-POST-v7.json'), ), jHeader, ); @@ -176,7 +176,7 @@ export class BalenaAPIMock extends NockMock { persist = false, times = undefined as number | undefined, }) { - this.optPatch(/^\/v6\/image($|[(?])/, { optional, persist, times }).reply( + this.optPatch(/^\/v7\/image($|[(?])/, { optional, persist, times }).reply( statusCode, this.getInspectedReplyBodyFunction(inspectRequest, replyBody), ); @@ -186,9 +186,9 @@ export class BalenaAPIMock extends NockMock { * Mocks balena-release call */ public expectPostImage(opts: ScopeOpts = {}) { - this.optPost(/^\/v6\/image($|[(?])/, opts).replyWithFile( + this.optPost(/^\/v7\/image($|[(?])/, opts).replyWithFile( 201, - path.join(apiResponsePath, 'image-POST-v6.json'), + path.join(apiResponsePath, 'image-POST-v7.json'), jHeader, ); } @@ -197,9 +197,9 @@ export class BalenaAPIMock extends NockMock { * Mocks balena-release call */ public expectPostImageLabel(opts: ScopeOpts = {}) { - this.optPost(/^\/v6\/image_label($|[(?])/, opts).replyWithFile( + this.optPost(/^\/v7\/image_label($|[(?])/, opts).replyWithFile( 201, - path.join(apiResponsePath, 'image-label-POST-v6.json'), + path.join(apiResponsePath, 'image-label-POST-v7.json'), jHeader, ); } @@ -209,11 +209,11 @@ export class BalenaAPIMock extends NockMock { */ public expectPostImageIsPartOfRelease(opts: ScopeOpts = {}) { this.optPost( - /^\/v6\/image__is_part_of__release($|[(?])/, + /^\/v7\/image__is_part_of__release($|[(?])/, opts, ).replyWithFile( 200, - path.join(apiResponsePath, 'image-is-part-of-release-POST-v6.json'), + path.join(apiResponsePath, 'image-is-part-of-release-POST-v7.json'), jHeader, ); } @@ -365,7 +365,7 @@ export class BalenaAPIMock extends NockMock { public expectGetDeviceTypes(opts: ScopeOpts = {}) { this.optGet(/^\/v\d+\/device_type($|\?)/, opts).replyWithFile( 200, - path.join(apiResponsePath, 'device-type-GET-v6.json'), + path.join(apiResponsePath, 'device-type-GET-v7.json'), jHeader, ); } @@ -404,7 +404,7 @@ export class BalenaAPIMock extends NockMock { serviceName: string; }) { const serviceId = opts.serviceId || 243768; - this.optGet(/^\/v6\/application($|\?).*\$expand=service.*/, opts).reply( + this.optGet(/^\/v7\/application($|\?).*\$expand=service.*/, opts).reply( 200, { d: [{ service: [{ id: serviceId, service_name: opts.serviceName }] }], From 56e5dafb200177c7eaf2d864837d62f14f0b783b Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 17 Sep 2024 08:02:47 -0400 Subject: [PATCH 08/34] Drop the `device.is_managed_by__device` property from test-data --- .../api-response/device-missing-app.json | 19 +++++++++---------- .../api-response/device-missing-fields.json | 1 - tests/test-data/api-response/device.json | 19 +++++++++---------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/tests/test-data/api-response/device-missing-app.json b/tests/test-data/api-response/device-missing-app.json index fca329f14..69bde5fd8 100644 --- a/tests/test-data/api-response/device-missing-app.json +++ b/tests/test-data/api-response/device-missing-app.json @@ -3,7 +3,6 @@ { "belongs_to__application": [], "id": 1747415, - "is_managed_by__device": null, "device_name": "sparkling-wood", "is_of__device_type": [{ "slug": "raspberrypi4-64" }], "uuid": "fda508c8583011b8466c26abdd5159f2", @@ -17,15 +16,15 @@ "supervisor_version": "10.3.7", "is_web_accessible": false, "overall_status": "idle", - "cpu_usage" : 34, - "cpu_temp" : 56.2, - "cpu_id" : "some cpu id", - "memory_usage" : 1000, - "memory_total" : 4000, - "storage_block_device" : "/dev/mmcblk0", - "storage_usage" : 1000, - "storage_total" : 64000, - "is_undervolted" : true, + "cpu_usage": 34, + "cpu_temp": 56.2, + "cpu_id": "some cpu id", + "memory_usage": 1000, + "memory_total": 4000, + "storage_block_device": "/dev/mmcblk0", + "storage_usage": 1000, + "storage_total": 64000, + "is_undervolted": true, "__metadata": { "uri": "/resin/device(@id)?@id=1747415" } diff --git a/tests/test-data/api-response/device-missing-fields.json b/tests/test-data/api-response/device-missing-fields.json index db57d1a3f..71995cc42 100644 --- a/tests/test-data/api-response/device-missing-fields.json +++ b/tests/test-data/api-response/device-missing-fields.json @@ -9,7 +9,6 @@ } ], "id": 1747415, - "is_managed_by__device": null, "device_name": "sparkling-wood", "is_of__device_type": [{ "slug": "raspberrypi4-64" }], "uuid": "fda508c8583011b8466c26abdd5159f2", diff --git a/tests/test-data/api-response/device.json b/tests/test-data/api-response/device.json index e6505ca55..75de86b67 100644 --- a/tests/test-data/api-response/device.json +++ b/tests/test-data/api-response/device.json @@ -15,7 +15,6 @@ } ], "id": 1747415, - "is_managed_by__device": null, "device_name": "sparkling-wood", "is_of__device_type": [{ "slug": "raspberrypi4-64" }], "uuid": "fda508c8583011b8466c26abdd5159f2", @@ -29,15 +28,15 @@ "supervisor_version": "10.3.7", "is_web_accessible": false, "overall_status": "offline", - "cpu_usage" : 34, - "cpu_temp" : 56.2, - "cpu_id" : "some cpu id", - "memory_usage" : 1000, - "memory_total" : 4000, - "storage_block_device" : "/dev/mmcblk0", - "storage_usage" : 1000, - "storage_total" : 64000, - "is_undervolted" : true, + "cpu_usage": 34, + "cpu_temp": 56.2, + "cpu_id": "some cpu id", + "memory_usage": 1000, + "memory_total": 4000, + "storage_block_device": "/dev/mmcblk0", + "storage_usage": 1000, + "storage_total": 64000, + "is_undervolted": true, "__metadata": { "uri": "/resin/device(@id)?@id=1747415" } From 1ee9a6828895856c446dd82481b15bf0a544c7a4 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 17 Sep 2024 08:10:02 -0400 Subject: [PATCH 09/34] Update device.overall_status comments with their respective replacements Changelog-entry: Rename `device.overall_status` values: `IDLE` to `OPERATIONAL`, `OFFLINE` to `DISCONNECTED`; add `REDUCED_FUNCTIONALITY` Change-type: major --- src/commands/device/restart.ts | 2 +- src/utils/patterns.ts | 6 ++++-- tests/commands/device/ssh.spec.ts | 2 +- tests/test-data/api-response/device-missing-app.json | 2 +- tests/test-data/api-response/device-missing-fields.json | 2 +- tests/test-data/api-response/device-status.json | 2 +- tests/test-data/api-response/device-types-GET-v1.json | 4 ++-- tests/test-data/api-response/device.json | 2 +- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/commands/device/restart.ts b/src/commands/device/restart.ts index 92d1d90d0..082ca041b 100644 --- a/src/commands/device/restart.ts +++ b/src/commands/device/restart.ts @@ -156,7 +156,7 @@ export default class DeviceRestartCmd extends Command { async restartAllServices(balena: BalenaSDK, deviceUuid: string) { // Note: device.restartApplication throws `BalenaDeviceNotFound: Device not found` if device not online. - // Need to use device.get first to distinguish between non-existant and offline devices. + // Need to use device.get first to distinguish between non-existant and disconnected devices. // Remove this workaround when SDK issue resolved: https://github.com/balena-io/balena-sdk/issues/649 const { instanceOf, ExpectedError } = await import('../../errors'); try { diff --git a/src/utils/patterns.ts b/src/utils/patterns.ts index 6dcbc5162..1ea2cafd3 100644 --- a/src/utils/patterns.ts +++ b/src/utils/patterns.ts @@ -319,7 +319,7 @@ export async function awaitDeviceOsUpdate( } if (osUpdateProgress !== null) { - // Avoid resetting to 0% at end of process when device goes offline. + // Avoid resetting to 0% at end of process when device goes disconnected. progressBar.update({ percentage: osUpdateProgress }); } @@ -358,7 +358,9 @@ export async function getOnlineTargetDeviceUuid( }); if (!device.is_online) { - throw new ExpectedError(`Device with UUID ${fleetOrDevice} is offline`); + throw new ExpectedError( + `Device with UUID ${fleetOrDevice} is disconnected`, + ); } return device.uuid; diff --git a/tests/commands/device/ssh.spec.ts b/tests/commands/device/ssh.spec.ts index 94534b773..0da4caf5e 100644 --- a/tests/commands/device/ssh.spec.ts +++ b/tests/commands/device/ssh.spec.ts @@ -121,7 +121,7 @@ describe('balena device ssh', function () { itSS('should fail if device not online (mocked, device UUID)', async () => { const deviceUUID = 'abc1234'; - const expectedErrLines = ['Device with UUID abc1234 is offline']; + const expectedErrLines = ['Device with UUID abc1234 is disconnected']; api.expectGetWhoAmI({ optional: true, persist: true }); api.expectGetDevice({ fullUUID: deviceUUID, isOnline: false }); mockedExitCode = 0; diff --git a/tests/test-data/api-response/device-missing-app.json b/tests/test-data/api-response/device-missing-app.json index 69bde5fd8..7a2d84116 100644 --- a/tests/test-data/api-response/device-missing-app.json +++ b/tests/test-data/api-response/device-missing-app.json @@ -15,7 +15,7 @@ "os_version": "balenaOS 2.44.0+rev3", "supervisor_version": "10.3.7", "is_web_accessible": false, - "overall_status": "idle", + "overall_status": "reduced-functionality", "cpu_usage": 34, "cpu_temp": 56.2, "cpu_id": "some cpu id", diff --git a/tests/test-data/api-response/device-missing-fields.json b/tests/test-data/api-response/device-missing-fields.json index 71995cc42..ab52e340b 100644 --- a/tests/test-data/api-response/device-missing-fields.json +++ b/tests/test-data/api-response/device-missing-fields.json @@ -21,7 +21,7 @@ "os_version": "balenaOS 2.44.0+rev3", "supervisor_version": "10.3.7", "is_web_accessible": false, - "overall_status": "offline", + "overall_status": "disconnected", "__metadata": { "uri": "/resin/device(@id)?@id=1747415" } diff --git a/tests/test-data/api-response/device-status.json b/tests/test-data/api-response/device-status.json index 643f64c84..4dff4953e 100644 --- a/tests/test-data/api-response/device-status.json +++ b/tests/test-data/api-response/device-status.json @@ -1,7 +1,7 @@ { "d": [ { - "overall_status": "offline", + "overall_status": "disconnected", "__metadata": {} } ] diff --git a/tests/test-data/api-response/device-types-GET-v1.json b/tests/test-data/api-response/device-types-GET-v1.json index ea84e934f..dd275864d 100644 --- a/tests/test-data/api-response/device-types-GET-v1.json +++ b/tests/test-data/api-response/device-types-GET-v1.json @@ -4073,7 +4073,7 @@ "state": "DISCONTINUED", "stateInstructions": { "postProvisioning": [ - "The device is performing a shutdown. Please wait until the device is offline in the dashboard and disconnect the power cable.", + "The device is performing a shutdown. Please wait until the device is disconnected in the dashboard and disconnect the power cable.", "Remove the resinOS installation media.", "Set J11 (just next to the micro SD card slot) to position 1-2 (the position closest to the edge of the board).", "Remove and re-connect power to the board." @@ -4084,7 +4084,7 @@ "Insert the freshly burnt SD card into the VIA VAB 820-quad.", "Warning! This will also completely erase internal storage media, so please make a backup first.", "Set J11 (just next to the micro SD card slot) to position 2-3 (the position furthest away from the edge of the board) and then power on the board.", - "The device is performing a shutdown. Please wait until the device is offline in the dashboard and disconnect the power cable.", + "The device is performing a shutdown. Please wait until the device is disconnected in the dashboard and disconnect the power cable.", "Remove the resinOS installation media.", "Set J11 (just next to the micro SD card slot) to position 1-2 (the position closest to the edge of the board).", "Remove and re-connect power to the board." diff --git a/tests/test-data/api-response/device.json b/tests/test-data/api-response/device.json index 75de86b67..d5c508c7d 100644 --- a/tests/test-data/api-response/device.json +++ b/tests/test-data/api-response/device.json @@ -27,7 +27,7 @@ "os_version": "balenaOS 2.44.0+rev3", "supervisor_version": "10.3.7", "is_web_accessible": false, - "overall_status": "offline", + "overall_status": "disconnected", "cpu_usage": 34, "cpu_temp": 56.2, "cpu_id": "some cpu id", From 5adc43bcbde6ce3e759493fa4eebcfff6d93f917 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 17 Sep 2024 08:20:11 -0400 Subject: [PATCH 10/34] Update `image_size` type from number to string --- docs/balena-cli.md | 6 +++--- src/commands/preload/index.ts | 8 +++++--- src/utils/compose_ts.ts | 2 +- tests/test-data/api-response/release-GET-v7.json | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index f1ac7804e..db59715cc 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -3277,9 +3277,9 @@ fleet name or slug (preferred) The commit hash of the release to preload. Use "current" to specify the current release (ignored if no appId is given). The current release is usually also the -latest, but can be pinned to a specific release. See: -https://www.balena.io/docs/learn/deploy/release-strategy/release-policy/ -https://www.balena.io/docs/learn/more/masterclasses/fleet-management/#63-pin-using-the-api +latest, but can be pinned to a specific release. See: +https://www.balena.io/docs/learn/deploy/release-strategy/release-policy/ +https://www.balena.io/docs/learn/more/masterclasses/fleet-management/#63-pin-using-the-api https://github.com/balena-io-examples/staged-releases #### -s, --splash-image SPLASH-IMAGE diff --git a/src/commands/preload/index.ts b/src/commands/preload/index.ts index cad1c7328..0d5205ca9 100644 --- a/src/commands/preload/index.ts +++ b/src/commands/preload/index.ts @@ -84,9 +84,9 @@ export default class PreloadCmd extends Command { description: `\ The commit hash of the release to preload. Use "current" to specify the current release (ignored if no appId is given). The current release is usually also the -latest, but can be pinned to a specific release. See: -https://www.balena.io/docs/learn/deploy/release-strategy/release-policy/ -https://www.balena.io/docs/learn/more/masterclasses/fleet-management/#63-pin-using-the-api +latest, but can be pinned to a specific release. See: +https://www.balena.io/docs/learn/deploy/release-strategy/release-policy/ +https://www.balena.io/docs/learn/more/masterclasses/fleet-management/#63-pin-using-the-api https://github.com/balena-io-examples/staged-releases\ `, char: 'c', @@ -413,6 +413,8 @@ Can be repeated to add multiple certificates.\ const DEFAULT_CHOICE = { name: 'current', value: 'current' }; const choices = [DEFAULT_CHOICE].concat( releases.map((release) => ({ + // TODO: [next-major] consider changing this to use the release semver + // and maybe the commit as well name: `${release.end_timestamp} - ${release.commit}`, value: release.commit, })), diff --git a/src/utils/compose_ts.ts b/src/utils/compose_ts.ts index bd021ebcf..b2fd30442 100644 --- a/src/utils/compose_ts.ts +++ b/src/utils/compose_ts.ts @@ -1292,7 +1292,7 @@ async function pushAndUpdateServiceImages( localImage.inspect(), pushImage(localImage, index), ]); - serviceImage.image_size = imgInfo.Size; + serviceImage.image_size = `${imgInfo.Size}`; serviceImage.content_hash = imgDigest; serviceImage.build_log = logs; serviceImage.dockerfile = props.dockerfile; diff --git a/tests/test-data/api-response/release-GET-v7.json b/tests/test-data/api-response/release-GET-v7.json index efae8a269..082ac77a1 100644 --- a/tests/test-data/api-response/release-GET-v7.json +++ b/tests/test-data/api-response/release-GET-v7.json @@ -28,7 +28,7 @@ }, "__id": 233455 }, - "image_size": 134320410, + "image_size": "134320410", "is_stored_at__image_location": "registry2.balena-cloud.com/v2/9c00c9413942cd15cfc9189c5dac359d", "project_type": "Standard Dockerfile", "error_message": null, From ec92f21b703e03dacc5ddf65ff0f811b18b90199 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 17 Sep 2024 08:26:17 -0400 Subject: [PATCH 11/34] Drop the no longer needed __metadata property handling --- src/utils/compose-types.d.ts | 2 +- src/utils/compose.ts | 8 +- tests/commands/release.spec.ts | 1 - tests/nock/balena-api-mock.ts | 8 +- ...ion-GET-v7-expanded-app-type-cpu-arch.json | 8 +- .../application-GET-v7-expanded-app-type.json | 8 +- .../api-response/device-missing-app.json | 5 +- .../api-response/device-missing-fields.json | 8 +- .../test-data/api-response/device-status.json | 3 +- .../api-response/device-type-GET-v7.json | 1105 +++++------------ tests/test-data/api-response/device.json | 8 +- tests/test-data/api-response/devices.json | 13 +- .../test-data/api-response/image-POST-v7.json | 7 +- .../image-is-part-of-release-POST-v7.json | 5 +- .../api-response/image-label-POST-v7.json | 7 +- .../api-response/release-GET-v7.json | 14 +- .../api-response/release-POST-v7.json | 11 +- 17 files changed, 328 insertions(+), 893 deletions(-) diff --git a/src/utils/compose-types.d.ts b/src/utils/compose-types.d.ts index ab566167d..8bd000cb2 100644 --- a/src/utils/compose-types.d.ts +++ b/src/utils/compose-types.d.ts @@ -95,7 +95,7 @@ export interface Release { | 'end_timestamp' >; serviceImages: Dictionary< - Omit + Omit >; } diff --git a/src/utils/compose.ts b/src/utils/compose.ts index 3b38f658a..1270cc913 100644 --- a/src/utils/compose.ts +++ b/src/utils/compose.ts @@ -186,13 +186,9 @@ export const createRelease = async function ( serviceImages: _.mapValues( serviceImages, (serviceImage) => - _.omit(serviceImage, [ - 'created_at', - 'is_a_build_of__service', - '__metadata', - ]) as Omit< + _.omit(serviceImage, ['created_at', 'is_a_build_of__service']) as Omit< typeof serviceImage, - 'created_at' | 'is_a_build_of__service' | '__metadata' + 'created_at' | 'is_a_build_of__service' >, ), }; diff --git a/tests/commands/release.spec.ts b/tests/commands/release.spec.ts index 7c749b6e4..1ced28ca9 100644 --- a/tests/commands/release.spec.ts +++ b/tests/commands/release.spec.ts @@ -85,6 +85,5 @@ describe('balena release', function () { expect(json[0].contains__image[0].image[0].start_timestamp).to.equal( '2020-01-04T01:13:08.583Z', ); - expect(json[0].__metadata.uri).to.equal('/resin/release(@id)?@id=142334'); }); }); diff --git a/tests/nock/balena-api-mock.ts b/tests/nock/balena-api-mock.ts index d0ce59b66..c468efbf5 100644 --- a/tests/nock/balena-api-mock.ts +++ b/tests/nock/balena-api-mock.ts @@ -90,9 +90,8 @@ export class BalenaAPIMock extends NockMock { this.optGet(/^\/v7\/my_application($|[(?])/, opts).reply( 200, JSON.parse(`{"d": [{ - "organization": [{ "handle": "bob", "__metadata": {} }], - "id": 1301645, - "__metadata": { "uri": "/resin/my_application(@id)?@id=1301645" }}]} + "organization": [{ "handle": "bob" }], + "id": 1301645}]} `), ); } @@ -423,9 +422,6 @@ export class BalenaAPIMock extends NockMock { actor: { __id: 1234567 }, username: 'gh_user', created_at: '2018-08-19T13:55:04.485Z', - __metadata: { - uri: '/resin/user(@id)?@id=43699', - }, }, ], }); diff --git a/tests/test-data/api-response/application-GET-v7-expanded-app-type-cpu-arch.json b/tests/test-data/api-response/application-GET-v7-expanded-app-type-cpu-arch.json index 0cee06592..5dc62b16d 100644 --- a/tests/test-data/api-response/application-GET-v7-expanded-app-type-cpu-arch.json +++ b/tests/test-data/api-response/application-GET-v7-expanded-app-type-cpu-arch.json @@ -6,8 +6,7 @@ "name": "Starter", "slug": "microservices-starter", "supports_multicontainer": true, - "is_legacy": true, - "__metadata": {} + "is_legacy": true } ], "id": 1301645, @@ -44,10 +43,7 @@ "should_track_latest_release": true, "is_accessible_by_support_until__date": null, "is_public": false, - "is_host": false, - "__metadata": { - "uri": "/resin/application(@id)?@id=1301645" - } + "is_host": false } ] } diff --git a/tests/test-data/api-response/application-GET-v7-expanded-app-type.json b/tests/test-data/api-response/application-GET-v7-expanded-app-type.json index 9f6d194fc..af136e832 100644 --- a/tests/test-data/api-response/application-GET-v7-expanded-app-type.json +++ b/tests/test-data/api-response/application-GET-v7-expanded-app-type.json @@ -6,8 +6,7 @@ "name": "Starter", "slug": "microservices-starter", "supports_multicontainer": true, - "is_legacy": true, - "__metadata": {} + "is_legacy": true } ], "id": 1301645, @@ -39,10 +38,7 @@ "should_track_latest_release": true, "is_accessible_by_support_until__date": null, "is_public": false, - "is_host": false, - "__metadata": { - "uri": "/resin/application(@id)?@id=1301645" - } + "is_host": false } ] } diff --git a/tests/test-data/api-response/device-missing-app.json b/tests/test-data/api-response/device-missing-app.json index 7a2d84116..10d51076f 100644 --- a/tests/test-data/api-response/device-missing-app.json +++ b/tests/test-data/api-response/device-missing-app.json @@ -24,10 +24,7 @@ "storage_block_device": "/dev/mmcblk0", "storage_usage": 1000, "storage_total": 64000, - "is_undervolted": true, - "__metadata": { - "uri": "/resin/device(@id)?@id=1747415" - } + "is_undervolted": true } ] } diff --git a/tests/test-data/api-response/device-missing-fields.json b/tests/test-data/api-response/device-missing-fields.json index ab52e340b..1f6a0601c 100644 --- a/tests/test-data/api-response/device-missing-fields.json +++ b/tests/test-data/api-response/device-missing-fields.json @@ -4,8 +4,7 @@ "belongs_to__application": [ { "app_name": "test app", - "slug": "org/test app", - "__metadata": {} + "slug": "org/test app" } ], "id": 1747415, @@ -21,10 +20,7 @@ "os_version": "balenaOS 2.44.0+rev3", "supervisor_version": "10.3.7", "is_web_accessible": false, - "overall_status": "disconnected", - "__metadata": { - "uri": "/resin/device(@id)?@id=1747415" - } + "overall_status": "disconnected" } ] } diff --git a/tests/test-data/api-response/device-status.json b/tests/test-data/api-response/device-status.json index 4dff4953e..0ee67523f 100644 --- a/tests/test-data/api-response/device-status.json +++ b/tests/test-data/api-response/device-status.json @@ -1,8 +1,7 @@ { "d": [ { - "overall_status": "disconnected", - "__metadata": {} + "overall_status": "disconnected" } ] } diff --git a/tests/test-data/api-response/device-type-GET-v7.json b/tests/test-data/api-response/device-type-GET-v7.json index da1ff6383..fe9d67ac0 100644 --- a/tests/test-data/api-response/device-type-GET-v7.json +++ b/tests/test-data/api-response/device-type-GET-v7.json @@ -3,124 +3,97 @@ { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "n310-tx2", - "__metadata": {} + "is_referenced_by__alias": "n310-tx2" } ], "id": 162, "slug": "n310-tx2", "name": "Aetina N310 TX2", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=162" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "n510-tx2", - "__metadata": {} + "is_referenced_by__alias": "n510-tx2" } ], "id": 39, "slug": "n510-tx2", "name": "Aetina N510 TX2", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=39" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "aio-3288c", - "__metadata": {} + "is_referenced_by__alias": "aio-3288c" } ], "id": 148, "slug": "aio-3288c", "name": "AIO 3288C", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=148" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "am571x-evm", - "__metadata": {} + "is_referenced_by__alias": "am571x-evm" } ], "id": 1, "slug": "am571x-evm", "name": "AM571X EVM", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=1" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "apalis-imx6q", - "__metadata": {} + "is_referenced_by__alias": "apalis-imx6q" } ], "id": 2, "slug": "apalis-imx6q", "name": "Apalis iMX6q", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=2" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "asus-tinker-board", - "__metadata": {} + "is_referenced_by__alias": "asus-tinker-board" } ], "id": 8, @@ -132,22 +105,17 @@ "__deferred": { "uri": "/resin/device_family(@id)?@id=1" } - }, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=8" } }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "asus-tinker-board-s", - "__metadata": {} + "is_referenced_by__alias": "asus-tinker-board-s" } ], "id": 9, @@ -159,1824 +127,1409 @@ "__deferred": { "uri": "/resin/device_family(@id)?@id=1" } - }, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=9" } }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "jn30b-nano", - "__metadata": {} + "is_referenced_by__alias": "jn30b-nano" } ], "id": 141, "slug": "jn30b-nano", "name": "Auvidea JN30B Nano", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=141" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "fincm3", - "__metadata": {} + "is_referenced_by__alias": "fincm3" } ], "id": 21, "slug": "fincm3", "name": "Balena Fin (CM3)", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=21" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "bananapi-m1-plus", - "__metadata": {} + "is_referenced_by__alias": "bananapi-m1-plus" } ], "id": 10, "slug": "bananapi-m1-plus", "name": "BananaPi-M1+", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=10" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "beagleboard-xm", - "__metadata": {} + "is_referenced_by__alias": "beagleboard-xm" } ], "id": 11, "slug": "beagleboard-xm", "name": "BeagleBoard-XM", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=11" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "beaglebone-black", - "__metadata": {} + "is_referenced_by__alias": "beaglebone-black" } ], "id": 12, "slug": "beaglebone-black", "name": "BeagleBone Black", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=12" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "beaglebone-green", - "__metadata": {} + "is_referenced_by__alias": "beaglebone-green" } ], "id": 13, "slug": "beaglebone-green", "name": "BeagleBone Green", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=13" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "beaglebone-green-gateway", - "__metadata": {} + "is_referenced_by__alias": "beaglebone-green-gateway" } ], "id": 184, "slug": "beaglebone-green-gateway", "name": "BeagleBone Green Gateway", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=184" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "beaglebone-green-wifi", - "__metadata": {} + "is_referenced_by__alias": "beaglebone-green-wifi" } ], "id": 14, "slug": "beaglebone-green-wifi", "name": "BeagleBone Green Wireless", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=14" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "colibri-imx6dl", - "__metadata": {} + "is_referenced_by__alias": "colibri-imx6dl" } ], "id": 18, "slug": "colibri-imx6dl", "name": "Colibri iMX6dl", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=18" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "iot-gate-imx8", - "__metadata": {} + "is_referenced_by__alias": "iot-gate-imx8" } ], "id": 190, "slug": "iot-gate-imx8", "name": "Compulab IOT-gate-imx8", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=190" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "cl-som-imx8", - "__metadata": {} + "is_referenced_by__alias": "cl-som-imx8" } ], "id": 17, "slug": "cl-som-imx8", "name": "Compulab MX8M", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=17" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "coral-dev", - "__metadata": {} + "is_referenced_by__alias": "coral-dev" } ], "id": 142, "slug": "coral-dev", "name": "Coral Dev Board", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=142" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "astro-tx2", - "__metadata": {} + "is_referenced_by__alias": "astro-tx2" } ], "id": 161, "slug": "astro-tx2", "name": "CTI Astro TX2 G+", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=161" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "orbitty-tx2", - "__metadata": {} + "is_referenced_by__alias": "orbitty-tx2" } ], "id": 52, "slug": "orbitty-tx2", "name": "CTI Orbitty TX2", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=52" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "photon-nano", - "__metadata": {} + "is_referenced_by__alias": "photon-nano" } ], "id": 146, "slug": "photon-nano", "name": "CTI Photon Nano", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=146" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "photon-xavier-nx", - "__metadata": {} + "is_referenced_by__alias": "photon-xavier-nx" } ], "id": 176, "slug": "photon-xavier-nx", "name": "CTI Photon Xavier NX", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=176" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "spacely-tx2", - "__metadata": {} + "is_referenced_by__alias": "spacely-tx2" } ], "id": 64, "slug": "spacely-tx2", "name": "CTI Spacely TX2", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=64" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "i386-nlp", - "__metadata": {} + "slug": "i386-nlp" } ], "device_type_alias": [ { - "is_referenced_by__alias": "cybertan-ze250", - "__metadata": {} + "is_referenced_by__alias": "cybertan-ze250" } ], "id": 19, "slug": "cybertan-ze250", "name": "Cybertan ZE250", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=19" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "ccimx8x-sbc-pro", - "__metadata": {} + "is_referenced_by__alias": "ccimx8x-sbc-pro" } ], "id": 185, "slug": "ccimx8x-sbc-pro", "name": "Digi ConnectCore 8X SBC Pro", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=185" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "amd64", - "__metadata": {} + "slug": "amd64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "edge", - "__metadata": {} + "is_referenced_by__alias": "edge" } ], "id": 20, "slug": "edge", "name": "Edge Device Builder", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=20" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "etcher-pro", - "__metadata": {} + "is_referenced_by__alias": "etcher-pro" } ], "id": 144, "slug": "etcher-pro", "name": "Etcher Pro", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=144" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "firefly-rk3288", - "__metadata": {} + "is_referenced_by__alias": "firefly-rk3288" } ], "id": 147, "slug": "firefly-rk3288", "name": "FireFly rk3288", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=147" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "floyd-nano", - "__metadata": {} + "is_referenced_by__alias": "floyd-nano" } ], "id": 192, "slug": "floyd-nano", "name": "Floyd Nano BB02A eMMC", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=192" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "amd64", - "__metadata": {} + "slug": "amd64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "generic", - "__metadata": {} + "is_referenced_by__alias": "generic" } ], "id": 22, "slug": "generic", "name": "Generic", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=22" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "generic-aarch64", - "__metadata": {} + "is_referenced_by__alias": "generic-aarch64" } ], "id": 23, "slug": "generic-aarch64", "name": "Generic AARCH64", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=23" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "generic-amd64", - "__metadata": {} + "is_referenced_by__alias": "generic-amd64" } ], "id": 24, "slug": "generic-amd64", "name": "generic-amd64", "is_private": true, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=24" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "generic-armv7ahf", - "__metadata": {} + "is_referenced_by__alias": "generic-armv7ahf" } ], "id": 178, "slug": "generic-armv7ahf", "name": "Generic ARMv7-a HF", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=178" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "amd64", - "__metadata": {} + "slug": "amd64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "genericx86-64-ext", - "__metadata": {} + "is_referenced_by__alias": "genericx86-64-ext" } ], "id": 145, "slug": "genericx86-64-ext", "name": "Generic x86_64", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=145" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "hummingboard", - "__metadata": {} + "is_referenced_by__alias": "hummingboard" } ], "id": 25, "slug": "hummingboard", "name": "Hummingboard", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=25" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "imx8mm-var-dart ", - "__metadata": {} + "is_referenced_by__alias": "imx8mm-var-dart " } ], "id": 151, "slug": "imx8mm-var-dart ", "name": "imx8mm-var-dart ", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=151" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "i386", - "__metadata": {} + "slug": "i386" } ], "device_type_alias": [ { - "is_referenced_by__alias": "intel-edison", - "__metadata": {} + "is_referenced_by__alias": "intel-edison" } ], "id": 29, "slug": "intel-edison", "name": "Intel Edison", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=29" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "amd64", - "__metadata": {} + "slug": "amd64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "intel-nuc", - "__metadata": {} + "is_referenced_by__alias": "intel-nuc" }, { - "is_referenced_by__alias": "nuc", - "__metadata": {} + "is_referenced_by__alias": "nuc" } ], "id": 30, "slug": "intel-nuc", "name": "Intel NUC", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=30" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "smarc-px30", - "__metadata": {} + "is_referenced_by__alias": "smarc-px30" } ], "id": 186, "slug": "smarc-px30", "name": "I-Pi SMARC PX30 SD-CARD", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=186" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "amd64", - "__metadata": {} + "slug": "amd64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "surface-pro-6", - "__metadata": {} + "is_referenced_by__alias": "surface-pro-6" } ], "id": 67, "slug": "surface-pro-6", "name": "Microsoft Surface 6", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=67" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "amd64", - "__metadata": {} + "slug": "amd64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "surface-go", - "__metadata": {} + "is_referenced_by__alias": "surface-go" } ], "id": 140, "slug": "surface-go", "name": "Microsoft Surface Go", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=140" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "nanopc-t4", - "__metadata": {} + "is_referenced_by__alias": "nanopc-t4" } ], "id": 40, "slug": "nanopc-t4", "name": "NanoPC-T4", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=40" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "nanopi-neo-air", - "__metadata": {} + "is_referenced_by__alias": "nanopi-neo-air" } ], "id": 41, "slug": "nanopi-neo-air", "name": "Nanopi Neo Air", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=41" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "nitrogen6x", - "__metadata": {} + "is_referenced_by__alias": "nitrogen6x" } ], "id": 42, "slug": "nitrogen6x", "name": "Nitrogen 6x", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=42" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "nitrogen6xq2g", - "__metadata": {} + "is_referenced_by__alias": "nitrogen6xq2g" } ], "id": 43, "slug": "nitrogen6xq2g", "name": "Nitrogen 6X Quad 2GB", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=43" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "nitrogen8mm", - "__metadata": {} + "is_referenced_by__alias": "nitrogen8mm" } ], "id": 44, "slug": "nitrogen8mm", "name": "Nitrogen8M Mini SBC", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=44" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "npe-x500-m3", - "__metadata": {} + "is_referenced_by__alias": "npe-x500-m3" } ], "id": 45, "slug": "npe-x500-m3", "name": "NPE X500 M3", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=45" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "blackboard-tx2", - "__metadata": {} + "is_referenced_by__alias": "blackboard-tx2" } ], "id": 16, "slug": "blackboard-tx2", "name": "Nvidia blackboard TX2", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=16" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "jetson-nano-2gb-devkit", - "__metadata": {} + "is_referenced_by__alias": "jetson-nano-2gb-devkit" } ], "id": 188, "slug": "jetson-nano-2gb-devkit", "name": "Nvidia Jetson Nano 2GB Devkit SD", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=188" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "jetson-nano-emmc", - "__metadata": {} + "is_referenced_by__alias": "jetson-nano-emmc" } ], "id": 158, "slug": "jetson-nano-emmc", "name": "Nvidia Jetson Nano eMMC", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=158" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "jetson-nano", - "__metadata": {} + "is_referenced_by__alias": "jetson-nano" } ], "id": 32, "slug": "jetson-nano", "name": "Nvidia Jetson Nano SD-CARD", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=32" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "jetson-tx1", - "__metadata": {} + "is_referenced_by__alias": "jetson-tx1" } ], "id": 33, "slug": "jetson-tx1", "name": "Nvidia Jetson TX1", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=33" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "jetson-tx2", - "__metadata": {} + "is_referenced_by__alias": "jetson-tx2" } ], "id": 34, "slug": "jetson-tx2", "name": "Nvidia Jetson TX2", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=34" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "jetson-tx2-skycatch", - "__metadata": {} + "is_referenced_by__alias": "jetson-tx2-skycatch" } ], "id": 35, "slug": "jetson-tx2-skycatch", "name": "Nvidia Jetson TX2 Skycatch (EXPERIMENTAL)", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=35" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "jetson-xavier", - "__metadata": {} + "is_referenced_by__alias": "jetson-xavier" } ], "id": 36, "slug": "jetson-xavier", "name": "Nvidia Jetson Xavier", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=36" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "jetson-xavier-nx-devkit-emmc", - "__metadata": {} + "is_referenced_by__alias": "jetson-xavier-nx-devkit-emmc" } ], "id": 159, "slug": "jetson-xavier-nx-devkit-emmc", "name": "Nvidia Jetson Xavier NX Devkit eMMC", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=159" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "jetson-xavier-nx-devkit", - "__metadata": {} + "is_referenced_by__alias": "jetson-xavier-nx-devkit" } ], "id": 181, "slug": "jetson-xavier-nx-devkit", "name": "Nvidia Jetson Xavier NX Devkit SD-CARD", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=181" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "odroid-c1", - "__metadata": {} + "is_referenced_by__alias": "odroid-c1" } ], "id": 46, "slug": "odroid-c1", "name": "ODROID-C1+", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=46" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "odroid-u3+", - "__metadata": {} + "is_referenced_by__alias": "odroid-u3+" }, { - "is_referenced_by__alias": "odroid-ux3", - "__metadata": {} + "is_referenced_by__alias": "odroid-ux3" }, { - "is_referenced_by__alias": "odroid-xu4", - "__metadata": {} + "is_referenced_by__alias": "odroid-xu4" } ], "id": 47, "slug": "odroid-xu4", "name": "ODROID-XU4", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=47" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "orange-pi-lite", - "__metadata": {} + "is_referenced_by__alias": "orange-pi-lite" } ], "id": 48, "slug": "orange-pi-lite", "name": "Orange Pi Lite", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=48" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "orange-pi-one", - "__metadata": {} + "is_referenced_by__alias": "orange-pi-one" } ], "id": 49, "slug": "orange-pi-one", "name": "Orange Pi One", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=49" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "orangepi-plus2", - "__metadata": {} + "is_referenced_by__alias": "orangepi-plus2" } ], "id": 50, "slug": "orangepi-plus2", "name": "Orange Pi Plus2", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=50" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "orange-pi-zero", - "__metadata": {} + "is_referenced_by__alias": "orange-pi-zero" } ], "id": 51, "slug": "orange-pi-zero", "name": "Orange Pi Zero", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=51" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "parallella", - "__metadata": {} + "is_referenced_by__alias": "parallella" } ], "id": 53, "slug": "parallella", "name": "Parallella", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=53" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "beaglebone-pocket", - "__metadata": {} + "is_referenced_by__alias": "beaglebone-pocket" } ], "id": 15, "slug": "beaglebone-pocket", "name": "PocketBeagle", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=15" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "i386", - "__metadata": {} + "slug": "i386" } ], "device_type_alias": [ { - "is_referenced_by__alias": "qemux86", - "__metadata": {} + "is_referenced_by__alias": "qemux86" } ], "id": 54, "slug": "qemux86", "name": "QEMU X86 32bit", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=54" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "amd64", - "__metadata": {} + "slug": "amd64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "qemux86-64", - "__metadata": {} + "is_referenced_by__alias": "qemux86-64" } ], "id": 55, "slug": "qemux86-64", "name": "QEMU X86 64bit", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=55" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "raspberrypi2", - "__metadata": {} + "is_referenced_by__alias": "raspberrypi2" }, { - "is_referenced_by__alias": "raspberry-pi2", - "__metadata": {} + "is_referenced_by__alias": "raspberry-pi2" } ], "id": 57, "slug": "raspberry-pi2", "name": "Raspberry Pi 2", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=57" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "raspberrypi3", - "__metadata": {} + "is_referenced_by__alias": "raspberrypi3" } ], "id": 58, "slug": "raspberrypi3", "name": "Raspberry Pi 3", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=58" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "raspberrypi3-64", - "__metadata": {} + "is_referenced_by__alias": "raspberrypi3-64" } ], "id": 59, "slug": "raspberrypi3-64", "name": "Raspberry Pi 3 (using 64bit OS)", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=59" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "raspberrypi400-64", - "__metadata": {} + "is_referenced_by__alias": "raspberrypi400-64" } ], "id": 183, "slug": "raspberrypi400-64", "name": "Raspberry Pi 400", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=183" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "raspberrypi4-64", - "__metadata": {} + "is_referenced_by__alias": "raspberrypi4-64" } ], "id": 60, "slug": "raspberrypi4-64", "name": "Raspberry Pi 4 (using 64bit OS)", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=60" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "raspberrypicm4-ioboard", - "__metadata": {} + "is_referenced_by__alias": "raspberrypicm4-ioboard" } ], "id": 191, "slug": "raspberrypicm4-ioboard", "name": "Raspberry Pi CM4 IO Board", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=191" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "rpi", - "__metadata": {} + "slug": "rpi" } ], "device_type_alias": [ { - "is_referenced_by__alias": "raspberrypi", - "__metadata": {} + "is_referenced_by__alias": "raspberrypi" }, { - "is_referenced_by__alias": "raspberry-pi", - "__metadata": {} + "is_referenced_by__alias": "raspberry-pi" } ], "id": 56, "slug": "raspberry-pi", "name": "Raspberry Pi (v1 / Zero / Zero W)", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=56" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "revpi-connect", - "__metadata": {} + "is_referenced_by__alias": "revpi-connect" } ], "id": 163, "slug": "revpi-connect", "name": "Revolution Pi Connect", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=163" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "revpi-core-3", - "__metadata": {} + "is_referenced_by__alias": "revpi-core-3" } ], "id": 61, "slug": "revpi-core-3", "name": "Revolution Pi Core 3", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=61" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "kitra520", - "__metadata": {} + "is_referenced_by__alias": "kitra520" } ], "id": 37, "slug": "kitra520", "name": "RushUp Kitra 520", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=37" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "kitra710", - "__metadata": {} + "is_referenced_by__alias": "kitra710" } ], "id": 38, "slug": "kitra710", "name": "RushUp Kitra 710", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=38" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "artik10", - "__metadata": {} + "is_referenced_by__alias": "artik10" } ], "id": 3, "slug": "artik10", "name": "Samsung Artik 10", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=3" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "artik5", - "__metadata": {} + "is_referenced_by__alias": "artik5" } ], "id": 4, "slug": "artik5", "name": "Samsung Artik 520", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=4" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "artik530", - "__metadata": {} + "is_referenced_by__alias": "artik530" } ], "id": 5, "slug": "artik530", "name": "Samsung Artik 530", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=5" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "artik533s", - "__metadata": {} + "is_referenced_by__alias": "artik533s" } ], "id": 6, "slug": "artik533s", "name": "Samsung Artik 530s 1G", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=6" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "artik710", - "__metadata": {} + "is_referenced_by__alias": "artik710" } ], "id": 7, "slug": "artik710", "name": "Samsung Artik 710", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=7" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "i386-nlp", - "__metadata": {} + "slug": "i386-nlp" } ], "device_type_alias": [ { - "is_referenced_by__alias": "iot2000", - "__metadata": {} + "is_referenced_by__alias": "iot2000" } ], "id": 31, "slug": "iot2000", "name": "Siemens IOT2000", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=31" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "skx2", - "__metadata": {} + "is_referenced_by__alias": "skx2" } ], "id": 62, "slug": "skx2", "name": "SKX2", "is_private": true, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=62" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "ts4900", - "__metadata": {} + "is_referenced_by__alias": "ts4900" } ], "id": 68, "slug": "ts4900", "name": "Technologic TS-4900", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=68" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "ts7700", - "__metadata": {} + "is_referenced_by__alias": "ts7700" } ], "id": 69, "slug": "ts7700", "name": "Technologic TS-7700", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=69" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "amd64", - "__metadata": {} + "slug": "amd64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "up-board", - "__metadata": {} + "is_referenced_by__alias": "up-board" } ], "id": 70, @@ -1988,22 +1541,17 @@ "__deferred": { "uri": "/resin/device_family(@id)?@id=2" } - }, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=70" } }, { "is_of__cpu_architecture": [ { - "slug": "amd64", - "__metadata": {} + "slug": "amd64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "up-core", - "__metadata": {} + "is_referenced_by__alias": "up-core" } ], "id": 71, @@ -2015,22 +1563,17 @@ "__deferred": { "uri": "/resin/device_family(@id)?@id=2" } - }, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=71" } }, { "is_of__cpu_architecture": [ { - "slug": "amd64", - "__metadata": {} + "slug": "amd64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "up-core-plus", - "__metadata": {} + "is_referenced_by__alias": "up-core-plus" } ], "id": 72, @@ -2042,22 +1585,17 @@ "__deferred": { "uri": "/resin/device_family(@id)?@id=2" } - }, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=72" } }, { "is_of__cpu_architecture": [ { - "slug": "amd64", - "__metadata": {} + "slug": "amd64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "up-squared", - "__metadata": {} + "is_referenced_by__alias": "up-squared" } ], "id": 73, @@ -2069,186 +1607,143 @@ "__deferred": { "uri": "/resin/device_family(@id)?@id=2" } - }, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=73" } }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "imx6ul-var-dart", - "__metadata": {} + "is_referenced_by__alias": "imx6ul-var-dart" } ], "id": 26, "slug": "imx6ul-var-dart", "name": "Variscite DART-6UL", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=26" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "imx8m-var-dart", - "__metadata": {} + "is_referenced_by__alias": "imx8m-var-dart" } ], "id": 28, "slug": "imx8m-var-dart", "name": "Variscite DART-MX8M", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=28" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "imx8mm-var-dart", - "__metadata": {} + "is_referenced_by__alias": "imx8mm-var-dart" } ], "id": 150, "slug": "imx8mm-var-dart", "name": "Variscite DART-MX8M Mini", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=150" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "var-som-mx6", - "__metadata": {} + "is_referenced_by__alias": "var-som-mx6" } ], "id": 74, "slug": "var-som-mx6", "name": "Variscite VAR-SOM-MX6", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=74" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "imx7-var-som", - "__metadata": {} + "is_referenced_by__alias": "imx7-var-som" } ], "id": 27, "slug": "imx7-var-som", "name": "Variscite VAR-SOM-MX7", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=27" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "via-vab820-quad", - "__metadata": {} + "is_referenced_by__alias": "via-vab820-quad" } ], "id": 75, "slug": "via-vab820-quad", "name": "VIA VAB 820-quad", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=75" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "armv7hf", - "__metadata": {} + "slug": "armv7hf" } ], "device_type_alias": [ { - "is_referenced_by__alias": "zc702-zynq7", - "__metadata": {} + "is_referenced_by__alias": "zc702-zynq7" } ], "id": 169, "slug": "zc702-zynq7", "name": "Zynq ZC702", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=169" - } + "belongs_to__device_family": null }, { "is_of__cpu_architecture": [ { - "slug": "aarch64", - "__metadata": {} + "slug": "aarch64" } ], "device_type_alias": [ { - "is_referenced_by__alias": "zynq-xz702", - "__metadata": {} + "is_referenced_by__alias": "zynq-xz702" } ], "id": 76, "slug": "zynq-xz702", "name": "Zynq ZC702 (DISCONTINUED)", "is_private": false, - "belongs_to__device_family": null, - "__metadata": { - "uri": "/resin/device_type(@id)?@id=76" - } + "belongs_to__device_family": null } ] -} \ No newline at end of file +} diff --git a/tests/test-data/api-response/device.json b/tests/test-data/api-response/device.json index d5c508c7d..74b67fef1 100644 --- a/tests/test-data/api-response/device.json +++ b/tests/test-data/api-response/device.json @@ -4,8 +4,7 @@ "belongs_to__application": [ { "app_name": "test app", - "slug": "org/test app", - "__metadata": {} + "slug": "org/test app" } ], "device_tag": [ @@ -36,10 +35,7 @@ "storage_block_device": "/dev/mmcblk0", "storage_usage": 1000, "storage_total": 64000, - "is_undervolted": true, - "__metadata": { - "uri": "/resin/device(@id)?@id=1747415" - } + "is_undervolted": true } ] } diff --git a/tests/test-data/api-response/devices.json b/tests/test-data/api-response/devices.json index e6403c4a0..bc1672d3c 100644 --- a/tests/test-data/api-response/devices.json +++ b/tests/test-data/api-response/devices.json @@ -3,8 +3,7 @@ { "belongs_to__application": [ { - "slug": "org/test app", - "__metadata": {} + "slug": "org/test app" } ], "id": 1747415, @@ -19,10 +18,7 @@ "status": "Idle", "is_online": false, "os_version": "balenaOS 2.44.0+rev3", - "supervisor_version": "10.3.7", - "__metadata": { - "uri": "/resin/device(@id)?@id=1747415" - } + "supervisor_version": "10.3.7" }, { "belongs_to__application": [], @@ -38,10 +34,7 @@ "status": "Idle", "is_online": false, "os_version": "balenaOS 2.44.0+rev3", - "supervisor_version": "10.3.7", - "__metadata": { - "uri": "/resin/device(@id)?@id=1747415" - } + "supervisor_version": "10.3.7" } ] } diff --git a/tests/test-data/api-response/image-POST-v7.json b/tests/test-data/api-response/image-POST-v7.json index 17f7fb322..c1ef357da 100644 --- a/tests/test-data/api-response/image-POST-v7.json +++ b/tests/test-data/api-response/image-POST-v7.json @@ -18,8 +18,5 @@ "push_timestamp": null, "status": "running", "content_hash": null, - "contract": null, - "__metadata": { - "uri": "/resin/image(@id)?@id=1859016" - } -} \ No newline at end of file + "contract": null +} diff --git a/tests/test-data/api-response/image-is-part-of-release-POST-v7.json b/tests/test-data/api-response/image-is-part-of-release-POST-v7.json index d45645aba..db5c6abe1 100644 --- a/tests/test-data/api-response/image-is-part-of-release-POST-v7.json +++ b/tests/test-data/api-response/image-is-part-of-release-POST-v7.json @@ -12,8 +12,5 @@ "uri": "/resin/release(1218643)" }, "__id": 1218643 - }, - "__metadata": { - "uri": "/resin/image__is_part_of__release(@id)?@id=1774668" } -} \ No newline at end of file +} diff --git a/tests/test-data/api-response/image-label-POST-v7.json b/tests/test-data/api-response/image-label-POST-v7.json index a22b53c9d..83d6b8934 100644 --- a/tests/test-data/api-response/image-label-POST-v7.json +++ b/tests/test-data/api-response/image-label-POST-v7.json @@ -8,8 +8,5 @@ "__id": 1774668 }, "label_name": "io.resin.features.firmware", - "value": "1", - "__metadata": { - "uri": "/resin/image_label(@id)?@id=99699617" - } -} \ No newline at end of file + "value": "1" +} diff --git a/tests/test-data/api-response/release-GET-v7.json b/tests/test-data/api-response/release-GET-v7.json index 082ac77a1..3f0b8788f 100644 --- a/tests/test-data/api-response/release-GET-v7.json +++ b/tests/test-data/api-response/release-GET-v7.json @@ -10,9 +10,6 @@ "build_log": null, "start_timestamp": "2021-08-25T22:18:33.624Z", "end_timestamp": "2021-08-25T22:18:48.820Z", - "__metadata": { - "uri": "/resin/release(@id)?@id=142334" - }, "contains__image": [ { "image": [ @@ -36,10 +33,7 @@ "push_timestamp": "2020-01-04T01:13:14.415Z", "status": "success", "content_hash": "sha256:6b5471aae43ae81e8f69e10d1a516cb412569a6d5020a57eae311f8fa16d688a", - "contract": null, - "__metadata": { - "uri": "/resin/image(@id)?@id=1820810" - } + "contract": null } ], "id": 1738663, @@ -49,17 +43,13 @@ "uri": "/resin/release(1203844)" }, "__id": 1203844 - }, - "__metadata": { - "uri": "/resin/image__is_part_of__release(@id)?@id=1738663" } } ], "release_tag": [ { "tag_key": "testtag1", - "value": "val1", - "__metadata": {} + "value": "val1" } ], "composition": { diff --git a/tests/test-data/api-response/release-POST-v7.json b/tests/test-data/api-response/release-POST-v7.json index ab5ca3455..1c3b5b411 100644 --- a/tests/test-data/api-response/release-POST-v7.json +++ b/tests/test-data/api-response/release-POST-v7.json @@ -29,9 +29,7 @@ "tty": true, "restart": "always", "network_mode": "host", - "volumes": [ - "resin-data:/data" - ], + "volumes": ["resin-data:/data"], "labels": { "io.resin.features.kernel-modules": "1", "io.resin.features.firmware": "1", @@ -47,8 +45,5 @@ "build_log": null, "start_timestamp": "2020-01-16T17:08:52.710Z", "end_timestamp": null, - "update_timestamp": "2020-01-16T17:08:53.017Z", - "__metadata": { - "uri": "/resin/release(@id)?@id=1218643" - } -} \ No newline at end of file + "update_timestamp": "2020-01-16T17:08:53.017Z" +} From 593233a99fec514ab3c92ab395e85beb3a95950a Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 24 Oct 2024 13:45:24 -0400 Subject: [PATCH 12/34] Tests: Drop unused `my_application` resource mock Change-type: patch --- tests/nock/balena-api-mock.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/nock/balena-api-mock.ts b/tests/nock/balena-api-mock.ts index c468efbf5..bf6ca2303 100644 --- a/tests/nock/balena-api-mock.ts +++ b/tests/nock/balena-api-mock.ts @@ -86,16 +86,6 @@ export class BalenaAPIMock extends NockMock { this.optPost(/^\/api-key\/v[0-9]\/?$/, opts).reply(200, 'dummykey'); } - public expectGetMyApplication(opts: ScopeOpts = {}) { - this.optGet(/^\/v7\/my_application($|[(?])/, opts).reply( - 200, - JSON.parse(`{"d": [{ - "organization": [{ "handle": "bob" }], - "id": 1301645}]} - `), - ); - } - public expectGetAuth(opts: ScopeOpts = {}) { this.optGet(/^\/auth\/v1\//, opts).reply(200, { token: 'test', From 1275c11573d7da22c23ae3f3b76025424a92c339 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 17 Sep 2024 16:58:35 -0400 Subject: [PATCH 13/34] Update `balena-preload` to 16.0.0 Change-type: patch --- npm-shrinkwrap.json | 83 +++++---------------------------------------- package.json | 2 +- 2 files changed, 10 insertions(+), 75 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 8067a8de0..241553bd7 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -20,7 +20,7 @@ "balena-device-init": "^7.0.1", "balena-errors": "^4.7.3", "balena-image-fs": "^7.0.6", - "balena-preload": "^15.0.6", + "balena-preload": "^16.0.0", "balena-sdk": "^20.3.0", "balena-semver": "^2.3.0", "balena-settings-client": "^5.0.2", @@ -5526,11 +5526,11 @@ } }, "node_modules/balena-preload": { - "version": "15.0.6", - "resolved": "https://registry.npmjs.org/balena-preload/-/balena-preload-15.0.6.tgz", - "integrity": "sha512-WQQu9Agu8usnmwZZFz5G+Qblnry/NsIwpv1hu5PCViHSOARHThQrBu6n5Yhx2LUGQ2J0e+BcoE3eEeBWD3vxuA==", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/balena-preload/-/balena-preload-16.0.0.tgz", + "integrity": "sha512-IP+4Op6LHJW5ip/oomQmERjbNroKqi5atDI3s07aokgv/mH8J7jy4BOOW6JwnrHb560IQy/oPf4yM4h3qQlLEA==", "dependencies": { - "balena-sdk": "^19.7.2", + "balena-sdk": "^20.1.3", "bluebird": "^3.7.2", "compare-versions": "^3.6.0", "docker-progress": "^5.0.0", @@ -5544,58 +5544,6 @@ "node": ">=18" } }, - "node_modules/balena-preload/node_modules/@types/node": { - "version": "18.19.50", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.50.tgz", - "integrity": "sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==", - "license": "MIT", - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/balena-preload/node_modules/balena-sdk": { - "version": "19.10.0", - "resolved": "https://registry.npmjs.org/balena-sdk/-/balena-sdk-19.10.0.tgz", - "integrity": "sha512-9q+NzwTJgiTp6ucFA5wqbsqKQS0lFhFYsjGPyqkdQhjciPX7SyhUHlurHUsesDKhFbY0waFLelSIP5sKpN7z4Q==", - "license": "Apache-2.0", - "dependencies": { - "@balena/es-version": "^1.0.0", - "@types/json-schema": "^7.0.9", - "@types/node": "^18.0.0", - "abortcontroller-polyfill": "^1.7.1", - "balena-auth": "^6.0.1", - "balena-errors": "^4.9.0", - "balena-hup-action-utils": "~6.1.0", - "balena-register-device": "^9.0.2", - "balena-request": "^13.3.2", - "balena-semver": "^2.3.0", - "balena-settings-client": "^5.0.0", - "date-fns": "^3.0.5", - "handlebars": "^4.7.7", - "lodash": "^4.17.21", - "memoizee": "^0.4.15", - "mime": "^3.0.0", - "ndjson": "^2.0.0", - "p-throttle": "^4.1.1", - "pinejs-client-core": "~6.14.0", - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=18.0" - } - }, - "node_modules/balena-preload/node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/balena-register-device": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/balena-register-device/-/balena-register-device-9.0.2.tgz", @@ -5688,20 +5636,6 @@ "node": ">=10.0.0" } }, - "node_modules/balena-sdk/node_modules/pinejs-client-core": { - "version": "6.15.11", - "resolved": "https://registry.npmjs.org/pinejs-client-core/-/pinejs-client-core-6.15.11.tgz", - "integrity": "sha512-EUhXx+UpyKJnkw7E5Y5fEwYMNx6SstBJdE21Rwsvs783oXPeoQ1Gmo1Lh5Ct67YaDQLoA6Dab4KoqycwrZPGSA==", - "license": "MIT", - "dependencies": { - "@balena/abstract-sql-to-typescript": "^3.2.3", - "@balena/es-version": "^1.0.3" - }, - "engines": { - "node": ">=10.0.0", - "npm": ">=6.0.0" - } - }, "node_modules/balena-semver": { "version": "2.3.5", "resolved": "https://registry.npmjs.org/balena-semver/-/balena-semver-2.3.5.tgz", @@ -14380,10 +14314,11 @@ } }, "node_modules/pinejs-client-core": { - "version": "6.14.13", - "resolved": "https://registry.npmjs.org/pinejs-client-core/-/pinejs-client-core-6.14.13.tgz", - "integrity": "sha512-Ca1kfbst+0C9UbvqrJFM2VZRAX/UDSgMDYiqSswzTsNoz/axOLMB3bmbrK8el+wSLb0TG2s/UsOZQTnN4MkOcQ==", + "version": "6.15.11", + "resolved": "https://registry.npmjs.org/pinejs-client-core/-/pinejs-client-core-6.15.11.tgz", + "integrity": "sha512-EUhXx+UpyKJnkw7E5Y5fEwYMNx6SstBJdE21Rwsvs783oXPeoQ1Gmo1Lh5Ct67YaDQLoA6Dab4KoqycwrZPGSA==", "dependencies": { + "@balena/abstract-sql-to-typescript": "^3.2.3", "@balena/es-version": "^1.0.3" }, "engines": { diff --git a/package.json b/package.json index 48611875c..5f6427041 100644 --- a/package.json +++ b/package.json @@ -199,7 +199,7 @@ "balena-device-init": "^7.0.1", "balena-errors": "^4.7.3", "balena-image-fs": "^7.0.6", - "balena-preload": "^15.0.6", + "balena-preload": "^16.0.0", "balena-sdk": "^20.3.0", "balena-semver": "^2.3.0", "balena-settings-client": "^5.0.2", From d4b554da1b45e6680e4b6ea6bdf6875c2f60d109 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Wed, 23 Oct 2024 09:27:52 -0400 Subject: [PATCH 14/34] Docs: Show whether an alias is deprecated Change-type: patch --- automation/capitanodoc/markdown.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/automation/capitanodoc/markdown.ts b/automation/capitanodoc/markdown.ts index 4edf72b70..4bd32bcd1 100644 --- a/automation/capitanodoc/markdown.ts +++ b/automation/capitanodoc/markdown.ts @@ -25,7 +25,14 @@ function renderOclifCommand(command: Category['commands'][0]): string[] { const result = [`## ${ent.encode(command.name || '')}`]; if (command.aliases?.length) { result.push('### Aliases'); - result.push(command.aliases.map((alias) => `- \`${alias}\``).join('\n')); + result.push( + command.aliases + .map( + (alias) => + `- \`${alias}\`${command.deprecateAliases ? ' *(deprecated)*' : ''}`, + ) + .join('\n'), + ); result.push( `\nTo use one of the aliases, replace \`${command.name}\` with the alias.`, ); From 13110cca455721aaff457a1aa50d74c90b542846 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 24 Sep 2024 12:26:16 -0400 Subject: [PATCH 15/34] Deprecate `devices` command in favor of `device list` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/device/list.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index db59715cc..536aadcb2 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -1473,7 +1473,7 @@ expiry date assigned to generated provisioning api key (format: YYYY-MM-DD) ### Aliases -- `devices` +- `devices` *(deprecated)* To use one of the aliases, replace `device list` with the alias. diff --git a/src/commands/device/list.ts b/src/commands/device/list.ts index ce492a0ae..a30e4710b 100644 --- a/src/commands/device/list.ts +++ b/src/commands/device/list.ts @@ -37,6 +37,7 @@ const devicesSelectFields = { export default class DeviceListCmd extends Command { public static aliases = ['devices']; + public static deprecateAliases = true; public static description = stripIndent` List all devices. From b6f8be27ecd524238bded3c2f9ae03af1251663c Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 24 Sep 2024 12:47:00 -0400 Subject: [PATCH 16/34] Deprecate `api-keys` command in favor of `api-key list` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/api-key/list.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 536aadcb2..0d3479a68 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -339,7 +339,7 @@ the API key name ### Aliases -- `api-keys` +- `api-keys` *(deprecated)* To use one of the aliases, replace `api-key list` with the alias. diff --git a/src/commands/api-key/list.ts b/src/commands/api-key/list.ts index 4087e3d91..2bb69013d 100644 --- a/src/commands/api-key/list.ts +++ b/src/commands/api-key/list.ts @@ -21,6 +21,7 @@ import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; export default class APIKeyListCmd extends Command { public static aliases = ['api-keys']; + public static deprecateAliases = true; public static description = stripIndent` Print a list of balenaCloud API keys. From 71ef00534d4c5f3a45d65a775f6d150e8a981f85 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 24 Sep 2024 12:53:37 -0400 Subject: [PATCH 17/34] Deprecate `fleets` command in favor of `fleet list` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/fleet/list.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 0d3479a68..06dce9691 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -2573,7 +2573,7 @@ produce JSON output instead of tabular output ### Aliases -- `fleets` +- `fleets` *(deprecated)* To use one of the aliases, replace `fleet list` with the alias. diff --git a/src/commands/fleet/list.ts b/src/commands/fleet/list.ts index 5d7824dc9..5972dd931 100644 --- a/src/commands/fleet/list.ts +++ b/src/commands/fleet/list.ts @@ -28,6 +28,7 @@ interface ExtendedApplication extends ApplicationWithDeviceTypeSlug { export default class FleetListCmd extends Command { public static aliases = ['fleets']; + public static deprecateAliases = true; public static description = stripIndent` List all fleets. From 35dce4579a18b529272046190dc11b25feadaa41 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 24 Sep 2024 13:46:21 -0400 Subject: [PATCH 18/34] Deprecate `releases` command in favor of `release list` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/release/list.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 06dce9691..9b52d5d43 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -3647,7 +3647,7 @@ the commit or ID of the release to invalidate ### Aliases -- `releases` +- `releases` *(deprecated)* To use one of the aliases, replace `release list` with the alias. diff --git a/src/commands/release/list.ts b/src/commands/release/list.ts index d35643729..bd4584da5 100644 --- a/src/commands/release/list.ts +++ b/src/commands/release/list.ts @@ -24,6 +24,7 @@ import { jsonInfo } from '../../utils/messages'; export default class ReleaseListCmd extends Command { public static aliases = ['releases']; + public static deprecateAliases = true; public static description = stripIndent` List all releases of a fleet. From 3251f0428743f4681132e995d25840340777580e Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 24 Sep 2024 13:56:06 -0400 Subject: [PATCH 19/34] Deprecate `keys` command in favor of `key list` Change-type: patch --- docs/balena-cli.md | 4 ++-- src/commands/ssh-key/list.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 9b52d5d43..00a2fdef5 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -3803,8 +3803,8 @@ balenaCloud ID for the SSH key ### Aliases -- `keys` -- `key list` +- `keys` *(deprecated)* +- `key list` *(deprecated)* To use one of the aliases, replace `ssh-key list` with the alias. diff --git a/src/commands/ssh-key/list.ts b/src/commands/ssh-key/list.ts index 78ca85ce9..549be44a1 100644 --- a/src/commands/ssh-key/list.ts +++ b/src/commands/ssh-key/list.ts @@ -21,6 +21,7 @@ import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; export default class SSHKeyListCmd extends Command { public static aliases = ['keys', 'key list']; + public static deprecateAliases = true; public static description = stripIndent` List the SSH keys in balenaCloud. From 3dee7bd6f67a56343e275cf2d3ba9470fe09ea07 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Wed, 25 Sep 2024 07:32:08 -0400 Subject: [PATCH 20/34] Deprecate `key` commands in favor of `ssh-key` Change-type: patch --- docs/balena-cli.md | 6 +++--- src/commands/ssh-key/add.ts | 1 + src/commands/ssh-key/index.ts | 1 + src/commands/ssh-key/rm.ts | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 00a2fdef5..d59ff2fa4 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -3730,7 +3730,7 @@ Examples: ### Aliases -- `key add` +- `key add` *(deprecated)* To use one of the aliases, replace `ssh-key add` with the alias. @@ -3778,7 +3778,7 @@ the path to the public key file ### Aliases -- `key` +- `key` *(deprecated)* To use one of the aliases, replace `ssh-key` with the alias. @@ -3823,7 +3823,7 @@ Examples: ### Aliases -- `key rm` +- `key rm` *(deprecated)* To use one of the aliases, replace `ssh-key rm` with the alias. diff --git a/src/commands/ssh-key/add.ts b/src/commands/ssh-key/add.ts index 726aab9e5..59532fc9f 100644 --- a/src/commands/ssh-key/add.ts +++ b/src/commands/ssh-key/add.ts @@ -22,6 +22,7 @@ import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class SSHKeyAddCmd extends Command { public static aliases = ['key add']; + public static deprecateAliases = true; public static description = stripIndent` Add an SSH key to balenaCloud. diff --git a/src/commands/ssh-key/index.ts b/src/commands/ssh-key/index.ts index 95b128fb9..79a970360 100644 --- a/src/commands/ssh-key/index.ts +++ b/src/commands/ssh-key/index.ts @@ -22,6 +22,7 @@ import { parseAsInteger } from '../../utils/validation'; export default class SSHKeyCmd extends Command { public static aliases = ['key']; + public static deprecateAliases = true; public static description = stripIndent` Display an SSH key. diff --git a/src/commands/ssh-key/rm.ts b/src/commands/ssh-key/rm.ts index 05920e2ad..7cbcee7b1 100644 --- a/src/commands/ssh-key/rm.ts +++ b/src/commands/ssh-key/rm.ts @@ -22,6 +22,7 @@ import { parseAsInteger } from '../../utils/validation'; export default class SSHKeyRmCmd extends Command { public static aliases = ['key rm']; + public static deprecateAliases = true; public static description = stripIndent` Remove an SSH key from balenaCloud. From bb8031170050adc931358d8b0f269f785c41af36 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Tue, 24 Sep 2024 14:52:59 -0400 Subject: [PATCH 21/34] Deprecate `envs` command in favor of `env list` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/env/list.ts | 1 + tests/commands/env/list.spec.ts | 9 +++------ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index d59ff2fa4..911d0dfc3 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -2188,7 +2188,7 @@ port mapping in the format [:[localIP:]localPort] ### Aliases -- `envs` +- `envs` *(deprecated)* To use one of the aliases, replace `env list` with the alias. diff --git a/src/commands/env/list.ts b/src/commands/env/list.ts index 5a32d97e7..875014f45 100644 --- a/src/commands/env/list.ts +++ b/src/commands/env/list.ts @@ -47,6 +47,7 @@ interface ServiceEnvironmentVariableInfo export default class EnvListCmd extends Command { public static aliases = ['envs']; + public static deprecateAliases = true; public static description = stripIndent` List the environment or config variables of a fleet, device or service. diff --git a/tests/commands/env/list.spec.ts b/tests/commands/env/list.spec.ts index 5cf835418..a07904128 100644 --- a/tests/commands/env/list.spec.ts +++ b/tests/commands/env/list.spec.ts @@ -65,20 +65,17 @@ describe('balena env list', function () { api.expectGetAppEnvVars(); api.expectGetAppServiceVars(); - const { out, err } = await runCommand(`envs -f ${appName}`); + const { out } = await runCommand(`envs -f ${appName}`); - expect(out.join('')).to.satisfy((msg: string) => - msg.endsWith( - stripIndent` + expect(out.join('')).to.contain( + stripIndent` ID NAME VALUE FLEET SERVICE 120110 svar1 svar1-value gh_user/testApp service1 120111 svar2 svar2-value gh_user/testApp service2 120101 var1 var1-val gh_user/testApp * 120102 var2 22 gh_user/testApp * ` + '\n', - ), ); - expect(err.join('')).to.equal(''); }); it('should successfully list config vars for a test fleet', async () => { From bc66febc502d46bd37916d0bf5c413736f1522da Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Wed, 25 Sep 2024 07:47:38 -0400 Subject: [PATCH 22/34] Deprecate `tags` command in favor of `tag list` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/tag/list.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 911d0dfc3..92df9e427 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -3909,7 +3909,7 @@ length of time to enable support for, in (h)ours or (d)ays, e.g. 12h, 2d ### Aliases -- `tags` +- `tags` *(deprecated)* To use one of the aliases, replace `tag list` with the alias. diff --git a/src/commands/tag/list.ts b/src/commands/tag/list.ts index 509ed9e83..07c3daeb8 100644 --- a/src/commands/tag/list.ts +++ b/src/commands/tag/list.ts @@ -23,6 +23,7 @@ import { applicationIdInfo } from '../../utils/messages'; export default class TagListCmd extends Command { public static aliases = ['tags']; + public static deprecateAliases = true; public static description = stripIndent` List all tags for a fleet, device or release. From c7a06f7259d8aaaac7f0629dba2756790c87d0f7 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 26 Sep 2024 07:52:46 -0400 Subject: [PATCH 23/34] Deprecate `orgs` command in favor of `organization list` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/organization/list.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 92df9e427..4375af7f5 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -2832,7 +2832,7 @@ answer "yes" to all questions (non interactive use) ### Aliases -- `orgs` +- `orgs` *(deprecated)* To use one of the aliases, replace `organization list` with the alias. diff --git a/src/commands/organization/list.ts b/src/commands/organization/list.ts index 544ebdeac..34df0174a 100644 --- a/src/commands/organization/list.ts +++ b/src/commands/organization/list.ts @@ -21,6 +21,7 @@ import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; export default class OrganizationListCmd extends Command { public static aliases = ['orgs']; + public static deprecateAliases = true; public static description = stripIndent` List all organizations. From 5db0c71bb356a1fddd9aa32832bf76f1d0a71c93 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 26 Sep 2024 08:02:01 -0400 Subject: [PATCH 24/34] Deprecate `scan` command in favor of `device detect` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/device/detect.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 4375af7f5..dfcb54da1 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -1296,7 +1296,7 @@ answer "yes" to all questions (non interactive use) ### Aliases -- `scan` +- `scan` *(deprecated)* To use one of the aliases, replace `device detect` with the alias. diff --git a/src/commands/device/detect.ts b/src/commands/device/detect.ts index 0361d4618..79605016f 100644 --- a/src/commands/device/detect.ts +++ b/src/commands/device/detect.ts @@ -21,6 +21,7 @@ import { getCliUx, stripIndent } from '../../utils/lazy'; export default class DeviceDetectCmd extends Command { public static aliases = ['scan']; + public static deprecateAliases = true; public static description = stripIndent` Scan for balenaOS devices on your local network. From c5d8f7326351d88c61ee419546026aee5ee6cff8 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 26 Sep 2024 08:20:52 -0400 Subject: [PATCH 25/34] Deprecate `logs` command in favor of `device logs` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/device/logs.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index dfcb54da1..66198a972 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -1554,7 +1554,7 @@ output boolean indicating local mode status ### Aliases -- `logs` +- `logs` *(deprecated)* To use one of the aliases, replace `device logs` with the alias. diff --git a/src/commands/device/logs.ts b/src/commands/device/logs.ts index 4903482d4..12d938515 100644 --- a/src/commands/device/logs.ts +++ b/src/commands/device/logs.ts @@ -24,6 +24,7 @@ const MAX_RETRY = 1000; export default class DeviceLogsCmd extends Command { public static aliases = ['logs']; + public static deprecateAliases = true; public static description = stripIndent` Show device logs. From 84985022e5dce3eea9ccb5c3c5bd4982c6670822 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 26 Sep 2024 11:26:19 -0400 Subject: [PATCH 26/34] Deprecate `ssh` command in favor of `device ssh` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/device/ssh.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 66198a972..6f3730c8e 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -1982,7 +1982,7 @@ force action if the update lock is set ### Aliases -- `ssh` +- `ssh` *(deprecated)* To use one of the aliases, replace `device ssh` with the alias. diff --git a/src/commands/device/ssh.ts b/src/commands/device/ssh.ts index 1268ebf57..0469e5faa 100644 --- a/src/commands/device/ssh.ts +++ b/src/commands/device/ssh.ts @@ -25,6 +25,7 @@ import { export default class DeviceSSHCmd extends Command { public static aliases = ['ssh']; + public static deprecateAliases = true; public static description = stripIndent` Open a SSH prompt on a device's host OS or service container. From 61ebf9e4fd69e03894c0e6bdaabbab5847be380c Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 26 Sep 2024 12:32:10 -0400 Subject: [PATCH 27/34] Deprecate `env add` in favor of `env set` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/env/set.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 6f3730c8e..e1ec7c289 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -2406,7 +2406,7 @@ do not prompt for confirmation before deleting the variable ### Aliases -- `env add` +- `env add` *(deprecated)* To use one of the aliases, replace `env set` with the alias. diff --git a/src/commands/env/set.ts b/src/commands/env/set.ts index 036ccfd33..6807579b1 100644 --- a/src/commands/env/set.ts +++ b/src/commands/env/set.ts @@ -37,6 +37,7 @@ interface ArgsDef { export default class EnvSetCmd extends Command { public static aliases = ['env add']; + public static deprecateAliases = true; public static description = stripIndent` Add or update env or config variable to fleets, devices or services. From 9d3f9128a8f57995badaed68f5c01cf51e482d6f Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 26 Sep 2024 12:38:51 -0400 Subject: [PATCH 28/34] Deprecate `tunnel` command in favor of `device tunnel` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/device/tunnel.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index e1ec7c289..c4ac3b841 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -2126,7 +2126,7 @@ the uuid of the device to make track the fleet's release ### Aliases -- `tunnel` +- `tunnel` *(deprecated)* To use one of the aliases, replace `device tunnel` with the alias. diff --git a/src/commands/device/tunnel.ts b/src/commands/device/tunnel.ts index fc0868534..a325d3f8d 100644 --- a/src/commands/device/tunnel.ts +++ b/src/commands/device/tunnel.ts @@ -29,6 +29,7 @@ import type { Server, Socket } from 'net'; export default class DeviceTunnelCmd extends Command { public static aliases = ['tunnel']; + public static deprecateAliases = true; public static description = stripIndent` Tunnel local ports to your balenaOS device. From 8be069dbdbc62a9f10f96fb657ac7561ee6cd3fe Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 26 Sep 2024 12:45:48 -0400 Subject: [PATCH 29/34] Deprecate `notes` command in favor of `device note` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/device/note.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index c4ac3b841..42e316ca9 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -1655,7 +1655,7 @@ fleet name or slug (preferred) ### Aliases -- `notes` +- `notes` *(deprecated)* To use one of the aliases, replace `device note` with the alias. diff --git a/src/commands/device/note.ts b/src/commands/device/note.ts index 5be144c81..3e0b3f833 100644 --- a/src/commands/device/note.ts +++ b/src/commands/device/note.ts @@ -22,6 +22,7 @@ import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class DeviceNoteCmd extends Command { public static aliases = ['notes']; + public static deprecateAliases = true; public static description = stripIndent` Set a device note. From 12923c9b8461f41f813912e3bd5b0838e0958ba3 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 26 Sep 2024 13:01:19 -0400 Subject: [PATCH 30/34] Deprecate `devices supported` command in favor of `device-type list` Change-type: patch --- docs/balena-cli.md | 2 +- src/commands/device-type/list.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 42e316ca9..80544ea47 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -1229,7 +1229,7 @@ Docker host TLS key file ### Aliases -- `devices supported` +- `devices supported` *(deprecated)* To use one of the aliases, replace `device-type list` with the alias. diff --git a/src/commands/device-type/list.ts b/src/commands/device-type/list.ts index e2c2e6f2d..2e50b4fe1 100644 --- a/src/commands/device-type/list.ts +++ b/src/commands/device-type/list.ts @@ -22,6 +22,7 @@ import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; export default class DeviceTypeListCmd extends Command { public static aliases = ['devices supported']; + public static deprecateAliases = true; public static description = stripIndent` List the device types supported by balena (like 'raspberrypi3' or 'intel-nuc'). From de1821d7ac71e8b111683c6619f75a890faf0606 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 26 Sep 2024 11:43:31 -0400 Subject: [PATCH 31/34] Stop checking for very old, long-removed commands Change-type: major --- src/preparser.ts | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/src/preparser.ts b/src/preparser.ts index 8afcb3cd1..7fa068823 100644 --- a/src/preparser.ts +++ b/src/preparser.ts @@ -110,14 +110,9 @@ export function checkDeletedCommand(argvSlice: string[]): void { if (argvSlice[0] === 'help') { argvSlice = argvSlice.slice(1); } - function replaced( - oldCmd: string, - alternative: string, - version: string, - verb = 'replaced', - ) { + function replaced(oldCmd: string, alternative: string, version: string) { throw new ExpectedError(`\ -Note: the command "balena ${oldCmd}" was ${verb} in CLI version ${version}. +Note: the command "balena ${oldCmd}" was replaced in CLI version ${version}. Please use "balena ${alternative}" instead.`); } function removed(oldCmd: string, alternative: string, version: string) { @@ -127,22 +122,7 @@ Please use "balena ${alternative}" instead.`); } throw new ExpectedError(msg); } - const stopAlternative = - 'Please use "balena device ssh -s" to access the host OS, then use `balena-engine stop`.'; - const cmds: { [cmd: string]: [(...args: any) => void, ...string[]] } = { - sync: [replaced, 'push', 'v11.0.0', 'removed'], - 'local logs': [replaced, 'logs', 'v11.0.0'], - 'local push': [replaced, 'push', 'v11.0.0'], - 'local scan': [replaced, 'scan', 'v11.0.0'], - 'local ssh': [replaced, 'ssh', 'v11.0.0'], - 'local stop': [removed, stopAlternative, 'v11.0.0'], - app: [replaced, 'fleet', 'v13.0.0'], - apps: [replaced, 'fleets', 'v13.0.0'], - 'app purge': [replaced, 'fleet purge', 'v13.0.0'], - 'app rename': [replaced, 'fleet rename', 'v13.0.0'], - 'app restart': [replaced, 'fleet restart', 'v13.0.0'], - 'app rm': [replaced, 'fleet rm', 'v13.0.0'], - }; + const cmds: { [cmd: string]: ['replaced' | 'removed', string, string] } = {}; let cmd: string | undefined; if (argvSlice.length > 1) { cmd = [argvSlice[0], argvSlice[1]].join(' '); @@ -150,7 +130,9 @@ Please use "balena ${alternative}" instead.`); cmd = argvSlice[0]; } if (cmd && Object.getOwnPropertyNames(cmds).includes(cmd)) { - cmds[cmd][0](cmd, ...cmds[cmd].slice(1)); + const changeType = cmds[cmd][0]; + const changeTypeFn = changeType === 'replaced' ? replaced : removed; + changeTypeFn(cmd, cmds[cmd][1], cmds[cmd][2]); } } From d023d0af91ffc4f02fba5fceeb8ccd9751a5e07b Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Mon, 30 Sep 2024 12:05:32 -0400 Subject: [PATCH 32/34] Drop `-h` flag for help and stop manually adding `help` per command in favor of oclif automatically adding it Change-type: major --- completion/_balena | 2 +- completion/templates/zsh.template | 2 +- docs/balena-cli.md | 50 ------------------------- src/commands/api-key/generate.ts | 5 --- src/commands/api-key/list.ts | 1 - src/commands/api-key/revoke.ts | 5 --- src/commands/app/create.ts | 2 - src/commands/block/create.ts | 2 - src/commands/build/index.ts | 4 -- src/commands/config/generate.ts | 1 - src/commands/config/inject.ts | 1 - src/commands/config/read.ts | 1 - src/commands/config/reconfigure.ts | 1 - src/commands/config/write.ts | 1 - src/commands/deploy/index.ts | 4 -- src/commands/device-type/list.ts | 2 - src/commands/device/deactivate.ts | 1 - src/commands/device/detect.ts | 2 - src/commands/device/identify.ts | 5 --- src/commands/device/index.ts | 1 - src/commands/device/init.ts | 2 - src/commands/device/list.ts | 1 - src/commands/device/local-mode.ts | 2 - src/commands/device/logs.ts | 2 - src/commands/device/move.ts | 1 - src/commands/device/note.ts | 1 - src/commands/device/os-update.ts | 1 - src/commands/device/pin.ts | 5 --- src/commands/device/public-url.ts | 2 - src/commands/device/purge.ts | 5 --- src/commands/device/reboot.ts | 1 - src/commands/device/register.ts | 2 - src/commands/device/rename.ts | 5 --- src/commands/device/restart.ts | 2 - src/commands/device/rm.ts | 1 - src/commands/device/shutdown.ts | 1 - src/commands/device/ssh.ts | 2 - src/commands/device/start-service.ts | 5 --- src/commands/device/stop-service.ts | 5 --- src/commands/device/track-fleet.ts | 5 --- src/commands/device/tunnel.ts | 2 - src/commands/env/list.ts | 1 - src/commands/env/rename.ts | 2 - src/commands/env/set.ts | 2 - src/commands/fleet/create.ts | 2 - src/commands/fleet/index.ts | 1 - src/commands/fleet/list.ts | 1 - src/commands/fleet/pin.ts | 5 --- src/commands/fleet/purge.ts | 5 --- src/commands/fleet/rename.ts | 5 --- src/commands/fleet/restart.ts | 5 --- src/commands/fleet/rm.ts | 1 - src/commands/fleet/track-latest.ts | 5 --- src/commands/join/index.ts | 1 - src/commands/leave/index.ts | 5 --- src/commands/local/configure.ts | 5 --- src/commands/local/flash.ts | 1 - src/commands/login/index.ts | 3 -- src/commands/organization/list.ts | 5 --- src/commands/os/build-config.ts | 2 - src/commands/os/configure.ts | 1 - src/commands/os/download.ts | 2 - src/commands/os/initialize.ts | 1 - src/commands/os/versions.ts | 2 - src/commands/preload/index.ts | 3 -- src/commands/push/index.ts | 2 - src/commands/release/finalize.ts | 5 --- src/commands/release/index.ts | 1 - src/commands/release/invalidate.ts | 5 --- src/commands/release/list.ts | 1 - src/commands/release/validate.ts | 5 --- src/commands/settings/index.ts | 5 --- src/commands/ssh-key/add.ts | 5 --- src/commands/ssh-key/index.ts | 5 --- src/commands/ssh-key/list.ts | 5 --- src/commands/ssh-key/rm.ts | 1 - src/commands/support/index.ts | 1 - src/commands/tag/list.ts | 1 - src/commands/tag/rm.ts | 1 - src/commands/tag/set.ts | 1 - src/commands/util/available-drives.ts | 5 --- src/commands/version/index.ts | 1 - src/help.ts | 4 +- src/preparser.ts | 4 +- src/utils/application-create.ts | 1 - src/utils/common-flags.ts | 2 - tests/commands/app/create.spec.ts | 46 ----------------------- tests/commands/device-type/list.spec.ts | 4 +- tests/commands/help.spec.ts | 2 +- 89 files changed, 9 insertions(+), 316 deletions(-) delete mode 100644 tests/commands/app/create.spec.ts diff --git a/completion/_balena b/completion/_balena index 0058ceab5..9daf9928d 100644 --- a/completion/_balena +++ b/completion/_balena @@ -29,7 +29,7 @@ _balena() { _arguments -C \ '(- 1 *)--version[show version and exit]' \ - '(- 1 *)'{-h,--help}'[show help options and exit]' \ + '(- 1 *)--help[show help options and exit]' \ '1:first command:_balena_main_cmds' \ '2:second command:_balena_sec_cmds' \ && ret=0 diff --git a/completion/templates/zsh.template b/completion/templates/zsh.template index 4676869f5..d57621463 100644 --- a/completion/templates/zsh.template +++ b/completion/templates/zsh.template @@ -14,7 +14,7 @@ $sub_cmds$ _arguments -C \ '(- 1 *)--version[show version and exit]' \ - '(- 1 *)'{-h,--help}'[show help options and exit]' \ + '(- 1 *)--help[show help options and exit]' \ '1:first command:_balena_main_cmds' \ '2:second command:_balena_sec_cmds' \ && ret=0 diff --git a/docs/balena-cli.md b/docs/balena-cli.md index 80544ea47..3d5c2f496 100644 --- a/docs/balena-cli.md +++ b/docs/balena-cli.md @@ -333,8 +333,6 @@ Examples: the API key name -### Options - ## api-key list ### Aliases @@ -384,8 +382,6 @@ Examples: the API key ids -### Options - # Apps ## app create @@ -1346,8 +1342,6 @@ Examples: the uuid of the device to identify -### Options - ## device ### Description @@ -1749,8 +1743,6 @@ the uuid of the device to pin to a release the commit of the release for the device to get pinned to -### Options - ## device public-url ### Description @@ -1807,8 +1799,6 @@ Examples: comma-separated list (no blank spaces) of device UUIDs -### Options - ## device reboot ### Description @@ -1895,8 +1885,6 @@ the uuid of the device to rename the new name for the device -### Options - ## device restart ### Description @@ -2076,8 +2064,6 @@ comma-separated list (no blank spaces) of device UUIDs comma-separated list (no blank spaces) of service names -### Options - ## device stop-service ### Description @@ -2102,8 +2088,6 @@ comma-separated list (no blank spaces) of device UUIDs comma-separated list (no blank spaces) of service names -### Options - ## device track-fleet ### Description @@ -2120,8 +2104,6 @@ Examples: the uuid of the device to make track the fleet's release -### Options - ## device tunnel ### Aliases @@ -2618,8 +2600,6 @@ the slug of the fleet to pin to a release the commit of the release for the fleet to get pinned to -### Options - ## fleet purge ### Description @@ -2648,8 +2628,6 @@ Examples: fleet name or slug (preferred) -### Options - ## fleet rename ### Description @@ -2685,8 +2663,6 @@ fleet name or slug (preferred) the new name for the fleet -### Options - ## fleet restart ### Description @@ -2714,8 +2690,6 @@ Examples: fleet name or slug (preferred) -### Options - ## fleet rm ### Description @@ -2769,8 +2743,6 @@ Examples: the slug of the fleet to make track the latest release -### Options - # Local ## local configure @@ -2790,8 +2762,6 @@ Examples: path of drive or image to configure -### Options - ## local flash ### Description @@ -2845,8 +2815,6 @@ Examples: $ balena organization list -### Options - # OS ## os build-config @@ -3217,8 +3185,6 @@ Examples: the device IP or hostname -### Options - # Preload ## preload @@ -3586,8 +3552,6 @@ Examples: the commit or ID of the release to finalize -### Options - ## release ### Description @@ -3641,8 +3605,6 @@ Examples: the commit or ID of the release to invalidate -### Options - ## release list ### Aliases @@ -3708,8 +3670,6 @@ Examples: the commit or ID of the release to validate -### Options - # Settings ## settings @@ -3722,8 +3682,6 @@ Examples: $ balena settings -### Options - # SSH Keys ## ssh-key add @@ -3772,8 +3730,6 @@ the SSH key name the path to the public key file -### Options - ## ssh-key ### Aliases @@ -3797,8 +3753,6 @@ Examples: balenaCloud ID for the SSH key -### Options - ## ssh-key list ### Aliases @@ -3817,8 +3771,6 @@ Examples: $ balena ssh-key list -### Options - ## ssh-key rm ### Aliases @@ -4058,8 +4010,6 @@ release id List available drives which are usable for writing an OS image to. Does not list system drives. -### Options - # Version ## version diff --git a/src/commands/api-key/generate.ts b/src/commands/api-key/generate.ts index e869358db..1eb381dea 100644 --- a/src/commands/api-key/generate.ts +++ b/src/commands/api-key/generate.ts @@ -17,7 +17,6 @@ import { Args, Command } from '@oclif/core'; import { ExpectedError } from '../../errors'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class GenerateCmd extends Command { @@ -39,10 +38,6 @@ export default class GenerateCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/api-key/list.ts b/src/commands/api-key/list.ts index 2bb69013d..8f802ff7f 100644 --- a/src/commands/api-key/list.ts +++ b/src/commands/api-key/list.ts @@ -33,7 +33,6 @@ export default class APIKeyListCmd extends Command { public static examples = ['$ balena api-key list']; public static flags = { - help: cf.help, user: Flags.boolean({ char: 'u', description: 'show API keys for your user', diff --git a/src/commands/api-key/revoke.ts b/src/commands/api-key/revoke.ts index a8c4756ba..ef303d684 100644 --- a/src/commands/api-key/revoke.ts +++ b/src/commands/api-key/revoke.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class RevokeCmd extends Command { @@ -40,10 +39,6 @@ export default class RevokeCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/app/create.ts b/src/commands/app/create.ts index 67242d306..7ca52f775 100644 --- a/src/commands/app/create.ts +++ b/src/commands/app/create.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { stripIndent } from '../../utils/lazy'; export default class AppCreateCmd extends Command { @@ -64,7 +63,6 @@ export default class AppCreateCmd extends Command { description: 'app device type (Check available types with `balena device-type list`)', }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/block/create.ts b/src/commands/block/create.ts index 0e69b6ccc..221f7d2ab 100644 --- a/src/commands/block/create.ts +++ b/src/commands/block/create.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { stripIndent } from '../../utils/lazy'; export default class BlockCreateCmd extends Command { @@ -64,7 +63,6 @@ export default class BlockCreateCmd extends Command { description: 'block device type (Check available types with `balena device-type list`)', }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/build/index.ts b/src/commands/build/index.ts index fd0c99405..66a8944ff 100644 --- a/src/commands/build/index.ts +++ b/src/commands/build/index.ts @@ -44,7 +44,6 @@ interface FlagsDef extends ComposeCliFlags, DockerCliFlags { deviceType?: string; fleet?: string; source?: string; // Not part of command profile - source param copied here. - help: void; } export default class BuildCmd extends Command { @@ -95,9 +94,6 @@ ${dockerignoreHelp} fleet: cf.fleet, ...composeCliFlags, ...dockerCliFlags, - // NOTE: Not supporting -h for help, because of clash with -h in DockerCliFlags - // Revisit this in future release. - help: Flags.help({}), }; public static primary = true; diff --git a/src/commands/config/generate.ts b/src/commands/config/generate.ts index ee95a0c78..4376b53f2 100644 --- a/src/commands/config/generate.ts +++ b/src/commands/config/generate.ts @@ -117,7 +117,6 @@ export default class ConfigGenerateCmd extends Command { 'expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)', exclusive: ['device'], }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/config/inject.ts b/src/commands/config/inject.ts index f34e71d04..a9d06cb19 100644 --- a/src/commands/config/inject.ts +++ b/src/commands/config/inject.ts @@ -44,7 +44,6 @@ export default class ConfigInjectCmd extends Command { public static flags = { drive: cf.driveOrImg, - help: cf.help, }; public static root = true; diff --git a/src/commands/config/read.ts b/src/commands/config/read.ts index d32b511d1..644f68f19 100644 --- a/src/commands/config/read.ts +++ b/src/commands/config/read.ts @@ -38,7 +38,6 @@ export default class ConfigReadCmd extends Command { public static flags = { drive: cf.driveOrImg, - help: cf.help, json: cf.json, }; diff --git a/src/commands/config/reconfigure.ts b/src/commands/config/reconfigure.ts index 24003f8e8..af01e9592 100644 --- a/src/commands/config/reconfigure.ts +++ b/src/commands/config/reconfigure.ts @@ -44,7 +44,6 @@ export default class ConfigReconfigureCmd extends Command { description: 'show advanced commands', char: 'v', }), - help: cf.help, version: Flags.string({ description: 'balenaOS version, for example "2.32.0" or "2.44.0+rev1"', }), diff --git a/src/commands/config/write.ts b/src/commands/config/write.ts index 34cd3b8b1..4a8d991c8 100644 --- a/src/commands/config/write.ts +++ b/src/commands/config/write.ts @@ -49,7 +49,6 @@ export default class ConfigWriteCmd extends Command { public static flags = { drive: cf.driveOrImg, - help: cf.help, }; public static root = true; diff --git a/src/commands/deploy/index.ts b/src/commands/deploy/index.ts index 1e87ad74e..312edfb41 100644 --- a/src/commands/deploy/index.ts +++ b/src/commands/deploy/index.ts @@ -60,7 +60,6 @@ interface FlagsDef extends ComposeCliFlags, DockerCliFlags { 'release-tag'?: string[]; draft: boolean; note?: string; - help: void; } export default class DeployCmd extends Command { @@ -139,9 +138,6 @@ ${dockerignoreHelp} note: Flags.string({ description: 'The notes for this release' }), ...composeCliFlags, ...dockerCliFlags, - // NOTE: Not supporting -h for help, because of clash with -h in DockerCliFlags - // Revisit this in future release. - help: Flags.help({}), }; public static authenticated = true; diff --git a/src/commands/device-type/list.ts b/src/commands/device-type/list.ts index 2e50b4fe1..ff3d5dcc3 100644 --- a/src/commands/device-type/list.ts +++ b/src/commands/device-type/list.ts @@ -17,7 +17,6 @@ import { Flags, Command } from '@oclif/core'; import type * as BalenaSdk from 'balena-sdk'; import * as _ from 'lodash'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; export default class DeviceTypeListCmd extends Command { @@ -46,7 +45,6 @@ export default class DeviceTypeListCmd extends Command { ]; public static flags = { - help: cf.help, json: Flags.boolean({ char: 'j', description: 'produce JSON output instead of tabular output', diff --git a/src/commands/device/deactivate.ts b/src/commands/device/deactivate.ts index e8e50611c..f0a81631d 100644 --- a/src/commands/device/deactivate.ts +++ b/src/commands/device/deactivate.ts @@ -42,7 +42,6 @@ export default class DeviceDeactivateCmd extends Command { public static flags = { yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/detect.ts b/src/commands/device/detect.ts index 79605016f..c8489c428 100644 --- a/src/commands/device/detect.ts +++ b/src/commands/device/detect.ts @@ -16,7 +16,6 @@ */ import { Flags, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getCliUx, stripIndent } from '../../utils/lazy'; export default class DeviceDetectCmd extends Command { @@ -50,7 +49,6 @@ export default class DeviceDetectCmd extends Command { char: 't', description: 'scan timeout in seconds', }), - help: cf.help, json: Flags.boolean({ default: false, char: 'j', diff --git a/src/commands/device/identify.ts b/src/commands/device/identify.ts index 57bef0af0..c3de3ceca 100644 --- a/src/commands/device/identify.ts +++ b/src/commands/device/identify.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { ExpectedError } from '../../errors'; @@ -35,10 +34,6 @@ export default class DeviceIdentifyCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/device/index.ts b/src/commands/device/index.ts index 86e2c0a0b..53e6c7bbb 100644 --- a/src/commands/device/index.ts +++ b/src/commands/device/index.ts @@ -63,7 +63,6 @@ export default class DeviceCmd extends Command { public static flags = { json: cf.json, - help: cf.help, view: Flags.boolean({ default: false, description: 'open device dashboard page', diff --git a/src/commands/device/init.ts b/src/commands/device/init.ts index 7ad58e249..81b907f4d 100644 --- a/src/commands/device/init.ts +++ b/src/commands/device/init.ts @@ -28,7 +28,6 @@ interface FlagsDef { 'os-version'?: string; drive?: string; config?: string; - help: void; 'provisioning-key-name'?: string; 'provisioning-key-expiry-date'?: string; } @@ -100,7 +99,6 @@ export default class DeviceInitCmd extends Command { description: 'expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)', }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/list.ts b/src/commands/device/list.ts index a30e4710b..7eea1c1ed 100644 --- a/src/commands/device/list.ts +++ b/src/commands/device/list.ts @@ -59,7 +59,6 @@ export default class DeviceListCmd extends Command { public static flags = { fleet: cf.fleet, json: cf.json, - help: cf.help, }; public static primary = true; diff --git a/src/commands/device/local-mode.ts b/src/commands/device/local-mode.ts index e26ae15dc..7d3273363 100644 --- a/src/commands/device/local-mode.ts +++ b/src/commands/device/local-mode.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class DeviceLocalModeCmd extends Command { @@ -54,7 +53,6 @@ export default class DeviceLocalModeCmd extends Command { description: 'output boolean indicating local mode status', exclusive: ['enable', 'disable'], }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/logs.ts b/src/commands/device/logs.ts index 12d938515..b08d81e16 100644 --- a/src/commands/device/logs.ts +++ b/src/commands/device/logs.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import type { LogMessage } from 'balena-sdk'; @@ -87,7 +86,6 @@ export default class DeviceLogsCmd extends Command { 'Only show system logs. This can be used in combination with --service.', char: 'S', }), - help: cf.help, }; public static primary = true; diff --git a/src/commands/device/move.ts b/src/commands/device/move.ts index 93393b323..0300fe704 100644 --- a/src/commands/device/move.ts +++ b/src/commands/device/move.ts @@ -55,7 +55,6 @@ export default class DeviceMoveCmd extends Command { public static flags = { fleet: cf.fleet, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/note.ts b/src/commands/device/note.ts index 3e0b3f833..cedbdb811 100644 --- a/src/commands/device/note.ts +++ b/src/commands/device/note.ts @@ -50,7 +50,6 @@ export default class DeviceNoteCmd extends Command { exclusive: ['device'], hidden: true, }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/os-update.ts b/src/commands/device/os-update.ts index 665c5d87f..580d2eefe 100644 --- a/src/commands/device/os-update.ts +++ b/src/commands/device/os-update.ts @@ -57,7 +57,6 @@ export default class DeviceOsUpdateCmd extends Command { exclusive: ['version'], }), yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/pin.ts b/src/commands/device/pin.ts index cbe896ded..b786ccb8d 100644 --- a/src/commands/device/pin.ts +++ b/src/commands/device/pin.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { getExpandedProp } from '../../utils/pine'; @@ -43,10 +42,6 @@ export default class DevicePinCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/device/public-url.ts b/src/commands/device/public-url.ts index c1ff9bb55..52f7394bf 100644 --- a/src/commands/device/public-url.ts +++ b/src/commands/device/public-url.ts @@ -17,7 +17,6 @@ import { Flags, Args, Command } from '@oclif/core'; import { ExpectedError } from '../../errors'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class DevicePublicUrlCmd extends Command { @@ -56,7 +55,6 @@ export default class DevicePublicUrlCmd extends Command { description: 'determine if public URL is enabled', exclusive: ['enable', 'disable'], }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/purge.ts b/src/commands/device/purge.ts index 00bd54d0f..37cf4a5d9 100644 --- a/src/commands/device/purge.ts +++ b/src/commands/device/purge.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getCliUx, stripIndent } from '../../utils/lazy'; export default class DevicePurgeCmd extends Command { @@ -41,10 +40,6 @@ export default class DevicePurgeCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/device/reboot.ts b/src/commands/device/reboot.ts index 2a7e0e903..9061b4051 100644 --- a/src/commands/device/reboot.ts +++ b/src/commands/device/reboot.ts @@ -36,7 +36,6 @@ export default class DeviceRebootCmd extends Command { public static flags = { force: cf.force, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/register.ts b/src/commands/device/register.ts index cefea0705..13c8be60a 100644 --- a/src/commands/device/register.ts +++ b/src/commands/device/register.ts @@ -16,7 +16,6 @@ */ import { Flags, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import * as ca from '../../utils/common-args'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { applicationIdInfo } from '../../utils/messages'; @@ -52,7 +51,6 @@ export default class DeviceRegisterCmd extends Command { description: "device type slug (run 'balena device-type list' for possible values)", }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/rename.ts b/src/commands/device/rename.ts index 0f56b8d43..f087be808 100644 --- a/src/commands/device/rename.ts +++ b/src/commands/device/rename.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent, getCliForm } from '../../utils/lazy'; export default class DeviceRenameCmd extends Command { @@ -42,10 +41,6 @@ export default class DeviceRenameCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/device/restart.ts b/src/commands/device/restart.ts index 082ca041b..f64d3bd52 100644 --- a/src/commands/device/restart.ts +++ b/src/commands/device/restart.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getCliUx, stripIndent } from '../../utils/lazy'; import type { BalenaSDK, @@ -58,7 +57,6 @@ export default class DeviceRestartCmd extends Command { 'comma-separated list (no blank spaces) of service names to restart', char: 's', }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/rm.ts b/src/commands/device/rm.ts index 1ce7434d6..be387aa77 100644 --- a/src/commands/device/rm.ts +++ b/src/commands/device/rm.ts @@ -44,7 +44,6 @@ export default class DeviceRmCmd extends Command { public static flags = { yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/shutdown.ts b/src/commands/device/shutdown.ts index 79b1974e5..a65d7d84b 100644 --- a/src/commands/device/shutdown.ts +++ b/src/commands/device/shutdown.ts @@ -37,7 +37,6 @@ export default class DeviceShutdownCmd extends Command { public static flags = { force: cf.force, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/device/ssh.ts b/src/commands/device/ssh.ts index 0469e5faa..ca722ac57 100644 --- a/src/commands/device/ssh.ts +++ b/src/commands/device/ssh.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { parseAsInteger, @@ -100,7 +99,6 @@ export default class DeviceSSHCmd extends Command { default: false, description: 'bypass global proxy configuration for the ssh connection', }), - help: cf.help, }; public static primary = true; diff --git a/src/commands/device/start-service.ts b/src/commands/device/start-service.ts index 5749c2a25..eba5c71e3 100644 --- a/src/commands/device/start-service.ts +++ b/src/commands/device/start-service.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getCliUx, stripIndent } from '../../utils/lazy'; import type { BalenaSDK } from 'balena-sdk'; @@ -45,10 +44,6 @@ export default class DeviceStartServiceCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/device/stop-service.ts b/src/commands/device/stop-service.ts index 652d1ec46..22f46067d 100644 --- a/src/commands/device/stop-service.ts +++ b/src/commands/device/stop-service.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getCliUx, stripIndent } from '../../utils/lazy'; import type { BalenaSDK } from 'balena-sdk'; @@ -45,10 +44,6 @@ export default class DeviceStopServiceCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/device/track-fleet.ts b/src/commands/device/track-fleet.ts index cbf976b2d..f4612a972 100644 --- a/src/commands/device/track-fleet.ts +++ b/src/commands/device/track-fleet.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class DeviceTrackFleetCmd extends Command { @@ -34,10 +33,6 @@ export default class DeviceTrackFleetCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/device/tunnel.ts b/src/commands/device/tunnel.ts index a325d3f8d..38d877ea8 100644 --- a/src/commands/device/tunnel.ts +++ b/src/commands/device/tunnel.ts @@ -21,7 +21,6 @@ import { InvalidPortMappingError, ExpectedError, } from '../../errors'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { lowercaseIfSlug } from '../../utils/normalization'; @@ -87,7 +86,6 @@ export default class DeviceTunnelCmd extends Command { char: 'p', multiple: true, }), - help: cf.help, }; public static primary = true; diff --git a/src/commands/env/list.ts b/src/commands/env/list.ts index 875014f45..42c122d56 100644 --- a/src/commands/env/list.ts +++ b/src/commands/env/list.ts @@ -105,7 +105,6 @@ export default class EnvListCmd extends Command { exclusive: ['service'], }), device: { ...cf.device, exclusive: ['fleet'] }, - help: cf.help, json: cf.json, service: { ...cf.service, exclusive: ['config'] }, }; diff --git a/src/commands/env/rename.ts b/src/commands/env/rename.ts index dcdd59f4b..e21e01d74 100644 --- a/src/commands/env/rename.ts +++ b/src/commands/env/rename.ts @@ -15,7 +15,6 @@ * limitations under the License. */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import * as ec from '../../utils/env-common'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { parseAsInteger } from '../../utils/validation'; @@ -55,7 +54,6 @@ export default class EnvRenameCmd extends Command { config: ec.booleanConfig, device: ec.booleanDevice, service: ec.booleanService, - help: cf.help, }; public async run() { diff --git a/src/commands/env/set.ts b/src/commands/env/set.ts index 6807579b1..6ad8d6a04 100644 --- a/src/commands/env/set.ts +++ b/src/commands/env/set.ts @@ -25,7 +25,6 @@ import { applicationIdInfo } from '../../utils/messages'; interface FlagsDef { fleet?: string; device?: string; // device UUID - help: void; quiet: boolean; service?: string; // service name } @@ -98,7 +97,6 @@ export default class EnvSetCmd extends Command { public static flags = { fleet: { ...cf.fleet, exclusive: ['device'] }, device: { ...cf.device, exclusive: ['fleet'] }, - help: cf.help, quiet: cf.quiet, service: cf.service, }; diff --git a/src/commands/fleet/create.ts b/src/commands/fleet/create.ts index 2412ab59e..ebb3cb35f 100644 --- a/src/commands/fleet/create.ts +++ b/src/commands/fleet/create.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { stripIndent } from '../../utils/lazy'; export default class FleetCreateCmd extends Command { @@ -64,7 +63,6 @@ export default class FleetCreateCmd extends Command { description: 'fleet device type (Check available types with `balena device-type list`)', }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/fleet/index.ts b/src/commands/fleet/index.ts index ebba3444b..7080a697c 100644 --- a/src/commands/fleet/index.ts +++ b/src/commands/fleet/index.ts @@ -40,7 +40,6 @@ export default class FleetCmd extends Command { }; public static flags = { - help: cf.help, view: Flags.boolean({ default: false, description: 'open fleet dashboard page', diff --git a/src/commands/fleet/list.ts b/src/commands/fleet/list.ts index 5972dd931..49e84547f 100644 --- a/src/commands/fleet/list.ts +++ b/src/commands/fleet/list.ts @@ -42,7 +42,6 @@ export default class FleetListCmd extends Command { public static examples = ['$ balena fleet list']; public static flags = { - help: cf.help, json: cf.json, }; diff --git a/src/commands/fleet/pin.ts b/src/commands/fleet/pin.ts index 92a190577..e1665bef8 100644 --- a/src/commands/fleet/pin.ts +++ b/src/commands/fleet/pin.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { getExpandedProp } from '../../utils/pine'; @@ -43,10 +42,6 @@ export default class FleetPinCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/fleet/purge.ts b/src/commands/fleet/purge.ts index a6601ff13..2bcd39665 100644 --- a/src/commands/fleet/purge.ts +++ b/src/commands/fleet/purge.ts @@ -16,7 +16,6 @@ */ import { Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import * as ca from '../../utils/common-args'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { applicationIdInfo } from '../../utils/messages'; @@ -40,10 +39,6 @@ export default class FleetPurgeCmd extends Command { fleet: ca.fleetRequired, }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/fleet/rename.ts b/src/commands/fleet/rename.ts index cd99434c7..a6e03a06d 100644 --- a/src/commands/fleet/rename.ts +++ b/src/commands/fleet/rename.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import * as ca from '../../utils/common-args'; import { getBalenaSdk, stripIndent, getCliForm } from '../../utils/lazy'; import { applicationIdInfo } from '../../utils/messages'; @@ -46,10 +45,6 @@ export default class FleetRenameCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/fleet/restart.ts b/src/commands/fleet/restart.ts index e81067b07..9a6c6c9d8 100644 --- a/src/commands/fleet/restart.ts +++ b/src/commands/fleet/restart.ts @@ -16,7 +16,6 @@ */ import { Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import * as ca from '../../utils/common-args'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { applicationIdInfo } from '../../utils/messages'; @@ -39,10 +38,6 @@ export default class FleetRestartCmd extends Command { fleet: ca.fleetRequired, }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/fleet/rm.ts b/src/commands/fleet/rm.ts index c115f67fa..c768b74d9 100644 --- a/src/commands/fleet/rm.ts +++ b/src/commands/fleet/rm.ts @@ -44,7 +44,6 @@ export default class FleetRmCmd extends Command { public static flags = { yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/fleet/track-latest.ts b/src/commands/fleet/track-latest.ts index 588592ee4..2547d9b2b 100644 --- a/src/commands/fleet/track-latest.ts +++ b/src/commands/fleet/track-latest.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class FleetTrackLatestCmd extends Command { @@ -37,10 +36,6 @@ export default class FleetTrackLatestCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/join/index.ts b/src/commands/join/index.ts index 2e3ccc7fc..5427cb576 100644 --- a/src/commands/join/index.ts +++ b/src/commands/join/index.ts @@ -65,7 +65,6 @@ export default class JoinCmd extends Command { description: 'the interval in minutes to check for updates', char: 'i', }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/leave/index.ts b/src/commands/leave/index.ts index 9ff813999..123631a8f 100644 --- a/src/commands/leave/index.ts +++ b/src/commands/leave/index.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { stripIndent } from '../../utils/lazy'; import { parseAsLocalHostnameOrIp } from '../../utils/validation'; @@ -49,10 +48,6 @@ export default class LeaveCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public static primary = true; diff --git a/src/commands/local/configure.ts b/src/commands/local/configure.ts index 7e72fb60d..1cdd244ca 100644 --- a/src/commands/local/configure.ts +++ b/src/commands/local/configure.ts @@ -17,7 +17,6 @@ import { Args, Command } from '@oclif/core'; import { promisify } from 'util'; -import * as cf from '../../utils/common-flags'; import { stripIndent } from '../../utils/lazy'; export default class LocalConfigureCmd extends Command { @@ -39,10 +38,6 @@ export default class LocalConfigureCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static root = true; public static offlineCompatible = true; diff --git a/src/commands/local/flash.ts b/src/commands/local/flash.ts index 592e0993a..89c097efb 100644 --- a/src/commands/local/flash.ts +++ b/src/commands/local/flash.ts @@ -48,7 +48,6 @@ export default class LocalFlashCmd extends Command { public static flags = { drive: cf.drive, yes: cf.yes, - help: cf.help, }; public static offlineCompatible = true; diff --git a/src/commands/login/index.ts b/src/commands/login/index.ts index 7fb7de770..34d7fbfb7 100644 --- a/src/commands/login/index.ts +++ b/src/commands/login/index.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent, getCliForm } from '../../utils/lazy'; import { ExpectedError } from '../../errors'; import type { WhoamiResult } from 'balena-sdk'; @@ -29,7 +28,6 @@ interface FlagsDef { user?: string; password?: string; port?: number; - help: void; hideExperimentalWarning: boolean; } @@ -111,7 +109,6 @@ export default class LoginCmd extends Command { default: false, description: 'Hides warning for experimental features', }), - help: cf.help, }; public static primary = true; diff --git a/src/commands/organization/list.ts b/src/commands/organization/list.ts index 34df0174a..df252d836 100644 --- a/src/commands/organization/list.ts +++ b/src/commands/organization/list.ts @@ -16,7 +16,6 @@ */ import { Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; export default class OrganizationListCmd extends Command { @@ -30,10 +29,6 @@ export default class OrganizationListCmd extends Command { `; public static examples = ['$ balena organization list']; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/os/build-config.ts b/src/commands/os/build-config.ts index caac821a7..7a15613b5 100644 --- a/src/commands/os/build-config.ts +++ b/src/commands/os/build-config.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getCliForm, stripIndent } from '../../utils/lazy'; import * as _ from 'lodash'; import type { DeviceTypeJson } from 'balena-sdk'; @@ -55,7 +54,6 @@ export default class OsBuildConfigCmd extends Command { char: 'o', required: true, }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/os/configure.ts b/src/commands/os/configure.ts index cb9669ef5..da497c361 100644 --- a/src/commands/os/configure.ts +++ b/src/commands/os/configure.ts @@ -154,7 +154,6 @@ export default class OsConfigureCmd extends Command { 'expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)', exclusive: ['config', 'device'], }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/os/download.ts b/src/commands/os/download.ts index 00ae0787b..4635fcdd8 100644 --- a/src/commands/os/download.ts +++ b/src/commands/os/download.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { stripIndent } from '../../utils/lazy'; export default class OsDownloadCmd extends Command { @@ -78,7 +77,6 @@ export default class OsDownloadCmd extends Command { or 'menu-esr' (interactive menu, ESR versions) `, }), - help: cf.help, }; public async run() { diff --git a/src/commands/os/initialize.ts b/src/commands/os/initialize.ts index 76c5063f0..c6d4b52ae 100644 --- a/src/commands/os/initialize.ts +++ b/src/commands/os/initialize.ts @@ -51,7 +51,6 @@ export default class OsInitializeCmd extends Command { type: cf.deviceType, drive: cf.drive, yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/os/versions.ts b/src/commands/os/versions.ts index bdd1c0b83..1937885bc 100644 --- a/src/commands/os/versions.ts +++ b/src/commands/os/versions.ts @@ -16,7 +16,6 @@ */ import { Flags, Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { stripIndent } from '../../utils/lazy'; export default class OsVersionsCmd extends Command { @@ -40,7 +39,6 @@ export default class OsVersionsCmd extends Command { }; public static flags = { - help: cf.help, esr: Flags.boolean({ description: 'select balenaOS ESR versions', default: false, diff --git a/src/commands/preload/index.ts b/src/commands/preload/index.ts index 0d5205ca9..0cdfc63b7 100644 --- a/src/commands/preload/index.ts +++ b/src/commands/preload/index.ts @@ -128,9 +128,6 @@ Can be repeated to add multiple certificates.\ 'Docker daemon TCP port number (hint: 2375 for balena devices)', parse: async (p) => parseAsInteger(p, 'dockerPort'), }), - // Not supporting -h for help, because of clash with -h in DockerCliFlags - // Revisit this in future release. - help: Flags.help({}), }; public static authenticated = true; diff --git a/src/commands/push/index.ts b/src/commands/push/index.ts index 520c25111..2b8b6e726 100644 --- a/src/commands/push/index.ts +++ b/src/commands/push/index.ts @@ -17,7 +17,6 @@ import { Flags, Args, Command } from '@oclif/core'; import type { Interfaces } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; import { dockerignoreHelp, registrySecretsHelp } from '../../utils/messages'; import type { BalenaSDK } from 'balena-sdk'; @@ -218,7 +217,6 @@ export default class PushCmd extends Command { default: false, }), note: Flags.string({ description: 'The notes for this release' }), - help: cf.help, }; public static primary = true; diff --git a/src/commands/release/finalize.ts b/src/commands/release/finalize.ts index e1f6c2296..20276e2e2 100644 --- a/src/commands/release/finalize.ts +++ b/src/commands/release/finalize.ts @@ -17,7 +17,6 @@ import { Command } from '@oclif/core'; import { commitOrIdArg } from '.'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class ReleaseFinalizeCmd extends Command { @@ -40,10 +39,6 @@ export default class ReleaseFinalizeCmd extends Command { '$ balena release finalize 1234567', ]; - public static flags = { - help: cf.help, - }; - public static args = { commitOrId: commitOrIdArg({ description: 'the commit or ID of the release to finalize', diff --git a/src/commands/release/index.ts b/src/commands/release/index.ts index 1b9db22e1..0c6cc19ab 100644 --- a/src/commands/release/index.ts +++ b/src/commands/release/index.ts @@ -43,7 +43,6 @@ export default class ReleaseCmd extends Command { public static flags = { json: cf.json, - help: cf.help, composition: Flags.boolean({ default: false, char: 'c', diff --git a/src/commands/release/invalidate.ts b/src/commands/release/invalidate.ts index 26cfee608..42f952c81 100644 --- a/src/commands/release/invalidate.ts +++ b/src/commands/release/invalidate.ts @@ -17,7 +17,6 @@ import { Command } from '@oclif/core'; import { commitOrIdArg } from '.'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class ReleaseInvalidateCmd extends Command { @@ -35,10 +34,6 @@ export default class ReleaseInvalidateCmd extends Command { '$ balena release invalidate 1234567', ]; - public static flags = { - help: cf.help, - }; - public static args = { commitOrId: commitOrIdArg({ description: 'the commit or ID of the release to invalidate', diff --git a/src/commands/release/list.ts b/src/commands/release/list.ts index bd4584da5..dace069e6 100644 --- a/src/commands/release/list.ts +++ b/src/commands/release/list.ts @@ -42,7 +42,6 @@ export default class ReleaseListCmd extends Command { public static flags = { json: cf.json, - help: cf.help, }; public static args = { diff --git a/src/commands/release/validate.ts b/src/commands/release/validate.ts index 83c269daf..83d3e9ab6 100644 --- a/src/commands/release/validate.ts +++ b/src/commands/release/validate.ts @@ -17,7 +17,6 @@ import { Command } from '@oclif/core'; import { commitOrIdArg } from '.'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class ReleaseValidateCmd extends Command { @@ -34,10 +33,6 @@ export default class ReleaseValidateCmd extends Command { '$ balena release validate 1234567', ]; - public static flags = { - help: cf.help, - }; - public static args = { commitOrId: commitOrIdArg({ description: 'the commit or ID of the release to validate', diff --git a/src/commands/settings/index.ts b/src/commands/settings/index.ts index f5ca58f04..6dfaa5bcc 100644 --- a/src/commands/settings/index.ts +++ b/src/commands/settings/index.ts @@ -16,7 +16,6 @@ */ import { Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class SettingsCmd extends Command { @@ -27,10 +26,6 @@ export default class SettingsCmd extends Command { `; public static examples = ['$ balena settings']; - public static flags = { - help: cf.help, - }; - public async run() { await this.parse(SettingsCmd); diff --git a/src/commands/ssh-key/add.ts b/src/commands/ssh-key/add.ts index 59532fc9f..4180792b2 100644 --- a/src/commands/ssh-key/add.ts +++ b/src/commands/ssh-key/add.ts @@ -17,7 +17,6 @@ import { Args, Command } from '@oclif/core'; import { ExpectedError } from '../../errors'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, stripIndent } from '../../utils/lazy'; export default class SSHKeyAddCmd extends Command { @@ -63,10 +62,6 @@ export default class SSHKeyAddCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/ssh-key/index.ts b/src/commands/ssh-key/index.ts index 79a970360..bb8ca1f8a 100644 --- a/src/commands/ssh-key/index.ts +++ b/src/commands/ssh-key/index.ts @@ -16,7 +16,6 @@ */ import { Args, Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; import { parseAsInteger } from '../../utils/validation'; @@ -40,10 +39,6 @@ export default class SSHKeyCmd extends Command { }), }; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/ssh-key/list.ts b/src/commands/ssh-key/list.ts index 549be44a1..d081e6402 100644 --- a/src/commands/ssh-key/list.ts +++ b/src/commands/ssh-key/list.ts @@ -16,7 +16,6 @@ */ import { Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy'; export default class SSHKeyListCmd extends Command { @@ -30,10 +29,6 @@ export default class SSHKeyListCmd extends Command { `; public static examples = ['$ balena ssh-key list']; - public static flags = { - help: cf.help, - }; - public static authenticated = true; public async run() { diff --git a/src/commands/ssh-key/rm.ts b/src/commands/ssh-key/rm.ts index 7cbcee7b1..273cfa948 100644 --- a/src/commands/ssh-key/rm.ts +++ b/src/commands/ssh-key/rm.ts @@ -47,7 +47,6 @@ export default class SSHKeyRmCmd extends Command { public static flags = { yes: cf.yes, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/support/index.ts b/src/commands/support/index.ts index 50d4e4201..6c100a247 100644 --- a/src/commands/support/index.ts +++ b/src/commands/support/index.ts @@ -66,7 +66,6 @@ export default class SupportCmd extends Command { 'length of time to enable support for, in (h)ours or (d)ays, e.g. 12h, 2d', char: 't', }), - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/tag/list.ts b/src/commands/tag/list.ts index 07c3daeb8..40ca940ef 100644 --- a/src/commands/tag/list.ts +++ b/src/commands/tag/list.ts @@ -54,7 +54,6 @@ export default class TagListCmd extends Command { ...cf.release, exclusive: ['fleet', 'device'], }, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/tag/rm.ts b/src/commands/tag/rm.ts index 3c1585cc8..622b6f35a 100644 --- a/src/commands/tag/rm.ts +++ b/src/commands/tag/rm.ts @@ -57,7 +57,6 @@ export default class TagRmCmd extends Command { ...cf.release, exclusive: ['fleet', 'device'], }, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/tag/set.ts b/src/commands/tag/set.ts index 60575a32e..adb79a1ef 100644 --- a/src/commands/tag/set.ts +++ b/src/commands/tag/set.ts @@ -71,7 +71,6 @@ export default class TagSetCmd extends Command { ...cf.release, exclusive: ['fleet', 'device'], }, - help: cf.help, }; public static authenticated = true; diff --git a/src/commands/util/available-drives.ts b/src/commands/util/available-drives.ts index 3de865cfb..d47427181 100644 --- a/src/commands/util/available-drives.ts +++ b/src/commands/util/available-drives.ts @@ -16,7 +16,6 @@ */ import { Command } from '@oclif/core'; -import * as cf from '../../utils/common-flags'; import { stripIndent, getChalk, getVisuals } from '../../utils/lazy'; export default class UtilAvailableDrivesCmd extends Command { @@ -27,10 +26,6 @@ export default class UtilAvailableDrivesCmd extends Command { Does not list system drives. `; - public static flags = { - help: cf.help, - }; - public static offlineCompatible = true; public async run() { diff --git a/src/commands/version/index.ts b/src/commands/version/index.ts index c7f5919c6..2624b2e57 100644 --- a/src/commands/version/index.ts +++ b/src/commands/version/index.ts @@ -63,7 +63,6 @@ export default class VersionCmd extends Command { description: 'output version information in JSON format for programmatic use', }), - help: Flags.help({ char: 'h' }), }; public async run() { diff --git a/src/help.ts b/src/help.ts index 85e7fd512..16b753915 100644 --- a/src/help.ts +++ b/src/help.ts @@ -28,7 +28,7 @@ function getHelpSubject(args: string[]): string | undefined { if (arg === '--') { return; } - if (arg === 'help' || arg === '--help' || arg === '-h') { + if (arg === 'help' || arg === '--help') { continue; } if (arg.startsWith('-')) { @@ -135,7 +135,7 @@ export default class BalenaHelp extends Help { } const globalOps = [ - ['--help, -h', 'display command help'], + ['--help', 'display command help'], ['--debug', 'enable debug output'], [ '--unsupported', diff --git a/src/preparser.ts b/src/preparser.ts index 7fa068823..242af795f 100644 --- a/src/preparser.ts +++ b/src/preparser.ts @@ -40,8 +40,8 @@ export async function preparseArgs(argv: string[]): Promise { if (['--version', '-v'].includes(cmdSlice[0])) { cmdSlice[0] = 'version'; } - // convert 'balena --help' or 'balena -h' to 'balena help' - else if (['--help', '-h'].includes(cmdSlice[0])) { + // convert 'balena --help' to 'balena help' + else if ('--help' === cmdSlice[0]) { cmdSlice[0] = 'help'; } // convert e.g. 'balena help env set' to 'balena env set --help' diff --git a/src/utils/application-create.ts b/src/utils/application-create.ts index 072b561cd..b25acc982 100644 --- a/src/utils/application-create.ts +++ b/src/utils/application-create.ts @@ -4,7 +4,6 @@ import { getBalenaSdk } from './lazy'; export interface FlagsDef { organization?: string; type?: string; // application device type - help: void; } export interface ArgsDef { diff --git a/src/utils/common-flags.ts b/src/utils/common-flags.ts index 8f687cf11..ba84db139 100644 --- a/src/utils/common-flags.ts +++ b/src/utils/common-flags.ts @@ -30,8 +30,6 @@ export const device = Flags.string({ description: 'device UUID', }); -export const help = Flags.help({ char: 'h' }); - export const quiet = Flags.boolean({ char: 'q', description: 'suppress warning messages', diff --git a/tests/commands/app/create.spec.ts b/tests/commands/app/create.spec.ts deleted file mode 100644 index 290b5e378..000000000 --- a/tests/commands/app/create.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * Copyright 2019-2020 Balena Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { expect } from 'chai'; -import { BalenaAPIMock } from '../../nock/balena-api-mock'; -import { cleanOutput, runCommand } from '../../helpers'; - -const HELP_MESSAGE = ''; - -describe('balena app create', function () { - let api: BalenaAPIMock; - - beforeEach(() => { - api = new BalenaAPIMock(); - }); - - afterEach(() => { - // Check all expected api calls have been made and clean up. - api.done(); - }); - - // Temporarily skipped because of parse/checking order issue with -h - it.skip('should print help text with the -h flag', async () => { - api.expectGetWhoAmI({ optional: true }); - - const { out, err } = await runCommand('app create -h'); - - expect(cleanOutput(out)).to.deep.equal(cleanOutput([HELP_MESSAGE])); - - expect(err).to.eql([]); - }); -}); diff --git a/tests/commands/device-type/list.spec.ts b/tests/commands/device-type/list.spec.ts index 64bce186f..556b52ef0 100644 --- a/tests/commands/device-type/list.spec.ts +++ b/tests/commands/device-type/list.spec.ts @@ -33,8 +33,8 @@ describe('balena device-type list', function () { api.done(); }); - it('should print help text with the -h flag', async () => { - const { out, err } = await runCommand('device-type list -h'); + it('should print help text with the --help flag', async () => { + const { out, err } = await runCommand('device-type list --help'); expect(cleanOutput(out)).to.contain('$ balena device-type list'); diff --git a/tests/commands/help.spec.ts b/tests/commands/help.spec.ts index 0b395232d..4d0db6473 100644 --- a/tests/commands/help.spec.ts +++ b/tests/commands/help.spec.ts @@ -98,7 +98,7 @@ const LIST_ADDITIONAL = ` const GLOBAL_OPTIONS = ` GLOBAL OPTIONS - --help, -h + --help --debug `; From 4b3fdcf99c1dfa2dfe699d5ee1bdf9ee34338ca9 Mon Sep 17 00:00:00 2001 From: jaomaloy Date: Mon, 21 Oct 2024 21:06:02 +0800 Subject: [PATCH 33/34] `device update`: Use detached HUP for os updates This will not track HUP progress when we call OS update in the CLI but will allow for more reliable OS updates by default. Change-type: major --- src/commands/device/os-update.ts | 15 ++++++++-- src/utils/patterns.ts | 48 +------------------------------- 2 files changed, 14 insertions(+), 49 deletions(-) diff --git a/src/commands/device/os-update.ts b/src/commands/device/os-update.ts index 580d2eefe..47aa5fdf3 100644 --- a/src/commands/device/os-update.ts +++ b/src/commands/device/os-update.ts @@ -146,7 +146,18 @@ export default class DeviceOsUpdateCmd extends Command { 'Host OS updates require a device restart when they complete. Are you sure you want to proceed?', ); - await sdk.models.device.startOsUpdate(uuid, targetOsVersion); - await patterns.awaitDeviceOsUpdate(uuid, targetOsVersion); + await sdk.models.device + .startOsUpdate(uuid, targetOsVersion, { + runDetached: true, + }) + .then(() => { + console.log( + `The balena OS update has started. You can keep track of the progress via the dashboard.\n` + + `To open the dashboard page related to a device via the CLI, you can use \`balena device UUID --view\``, + ); + }) + .catch((error) => { + console.error(`Failed to start OS update for device ${uuid}:`, error); + }); } } diff --git a/src/utils/patterns.ts b/src/utils/patterns.ts index 1ea2cafd3..b13ba8fd5 100644 --- a/src/utils/patterns.ts +++ b/src/utils/patterns.ts @@ -30,9 +30,8 @@ import { ExpectedError, NotAvailableInOfflineModeError, } from '../errors'; -import { getBalenaSdk, getVisuals, stripIndent, getCliForm } from './lazy'; +import { getBalenaSdk, stripIndent, getCliForm } from './lazy'; import validation = require('./validation'); -import { delay } from './helpers'; export function authenticate(options: object): Promise { const balena = getBalenaSdk(); @@ -286,51 +285,6 @@ export async function getAndSelectOrganization() { } } -export async function awaitDeviceOsUpdate( - uuid: string, - targetOsVersion: string, -) { - const balena = getBalenaSdk(); - - const deviceName = await balena.models.device.getName(uuid); - const visuals = getVisuals(); - const progressBar = new visuals.Progress( - `Updating the OS of ${deviceName} to v${targetOsVersion}`, - ); - progressBar.update({ percentage: 0 }); - - const poll = async (): Promise => { - const [osUpdateStatus, { overall_progress: osUpdateProgress }] = - await Promise.all([ - balena.models.device.getOsUpdateStatus(uuid), - balena.models.device.get(uuid, { $select: 'overall_progress' }), - ]); - if (osUpdateStatus.status === 'done') { - console.info( - `The device ${deviceName} has been updated to v${targetOsVersion} and will restart shortly!`, - ); - return; - } - - if (osUpdateStatus.error) { - throw new ExpectedError( - `Failed to complete Host OS update on device ${deviceName}\n${osUpdateStatus.error}`, - ); - } - - if (osUpdateProgress !== null) { - // Avoid resetting to 0% at end of process when device goes disconnected. - progressBar.update({ percentage: osUpdateProgress }); - } - - await delay(3000); - await poll(); - }; - - await poll(); - return uuid; -} - /* * Given fleetOrDevice, which may be * - a fleet name From 07a7bd76fe50f7c4daca507268ac641067b9cd07 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Fri, 25 Oct 2024 12:36:25 -0400 Subject: [PATCH 34/34] Deduplicate dependencies --- npm-shrinkwrap.json | 47 ++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 241553bd7..051dcb683 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1264,13 +1264,12 @@ "dev": true }, "node_modules/@babel/parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.9.tgz", - "integrity": "sha512-aI3jjAAO1fh7vY/pBGsn1i9LDbRP43+asrRlkPuTXW5yHXtd1NgTEMudbBoDDxrf1daEEfPJqR+JBMakzrR4Dg==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.0.tgz", + "integrity": "sha512-aP8x5pIw3xvYr/sXT+SEUwyhrXT8rUJRZltK/qN3Db80dcKpTett8cJxHyjk+xYSVXvNnl2SfcJVjbwxpOSscA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/types": "^7.25.9" + "@babel/types": "^7.26.0" }, "bin": { "parser": "bin/babel-parser.js" @@ -1280,11 +1279,10 @@ } }, "node_modules/@babel/parser/node_modules/@babel/types": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.9.tgz", - "integrity": "sha512-OwS2CM5KocvQ/k7dFJa8i5bNGJP0hXWfVCfDkqRFP1IreH1JDC7wG6eCYCi0+McbfT8OR/kNqsI0UU0xP9H6PQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", + "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" @@ -1308,11 +1306,10 @@ } }, "node_modules/@babel/template/node_modules/@babel/types": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.9.tgz", - "integrity": "sha512-OwS2CM5KocvQ/k7dFJa8i5bNGJP0hXWfVCfDkqRFP1IreH1JDC7wG6eCYCi0+McbfT8OR/kNqsI0UU0xP9H6PQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", + "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" @@ -1343,13 +1340,13 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/generator": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.9.tgz", - "integrity": "sha512-omlUGkr5EaoIJrhLf9CJ0TvjBRpd9+AXRG//0GEQ9THSo8wPiTlbpy1/Ow8ZTrbXpjd9FHXfbFQx32I04ht0FA==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.0.tgz", + "integrity": "sha512-/AIkAmInnWwgEAJGQr9vY0c66Mj6kjkE2ZPB1PurTRaRAh3U+J45sAQMjQDJdh4WbR3l0x5xkimXBKyBXXAu2w==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/types": "^7.25.9", + "@babel/parser": "^7.26.0", + "@babel/types": "^7.26.0", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -1359,11 +1356,10 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/types": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.9.tgz", - "integrity": "sha512-OwS2CM5KocvQ/k7dFJa8i5bNGJP0hXWfVCfDkqRFP1IreH1JDC7wG6eCYCi0+McbfT8OR/kNqsI0UU0xP9H6PQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", + "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" @@ -3940,10 +3936,9 @@ } }, "node_modules/@types/node": { - "version": "20.16.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.15.tgz", - "integrity": "sha512-DV58qQz9dBMqVVn+qnKwGa51QzCD4YM/tQM16qLKxdf5tqz5W4QwtrMzjSTbabN1cFTSuyxVYBy+QWHjWW8X/g==", - "license": "MIT", + "version": "20.17.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.1.tgz", + "integrity": "sha512-j2VlPv1NnwPJbaCNv69FO/1z4lId0QmGvpT41YxitRtWlg96g/j8qcv2RKsLKe2F6OJgyXhupN1Xo17b2m139Q==", "dependencies": { "undici-types": "~6.19.2" }