From f76ca1804aef20852edd6176ab0eda58b2d7984c Mon Sep 17 00:00:00 2001 From: Paulo Castro Date: Wed, 11 Sep 2019 14:35:06 +0100 Subject: [PATCH] Update balena-sdk from 11.18.0 to 12.10.0 (pre-req for #1153 and #1304) Change-type: patch Signed-off-by: Paulo Castro --- lib/utils/cloud.ts | 21 +++++- lib/utils/helpers.ts | 6 +- npm-shrinkwrap.json | 153 +++++++++++++++++++++++++++++++++++-------- package.json | 4 +- 4 files changed, 151 insertions(+), 33 deletions(-) diff --git a/lib/utils/cloud.ts b/lib/utils/cloud.ts index f10dd5c7..9b3b19c7 100644 --- a/lib/utils/cloud.ts +++ b/lib/utils/cloud.ts @@ -1,9 +1,26 @@ -import { BalenaSDK } from 'balena-sdk'; +/** + * @license + * Copyright 2019 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 { BalenaSDK, Service } from 'balena-sdk'; import memoize = require('lodash/memoize'); export const serviceIdToName = memoize( async (sdk: BalenaSDK, serviceId: number): Promise => { - const serviceName = await sdk.pine.get({ + const serviceName = await sdk.pine.get({ resource: 'service', id: serviceId, options: { diff --git a/lib/utils/helpers.ts b/lib/utils/helpers.ts index beab4ba5..9ef49193 100644 --- a/lib/utils/helpers.ts +++ b/lib/utils/helpers.ts @@ -134,7 +134,9 @@ export function getArchAndDeviceType( getApplication(applicationName), balena.models.config.getDeviceTypes(), function(app, deviceTypes) { - const config = _.find(deviceTypes, { slug: app.device_type }); + const config = _.find(deviceTypes, { + slug: app.device_type, + }); if (!config) { throw new Error('Could not read application information!'); @@ -150,7 +152,7 @@ export function getApplication(applicationName: string) { // that off to a special handler (before importing any modules) const match = applicationName.split('/'); - const extraOptions = { + const extraOptions: BalenaSdk.PineOptionsFor = { $expand: { application_type: { $select: ['name', 'slug', 'supports_multicontainer', 'is_legacy'], diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a92c4938..e51c1421 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -511,8 +511,7 @@ "@types/common-tags": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@types/common-tags/-/common-tags-1.4.0.tgz", - "integrity": "sha512-HI1tSO87vmd1sPS3DOVSK4gvVKROvCBFvAnXlLiQtAus/+1xXMQcNyu9TX2ChwRXFeQZeB9+f+nMo99xLd5DdA==", - "dev": true + "integrity": "sha512-HI1tSO87vmd1sPS3DOVSK4gvVKROvCBFvAnXlLiQtAus/+1xXMQcNyu9TX2ChwRXFeQZeB9+f+nMo99xLd5DdA==" }, "@types/depcheck": { "version": "0.6.0", @@ -1749,6 +1748,41 @@ "mkdirp": "^0.5.1", "rimraf": "^2.4.1", "semver": "^5.3.0" + }, + "dependencies": { + "@types/node": { + "version": "8.10.54", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.54.tgz", + "integrity": "sha512-kaYyLYf6ICn6/isAyD4K1MyWWd5Q3JgH6bnMN089LUx88+s4W8GvK9Q6JMBVu5vsFFp7pMdSxdKmlBXwH/VFRg==" + }, + "balena-sdk": { + "version": "11.18.2", + "resolved": "https://registry.npmjs.org/balena-sdk/-/balena-sdk-11.18.2.tgz", + "integrity": "sha512-1umbGqBJc+18vVzKsHW8Q/8RFjqWbHY2VoZGVG96prqYjXxFIIprcoSaNY7IHaqAFkuo+xzd5ieHBo2RUNT1iw==", + "requires": { + "@types/bluebird": "3.5.21", + "@types/common-tags": "^1.4.0", + "@types/node": "^8.0.53", + "abortcontroller-polyfill": "^1.1.9", + "balena-auth": "^3.0.0", + "balena-errors": "^4.0.0", + "balena-hup-action-utils": "~1.2.0", + "balena-pine": "^9.0.0", + "balena-register-device": "^6.0.0", + "balena-request": "^10.0.0", + "balena-semver": "^2.0.0", + "balena-settings-client": "^4.0.0", + "bluebird": "^3.3.1", + "common-tags": "^1.8.0", + "lodash": "^4.4.0", + "memoizee": "^0.4.9", + "moment": "^2.18.1", + "ndjson": "^1.5.0", + "promise-memoize": "^1.2.0", + "resin-device-status": "^1.0.1", + "semver": "^5.3.0" + } + } } }, "balena-pine": { @@ -1802,6 +1836,39 @@ "unzipper": "^0.8.9" }, "dependencies": { + "@types/node": { + "version": "8.10.54", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.54.tgz", + "integrity": "sha512-kaYyLYf6ICn6/isAyD4K1MyWWd5Q3JgH6bnMN089LUx88+s4W8GvK9Q6JMBVu5vsFFp7pMdSxdKmlBXwH/VFRg==" + }, + "balena-sdk": { + "version": "11.18.2", + "resolved": "https://registry.npmjs.org/balena-sdk/-/balena-sdk-11.18.2.tgz", + "integrity": "sha512-1umbGqBJc+18vVzKsHW8Q/8RFjqWbHY2VoZGVG96prqYjXxFIIprcoSaNY7IHaqAFkuo+xzd5ieHBo2RUNT1iw==", + "requires": { + "@types/bluebird": "3.5.21", + "@types/common-tags": "^1.4.0", + "@types/node": "^8.0.53", + "abortcontroller-polyfill": "^1.1.9", + "balena-auth": "^3.0.0", + "balena-errors": "^4.0.0", + "balena-hup-action-utils": "~1.2.0", + "balena-pine": "^9.0.0", + "balena-register-device": "^6.0.0", + "balena-request": "^10.0.0", + "balena-semver": "^2.0.0", + "balena-settings-client": "^4.0.0", + "bluebird": "^3.3.1", + "common-tags": "^1.8.0", + "lodash": "^4.4.0", + "memoizee": "^0.4.9", + "moment": "^2.18.1", + "ndjson": "^1.5.0", + "promise-memoize": "^1.2.0", + "resin-device-status": "^1.0.1", + "semver": "^5.3.0" + } + }, "bl": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bl/-/bl-3.0.0.tgz", @@ -1921,17 +1988,18 @@ } }, "balena-sdk": { - "version": "11.18.2", - "resolved": "https://registry.npmjs.org/balena-sdk/-/balena-sdk-11.18.2.tgz", - "integrity": "sha512-1umbGqBJc+18vVzKsHW8Q/8RFjqWbHY2VoZGVG96prqYjXxFIIprcoSaNY7IHaqAFkuo+xzd5ieHBo2RUNT1iw==", + "version": "12.10.0", + "resolved": "https://registry.npmjs.org/balena-sdk/-/balena-sdk-12.10.0.tgz", + "integrity": "sha512-nE3zJ5heZPVYBnoQPUo/uEFXyCtaDXOItIDcMAMBaCBurTQDHlbfg1d/C62ahBti2mowI927eIHqAQ4Huyrglw==", "requires": { "@types/bluebird": "3.5.21", "@types/common-tags": "^1.4.0", "@types/node": "^8.0.53", "abortcontroller-polyfill": "^1.1.9", "balena-auth": "^3.0.0", - "balena-errors": "^4.0.0", - "balena-hup-action-utils": "~1.2.0", + "balena-device-status": "^3.1.0", + "balena-errors": "^4.1.0", + "balena-hup-action-utils": "~3.0.0", "balena-pine": "^9.0.0", "balena-register-device": "^6.0.0", "balena-request": "^10.0.0", @@ -1944,19 +2012,22 @@ "moment": "^2.18.1", "ndjson": "^1.5.0", "promise-memoize": "^1.2.0", - "resin-device-status": "^1.0.1", "semver": "^5.3.0" }, "dependencies": { - "@types/common-tags": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@types/common-tags/-/common-tags-1.8.0.tgz", - "integrity": "sha512-htRqZr5qn8EzMelhX/Xmx142z218lLyGaeZ3YR8jlze4TATRU9huKKvuBmAJEW4LCC4pnY1N6JAm6p85fMHjhg==" - }, "@types/node": { - "version": "8.10.49", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.49.tgz", - "integrity": "sha512-YX30JVx0PvSmJ3Eqr74fYLGeBxD+C7vIL20ek+GGGLJeUbVYRUW3EzyAXpIRA0K8c8o0UWqR/GwEFYiFoz1T8w==" + "version": "8.10.54", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.54.tgz", + "integrity": "sha512-kaYyLYf6ICn6/isAyD4K1MyWWd5Q3JgH6bnMN089LUx88+s4W8GvK9Q6JMBVu5vsFFp7pMdSxdKmlBXwH/VFRg==" + }, + "balena-hup-action-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/balena-hup-action-utils/-/balena-hup-action-utils-3.0.0.tgz", + "integrity": "sha512-vBRfcA7iBBvsY61ORpRFYGj65UmKwmsT0lZPA3lokCn8f3fDAqjXn5+c1kRH/i48HoU55FuPy2qqcuDNdqRr9w==", + "requires": { + "balena-semver": "^2.0.0", + "lodash": "^4.17.11" + } } } }, @@ -1971,15 +2042,10 @@ "semver": "^5.3.0" }, "dependencies": { - "@types/lodash": { - "version": "4.14.121", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.121.tgz", - "integrity": "sha512-ORj7IBWj13iYufXt/VXrCNMbUuCTJfhzme5kx9U/UtcIPdJYuvPDUAlHlbNhz/8lKCLy9XGIZnGrqXOtQbPGoQ==" - }, "@types/semver": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.0.1.tgz", - "integrity": "sha512-ffCdcrEE5h8DqVxinQjo+2d1q+FV5z7iNtPofw3JsrltSoSVlOGaW0rY8XxtO9XukdTn8TaCGWmk2VFGhI70mg==" + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.0.2.tgz", + "integrity": "sha512-G1Ggy7/9Nsa1Jt2yiBR2riEuyK2DFNnqow6R7cromXPMNynackRY1vqFTLz/gwnef1LHokbXThcPhqMRjUbkpQ==" } } }, @@ -2051,6 +2117,11 @@ "underscore.string": "^3.2.3" }, "dependencies": { + "@types/node": { + "version": "8.10.54", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.54.tgz", + "integrity": "sha512-kaYyLYf6ICn6/isAyD4K1MyWWd5Q3JgH6bnMN089LUx88+s4W8GvK9Q6JMBVu5vsFFp7pMdSxdKmlBXwH/VFRg==" + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -2061,6 +2132,34 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" }, + "balena-sdk": { + "version": "11.18.2", + "resolved": "https://registry.npmjs.org/balena-sdk/-/balena-sdk-11.18.2.tgz", + "integrity": "sha512-1umbGqBJc+18vVzKsHW8Q/8RFjqWbHY2VoZGVG96prqYjXxFIIprcoSaNY7IHaqAFkuo+xzd5ieHBo2RUNT1iw==", + "requires": { + "@types/bluebird": "3.5.21", + "@types/common-tags": "^1.4.0", + "@types/node": "^8.0.53", + "abortcontroller-polyfill": "^1.1.9", + "balena-auth": "^3.0.0", + "balena-errors": "^4.0.0", + "balena-hup-action-utils": "~1.2.0", + "balena-pine": "^9.0.0", + "balena-register-device": "^6.0.0", + "balena-request": "^10.0.0", + "balena-semver": "^2.0.0", + "balena-settings-client": "^4.0.0", + "bluebird": "^3.3.1", + "common-tags": "^1.8.0", + "lodash": "^4.4.0", + "memoizee": "^0.4.9", + "moment": "^2.18.1", + "ndjson": "^1.5.0", + "promise-memoize": "^1.2.0", + "resin-device-status": "^1.0.1", + "semver": "^5.3.0" + } + }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", @@ -16990,9 +17089,9 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "typescript": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.3.tgz", - "integrity": "sha512-FFgHdPt4T/duxx6Ndf7hwgMZZjZpB+U0nMNGVCYPq0rEzWKjEDobm4J6yb3CS7naZ0yURFqdw9Gwc7UOh/P9oQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz", + "integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==", "dev": true }, "udif": { diff --git a/package.json b/package.json index e66148ce..0ccae62b 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "shell-escape": "^0.2.0", "sinon": "^7.4.1", "ts-node": "^8.1.0", - "typescript": "3.4.3" + "typescript": "^3.4.5" }, "dependencies": { "@oclif/command": "^1.5.12", @@ -151,7 +151,7 @@ "balena-device-status": "^3.1.2", "balena-image-manager": "^6.0.0", "balena-preload": "^8.2.1", - "balena-sdk": "^11.18.0", + "balena-sdk": "^12.10.0", "balena-settings-client": "^4.0.0", "balena-sync": "^10.0.3", "bash": "0.0.1",