@ledgerhq/device-core 0.1.1-next.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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +12 -0
- package/LICENSE.txt +21 -0
- package/jest.config.json +13 -0
- package/lib/capabilities/isCustomLockScreenSupported.d.ts +5 -0
- package/lib/capabilities/isCustomLockScreenSupported.d.ts.map +1 -0
- package/lib/capabilities/isCustomLockScreenSupported.js +16 -0
- package/lib/capabilities/isCustomLockScreenSupported.js.map +1 -0
- package/lib/capabilities/isCustomLockScreenSupported.test.d.ts +2 -0
- package/lib/capabilities/isCustomLockScreenSupported.test.d.ts.map +1 -0
- package/lib/capabilities/isCustomLockScreenSupported.test.js +22 -0
- package/lib/capabilities/isCustomLockScreenSupported.test.js.map +1 -0
- package/lib/capabilities/isEditDeviceNameSupported.d.ts +3 -0
- package/lib/capabilities/isEditDeviceNameSupported.d.ts.map +1 -0
- package/lib/capabilities/isEditDeviceNameSupported.js +9 -0
- package/lib/capabilities/isEditDeviceNameSupported.js.map +1 -0
- package/lib/capabilities/isEditDeviceNameSupported.test.d.ts +2 -0
- package/lib/capabilities/isEditDeviceNameSupported.test.d.ts.map +1 -0
- package/lib/capabilities/isEditDeviceNameSupported.test.js +19 -0
- package/lib/capabilities/isEditDeviceNameSupported.test.js.map +1 -0
- package/lib/capabilities/isSyncOnboardingSupported.d.ts +3 -0
- package/lib/capabilities/isSyncOnboardingSupported.d.ts.map +1 -0
- package/lib/capabilities/isSyncOnboardingSupported.js +9 -0
- package/lib/capabilities/isSyncOnboardingSupported.js.map +1 -0
- package/lib/capabilities/isSyncOnboardingSupported.test.d.ts +2 -0
- package/lib/capabilities/isSyncOnboardingSupported.test.d.ts.map +1 -0
- package/lib/capabilities/isSyncOnboardingSupported.test.js +17 -0
- package/lib/capabilities/isSyncOnboardingSupported.test.js.map +1 -0
- package/lib/commands/entities/APDU.d.ts +9 -0
- package/lib/commands/entities/APDU.d.ts.map +1 -0
- package/lib/commands/entities/APDU.js +3 -0
- package/lib/commands/entities/APDU.js.map +1 -0
- package/lib/commands/entities/FirmwareInfoEntity.d.ts +16 -0
- package/lib/commands/entities/FirmwareInfoEntity.d.ts.map +1 -0
- package/lib/commands/entities/FirmwareInfoEntity.js +3 -0
- package/lib/commands/entities/FirmwareInfoEntity.js.map +1 -0
- package/lib/commands/use-cases/getDeviceName.d.ts +3 -0
- package/lib/commands/use-cases/getDeviceName.d.ts.map +1 -0
- package/lib/commands/use-cases/getDeviceName.js +48 -0
- package/lib/commands/use-cases/getDeviceName.js.map +1 -0
- package/lib/commands/use-cases/getVersion.d.ts +15 -0
- package/lib/commands/use-cases/getVersion.d.ts.map +1 -0
- package/lib/commands/use-cases/getVersion.js +31 -0
- package/lib/commands/use-cases/getVersion.js.map +1 -0
- package/lib/commands/use-cases/isBootloaderVersionSupported.d.ts +7 -0
- package/lib/commands/use-cases/isBootloaderVersionSupported.d.ts.map +1 -0
- package/lib/commands/use-cases/isBootloaderVersionSupported.js +20 -0
- package/lib/commands/use-cases/isBootloaderVersionSupported.js.map +1 -0
- package/lib/commands/use-cases/isBootloaderVersionSupported.test.d.ts +2 -0
- package/lib/commands/use-cases/isBootloaderVersionSupported.test.d.ts.map +1 -0
- package/lib/commands/use-cases/isBootloaderVersionSupported.test.js +53 -0
- package/lib/commands/use-cases/isBootloaderVersionSupported.test.js.map +1 -0
- package/lib/commands/use-cases/isDeviceLocalizationSupported.d.ts +3 -0
- package/lib/commands/use-cases/isDeviceLocalizationSupported.d.ts.map +1 -0
- package/lib/commands/use-cases/isDeviceLocalizationSupported.js +15 -0
- package/lib/commands/use-cases/isDeviceLocalizationSupported.js.map +1 -0
- package/lib/commands/use-cases/isDeviceLocalizationSupported.test.d.ts +2 -0
- package/lib/commands/use-cases/isDeviceLocalizationSupported.test.d.ts.map +1 -0
- package/lib/commands/use-cases/isDeviceLocalizationSupported.test.js +45 -0
- package/lib/commands/use-cases/isDeviceLocalizationSupported.test.js.map +1 -0
- package/lib/commands/use-cases/isHardwareVersionSupported.d.ts +7 -0
- package/lib/commands/use-cases/isHardwareVersionSupported.d.ts.map +1 -0
- package/lib/commands/use-cases/isHardwareVersionSupported.js +16 -0
- package/lib/commands/use-cases/isHardwareVersionSupported.js.map +1 -0
- package/lib/commands/use-cases/isHardwareVersionSupported.test.d.ts +2 -0
- package/lib/commands/use-cases/isHardwareVersionSupported.test.d.ts.map +1 -0
- package/lib/commands/use-cases/isHardwareVersionSupported.test.js +36 -0
- package/lib/commands/use-cases/isHardwareVersionSupported.test.js.map +1 -0
- package/lib/commands/use-cases/parseGetDeviceNameResponse.d.ts +3 -0
- package/lib/commands/use-cases/parseGetDeviceNameResponse.d.ts.map +1 -0
- package/lib/commands/use-cases/parseGetDeviceNameResponse.js +23 -0
- package/lib/commands/use-cases/parseGetDeviceNameResponse.js.map +1 -0
- package/lib/commands/use-cases/parseGetDeviceNameResponse.test.d.ts +2 -0
- package/lib/commands/use-cases/parseGetDeviceNameResponse.test.d.ts.map +1 -0
- package/lib/commands/use-cases/parseGetDeviceNameResponse.test.js +27 -0
- package/lib/commands/use-cases/parseGetDeviceNameResponse.test.js.map +1 -0
- package/lib/commands/use-cases/parseGetVersionResponse.d.ts +4 -0
- package/lib/commands/use-cases/parseGetVersionResponse.d.ts.map +1 -0
- package/lib/commands/use-cases/parseGetVersionResponse.js +108 -0
- package/lib/commands/use-cases/parseGetVersionResponse.js.map +1 -0
- package/lib/commands/use-cases/parseGetVersionResponse.test.d.ts +2 -0
- package/lib/commands/use-cases/parseGetVersionResponse.test.d.ts.map +1 -0
- package/lib/commands/use-cases/parseGetVersionResponse.test.js +105 -0
- package/lib/commands/use-cases/parseGetVersionResponse.test.js.map +1 -0
- package/lib/customLockScreen/screenSpecs.d.ts +30 -0
- package/lib/customLockScreen/screenSpecs.d.ts.map +1 -0
- package/lib/customLockScreen/screenSpecs.js +46 -0
- package/lib/customLockScreen/screenSpecs.js.map +1 -0
- package/lib/index.d.ts +23 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +56 -0
- package/lib/index.js.map +1 -0
- package/lib/managerApi/entities/AppEntity.d.ts +62 -0
- package/lib/managerApi/entities/AppEntity.d.ts.map +1 -0
- package/lib/managerApi/entities/AppEntity.js +12 -0
- package/lib/managerApi/entities/AppEntity.js.map +1 -0
- package/lib/managerApi/entities/DeviceInfoEntity.d.ts +22 -0
- package/lib/managerApi/entities/DeviceInfoEntity.d.ts.map +1 -0
- package/lib/managerApi/entities/DeviceInfoEntity.js +3 -0
- package/lib/managerApi/entities/DeviceInfoEntity.js.map +1 -0
- package/lib/managerApi/entities/DeviceVersionEntity.d.ts +17 -0
- package/lib/managerApi/entities/DeviceVersionEntity.d.ts.map +1 -0
- package/lib/managerApi/entities/DeviceVersionEntity.js +3 -0
- package/lib/managerApi/entities/DeviceVersionEntity.js.map +1 -0
- package/lib/managerApi/entities/FirmwareUpdateContextEntity.d.ts +42 -0
- package/lib/managerApi/entities/FirmwareUpdateContextEntity.d.ts.map +1 -0
- package/lib/managerApi/entities/FirmwareUpdateContextEntity.js +3 -0
- package/lib/managerApi/entities/FirmwareUpdateContextEntity.js.map +1 -0
- package/lib/managerApi/entities/Id.d.ts +2 -0
- package/lib/managerApi/entities/Id.d.ts.map +1 -0
- package/lib/managerApi/entities/Id.js +3 -0
- package/lib/managerApi/entities/Id.js.map +1 -0
- package/lib/managerApi/entities/LanguagePackageEntity.d.ts +20 -0
- package/lib/managerApi/entities/LanguagePackageEntity.d.ts.map +1 -0
- package/lib/managerApi/entities/LanguagePackageEntity.js +3 -0
- package/lib/managerApi/entities/LanguagePackageEntity.js.map +1 -0
- package/lib/managerApi/entities/mocks/aDeviceInfo.d.ts +3 -0
- package/lib/managerApi/entities/mocks/aDeviceInfo.d.ts.map +1 -0
- package/lib/managerApi/entities/mocks/aDeviceInfo.js +8 -0
- package/lib/managerApi/entities/mocks/aDeviceInfo.js.map +1 -0
- package/lib/managerApi/entities/mocks/aDeviceVersion.d.ts +3 -0
- package/lib/managerApi/entities/mocks/aDeviceVersion.d.ts.map +1 -0
- package/lib/managerApi/entities/mocks/aDeviceVersion.js +8 -0
- package/lib/managerApi/entities/mocks/aDeviceVersion.js.map +1 -0
- package/lib/managerApi/entities/mocks/aFinalFirmware.d.ts +3 -0
- package/lib/managerApi/entities/mocks/aFinalFirmware.d.ts.map +1 -0
- package/lib/managerApi/entities/mocks/aFinalFirmware.js +8 -0
- package/lib/managerApi/entities/mocks/aFinalFirmware.js.map +1 -0
- package/lib/managerApi/entities/mocks/aOsuFirmware.d.ts +19 -0
- package/lib/managerApi/entities/mocks/aOsuFirmware.d.ts.map +1 -0
- package/lib/managerApi/entities/mocks/aOsuFirmware.js +8 -0
- package/lib/managerApi/entities/mocks/aOsuFirmware.js.map +1 -0
- package/lib/managerApi/repositories/HttpManagerApiRepository.d.ts +18 -0
- package/lib/managerApi/repositories/HttpManagerApiRepository.d.ts.map +1 -0
- package/lib/managerApi/repositories/HttpManagerApiRepository.js +204 -0
- package/lib/managerApi/repositories/HttpManagerApiRepository.js.map +1 -0
- package/lib/managerApi/repositories/HttpManagerApiRepository.test.d.ts +2 -0
- package/lib/managerApi/repositories/HttpManagerApiRepository.test.d.ts.map +1 -0
- package/lib/managerApi/repositories/HttpManagerApiRepository.test.js +402 -0
- package/lib/managerApi/repositories/HttpManagerApiRepository.test.js.map +1 -0
- package/lib/managerApi/repositories/ManagerApiRepository.d.ts +54 -0
- package/lib/managerApi/repositories/ManagerApiRepository.d.ts.map +1 -0
- package/lib/managerApi/repositories/ManagerApiRepository.js +3 -0
- package/lib/managerApi/repositories/ManagerApiRepository.js.map +1 -0
- package/lib/managerApi/repositories/StubManagerApiRepository.d.ts +15 -0
- package/lib/managerApi/repositories/StubManagerApiRepository.d.ts.map +1 -0
- package/lib/managerApi/repositories/StubManagerApiRepository.js +44 -0
- package/lib/managerApi/repositories/StubManagerApiRepository.js.map +1 -0
- package/lib/managerApi/use-cases/fetchMcus.d.ts +3 -0
- package/lib/managerApi/use-cases/fetchMcus.d.ts.map +1 -0
- package/lib/managerApi/use-cases/fetchMcus.js +8 -0
- package/lib/managerApi/use-cases/fetchMcus.js.map +1 -0
- package/lib/managerApi/use-cases/getLatestFirmwareForDevice.d.ts +12 -0
- package/lib/managerApi/use-cases/getLatestFirmwareForDevice.d.ts.map +1 -0
- package/lib/managerApi/use-cases/getLatestFirmwareForDevice.js +62 -0
- package/lib/managerApi/use-cases/getLatestFirmwareForDevice.js.map +1 -0
- package/lib/managerApi/use-cases/getLatestFirmwareForDevice.test.d.ts +2 -0
- package/lib/managerApi/use-cases/getLatestFirmwareForDevice.test.d.ts.map +1 -0
- package/lib/managerApi/use-cases/getLatestFirmwareForDevice.test.js +178 -0
- package/lib/managerApi/use-cases/getLatestFirmwareForDevice.test.js.map +1 -0
- package/lib/managerApi/use-cases/getProviderIdUseCase.d.ts +7 -0
- package/lib/managerApi/use-cases/getProviderIdUseCase.d.ts.map +1 -0
- package/lib/managerApi/use-cases/getProviderIdUseCase.js +23 -0
- package/lib/managerApi/use-cases/getProviderIdUseCase.js.map +1 -0
- package/lib/managerApi/use-cases/getUserHashes.d.ts +5 -0
- package/lib/managerApi/use-cases/getUserHashes.d.ts.map +1 -0
- package/lib/managerApi/use-cases/getUserHashes.js +33 -0
- package/lib/managerApi/use-cases/getUserHashes.js.map +1 -0
- package/lib-es/capabilities/isCustomLockScreenSupported.d.ts +5 -0
- package/lib-es/capabilities/isCustomLockScreenSupported.d.ts.map +1 -0
- package/lib-es/capabilities/isCustomLockScreenSupported.js +12 -0
- package/lib-es/capabilities/isCustomLockScreenSupported.js.map +1 -0
- package/lib-es/capabilities/isCustomLockScreenSupported.test.d.ts +2 -0
- package/lib-es/capabilities/isCustomLockScreenSupported.test.d.ts.map +1 -0
- package/lib-es/capabilities/isCustomLockScreenSupported.test.js +20 -0
- package/lib-es/capabilities/isCustomLockScreenSupported.test.js.map +1 -0
- package/lib-es/capabilities/isEditDeviceNameSupported.d.ts +3 -0
- package/lib-es/capabilities/isEditDeviceNameSupported.d.ts.map +1 -0
- package/lib-es/capabilities/isEditDeviceNameSupported.js +5 -0
- package/lib-es/capabilities/isEditDeviceNameSupported.js.map +1 -0
- package/lib-es/capabilities/isEditDeviceNameSupported.test.d.ts +2 -0
- package/lib-es/capabilities/isEditDeviceNameSupported.test.d.ts.map +1 -0
- package/lib-es/capabilities/isEditDeviceNameSupported.test.js +17 -0
- package/lib-es/capabilities/isEditDeviceNameSupported.test.js.map +1 -0
- package/lib-es/capabilities/isSyncOnboardingSupported.d.ts +3 -0
- package/lib-es/capabilities/isSyncOnboardingSupported.d.ts.map +1 -0
- package/lib-es/capabilities/isSyncOnboardingSupported.js +5 -0
- package/lib-es/capabilities/isSyncOnboardingSupported.js.map +1 -0
- package/lib-es/capabilities/isSyncOnboardingSupported.test.d.ts +2 -0
- package/lib-es/capabilities/isSyncOnboardingSupported.test.d.ts.map +1 -0
- package/lib-es/capabilities/isSyncOnboardingSupported.test.js +15 -0
- package/lib-es/capabilities/isSyncOnboardingSupported.test.js.map +1 -0
- package/lib-es/commands/entities/APDU.d.ts +9 -0
- package/lib-es/commands/entities/APDU.d.ts.map +1 -0
- package/lib-es/commands/entities/APDU.js +2 -0
- package/lib-es/commands/entities/APDU.js.map +1 -0
- package/lib-es/commands/entities/FirmwareInfoEntity.d.ts +16 -0
- package/lib-es/commands/entities/FirmwareInfoEntity.d.ts.map +1 -0
- package/lib-es/commands/entities/FirmwareInfoEntity.js +2 -0
- package/lib-es/commands/entities/FirmwareInfoEntity.js.map +1 -0
- package/lib-es/commands/use-cases/getDeviceName.d.ts +3 -0
- package/lib-es/commands/use-cases/getDeviceName.d.ts.map +1 -0
- package/lib-es/commands/use-cases/getDeviceName.js +44 -0
- package/lib-es/commands/use-cases/getDeviceName.js.map +1 -0
- package/lib-es/commands/use-cases/getVersion.d.ts +15 -0
- package/lib-es/commands/use-cases/getVersion.d.ts.map +1 -0
- package/lib-es/commands/use-cases/getVersion.js +27 -0
- package/lib-es/commands/use-cases/getVersion.js.map +1 -0
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.d.ts +7 -0
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.d.ts.map +1 -0
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.js +16 -0
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.js.map +1 -0
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.test.d.ts +2 -0
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.test.d.ts.map +1 -0
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.test.js +51 -0
- package/lib-es/commands/use-cases/isBootloaderVersionSupported.test.js.map +1 -0
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.d.ts +3 -0
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.d.ts.map +1 -0
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.js +11 -0
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.js.map +1 -0
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.test.d.ts +2 -0
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.test.d.ts.map +1 -0
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.test.js +43 -0
- package/lib-es/commands/use-cases/isDeviceLocalizationSupported.test.js.map +1 -0
- package/lib-es/commands/use-cases/isHardwareVersionSupported.d.ts +7 -0
- package/lib-es/commands/use-cases/isHardwareVersionSupported.d.ts.map +1 -0
- package/lib-es/commands/use-cases/isHardwareVersionSupported.js +12 -0
- package/lib-es/commands/use-cases/isHardwareVersionSupported.js.map +1 -0
- package/lib-es/commands/use-cases/isHardwareVersionSupported.test.d.ts +2 -0
- package/lib-es/commands/use-cases/isHardwareVersionSupported.test.d.ts.map +1 -0
- package/lib-es/commands/use-cases/isHardwareVersionSupported.test.js +34 -0
- package/lib-es/commands/use-cases/isHardwareVersionSupported.test.js.map +1 -0
- package/lib-es/commands/use-cases/parseGetDeviceNameResponse.d.ts +3 -0
- package/lib-es/commands/use-cases/parseGetDeviceNameResponse.d.ts.map +1 -0
- package/lib-es/commands/use-cases/parseGetDeviceNameResponse.js +19 -0
- package/lib-es/commands/use-cases/parseGetDeviceNameResponse.js.map +1 -0
- package/lib-es/commands/use-cases/parseGetDeviceNameResponse.test.d.ts +2 -0
- package/lib-es/commands/use-cases/parseGetDeviceNameResponse.test.d.ts.map +1 -0
- package/lib-es/commands/use-cases/parseGetDeviceNameResponse.test.js +25 -0
- package/lib-es/commands/use-cases/parseGetDeviceNameResponse.test.js.map +1 -0
- package/lib-es/commands/use-cases/parseGetVersionResponse.d.ts +4 -0
- package/lib-es/commands/use-cases/parseGetVersionResponse.d.ts.map +1 -0
- package/lib-es/commands/use-cases/parseGetVersionResponse.js +104 -0
- package/lib-es/commands/use-cases/parseGetVersionResponse.js.map +1 -0
- package/lib-es/commands/use-cases/parseGetVersionResponse.test.d.ts +2 -0
- package/lib-es/commands/use-cases/parseGetVersionResponse.test.d.ts.map +1 -0
- package/lib-es/commands/use-cases/parseGetVersionResponse.test.js +103 -0
- package/lib-es/commands/use-cases/parseGetVersionResponse.test.js.map +1 -0
- package/lib-es/customLockScreen/screenSpecs.d.ts +30 -0
- package/lib-es/customLockScreen/screenSpecs.d.ts.map +1 -0
- package/lib-es/customLockScreen/screenSpecs.js +40 -0
- package/lib-es/customLockScreen/screenSpecs.js.map +1 -0
- package/lib-es/index.d.ts +23 -0
- package/lib-es/index.d.ts.map +1 -0
- package/lib-es/index.js +21 -0
- package/lib-es/index.js.map +1 -0
- package/lib-es/managerApi/entities/AppEntity.d.ts +62 -0
- package/lib-es/managerApi/entities/AppEntity.d.ts.map +1 -0
- package/lib-es/managerApi/entities/AppEntity.js +9 -0
- package/lib-es/managerApi/entities/AppEntity.js.map +1 -0
- package/lib-es/managerApi/entities/DeviceInfoEntity.d.ts +22 -0
- package/lib-es/managerApi/entities/DeviceInfoEntity.d.ts.map +1 -0
- package/lib-es/managerApi/entities/DeviceInfoEntity.js +2 -0
- package/lib-es/managerApi/entities/DeviceInfoEntity.js.map +1 -0
- package/lib-es/managerApi/entities/DeviceVersionEntity.d.ts +17 -0
- package/lib-es/managerApi/entities/DeviceVersionEntity.d.ts.map +1 -0
- package/lib-es/managerApi/entities/DeviceVersionEntity.js +2 -0
- package/lib-es/managerApi/entities/DeviceVersionEntity.js.map +1 -0
- package/lib-es/managerApi/entities/FirmwareUpdateContextEntity.d.ts +42 -0
- package/lib-es/managerApi/entities/FirmwareUpdateContextEntity.d.ts.map +1 -0
- package/lib-es/managerApi/entities/FirmwareUpdateContextEntity.js +2 -0
- package/lib-es/managerApi/entities/FirmwareUpdateContextEntity.js.map +1 -0
- package/lib-es/managerApi/entities/Id.d.ts +2 -0
- package/lib-es/managerApi/entities/Id.d.ts.map +1 -0
- package/lib-es/managerApi/entities/Id.js +2 -0
- package/lib-es/managerApi/entities/Id.js.map +1 -0
- package/lib-es/managerApi/entities/LanguagePackageEntity.d.ts +20 -0
- package/lib-es/managerApi/entities/LanguagePackageEntity.d.ts.map +1 -0
- package/lib-es/managerApi/entities/LanguagePackageEntity.js +2 -0
- package/lib-es/managerApi/entities/LanguagePackageEntity.js.map +1 -0
- package/lib-es/managerApi/entities/mocks/aDeviceInfo.d.ts +3 -0
- package/lib-es/managerApi/entities/mocks/aDeviceInfo.d.ts.map +1 -0
- package/lib-es/managerApi/entities/mocks/aDeviceInfo.js +4 -0
- package/lib-es/managerApi/entities/mocks/aDeviceInfo.js.map +1 -0
- package/lib-es/managerApi/entities/mocks/aDeviceVersion.d.ts +3 -0
- package/lib-es/managerApi/entities/mocks/aDeviceVersion.d.ts.map +1 -0
- package/lib-es/managerApi/entities/mocks/aDeviceVersion.js +4 -0
- package/lib-es/managerApi/entities/mocks/aDeviceVersion.js.map +1 -0
- package/lib-es/managerApi/entities/mocks/aFinalFirmware.d.ts +3 -0
- package/lib-es/managerApi/entities/mocks/aFinalFirmware.d.ts.map +1 -0
- package/lib-es/managerApi/entities/mocks/aFinalFirmware.js +4 -0
- package/lib-es/managerApi/entities/mocks/aFinalFirmware.js.map +1 -0
- package/lib-es/managerApi/entities/mocks/aOsuFirmware.d.ts +19 -0
- package/lib-es/managerApi/entities/mocks/aOsuFirmware.d.ts.map +1 -0
- package/lib-es/managerApi/entities/mocks/aOsuFirmware.js +4 -0
- package/lib-es/managerApi/entities/mocks/aOsuFirmware.js.map +1 -0
- package/lib-es/managerApi/repositories/HttpManagerApiRepository.d.ts +18 -0
- package/lib-es/managerApi/repositories/HttpManagerApiRepository.d.ts.map +1 -0
- package/lib-es/managerApi/repositories/HttpManagerApiRepository.js +197 -0
- package/lib-es/managerApi/repositories/HttpManagerApiRepository.js.map +1 -0
- package/lib-es/managerApi/repositories/HttpManagerApiRepository.test.d.ts +2 -0
- package/lib-es/managerApi/repositories/HttpManagerApiRepository.test.d.ts.map +1 -0
- package/lib-es/managerApi/repositories/HttpManagerApiRepository.test.js +400 -0
- package/lib-es/managerApi/repositories/HttpManagerApiRepository.test.js.map +1 -0
- package/lib-es/managerApi/repositories/ManagerApiRepository.d.ts +54 -0
- package/lib-es/managerApi/repositories/ManagerApiRepository.d.ts.map +1 -0
- package/lib-es/managerApi/repositories/ManagerApiRepository.js +2 -0
- package/lib-es/managerApi/repositories/ManagerApiRepository.js.map +1 -0
- package/lib-es/managerApi/repositories/StubManagerApiRepository.d.ts +15 -0
- package/lib-es/managerApi/repositories/StubManagerApiRepository.d.ts.map +1 -0
- package/lib-es/managerApi/repositories/StubManagerApiRepository.js +40 -0
- package/lib-es/managerApi/repositories/StubManagerApiRepository.js.map +1 -0
- package/lib-es/managerApi/use-cases/fetchMcus.d.ts +3 -0
- package/lib-es/managerApi/use-cases/fetchMcus.d.ts.map +1 -0
- package/lib-es/managerApi/use-cases/fetchMcus.js +4 -0
- package/lib-es/managerApi/use-cases/fetchMcus.js.map +1 -0
- package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.d.ts +12 -0
- package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.d.ts.map +1 -0
- package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.js +58 -0
- package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.js.map +1 -0
- package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.test.d.ts +2 -0
- package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.test.d.ts.map +1 -0
- package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.test.js +176 -0
- package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.test.js.map +1 -0
- package/lib-es/managerApi/use-cases/getProviderIdUseCase.d.ts +7 -0
- package/lib-es/managerApi/use-cases/getProviderIdUseCase.d.ts.map +1 -0
- package/lib-es/managerApi/use-cases/getProviderIdUseCase.js +19 -0
- package/lib-es/managerApi/use-cases/getProviderIdUseCase.js.map +1 -0
- package/lib-es/managerApi/use-cases/getUserHashes.d.ts +5 -0
- package/lib-es/managerApi/use-cases/getUserHashes.d.ts.map +1 -0
- package/lib-es/managerApi/use-cases/getUserHashes.js +26 -0
- package/lib-es/managerApi/use-cases/getUserHashes.js.map +1 -0
- package/package.json +67 -0
- package/src/capabilities/isCustomLockScreenSupported.test.ts +25 -0
- package/src/capabilities/isCustomLockScreenSupported.ts +17 -0
- package/src/capabilities/isEditDeviceNameSupported.test.ts +18 -0
- package/src/capabilities/isEditDeviceNameSupported.ts +5 -0
- package/src/capabilities/isSyncOnboardingSupported.test.ts +16 -0
- package/src/capabilities/isSyncOnboardingSupported.ts +5 -0
- package/src/commands/entities/APDU.ts +12 -0
- package/src/commands/entities/FirmwareInfoEntity.ts +14 -0
- package/src/commands/use-cases/getDeviceName.ts +38 -0
- package/src/commands/use-cases/getVersion.ts +23 -0
- package/src/commands/use-cases/isBootloaderVersionSupported.test.ts +58 -0
- package/src/commands/use-cases/isBootloaderVersionSupported.ts +24 -0
- package/src/commands/use-cases/isDeviceLocalizationSupported.test.ts +48 -0
- package/src/commands/use-cases/isDeviceLocalizationSupported.ts +20 -0
- package/src/commands/use-cases/isHardwareVersionSupported.test.ts +39 -0
- package/src/commands/use-cases/isHardwareVersionSupported.ts +20 -0
- package/src/commands/use-cases/parseGetDeviceNameResponse.test.ts +35 -0
- package/src/commands/use-cases/parseGetDeviceNameResponse.ts +20 -0
- package/src/commands/use-cases/parseGetVersionResponse.test.ts +123 -0
- package/src/commands/use-cases/parseGetVersionResponse.ts +121 -0
- package/src/customLockScreen/screenSpecs.ts +87 -0
- package/src/index.ts +33 -0
- package/src/managerApi/entities/AppEntity.ts +66 -0
- package/src/managerApi/entities/DeviceInfoEntity.ts +26 -0
- package/src/managerApi/entities/DeviceVersionEntity.ts +17 -0
- package/src/managerApi/entities/FirmwareUpdateContextEntity.ts +44 -0
- package/src/managerApi/entities/Id.ts +1 -0
- package/src/managerApi/entities/LanguagePackageEntity.ts +21 -0
- package/src/managerApi/entities/mocks/aDeviceInfo.ts +16 -0
- package/src/managerApi/entities/mocks/aDeviceVersion.ts +22 -0
- package/src/managerApi/entities/mocks/aFinalFirmware.ts +25 -0
- package/src/managerApi/entities/mocks/aOsuFirmware.ts +22 -0
- package/src/managerApi/repositories/HttpManagerApiRepository.test.ts +494 -0
- package/src/managerApi/repositories/HttpManagerApiRepository.ts +284 -0
- package/src/managerApi/repositories/ManagerApiRepository.ts +68 -0
- package/src/managerApi/repositories/StubManagerApiRepository.ts +49 -0
- package/src/managerApi/use-cases/fetchMcus.ts +5 -0
- package/src/managerApi/use-cases/getLatestFirmwareForDevice.test.ts +196 -0
- package/src/managerApi/use-cases/getLatestFirmwareForDevice.ts +66 -0
- package/src/managerApi/use-cases/getProviderIdUseCase.ts +24 -0
- package/src/managerApi/use-cases/getUserHashes.ts +30 -0
- package/tsconfig.json +16 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# @ledgerhq/device-core
|
|
2
|
+
|
|
3
|
+
## 0.1.1-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`7d5a724`](https://github.com/LedgerHQ/ledger-live/commit/7d5a724f40079a233b159b5231d69f318327e175), [`b3dfed5`](https://github.com/LedgerHQ/ledger-live/commit/b3dfed54bd8d54e62530cb2db92c3c108b43e0d7), [`7887ad9`](https://github.com/LedgerHQ/ledger-live/commit/7887ad9842e59f6fc567f118f06b3e12bdb9073b), [`5ae6d8f`](https://github.com/LedgerHQ/ledger-live/commit/5ae6d8fb9b868dc01724e84ede2708e7a717c3f2), [`21f5c44`](https://github.com/LedgerHQ/ledger-live/commit/21f5c4438bb542a3891f692f4274ee4c28aa76cd), [`a780777`](https://github.com/LedgerHQ/ledger-live/commit/a780777c13e08c1c3cd66ef5f6deac0fe928a894), [`1aa8ef4`](https://github.com/LedgerHQ/ledger-live/commit/1aa8ef404411c31f6ac4cf09fba453042db8b955), [`fc4f83e`](https://github.com/LedgerHQ/ledger-live/commit/fc4f83e26d9f00b7c518f28157e8d9da55ce3685), [`13bea7c`](https://github.com/LedgerHQ/ledger-live/commit/13bea7ced4b8a7ad40fbc5205e3b58ed8a217982), [`d2f8b26`](https://github.com/LedgerHQ/ledger-live/commit/d2f8b26c99551cba902c07e9c544f3c84d74686c), [`dd1d17f`](https://github.com/LedgerHQ/ledger-live/commit/dd1d17fd3ce7ed42558204b2f93707fb9b1599de), [`5ca7923`](https://github.com/LedgerHQ/ledger-live/commit/5ca79234ccbe66ce22f998fe3ebd2cdec681499a), [`26b3a5d`](https://github.com/LedgerHQ/ledger-live/commit/26b3a5d7d6e11efc226403707d683f3d0098a1c1), [`9ada63a`](https://github.com/LedgerHQ/ledger-live/commit/9ada63a05b2d2518af09a9c07937cf94b5b2ea67), [`5848f9e`](https://github.com/LedgerHQ/ledger-live/commit/5848f9e247f169eb7a4aff322253937214b9efdd), [`c7f072f`](https://github.com/LedgerHQ/ledger-live/commit/c7f072f833a950e230137499d4908b792f6b615f), [`a8138f9`](https://github.com/LedgerHQ/ledger-live/commit/a8138f9ec0cff714d9745012eb91a09713ffbbd2), [`2331bae`](https://github.com/LedgerHQ/ledger-live/commit/2331bae7393f822aa64e5d0ab8f51622b6363b33), [`b72c52b`](https://github.com/LedgerHQ/ledger-live/commit/b72c52b3e4ebbb7aaf2142afbf6a9b9172e7ee04), [`e1df8bc`](https://github.com/LedgerHQ/ledger-live/commit/e1df8bca348287e94970de90c51e98fa277c5364), [`53da330`](https://github.com/LedgerHQ/ledger-live/commit/53da3301aaceeb16e6b1f96b1ea44428fbeb4483), [`52d5703`](https://github.com/LedgerHQ/ledger-live/commit/52d57039bb015af2616670db480364a2e5fc9966), [`ba5c49b`](https://github.com/LedgerHQ/ledger-live/commit/ba5c49b82af70a2e459720b9cb124546c406b88b)]:
|
|
8
|
+
- @ledgerhq/types-live@6.46.0-next.0
|
|
9
|
+
- @ledgerhq/errors@6.16.4-next.0
|
|
10
|
+
- @ledgerhq/devices@8.3.0-next.0
|
|
11
|
+
- @ledgerhq/hw-transport@6.30.6-next.0
|
|
12
|
+
- @ledgerhq/live-network@1.2.1-next.0
|
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-present Ledger https://www.ledger.com/
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/jest.config.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DeviceModelId } from "@ledgerhq/devices";
|
|
2
|
+
export declare const supportedDeviceModelIds: readonly [DeviceModelId.stax, DeviceModelId.europa];
|
|
3
|
+
export type CLSSupportedDeviceModelId = (typeof supportedDeviceModelIds)[number];
|
|
4
|
+
export declare function isCustomLockScreenSupported(deviceModelId: DeviceModelId): deviceModelId is CLSSupportedDeviceModelId;
|
|
5
|
+
//# sourceMappingURL=isCustomLockScreenSupported.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isCustomLockScreenSupported.d.ts","sourceRoot":"","sources":["../../src/capabilities/isCustomLockScreenSupported.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,eAAO,MAAM,uBAAuB,qDAAsD,CAAC;AAE3F,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,aAAa,GAC3B,aAAa,IAAI,yBAAyB,CAQ5C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCustomLockScreenSupported = exports.supportedDeviceModelIds = void 0;
|
|
4
|
+
const devices_1 = require("@ledgerhq/devices");
|
|
5
|
+
exports.supportedDeviceModelIds = [devices_1.DeviceModelId.stax, devices_1.DeviceModelId.europa];
|
|
6
|
+
function isCustomLockScreenSupported(deviceModelId) {
|
|
7
|
+
switch (deviceModelId) {
|
|
8
|
+
case devices_1.DeviceModelId.stax:
|
|
9
|
+
case devices_1.DeviceModelId.europa:
|
|
10
|
+
return true;
|
|
11
|
+
default:
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.isCustomLockScreenSupported = isCustomLockScreenSupported;
|
|
16
|
+
//# sourceMappingURL=isCustomLockScreenSupported.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isCustomLockScreenSupported.js","sourceRoot":"","sources":["../../src/capabilities/isCustomLockScreenSupported.ts"],"names":[],"mappings":";;;AAAA,+CAAkD;AAErC,QAAA,uBAAuB,GAAG,CAAC,uBAAa,CAAC,IAAI,EAAE,uBAAa,CAAC,MAAM,CAAU,CAAC;AAI3F,SAAgB,2BAA2B,CACzC,aAA4B;IAE5B,QAAQ,aAAa,EAAE;QACrB,KAAK,uBAAa,CAAC,IAAI,CAAC;QACxB,KAAK,uBAAa,CAAC,MAAM;YACvB,OAAO,IAAI,CAAC;QACd;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC;AAVD,kEAUC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isCustomLockScreenSupported.test.d.ts","sourceRoot":"","sources":["../../src/capabilities/isCustomLockScreenSupported.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devices_1 = require("@ledgerhq/devices");
|
|
4
|
+
const isCustomLockScreenSupported_1 = require("./isCustomLockScreenSupported");
|
|
5
|
+
describe("isCustomLockScreenSupported", () => {
|
|
6
|
+
it("should return true if custom lock screen is supported", () => {
|
|
7
|
+
expect((0, isCustomLockScreenSupported_1.isCustomLockScreenSupported)(devices_1.DeviceModelId.stax)).toBe(true);
|
|
8
|
+
expect((0, isCustomLockScreenSupported_1.isCustomLockScreenSupported)(devices_1.DeviceModelId.europa)).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
it("should return false if custom lock screen is not supported", () => {
|
|
11
|
+
expect((0, isCustomLockScreenSupported_1.isCustomLockScreenSupported)(devices_1.DeviceModelId.nanoS)).toBe(false);
|
|
12
|
+
expect((0, isCustomLockScreenSupported_1.isCustomLockScreenSupported)(devices_1.DeviceModelId.nanoSP)).toBe(false);
|
|
13
|
+
expect((0, isCustomLockScreenSupported_1.isCustomLockScreenSupported)(devices_1.DeviceModelId.nanoX)).toBe(false);
|
|
14
|
+
expect((0, isCustomLockScreenSupported_1.isCustomLockScreenSupported)(devices_1.DeviceModelId.blue)).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
describe("supportedDeviceModelIds", () => {
|
|
18
|
+
it("should return supported device model ids", () => {
|
|
19
|
+
expect(isCustomLockScreenSupported_1.supportedDeviceModelIds).toEqual([devices_1.DeviceModelId.stax, devices_1.DeviceModelId.europa]);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=isCustomLockScreenSupported.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isCustomLockScreenSupported.test.js","sourceRoot":"","sources":["../../src/capabilities/isCustomLockScreenSupported.test.ts"],"names":[],"mappings":";;AAAA,+CAAkD;AAClD,+EAGuC;AAEvC,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,MAAM,CAAC,IAAA,yDAA2B,EAAC,uBAAa,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnE,MAAM,CAAC,IAAA,yDAA2B,EAAC,uBAAa,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,CAAC,IAAA,yDAA2B,EAAC,uBAAa,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrE,MAAM,CAAC,IAAA,yDAA2B,EAAC,uBAAa,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtE,MAAM,CAAC,IAAA,yDAA2B,EAAC,uBAAa,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrE,MAAM,CAAC,IAAA,yDAA2B,EAAC,uBAAa,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,CAAC,qDAAuB,CAAC,CAAC,OAAO,CAAC,CAAC,uBAAa,CAAC,IAAI,EAAE,uBAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEditDeviceNameSupported.d.ts","sourceRoot":"","sources":["../../src/capabilities/isEditDeviceNameSupported.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,wBAAgB,yBAAyB,CAAC,aAAa,EAAE,aAAa,WAErE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEditDeviceNameSupported = void 0;
|
|
4
|
+
const devices_1 = require("@ledgerhq/devices");
|
|
5
|
+
function isEditDeviceNameSupported(deviceModelId) {
|
|
6
|
+
return [devices_1.DeviceModelId.stax, devices_1.DeviceModelId.nanoX, devices_1.DeviceModelId.europa].includes(deviceModelId);
|
|
7
|
+
}
|
|
8
|
+
exports.isEditDeviceNameSupported = isEditDeviceNameSupported;
|
|
9
|
+
//# sourceMappingURL=isEditDeviceNameSupported.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEditDeviceNameSupported.js","sourceRoot":"","sources":["../../src/capabilities/isEditDeviceNameSupported.ts"],"names":[],"mappings":";;;AAAA,+CAAkD;AAElD,SAAgB,yBAAyB,CAAC,aAA4B;IACpE,OAAO,CAAC,uBAAa,CAAC,IAAI,EAAE,uBAAa,CAAC,KAAK,EAAE,uBAAa,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AACjG,CAAC;AAFD,8DAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEditDeviceNameSupported.test.d.ts","sourceRoot":"","sources":["../../src/capabilities/isEditDeviceNameSupported.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devices_1 = require("@ledgerhq/devices");
|
|
4
|
+
const isEditDeviceNameSupported_1 = require("./isEditDeviceNameSupported");
|
|
5
|
+
const supportedDevices = [devices_1.DeviceModelId.stax, devices_1.DeviceModelId.nanoX, devices_1.DeviceModelId.europa];
|
|
6
|
+
const unsupportedDevices = [devices_1.DeviceModelId.nanoS, devices_1.DeviceModelId.blue, devices_1.DeviceModelId.nanoSP];
|
|
7
|
+
describe("isEditDeviceNameSupported", () => {
|
|
8
|
+
it("should return true for supported devices", () => {
|
|
9
|
+
supportedDevices.forEach((deviceModelId) => {
|
|
10
|
+
expect((0, isEditDeviceNameSupported_1.isEditDeviceNameSupported)(deviceModelId)).toBe(true);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
it("should return false for unsupported devices", () => {
|
|
14
|
+
unsupportedDevices.forEach((deviceModelId) => {
|
|
15
|
+
expect((0, isEditDeviceNameSupported_1.isEditDeviceNameSupported)(deviceModelId)).toBe(false);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=isEditDeviceNameSupported.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEditDeviceNameSupported.test.js","sourceRoot":"","sources":["../../src/capabilities/isEditDeviceNameSupported.test.ts"],"names":[],"mappings":";;AAAA,+CAAkD;AAClD,2EAAwE;AAExE,MAAM,gBAAgB,GAAG,CAAC,uBAAa,CAAC,IAAI,EAAE,uBAAa,CAAC,KAAK,EAAE,uBAAa,CAAC,MAAM,CAAC,CAAC;AACzF,MAAM,kBAAkB,GAAG,CAAC,uBAAa,CAAC,KAAK,EAAE,uBAAa,CAAC,IAAI,EAAE,uBAAa,CAAC,MAAM,CAAC,CAAC;AAE3F,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,gBAAgB,CAAC,OAAO,CAAC,CAAC,aAA4B,EAAE,EAAE;YACxD,MAAM,CAAC,IAAA,qDAAyB,EAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,kBAAkB,CAAC,OAAO,CAAC,CAAC,aAA4B,EAAE,EAAE;YAC1D,MAAM,CAAC,IAAA,qDAAyB,EAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSyncOnboardingSupported.d.ts","sourceRoot":"","sources":["../../src/capabilities/isSyncOnboardingSupported.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,wBAAgB,yBAAyB,CAAC,aAAa,EAAE,aAAa,WAErE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSyncOnboardingSupported = void 0;
|
|
4
|
+
const devices_1 = require("@ledgerhq/devices");
|
|
5
|
+
function isSyncOnboardingSupported(deviceModelId) {
|
|
6
|
+
return [devices_1.DeviceModelId.stax, devices_1.DeviceModelId.europa].includes(deviceModelId);
|
|
7
|
+
}
|
|
8
|
+
exports.isSyncOnboardingSupported = isSyncOnboardingSupported;
|
|
9
|
+
//# sourceMappingURL=isSyncOnboardingSupported.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSyncOnboardingSupported.js","sourceRoot":"","sources":["../../src/capabilities/isSyncOnboardingSupported.ts"],"names":[],"mappings":";;;AAAA,+CAAkD;AAElD,SAAgB,yBAAyB,CAAC,aAA4B;IACpE,OAAO,CAAC,uBAAa,CAAC,IAAI,EAAE,uBAAa,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AAC5E,CAAC;AAFD,8DAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSyncOnboardingSupported.test.d.ts","sourceRoot":"","sources":["../../src/capabilities/isSyncOnboardingSupported.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devices_1 = require("@ledgerhq/devices");
|
|
4
|
+
const isSyncOnboardingSupported_1 = require("./isSyncOnboardingSupported");
|
|
5
|
+
describe("isSyncOnboardingSupported", () => {
|
|
6
|
+
it("should return true if sync onboarding is supported", () => {
|
|
7
|
+
expect((0, isSyncOnboardingSupported_1.isSyncOnboardingSupported)(devices_1.DeviceModelId.stax)).toBe(true);
|
|
8
|
+
expect((0, isSyncOnboardingSupported_1.isSyncOnboardingSupported)(devices_1.DeviceModelId.europa)).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
it("should return false if sync onboarding is not supported", () => {
|
|
11
|
+
expect((0, isSyncOnboardingSupported_1.isSyncOnboardingSupported)(devices_1.DeviceModelId.nanoS)).toBe(false);
|
|
12
|
+
expect((0, isSyncOnboardingSupported_1.isSyncOnboardingSupported)(devices_1.DeviceModelId.nanoSP)).toBe(false);
|
|
13
|
+
expect((0, isSyncOnboardingSupported_1.isSyncOnboardingSupported)(devices_1.DeviceModelId.nanoX)).toBe(false);
|
|
14
|
+
expect((0, isSyncOnboardingSupported_1.isSyncOnboardingSupported)(devices_1.DeviceModelId.blue)).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=isSyncOnboardingSupported.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSyncOnboardingSupported.test.js","sourceRoot":"","sources":["../../src/capabilities/isSyncOnboardingSupported.test.ts"],"names":[],"mappings":";;AAAA,+CAAkD;AAClD,2EAAwE;AAExE,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,CAAC,IAAA,qDAAyB,EAAC,uBAAa,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,MAAM,CAAC,IAAA,qDAAyB,EAAC,uBAAa,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,CAAC,IAAA,qDAAyB,EAAC,uBAAa,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnE,MAAM,CAAC,IAAA,qDAAyB,EAAC,uBAAa,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpE,MAAM,CAAC,IAAA,qDAAyB,EAAC,uBAAa,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnE,MAAM,CAAC,IAAA,qDAAyB,EAAC,uBAAa,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"APDU.d.ts","sourceRoot":"","sources":["../../../src/commands/entities/APDU.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,IAAI,GAAG;IAEjB,GAAG,EAAE,MAAM;IAEX,GAAG,EAAE,MAAM;IAEX,EAAE,EAAE,MAAM;IAEV,EAAE,EAAE,MAAM;IAEV,IAAI,EAAE,MAAM,GAAG,SAAS;CACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"APDU.js","sourceRoot":"","sources":["../../../src/commands/entities/APDU.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export type FirmwareInfoEntity = {
|
|
3
|
+
isBootloader: boolean;
|
|
4
|
+
rawVersion: string;
|
|
5
|
+
targetId: number;
|
|
6
|
+
seVersion?: string;
|
|
7
|
+
mcuVersion: string;
|
|
8
|
+
mcuBlVersion?: string;
|
|
9
|
+
mcuTargetId?: number;
|
|
10
|
+
seTargetId?: number;
|
|
11
|
+
flags: Buffer;
|
|
12
|
+
bootloaderVersion?: string;
|
|
13
|
+
hardwareVersion?: number;
|
|
14
|
+
languageId?: number;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=FirmwareInfoEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FirmwareInfoEntity.d.ts","sourceRoot":"","sources":["../../../src/commands/entities/FirmwareInfoEntity.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FirmwareInfoEntity.js","sourceRoot":"","sources":["../../../src/commands/entities/FirmwareInfoEntity.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDeviceName.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/getDeviceName.ts"],"names":[],"mappings":"AAAA,OAAO,SAA0B,MAAM,wBAAwB,CAAC;AAehE,wBAAsB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBzE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getDeviceName = void 0;
|
|
13
|
+
const hw_transport_1 = require("@ledgerhq/hw-transport");
|
|
14
|
+
const logs_1 = require("@ledgerhq/logs");
|
|
15
|
+
const parseGetDeviceNameResponse_1 = require("./parseGetDeviceNameResponse");
|
|
16
|
+
/**
|
|
17
|
+
* A first APDU that we send because getDeviceName sometimes misbehaves on LNX
|
|
18
|
+
* if it's not sent.
|
|
19
|
+
* cf. https://github.com/LedgerHQ/ledger-live/pull/2250 where it was removed
|
|
20
|
+
* cf. https://github.com/LedgerHQ/ledger-live/pull/2401 where it was added back
|
|
21
|
+
*/
|
|
22
|
+
const CLEANING_APDU = [0xe0, 0x50, 0x00, 0x00, undefined];
|
|
23
|
+
const GET_DEVICE_NAME_APDU = [0xe0, 0xd2, 0x00, 0x00, Buffer.from([])];
|
|
24
|
+
function getDeviceName(transport) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const tracer = new logs_1.LocalTracer("hw", {
|
|
27
|
+
transport: transport.getTraceContext(),
|
|
28
|
+
function: "getDeviceName",
|
|
29
|
+
});
|
|
30
|
+
tracer.trace("Start");
|
|
31
|
+
try {
|
|
32
|
+
// Legacy: prevents bad apdu response for LNX
|
|
33
|
+
yield transport.send(...CLEANING_APDU);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
tracer.trace(`Error on 0xe0500000: ${error}`, { error });
|
|
37
|
+
}
|
|
38
|
+
tracer.trace("Sent cleaning 0xe0500000");
|
|
39
|
+
const res = yield transport.send(...GET_DEVICE_NAME_APDU, [
|
|
40
|
+
hw_transport_1.StatusCodes.OK,
|
|
41
|
+
hw_transport_1.StatusCodes.DEVICE_NOT_ONBOARDED,
|
|
42
|
+
hw_transport_1.StatusCodes.DEVICE_NOT_ONBOARDED_2,
|
|
43
|
+
]);
|
|
44
|
+
return (0, parseGetDeviceNameResponse_1.parseGetDeviceNameResponse)(res);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
exports.getDeviceName = getDeviceName;
|
|
48
|
+
//# sourceMappingURL=getDeviceName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDeviceName.js","sourceRoot":"","sources":["../../../src/commands/use-cases/getDeviceName.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAgE;AAChE,yCAA6C;AAE7C,6EAA0E;AAE1E;;;;;GAKG;AACH,MAAM,aAAa,GAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AAEhE,MAAM,oBAAoB,GAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAE7E,SAAsB,aAAa,CAAC,SAAoB;;QACtD,MAAM,MAAM,GAAG,IAAI,kBAAW,CAAC,IAAI,EAAE;YACnC,SAAS,EAAE,SAAS,CAAC,eAAe,EAAE;YACtC,QAAQ,EAAE,eAAe;SAC1B,CAAC,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEtB,IAAI;YACF,6CAA6C;YAC7C,MAAM,SAAS,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;SACxC;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,CAAC,wBAAwB,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;SAC1D;QACD,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAEzC,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,GAAG,oBAAoB,EAAE;YACxD,0BAAW,CAAC,EAAE;YACd,0BAAW,CAAC,oBAAoB;YAChC,0BAAW,CAAC,sBAAsB;SACnC,CAAC,CAAC;QAEH,OAAO,IAAA,uDAA0B,EAAC,GAAG,CAAC,CAAC;IACzC,CAAC;CAAA;AAtBD,sCAsBC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Transport from "@ledgerhq/hw-transport";
|
|
2
|
+
import { FirmwareInfoEntity } from "../entities/FirmwareInfoEntity";
|
|
3
|
+
import { APDU } from "../entities/APDU";
|
|
4
|
+
export declare const GET_VERSION_APDU: APDU;
|
|
5
|
+
/**
|
|
6
|
+
* Get the FirmwareInfo of a given device
|
|
7
|
+
*
|
|
8
|
+
* @param transport
|
|
9
|
+
* @param options - Contains optional options:
|
|
10
|
+
* - abortTimeoutMs: aborts the APDU exchange after a given timeout
|
|
11
|
+
*/
|
|
12
|
+
export declare function getVersion(transport: Transport, { abortTimeoutMs }?: {
|
|
13
|
+
abortTimeoutMs?: number;
|
|
14
|
+
}): Promise<FirmwareInfoEntity>;
|
|
15
|
+
//# sourceMappingURL=getVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getVersion.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/getVersion.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGxC,eAAO,MAAM,gBAAgB,EAAE,IAA0C,CAAC;AAE1E;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,SAAS,EACpB,EAAE,cAAc,EAAE,GAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAO,GACnD,OAAO,CAAC,kBAAkB,CAAC,CAK7B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getVersion = exports.GET_VERSION_APDU = void 0;
|
|
13
|
+
const parseGetVersionResponse_1 = require("./parseGetVersionResponse");
|
|
14
|
+
exports.GET_VERSION_APDU = [0xe0, 0x01, 0x00, 0x00, undefined];
|
|
15
|
+
/**
|
|
16
|
+
* Get the FirmwareInfo of a given device
|
|
17
|
+
*
|
|
18
|
+
* @param transport
|
|
19
|
+
* @param options - Contains optional options:
|
|
20
|
+
* - abortTimeoutMs: aborts the APDU exchange after a given timeout
|
|
21
|
+
*/
|
|
22
|
+
function getVersion(transport, { abortTimeoutMs } = {}) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const res = yield transport.send(...exports.GET_VERSION_APDU, undefined, {
|
|
25
|
+
abortTimeoutMs,
|
|
26
|
+
});
|
|
27
|
+
return (0, parseGetVersionResponse_1.parseGetVersionResponse)(res);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.getVersion = getVersion;
|
|
31
|
+
//# sourceMappingURL=getVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getVersion.js","sourceRoot":"","sources":["../../../src/commands/use-cases/getVersion.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,uEAAoE;AAEvD,QAAA,gBAAgB,GAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AAE1E;;;;;;GAMG;AACH,SAAsB,UAAU,CAC9B,SAAoB,EACpB,EAAE,cAAc,KAAkC,EAAE;;QAEpD,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,GAAG,wBAAgB,EAAE,SAAS,EAAE;YAC/D,cAAc;SACf,CAAC,CAAC;QACH,OAAO,IAAA,iDAAuB,EAAC,GAAG,CAAC,CAAC;IACtC,CAAC;CAAA;AARD,gCAQC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DeviceModelId } from "@ledgerhq/devices";
|
|
2
|
+
/**
|
|
3
|
+
* @returns whether the Bootloader Version bytes are included in the result of the
|
|
4
|
+
* getVersion APDU
|
|
5
|
+
**/
|
|
6
|
+
export declare const isBootloaderVersionSupported: (seVersion: string, modelId?: DeviceModelId) => boolean;
|
|
7
|
+
//# sourceMappingURL=isBootloaderVersionSupported.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isBootloaderVersionSupported.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/isBootloaderVersionSupported.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAWlD;;;IAGI;AAEJ,eAAO,MAAM,4BAA4B,cAAe,MAAM,YAAY,aAAa,KAAG,OAMvF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isBootloaderVersionSupported = void 0;
|
|
4
|
+
const semver_1 = require("semver");
|
|
5
|
+
const deviceVersionRangesForBootloaderVersion = {
|
|
6
|
+
nanoS: ">=2.0.0",
|
|
7
|
+
nanoX: ">=2.0.0",
|
|
8
|
+
nanoSP: ">=1.0.0",
|
|
9
|
+
stax: ">=1.0.0",
|
|
10
|
+
europa: ">=1.0.0",
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @returns whether the Bootloader Version bytes are included in the result of the
|
|
14
|
+
* getVersion APDU
|
|
15
|
+
**/
|
|
16
|
+
const isBootloaderVersionSupported = (seVersion, modelId) => !!modelId &&
|
|
17
|
+
!!deviceVersionRangesForBootloaderVersion[modelId] &&
|
|
18
|
+
!!(0, semver_1.satisfies)((0, semver_1.coerce)(seVersion) || seVersion, deviceVersionRangesForBootloaderVersion[modelId]);
|
|
19
|
+
exports.isBootloaderVersionSupported = isBootloaderVersionSupported;
|
|
20
|
+
//# sourceMappingURL=isBootloaderVersionSupported.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isBootloaderVersionSupported.js","sourceRoot":"","sources":["../../../src/commands/use-cases/isBootloaderVersionSupported.ts"],"names":[],"mappings":";;;AAAA,mCAA+E;AAG/E,MAAM,uCAAuC,GAEzC;IACF,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;CAClB,CAAC;AACF;;;IAGI;AAEG,MAAM,4BAA4B,GAAG,CAAC,SAAiB,EAAE,OAAuB,EAAW,EAAE,CAClG,CAAC,CAAC,OAAO;IACT,CAAC,CAAC,uCAAuC,CAAC,OAAO,CAAC;IAClD,CAAC,CAAC,IAAA,kBAAgB,EAChB,IAAA,eAAY,EAAC,SAAS,CAAC,IAAI,SAAS,EACpC,uCAAuC,CAAC,OAAO,CAAW,CAC3D,CAAC;AANS,QAAA,4BAA4B,gCAMrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isBootloaderVersionSupported.test.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/isBootloaderVersionSupported.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devices_1 = require("@ledgerhq/devices");
|
|
4
|
+
const isBootloaderVersionSupported_1 = require("./isBootloaderVersionSupported");
|
|
5
|
+
const { nanoS, nanoSP, nanoX, stax } = devices_1.DeviceModelId;
|
|
6
|
+
test("isBootloaderVersionSupported", () => {
|
|
7
|
+
/**
|
|
8
|
+
* Nano S
|
|
9
|
+
* */
|
|
10
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.9.0", nanoS)).toBe(false);
|
|
11
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.9.0-whatever0", nanoS)).toBe(false);
|
|
12
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.0.0", nanoS)).toBe(true);
|
|
13
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.0.0-rc1", nanoS)).toBe(true);
|
|
14
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.0.1", nanoS)).toBe(true);
|
|
15
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.0.1-whatever0", nanoS)).toBe(true);
|
|
16
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.1.0", nanoS)).toBe(true);
|
|
17
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.1.0-whatever0", nanoS)).toBe(true);
|
|
18
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("3.0.0", nanoS)).toBe(true);
|
|
19
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("3.0.0-whatever0", nanoS)).toBe(true);
|
|
20
|
+
/**
|
|
21
|
+
* Nano X
|
|
22
|
+
* */
|
|
23
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.9.0", nanoX)).toBe(false);
|
|
24
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.9.0-whatever0", nanoX)).toBe(false);
|
|
25
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.0.0", nanoX)).toBe(true);
|
|
26
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.0.0-rc1", nanoX)).toBe(true);
|
|
27
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.0.1", nanoX)).toBe(true);
|
|
28
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.0.1-whatever0", nanoX)).toBe(true);
|
|
29
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.1.0", nanoX)).toBe(true);
|
|
30
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("2.1.0-whatever0", nanoX)).toBe(true);
|
|
31
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("3.0.0", nanoX)).toBe(true);
|
|
32
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("3.0.0-whatever0", nanoX)).toBe(true);
|
|
33
|
+
/**
|
|
34
|
+
* Nano SP
|
|
35
|
+
* */
|
|
36
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("0.9.0", nanoSP)).toBe(false);
|
|
37
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("0.9.0-whatever0", nanoSP)).toBe(false);
|
|
38
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.0.0", nanoSP)).toBe(true);
|
|
39
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.0.0-rc1", nanoSP)).toBe(true);
|
|
40
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.0.1", nanoSP)).toBe(true);
|
|
41
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.0.1-whatever0", nanoSP)).toBe(true);
|
|
42
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.1.0", nanoSP)).toBe(true);
|
|
43
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.1.0-whatever0", nanoSP)).toBe(true);
|
|
44
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.0.0", nanoSP)).toBe(true);
|
|
45
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.0.0-whatever0", nanoSP)).toBe(true);
|
|
46
|
+
/**
|
|
47
|
+
* Stax
|
|
48
|
+
* */
|
|
49
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("0.9.0", stax)).toBe(false);
|
|
50
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.0.0", stax)).toBe(true);
|
|
51
|
+
expect((0, isBootloaderVersionSupported_1.isBootloaderVersionSupported)("1.0.0-whatever0", stax)).toBe(true);
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=isBootloaderVersionSupported.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isBootloaderVersionSupported.test.js","sourceRoot":"","sources":["../../../src/commands/use-cases/isBootloaderVersionSupported.test.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDeviceLocalizationSupported.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/isDeviceLocalizationSupported.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAUlD,eAAO,MAAM,6BAA6B,cAC7B,MAAM,YACP,aAAa,KACtB,OAMA,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDeviceLocalizationSupported = void 0;
|
|
4
|
+
const semver_1 = require("semver");
|
|
5
|
+
const deviceVersionRangesForLocalization = {
|
|
6
|
+
nanoX: ">=2.1.0",
|
|
7
|
+
nanoSP: ">=1.1.0",
|
|
8
|
+
stax: ">=1.0.0",
|
|
9
|
+
europa: ">=1.0.0",
|
|
10
|
+
};
|
|
11
|
+
const isDeviceLocalizationSupported = (seVersion, modelId) => !!modelId &&
|
|
12
|
+
!!deviceVersionRangesForLocalization[modelId] &&
|
|
13
|
+
!!(0, semver_1.satisfies)((0, semver_1.coerce)(seVersion) || seVersion, deviceVersionRangesForLocalization[modelId]);
|
|
14
|
+
exports.isDeviceLocalizationSupported = isDeviceLocalizationSupported;
|
|
15
|
+
//# sourceMappingURL=isDeviceLocalizationSupported.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDeviceLocalizationSupported.js","sourceRoot":"","sources":["../../../src/commands/use-cases/isDeviceLocalizationSupported.ts"],"names":[],"mappings":";;;AACA,mCAA+E;AAE/E,MAAM,kCAAkC,GAAwC;IAC9E,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;CAClB,CAAC;AAEK,MAAM,6BAA6B,GAAG,CAC3C,SAAiB,EACjB,OAAuB,EACd,EAAE,CACX,CAAC,CAAC,OAAO;IACT,CAAC,CAAC,kCAAkC,CAAC,OAAO,CAAC;IAC7C,CAAC,CAAC,IAAA,kBAAgB,EAChB,IAAA,eAAY,EAAC,SAAS,CAAC,IAAI,SAAS,EACpC,kCAAkC,CAAC,OAAO,CAAW,CACtD,CAAC;AATS,QAAA,6BAA6B,iCAStC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDeviceLocalizationSupported.test.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/isDeviceLocalizationSupported.test.ts"],"names":[],"mappings":""}
|