@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/lib/cjs/src/api/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var A=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of s(e))!i.call(t,p)&&p!==n&&o(t,p,{get:()=>e[p],enumerable:!(r=a(e,p))||r.enumerable});return t};var d=t=>A(o({},"__esModule",{value:!0}),t);var y={};module.exports=d(y);
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/api/types.ts"],
|
|
4
|
-
"sourcesContent": ["export type { OpenAppErrorCodes } from \"./command/os/OpenAppCommand\";\nexport type { CommandErrors } from \"./command/utils/CommandErrors\";\nexport type { DeviceId } from \"./device/DeviceModel\";\nexport type { ConnectionType } from \"./discovery/ConnectionType\";\nexport type { CommandErrorArgs } from \"./Error\";\nexport type { LogSubscriberOptions } from \"./logger-subscriber/model/LogSubscriberOptions\";\nexport type { DiscoveredDevice } from \"./transport/model/DiscoveredDevice\";\nexport type {\n Transport,\n TransportArgs,\n TransportFactory,\n} from \"./transport/model/Transport\";\nexport type { TransportIdentifier } from \"./transport/model/TransportIdentifier\";\nexport type { ApduBuilderArgs } from \"@api/apdu/utils/ApduBuilder\";\nexport type { Command } from \"@api/command/Command\";\nexport type {\n CommandErrorResult,\n CommandResult,\n CommandSuccessResult,\n} from \"@api/command/model/CommandResult\";\nexport type { SendCommandUseCaseArgs } from \"@api/command/use-case/SendCommandUseCase\";\nexport type { DeviceModelId } from \"@api/device/DeviceModel\";\nexport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nexport {\n type GetDeviceMetadataDAError,\n type GetDeviceMetadataDAInput,\n type GetDeviceMetadataDAIntermediateValue,\n type GetDeviceMetadataDAOutput,\n type GetDeviceMetadataDAState,\n} from \"@api/device-action/os/GetDeviceMetadata/types\";\nexport {\n type GetDeviceStatusDAError,\n type GetDeviceStatusDAInput,\n type GetDeviceStatusDAIntermediateValue,\n type GetDeviceStatusDAOutput,\n type GetDeviceStatusDAState,\n} from \"@api/device-action/os/GetDeviceStatus/types\";\nexport {\n type GoToDashboardDAError,\n type GoToDashboardDAInput,\n type GoToDashboardDAIntermediateValue,\n type GoToDashboardDAOutput,\n type GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport {\n type ApplicationConstraint,\n type ApplicationDependency,\n type ApplicationVersionConstraint,\n type InstallOrUpdateAppsDAError,\n type InstallOrUpdateAppsDAInput,\n type InstallOrUpdateAppsDAIntermediateValue,\n type InstallOrUpdateAppsDAOutput,\n type InstallOrUpdateAppsDAState,\n type InstallPlan,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nexport {\n type ListAppsDAError,\n type ListAppsDAInput,\n type ListAppsDAIntermediateValue,\n type ListAppsDAOutput,\n type ListAppsDAState,\n} from \"@api/device-action/os/ListApps/types\";\nexport {\n type ListAppsWithMetadataDAError,\n type ListAppsWithMetadataDAInput,\n type ListAppsWithMetadataDAIntermediateValue,\n type ListAppsWithMetadataDAOutput,\n type ListAppsWithMetadataDAState,\n} from \"@api/device-action/os/ListAppsWithMetadata/types\";\nexport {\n type OpenAppDAError,\n type OpenAppDAInput,\n type OpenAppDAIntermediateValue,\n type OpenAppDAOutput,\n type OpenAppDARequiredInteraction,\n type OpenAppDAState,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\nexport {\n type OpenAppWithDependenciesDAError,\n type OpenAppWithDependenciesDAInput,\n type OpenAppWithDependenciesDAIntermediateValue,\n type OpenAppWithDependenciesDAOutput,\n type OpenAppWithDependenciesDARequiredInteraction,\n type OpenAppWithDependenciesDAState,\n} from \"@api/device-action/os/OpenAppWithDependencies/types\";\nexport {\n type SendCommandInAppDAError,\n type SendCommandInAppDAInput,\n type SendCommandInAppDAIntermediateValue,\n type SendCommandInAppDAOutput,\n} from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes\";\nexport type { ExecuteDeviceActionUseCaseArgs } from \"@api/device-action/use-case/ExecuteDeviceActionUseCase\";\nexport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nexport { type DeviceModelDataSource } from \"@api/device-model/data/DeviceModelDataSource\";\nexport type {\n Catalog,\n CustomImage,\n DeviceSessionState,\n FirmwareUpdate,\n FirmwareUpdateContext,\n FirmwareVersion,\n InstalledLanguagePackage,\n RunningApp,\n} from \"@api/device-session/DeviceSessionState\";\nexport { type ApduReceiverService } from \"@api/device-session/service/ApduReceiverService\";\nexport { type ApduReceiverServiceFactory } from \"@api/device-session/service/ApduReceiverService\";\nexport { type ApduSenderServiceFactory } from \"@api/device-session/service/ApduSenderService\";\nexport { type ApduSenderService } from \"@api/device-session/service/ApduSenderService\";\nexport type { DeviceSessionId } from \"@api/device-session/types\";\nexport type { DmkConfig } from \"@api/DmkConfig\";\nexport type { DmkError } from \"@api/Error\";\nexport type { LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nexport type {\n LoggerSubscriberService,\n LogParams,\n} from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nexport {\n type GenuineCheckDAError,\n type GenuineCheckDAInput,\n type GenuineCheckDAIntermediateValue,\n type GenuineCheckDAOutput,\n type GenuineCheckDARequiredInteraction,\n type GenuineCheckDAState,\n} from \"@api/secure-channel/device-action/GenuineCheck/types\";\nexport {\n type InstallAppDAError,\n type InstallAppDAInput,\n type InstallAppDAIntermediateValue,\n type InstallAppDAOutput,\n type InstallAppDARequiredInteraction,\n type InstallAppDAState,\n} from \"@api/secure-channel/device-action/InstallApp/types\";\nexport {\n type ListInstalledAppsDAError,\n type ListInstalledAppsDAInput,\n type ListInstalledAppsDAIntermediateValue,\n type ListInstalledAppsDAOutput,\n type ListInstalledAppsDARequiredInteraction,\n type ListInstalledAppsDAState,\n} from \"@api/secure-channel/device-action/ListInstalledApps/types\";\nexport {\n type UninstallAppDAError,\n type UninstallAppDAInput,\n type UninstallAppDAIntermediateValue,\n type UninstallAppDAOutput,\n type UninstallAppDARequiredInteraction,\n type UninstallAppDAState,\n} from \"@api/secure-channel/device-action/UninstallApp/types\";\nexport { type DeviceApduSender } from \"@api/transport/model/DeviceApduSender\";\nexport {\n type DeviceConnection,\n type DisconnectHandler,\n type SendApduFnType,\n type SendApduResult,\n} from \"@api/transport/model/DeviceConnection\";\nexport { type TransportDiscoveredDevice } from \"@api/transport/model/TransportDiscoveredDevice\";\nexport type { HexaString } from \"@api/utils/HexaString\";\nexport type { ConnectUseCaseArgs } from \"@internal/discovery/use-case/ConnectUseCase\";\nexport type { DisconnectUseCaseArgs } from \"@internal/discovery/use-case/DisconnectUseCase\";\nexport type { GetConnectedDeviceUseCaseArgs } from \"@internal/discovery/use-case/GetConnectedDeviceUseCase\";\nexport type { StartDiscoveringUseCaseArgs } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nexport type { SendApduUseCaseArgs } from \"@internal/send/use-case/SendApduUseCase\";\n"],
|
|
4
|
+
"sourcesContent": ["export type { OpenAppErrorCodes } from \"./command/os/OpenAppCommand\";\nexport type { CommandErrors } from \"./command/utils/CommandErrors\";\nexport type { DeviceId } from \"./device/DeviceModel\";\nexport type { ConnectionType } from \"./discovery/ConnectionType\";\nexport type { CommandErrorArgs } from \"./Error\";\nexport type { LogSubscriberOptions } from \"./logger-subscriber/model/LogSubscriberOptions\";\nexport type { DiscoveredDevice } from \"./transport/model/DiscoveredDevice\";\nexport type {\n Transport,\n TransportArgs,\n TransportFactory,\n} from \"./transport/model/Transport\";\nexport type { TransportIdentifier } from \"./transport/model/TransportIdentifier\";\nexport type { ApduBuilderArgs } from \"@api/apdu/utils/ApduBuilder\";\nexport type { Command } from \"@api/command/Command\";\nexport type {\n CommandErrorResult,\n CommandResult,\n CommandSuccessResult,\n} from \"@api/command/model/CommandResult\";\nexport type { SendCommandUseCaseArgs } from \"@api/command/use-case/SendCommandUseCase\";\nexport type { DeviceModelId } from \"@api/device/DeviceModel\";\nexport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nexport {\n type CallTaskInAppDAError,\n type CallTaskInAppDAIntermediateValue,\n type CallTaskInAppDAOutput,\n} from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes\";\nexport {\n type GetDeviceMetadataDAError,\n type GetDeviceMetadataDAInput,\n type GetDeviceMetadataDAIntermediateValue,\n type GetDeviceMetadataDAOutput,\n type GetDeviceMetadataDAState,\n} from \"@api/device-action/os/GetDeviceMetadata/types\";\nexport {\n type GetDeviceStatusDAError,\n type GetDeviceStatusDAInput,\n type GetDeviceStatusDAIntermediateValue,\n type GetDeviceStatusDAOutput,\n type GetDeviceStatusDAState,\n} from \"@api/device-action/os/GetDeviceStatus/types\";\nexport {\n type GoToDashboardDAError,\n type GoToDashboardDAInput,\n type GoToDashboardDAIntermediateValue,\n type GoToDashboardDAOutput,\n type GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport {\n type ApplicationConstraint,\n type ApplicationDependency,\n type ApplicationVersionConstraint,\n type InstallOrUpdateAppsDAError,\n type InstallOrUpdateAppsDAInput,\n type InstallOrUpdateAppsDAIntermediateValue,\n type InstallOrUpdateAppsDAOutput,\n type InstallOrUpdateAppsDAState,\n type InstallPlan,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nexport {\n type ListAppsDAError,\n type ListAppsDAInput,\n type ListAppsDAIntermediateValue,\n type ListAppsDAOutput,\n type ListAppsDAState,\n} from \"@api/device-action/os/ListApps/types\";\nexport {\n type ListAppsWithMetadataDAError,\n type ListAppsWithMetadataDAInput,\n type ListAppsWithMetadataDAIntermediateValue,\n type ListAppsWithMetadataDAOutput,\n type ListAppsWithMetadataDAState,\n} from \"@api/device-action/os/ListAppsWithMetadata/types\";\nexport {\n type OpenAppDAError,\n type OpenAppDAInput,\n type OpenAppDAIntermediateValue,\n type OpenAppDAOutput,\n type OpenAppDARequiredInteraction,\n type OpenAppDAState,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\nexport {\n type OpenAppWithDependenciesDAError,\n type OpenAppWithDependenciesDAInput,\n type OpenAppWithDependenciesDAIntermediateValue,\n type OpenAppWithDependenciesDAOutput,\n type OpenAppWithDependenciesDARequiredInteraction,\n type OpenAppWithDependenciesDAState,\n} from \"@api/device-action/os/OpenAppWithDependencies/types\";\nexport {\n type SendCommandInAppDAError,\n type SendCommandInAppDAInput,\n type SendCommandInAppDAIntermediateValue,\n type SendCommandInAppDAOutput,\n} from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes\";\nexport type { ExecuteDeviceActionUseCaseArgs } from \"@api/device-action/use-case/ExecuteDeviceActionUseCase\";\nexport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nexport { type DeviceModelDataSource } from \"@api/device-model/data/DeviceModelDataSource\";\nexport type {\n Catalog,\n CustomImage,\n DeviceSessionState,\n FirmwareUpdate,\n FirmwareUpdateContext,\n FirmwareVersion,\n InstalledLanguagePackage,\n RunningApp,\n} from \"@api/device-session/DeviceSessionState\";\nexport { type ApduReceiverService } from \"@api/device-session/service/ApduReceiverService\";\nexport { type ApduReceiverServiceFactory } from \"@api/device-session/service/ApduReceiverService\";\nexport { type ApduSenderServiceFactory } from \"@api/device-session/service/ApduSenderService\";\nexport { type ApduSenderService } from \"@api/device-session/service/ApduSenderService\";\nexport type { DeviceSessionId } from \"@api/device-session/types\";\nexport type { DmkConfig } from \"@api/DmkConfig\";\nexport type { DmkError } from \"@api/Error\";\nexport type { LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nexport type {\n LoggerSubscriberService,\n LogParams,\n} from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nexport {\n type GenuineCheckDAError,\n type GenuineCheckDAInput,\n type GenuineCheckDAIntermediateValue,\n type GenuineCheckDAOutput,\n type GenuineCheckDARequiredInteraction,\n type GenuineCheckDAState,\n} from \"@api/secure-channel/device-action/GenuineCheck/types\";\nexport {\n type InstallAppDAError,\n type InstallAppDAInput,\n type InstallAppDAIntermediateValue,\n type InstallAppDAOutput,\n type InstallAppDARequiredInteraction,\n type InstallAppDAState,\n} from \"@api/secure-channel/device-action/InstallApp/types\";\nexport {\n type ListInstalledAppsDAError,\n type ListInstalledAppsDAInput,\n type ListInstalledAppsDAIntermediateValue,\n type ListInstalledAppsDAOutput,\n type ListInstalledAppsDARequiredInteraction,\n type ListInstalledAppsDAState,\n} from \"@api/secure-channel/device-action/ListInstalledApps/types\";\nexport {\n type UninstallAppDAError,\n type UninstallAppDAInput,\n type UninstallAppDAIntermediateValue,\n type UninstallAppDAOutput,\n type UninstallAppDARequiredInteraction,\n type UninstallAppDAState,\n} from \"@api/secure-channel/device-action/UninstallApp/types\";\nexport { type DeviceApduSender } from \"@api/transport/model/DeviceApduSender\";\nexport {\n type DeviceConnection,\n type DisconnectHandler,\n type SendApduFnType,\n type SendApduResult,\n} from \"@api/transport/model/DeviceConnection\";\nexport { type TransportDiscoveredDevice } from \"@api/transport/model/TransportDiscoveredDevice\";\nexport type { HexaString } from \"@api/utils/HexaString\";\nexport type { ConnectUseCaseArgs } from \"@internal/discovery/use-case/ConnectUseCase\";\nexport type { DisconnectUseCaseArgs } from \"@internal/discovery/use-case/DisconnectUseCase\";\nexport type { GetConnectedDeviceUseCaseArgs } from \"@internal/discovery/use-case/GetConnectedDeviceUseCase\";\nexport type { StartDiscoveringUseCaseArgs } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nexport type { SendApduUseCaseArgs } from \"@internal/send/use-case/SendApduUseCase\";\n"],
|
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
6
|
"names": ["types_exports", "__toCommonJS"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var a=(i,e)=>{for(var o in e)p(i,o,{get:e[o],enumerable:!0})},h=(i,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of n(e))!c.call(i,t)&&t!==o&&p(i,t,{get:()=>e[t],enumerable:!(s=l(e,t))||s.enumerable});return i};var v=i=>h(p({},"__esModule",{value:!0}),i);var d={};a(d,{ApplicationChecker:()=>m});module.exports=v(d);var r=require("semver");class m{isCompatible;version;modelId;constructor(e,o,s){this.modelId=e.deviceModelId;const t=s.resolve(e,o);this.isCompatible=t.isCompatible,this.version=t.version}withMinVersionInclusive(e){return(0,r.gte)(this.version,e)||(this.isCompatible=!1),this}withMinVersionExclusive(e){return(0,r.gt)(this.version,e)||(this.isCompatible=!1),this}excludeDeviceModel(e){return this.modelId===e&&(this.isCompatible=!1),this}check(){return this.isCompatible}}0&&(module.exports={ApplicationChecker});
|
|
2
|
+
//# sourceMappingURL=ApplicationChecker.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/api/utils/ApplicationChecker.ts"],
|
|
4
|
+
"sourcesContent": ["import { gt, gte } from \"semver\";\n\nimport { type DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\n\nimport {\n type AppConfig,\n type ApplicationResolver,\n} from \"./ApplicationResolver\";\n\nexport class ApplicationChecker {\n private isCompatible: boolean;\n private version: string;\n private modelId: DeviceModelId;\n\n constructor(\n deviceState: DeviceSessionState,\n appConfig: AppConfig,\n resolver: ApplicationResolver,\n ) {\n this.modelId = deviceState.deviceModelId;\n const resolved = resolver.resolve(deviceState, appConfig);\n this.isCompatible = resolved.isCompatible;\n this.version = resolved.version;\n }\n\n withMinVersionInclusive(version: string): ApplicationChecker {\n if (!gte(this.version, version)) this.isCompatible = false;\n return this;\n }\n\n withMinVersionExclusive(version: string): ApplicationChecker {\n if (!gt(this.version, version)) this.isCompatible = false;\n return this;\n }\n\n excludeDeviceModel(modelId: DeviceModelId): ApplicationChecker {\n if (this.modelId === modelId) this.isCompatible = false;\n return this;\n }\n\n check(): boolean {\n return this.isCompatible;\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAwB,kBAUjB,MAAMF,CAAmB,CACtB,aACA,QACA,QAER,YACEG,EACAC,EACAC,EACA,CACA,KAAK,QAAUF,EAAY,cAC3B,MAAMG,EAAWD,EAAS,QAAQF,EAAaC,CAAS,EACxD,KAAK,aAAeE,EAAS,aAC7B,KAAK,QAAUA,EAAS,OAC1B,CAEA,wBAAwBC,EAAqC,CAC3D,SAAK,OAAI,KAAK,QAASA,CAAO,IAAG,KAAK,aAAe,IAC9C,IACT,CAEA,wBAAwBA,EAAqC,CAC3D,SAAK,MAAG,KAAK,QAASA,CAAO,IAAG,KAAK,aAAe,IAC7C,IACT,CAEA,mBAAmBC,EAA4C,CAC7D,OAAI,KAAK,UAAYA,IAAS,KAAK,aAAe,IAC3C,IACT,CAEA,OAAiB,CACf,OAAO,KAAK,YACd,CACF",
|
|
6
|
+
"names": ["ApplicationChecker_exports", "__export", "ApplicationChecker", "__toCommonJS", "import_semver", "deviceState", "appConfig", "resolver", "resolved", "version", "modelId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=require("../device/DeviceModel"),n=require("../device/DeviceStatus"),l=require("../device-session/DeviceSessionState"),i=require("./ApplicationChecker");describe("ApplicationChecker",()=>{function s(e=r.DeviceModelId.FLEX){return{sessionStateType:l.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:n.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"TestApp",version:"1.0.0"},deviceModelId:e,isSecureConnectionAllowed:!1}}function o(e){return{resolve:()=>e}}const c={version:"1.0.0"};it("should pass check when resolved as compatible",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),c,e).check();expect(t).toStrictEqual(!0)}),it("should reject check when resolved as incompatible",()=>{const e=o({isCompatible:!1,version:"0.0.1"}),t=new i.ApplicationChecker(s(),c,e).check();expect(t).toStrictEqual(!1)}),it("should pass with min version inclusive when version matches",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!0)}),it("should reject with min version inclusive when version is too low",()=>{const e=o({isCompatible:!0,version:"1.11.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!1)}),it("should pass with min version exclusive when version is greater",()=>{const e=o({isCompatible:!0,version:"1.13.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionExclusive("1.12.0").check();expect(t).toStrictEqual(!0)}),it("should reject with min version exclusive when version is equal",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionExclusive("1.12.0").check();expect(t).toStrictEqual(!1)}),it("should pass when device model is not excluded",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(r.DeviceModelId.FLEX),c,e).excludeDeviceModel(r.DeviceModelId.NANO_S).check();expect(t).toStrictEqual(!0)}),it("should reject when device model is excluded",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(r.DeviceModelId.FLEX),c,e).excludeDeviceModel(r.DeviceModelId.FLEX).check();expect(t).toStrictEqual(!1)}),it("should pass with chained conditions when all are met",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionInclusive("1.11.0").excludeDeviceModel(r.DeviceModelId.NANO_S).check();expect(t).toStrictEqual(!0)}),it("should reject with chained conditions when one fails",()=>{const e=o({isCompatible:!0,version:"1.10.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionInclusive("1.11.0").excludeDeviceModel(r.DeviceModelId.NANO_S).check();expect(t).toStrictEqual(!1)}),it("should not override incompatible resolution even if constraints pass",()=>{const e=o({isCompatible:!1,version:"1.15.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!1)})});
|
|
2
|
+
//# sourceMappingURL=ApplicationChecker.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/api/utils/ApplicationChecker.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\n\nimport { ApplicationChecker } from \"./ApplicationChecker\";\nimport {\n type ApplicationResolver,\n type ResolvedApp,\n} from \"./ApplicationResolver\";\n\ndescribe(\"ApplicationChecker\", () => {\n function createReadyState(modelId: DeviceModelId = DeviceModelId.FLEX) {\n return {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"TestApp\", version: \"1.0.0\" },\n deviceModelId: modelId,\n isSecureConnectionAllowed: false,\n };\n }\n\n function createMockResolver(resolved: ResolvedApp): ApplicationResolver {\n return {\n resolve: () => resolved,\n };\n }\n\n const appConfig = { version: \"1.0.0\" };\n\n it(\"should pass check when resolved as compatible\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n ).check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject check when resolved as incompatible\", () => {\n const resolver = createMockResolver({\n isCompatible: false,\n version: \"0.0.1\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n ).check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with min version inclusive when version matches\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with min version inclusive when version is too low\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.11.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with min version exclusive when version is greater\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.13.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with min version exclusive when version is equal\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass when device model is not excluded\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(DeviceModelId.FLEX),\n appConfig,\n resolver,\n )\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject when device model is excluded\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(DeviceModelId.FLEX),\n appConfig,\n resolver,\n )\n .excludeDeviceModel(DeviceModelId.FLEX)\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with chained conditions when all are met\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with chained conditions when one fails\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.10.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should not override incompatible resolution even if constraints pass\", () => {\n const resolver = createMockResolver({\n isCompatible: false,\n version: \"1.15.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["import_DeviceModel", "import_DeviceStatus", "import_DeviceSessionState", "import_ApplicationChecker", "createReadyState", "modelId", "createMockResolver", "resolved", "appConfig", "resolver", "result"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var l=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of s(e))!a.call(o,p)&&p!==t&&n(o,p,{get:()=>e[p],enumerable:!(i=r(e,p))||i.enumerable});return o};var v=o=>l(n({},"__esModule",{value:!0}),o);var d={};module.exports=v(d);
|
|
2
|
+
//# sourceMappingURL=ApplicationResolver.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/api/utils/ApplicationResolver.ts"],
|
|
4
|
+
"sourcesContent": ["import { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\n\nexport type AppConfig = Record<string, unknown> & {\n readonly version: string;\n};\n\nexport type ResolvedApp = {\n readonly isCompatible: boolean;\n readonly version: string;\n};\n\nexport interface ApplicationResolver {\n resolve(deviceState: DeviceSessionState, appConfig: AppConfig): ResolvedApp;\n}\n"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["ApplicationResolver_exports", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var
|
|
1
|
+
"use strict";var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var b=(r,n)=>{for(var t in n)i(r,t,{get:n[t],enumerable:!0})},c=(r,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of s(n))!g.call(r,o)&&o!==t&&i(r,o,{get:()=>n[o],enumerable:!(e=u(n,o))||e.enumerable});return r};var l=r=>c(i({},"__esModule",{value:!0}),r);var y={};b(y,{base64StringToBuffer:()=>d,bufferToBase64String:()=>h,isBase64String:()=>a});module.exports=l(y);function a(r){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r)}function d(r){if(r.length===0)return new Uint8Array;if(!a(r))return null;try{const n=atob(r),t=new Uint8Array(n.length);for(let e=0;e<n.length;e++)t[e]=n.charCodeAt(e);return t}catch{return Uint8Array.from(Buffer.from(r,"base64"))}}function h(r){const n=globalThis;if(typeof n.btoa=="function"){let e="";for(let o=0;o<r.length;o++){const f=r[o];if(f===void 0)throw new Error("Unexpected undefined byte in array.");e+=String.fromCharCode(f)}return n.btoa(e)}const t=n.Buffer;if(typeof t<"u")return t.from(r).toString("base64");throw new Error("No Base64 encoder available in this environment.")}0&&(module.exports={base64StringToBuffer,bufferToBase64String,isBase64String});
|
|
2
2
|
//# sourceMappingURL=Base64String.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/api/utils/Base64String.ts"],
|
|
4
|
-
"sourcesContent": ["export function isBase64String(value: string): boolean {\n // Valid base64 characters are [A-Za-z0-9+/]\n // They are always grouped by 4 characters.\n // Optional padding at the end with one or two '='.\n // see section 4 of: https://www.rfc-editor.org/rfc/rfc4648.txt\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(\n value,\n );\n}\n\nexport function base64StringToBuffer(value: string): Uint8Array | null {\n if (value.length === 0) {\n return new Uint8Array();\n }\n if (!isBase64String(value)) {\n return null;\n }\n try {\n // Use the browser implementation of atob\n const base64Decoded = atob(value);\n const buffer = new Uint8Array(base64Decoded.length);\n for (let i = 0; i < base64Decoded.length; i++) {\n buffer[i] = base64Decoded.charCodeAt(i);\n }\n return buffer;\n } catch (_error: unknown) {\n // Use the implementation of Buffer for environments such as node\n return Uint8Array.from(Buffer.from(value, \"base64\"));\n }\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,EAAA,mBAAAC,IAAA,eAAAC,
|
|
6
|
-
"names": ["Base64String_exports", "__export", "base64StringToBuffer", "isBase64String", "__toCommonJS", "value", "base64Decoded", "buffer", "i"]
|
|
4
|
+
"sourcesContent": ["export function isBase64String(value: string): boolean {\n // Valid base64 characters are [A-Za-z0-9+/]\n // They are always grouped by 4 characters.\n // Optional padding at the end with one or two '='.\n // see section 4 of: https://www.rfc-editor.org/rfc/rfc4648.txt\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(\n value,\n );\n}\n\nexport function base64StringToBuffer(value: string): Uint8Array | null {\n if (value.length === 0) {\n return new Uint8Array();\n }\n if (!isBase64String(value)) {\n return null;\n }\n try {\n // Use the browser implementation of atob\n const base64Decoded = atob(value);\n const buffer = new Uint8Array(base64Decoded.length);\n for (let i = 0; i < base64Decoded.length; i++) {\n buffer[i] = base64Decoded.charCodeAt(i);\n }\n return buffer;\n } catch (_error: unknown) {\n // Use the implementation of Buffer for environments such as node\n return Uint8Array.from(Buffer.from(value, \"base64\"));\n }\n}\n\nexport function bufferToBase64String(bytes: Uint8Array): string {\n const g = globalThis as typeof globalThis & {\n Buffer?: typeof Buffer;\n btoa?: (data: string) => string;\n };\n\n if (typeof g.btoa === \"function\") {\n // convert bytes to a binary string for btoa\n let binary = \"\";\n for (let i = 0; i < bytes.length; i++) {\n const byte = bytes[i];\n if (byte === undefined) {\n throw new Error(\"Unexpected undefined byte in array.\");\n }\n binary += String.fromCharCode(byte);\n }\n return g.btoa(binary);\n }\n\n const Buf = g.Buffer;\n if (typeof Buf !== \"undefined\") {\n return Buf.from(bytes).toString(\"base64\");\n }\n\n throw new Error(\"No Base64 encoder available in this environment.\");\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,EAAA,yBAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAL,GAAO,SAASI,EAAeE,EAAwB,CAKrD,MAAO,mEAAmE,KACxEA,CACF,CACF,CAEO,SAASJ,EAAqBI,EAAkC,CACrE,GAAIA,EAAM,SAAW,EACnB,OAAO,IAAI,WAEb,GAAI,CAACF,EAAeE,CAAK,EACvB,OAAO,KAET,GAAI,CAEF,MAAMC,EAAgB,KAAKD,CAAK,EAC1BE,EAAS,IAAI,WAAWD,EAAc,MAAM,EAClD,QAASE,EAAI,EAAGA,EAAIF,EAAc,OAAQE,IACxCD,EAAOC,CAAC,EAAIF,EAAc,WAAWE,CAAC,EAExC,OAAOD,CACT,MAA0B,CAExB,OAAO,WAAW,KAAK,OAAO,KAAKF,EAAO,QAAQ,CAAC,CACrD,CACF,CAEO,SAASH,EAAqBO,EAA2B,CAC9D,MAAMC,EAAI,WAKV,GAAI,OAAOA,EAAE,MAAS,WAAY,CAEhC,IAAIC,EAAS,GACb,QAASH,EAAI,EAAGA,EAAIC,EAAM,OAAQD,IAAK,CACrC,MAAMI,EAAOH,EAAMD,CAAC,EACpB,GAAII,IAAS,OACX,MAAM,IAAI,MAAM,qCAAqC,EAEvDD,GAAU,OAAO,aAAaC,CAAI,CACpC,CACA,OAAOF,EAAE,KAAKC,CAAM,CACtB,CAEA,MAAME,EAAMH,EAAE,OACd,GAAI,OAAOG,EAAQ,IACjB,OAAOA,EAAI,KAAKJ,CAAK,EAAE,SAAS,QAAQ,EAG1C,MAAM,IAAI,MAAM,kDAAkD,CACpE",
|
|
6
|
+
"names": ["Base64String_exports", "__export", "base64StringToBuffer", "bufferToBase64String", "isBase64String", "__toCommonJS", "value", "base64Decoded", "buffer", "i", "bytes", "g", "binary", "byte", "Buf"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var t=require("./Base64String");describe("Base64String",()=>{describe("isBase64String function",()=>{it("should return true if the value is a valid base64 string",()=>{const e=(0,t.isBase64String)("Zmlyc3QgdG/zdGluZyBz+HI9");expect(e).toBeTruthy()}),it("should return true if the value is a valid base64 string, one padding",()=>{const e=(0,t.isBase64String)("Zmlyc3QgdGVzdGluZyBzdHI=");expect(e).toBeTruthy()}),it("should return true if the value is a valid base64 string, two paddings",()=>{const e=(0,t.isBase64String)("Zmlyc3QgdGVzdGluZyBzdH==");expect(e).toBeTruthy()}),it("should return true for an empty string",()=>{const e=(0,t.isBase64String)("");expect(e).toBeTruthy()}),it("should return false for an invalid base64 string",()=>{const e=(0,t.isBase64String)("invalid base64 string");expect(e).toBeFalsy()}),it("should return false with 3 paddings",()=>{const e=(0,t.isBase64String)("Zmlyc3QgdGVzdGluZyBzd===");expect(e).toBeFalsy()}),it("should return false on incomplete string (not multiple of 4)",()=>{const e=(0,t.isBase64String)("Zmlyc3QgdGVzdGluZyBzdHI");expect(e).toBeFalsy()})}),describe("base64StringToBuffer function",()=>{beforeEach(()=>{vi.resetAllMocks()}),it("should convert empty input to empty buffer",()=>{const e=(0,t.base64StringToBuffer)("");expect(e).toStrictEqual(new Uint8Array)}),it("invalid base64 string converted to null",()=>{const e=(0,t.base64StringToBuffer)("invalid string");expect(e).toStrictEqual(null)}),it("should convert a base64 string to a buffer using browser's atob",()=>{const e=(0,t.base64StringToBuffer)("Zmlyc3QgdGVzdCBzdHJpbmc=");expect(e).toStrictEqual(Uint8Array.from([102,105,114,115,116,32,116,101,115,116,32,115,116,114,105,110,103]))}),it("should convert a base64 string to a buffer using Buffer",()=>{vi.spyOn(global,"atob").mockImplementation(()=>{throw new Error("atob is not defined")});const e=(0,t.base64StringToBuffer)("Zmlyc3QgdGVzdCBzdHJpbmc=");expect(e).toStrictEqual(Uint8Array.from([102,105,114,115,116,32,116,101,115,116,32,115,116,114,105,110,103]))})})});describe("bufferToBase64String",()=>{const a=globalThis.btoa,e=globalThis.Buffer;beforeEach(()=>{vi.restoreAllMocks(),globalThis.btoa=a,globalThis.Buffer=e}),afterAll(()=>{globalThis.btoa=a,globalThis.Buffer=e}),it("should encode an empty buffer to an empty base64 string when btoa is available",()=>{globalThis.btoa=vi.fn(o=>(expect(o).toBe(""),""));const s=new Uint8Array,n=(0,t.bufferToBase64String)(s);expect(n).toBe(""),expect(globalThis.btoa).toHaveBeenCalledTimes(1)}),it("should encode a buffer to base64 using btoa when available",()=>{const s="first testing str",n=Uint8Array.from(s.split("").map(r=>r.charCodeAt(0)));globalThis.btoa=vi.fn(r=>(expect(r).toBe(s),"Zmlyc3QgdGVzdGluZyBzdHI="));const o=(0,t.bufferToBase64String)(n);expect(o).toBe("Zmlyc3QgdGVzdGluZyBzdHI="),expect(globalThis.btoa).toHaveBeenCalledTimes(1)}),it("should encode a buffer to base64 using Buffer when btoa is not available",()=>{globalThis.btoa=void 0;const s="testing str",n=Buffer.from(s,"binary").toString("base64"),o=Uint8Array.from(s.split("").map(i=>i.charCodeAt(0))),r=vi.spyOn(Buffer,"from"),l=(0,t.bufferToBase64String)(o);expect(l).toBe(n),expect(r).toHaveBeenCalledTimes(1)}),it("should throw an error when no Base64 encoder is available",()=>{globalThis.btoa=void 0,globalThis.Buffer=void 0;const s=Uint8Array.from([1,2,3]);expect(()=>(0,t.bufferToBase64String)(s)).toThrowError("No Base64 encoder available in this environment.")}),it("should throw if an undefined byte is encountered (defensive check)",()=>{const s={length:3,0:102,1:void 0,2:111};globalThis.btoa=vi.fn(),expect(()=>(0,t.bufferToBase64String)(s)).toThrowError("Unexpected undefined byte in array.")})});
|
|
2
2
|
//# sourceMappingURL=Base64String.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/api/utils/Base64String.test.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["import_Base64String", "result"]
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport {\n base64StringToBuffer,\n bufferToBase64String,\n isBase64String,\n} from \"./Base64String\";\n\ndescribe(\"Base64String\", () => {\n describe(\"isBase64String function\", () => {\n it(\"should return true if the value is a valid base64 string\", () => {\n // GIVEN\n const value = \"Zmlyc3QgdG/zdGluZyBz+HI9\";\n\n // WHEN\n const result = isBase64String(value);\n\n // THEN\n expect(result).toBeTruthy();\n });\n\n it(\"should return true if the value is a valid base64 string, one padding\", () => {\n // GIVEN\n const value = \"Zmlyc3QgdGVzdGluZyBzdHI=\";\n\n // WHEN\n const result = isBase64String(value);\n\n // THEN\n expect(result).toBeTruthy();\n });\n\n it(\"should return true if the value is a valid base64 string, two paddings\", () => {\n // GIVEN\n const value = \"Zmlyc3QgdGVzdGluZyBzdH==\";\n\n // WHEN\n const result = isBase64String(value);\n\n // THEN\n expect(result).toBeTruthy();\n });\n\n it(\"should return true for an empty string\", () => {\n // GIVEN\n const value = \"\";\n\n // WHEN\n const result = isBase64String(value);\n\n // THEN\n expect(result).toBeTruthy();\n });\n\n it(\"should return false for an invalid base64 string\", () => {\n // GIVEN\n const value = \"invalid base64 string\";\n\n // WHEN\n const result = isBase64String(value);\n\n // THEN\n expect(result).toBeFalsy();\n });\n\n it(\"should return false with 3 paddings\", () => {\n // GIVEN\n const value = \"Zmlyc3QgdGVzdGluZyBzd===\";\n\n // WHEN\n const result = isBase64String(value);\n\n // THEN\n expect(result).toBeFalsy();\n });\n\n it(\"should return false on incomplete string (not multiple of 4)\", () => {\n // GIVEN\n const value = \"Zmlyc3QgdGVzdGluZyBzdHI\";\n\n // WHEN\n const result = isBase64String(value);\n\n // THEN\n expect(result).toBeFalsy();\n });\n });\n\n describe(\"base64StringToBuffer function\", () => {\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n it(\"should convert empty input to empty buffer\", () => {\n // GIVEN\n const value = \"\";\n\n // WHEN\n const result = base64StringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(new Uint8Array());\n });\n\n it(\"invalid base64 string converted to null\", () => {\n // GIVEN\n const value = \"invalid string\";\n\n // WHEN\n const result = base64StringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(null);\n });\n\n it(\"should convert a base64 string to a buffer using browser's atob\", () => {\n // GIVEN\n const value = \"Zmlyc3QgdGVzdCBzdHJpbmc=\";\n\n // WHEN\n const result = base64StringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(\n Uint8Array.from([\n 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20,\n 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,\n ]),\n );\n });\n\n it(\"should convert a base64 string to a buffer using Buffer\", () => {\n // GIVEN\n vi.spyOn(global, \"atob\").mockImplementation(() => {\n throw new Error(\"atob is not defined\");\n });\n const value = \"Zmlyc3QgdGVzdCBzdHJpbmc=\";\n\n // WHEN\n const result = base64StringToBuffer(value);\n\n // THEN\n expect(result).toStrictEqual(\n Uint8Array.from([\n 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20,\n 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,\n ]),\n );\n });\n });\n});\n\ndescribe(\"bufferToBase64String\", () => {\n const originalBtoa = (globalThis as any).btoa;\n const originalBuffer = (globalThis as any).Buffer;\n\n beforeEach(() => {\n vi.restoreAllMocks();\n (globalThis as any).btoa = originalBtoa;\n (globalThis as any).Buffer = originalBuffer;\n });\n\n afterAll(() => {\n (globalThis as any).btoa = originalBtoa;\n (globalThis as any).Buffer = originalBuffer;\n });\n\n it(\"should encode an empty buffer to an empty base64 string when btoa is available\", () => {\n // GIVEN\n (globalThis as any).btoa = vi.fn((input: string) => {\n expect(input).toBe(\"\");\n return \"\";\n });\n\n const bytes = new Uint8Array();\n\n // WHEN\n const result = bufferToBase64String(bytes);\n\n // THEN\n expect(result).toBe(\"\");\n expect(globalThis.btoa).toHaveBeenCalledTimes(1);\n });\n\n it(\"should encode a buffer to base64 using btoa when available\", () => {\n // GIVEN\n const text = \"first testing str\";\n const bytes = Uint8Array.from(text.split(\"\").map((c) => c.charCodeAt(0)));\n\n (globalThis as any).btoa = vi.fn((input: string) => {\n expect(input).toBe(text);\n return \"Zmlyc3QgdGVzdGluZyBzdHI=\";\n });\n\n // WHEN\n const result = bufferToBase64String(bytes);\n\n // THEN\n expect(result).toBe(\"Zmlyc3QgdGVzdGluZyBzdHI=\");\n expect(globalThis.btoa).toHaveBeenCalledTimes(1);\n });\n\n it(\"should encode a buffer to base64 using Buffer when btoa is not available\", () => {\n // GIVEN\n (globalThis as any).btoa = undefined;\n\n const text = \"testing str\";\n const expectedBase64 = Buffer.from(text, \"binary\").toString(\"base64\");\n const bytes = Uint8Array.from(text.split(\"\").map((c) => c.charCodeAt(0)));\n\n const bufferFromSpy = vi.spyOn(Buffer, \"from\");\n\n // WHEN\n const result = bufferToBase64String(bytes);\n\n // THEN\n expect(result).toBe(expectedBase64);\n expect(bufferFromSpy).toHaveBeenCalledTimes(1);\n });\n\n it(\"should throw an error when no Base64 encoder is available\", () => {\n // GIVEN\n (globalThis as any).btoa = undefined;\n (globalThis as any).Buffer = undefined;\n\n const bytes = Uint8Array.from([0x01, 0x02, 0x03]);\n\n // WHEN / THEN\n expect(() => bufferToBase64String(bytes)).toThrowError(\n \"No Base64 encoder available in this environment.\",\n );\n });\n\n it(\"should throw if an undefined byte is encountered (defensive check)\", () => {\n // GIVEN\n const bytes = {\n length: 3,\n 0: 0x66,\n 1: undefined,\n 2: 0x6f,\n } as unknown as Uint8Array;\n\n (globalThis as any).btoa = vi.fn();\n\n // WHEN / THEN\n expect(() => bufferToBase64String(bytes)).toThrowError(\n \"Unexpected undefined byte in array.\",\n );\n });\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["import_Base64String", "result", "originalBtoa", "originalBuffer", "input", "bytes", "text", "c", "expectedBase64", "bufferFromSpy"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var n=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var D=(o,e)=>{for(var t in e)n(o,t,{get:e[t],enumerable:!0})},U=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of A(e))!d.call(o,s)&&s!==t&&n(o,s,{get:()=>e[s],enumerable:!(i=C(e,s))||i.enumerable});return o};var F=o=>U(n({},"__esModule",{value:!0}),o);var h={};D(h,{deviceSessionModuleFactory:()=>R});module.exports=F(h);var u=require("inversify"),S=require("../../../api/device-session/use-case/DisableDeviceSessionRefresher"),v=require("../../device-session/service/DefaultApduReceiverService"),m=require("../../device-session/service/DefaultApduSenderService"),f=require("../../device-session/service/DefaultDeviceSessionService"),g=require("../../device-session/use-case/CloseSessionsUseCase"),l=require("../../device-session/use-case/GetDeviceSessionStateUseCase"),y=require("../../device-session/use-case/UnsafeBypassIntentQueueUseCase"),p=require("../../logger-publisher/di/loggerTypes"),c=require("../../../../src/di.stub"),r=require("./deviceSessionTypes");const R=({stub:o}={stub:!1})=>new u.ContainerModule(({bind:e,rebindSync:t})=>{e(r.deviceSessionTypes.ApduSenderServiceFactory).toFactory(i=>{const s=i.get(p.loggerTypes.LoggerPublisherServiceFactory);return a=>new m.DefaultApduSenderService(a,s)}),e(r.deviceSessionTypes.ApduReceiverServiceFactory).toFactory(i=>{const s=i.get(p.loggerTypes.LoggerPublisherServiceFactory);return(a={})=>new v.DefaultApduReceiverService(a,s)}),e(r.deviceSessionTypes.DeviceSessionService).to(f.DefaultDeviceSessionService).inSingletonScope(),e(r.deviceSessionTypes.GetDeviceSessionStateUseCase).to(l.GetDeviceSessionStateUseCase),e(r.deviceSessionTypes.CloseSessionsUseCase).to(g.CloseSessionsUseCase),e(r.deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(S.DisableDeviceSessionRefresherUseCase),e(r.deviceSessionTypes.UnsafeBypassIntentQueueUseCase).to(y.UnsafeBypassIntentQueueUseCase),o&&(t(r.deviceSessionTypes.GetDeviceSessionStateUseCase).to(c.StubUseCase),t(r.deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(c.StubUseCase),t(r.deviceSessionTypes.UnsafeBypassIntentQueueUseCase).to(c.StubUseCase))});0&&(module.exports={deviceSessionModuleFactory});
|
|
2
2
|
//# sourceMappingURL=deviceSessionModule.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/di/deviceSessionModule.ts"],
|
|
4
|
-
"sourcesContent": ["import { ContainerModule, type Factory } from \"inversify\";\n\nimport { type ApduReceiverService } from \"@api/device-session/service/ApduReceiverService\";\nimport { type ApduReceiverConstructorArgs } from \"@api/device-session/service/ApduReceiverService\";\nimport { type ApduSenderService } from \"@api/device-session/service/ApduSenderService\";\nimport { type ApduSenderServiceConstructorArgs } from \"@api/device-session/service/ApduSenderService\";\nimport { DisableDeviceSessionRefresherUseCase } from \"@api/device-session/use-case/DisableDeviceSessionRefresher\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DefaultApduReceiverService } from \"@internal/device-session/service/DefaultApduReceiverService\";\nimport { DefaultApduSenderService } from \"@internal/device-session/service/DefaultApduSenderService\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { CloseSessionsUseCase } from \"@internal/device-session/use-case/CloseSessionsUseCase\";\nimport { GetDeviceSessionStateUseCase } from \"@internal/device-session/use-case/GetDeviceSessionStateUseCase\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { deviceSessionTypes } from \"./deviceSessionTypes\";\n\nexport type DeviceSessionModuleArgs = Partial<{\n stub: boolean;\n}>;\n\nexport const deviceSessionModuleFactory = (\n { stub }: DeviceSessionModuleArgs = { stub: false },\n) =>\n new ContainerModule(({ bind, rebindSync }) => {\n bind<Factory<ApduSenderService>>(\n deviceSessionTypes.ApduSenderServiceFactory,\n ).toFactory((context) => {\n const logger = context.get<(name: string) => LoggerPublisherService>(\n loggerTypes.LoggerPublisherServiceFactory,\n );\n\n return (args: ApduSenderServiceConstructorArgs) => {\n return new DefaultApduSenderService(args, logger);\n };\n });\n\n bind<Factory<ApduReceiverService>>(\n deviceSessionTypes.ApduReceiverServiceFactory,\n ).toFactory((context) => {\n const logger = context.get<(name: string) => LoggerPublisherService>(\n loggerTypes.LoggerPublisherServiceFactory,\n );\n\n return (args: ApduReceiverConstructorArgs = {}) => {\n return new DefaultApduReceiverService(args, logger);\n };\n });\n\n bind(deviceSessionTypes.DeviceSessionService)\n .to(DefaultDeviceSessionService)\n .inSingletonScope();\n\n bind(deviceSessionTypes.GetDeviceSessionStateUseCase).to(\n GetDeviceSessionStateUseCase,\n );\n bind(deviceSessionTypes.CloseSessionsUseCase).to(CloseSessionsUseCase);\n bind(deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(\n DisableDeviceSessionRefresherUseCase,\n );\n\n if (stub) {\n rebindSync(deviceSessionTypes.GetDeviceSessionStateUseCase).to(\n StubUseCase,\n );\n rebindSync(deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(\n StubUseCase,\n );\n }\n });\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA8C,qBAM9CC,EAAqD,sEAErDC,EAA2C,uEAC3CC,EAAyC,qEACzCC,EAA4C,wEAC5CC,EAAqC,kEACrCC,EAA6C,0EAC7CC,EAA4B,qDAC5BC,EAA4B,6BAE5BC,EAAmC,gCAM5B,
|
|
6
|
-
"names": ["deviceSessionModule_exports", "__export", "deviceSessionModuleFactory", "__toCommonJS", "import_inversify", "import_DisableDeviceSessionRefresher", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_DefaultDeviceSessionService", "import_CloseSessionsUseCase", "import_GetDeviceSessionStateUseCase", "import_loggerTypes", "import_di", "import_deviceSessionTypes", "stub", "bind", "rebindSync", "context", "logger", "args"]
|
|
4
|
+
"sourcesContent": ["import { ContainerModule, type Factory } from \"inversify\";\n\nimport { type ApduReceiverService } from \"@api/device-session/service/ApduReceiverService\";\nimport { type ApduReceiverConstructorArgs } from \"@api/device-session/service/ApduReceiverService\";\nimport { type ApduSenderService } from \"@api/device-session/service/ApduSenderService\";\nimport { type ApduSenderServiceConstructorArgs } from \"@api/device-session/service/ApduSenderService\";\nimport { DisableDeviceSessionRefresherUseCase } from \"@api/device-session/use-case/DisableDeviceSessionRefresher\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DefaultApduReceiverService } from \"@internal/device-session/service/DefaultApduReceiverService\";\nimport { DefaultApduSenderService } from \"@internal/device-session/service/DefaultApduSenderService\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { CloseSessionsUseCase } from \"@internal/device-session/use-case/CloseSessionsUseCase\";\nimport { GetDeviceSessionStateUseCase } from \"@internal/device-session/use-case/GetDeviceSessionStateUseCase\";\nimport { UnsafeBypassIntentQueueUseCase } from \"@internal/device-session/use-case/UnsafeBypassIntentQueueUseCase\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { deviceSessionTypes } from \"./deviceSessionTypes\";\n\nexport type DeviceSessionModuleArgs = Partial<{\n stub: boolean;\n}>;\n\nexport const deviceSessionModuleFactory = (\n { stub }: DeviceSessionModuleArgs = { stub: false },\n) =>\n new ContainerModule(({ bind, rebindSync }) => {\n bind<Factory<ApduSenderService>>(\n deviceSessionTypes.ApduSenderServiceFactory,\n ).toFactory((context) => {\n const logger = context.get<(name: string) => LoggerPublisherService>(\n loggerTypes.LoggerPublisherServiceFactory,\n );\n\n return (args: ApduSenderServiceConstructorArgs) => {\n return new DefaultApduSenderService(args, logger);\n };\n });\n\n bind<Factory<ApduReceiverService>>(\n deviceSessionTypes.ApduReceiverServiceFactory,\n ).toFactory((context) => {\n const logger = context.get<(name: string) => LoggerPublisherService>(\n loggerTypes.LoggerPublisherServiceFactory,\n );\n\n return (args: ApduReceiverConstructorArgs = {}) => {\n return new DefaultApduReceiverService(args, logger);\n };\n });\n\n bind(deviceSessionTypes.DeviceSessionService)\n .to(DefaultDeviceSessionService)\n .inSingletonScope();\n\n bind(deviceSessionTypes.GetDeviceSessionStateUseCase).to(\n GetDeviceSessionStateUseCase,\n );\n bind(deviceSessionTypes.CloseSessionsUseCase).to(CloseSessionsUseCase);\n bind(deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(\n DisableDeviceSessionRefresherUseCase,\n );\n bind(deviceSessionTypes.UnsafeBypassIntentQueueUseCase).to(\n UnsafeBypassIntentQueueUseCase,\n );\n\n if (stub) {\n rebindSync(deviceSessionTypes.GetDeviceSessionStateUseCase).to(\n StubUseCase,\n );\n rebindSync(deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(\n StubUseCase,\n );\n rebindSync(deviceSessionTypes.UnsafeBypassIntentQueueUseCase).to(\n StubUseCase,\n );\n }\n });\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA8C,qBAM9CC,EAAqD,sEAErDC,EAA2C,uEAC3CC,EAAyC,qEACzCC,EAA4C,wEAC5CC,EAAqC,kEACrCC,EAA6C,0EAC7CC,EAA+C,4EAC/CC,EAA4B,qDAC5BC,EAA4B,6BAE5BC,EAAmC,gCAM5B,MAAMZ,EAA6B,CACxC,CAAE,KAAAa,CAAK,EAA6B,CAAE,KAAM,EAAM,IAElD,IAAI,kBAAgB,CAAC,CAAE,KAAAC,EAAM,WAAAC,CAAW,IAAM,CAC5CD,EACE,qBAAmB,wBACrB,EAAE,UAAWE,GAAY,CACvB,MAAMC,EAASD,EAAQ,IACrB,cAAY,6BACd,EAEA,OAAQE,GACC,IAAI,2BAAyBA,EAAMD,CAAM,CAEpD,CAAC,EAEDH,EACE,qBAAmB,0BACrB,EAAE,UAAWE,GAAY,CACvB,MAAMC,EAASD,EAAQ,IACrB,cAAY,6BACd,EAEA,MAAO,CAACE,EAAoC,CAAC,IACpC,IAAI,6BAA2BA,EAAMD,CAAM,CAEtD,CAAC,EAEDH,EAAK,qBAAmB,oBAAoB,EACzC,GAAG,6BAA2B,EAC9B,iBAAiB,EAEpBA,EAAK,qBAAmB,4BAA4B,EAAE,GACpD,8BACF,EACAA,EAAK,qBAAmB,oBAAoB,EAAE,GAAG,sBAAoB,EACrEA,EAAK,qBAAmB,oCAAoC,EAAE,GAC5D,sCACF,EACAA,EAAK,qBAAmB,8BAA8B,EAAE,GACtD,gCACF,EAEID,IACFE,EAAW,qBAAmB,4BAA4B,EAAE,GAC1D,aACF,EACAA,EAAW,qBAAmB,oCAAoC,EAAE,GAClE,aACF,EACAA,EAAW,qBAAmB,8BAA8B,EAAE,GAC5D,aACF,EAEJ,CAAC",
|
|
6
|
+
"names": ["deviceSessionModule_exports", "__export", "deviceSessionModuleFactory", "__toCommonJS", "import_inversify", "import_DisableDeviceSessionRefresher", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_DefaultDeviceSessionService", "import_CloseSessionsUseCase", "import_GetDeviceSessionStateUseCase", "import_UnsafeBypassIntentQueueUseCase", "import_loggerTypes", "import_di", "import_deviceSessionTypes", "stub", "bind", "rebindSync", "context", "logger", "args"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var
|
|
1
|
+
"use strict";var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var t=(s,e)=>{for(var i in e)r(s,i,{get:e[i],enumerable:!0})},v=(s,e,i,S)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of c(e))!n.call(s,o)&&o!==i&&r(s,o,{get:()=>e[o],enumerable:!(S=a(e,o))||S.enumerable});return s};var y=s=>v(r({},"__esModule",{value:!0}),s);var l={};t(l,{deviceSessionTypes:()=>f});module.exports=y(l);const f={ApduSenderServiceFactory:Symbol.for("ApduSenderServiceFactory"),ApduReceiverServiceFactory:Symbol.for("ApduReceiverServiceFactory"),DeviceSessionService:Symbol.for("DeviceSessionService"),GetDeviceSessionStateUseCase:Symbol.for("GetDeviceSessionStateUseCase"),DisableDeviceSessionRefresherUseCase:Symbol.for("DisableDeviceSessionRefresherUseCase"),CloseSessionsUseCase:Symbol.for("CloseSessionsUseCase"),UnsafeBypassIntentQueueUseCase:Symbol.for("UnsafeBypassIntentQueueUseCase")};0&&(module.exports={deviceSessionTypes});
|
|
2
2
|
//# sourceMappingURL=deviceSessionTypes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/di/deviceSessionTypes.ts"],
|
|
4
|
-
"sourcesContent": ["export const deviceSessionTypes = {\n ApduSenderServiceFactory: Symbol.for(\"ApduSenderServiceFactory\"),\n ApduReceiverServiceFactory: Symbol.for(\"ApduReceiverServiceFactory\"),\n DeviceSessionService: Symbol.for(\"DeviceSessionService\"),\n GetDeviceSessionStateUseCase: Symbol.for(\"GetDeviceSessionStateUseCase\"),\n DisableDeviceSessionRefresherUseCase: Symbol.for(\n \"DisableDeviceSessionRefresherUseCase\",\n ),\n CloseSessionsUseCase: Symbol.for(\"CloseSessionsUseCase\"),\n};\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAqB,CAChC,yBAA0B,OAAO,IAAI,0BAA0B,EAC/D,2BAA4B,OAAO,IAAI,4BAA4B,EACnE,qBAAsB,OAAO,IAAI,sBAAsB,EACvD,6BAA8B,OAAO,IAAI,8BAA8B,EACvE,qCAAsC,OAAO,IAC3C,sCACF,EACA,qBAAsB,OAAO,IAAI,sBAAsB,
|
|
4
|
+
"sourcesContent": ["export const deviceSessionTypes = {\n ApduSenderServiceFactory: Symbol.for(\"ApduSenderServiceFactory\"),\n ApduReceiverServiceFactory: Symbol.for(\"ApduReceiverServiceFactory\"),\n DeviceSessionService: Symbol.for(\"DeviceSessionService\"),\n GetDeviceSessionStateUseCase: Symbol.for(\"GetDeviceSessionStateUseCase\"),\n DisableDeviceSessionRefresherUseCase: Symbol.for(\n \"DisableDeviceSessionRefresherUseCase\",\n ),\n CloseSessionsUseCase: Symbol.for(\"CloseSessionsUseCase\"),\n UnsafeBypassIntentQueueUseCase: Symbol.for(\"UnsafeBypassIntentQueueUseCase\"),\n};\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAqB,CAChC,yBAA0B,OAAO,IAAI,0BAA0B,EAC/D,2BAA4B,OAAO,IAAI,4BAA4B,EACnE,qBAAsB,OAAO,IAAI,sBAAsB,EACvD,6BAA8B,OAAO,IAAI,8BAA8B,EACvE,qCAAsC,OAAO,IAC3C,sCACF,EACA,qBAAsB,OAAO,IAAI,sBAAsB,EACvD,+BAAgC,OAAO,IAAI,gCAAgC,CAC7E",
|
|
6
6
|
"names": ["deviceSessionTypes_exports", "__export", "deviceSessionTypes", "__toCommonJS"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var m=Object.defineProperty;var
|
|
1
|
+
"use strict";var m=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var l=(s,e)=>{for(var n in e)m(s,n,{get:e[n],enumerable:!0})},h=(s,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of v(e))!E.call(s,t)&&t!==n&&m(s,t,{get:()=>e[t],enumerable:!(i=d(e,t))||i.enumerable});return s};var D=s=>h(m({},"__esModule",{value:!0}),s);var _={};l(_,{DevicePinger:()=>C});module.exports=D(_);var p=require("../../../api/device/DeviceModel"),a=require("../../../api/index"),c=require("../../device-session/data/ApduResponseConst"),u=require("../../device-session/data/DeviceSessionRefresherConst"),r=require("../../device-session/model/DeviceSessionEventDispatcher");class C{constructor(e,n,i,t){this.connectedDevice=n;this._sessionEventDispatcher=i;this._sendCommandFunction=t,this._logger=e("device-pinger"),this._subscription=this._sessionEventDispatcher.listen().subscribe(async o=>await this.mapEventAction(o))}_sendCommandFunction;_subscription;_logger;async ping(){try{return await this.mapDevicePingAction(this.connectedDevice.deviceModel.id)}catch(e){return this._logger.error("Error while pinging device",{data:{error:e}}),null}}mapEventAction=async e=>{switch(e.eventName){case r.SessionEvents.REFRESH_NEEDED:return await this.ping();default:return null}};async mapDevicePingAction(e){switch(e){case p.DeviceModelId.NANO_S:{const n=async()=>{const o=await this._sendCommandFunction(new a.GetAppAndVersionCommand,c.PINGER_TIMEOUT);return this._sendCommandFunction(new a.GetOsVersionCommand,c.PINGER_TIMEOUT),o},i=new Promise(o=>{setTimeout(()=>o(null),u.DEVICE_SESSION_REFRESHER_POLLING_INTERVAL*2+100)}),t=await Promise.race([n(),i]);return t?this._sessionEventDispatcher.dispatch({eventName:r.SessionEvents.COMMAND_SUCCEEDED,eventData:t}):this._sessionEventDispatcher.dispatch({eventName:r.SessionEvents.DEVICE_STATE_UPDATE_LOCKED}),t}default:{const n=await this._sendCommandFunction(new a.GetAppAndVersionCommand,c.PINGER_TIMEOUT);return this._sessionEventDispatcher.dispatch({eventName:r.SessionEvents.COMMAND_SUCCEEDED,eventData:n}),n}}}unsubscribe(){this._subscription.unsubscribe()}}0&&(module.exports={DevicePinger});
|
|
2
2
|
//# sourceMappingURL=DevicePinger.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/model/DevicePinger.ts"],
|
|
4
|
-
"sourcesContent": ["import { type Subscription } from \"rxjs\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n GetOsVersionCommand,\n type TransportConnectedDevice,\n} from \"@api/index\";\nimport {\n type Command,\n type CommandResult,\n type LoggerPublisherService,\n} from \"@api/types\";\nimport { PINGER_TIMEOUT } from \"@internal/device-session/data/ApduResponseConst\";\nimport { DEVICE_SESSION_REFRESHER_POLLING_INTERVAL } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport {\n type DeviceSessionEventDispatcher,\n type NewEvent,\n SessionEvents,\n} from \"@internal/device-session/model/DeviceSessionEventDispatcher\";\n\ntype SendCommandFunction = <Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n) => Promise<CommandResult<Response, ErrorStatusCodes>>;\n\nexport class DevicePinger {\n private readonly _sendCommandFunction: SendCommandFunction;\n private _subscription: Subscription;\n private _logger: LoggerPublisherService;\n\n constructor(\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n private connectedDevice: TransportConnectedDevice,\n private _sessionEventDispatcher: DeviceSessionEventDispatcher,\n sendCommandFunction: SendCommandFunction,\n ) {\n this._sendCommandFunction = sendCommandFunction;\n this._logger = loggerModuleFactory(\"device-pinger\");\n this._subscription = this._sessionEventDispatcher\n .listen()\n .subscribe(async (event) => await this.mapEventAction(event));\n }\n\n public async ping(): Promise<CommandResult<GetAppAndVersionResponse> | null> {\n try {\n const result = await this.mapDevicePingAction(\n this.connectedDevice.deviceModel.id,\n );\n return result;\n } catch (error) {\n this._logger.error(\"Error while pinging device\", {\n data: {\n error,\n },\n });\n
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAEA,IAAAI,EAA8B,mCAC9BC,EAKO,sBAMPC,EAA+B,2DAC/BC,EAA0D,qEAC1DC,EAIO,uEAOA,MAAMN,CAAa,CAKxB,YACEO,EACQC,EACAC,EACRC,EACA,CAHQ,qBAAAF,EACA,6BAAAC,EAGR,KAAK,qBAAuBC,EAC5B,KAAK,QAAUH,EAAoB,eAAe,EAClD,KAAK,cAAgB,KAAK,wBACvB,OAAO,EACP,UAAU,MAAOI,GAAU,MAAM,KAAK,eAAeA,CAAK,CAAC,CAChE,CAfiB,qBACT,cACA,QAeR,MAAa,MAAgE,CAC3E,GAAI,CAIF,OAHe,MAAM,KAAK,oBACxB,KAAK,gBAAgB,YAAY,EACnC,CAEF,OAASC,EAAO,CACd,
|
|
4
|
+
"sourcesContent": ["import { type Subscription } from \"rxjs\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n GetOsVersionCommand,\n type TransportConnectedDevice,\n} from \"@api/index\";\nimport {\n type Command,\n type CommandResult,\n type LoggerPublisherService,\n} from \"@api/types\";\nimport { PINGER_TIMEOUT } from \"@internal/device-session/data/ApduResponseConst\";\nimport { DEVICE_SESSION_REFRESHER_POLLING_INTERVAL } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport {\n type DeviceSessionEventDispatcher,\n type NewEvent,\n SessionEvents,\n} from \"@internal/device-session/model/DeviceSessionEventDispatcher\";\n\ntype SendCommandFunction = <Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n) => Promise<CommandResult<Response, ErrorStatusCodes>>;\n\nexport class DevicePinger {\n private readonly _sendCommandFunction: SendCommandFunction;\n private _subscription: Subscription;\n private _logger: LoggerPublisherService;\n\n constructor(\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n private connectedDevice: TransportConnectedDevice,\n private _sessionEventDispatcher: DeviceSessionEventDispatcher,\n sendCommandFunction: SendCommandFunction,\n ) {\n this._sendCommandFunction = sendCommandFunction;\n this._logger = loggerModuleFactory(\"device-pinger\");\n this._subscription = this._sessionEventDispatcher\n .listen()\n .subscribe(async (event) => await this.mapEventAction(event));\n }\n\n public async ping(): Promise<CommandResult<GetAppAndVersionResponse> | null> {\n try {\n const result = await this.mapDevicePingAction(\n this.connectedDevice.deviceModel.id,\n );\n return result;\n } catch (error) {\n this._logger.error(\"Error while pinging device\", {\n data: {\n error,\n },\n });\n return null;\n }\n }\n\n private mapEventAction = async (event: NewEvent) => {\n switch (event.eventName) {\n case SessionEvents.REFRESH_NEEDED:\n return await this.ping();\n default:\n return null;\n }\n };\n\n private async mapDevicePingAction(deviceModelId: DeviceModelId) {\n switch (deviceModelId) {\n case DeviceModelId.NANO_S: {\n const chainPromise: () => Promise<\n CommandResult<GetAppAndVersionResponse>\n > = async () => {\n const appVersionResult = await this._sendCommandFunction(\n new GetAppAndVersionCommand(),\n PINGER_TIMEOUT,\n );\n\n this._sendCommandFunction(new GetOsVersionCommand(), PINGER_TIMEOUT);\n return appVersionResult;\n };\n\n const timeoutPromise: Promise<null> = new Promise((resolve) => {\n setTimeout(\n () => resolve(null),\n DEVICE_SESSION_REFRESHER_POLLING_INTERVAL * 2 + 100,\n );\n });\n\n const resultOrTimeout: CommandResult<GetAppAndVersionResponse> | null =\n await Promise.race([chainPromise(), timeoutPromise]);\n\n if (!resultOrTimeout) {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n } else {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.COMMAND_SUCCEEDED,\n eventData: resultOrTimeout,\n });\n }\n return resultOrTimeout;\n }\n default: {\n const result = await this._sendCommandFunction(\n new GetAppAndVersionCommand(),\n PINGER_TIMEOUT,\n );\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.COMMAND_SUCCEEDED,\n eventData: result,\n });\n return result;\n }\n }\n }\n\n public unsubscribe(): void {\n this._subscription.unsubscribe();\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAEA,IAAAI,EAA8B,mCAC9BC,EAKO,sBAMPC,EAA+B,2DAC/BC,EAA0D,qEAC1DC,EAIO,uEAOA,MAAMN,CAAa,CAKxB,YACEO,EACQC,EACAC,EACRC,EACA,CAHQ,qBAAAF,EACA,6BAAAC,EAGR,KAAK,qBAAuBC,EAC5B,KAAK,QAAUH,EAAoB,eAAe,EAClD,KAAK,cAAgB,KAAK,wBACvB,OAAO,EACP,UAAU,MAAOI,GAAU,MAAM,KAAK,eAAeA,CAAK,CAAC,CAChE,CAfiB,qBACT,cACA,QAeR,MAAa,MAAgE,CAC3E,GAAI,CAIF,OAHe,MAAM,KAAK,oBACxB,KAAK,gBAAgB,YAAY,EACnC,CAEF,OAASC,EAAO,CACd,YAAK,QAAQ,MAAM,6BAA8B,CAC/C,KAAM,CACJ,MAAAA,CACF,CACF,CAAC,EACM,IACT,CACF,CAEQ,eAAiB,MAAOD,GAAoB,CAClD,OAAQA,EAAM,UAAW,CACvB,KAAK,gBAAc,eACjB,OAAO,MAAM,KAAK,KAAK,EACzB,QACE,OAAO,IACX,CACF,EAEA,MAAc,oBAAoBE,EAA8B,CAC9D,OAAQA,EAAe,CACrB,KAAK,gBAAc,OAAQ,CACzB,MAAMC,EAEF,SAAY,CACd,MAAMC,EAAmB,MAAM,KAAK,qBAClC,IAAI,0BACJ,gBACF,EAEA,YAAK,qBAAqB,IAAI,sBAAuB,gBAAc,EAC5DA,CACT,EAEMC,EAAgC,IAAI,QAASC,GAAY,CAC7D,WACE,IAAMA,EAAQ,IAAI,EAClB,4CAA4C,EAAI,GAClD,CACF,CAAC,EAEKC,EACJ,MAAM,QAAQ,KAAK,CAACJ,EAAa,EAAGE,CAAc,CAAC,EAErD,OAAKE,EAKH,KAAK,wBAAwB,SAAS,CACpC,UAAW,gBAAc,kBACzB,UAAWA,CACb,CAAC,EAPD,KAAK,wBAAwB,SAAS,CACpC,UAAW,gBAAc,0BAC3B,CAAC,EAOIA,CACT,CACA,QAAS,CACP,MAAMC,EAAS,MAAM,KAAK,qBACxB,IAAI,0BACJ,gBACF,EACA,YAAK,wBAAwB,SAAS,CACpC,UAAW,gBAAc,kBACzB,UAAWA,CACb,CAAC,EACMA,CACT,CACF,CACF,CAEO,aAAoB,CACzB,KAAK,cAAc,YAAY,CACjC,CACF",
|
|
6
6
|
"names": ["DevicePinger_exports", "__export", "DevicePinger", "__toCommonJS", "import_DeviceModel", "import_api", "import_ApduResponseConst", "import_DeviceSessionRefresherConst", "import_DeviceSessionEventDispatcher", "loggerModuleFactory", "connectedDevice", "_sessionEventDispatcher", "sendCommandFunction", "event", "error", "deviceModelId", "chainPromise", "appVersionResult", "timeoutPromise", "resolve", "resultOrTimeout", "result"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var E=require("rxjs"),e=require("vitest"),d=require("../../../api/device/DeviceModel"),p=require("../../../api/index"),D=require("../../device-session/data/DeviceSessionRefresherConst"),a=require("../../device-session/model/DeviceSessionEventDispatcher"),m=require("./DevicePinger");(0,e.describe)("DevicePinger",()=>{let n,u;const v=e.vi.fn(()=>u);let r,s,i,o;(0,e.beforeEach)(()=>{r=new E.Subject,s={listen:()=>r.asObservable(),dispatch:e.vi.fn()},n=e.vi.fn(),u={info:e.vi.fn(),warn:e.vi.fn(),error:e.vi.fn(),debug:e.vi.fn(),subscribers:[]},i={deviceModel:{id:d.DeviceModelId.NANO_X}},o=new m.DevicePinger(v,i,s,n)}),(0,e.afterEach)(()=>{o.unsubscribe(),e.vi.restoreAllMocks()}),(0,e.it)("should call sendCommandFunction and dispatch COMMAND_SUCCEEDED event on successful ping for non-NANO_S",async()=>{const t={status:"success",data:{foo:"bar"}};n.mockResolvedValue(t);const c=await o.ping();(0,e.expect)(n).toHaveBeenCalledTimes(1);const l=n.mock.calls[0][0];(0,e.expect)(l).toBeInstanceOf(p.GetAppAndVersionCommand),(0,e.expect)(s.dispatch).toHaveBeenCalledWith({eventName:a.SessionEvents.COMMAND_SUCCEEDED,eventData:t}),(0,e.expect)(c).toEqual(t)}),(0,e.it)("should log error and throw error on ping failure",async()=>{const t=new Error("ping failed");n.mockRejectedValue(t),
|
|
1
|
+
"use strict";var E=require("rxjs"),e=require("vitest"),d=require("../../../api/device/DeviceModel"),p=require("../../../api/index"),D=require("../../device-session/data/DeviceSessionRefresherConst"),a=require("../../device-session/model/DeviceSessionEventDispatcher"),m=require("./DevicePinger");(0,e.describe)("DevicePinger",()=>{let n,u;const v=e.vi.fn(()=>u);let r,s,i,o;(0,e.beforeEach)(()=>{r=new E.Subject,s={listen:()=>r.asObservable(),dispatch:e.vi.fn()},n=e.vi.fn(),u={info:e.vi.fn(),warn:e.vi.fn(),error:e.vi.fn(),debug:e.vi.fn(),subscribers:[]},i={deviceModel:{id:d.DeviceModelId.NANO_X}},o=new m.DevicePinger(v,i,s,n)}),(0,e.afterEach)(()=>{o.unsubscribe(),e.vi.restoreAllMocks()}),(0,e.it)("should call sendCommandFunction and dispatch COMMAND_SUCCEEDED event on successful ping for non-NANO_S",async()=>{const t={status:"success",data:{foo:"bar"}};n.mockResolvedValue(t);const c=await o.ping();(0,e.expect)(n).toHaveBeenCalledTimes(1);const l=n.mock.calls[0][0];(0,e.expect)(l).toBeInstanceOf(p.GetAppAndVersionCommand),(0,e.expect)(s.dispatch).toHaveBeenCalledWith({eventName:a.SessionEvents.COMMAND_SUCCEEDED,eventData:t}),(0,e.expect)(c).toEqual(t)}),(0,e.it)("should log error and throw error on ping failure",async()=>{const t=new Error("ping failed");n.mockRejectedValue(t),(0,e.expect)(await o.ping()).toBeNull(),(0,e.expect)(n).toHaveBeenCalledTimes(1)}),(0,e.it)("should dispatch DEVICE_STATE_UPDATE_LOCKED and return null on timeout for NANO_S",async()=>{i.deviceModel.id=d.DeviceModelId.NANO_S,o.unsubscribe(),o=new m.DevicePinger(v,i,s,n);const t=new Promise(()=>{});n.mockReturnValueOnce(t),e.vi.useFakeTimers();const c=o.ping();e.vi.advanceTimersByTime(D.DEVICE_SESSION_REFRESHER_POLLING_INTERVAL*4);const l=await c;(0,e.expect)(l).toBeNull(),(0,e.expect)(s.dispatch).toHaveBeenCalledWith({eventName:a.SessionEvents.DEVICE_STATE_UPDATE_LOCKED}),(0,e.expect)(n).toHaveBeenCalledTimes(1),e.vi.useRealTimers()}),(0,e.it)("should call ping on REFRESH_NEEDED event",async()=>{const t={status:"success",data:{foo:"bar"}};n.mockResolvedValue(t),r.next({eventName:a.SessionEvents.REFRESH_NEEDED,eventData:void 0}),await Promise.resolve(),(0,e.expect)(n).toHaveBeenCalled(),(0,e.expect)(s.dispatch).toHaveBeenCalledWith({eventName:a.SessionEvents.COMMAND_SUCCEEDED,eventData:t})}),(0,e.it)("should not process events after unsubscribe is called",async()=>{o.unsubscribe(),n.mockClear(),r.next({eventName:a.SessionEvents.REFRESH_NEEDED,eventData:void 0}),await Promise.resolve(),(0,e.expect)(n).not.toHaveBeenCalled()})});
|
|
2
2
|
//# sourceMappingURL=DevicePinger.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/model/DevicePinger.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { Subject } from \"rxjs\";\nimport { afterEach, beforeEach, describe, expect, it, vi } from \"vitest\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport {\n GetAppAndVersionCommand,\n type TransportConnectedDevice,\n} from \"@api/index\";\nimport type { LoggerPublisherService } from \"@api/types\";\nimport { DEVICE_SESSION_REFRESHER_POLLING_INTERVAL } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport {\n type DeviceSessionEventDispatcher,\n type NewEvent,\n SessionEvents,\n} from \"@internal/device-session/model/DeviceSessionEventDispatcher\";\n\nimport { DevicePinger } from \"./DevicePinger\";\n\ndescribe(\"DevicePinger\", () => {\n let dummySendCommandFunction: ReturnType<typeof vi.fn>;\n let mockLogger: LoggerPublisherService & {\n info: ReturnType<typeof vi.fn>;\n warn: ReturnType<typeof vi.fn>;\n error: ReturnType<typeof vi.fn>;\n };\n const mockedLoggerModuleFactory = vi.fn(() => mockLogger);\n let eventSubject: Subject<NewEvent>;\n let mockSessionEventDispatcher: DeviceSessionEventDispatcher;\n let dummyConnectedDevice: TransportConnectedDevice;\n let devicePinger: DevicePinger;\n\n beforeEach(() => {\n eventSubject = new Subject<NewEvent>();\n mockSessionEventDispatcher = {\n listen: () => eventSubject.asObservable(),\n dispatch: vi.fn(),\n } as unknown as DeviceSessionEventDispatcher;\n\n dummySendCommandFunction = vi.fn();\n mockLogger = {\n info: vi.fn(),\n warn: vi.fn(),\n error: vi.fn(),\n debug: vi.fn(),\n subscribers: [],\n };\n\n dummyConnectedDevice = {\n deviceModel: {\n id: DeviceModelId.NANO_X,\n },\n } as unknown as TransportConnectedDevice;\n\n devicePinger = new DevicePinger(\n mockedLoggerModuleFactory,\n dummyConnectedDevice,\n mockSessionEventDispatcher,\n dummySendCommandFunction,\n );\n });\n\n afterEach(() => {\n devicePinger.unsubscribe();\n vi.restoreAllMocks();\n });\n\n it(\"should call sendCommandFunction and dispatch COMMAND_SUCCEEDED event on successful ping for non-NANO_S\", async () => {\n // given\n const dummyResult = {\n status: \"success\",\n data: { foo: \"bar\" },\n };\n dummySendCommandFunction.mockResolvedValue(dummyResult);\n\n // when\n const result = await devicePinger.ping();\n\n // then\n expect(dummySendCommandFunction).toHaveBeenCalledTimes(1);\n const commandArg = dummySendCommandFunction.mock\n .calls[0]![0] as GetAppAndVersionCommand;\n expect(commandArg).toBeInstanceOf(GetAppAndVersionCommand);\n expect(mockSessionEventDispatcher.dispatch).toHaveBeenCalledWith({\n eventName: SessionEvents.COMMAND_SUCCEEDED,\n eventData: dummyResult,\n });\n expect(result).toEqual(dummyResult);\n });\n\n it(\"should log error and throw error on ping failure\", async () => {\n // given\n const dummyError = new Error(\"ping failed\");\n dummySendCommandFunction.mockRejectedValue(dummyError);\n\n // then\n await
|
|
5
|
-
"mappings": "aAAA,IAAAA,EAAwB,gBACxBC,EAAgE,kBAEhEC,EAA8B,mCAC9BC,EAGO,sBAEPC,EAA0D,qEAC1DC,EAIO,uEAEPC,EAA6B,6BAE7B,YAAS,eAAgB,IAAM,CAC7B,IAAIC,EACAC,EAKJ,MAAMC,EAA4B,KAAG,GAAG,IAAMD,CAAU,EACxD,IAAIE,EACAC,EACAC,EACAC,KAEJ,cAAW,IAAM,CACfH,EAAe,IAAI,UACnBC,EAA6B,CAC3B,OAAQ,IAAMD,EAAa,aAAa,EACxC,SAAU,KAAG,GAAG,CAClB,EAEAH,EAA2B,KAAG,GAAG,EACjCC,EAAa,CACX,KAAM,KAAG,GAAG,EACZ,KAAM,KAAG,GAAG,EACZ,MAAO,KAAG,GAAG,EACb,MAAO,KAAG,GAAG,EACb,YAAa,CAAC,CAChB,EAEAI,EAAuB,CACrB,YAAa,CACX,GAAI,gBAAc,MACpB,CACF,EAEAC,EAAe,IAAI,eACjBJ,EACAG,EACAD,EACAJ,CACF,CACF,CAAC,KAED,aAAU,IAAM,CACdM,EAAa,YAAY,EACzB,KAAG,gBAAgB,CACrB,CAAC,KAED,MAAG,yGAA0G,SAAY,CAEvH,MAAMC,EAAc,CAClB,OAAQ,UACR,KAAM,CAAE,IAAK,KAAM,CACrB,EACAP,EAAyB,kBAAkBO,CAAW,EAGtD,MAAMC,EAAS,MAAMF,EAAa,KAAK,KAGvC,UAAON,CAAwB,EAAE,sBAAsB,CAAC,EACxD,MAAMS,EAAaT,EAAyB,KACzC,MAAM,CAAC,EAAG,CAAC,KACd,UAAOS,CAAU,EAAE,eAAe,yBAAuB,KACzD,UAAOL,EAA2B,QAAQ,EAAE,qBAAqB,CAC/D,UAAW,gBAAc,kBACzB,UAAWG,CACb,CAAC,KACD,UAAOC,CAAM,EAAE,QAAQD,CAAW,CACpC,CAAC,KAED,MAAG,mDAAoD,SAAY,CAEjE,MAAMG,EAAa,IAAI,MAAM,aAAa,EAC1CV,EAAyB,kBAAkBU,CAAU,
|
|
4
|
+
"sourcesContent": ["import { Subject } from \"rxjs\";\nimport { afterEach, beforeEach, describe, expect, it, vi } from \"vitest\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport {\n GetAppAndVersionCommand,\n type TransportConnectedDevice,\n} from \"@api/index\";\nimport type { LoggerPublisherService } from \"@api/types\";\nimport { DEVICE_SESSION_REFRESHER_POLLING_INTERVAL } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport {\n type DeviceSessionEventDispatcher,\n type NewEvent,\n SessionEvents,\n} from \"@internal/device-session/model/DeviceSessionEventDispatcher\";\n\nimport { DevicePinger } from \"./DevicePinger\";\n\ndescribe(\"DevicePinger\", () => {\n let dummySendCommandFunction: ReturnType<typeof vi.fn>;\n let mockLogger: LoggerPublisherService & {\n info: ReturnType<typeof vi.fn>;\n warn: ReturnType<typeof vi.fn>;\n error: ReturnType<typeof vi.fn>;\n };\n const mockedLoggerModuleFactory = vi.fn(() => mockLogger);\n let eventSubject: Subject<NewEvent>;\n let mockSessionEventDispatcher: DeviceSessionEventDispatcher;\n let dummyConnectedDevice: TransportConnectedDevice;\n let devicePinger: DevicePinger;\n\n beforeEach(() => {\n eventSubject = new Subject<NewEvent>();\n mockSessionEventDispatcher = {\n listen: () => eventSubject.asObservable(),\n dispatch: vi.fn(),\n } as unknown as DeviceSessionEventDispatcher;\n\n dummySendCommandFunction = vi.fn();\n mockLogger = {\n info: vi.fn(),\n warn: vi.fn(),\n error: vi.fn(),\n debug: vi.fn(),\n subscribers: [],\n };\n\n dummyConnectedDevice = {\n deviceModel: {\n id: DeviceModelId.NANO_X,\n },\n } as unknown as TransportConnectedDevice;\n\n devicePinger = new DevicePinger(\n mockedLoggerModuleFactory,\n dummyConnectedDevice,\n mockSessionEventDispatcher,\n dummySendCommandFunction,\n );\n });\n\n afterEach(() => {\n devicePinger.unsubscribe();\n vi.restoreAllMocks();\n });\n\n it(\"should call sendCommandFunction and dispatch COMMAND_SUCCEEDED event on successful ping for non-NANO_S\", async () => {\n // given\n const dummyResult = {\n status: \"success\",\n data: { foo: \"bar\" },\n };\n dummySendCommandFunction.mockResolvedValue(dummyResult);\n\n // when\n const result = await devicePinger.ping();\n\n // then\n expect(dummySendCommandFunction).toHaveBeenCalledTimes(1);\n const commandArg = dummySendCommandFunction.mock\n .calls[0]![0] as GetAppAndVersionCommand;\n expect(commandArg).toBeInstanceOf(GetAppAndVersionCommand);\n expect(mockSessionEventDispatcher.dispatch).toHaveBeenCalledWith({\n eventName: SessionEvents.COMMAND_SUCCEEDED,\n eventData: dummyResult,\n });\n expect(result).toEqual(dummyResult);\n });\n\n it(\"should log error and throw error on ping failure\", async () => {\n // given\n const dummyError = new Error(\"ping failed\");\n dummySendCommandFunction.mockRejectedValue(dummyError);\n\n // then\n expect(await devicePinger.ping()).toBeNull();\n expect(dummySendCommandFunction).toHaveBeenCalledTimes(1);\n });\n\n it(\"should dispatch DEVICE_STATE_UPDATE_LOCKED and return null on timeout for NANO_S\", async () => {\n // given\n dummyConnectedDevice.deviceModel.id = DeviceModelId.NANO_S;\n devicePinger.unsubscribe();\n devicePinger = new DevicePinger(\n mockedLoggerModuleFactory,\n dummyConnectedDevice,\n mockSessionEventDispatcher,\n dummySendCommandFunction,\n );\n const neverResolvingPromise = new Promise(() => {});\n dummySendCommandFunction.mockReturnValueOnce(neverResolvingPromise);\n vi.useFakeTimers();\n\n // when\n const pingPromise = devicePinger.ping();\n vi.advanceTimersByTime(DEVICE_SESSION_REFRESHER_POLLING_INTERVAL * 4);\n\n const result = await pingPromise;\n\n // then\n expect(result).toBeNull();\n expect(mockSessionEventDispatcher.dispatch).toHaveBeenCalledWith({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n expect(dummySendCommandFunction).toHaveBeenCalledTimes(1);\n\n vi.useRealTimers();\n });\n\n it(\"should call ping on REFRESH_NEEDED event\", async () => {\n // given\n const dummyResult = {\n status: \"success\",\n data: { foo: \"bar\" },\n };\n dummySendCommandFunction.mockResolvedValue(dummyResult);\n\n // when\n eventSubject.next({\n eventName: SessionEvents.REFRESH_NEEDED,\n eventData: undefined,\n });\n await Promise.resolve();\n\n // then\n expect(dummySendCommandFunction).toHaveBeenCalled();\n expect(mockSessionEventDispatcher.dispatch).toHaveBeenCalledWith({\n eventName: SessionEvents.COMMAND_SUCCEEDED,\n eventData: dummyResult,\n });\n });\n\n it(\"should not process events after unsubscribe is called\", async () => {\n // given\n devicePinger.unsubscribe();\n dummySendCommandFunction.mockClear();\n\n // when\n eventSubject.next({\n eventName: SessionEvents.REFRESH_NEEDED,\n eventData: undefined,\n });\n await Promise.resolve();\n\n // then\n expect(dummySendCommandFunction).not.toHaveBeenCalled();\n });\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["import_rxjs", "import_vitest", "import_DeviceModel", "import_api", "import_DeviceSessionRefresherConst", "import_DeviceSessionEventDispatcher", "import_DevicePinger", "dummySendCommandFunction", "mockLogger", "mockedLoggerModuleFactory", "eventSubject", "mockSessionEventDispatcher", "dummyConnectedDevice", "devicePinger", "dummyResult", "result", "commandArg", "dummyError", "neverResolvingPromise", "pingPromise"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var l=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var O=(a,e)=>{for(var t in e)l(a,t,{get:e[t],enumerable:!0})},T=(a,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of y(e))!I.call(a,s)&&s!==t&&l(a,s,{get:()=>e[s],enumerable:!(i=R(e,s))||i.enumerable});return a};var x=a=>T(l({},"__esModule",{value:!0}),a);var P={};O(P,{DeviceSession:()=>w});module.exports=x(P);var r=require("rxjs"),S=require("uuid"),D=require("../../../api/command/utils/CommandUtils"),h=require("../../../api/device/DeviceStatus"),_=require("../../../api/device-session/DeviceSessionState"),p=require("../../../api/transport/model/Errors"),v=require("../../../api/utils/apduLogs"),g=require("../../device-session/data/DeviceSessionRefresherConst"),f=require("../../device-session/service/IntentQueueService"),E=require("../../device-session/service/RefresherService"),b=require("./DevicePinger"),u=require("./DeviceSessionEventDispatcher"),A=require("./DeviceSessionRefresher"),C=require("./DeviceSessionStateHandler");class w{_id;_connectedDevice;_deviceState;_managerApiService;_secureChannelService;_logger;_loggerModuleFactory;_refresherOptions;_pinger;_deviceSessionRefresher;_refresherService;_intentQueueService;_sessionEventDispatcher=new u.DeviceSessionEventDispatcher;_bypassIntentQueue=!1;constructor({connectedDevice:e,id:t=(0,S.v4)()},i,s,n,o,d=c=>new f.IntentQueueService(i,c)){this._id=t,this._connectedDevice=e,this._loggerModuleFactory=i,this._logger=i("device-session"),this._managerApiService=s,this._intentQueueService=d(this._sessionEventDispatcher),this._secureChannelService=n,this._refresherOptions={...g.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,...o},this._deviceState=new r.BehaviorSubject({sessionStateType:_.DeviceSessionStateType.Connected,deviceStatus:h.DeviceStatus.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id}),this._pinger=new b.DevicePinger(i,e,this._sessionEventDispatcher,(c,m)=>this.sendCommand(c,m)),this._deviceSessionRefresher=new A.DeviceSessionRefresher(i,this._refresherOptions,this._sessionEventDispatcher,this._connectedDevice),new C.DeviceSessionStateHandler(i,this._sessionEventDispatcher,this._connectedDevice,this._deviceState,c=>this.setDeviceSessionState(c)),this._refresherService=new E.RefresherService(i,{start:()=>this._deviceSessionRefresher.restartRefresher(),stop:()=>this._deviceSessionRefresher.stopRefresher()})}async initialiseSession(){try{this._refresherOptions.isRefresherDisabled?await this._pinger.ping():this._deviceSessionRefresher.startRefresher()}catch(e){throw this._logger.error("Error while initialising session",{data:{error:e}}),e}}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}getDeviceSessionState(){return this._deviceState.getValue()}setDeviceSessionState(e){this._deviceState.next(e)}sendApdu(e,t={isPolling:!1,triggersDisconnection:!1,abortTimeout:void 0}){return this._bypassIntentQueue?this._unsafeInternalSendApdu(e,t):this._internalSendApdu(e,t)}_internalSendApdu(e,t){const i=t.abortTimeout,s=Date.now(),{observable:n,cancel:o}=this._intentQueueService.enqueue({type:"send-apdu",execute:()=>(0,r.from)((async()=>{const c=Date.now()-s;return await this._unsafeInternalSendApdu(e,{isPolling:t.isPolling,triggersDisconnection:t.triggersDisconnection,abortTimeout:i?i-c:void 0})})())}),d=i?n.pipe((0,r.timeout)({each:i,with:()=>{throw o(),new p.SendApduTimeoutError}})):n;return(0,r.lastValueFrom)(d)}async _unsafeInternalSendApdu(e,t={isPolling:!1,triggersDisconnection:!1,abortTimeout:void 0}){return this._logger.debug((0,v.formatApduSendingLog)(e)),(await this._connectedDevice.sendApdu(e,t.triggersDisconnection,t.abortTimeout)).ifRight(s=>{this._logger.debug((0,v.formatApduReceivedLog)(s)),D.CommandUtils.isLockedDeviceResponse(s)?this._sessionEventDispatcher.dispatch({eventName:u.SessionEvents.DEVICE_STATE_UPDATE_LOCKED}):this._sessionEventDispatcher.dispatch({eventName:u.SessionEvents.DEVICE_STATE_UPDATE_CONNECTED})}).ifLeft(()=>{this._sessionEventDispatcher.dispatch({eventName:u.SessionEvents.DEVICE_STATE_UPDATE_UNKNOWN})})}sendCommand(e,t){return this._logger.debug(`[sendCommand] ${e.name}`),this._bypassIntentQueue?this._unsafeInternalSendCommand(e,t):this._internalSendCommand(e,t)}_internalSendCommand(e,t){const i=Date.now(),{observable:s,cancel:n}=this._intentQueueService.enqueue({type:"send-command",execute:()=>(0,r.from)((async()=>{const d=Date.now()-i;return await this._unsafeInternalSendCommand(e,t?t-d:void 0)})())}),o=t?s.pipe((0,r.timeout)({each:t,with:()=>{throw n(),new p.SendCommandTimeoutError}})):s;return(0,r.lastValueFrom)(o)}async _unsafeInternalSendCommand(e,t){const i=e.getApdu();return(await this._unsafeInternalSendApdu(i.getRawApdu(),{isPolling:!1,triggersDisconnection:e.triggersDisconnection??!1,abortTimeout:t})).caseOf({Left:n=>{throw this._logger.error("[sendCommand] error",{data:{err:n}}),n},Right:n=>{const o=e.parseResponse(n,this._connectedDevice.deviceModel.id);return this._logger.debug("[sendCommand] result",{data:{result:o}}),o}})}executeDeviceAction(e){return this._bypassIntentQueue?this._unsafeInternalExecuteDeviceAction(e):this._internalExecuteDeviceAction(e)}_internalExecuteDeviceAction(e){let t;const{observable:i,cancel:s}=this._intentQueueService.enqueue({type:"device-action",execute:()=>{const{observable:n,cancel:o}=this._unsafeInternalExecuteDeviceAction(e);return t=o,n}});return{observable:i,cancel:()=>{t?.(),s()}}}_unsafeInternalExecuteDeviceAction(e){const{observable:t,cancel:i}=e._execute({sendApdu:async s=>this._unsafeInternalSendApdu(s),sendCommand:async s=>this._unsafeInternalSendCommand(s),getDeviceModel:()=>this._connectedDevice.deviceModel,getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:s=>(this.setDeviceSessionState(s),this._deviceState.getValue()),getManagerApiService:()=>this._managerApiService,getSecureChannelService:()=>this._secureChannelService,loggerFactory:this._loggerModuleFactory});return{observable:t,cancel:i}}close(){this._updateDeviceStatus(h.DeviceStatus.NOT_CONNECTED),this._deviceState.complete(),this._deviceSessionRefresher.stopRefresher(),this._pinger.unsubscribe()}disableRefresher(e){return this._refresherService.disableRefresher(e)}_unsafeBypassIntentQueue(e){this._bypassIntentQueue=e}_updateDeviceStatus(e){const t=this._deviceState.getValue();this._deviceState.next({...t,deviceStatus:e})}}0&&(module.exports={DeviceSession});
|
|
2
2
|
//# sourceMappingURL=DeviceSession.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/model/DeviceSession.ts"],
|
|
4
|
-
"sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { BehaviorSubject, type Observable } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { type DmkError } from \"@api/Error\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { formatApduSendingLog } from \"@api/utils/apduLogs\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { MutexService } from \"@internal/device-session/service/MutexService\";\nimport { RefresherService } from \"@internal/device-session/service/RefresherService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { DevicePinger } from \"./DevicePinger\";\nimport {\n DeviceSessionEventDispatcher,\n SessionEvents,\n} from \"./DeviceSessionEventDispatcher\";\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\nimport { DeviceSessionStateHandler } from \"./DeviceSessionStateHandler\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\nexport type DeviceSessionRefresherOptions = {\n isRefresherDisabled: boolean;\n pollingInterval?: number;\n};\n\ntype SendApduOptions = {\n isPolling?: boolean;\n triggersDisconnection?: boolean;\n abortTimeout?: number;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _managerApiService: ManagerApiService;\n private readonly _secureChannelService: SecureChannelService;\n private readonly _logger: LoggerPublisherService;\n private readonly _refresherOptions: DeviceSessionRefresherOptions;\n private _pinger: DevicePinger;\n private _deviceSessionRefresher: DeviceSessionRefresher;\n private readonly _refresherService: RefresherService;\n private _commandMutex = new MutexService();\n private _sessionEventDispatcher = new DeviceSessionEventDispatcher();\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n secureChannelService: SecureChannelService,\n deviceSessionRefresherOptions: DeviceSessionRefresherOptions | undefined,\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._logger = loggerModuleFactory(\"device-session\");\n this._managerApiService = managerApiService;\n this._secureChannelService = secureChannelService;\n this._refresherOptions = {\n ...DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n ...deviceSessionRefresherOptions,\n };\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n });\n\n this._pinger = new DevicePinger(\n loggerModuleFactory,\n connectedDevice,\n this._sessionEventDispatcher,\n (command, abortTimeout) => this.sendCommand(command, abortTimeout),\n );\n this._deviceSessionRefresher = new DeviceSessionRefresher(\n loggerModuleFactory,\n this._refresherOptions,\n this._sessionEventDispatcher,\n this._connectedDevice,\n );\n new DeviceSessionStateHandler(\n loggerModuleFactory,\n this._sessionEventDispatcher,\n this._connectedDevice,\n this._deviceState,\n (state) => this.setDeviceSessionState(state),\n );\n\n this._refresherService = new RefresherService(loggerModuleFactory, {\n start: () => this._deviceSessionRefresher.restartRefresher(),\n stop: () => this._deviceSessionRefresher.stopRefresher(),\n });\n }\n\n public async initialiseSession(): Promise<void> {\n try {\n await this._pinger.ping();\n } catch (error) {\n this._logger.error(\"Error while initialising session\", {\n data: { error },\n });\n throw error;\n } finally {\n if (!this._refresherOptions.isRefresherDisabled) {\n this._deviceSessionRefresher.startRefresher();\n }\n }\n }\n\n public get id(): DeviceSessionId {\n return this._id;\n }\n\n public get connectedDevice(): TransportConnectedDevice {\n return this._connectedDevice;\n }\n\n public get state(): Observable<DeviceSessionState> {\n return this._deviceState.asObservable();\n }\n\n public getDeviceSessionState(): DeviceSessionState {\n return this._deviceState.getValue();\n }\n\n public setDeviceSessionState(state: DeviceSessionState): void {\n this._deviceState.next(state);\n }\n\n public async sendApdu(\n rawApdu: Uint8Array,\n options: SendApduOptions = {\n isPolling: false,\n triggersDisconnection: false,\n abortTimeout: undefined,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n const release = await this._commandMutex.lock();\n\n try {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_BUSY,\n });\n\n this._logger.debug(formatApduSendingLog(rawApdu));\n const result = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n options.abortTimeout,\n );\n\n result\n .ifRight((response: ApduResponse) => {\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n } else {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n }\n })\n .ifLeft(() => {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n });\n return result;\n } finally {\n release();\n }\n }\n\n public async sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n this._logger.debug(`[sendCommand] ${command.name}`);\n const apdu = command.getApdu();\n\n const response = await this.sendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n abortTimeout,\n });\n\n return response.caseOf({\n Left: (err) => {\n this._logger.error(\"[sendCommand] error\", { data: { err } });\n throw err;\n },\n Right: (r) => {\n const result = command.parseResponse(\n r,\n this._connectedDevice.deviceModel.id,\n );\n this._logger.debug(\"[sendCommand] result\", { data: { result } });\n return result;\n },\n });\n }\n\n public executeDeviceAction<\n Output,\n Input,\n E extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, E, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, E, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendApdu: async (apdu: Uint8Array) => this.sendApdu(apdu),\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n abortTimeout?: number,\n ) => this.sendCommand(command, abortTimeout),\n getDeviceModel: () => this._connectedDevice.deviceModel,\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n disableRefresher: (blockerId: string) =>\n this._refresherService.disableRefresher(blockerId),\n getManagerApiService: () => this._managerApiService,\n getSecureChannelService: () => this._secureChannelService,\n });\n return { observable, cancel };\n }\n\n public close(): void {\n this._updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._deviceSessionRefresher.stopRefresher();\n this._pinger.unsubscribe();\n }\n\n public disableRefresher(id: string): () => void {\n return this._refresherService.disableRefresher(id);\n }\n\n private _updateDeviceStatus(deviceStatus: DeviceStatus): void {\n const state = this._deviceState.getValue();\n this._deviceState.next({ ...state, deviceStatus });\n }\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,
|
|
6
|
-
"names": ["DeviceSession_exports", "__export", "DeviceSession", "__toCommonJS", "import_rxjs", "import_uuid", "import_CommandUtils", "import_DeviceStatus", "import_DeviceSessionState", "import_apduLogs", "import_DeviceSessionRefresherConst", "
|
|
4
|
+
"sourcesContent": ["import { type Either } from \"purify-ts\";\nimport {\n BehaviorSubject,\n from,\n lastValueFrom,\n type Observable,\n timeout,\n} from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { type DmkError } from \"@api/Error\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport {\n SendApduTimeoutError,\n SendCommandTimeoutError,\n} from \"@api/transport/model/Errors\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport {\n formatApduReceivedLog,\n formatApduSendingLog,\n} from \"@api/utils/apduLogs\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { IntentQueueService } from \"@internal/device-session/service/IntentQueueService\";\nimport { RefresherService } from \"@internal/device-session/service/RefresherService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { DevicePinger } from \"./DevicePinger\";\nimport {\n DeviceSessionEventDispatcher,\n SessionEvents,\n} from \"./DeviceSessionEventDispatcher\";\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\nimport { DeviceSessionStateHandler } from \"./DeviceSessionStateHandler\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\nexport type DeviceSessionRefresherOptions = {\n isRefresherDisabled: boolean;\n pollingInterval?: number;\n};\n\ntype SendApduOptions = {\n isPolling?: boolean;\n triggersDisconnection?: boolean;\n abortTimeout?: number;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _managerApiService: ManagerApiService;\n private readonly _secureChannelService: SecureChannelService;\n private readonly _logger: LoggerPublisherService;\n private readonly _loggerModuleFactory: (\n tag: string,\n ) => LoggerPublisherService;\n private readonly _refresherOptions: DeviceSessionRefresherOptions;\n private _pinger: DevicePinger;\n private _deviceSessionRefresher: DeviceSessionRefresher;\n private readonly _refresherService: RefresherService;\n private readonly _intentQueueService: IntentQueueService;\n private _sessionEventDispatcher = new DeviceSessionEventDispatcher();\n private _bypassIntentQueue: boolean = false;\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n secureChannelService: SecureChannelService,\n deviceSessionRefresherOptions: DeviceSessionRefresherOptions | undefined,\n intentQueueServiceFactory: (\n sessionEventDispatcher: DeviceSessionEventDispatcher,\n ) => IntentQueueService = (sessionEventDispatcher) =>\n new IntentQueueService(loggerModuleFactory, sessionEventDispatcher),\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._loggerModuleFactory = loggerModuleFactory;\n this._logger = loggerModuleFactory(\"device-session\");\n this._managerApiService = managerApiService;\n this._intentQueueService = intentQueueServiceFactory(\n this._sessionEventDispatcher,\n );\n this._secureChannelService = secureChannelService;\n this._refresherOptions = {\n ...DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n ...deviceSessionRefresherOptions,\n };\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n });\n\n this._pinger = new DevicePinger(\n loggerModuleFactory,\n connectedDevice,\n this._sessionEventDispatcher,\n (command, abortTimeout) => this.sendCommand(command, abortTimeout),\n );\n this._deviceSessionRefresher = new DeviceSessionRefresher(\n loggerModuleFactory,\n this._refresherOptions,\n this._sessionEventDispatcher,\n this._connectedDevice,\n );\n new DeviceSessionStateHandler(\n loggerModuleFactory,\n this._sessionEventDispatcher,\n this._connectedDevice,\n this._deviceState,\n (state) => this.setDeviceSessionState(state),\n );\n\n this._refresherService = new RefresherService(loggerModuleFactory, {\n start: () => this._deviceSessionRefresher.restartRefresher(),\n stop: () => this._deviceSessionRefresher.stopRefresher(),\n });\n }\n\n public async initialiseSession(): Promise<void> {\n try {\n if (this._refresherOptions.isRefresherDisabled) await this._pinger.ping();\n else this._deviceSessionRefresher.startRefresher();\n } catch (error) {\n this._logger.error(\"Error while initialising session\", {\n data: { error },\n });\n throw error;\n }\n }\n\n public get id(): DeviceSessionId {\n return this._id;\n }\n\n public get connectedDevice(): TransportConnectedDevice {\n return this._connectedDevice;\n }\n\n public get state(): Observable<DeviceSessionState> {\n return this._deviceState.asObservable();\n }\n\n public getDeviceSessionState(): DeviceSessionState {\n return this._deviceState.getValue();\n }\n\n public setDeviceSessionState(state: DeviceSessionState): void {\n this._deviceState.next(state);\n }\n\n public sendApdu(\n rawApdu: Uint8Array,\n options: SendApduOptions = {\n isPolling: false,\n triggersDisconnection: false,\n abortTimeout: undefined,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n // Bypass intent queue if flag is set\n if (this._bypassIntentQueue) {\n return this._unsafeInternalSendApdu(rawApdu, options);\n }\n return this._internalSendApdu(rawApdu, options);\n }\n\n private _internalSendApdu(\n rawApdu: Uint8Array,\n options: SendApduOptions,\n ): Promise<Either<DmkError, ApduResponse>> {\n const abortTimeout = options.abortTimeout;\n const beforeQueuedTimestamp = Date.now();\n const { observable, cancel } = this._intentQueueService.enqueue({\n type: \"send-apdu\",\n execute: () =>\n from(\n (async () => {\n const elapsedTime = Date.now() - beforeQueuedTimestamp;\n const result = await this._unsafeInternalSendApdu(rawApdu, {\n isPolling: options.isPolling,\n triggersDisconnection: options.triggersDisconnection,\n // Subtract the elapsed time to account for the time spent in the queue\n // to sync both observable and transport timeout\n abortTimeout: abortTimeout\n ? abortTimeout - elapsedTime\n : undefined,\n });\n return result;\n })(),\n ),\n });\n\n const timeoutObservable = abortTimeout\n ? observable.pipe(\n timeout({\n each: abortTimeout,\n with: () => {\n cancel();\n throw new SendApduTimeoutError();\n },\n }),\n )\n : observable;\n\n return lastValueFrom(timeoutObservable);\n }\n\n private async _unsafeInternalSendApdu(\n rawApdu: Uint8Array,\n options: SendApduOptions = {\n isPolling: false,\n triggersDisconnection: false,\n abortTimeout: undefined,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n this._logger.debug(formatApduSendingLog(rawApdu));\n const result = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n options.abortTimeout,\n );\n\n return result\n .ifRight((response: ApduResponse) => {\n this._logger.debug(formatApduReceivedLog(response));\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n } else {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n }\n })\n .ifLeft(() => {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_UNKNOWN,\n });\n });\n }\n\n public sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n this._logger.debug(`[sendCommand] ${command.name}`);\n\n // Bypass intent queue if flag is set\n if (this._bypassIntentQueue) {\n return this._unsafeInternalSendCommand(command, abortTimeout);\n }\n return this._internalSendCommand(command, abortTimeout);\n }\n\n private _internalSendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n const beforeQueuedTimestamp = Date.now();\n const { observable, cancel } = this._intentQueueService.enqueue({\n type: \"send-command\",\n execute: () =>\n from(\n (async () => {\n const elapsedTime = Date.now() - beforeQueuedTimestamp;\n const result = await this._unsafeInternalSendCommand(\n command,\n // Subtract the elapsed time to account for the time spent in the queue\n // to sync both observable and transport timeout\n abortTimeout ? abortTimeout - elapsedTime : undefined,\n );\n return result;\n })(),\n ),\n });\n\n const timeoutObservable = abortTimeout\n ? observable.pipe(\n timeout({\n each: abortTimeout,\n with: () => {\n cancel();\n throw new SendCommandTimeoutError();\n },\n }),\n )\n : observable;\n\n return lastValueFrom(timeoutObservable);\n }\n\n private async _unsafeInternalSendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n const apdu = command.getApdu();\n\n const response = await this._unsafeInternalSendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n abortTimeout,\n });\n\n return response.caseOf({\n Left: (err) => {\n this._logger.error(\"[sendCommand] error\", { data: { err } });\n throw err;\n },\n Right: (r) => {\n const result = command.parseResponse(\n r,\n this._connectedDevice.deviceModel.id,\n );\n this._logger.debug(\"[sendCommand] result\", { data: { result } });\n return result;\n },\n });\n }\n\n public executeDeviceAction<\n Output,\n Input,\n E extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, E, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, E, IntermediateValue> {\n // Bypass intent queue if flag is set\n if (this._bypassIntentQueue) {\n return this._unsafeInternalExecuteDeviceAction(deviceAction);\n }\n return this._internalExecuteDeviceAction(deviceAction);\n }\n\n private _internalExecuteDeviceAction<\n Output,\n Input,\n E extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, E, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, E, IntermediateValue> {\n let deviceActionCancel: (() => void) | undefined;\n\n const { observable: o, cancel: queueCancel } =\n this._intentQueueService.enqueue({\n type: \"device-action\",\n execute: () => {\n const { observable, cancel } =\n this._unsafeInternalExecuteDeviceAction(deviceAction);\n deviceActionCancel = cancel;\n return observable;\n },\n });\n\n return {\n observable: o,\n cancel: () => {\n deviceActionCancel?.();\n queueCancel();\n },\n };\n }\n\n private _unsafeInternalExecuteDeviceAction<\n Output,\n Input,\n E extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, E, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, E, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendApdu: async (apdu: Uint8Array) => this._unsafeInternalSendApdu(apdu), // note: there is no timeout handled at this stage\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n ) => this._unsafeInternalSendCommand(command), // note: there is no timeout handled at this stage\n getDeviceModel: () => this._connectedDevice.deviceModel,\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n getManagerApiService: () => this._managerApiService,\n getSecureChannelService: () => this._secureChannelService,\n loggerFactory: this._loggerModuleFactory,\n });\n\n return {\n observable,\n cancel,\n };\n }\n\n public close(): void {\n this._updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._deviceSessionRefresher.stopRefresher();\n this._pinger.unsubscribe();\n }\n\n public disableRefresher(id: string): () => void {\n return this._refresherService.disableRefresher(id);\n }\n\n public _unsafeBypassIntentQueue(bypass: boolean): void {\n this._bypassIntentQueue = bypass;\n }\n\n private _updateDeviceStatus(deviceStatus: DeviceStatus): void {\n const state = this._deviceState.getValue();\n this._deviceState.next({ ...state, deviceStatus });\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["DeviceSession_exports", "__export", "DeviceSession", "__toCommonJS", "import_rxjs", "import_uuid", "import_CommandUtils", "import_DeviceStatus", "import_DeviceSessionState", "import_Errors", "import_apduLogs", "import_DeviceSessionRefresherConst", "import_IntentQueueService", "import_RefresherService", "import_DevicePinger", "import_DeviceSessionEventDispatcher", "import_DeviceSessionRefresher", "import_DeviceSessionStateHandler", "connectedDevice", "id", "uuidv4", "loggerModuleFactory", "managerApiService", "secureChannelService", "deviceSessionRefresherOptions", "intentQueueServiceFactory", "sessionEventDispatcher", "command", "abortTimeout", "state", "error", "rawApdu", "options", "beforeQueuedTimestamp", "observable", "cancel", "elapsedTime", "timeoutObservable", "response", "apdu", "err", "r", "result", "deviceAction", "deviceActionCancel", "o", "queueCancel", "bypass", "deviceStatus"]
|
|
7
7
|
}
|