@ledgerhq/device-core 0.5.5 → 0.5.6-nightly.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/capabilities/isCustomLockScreenSupported.d.ts +1 -1
- package/lib/capabilities/isCustomLockScreenSupported.d.ts.map +1 -1
- package/lib/capabilities/isCustomLockScreenSupported.js +6 -1
- package/lib/capabilities/isCustomLockScreenSupported.js.map +1 -1
- package/lib/capabilities/isCustomLockScreenSupported.test.js +5 -1
- package/lib/capabilities/isCustomLockScreenSupported.test.js.map +1 -1
- package/lib/capabilities/isEditDeviceNameSupported.d.ts.map +1 -1
- package/lib/capabilities/isEditDeviceNameSupported.js +1 -0
- package/lib/capabilities/isEditDeviceNameSupported.js.map +1 -1
- package/lib/capabilities/isEditDeviceNameSupported.test.js +1 -0
- package/lib/capabilities/isEditDeviceNameSupported.test.js.map +1 -1
- package/lib/capabilities/isSyncOnboardingSupported.js +1 -1
- package/lib/capabilities/isSyncOnboardingSupported.js.map +1 -1
- package/lib/capabilities/isSyncOnboardingSupported.test.js +1 -0
- package/lib/capabilities/isSyncOnboardingSupported.test.js.map +1 -1
- package/lib/commands/use-cases/isBootloaderVersionSupported.d.ts.map +1 -1
- package/lib/commands/use-cases/isBootloaderVersionSupported.js +1 -0
- package/lib/commands/use-cases/isBootloaderVersionSupported.js.map +1 -1
- package/lib/commands/use-cases/isBootloaderVersionSupported.test.js +8 -3
- package/lib/commands/use-cases/isBootloaderVersionSupported.test.js.map +1 -1
- package/lib/commands/use-cases/isCharonSupported.d.ts.map +1 -1
- package/lib/commands/use-cases/isCharonSupported.js +1 -0
- package/lib/commands/use-cases/isCharonSupported.js.map +1 -1
- package/lib/commands/use-cases/isCharonSupported.test.js +6 -1
- package/lib/commands/use-cases/isCharonSupported.test.js.map +1 -1
- package/lib/commands/use-cases/isDeviceLocalizationSupported.d.ts.map +1 -1
- package/lib/commands/use-cases/isDeviceLocalizationSupported.js +1 -0
- package/lib/commands/use-cases/isDeviceLocalizationSupported.js.map +1 -1
- package/lib/commands/use-cases/isDeviceLocalizationSupported.test.js +6 -1
- package/lib/commands/use-cases/isDeviceLocalizationSupported.test.js.map +1 -1
- package/lib/commands/use-cases/isRecoverSupported.d.ts.map +1 -1
- package/lib/commands/use-cases/isRecoverSupported.js +1 -0
- package/lib/commands/use-cases/isRecoverSupported.js.map +1 -1
- package/lib/commands/use-cases/isRecoverSupported.test.js +6 -1
- package/lib/commands/use-cases/isRecoverSupported.test.js.map +1 -1
- package/lib/customLockScreen/screenSpecs.d.ts +3 -1
- package/lib/customLockScreen/screenSpecs.d.ts.map +1 -1
- package/lib/customLockScreen/screenSpecs.js +8 -0
- package/lib/customLockScreen/screenSpecs.js.map +1 -1
- package/lib/firmwareUpdate/shouldForceFirmwareUpdate.d.ts.map +1 -1
- package/lib/firmwareUpdate/shouldForceFirmwareUpdate.js +1 -0
- package/lib/firmwareUpdate/shouldForceFirmwareUpdate.js.map +1 -1
- package/lib/firmwareUpdate/shouldForceFirmwareUpdate.test.js +6 -0
- package/lib/firmwareUpdate/shouldForceFirmwareUpdate.test.js.map +1 -1
- package/lib-es/capabilities/isCustomLockScreenSupported.d.ts +1 -1
- package/lib-es/capabilities/isCustomLockScreenSupported.d.ts.map +1 -1
- package/lib-es/capabilities/isCustomLockScreenSupported.js +6 -1
- package/lib-es/capabilities/isCustomLockScreenSupported.js.map +1 -1
- package/lib-es/capabilities/isCustomLockScreenSupported.test.js +5 -1
- package/lib-es/capabilities/isCustomLockScreenSupported.test.js.map +1 -1
- package/lib-es/capabilities/isEditDeviceNameSupported.d.ts.map +1 -1
- package/lib-es/capabilities/isEditDeviceNameSupported.js +1 -0
- package/lib-es/capabilities/isEditDeviceNameSupported.js.map +1 -1
- package/lib-es/capabilities/isEditDeviceNameSupported.test.js +1 -0
- package/lib-es/capabilities/isEditDeviceNameSupported.test.js.map +1 -1
- package/lib-es/capabilities/isSyncOnboardingSupported.js +1 -1
- package/lib-es/capabilities/isSyncOnboardingSupported.js.map +1 -1
- package/lib-es/capabilities/isSyncOnboardingSupported.test.js +1 -0
- package/lib-es/capabilities/isSyncOnboardingSupported.test.js.map +1 -1
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.d.ts.map +1 -1
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.js +1 -0
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.js.map +1 -1
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.test.js +8 -3
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.test.js.map +1 -1
- package/lib-es/commands/use-cases/isCharonSupported.d.ts.map +1 -1
- package/lib-es/commands/use-cases/isCharonSupported.js +1 -0
- package/lib-es/commands/use-cases/isCharonSupported.js.map +1 -1
- package/lib-es/commands/use-cases/isCharonSupported.test.js +6 -1
- package/lib-es/commands/use-cases/isCharonSupported.test.js.map +1 -1
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.d.ts.map +1 -1
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.js +1 -0
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.js.map +1 -1
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.test.js +6 -1
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.test.js.map +1 -1
- package/lib-es/commands/use-cases/isRecoverSupported.d.ts.map +1 -1
- package/lib-es/commands/use-cases/isRecoverSupported.js +1 -0
- package/lib-es/commands/use-cases/isRecoverSupported.js.map +1 -1
- package/lib-es/commands/use-cases/isRecoverSupported.test.js +6 -1
- package/lib-es/commands/use-cases/isRecoverSupported.test.js.map +1 -1
- package/lib-es/customLockScreen/screenSpecs.d.ts +3 -1
- package/lib-es/customLockScreen/screenSpecs.d.ts.map +1 -1
- package/lib-es/customLockScreen/screenSpecs.js +8 -0
- package/lib-es/customLockScreen/screenSpecs.js.map +1 -1
- package/lib-es/firmwareUpdate/shouldForceFirmwareUpdate.d.ts.map +1 -1
- package/lib-es/firmwareUpdate/shouldForceFirmwareUpdate.js +1 -0
- package/lib-es/firmwareUpdate/shouldForceFirmwareUpdate.js.map +1 -1
- package/lib-es/firmwareUpdate/shouldForceFirmwareUpdate.test.js +6 -0
- package/lib-es/firmwareUpdate/shouldForceFirmwareUpdate.test.js.map +1 -1
- package/package.json +5 -5
- package/src/capabilities/isCustomLockScreenSupported.test.ts +5 -1
- package/src/capabilities/isCustomLockScreenSupported.ts +6 -1
- package/src/capabilities/isEditDeviceNameSupported.test.ts +1 -0
- package/src/capabilities/isEditDeviceNameSupported.ts +1 -0
- package/src/capabilities/isSyncOnboardingSupported.test.ts +1 -0
- package/src/capabilities/isSyncOnboardingSupported.ts +1 -1
- package/src/commands/use-cases/isBootloaderVersionSupported.test.ts +9 -3
- package/src/commands/use-cases/isBootloaderVersionSupported.ts +1 -0
- package/src/commands/use-cases/isCharonSupported.test.ts +7 -1
- package/src/commands/use-cases/isCharonSupported.ts +1 -0
- package/src/commands/use-cases/isDeviceLocalizationSupported.test.ts +7 -1
- package/src/commands/use-cases/isDeviceLocalizationSupported.ts +1 -0
- package/src/commands/use-cases/isRecoverSupported.test.ts +7 -1
- package/src/commands/use-cases/isRecoverSupported.ts +1 -0
- package/src/customLockScreen/screenSpecs.ts +12 -2
- package/src/firmwareUpdate/shouldForceFirmwareUpdate.test.ts +15 -0
- package/src/firmwareUpdate/shouldForceFirmwareUpdate.ts +1 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
supportedDeviceModelIds,
|
|
5
5
|
} from "../capabilities/isCustomLockScreenSupported";
|
|
6
6
|
|
|
7
|
-
type ScreenSpecs = {
|
|
7
|
+
export type ScreenSpecs = {
|
|
8
8
|
/** width of the screen in pixels */
|
|
9
9
|
width: number;
|
|
10
10
|
/** height of the screen in pixels */
|
|
@@ -17,6 +17,8 @@ type ScreenSpecs = {
|
|
|
17
17
|
paddingLeft: number;
|
|
18
18
|
/** number of pixels at the right of the screen which are not visible */
|
|
19
19
|
paddingRight: number;
|
|
20
|
+
/** number of bits per pixel */
|
|
21
|
+
bitsPerPixel: 1 | 4;
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
const NO_PADDING = {
|
|
@@ -32,11 +34,19 @@ export const SCREEN_SPECS: Record<CLSSupportedDeviceModelId, ScreenSpecs> = {
|
|
|
32
34
|
height: 672,
|
|
33
35
|
...NO_PADDING,
|
|
34
36
|
paddingBottom: 2,
|
|
37
|
+
bitsPerPixel: 4,
|
|
35
38
|
},
|
|
36
39
|
[DeviceModelId.europa]: {
|
|
37
40
|
width: 480,
|
|
38
41
|
height: 600,
|
|
39
42
|
...NO_PADDING,
|
|
43
|
+
bitsPerPixel: 4,
|
|
44
|
+
},
|
|
45
|
+
[DeviceModelId.apex]: {
|
|
46
|
+
width: 300,
|
|
47
|
+
height: 400,
|
|
48
|
+
...NO_PADDING,
|
|
49
|
+
bitsPerPixel: 1,
|
|
40
50
|
},
|
|
41
51
|
};
|
|
42
52
|
|
|
@@ -50,7 +60,7 @@ export function getScreenSpecs(deviceModelId: CLSSupportedDeviceModelId) {
|
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
const screenDataDimensions: Record<CLSSupportedDeviceModelId, Dimensions> =
|
|
53
|
-
supportedDeviceModelIds.reduce(
|
|
63
|
+
supportedDeviceModelIds.reduce<Record<CLSSupportedDeviceModelId, Dimensions>>(
|
|
54
64
|
(acc, deviceModelId) => {
|
|
55
65
|
const { width, height } = SCREEN_SPECS[deviceModelId];
|
|
56
66
|
acc[deviceModelId] = { width, height };
|
|
@@ -116,5 +116,20 @@ describe("shouldForceFirmwareUpdate", () => {
|
|
|
116
116
|
deviceModelId: DeviceModelId.nanoX,
|
|
117
117
|
}),
|
|
118
118
|
).toBe(false);
|
|
119
|
+
|
|
120
|
+
expect(
|
|
121
|
+
shouldForceFirmwareUpdate({ currentVersion: "0.0.0", deviceModelId: DeviceModelId.apex }),
|
|
122
|
+
).toBe(false);
|
|
123
|
+
|
|
124
|
+
expect(
|
|
125
|
+
shouldForceFirmwareUpdate({
|
|
126
|
+
currentVersion: "0.0.0-whatever",
|
|
127
|
+
deviceModelId: DeviceModelId.apex,
|
|
128
|
+
}),
|
|
129
|
+
).toBe(false);
|
|
130
|
+
|
|
131
|
+
expect(
|
|
132
|
+
shouldForceFirmwareUpdate({ currentVersion: "1.3.0", deviceModelId: DeviceModelId.apex }),
|
|
133
|
+
).toBe(false);
|
|
119
134
|
});
|
|
120
135
|
});
|