@balena/open-balena-api 27.2.0-build-device-type-helper-renames-157bd23edea9331400a53d43773b637cc56e41b8-1 → 27.2.0-build-device-type-helper-renames-8e842aedd18dd4e4133c351a45d6b76bd665ada4-1
Sign up to get free protection for your applications and to get access to all the features.
@@ -60,15 +60,10 @@ export const validateSlug = (slug) => {
|
|
60
60
|
}
|
61
61
|
return slug;
|
62
62
|
};
|
63
|
-
/** @deprecated */
|
64
|
-
const getAllDeviceTypes = async () => {
|
65
|
-
const dtInfo = await getDeviceTypes();
|
66
|
-
return _.uniqBy(Object.values(dtInfo).map((dtEntry) => dtEntry.latest), (dt) => dt.slug);
|
67
|
-
};
|
68
63
|
/** @deprecated Prefer querying the device_type resource directly unless you need the device-type.json contents. */
|
69
64
|
export const getAccessibleDeviceTypeJsons = async (resinApi) => {
|
70
|
-
const [
|
71
|
-
|
65
|
+
const [deviceTypeInfosBySlug, accessibleDeviceTypes] = await Promise.all([
|
66
|
+
getDeviceTypes(),
|
72
67
|
resinApi.get({
|
73
68
|
resource: 'device_type',
|
74
69
|
options: {
|
@@ -76,10 +71,9 @@ export const getAccessibleDeviceTypeJsons = async (resinApi) => {
|
|
76
71
|
},
|
77
72
|
}),
|
78
73
|
]);
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
});
|
74
|
+
return accessibleDeviceTypes
|
75
|
+
.map((dt) => deviceTypeInfosBySlug[dt.slug]?.latest)
|
76
|
+
.filter((dtJson) => dtJson != null);
|
83
77
|
};
|
84
78
|
/** @deprecated Use the getDeviceTypeBySlug unless you need the device-type.json contents. */
|
85
79
|
export const getDeviceTypeJsonBySlug = async (resinApi, slug) => (await findDeviceTypeInfoBySlug(resinApi, slug)).latest;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"device-types.js","sourceRoot":"","sources":["../../../src/features/device-types/device-types.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAIvB,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;A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ACF,CAAC,CAAC,CACF,CACD,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;IACvC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,oBAAoB,CAC7B,wDAAwD,IAAI,EAAE,CAC9D,CAAC;IACH,CAAC;IAED,OAAO;QACN,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;KACnB,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@balena/open-balena-api",
|
3
3
|
"description": "Internet of things, Made Simple",
|
4
|
-
"version": "27.2.0-build-device-type-helper-renames-
|
4
|
+
"version": "27.2.0-build-device-type-helper-renames-8e842aedd18dd4e4133c351a45d6b76bd665ada4-1",
|
5
5
|
"license": "AGPL-3.0",
|
6
6
|
"repository": {
|
7
7
|
"type": "git",
|
@@ -168,6 +168,6 @@
|
|
168
168
|
"loader": "ts-node/esm/transpile-only"
|
169
169
|
},
|
170
170
|
"versionist": {
|
171
|
-
"publishedAt": "2024-09-10T08:
|
171
|
+
"publishedAt": "2024-09-10T08:42:54.310Z"
|
172
172
|
}
|
173
173
|
}
|