@ledgerhq/device-management-kit 1.0.1 → 1.2.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/README.md +63 -28
- package/lib/cjs/package.json +1 -1
- package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKit.js.map +2 -2
- package/lib/cjs/src/api/apdu/utils/ApduBuilder.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ApduBuilder.js.map +3 -3
- package/lib/cjs/src/api/command/os/GetBackgroundImageSizeCommand.js +2 -0
- package/lib/cjs/src/api/command/os/GetBackgroundImageSizeCommand.js.map +7 -0
- package/lib/cjs/src/api/command/os/GetBackgroundImageSizeCommand.test.js +2 -0
- package/lib/cjs/src/api/command/os/GetBackgroundImageSizeCommand.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
- package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
- package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js +1 -1
- package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -1
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceStatus/types.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/ListApps/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListApps/types.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/types.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +3 -3
- package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js +1 -1
- package/lib/cjs/src/api/device-action/task/GetFirmwareMetadataTask.js.map +3 -3
- package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
- package/lib/cjs/src/api/index.js +1 -1
- package/lib/cjs/src/api/index.js.map +3 -3
- package/lib/cjs/src/api/logger-publisher/utils/noopLoggerFactory.js +2 -0
- package/lib/cjs/src/api/logger-publisher/utils/noopLoggerFactory.js.map +7 -0
- package/lib/cjs/src/api/logger-publisher/utils/noopLoggerFactory.test.js +2 -0
- package/lib/cjs/src/api/logger-publisher/utils/noopLoggerFactory.test.js.map +7 -0
- package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
- package/lib/cjs/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
- package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js +1 -1
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +3 -3
- package/lib/cjs/src/api/transport/model/Errors.js +1 -1
- package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
- package/lib/cjs/src/api/types.js +1 -1
- package/lib/cjs/src/api/types.js.map +1 -1
- package/lib/cjs/src/api/utils/ApplicationChecker.js +2 -0
- package/lib/cjs/src/api/utils/ApplicationChecker.js.map +7 -0
- package/lib/cjs/src/api/utils/ApplicationChecker.test.js +2 -0
- package/lib/cjs/src/api/utils/ApplicationChecker.test.js.map +7 -0
- package/lib/cjs/src/api/utils/ApplicationResolver.js +2 -0
- package/lib/cjs/src/api/utils/ApplicationResolver.js.map +7 -0
- package/lib/cjs/src/api/utils/Base64String.js +1 -1
- package/lib/cjs/src/api/utils/Base64String.js.map +3 -3
- package/lib/cjs/src/api/utils/Base64String.test.js +1 -1
- package/lib/cjs/src/api/utils/Base64String.test.js.map +3 -3
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
- package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.js +1 -1
- package/lib/cjs/src/internal/device-session/di/deviceSessionTypes.js.map +2 -2
- package/lib/cjs/src/internal/device-session/model/DevicePinger.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DevicePinger.js.map +2 -2
- package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DevicePinger.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DeviceSession.test.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSession.test.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +2 -2
- package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/service/IntentQueueService.js +2 -0
- package/lib/cjs/src/internal/device-session/service/IntentQueueService.js.map +7 -0
- package/lib/cjs/src/internal/device-session/service/IntentQueueService.test.js +2 -0
- package/lib/cjs/src/internal/device-session/service/IntentQueueService.test.js.map +7 -0
- package/lib/cjs/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.js +2 -0
- package/lib/cjs/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.js.map +7 -0
- package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
- package/lib/esm/package.json +1 -1
- package/lib/esm/src/api/DeviceManagementKit.js +1 -1
- package/lib/esm/src/api/DeviceManagementKit.js.map +2 -2
- package/lib/esm/src/api/apdu/utils/ApduBuilder.js +1 -1
- package/lib/esm/src/api/apdu/utils/ApduBuilder.js.map +3 -3
- package/lib/esm/src/api/command/os/GetBackgroundImageSizeCommand.js +2 -0
- package/lib/esm/src/api/command/os/GetBackgroundImageSizeCommand.js.map +7 -0
- package/lib/esm/src/api/command/os/GetBackgroundImageSizeCommand.test.js +2 -0
- package/lib/esm/src/api/command/os/GetBackgroundImageSizeCommand.test.js.map +7 -0
- package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
- package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
- package/lib/esm/src/api/device-action/model/UserInteractionRequired.js +1 -1
- package/lib/esm/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -0
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +4 -4
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
- package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +4 -4
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/types.js +1 -0
- package/lib/esm/src/api/device-action/os/GetDeviceStatus/types.js.map +4 -4
- package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/GoToDashboard/types.js +1 -0
- package/lib/esm/src/api/device-action/os/GoToDashboard/types.js.map +4 -4
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +4 -4
- package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/ListApps/types.js +1 -0
- package/lib/esm/src/api/device-action/os/ListApps/types.js.map +4 -4
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/types.js +1 -0
- package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/types.js.map +4 -4
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -0
- package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/types.js.map +4 -4
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +4 -4
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +3 -3
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -0
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +4 -4
- package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js +1 -1
- package/lib/esm/src/api/device-action/task/GetFirmwareMetadataTask.js.map +3 -3
- package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/xstate-utils/XStateDeviceAction.js.map +3 -3
- package/lib/esm/src/api/index.js +1 -1
- package/lib/esm/src/api/index.js.map +3 -3
- package/lib/esm/src/api/logger-publisher/utils/noopLoggerFactory.js +2 -0
- package/lib/esm/src/api/logger-publisher/utils/noopLoggerFactory.js.map +7 -0
- package/lib/esm/src/api/logger-publisher/utils/noopLoggerFactory.test.js +2 -0
- package/lib/esm/src/api/logger-publisher/utils/noopLoggerFactory.test.js.map +7 -0
- package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js +1 -1
- package/lib/esm/src/api/logger-subscriber/service/WebLogsExporterLogger.test.js.map +3 -3
- package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js +1 -1
- package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.js.map +3 -3
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js +1 -1
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.js.map +3 -3
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js +1 -1
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +3 -3
- package/lib/esm/src/api/transport/model/Errors.js +1 -1
- package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
- package/lib/esm/src/api/utils/ApplicationChecker.js +2 -0
- package/lib/esm/src/api/utils/ApplicationChecker.js.map +7 -0
- package/lib/esm/src/api/utils/ApplicationChecker.test.js +2 -0
- package/lib/esm/src/api/utils/ApplicationChecker.test.js.map +7 -0
- package/lib/esm/src/api/utils/ApplicationResolver.js +1 -0
- package/lib/esm/src/api/utils/ApplicationResolver.js.map +7 -0
- package/lib/esm/src/api/utils/Base64String.js +1 -1
- package/lib/esm/src/api/utils/Base64String.js.map +3 -3
- package/lib/esm/src/api/utils/Base64String.test.js +1 -1
- package/lib/esm/src/api/utils/Base64String.test.js.map +3 -3
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
- package/lib/esm/src/internal/device-session/di/deviceSessionTypes.js +1 -1
- package/lib/esm/src/internal/device-session/di/deviceSessionTypes.js.map +2 -2
- package/lib/esm/src/internal/device-session/model/DevicePinger.js +1 -1
- package/lib/esm/src/internal/device-session/model/DevicePinger.js.map +2 -2
- package/lib/esm/src/internal/device-session/model/DevicePinger.test.js +1 -1
- package/lib/esm/src/internal/device-session/model/DevicePinger.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DeviceSession.test.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSession.test.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSessionEventDispatcher.js.map +2 -2
- package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSessionRefresher.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.js.map +3 -3
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSessionStateHandler.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/service/IntentQueueService.js +2 -0
- package/lib/esm/src/internal/device-session/service/IntentQueueService.js.map +7 -0
- package/lib/esm/src/internal/device-session/service/IntentQueueService.test.js +2 -0
- package/lib/esm/src/internal/device-session/service/IntentQueueService.test.js.map +7 -0
- package/lib/esm/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.js +2 -0
- package/lib/esm/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.js.map +7 -0
- package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/ConnectUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js +1 -1
- package/lib/esm/src/internal/send/use-case/SendApduUseCase.test.js.map +3 -3
- package/lib/types/src/api/DeviceManagementKit.d.ts +10 -0
- package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts +7 -0
- package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
- package/lib/types/src/api/command/os/GetBackgroundImageSizeCommand.d.ts +17 -0
- package/lib/types/src/api/command/os/GetBackgroundImageSizeCommand.d.ts.map +1 -0
- package/lib/types/src/api/command/os/GetBackgroundImageSizeCommand.test.d.ts +2 -0
- package/lib/types/src/api/command/os/GetBackgroundImageSizeCommand.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/DeviceAction.d.ts +2 -1
- package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
- package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts +4 -1
- package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +9 -1
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +13 -2
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GetDeviceStatus/types.d.ts +6 -0
- package/lib/types/src/api/device-action/os/GetDeviceStatus/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts +1 -1
- package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +9 -1
- package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +9 -1
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/ListApps/ListAppsDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/ListApps/types.d.ts +6 -0
- package/lib/types/src/api/device-action/os/ListApps/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/ListAppsWithMetadata/types.d.ts +8 -1
- package/lib/types/src/api/device-action/os/ListAppsWithMetadata/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +12 -2
- package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +8 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +9 -1
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
- package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts +10 -1
- package/lib/types/src/api/device-action/xstate-utils/XStateDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/index.d.ts +11 -4
- package/lib/types/src/api/index.d.ts.map +1 -1
- package/lib/types/src/api/logger-publisher/utils/noopLoggerFactory.d.ts +12 -0
- package/lib/types/src/api/logger-publisher/utils/noopLoggerFactory.d.ts.map +1 -0
- package/lib/types/src/api/logger-publisher/utils/noopLoggerFactory.test.d.ts +2 -0
- package/lib/types/src/api/logger-publisher/utils/noopLoggerFactory.test.d.ts.map +1 -0
- package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +1 -0
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/Errors.d.ts +5 -0
- package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
- package/lib/types/src/api/types.d.ts +1 -0
- package/lib/types/src/api/types.d.ts.map +1 -1
- package/lib/types/src/api/utils/ApplicationChecker.d.ts +14 -0
- package/lib/types/src/api/utils/ApplicationChecker.d.ts.map +1 -0
- package/lib/types/src/api/utils/ApplicationChecker.test.d.ts +2 -0
- package/lib/types/src/api/utils/ApplicationChecker.test.d.ts.map +1 -0
- package/lib/types/src/api/utils/ApplicationResolver.d.ts +12 -0
- package/lib/types/src/api/utils/ApplicationResolver.d.ts.map +1 -0
- package/lib/types/src/api/utils/Base64String.d.ts +1 -0
- package/lib/types/src/api/utils/Base64String.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/di/deviceSessionTypes.d.ts +1 -0
- package/lib/types/src/internal/device-session/di/deviceSessionTypes.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.d.ts +13 -2
- package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts +3 -1
- package/lib/types/src/internal/device-session/model/DeviceSessionEventDispatcher.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts +0 -1
- package/lib/types/src/internal/device-session/model/DeviceSessionRefresher.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts +1 -0
- package/lib/types/src/internal/device-session/model/DeviceSessionStateHandler.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/service/IntentQueueService.d.ts +101 -0
- package/lib/types/src/internal/device-session/service/IntentQueueService.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/service/IntentQueueService.test.d.ts +2 -0
- package/lib/types/src/internal/device-session/service/IntentQueueService.test.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.d.ts +19 -0
- package/lib/types/src/internal/device-session/use-case/UnsafeBypassIntentQueueUseCase.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js +0 -2
- package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.js.map +0 -7
- package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js +0 -2
- package/lib/cjs/src/api/command/os/GetCustomImageSizeCommand.test.js.map +0 -7
- package/lib/cjs/src/internal/device-session/service/MutexService.js +0 -2
- package/lib/cjs/src/internal/device-session/service/MutexService.js.map +0 -7
- package/lib/cjs/src/internal/device-session/service/MutexService.test.js +0 -2
- package/lib/cjs/src/internal/device-session/service/MutexService.test.js.map +0 -7
- package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js +0 -2
- package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.js.map +0 -7
- package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js +0 -2
- package/lib/esm/src/api/command/os/GetCustomImageSizeCommand.test.js.map +0 -7
- package/lib/esm/src/internal/device-session/service/MutexService.js +0 -2
- package/lib/esm/src/internal/device-session/service/MutexService.js.map +0 -7
- package/lib/esm/src/internal/device-session/service/MutexService.test.js +0 -2
- package/lib/esm/src/internal/device-session/service/MutexService.test.js.map +0 -7
- package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts +0 -17
- package/lib/types/src/api/command/os/GetCustomImageSizeCommand.d.ts.map +0 -1
- package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts +0 -2
- package/lib/types/src/api/command/os/GetCustomImageSizeCommand.test.d.ts.map +0 -1
- package/lib/types/src/internal/device-session/service/MutexService.d.ts +0 -6
- package/lib/types/src/internal/device-session/service/MutexService.d.ts.map +0 -1
- package/lib/types/src/internal/device-session/service/MutexService.test.d.ts +0 -2
- package/lib/types/src/internal/device-session/service/MutexService.test.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@noble/hashes": "^1.8.0",
|
|
4
4
|
"@sentry/minimal": "6.19.7",
|
|
5
|
-
"axios": "1.13.
|
|
5
|
+
"axios": "1.13.5",
|
|
6
6
|
"inversify": "7.5.1",
|
|
7
7
|
"isomorphic-ws": "^5.0.0",
|
|
8
8
|
"purify-ts": "2.1.0",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"@types/ws": "^8.5.14",
|
|
21
21
|
"rxjs": "7.8.2",
|
|
22
22
|
"ts-node": "10.9.2",
|
|
23
|
-
"@ledgerhq/eslint-config-dsdk": "^0.0.2",
|
|
24
23
|
"@ledgerhq/ldmk-tool": "^0.0.1",
|
|
25
|
-
"@ledgerhq/
|
|
24
|
+
"@ledgerhq/eslint-config-dsdk": "^0.0.2",
|
|
26
25
|
"@ledgerhq/prettier-config-dsdk": "^0.0.2",
|
|
26
|
+
"@ledgerhq/vitest-config-dmk": "^0.0.0",
|
|
27
27
|
"@ledgerhq/tsconfig-dsdk": "^1.0.1"
|
|
28
28
|
},
|
|
29
29
|
"exports": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"type": "git",
|
|
48
48
|
"url": "https://github.com/LedgerHQ/device-sdk-ts.git"
|
|
49
49
|
},
|
|
50
|
-
"version": "1.0
|
|
50
|
+
"version": "1.2.0",
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "pnpm ldmk-tool build --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
53
53
|
"dev": "concurrently \"pnpm watch:builds\" \"pnpm watch:types\"",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var f=(r,e)=>{for(var o in e)a(r,o,{get:e[o],enumerable:!0})},z=(r,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of E(e))!S.call(r,m)&&m!==o&&a(r,m,{get:()=>e[m],enumerable:!(t=I(e,m))||t.enumerable});return r};var G=r=>z(a({},"__esModule",{value:!0}),r);var y={};f(y,{GetCustomImageSizeCommand:()=>A,GetCustomImageSizeCommandError:()=>c});module.exports=G(y);var d=require("../../apdu/utils/ApduBuilder"),i=require("../../apdu/utils/ApduParser"),u=require("../../command/Errors"),s=require("../../command/model/CommandResult"),p=require("../../command/utils/CommandErrors"),C=require("../../command/utils/CommandUtils"),g=require("../../command/utils/GlobalCommandError"),l=require("../../Error");const n={"662e":{message:"Invalid state, no background image loaded."},"662f":{message:"Invalid state, device is in recovery mode."}};class c extends l.DeviceExchangeError{constructor({message:e,errorCode:o}){super({message:e,errorCode:o,tag:"GetCustomImageSizeCommandError"})}}class A{name="getCustomImageSize";getApdu(){const e={cla:224,ins:100,p1:0,p2:0};return new d.ApduBuilder(e).build()}parseResponse(e){const o=new i.ApduParser(e);if(!C.CommandUtils.isSuccessResponse(e)){const m=o.encodeToHexaString(e.statusCode);return(0,p.isCommandErrorCode)(m,n)?(0,s.CommandResultFactory)({error:new c({...n[m],errorCode:m})}):(0,s.CommandResultFactory)({error:g.GlobalCommandErrorHandler.handle(e)})}const t=o.extract32BitUInt();return t===void 0?(0,s.CommandResultFactory)({error:new u.InvalidStatusWordError("Didn't receive any size")}):(0,s.CommandResultFactory)({data:t})}}0&&(module.exports={GetCustomImageSizeCommand,GetCustomImageSizeCommandError});
|
|
2
|
-
//# sourceMappingURL=GetCustomImageSizeCommand.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/api/command/os/GetCustomImageSizeCommand.ts"],
|
|
4
|
-
"sourcesContent": ["import { type Apdu } from \"@api/apdu/model/Apdu\";\nimport { ApduBuilder, type ApduBuilderArgs } from \"@api/apdu/utils/ApduBuilder\";\nimport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nimport { type Command } from \"@api/command/Command\";\nimport { InvalidStatusWordError } from \"@api/command/Errors\";\nimport {\n type CommandResult,\n CommandResultFactory,\n} from \"@api/command/model/CommandResult\";\nimport {\n type CommandErrors,\n isCommandErrorCode,\n} from \"@api/command/utils/CommandErrors\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { GlobalCommandErrorHandler } from \"@api/command/utils/GlobalCommandError\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type CommandErrorArgs, DeviceExchangeError } from \"@api/Error\";\n\nexport type GetCustomImageSizeResponse = number;\n\nexport type GetCustomImageSizeErrorCodes = \"662e\" | \"662f\";\n\nconst IMAGE_SIZE_ERRORS: CommandErrors<GetCustomImageSizeErrorCodes> = {\n \"662e\": { message: \"Invalid state, no background image loaded.\" },\n \"662f\": { message: \"Invalid state, device is in recovery mode.\" },\n};\n\nexport type GetCustomImageSizeCommandResult = CommandResult<\n GetCustomImageSizeResponse,\n GetCustomImageSizeErrorCodes\n>;\n\nexport class GetCustomImageSizeCommandError extends DeviceExchangeError<GetCustomImageSizeErrorCodes> {\n constructor({\n message,\n errorCode,\n }: CommandErrorArgs<GetCustomImageSizeErrorCodes>) {\n super({ message, errorCode, tag: \"GetCustomImageSizeCommandError\" });\n }\n}\n\nexport class GetCustomImageSizeCommand\n implements\n Command<GetCustomImageSizeResponse, void, GetCustomImageSizeErrorCodes>\n{\n readonly name = \"getCustomImageSize\";\n\n getApdu(): Apdu {\n const apduArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x64,\n p1: 0x00,\n p2: 0x00,\n };\n return new ApduBuilder(apduArgs).build();\n }\n\n parseResponse(apduResponse: ApduResponse): GetCustomImageSizeCommandResult {\n const parser = new ApduParser(apduResponse);\n\n if (!CommandUtils.isSuccessResponse(apduResponse)) {\n const errorCode = parser.encodeToHexaString(apduResponse.statusCode);\n if (isCommandErrorCode(errorCode, IMAGE_SIZE_ERRORS)) {\n return CommandResultFactory({\n error: new GetCustomImageSizeCommandError({\n ...IMAGE_SIZE_ERRORS[errorCode],\n errorCode,\n }),\n });\n }\n return CommandResultFactory({\n error: GlobalCommandErrorHandler.handle(apduResponse),\n });\n }\n\n const size = parser.extract32BitUInt();\n if (size === undefined) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Didn't receive any size\"),\n });\n }\n\n return CommandResultFactory({\n data: size,\n });\n }\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,EAAA,mCAAAC,IAAA,eAAAC,EAAAJ,GACA,IAAAK,EAAkD,uCAClDC,EAA2B,sCAE3BC,EAAuC,+BACvCC,EAGO,4CACPC,EAGO,4CACPC,EAA6B,2CAC7BC,EAA0C,iDAE1CC,EAA2D,sBAM3D,MAAMC,EAAiE,CACrE,OAAQ,CAAE,QAAS,4CAA6C,EAChE,OAAQ,CAAE,QAAS,4CAA6C,CAClE,EAOO,MAAMV,UAAuC,qBAAkD,CACpG,YAAY,CACV,QAAAW,EACA,UAAAC,CACF,EAAmD,CACjD,MAAM,CAAE,QAAAD,EAAS,UAAAC,EAAW,IAAK,gCAAiC,CAAC,CACrE,CACF,CAEO,MAAMb,CAGb,CACW,KAAO,qBAEhB,SAAgB,CACd,MAAMc,EAA4B,CAChC,IAAK,IACL,IAAK,IACL,GAAI,EACJ,GAAI,CACN,EACA,OAAO,IAAI,cAAYA,CAAQ,EAAE,MAAM,CACzC,CAEA,cAAcC,EAA6D,CACzE,MAAMC,EAAS,IAAI,aAAWD,CAAY,EAE1C,GAAI,CAAC,eAAa,kBAAkBA,CAAY,EAAG,CACjD,MAAMF,EAAYG,EAAO,mBAAmBD,EAAa,UAAU,EACnE,SAAI,sBAAmBF,EAAWF,CAAiB,KAC1C,wBAAqB,CAC1B,MAAO,IAAIV,EAA+B,CACxC,GAAGU,EAAkBE,CAAS,EAC9B,UAAAA,CACF,CAAC,CACH,CAAC,KAEI,wBAAqB,CAC1B,MAAO,4BAA0B,OAAOE,CAAY,CACtD,CAAC,CACH,CAEA,MAAME,EAAOD,EAAO,iBAAiB,EACrC,OAAIC,IAAS,UACJ,wBAAqB,CAC1B,MAAO,IAAI,yBAAuB,yBAAyB,CAC7D,CAAC,KAGI,wBAAqB,CAC1B,KAAMA,CACR,CAAC,CACH,CACF",
|
|
6
|
-
"names": ["GetCustomImageSizeCommand_exports", "__export", "GetCustomImageSizeCommand", "GetCustomImageSizeCommandError", "__toCommonJS", "import_ApduBuilder", "import_ApduParser", "import_Errors", "import_CommandResult", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_Error", "IMAGE_SIZE_ERRORS", "message", "errorCode", "apduArgs", "apduResponse", "parser", "size"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var n=require("../../command/Errors"),r=require("../../command/model/CommandResult"),a=require("../../command/model/CommandResult"),i=require("../../command/os/GetCustomImageSizeCommand"),o=require("../../device-session/ApduResponse");const m=new Uint8Array([224,100,0,0,0]);describe("GetCustomImageSizeCommand",()=>{let t;beforeEach(()=>{t=new i.GetCustomImageSizeCommand}),describe("name",()=>{it("should be 'getCustomImageSize'",()=>{expect(t.name).toBe("getCustomImageSize")})}),it("should return the correct APDU",()=>{const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(m)}),it("should parse result successfully",()=>{const e=new o.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([0,0,137,233])}),s=t.parseResponse(e);expect(s).toStrictEqual((0,r.CommandResultFactory)({data:35305}))}),it("should fail on invalid size",()=>{const e=new o.ApduResponse({statusCode:new Uint8Array([144,0]),data:new Uint8Array([233])}),s=t.parseResponse(e);expect(s).toStrictEqual((0,r.CommandResultFactory)({error:new n.InvalidStatusWordError("Didn't receive any size")}))}),it("should fail on device error",()=>{const e=new o.ApduResponse({statusCode:new Uint8Array([102,46]),data:new Uint8Array([])}),s=t.parseResponse(e);expect((0,a.isSuccessCommandResult)(s)).toBeFalsy()})});
|
|
2
|
-
//# sourceMappingURL=GetCustomImageSizeCommand.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/api/command/os/GetCustomImageSizeCommand.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { InvalidStatusWordError } from \"@api/command/Errors\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport { GetCustomImageSizeCommand } from \"@api/command/os/GetCustomImageSizeCommand\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nconst IMAGE_SIZE_APDU = new Uint8Array([0xe0, 0x64, 0x00, 0x00, 0x00]);\n\ndescribe(\"GetCustomImageSizeCommand\", () => {\n let command: GetCustomImageSizeCommand;\n\n beforeEach(() => {\n command = new GetCustomImageSizeCommand();\n });\n\n describe(\"name\", () => {\n it(\"should be 'getCustomImageSize'\", () => {\n expect(command.name).toBe(\"getCustomImageSize\");\n });\n });\n\n it(\"should return the correct APDU\", () => {\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(IMAGE_SIZE_APDU);\n });\n\n it(\"should parse result successfully\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([0x00, 0x00, 0x89, 0xe9]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: 35305,\n }),\n );\n });\n\n it(\"should fail on invalid size\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([0xe9]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"Didn't receive any size\"),\n }),\n );\n });\n\n it(\"should fail on device error\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x66, 0x2e]),\n data: new Uint8Array([]),\n });\n const result = command.parseResponse(response);\n expect(isSuccessCommandResult(result)).toBeFalsy();\n });\n});\n"],
|
|
5
|
-
"mappings": "aAAA,IAAAA,EAAuC,+BACvCC,EAAqC,4CACrCA,EAAuC,4CACvCC,EAA0C,qDAC1CC,EAA6B,4CAE7B,MAAMC,EAAkB,IAAI,WAAW,CAAC,IAAM,IAAM,EAAM,EAAM,CAAI,CAAC,EAErE,SAAS,4BAA6B,IAAM,CAC1C,IAAIC,EAEJ,WAAW,IAAM,CACfA,EAAU,IAAI,2BAChB,CAAC,EAED,SAAS,OAAQ,IAAM,CACrB,GAAG,iCAAkC,IAAM,CACzC,OAAOA,EAAQ,IAAI,EAAE,KAAK,oBAAoB,CAChD,CAAC,CACH,CAAC,EAED,GAAG,iCAAkC,IAAM,CACzC,MAAMC,EAAOD,EAAQ,QAAQ,EAC7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cAAcF,CAAe,CACzD,CAAC,EAED,GAAG,mCAAoC,IAAM,CAC3C,MAAMG,EAAyB,IAAI,eAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,EAAM,EAAM,IAAM,GAAI,CAAC,CAC/C,CAAC,EACKC,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,iBACb,wBAAqB,CACnB,KAAM,KACR,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMD,EAAyB,IAAI,eAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,GAAI,CAAC,CAC7B,CAAC,EACKC,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,iBACb,wBAAqB,CACnB,MAAO,IAAI,yBAAuB,yBAAyB,CAC7D,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMD,EAAyB,IAAI,eAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,EAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EACKC,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,UAAO,0BAAuBC,CAAM,CAAC,EAAE,UAAU,CACnD,CAAC,CACH,CAAC",
|
|
6
|
-
"names": ["import_Errors", "import_CommandResult", "import_GetCustomImageSizeCommand", "import_ApduResponse", "IMAGE_SIZE_APDU", "command", "apdu", "response", "result"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var h=(s,e)=>{for(var t in e)o(s,t,{get:e[t],enumerable:!0})},_=(s,e,t,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c(e))!l.call(s,i)&&i!==t&&o(s,i,{get:()=>e[i],enumerable:!(u=r(e,i))||u.enumerable});return s};var a=s=>_(o({},"__esModule",{value:!0}),s);var n={};h(n,{MutexService:()=>d});module.exports=a(n);class d{_queue=[];_locked=!1;async lock(){return new Promise(e=>{const t=()=>{if(this._locked=!1,this._queue.length>0){const u=this._queue.shift();this._locked=!0,u()}};this._locked?this._queue.push(()=>e(t)):(this._locked=!0,e(t))})}}0&&(module.exports={MutexService});
|
|
2
|
-
//# sourceMappingURL=MutexService.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/internal/device-session/service/MutexService.ts"],
|
|
4
|
-
"sourcesContent": ["export class MutexService {\n private _queue: Array<() => void> = [];\n private _locked = false;\n\n async lock(): Promise<() => void> {\n return new Promise((resolve) => {\n const release = () => {\n this._locked = false;\n if (this._queue.length > 0) {\n const next = this._queue.shift();\n this._locked = true;\n next!();\n }\n };\n\n if (!this._locked) {\n this._locked = true;\n resolve(release);\n } else {\n this._queue.push(() => resolve(release));\n }\n });\n }\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,CAAa,CAChB,OAA4B,CAAC,EAC7B,QAAU,GAElB,MAAM,MAA4B,CAChC,OAAO,IAAI,QAASE,GAAY,CAC9B,MAAMC,EAAU,IAAM,CAEpB,GADA,KAAK,QAAU,GACX,KAAK,OAAO,OAAS,EAAG,CAC1B,MAAMC,EAAO,KAAK,OAAO,MAAM,EAC/B,KAAK,QAAU,GACfA,EAAM,CACR,CACF,EAEK,KAAK,QAIR,KAAK,OAAO,KAAK,IAAMF,EAAQC,CAAO,CAAC,GAHvC,KAAK,QAAU,GACfD,EAAQC,CAAO,EAInB,CAAC,CACH,CACF",
|
|
6
|
-
"names": ["MutexService_exports", "__export", "MutexService", "__toCommonJS", "resolve", "release", "next"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("vitest"),c=require("./MutexService");(0,e.describe)("MutexService",()=>{(0,e.it)("should immediately return a release function when not locked",async()=>{const t=await new c.MutexService().lock();(0,e.expect)(typeof t).toBe("function"),t()}),(0,e.it)("should queue subsequent lock calls until the lock is released",async()=>{const o=new c.MutexService,t=await o.lock();let s=!1;const l=o.lock().then(n=>{s=!0,n()});(0,e.expect)(s).toBe(!1),t(),await l,(0,e.expect)(s).toBe(!0)}),(0,e.it)("should queue multiple locks in FIFO order",async()=>{const o=new c.MutexService,t=[],s=await o.lock();t.push("first");const l=o.lock().then(r=>{t.push("second"),r()}),n=o.lock().then(r=>{t.push("third"),r()});t.push("afterqueue"),s(),await Promise.all([l,n]),(0,e.expect)(t).toEqual(["first","afterqueue","second","third"])})});
|
|
2
|
-
//# sourceMappingURL=MutexService.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/internal/device-session/service/MutexService.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { describe, expect, it } from \"vitest\";\n\nimport { MutexService } from \"./MutexService\";\n\ndescribe(\"MutexService\", () => {\n it(\"should immediately return a release function when not locked\", async () => {\n // given\n const mutex = new MutexService();\n\n // when\n const release = await mutex.lock();\n\n // then\n expect(typeof release).toBe(\"function\");\n release();\n });\n\n it(\"should queue subsequent lock calls until the lock is released\", async () => {\n // given\n const mutex = new MutexService();\n const release1 = await mutex.lock();\n\n // when\n let lock2Resolved = false;\n const lock2Promise = mutex.lock().then((release2) => {\n lock2Resolved = true;\n release2();\n });\n\n // then\n expect(lock2Resolved).toBe(false);\n\n // when\n release1();\n await lock2Promise;\n\n // then\n expect(lock2Resolved).toBe(true);\n });\n\n it(\"should queue multiple locks in FIFO order\", async () => {\n // given\n const mutex = new MutexService();\n const order: string[] = [];\n\n // when\n const release1 = await mutex.lock();\n order.push(\"first\");\n const lock2Promise = mutex.lock().then((release2) => {\n order.push(\"second\");\n release2();\n });\n const lock3Promise = mutex.lock().then((release3) => {\n order.push(\"third\");\n release3();\n });\n\n // then\n order.push(\"afterqueue\");\n\n // when\n release1();\n await Promise.all([lock2Promise, lock3Promise]);\n\n // then\n expect(order).toEqual([\"first\", \"afterqueue\", \"second\", \"third\"]);\n });\n});\n"],
|
|
5
|
-
"mappings": "aAAA,IAAAA,EAAqC,kBAErCC,EAA6B,6BAE7B,YAAS,eAAgB,IAAM,IAC7B,MAAG,+DAAgE,SAAY,CAK7E,MAAMC,EAAU,MAHF,IAAI,eAAa,EAGH,KAAK,KAGjC,UAAO,OAAOA,CAAO,EAAE,KAAK,UAAU,EACtCA,EAAQ,CACV,CAAC,KAED,MAAG,gEAAiE,SAAY,CAE9E,MAAMC,EAAQ,IAAI,eACZC,EAAW,MAAMD,EAAM,KAAK,EAGlC,IAAIE,EAAgB,GACpB,MAAMC,EAAeH,EAAM,KAAK,EAAE,KAAMI,GAAa,CACnDF,EAAgB,GAChBE,EAAS,CACX,CAAC,KAGD,UAAOF,CAAa,EAAE,KAAK,EAAK,EAGhCD,EAAS,EACT,MAAME,KAGN,UAAOD,CAAa,EAAE,KAAK,EAAI,CACjC,CAAC,KAED,MAAG,4CAA6C,SAAY,CAE1D,MAAMF,EAAQ,IAAI,eACZK,EAAkB,CAAC,EAGnBJ,EAAW,MAAMD,EAAM,KAAK,EAClCK,EAAM,KAAK,OAAO,EAClB,MAAMF,EAAeH,EAAM,KAAK,EAAE,KAAMI,GAAa,CACnDC,EAAM,KAAK,QAAQ,EACnBD,EAAS,CACX,CAAC,EACKE,EAAeN,EAAM,KAAK,EAAE,KAAMO,GAAa,CACnDF,EAAM,KAAK,OAAO,EAClBE,EAAS,CACX,CAAC,EAGDF,EAAM,KAAK,YAAY,EAGvBJ,EAAS,EACT,MAAM,QAAQ,IAAI,CAACE,EAAcG,CAAY,CAAC,KAG9C,UAAOD,CAAK,EAAE,QAAQ,CAAC,QAAS,aAAc,SAAU,OAAO,CAAC,CAClE,CAAC,CACH,CAAC",
|
|
6
|
-
"names": ["import_vitest", "import_MutexService", "release", "mutex", "release1", "lock2Resolved", "lock2Promise", "release2", "order", "lock3Promise", "release3"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ApduBuilder as n}from"../../apdu/utils/ApduBuilder";import{ApduParser as d}from"../../apdu/utils/ApduParser";import{InvalidStatusWordError as i}from"../../command/Errors";import{CommandResultFactory as o}from"../../command/model/CommandResult";import{isCommandErrorCode as u}from"../../command/utils/CommandErrors";import{CommandUtils as p}from"../../command/utils/CommandUtils";import{GlobalCommandErrorHandler as C}from"../../command/utils/GlobalCommandError";import{DeviceExchangeError as g}from"../../Error";const s={"662e":{message:"Invalid state, no background image loaded."},"662f":{message:"Invalid state, device is in recovery mode."}};class l extends g{constructor({message:e,errorCode:r}){super({message:e,errorCode:r,tag:"GetCustomImageSizeCommandError"})}}class y{name="getCustomImageSize";getApdu(){const e={cla:224,ins:100,p1:0,p2:0};return new n(e).build()}parseResponse(e){const r=new d(e);if(!p.isSuccessResponse(e)){const m=r.encodeToHexaString(e.statusCode);return u(m,s)?o({error:new l({...s[m],errorCode:m})}):o({error:C.handle(e)})}const t=r.extract32BitUInt();return t===void 0?o({error:new i("Didn't receive any size")}):o({data:t})}}export{y as GetCustomImageSizeCommand,l as GetCustomImageSizeCommandError};
|
|
2
|
-
//# sourceMappingURL=GetCustomImageSizeCommand.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/api/command/os/GetCustomImageSizeCommand.ts"],
|
|
4
|
-
"sourcesContent": ["import { type Apdu } from \"@api/apdu/model/Apdu\";\nimport { ApduBuilder, type ApduBuilderArgs } from \"@api/apdu/utils/ApduBuilder\";\nimport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nimport { type Command } from \"@api/command/Command\";\nimport { InvalidStatusWordError } from \"@api/command/Errors\";\nimport {\n type CommandResult,\n CommandResultFactory,\n} from \"@api/command/model/CommandResult\";\nimport {\n type CommandErrors,\n isCommandErrorCode,\n} from \"@api/command/utils/CommandErrors\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { GlobalCommandErrorHandler } from \"@api/command/utils/GlobalCommandError\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport { type CommandErrorArgs, DeviceExchangeError } from \"@api/Error\";\n\nexport type GetCustomImageSizeResponse = number;\n\nexport type GetCustomImageSizeErrorCodes = \"662e\" | \"662f\";\n\nconst IMAGE_SIZE_ERRORS: CommandErrors<GetCustomImageSizeErrorCodes> = {\n \"662e\": { message: \"Invalid state, no background image loaded.\" },\n \"662f\": { message: \"Invalid state, device is in recovery mode.\" },\n};\n\nexport type GetCustomImageSizeCommandResult = CommandResult<\n GetCustomImageSizeResponse,\n GetCustomImageSizeErrorCodes\n>;\n\nexport class GetCustomImageSizeCommandError extends DeviceExchangeError<GetCustomImageSizeErrorCodes> {\n constructor({\n message,\n errorCode,\n }: CommandErrorArgs<GetCustomImageSizeErrorCodes>) {\n super({ message, errorCode, tag: \"GetCustomImageSizeCommandError\" });\n }\n}\n\nexport class GetCustomImageSizeCommand\n implements\n Command<GetCustomImageSizeResponse, void, GetCustomImageSizeErrorCodes>\n{\n readonly name = \"getCustomImageSize\";\n\n getApdu(): Apdu {\n const apduArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x64,\n p1: 0x00,\n p2: 0x00,\n };\n return new ApduBuilder(apduArgs).build();\n }\n\n parseResponse(apduResponse: ApduResponse): GetCustomImageSizeCommandResult {\n const parser = new ApduParser(apduResponse);\n\n if (!CommandUtils.isSuccessResponse(apduResponse)) {\n const errorCode = parser.encodeToHexaString(apduResponse.statusCode);\n if (isCommandErrorCode(errorCode, IMAGE_SIZE_ERRORS)) {\n return CommandResultFactory({\n error: new GetCustomImageSizeCommandError({\n ...IMAGE_SIZE_ERRORS[errorCode],\n errorCode,\n }),\n });\n }\n return CommandResultFactory({\n error: GlobalCommandErrorHandler.handle(apduResponse),\n });\n }\n\n const size = parser.extract32BitUInt();\n if (size === undefined) {\n return CommandResultFactory({\n error: new InvalidStatusWordError(\"Didn't receive any size\"),\n });\n }\n\n return CommandResultFactory({\n data: size,\n });\n }\n}\n"],
|
|
5
|
-
"mappings": "AACA,OAAS,eAAAA,MAAyC,8BAClD,OAAS,cAAAC,MAAkB,6BAE3B,OAAS,0BAAAC,MAA8B,sBACvC,OAEE,wBAAAC,MACK,mCACP,OAEE,sBAAAC,MACK,mCACP,OAAS,gBAAAC,MAAoB,kCAC7B,OAAS,6BAAAC,MAAiC,wCAE1C,OAAgC,uBAAAC,MAA2B,aAM3D,MAAMC,EAAiE,CACrE,OAAQ,CAAE,QAAS,4CAA6C,EAChE,OAAQ,CAAE,QAAS,4CAA6C,CAClE,EAOO,MAAMC,UAAuCF,CAAkD,CACpG,YAAY,CACV,QAAAG,EACA,UAAAC,CACF,EAAmD,CACjD,MAAM,CAAE,QAAAD,EAAS,UAAAC,EAAW,IAAK,gCAAiC,CAAC,CACrE,CACF,CAEO,MAAMC,CAGb,CACW,KAAO,qBAEhB,SAAgB,CACd,MAAMC,EAA4B,CAChC,IAAK,IACL,IAAK,IACL,GAAI,EACJ,GAAI,CACN,EACA,OAAO,IAAIb,EAAYa,CAAQ,EAAE,MAAM,CACzC,CAEA,cAAcC,EAA6D,CACzE,MAAMC,EAAS,IAAId,EAAWa,CAAY,EAE1C,GAAI,CAACT,EAAa,kBAAkBS,CAAY,EAAG,CACjD,MAAMH,EAAYI,EAAO,mBAAmBD,EAAa,UAAU,EACnE,OAAIV,EAAmBO,EAAWH,CAAiB,EAC1CL,EAAqB,CAC1B,MAAO,IAAIM,EAA+B,CACxC,GAAGD,EAAkBG,CAAS,EAC9B,UAAAA,CACF,CAAC,CACH,CAAC,EAEIR,EAAqB,CAC1B,MAAOG,EAA0B,OAAOQ,CAAY,CACtD,CAAC,CACH,CAEA,MAAME,EAAOD,EAAO,iBAAiB,EACrC,OAAIC,IAAS,OACJb,EAAqB,CAC1B,MAAO,IAAID,EAAuB,yBAAyB,CAC7D,CAAC,EAGIC,EAAqB,CAC1B,KAAMa,CACR,CAAC,CACH,CACF",
|
|
6
|
-
"names": ["ApduBuilder", "ApduParser", "InvalidStatusWordError", "CommandResultFactory", "isCommandErrorCode", "CommandUtils", "GlobalCommandErrorHandler", "DeviceExchangeError", "IMAGE_SIZE_ERRORS", "GetCustomImageSizeCommandError", "message", "errorCode", "GetCustomImageSizeCommand", "apduArgs", "apduResponse", "parser", "size"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{InvalidStatusWordError as n}from"../../command/Errors";import{CommandResultFactory as r}from"../../command/model/CommandResult";import{isSuccessCommandResult as a}from"../../command/model/CommandResult";import{GetCustomImageSizeCommand as i}from"../../command/os/GetCustomImageSizeCommand";import{ApduResponse as o}from"../../device-session/ApduResponse";const m=new Uint8Array([224,100,0,0,0]);describe("GetCustomImageSizeCommand",()=>{let t;beforeEach(()=>{t=new i}),describe("name",()=>{it("should be 'getCustomImageSize'",()=>{expect(t.name).toBe("getCustomImageSize")})}),it("should return the correct APDU",()=>{const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(m)}),it("should parse result successfully",()=>{const e=new o({statusCode:new Uint8Array([144,0]),data:new Uint8Array([0,0,137,233])}),s=t.parseResponse(e);expect(s).toStrictEqual(r({data:35305}))}),it("should fail on invalid size",()=>{const e=new o({statusCode:new Uint8Array([144,0]),data:new Uint8Array([233])}),s=t.parseResponse(e);expect(s).toStrictEqual(r({error:new n("Didn't receive any size")}))}),it("should fail on device error",()=>{const e=new o({statusCode:new Uint8Array([102,46]),data:new Uint8Array([])}),s=t.parseResponse(e);expect(a(s)).toBeFalsy()})});
|
|
2
|
-
//# sourceMappingURL=GetCustomImageSizeCommand.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/api/command/os/GetCustomImageSizeCommand.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { InvalidStatusWordError } from \"@api/command/Errors\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { isSuccessCommandResult } from \"@api/command/model/CommandResult\";\nimport { GetCustomImageSizeCommand } from \"@api/command/os/GetCustomImageSizeCommand\";\nimport { ApduResponse } from \"@api/device-session/ApduResponse\";\n\nconst IMAGE_SIZE_APDU = new Uint8Array([0xe0, 0x64, 0x00, 0x00, 0x00]);\n\ndescribe(\"GetCustomImageSizeCommand\", () => {\n let command: GetCustomImageSizeCommand;\n\n beforeEach(() => {\n command = new GetCustomImageSizeCommand();\n });\n\n describe(\"name\", () => {\n it(\"should be 'getCustomImageSize'\", () => {\n expect(command.name).toBe(\"getCustomImageSize\");\n });\n });\n\n it(\"should return the correct APDU\", () => {\n const apdu = command.getApdu();\n expect(apdu.getRawApdu()).toStrictEqual(IMAGE_SIZE_APDU);\n });\n\n it(\"should parse result successfully\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([0x00, 0x00, 0x89, 0xe9]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n data: 35305,\n }),\n );\n });\n\n it(\"should fail on invalid size\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x90, 0x00]),\n data: new Uint8Array([0xe9]),\n });\n const result = command.parseResponse(response);\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"Didn't receive any size\"),\n }),\n );\n });\n\n it(\"should fail on device error\", () => {\n const response: ApduResponse = new ApduResponse({\n statusCode: new Uint8Array([0x66, 0x2e]),\n data: new Uint8Array([]),\n });\n const result = command.parseResponse(response);\n expect(isSuccessCommandResult(result)).toBeFalsy();\n });\n});\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,0BAAAA,MAA8B,sBACvC,OAAS,wBAAAC,MAA4B,mCACrC,OAAS,0BAAAC,MAA8B,mCACvC,OAAS,6BAAAC,MAAiC,4CAC1C,OAAS,gBAAAC,MAAoB,mCAE7B,MAAMC,EAAkB,IAAI,WAAW,CAAC,IAAM,IAAM,EAAM,EAAM,CAAI,CAAC,EAErE,SAAS,4BAA6B,IAAM,CAC1C,IAAIC,EAEJ,WAAW,IAAM,CACfA,EAAU,IAAIH,CAChB,CAAC,EAED,SAAS,OAAQ,IAAM,CACrB,GAAG,iCAAkC,IAAM,CACzC,OAAOG,EAAQ,IAAI,EAAE,KAAK,oBAAoB,CAChD,CAAC,CACH,CAAC,EAED,GAAG,iCAAkC,IAAM,CACzC,MAAMC,EAAOD,EAAQ,QAAQ,EAC7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cAAcF,CAAe,CACzD,CAAC,EAED,GAAG,mCAAoC,IAAM,CAC3C,MAAMG,EAAyB,IAAIJ,EAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,EAAM,EAAM,IAAM,GAAI,CAAC,CAC/C,CAAC,EACKK,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,cACbR,EAAqB,CACnB,KAAM,KACR,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMO,EAAyB,IAAIJ,EAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,CAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,GAAI,CAAC,CAC7B,CAAC,EACKK,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAOC,CAAM,EAAE,cACbR,EAAqB,CACnB,MAAO,IAAID,EAAuB,yBAAyB,CAC7D,CAAC,CACH,CACF,CAAC,EAED,GAAG,8BAA+B,IAAM,CACtC,MAAMQ,EAAyB,IAAIJ,EAAa,CAC9C,WAAY,IAAI,WAAW,CAAC,IAAM,EAAI,CAAC,EACvC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,CAAC,EACKK,EAASH,EAAQ,cAAcE,CAAQ,EAC7C,OAAON,EAAuBO,CAAM,CAAC,EAAE,UAAU,CACnD,CAAC,CACH,CAAC",
|
|
6
|
-
"names": ["InvalidStatusWordError", "CommandResultFactory", "isSuccessCommandResult", "GetCustomImageSizeCommand", "ApduResponse", "IMAGE_SIZE_APDU", "command", "apdu", "response", "result"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
class u{_queue=[];_locked=!1;async lock(){return new Promise(e=>{const s=()=>{if(this._locked=!1,this._queue.length>0){const t=this._queue.shift();this._locked=!0,t()}};this._locked?this._queue.push(()=>e(s)):(this._locked=!0,e(s))})}}export{u as MutexService};
|
|
2
|
-
//# sourceMappingURL=MutexService.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/internal/device-session/service/MutexService.ts"],
|
|
4
|
-
"sourcesContent": ["export class MutexService {\n private _queue: Array<() => void> = [];\n private _locked = false;\n\n async lock(): Promise<() => void> {\n return new Promise((resolve) => {\n const release = () => {\n this._locked = false;\n if (this._queue.length > 0) {\n const next = this._queue.shift();\n this._locked = true;\n next!();\n }\n };\n\n if (!this._locked) {\n this._locked = true;\n resolve(release);\n } else {\n this._queue.push(() => resolve(release));\n }\n });\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAO,MAAMA,CAAa,CAChB,OAA4B,CAAC,EAC7B,QAAU,GAElB,MAAM,MAA4B,CAChC,OAAO,IAAI,QAASC,GAAY,CAC9B,MAAMC,EAAU,IAAM,CAEpB,GADA,KAAK,QAAU,GACX,KAAK,OAAO,OAAS,EAAG,CAC1B,MAAMC,EAAO,KAAK,OAAO,MAAM,EAC/B,KAAK,QAAU,GACfA,EAAM,CACR,CACF,EAEK,KAAK,QAIR,KAAK,OAAO,KAAK,IAAMF,EAAQC,CAAO,CAAC,GAHvC,KAAK,QAAU,GACfD,EAAQC,CAAO,EAInB,CAAC,CACH,CACF",
|
|
6
|
-
"names": ["MutexService", "resolve", "release", "next"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{describe as i,expect as s,it as r}from"vitest";import{MutexService as u}from"./MutexService";i("MutexService",()=>{r("should immediately return a release function when not locked",async()=>{const e=await new u().lock();s(typeof e).toBe("function"),e()}),r("should queue subsequent lock calls until the lock is released",async()=>{const t=new u,e=await t.lock();let o=!1;const c=t.lock().then(l=>{o=!0,l()});s(o).toBe(!1),e(),await c,s(o).toBe(!0)}),r("should queue multiple locks in FIFO order",async()=>{const t=new u,e=[],o=await t.lock();e.push("first");const c=t.lock().then(n=>{e.push("second"),n()}),l=t.lock().then(n=>{e.push("third"),n()});e.push("afterqueue"),o(),await Promise.all([c,l]),s(e).toEqual(["first","afterqueue","second","third"])})});
|
|
2
|
-
//# sourceMappingURL=MutexService.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/internal/device-session/service/MutexService.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { describe, expect, it } from \"vitest\";\n\nimport { MutexService } from \"./MutexService\";\n\ndescribe(\"MutexService\", () => {\n it(\"should immediately return a release function when not locked\", async () => {\n // given\n const mutex = new MutexService();\n\n // when\n const release = await mutex.lock();\n\n // then\n expect(typeof release).toBe(\"function\");\n release();\n });\n\n it(\"should queue subsequent lock calls until the lock is released\", async () => {\n // given\n const mutex = new MutexService();\n const release1 = await mutex.lock();\n\n // when\n let lock2Resolved = false;\n const lock2Promise = mutex.lock().then((release2) => {\n lock2Resolved = true;\n release2();\n });\n\n // then\n expect(lock2Resolved).toBe(false);\n\n // when\n release1();\n await lock2Promise;\n\n // then\n expect(lock2Resolved).toBe(true);\n });\n\n it(\"should queue multiple locks in FIFO order\", async () => {\n // given\n const mutex = new MutexService();\n const order: string[] = [];\n\n // when\n const release1 = await mutex.lock();\n order.push(\"first\");\n const lock2Promise = mutex.lock().then((release2) => {\n order.push(\"second\");\n release2();\n });\n const lock3Promise = mutex.lock().then((release3) => {\n order.push(\"third\");\n release3();\n });\n\n // then\n order.push(\"afterqueue\");\n\n // when\n release1();\n await Promise.all([lock2Promise, lock3Promise]);\n\n // then\n expect(order).toEqual([\"first\", \"afterqueue\", \"second\", \"third\"]);\n });\n});\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,YAAAA,EAAU,UAAAC,EAAQ,MAAAC,MAAU,SAErC,OAAS,gBAAAC,MAAoB,iBAE7BH,EAAS,eAAgB,IAAM,CAC7BE,EAAG,+DAAgE,SAAY,CAK7E,MAAME,EAAU,MAHF,IAAID,EAAa,EAGH,KAAK,EAGjCF,EAAO,OAAOG,CAAO,EAAE,KAAK,UAAU,EACtCA,EAAQ,CACV,CAAC,EAEDF,EAAG,gEAAiE,SAAY,CAE9E,MAAMG,EAAQ,IAAIF,EACZG,EAAW,MAAMD,EAAM,KAAK,EAGlC,IAAIE,EAAgB,GACpB,MAAMC,EAAeH,EAAM,KAAK,EAAE,KAAMI,GAAa,CACnDF,EAAgB,GAChBE,EAAS,CACX,CAAC,EAGDR,EAAOM,CAAa,EAAE,KAAK,EAAK,EAGhCD,EAAS,EACT,MAAME,EAGNP,EAAOM,CAAa,EAAE,KAAK,EAAI,CACjC,CAAC,EAEDL,EAAG,4CAA6C,SAAY,CAE1D,MAAMG,EAAQ,IAAIF,EACZO,EAAkB,CAAC,EAGnBJ,EAAW,MAAMD,EAAM,KAAK,EAClCK,EAAM,KAAK,OAAO,EAClB,MAAMF,EAAeH,EAAM,KAAK,EAAE,KAAMI,GAAa,CACnDC,EAAM,KAAK,QAAQ,EACnBD,EAAS,CACX,CAAC,EACKE,EAAeN,EAAM,KAAK,EAAE,KAAMO,GAAa,CACnDF,EAAM,KAAK,OAAO,EAClBE,EAAS,CACX,CAAC,EAGDF,EAAM,KAAK,YAAY,EAGvBJ,EAAS,EACT,MAAM,QAAQ,IAAI,CAACE,EAAcG,CAAY,CAAC,EAG9CV,EAAOS,CAAK,EAAE,QAAQ,CAAC,QAAS,aAAc,SAAU,OAAO,CAAC,CAClE,CAAC,CACH,CAAC",
|
|
6
|
-
"names": ["describe", "expect", "it", "MutexService", "release", "mutex", "release1", "lock2Resolved", "lock2Promise", "release2", "order", "lock3Promise", "release3"]
|
|
7
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Apdu } from "../../apdu/model/Apdu";
|
|
2
|
-
import { type Command } from "../../command/Command";
|
|
3
|
-
import { type CommandResult } from "../../command/model/CommandResult";
|
|
4
|
-
import { type ApduResponse } from "../../device-session/ApduResponse";
|
|
5
|
-
import { type CommandErrorArgs, DeviceExchangeError } from "../../Error";
|
|
6
|
-
export type GetCustomImageSizeResponse = number;
|
|
7
|
-
export type GetCustomImageSizeErrorCodes = "662e" | "662f";
|
|
8
|
-
export type GetCustomImageSizeCommandResult = CommandResult<GetCustomImageSizeResponse, GetCustomImageSizeErrorCodes>;
|
|
9
|
-
export declare class GetCustomImageSizeCommandError extends DeviceExchangeError<GetCustomImageSizeErrorCodes> {
|
|
10
|
-
constructor({ message, errorCode, }: CommandErrorArgs<GetCustomImageSizeErrorCodes>);
|
|
11
|
-
}
|
|
12
|
-
export declare class GetCustomImageSizeCommand implements Command<GetCustomImageSizeResponse, void, GetCustomImageSizeErrorCodes> {
|
|
13
|
-
readonly name = "getCustomImageSize";
|
|
14
|
-
getApdu(): Apdu;
|
|
15
|
-
parseResponse(apduResponse: ApduResponse): GetCustomImageSizeCommandResult;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=GetCustomImageSizeCommand.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetCustomImageSizeCommand.d.ts","sourceRoot":"","sources":["../../../../../../src/api/command/os/GetCustomImageSizeCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,kCAAkC,CAAC;AAO1C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,KAAK,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAExE,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEhD,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG,MAAM,CAAC;AAO3D,MAAM,MAAM,+BAA+B,GAAG,aAAa,CACzD,0BAA0B,EAC1B,4BAA4B,CAC7B,CAAC;AAEF,qBAAa,8BAA+B,SAAQ,mBAAmB,CAAC,4BAA4B,CAAC;gBACvF,EACV,OAAO,EACP,SAAS,GACV,EAAE,gBAAgB,CAAC,4BAA4B,CAAC;CAGlD;AAED,qBAAa,yBACX,YACE,OAAO,CAAC,0BAA0B,EAAE,IAAI,EAAE,4BAA4B,CAAC;IAEzE,QAAQ,CAAC,IAAI,wBAAwB;IAErC,OAAO,IAAI,IAAI;IAUf,aAAa,CAAC,YAAY,EAAE,YAAY,GAAG,+BAA+B;CA6B3E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetCustomImageSizeCommand.test.d.ts","sourceRoot":"","sources":["../../../../../../src/api/command/os/GetCustomImageSizeCommand.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MutexService.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/device-session/service/MutexService.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,OAAO,CAAS;IAElB,IAAI,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC;CAmBlC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MutexService.test.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/device-session/service/MutexService.test.ts"],"names":[],"mappings":""}
|