@ledgerhq/device-management-kit 0.0.0-rn-hid-improvements-20250523090318 → 0.0.0-rn-ble-pairing-removed-while-reconnecting-20250731133348
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/lib/cjs/src/api/DeviceManagementKit.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKit.js.map +3 -3
- package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
- package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
- package/lib/cjs/src/api/command/utils/CommandUtils.js +1 -1
- package/lib/cjs/src/api/command/utils/CommandUtils.js.map +2 -2
- package/lib/cjs/src/api/command/utils/CommandUtils.test.js +1 -1
- package/lib/cjs/src/api/command/utils/CommandUtils.test.js.map +2 -2
- package/lib/cjs/src/api/command/utils/GlobalCommandError.js +1 -1
- package/lib/cjs/src/api/command/utils/GlobalCommandError.js.map +2 -2
- 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 +2 -2
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +1 -1
- package/lib/cjs/src/api/device-action/os/Errors.js +1 -1
- package/lib/cjs/src/api/device-action/os/Errors.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/types.js.map +1 -1
- 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 +2 -2
- 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 +2 -2
- 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/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/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +1 -1
- 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 +2 -2
- 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 +1 -1
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +1 -1
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +2 -2
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +1 -1
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +2 -2
- package/lib/cjs/src/api/index.js +1 -1
- package/lib/cjs/src/api/index.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/GenuineCheck/types.js.map +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/types.js.map +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js +1 -1
- package/lib/cjs/src/api/secure-channel/device-action/UninstallApp/types.js.map +1 -1
- 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/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
- package/lib/cjs/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
- package/lib/cjs/src/api/secure-channel/task/types.js +1 -1
- package/lib/cjs/src/api/secure-channel/task/types.js.map +2 -2
- package/lib/cjs/src/api/secure-channel/utils.js +1 -1
- package/lib/cjs/src/api/secure-channel/utils.js.map +3 -3
- package/lib/cjs/src/api/secure-channel/utils.test.js +1 -1
- package/lib/cjs/src/api/secure-channel/utils.test.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 +2 -0
- package/lib/cjs/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
- 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/utils/AppName.js +2 -0
- package/lib/cjs/src/api/utils/AppName.js.map +7 -0
- package/lib/cjs/src/api/utils/AppName.test.js +2 -0
- package/lib/cjs/src/api/utils/AppName.test.js.map +7 -0
- package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +2 -2
- package/lib/cjs/src/internal/secure-channel/model/Errors.js +1 -1
- package/lib/cjs/src/internal/secure-channel/model/Errors.js.map +3 -3
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js +1 -1
- package/lib/cjs/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
- package/lib/esm/src/api/DeviceManagementKit.js +1 -1
- package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
- package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js +1 -1
- package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.js.map +3 -3
- package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js +1 -1
- package/lib/esm/src/api/apdu/utils/ByteArrayBuilder.test.js.map +2 -2
- package/lib/esm/src/api/command/utils/CommandUtils.js +1 -1
- package/lib/esm/src/api/command/utils/CommandUtils.js.map +3 -3
- package/lib/esm/src/api/command/utils/CommandUtils.test.js +1 -1
- package/lib/esm/src/api/command/utils/CommandUtils.test.js.map +2 -2
- package/lib/esm/src/api/command/utils/GlobalCommandError.js +1 -1
- package/lib/esm/src/api/command/utils/GlobalCommandError.js.map +2 -2
- 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 +2 -2
- package/lib/esm/src/api/device-action/os/Errors.js +1 -1
- package/lib/esm/src/api/device-action/os/Errors.js.map +3 -3
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +2 -2
- 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/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +1 -1
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +2 -2
- 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 +2 -2
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +1 -1
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +3 -3
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +1 -1
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.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/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js +1 -1
- package/lib/esm/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.js.map +2 -2
- package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js +1 -1
- package/lib/esm/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.js.map +2 -2
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js +1 -1
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.js.map +2 -2
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js +1 -1
- package/lib/esm/src/api/secure-channel/device-action/ListInstalledApps/types.js.map +2 -2
- package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js +1 -1
- package/lib/esm/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.js.map +2 -2
- 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/secure-channel/task/ConnectToSecureChannelTask.test.js +1 -1
- package/lib/esm/src/api/secure-channel/task/ConnectToSecureChannelTask.test.js.map +3 -3
- package/lib/esm/src/api/secure-channel/task/types.js +1 -1
- package/lib/esm/src/api/secure-channel/task/types.js.map +2 -2
- package/lib/esm/src/api/secure-channel/utils.js +1 -1
- package/lib/esm/src/api/secure-channel/utils.js.map +3 -3
- package/lib/esm/src/api/secure-channel/utils.test.js +1 -1
- package/lib/esm/src/api/secure-channel/utils.test.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 +2 -0
- package/lib/esm/src/api/transport/model/DeviceConnectionStateMachine.test.js.map +7 -0
- 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/AppName.js +2 -0
- package/lib/esm/src/api/utils/AppName.js.map +7 -0
- package/lib/esm/src/api/utils/AppName.test.js +2 -0
- package/lib/esm/src/api/utils/AppName.test.js.map +7 -0
- package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +2 -2
- package/lib/esm/src/internal/secure-channel/model/Errors.js +1 -1
- package/lib/esm/src/internal/secure-channel/model/Errors.js.map +3 -3
- package/lib/esm/src/internal/send/use-case/SendApduUseCase.js +1 -1
- package/lib/esm/src/internal/send/use-case/SendApduUseCase.js.map +3 -3
- package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts +28 -0
- package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
- package/lib/types/src/api/command/utils/CommandUtils.d.ts +3 -0
- package/lib/types/src/api/command/utils/CommandUtils.d.ts.map +1 -1
- package/lib/types/src/api/command/utils/GlobalCommandError.d.ts +1 -1
- package/lib/types/src/api/command/utils/GlobalCommandError.d.ts.map +1 -1
- package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts +1 -0
- 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 +0 -1
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/Errors.d.ts +10 -0
- package/lib/types/src/api/device-action/os/Errors.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 +2 -1
- 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/GoToDashboard/GoToDashboardDeviceAction.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 +3 -2
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/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 +0 -1
- 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 +0 -1
- 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 +0 -1
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
- package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts +2 -2
- package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -1
- package/lib/types/src/api/index.d.ts +1 -1
- package/lib/types/src/api/index.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts +2 -1
- package/lib/types/src/api/secure-channel/device-action/GenuineCheck/types.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts +2 -1
- package/lib/types/src/api/secure-channel/device-action/InstallApp/types.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts +2 -1
- package/lib/types/src/api/secure-channel/device-action/ListInstalledApps/types.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts +2 -1
- package/lib/types/src/api/secure-channel/device-action/UninstallApp/types.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts +5 -2
- package/lib/types/src/api/secure-channel/task/ConnectToSecureChannelTask.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/task/types.d.ts +6 -1
- package/lib/types/src/api/secure-channel/task/types.d.ts.map +1 -1
- package/lib/types/src/api/secure-channel/utils.d.ts +0 -11
- package/lib/types/src/api/secure-channel/utils.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts +8 -7
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts +2 -0
- package/lib/types/src/api/transport/model/DeviceConnectionStateMachine.test.d.ts.map +1 -0
- package/lib/types/src/api/transport/model/Errors.d.ts +0 -5
- package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
- package/lib/types/src/api/utils/AppName.d.ts +2 -0
- package/lib/types/src/api/utils/AppName.d.ts.map +1 -0
- package/lib/types/src/api/utils/AppName.test.d.ts +2 -0
- package/lib/types/src/api/utils/AppName.test.d.ts.map +1 -0
- package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
- package/lib/types/src/internal/secure-channel/model/Errors.d.ts +22 -2
- package/lib/types/src/internal/secure-channel/model/Errors.d.ts.map +1 -1
- package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts +5 -1
- package/lib/types/src/internal/send/use-case/SendApduUseCase.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.ts"],
|
4
|
-
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, setup } from \"xstate\";\n\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nimport { UnsupportedFirmwareDAError } from \"@api/device-action/os/Errors\";\nimport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nimport type { GetDeviceMetadataDAOutput } from \"@api/device-action/os/GetDeviceMetadata/types\";\nimport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nimport type { InstallOrUpdateAppsDAOutput } from \"@api/device-action/os/InstallOrUpdateApps/types\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\n\nimport {\n type OpenAppWithDependenciesDAError,\n type OpenAppWithDependenciesDAInput,\n type OpenAppWithDependenciesDAIntermediateValue,\n type OpenAppWithDependenciesDAOutput,\n} from \"./types\";\n\ntype OpenAppWithDependenciesMachineInternalState = {\n readonly error: OpenAppWithDependenciesDAError | null;\n readonly deviceMetadata: GetDeviceMetadataDAOutput | null;\n readonly installResult: InstallOrUpdateAppsDAOutput | null;\n};\n\nexport class OpenAppWithDependenciesDeviceAction extends XStateDeviceAction<\n OpenAppWithDependenciesDAOutput,\n OpenAppWithDependenciesDAInput,\n OpenAppWithDependenciesDAError,\n OpenAppWithDependenciesDAIntermediateValue,\n OpenAppWithDependenciesMachineInternalState\n> {\n makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n OpenAppWithDependenciesDAOutput,\n OpenAppWithDependenciesDAInput,\n OpenAppWithDependenciesDAError,\n OpenAppWithDependenciesDAIntermediateValue,\n OpenAppWithDependenciesMachineInternalState\n > {\n type types = StateMachineTypes<\n OpenAppWithDependenciesDAOutput,\n OpenAppWithDependenciesDAInput,\n OpenAppWithDependenciesDAError,\n OpenAppWithDependenciesDAIntermediateValue,\n OpenAppWithDependenciesMachineInternalState\n >;\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const getMetadataMachine = new GetDeviceMetadataDeviceAction({\n input: {\n unlockTimeout,\n useSecureChannel: true,\n forceUpdate: false,\n },\n }).makeStateMachine(internalApi);\n\n const installAppsMachine = new InstallOrUpdateAppsDeviceAction({\n input: {\n unlockTimeout,\n applications: [...this.input.dependencies, this.input.application],\n allowMissingApplication: false,\n },\n }).makeStateMachine(internalApi);\n\n const openAppMachine = new OpenAppDeviceAction({\n input: {\n unlockTimeout,\n appName: this.input.application.name,\n compatibleAppNames: this.input.compatibleAppNames,\n },\n }).makeStateMachine(internalApi);\n\n return setup({\n types: {\n input: {\n unlockTimeout,\n } as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n getMetadata: getMetadataMachine,\n installApps: installAppsMachine,\n openApp: openAppMachine,\n },\n guards: {\n hasError: ({ context }) => context._internalState.error !== null,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n id: \"OpenAppWithDependenciesDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n return {\n input: {\n application: _.input.application,\n dependencies: _.input.dependencies,\n compatibleAppNames: _.input.compatibleAppNames,\n requireLatestFirmware: _.input.requireLatestFirmware,\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n _internalState: {\n error: null,\n deviceMetadata: null,\n installResult: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: [\n {\n target: \"GetDeviceMetadata\",\n },\n ],\n },\n GetDeviceMetadata: {\n exit: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n invoke: {\n id: \"getMetadata\",\n src: \"getMetadata\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n useSecureChannel: true,\n forceUpdate: false,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"GetDeviceMetadataCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<OpenAppWithDependenciesMachineInternalState>(\n {\n Right: (data) => {\n if (\n _.context.input.requireLatestFirmware &&\n data.firmwareUpdateContext.availableUpdate !==\n undefined\n ) {\n return {\n ..._.context._internalState,\n error: new UnsupportedFirmwareDAError(\n \"Firmware is not the latest version\",\n ),\n };\n } else {\n return {\n ..._.context._internalState,\n deviceMetadata: data,\n };\n }\n },\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n },\n ),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetDeviceMetadataCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"InstallDependencies\",\n },\n ],\n },\n InstallDependencies: {\n exit: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n invoke: {\n src: \"installApps\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n applications: [\n ..._.context.input.dependencies,\n _.context.input.application,\n ],\n allowMissingApplication: false,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n installPlan:\n _.event.snapshot.context.intermediateValue.installPlan,\n }),\n }),\n },\n onDone: {\n target: \"InstallDependenciesCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<OpenAppWithDependenciesMachineInternalState>(\n {\n Right: (data) => ({\n ..._.context._internalState,\n installResult: data,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n },\n ),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n InstallDependenciesCheck: {\n always: [\n {\n guard: \"hasError\",\n target: \"Error\",\n },\n {\n target: \"OpenApp\",\n },\n ],\n },\n OpenApp: {\n exit: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n invoke: {\n src: \"openApp\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n appName: _.context.input.application.name,\n compatibleAppNames: this.input.compatibleAppNames,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n installPlan: null,\n }),\n }),\n },\n onDone: {\n target: \"OpenAppCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<OpenAppWithDependenciesMachineInternalState>(\n {\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n },\n ),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n OpenAppCheck: {\n always: [\n {\n guard: \"hasError\",\n target: \"Error\",\n },\n {\n target: \"Success\",\n },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (args) => {\n const { context } = args;\n const { error, deviceMetadata, installResult } = context._internalState;\n if (error) {\n return Left(error);\n }\n return Right({\n deviceMetadata: deviceMetadata!,\n installResult: installResult!,\n });\n },\n });\n }\n}\n"],
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA8B,kBAG9BC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAA2C,wCAC3CC,EAA8C,iFAE9CC,EAAgD,qFAEhDC,EAAoC,yEAEpCC,EAGO,8DAeA,MAAMV,UAA4C,oBAMvD,CACA,iBACEW,EAOA,CASA,MAAMC,EAAgB,KAAK,MAAM,eAAiB,4BAE5CC,EAAqB,IAAI,gCAA8B,CAC3D,MAAO,CACL,cAAAD,EACA,iBAAkB,GAClB,YAAa,EACf,CACF,CAAC,EAAE,iBAAiBD,CAAW,EAEzBG,EAAqB,IAAI,kCAAgC,CAC7D,MAAO,CACL,cAAAF,EACA,aAAc,CAAC,GAAG,KAAK,MAAM,aAAc,KAAK,MAAM,WAAW,EACjE,wBAAyB,EAC3B,CACF,CAAC,EAAE,iBAAiBD,CAAW,EAEzBI,EAAiB,IAAI,sBAAoB,CAC7C,MAAO,CACL,cAAAH,EACA,QAAS,KAAK,MAAM,YAAY,
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, setup } from \"xstate\";\n\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nimport { UnsupportedFirmwareDAError } from \"@api/device-action/os/Errors\";\nimport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nimport type { GetDeviceMetadataDAOutput } from \"@api/device-action/os/GetDeviceMetadata/types\";\nimport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nimport type { InstallOrUpdateAppsDAOutput } from \"@api/device-action/os/InstallOrUpdateApps/types\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\n\nimport {\n type OpenAppWithDependenciesDAError,\n type OpenAppWithDependenciesDAInput,\n type OpenAppWithDependenciesDAIntermediateValue,\n type OpenAppWithDependenciesDAOutput,\n} from \"./types\";\n\ntype OpenAppWithDependenciesMachineInternalState = {\n readonly error: OpenAppWithDependenciesDAError | null;\n readonly deviceMetadata: GetDeviceMetadataDAOutput | null;\n readonly installResult: InstallOrUpdateAppsDAOutput | null;\n};\n\nexport class OpenAppWithDependenciesDeviceAction extends XStateDeviceAction<\n OpenAppWithDependenciesDAOutput,\n OpenAppWithDependenciesDAInput,\n OpenAppWithDependenciesDAError,\n OpenAppWithDependenciesDAIntermediateValue,\n OpenAppWithDependenciesMachineInternalState\n> {\n makeStateMachine(\n internalApi: InternalApi,\n ): DeviceActionStateMachine<\n OpenAppWithDependenciesDAOutput,\n OpenAppWithDependenciesDAInput,\n OpenAppWithDependenciesDAError,\n OpenAppWithDependenciesDAIntermediateValue,\n OpenAppWithDependenciesMachineInternalState\n > {\n type types = StateMachineTypes<\n OpenAppWithDependenciesDAOutput,\n OpenAppWithDependenciesDAInput,\n OpenAppWithDependenciesDAError,\n OpenAppWithDependenciesDAIntermediateValue,\n OpenAppWithDependenciesMachineInternalState\n >;\n\n const unlockTimeout = this.input.unlockTimeout ?? DEFAULT_UNLOCK_TIMEOUT_MS;\n\n const getMetadataMachine = new GetDeviceMetadataDeviceAction({\n input: {\n unlockTimeout,\n useSecureChannel: true,\n forceUpdate: false,\n },\n }).makeStateMachine(internalApi);\n\n const installAppsMachine = new InstallOrUpdateAppsDeviceAction({\n input: {\n unlockTimeout,\n applications: [...this.input.dependencies, this.input.application],\n allowMissingApplication: false,\n },\n }).makeStateMachine(internalApi);\n\n const openAppMachine = new OpenAppDeviceAction({\n input: {\n unlockTimeout,\n appName: this.input.application.name,\n },\n }).makeStateMachine(internalApi);\n\n return setup({\n types: {\n input: {\n unlockTimeout,\n } as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n getMetadata: getMetadataMachine,\n installApps: installAppsMachine,\n openApp: openAppMachine,\n },\n guards: {\n hasError: ({ context }) => context._internalState.error !== null,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n id: \"OpenAppWithDependenciesDeviceAction\",\n initial: \"DeviceReady\",\n context: (_) => {\n return {\n input: {\n application: _.input.application,\n dependencies: _.input.dependencies,\n requireLatestFirmware: _.input.requireLatestFirmware,\n unlockTimeout: _.input.unlockTimeout,\n },\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n _internalState: {\n error: null,\n deviceMetadata: null,\n installResult: null,\n },\n };\n },\n states: {\n DeviceReady: {\n always: [\n {\n target: \"GetDeviceMetadata\",\n },\n ],\n },\n GetDeviceMetadata: {\n exit: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n invoke: {\n id: \"getMetadata\",\n src: \"getMetadata\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n useSecureChannel: true,\n forceUpdate: false,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n }),\n }),\n },\n onDone: {\n target: \"GetDeviceMetadataCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<OpenAppWithDependenciesMachineInternalState>(\n {\n Right: (data) => {\n if (\n _.context.input.requireLatestFirmware &&\n data.firmwareUpdateContext.availableUpdate !==\n undefined\n ) {\n return {\n ..._.context._internalState,\n error: new UnsupportedFirmwareDAError(\n \"Firmware is not the latest version\",\n ),\n };\n } else {\n return {\n ..._.context._internalState,\n deviceMetadata: data,\n };\n }\n },\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n },\n ),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n GetDeviceMetadataCheck: {\n always: [\n {\n target: \"Error\",\n guard: \"hasError\",\n },\n {\n target: \"InstallDependencies\",\n },\n ],\n },\n InstallDependencies: {\n exit: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n invoke: {\n src: \"installApps\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n applications: [\n ..._.context.input.dependencies,\n _.context.input.application,\n ],\n allowMissingApplication: false,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n installPlan:\n _.event.snapshot.context.intermediateValue.installPlan,\n }),\n }),\n },\n onDone: {\n target: \"InstallDependenciesCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<OpenAppWithDependenciesMachineInternalState>(\n {\n Right: (data) => ({\n ..._.context._internalState,\n installResult: data,\n }),\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n },\n ),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n InstallDependenciesCheck: {\n always: [\n {\n guard: \"hasError\",\n target: \"Error\",\n },\n {\n target: \"OpenApp\",\n },\n ],\n },\n OpenApp: {\n exit: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction: UserInteractionRequired.None,\n }),\n }),\n invoke: {\n src: \"openApp\",\n input: (_) => ({\n unlockTimeout: _.context.input.unlockTimeout,\n appName: _.context.input.application.name,\n }),\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) => ({\n ..._.context.intermediateValue,\n requiredUserInteraction:\n _.event.snapshot.context.intermediateValue\n .requiredUserInteraction,\n installPlan: null,\n }),\n }),\n },\n onDone: {\n target: \"OpenAppCheck\",\n actions: assign({\n _internalState: (_) =>\n _.event.output.caseOf<OpenAppWithDependenciesMachineInternalState>(\n {\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n },\n ),\n }),\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n OpenAppCheck: {\n always: [\n {\n guard: \"hasError\",\n target: \"Error\",\n },\n {\n target: \"Success\",\n },\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: (args) => {\n const { context } = args;\n const { error, deviceMetadata, installResult } = context._internalState;\n if (error) {\n return Left(error);\n }\n return Right({\n deviceMetadata: deviceMetadata!,\n installResult: installResult!,\n });\n },\n });\n }\n}\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA8B,kBAG9BC,EAAwC,4DACxCC,EAA0C,uCAC1CC,EAA2C,wCAC3CC,EAA8C,iFAE9CC,EAAgD,qFAEhDC,EAAoC,yE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P,KAAM,OACR,EACA,MAAO,CACL,KAAM,OACR,CACF,EACA,OAASC,GAAS,CAChB,KAAM,CAAE,QAAAJ,CAAQ,EAAII,EACd,CAAE,MAAAD,EAAO,eAAAE,EAAgB,cAAAC,CAAc,EAAIN,EAAQ,eACzD,OAAIG,KACK,QAAKA,CAAK,KAEZ,SAAM,CACX,eAAgBE,EAChB,cAAeC,CACjB,CAAC,CACH,CACF,CAAC,CACH,CACF",
|
6
6
|
"names": ["OpenAppWithDependenciesDeviceAction_exports", "__export", "OpenAppWithDependenciesDeviceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_UserInteractionRequired", "import_Const", "import_Errors", "import_GetDeviceMetadataDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_OpenAppDeviceAction", "import_XStateDeviceAction", "internalApi", "unlockTimeout", "getMetadataMachine", "installAppsMachine", "openAppMachine", "context", "_", "data", "error", "args", "deviceMetadata", "installResult"]
|
7
7
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/OpenAppWithDependencies/types.ts"],
|
4
|
-
"sourcesContent": ["import type { CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport type { DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport type {\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nimport type {\n GetDeviceMetadataDAOutput,\n GetDeviceMetadataDARequiredInteraction,\n} from \"@api/device-action/os/GetDeviceMetadata/types\";\nimport type { GetDeviceStatusDAInput } from \"@api/device-action/os/GetDeviceStatus/types\";\nimport type {\n ApplicationDependency,\n InstallOrUpdateAppsDAError,\n InstallOrUpdateAppsDAOutput,\n InstallOrUpdateAppsDARequiredInteraction,\n InstallPlan,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nimport type {\n OpenAppDAError,\n OpenAppDARequiredInteraction,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\n\nexport type OpenAppWithDependenciesDAOutput = {\n deviceMetadata: GetDeviceMetadataDAOutput;\n installResult: InstallOrUpdateAppsDAOutput;\n};\n\nexport type OpenAppWithDependenciesDAInput = GetDeviceStatusDAInput & {\n readonly application: ApplicationDependency;\n readonly dependencies: ApplicationDependency[];\n readonly
|
4
|
+
"sourcesContent": ["import type { CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport type { DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport type {\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nimport type {\n GetDeviceMetadataDAOutput,\n GetDeviceMetadataDARequiredInteraction,\n} from \"@api/device-action/os/GetDeviceMetadata/types\";\nimport type { GetDeviceStatusDAInput } from \"@api/device-action/os/GetDeviceStatus/types\";\nimport type {\n ApplicationDependency,\n InstallOrUpdateAppsDAError,\n InstallOrUpdateAppsDAOutput,\n InstallOrUpdateAppsDARequiredInteraction,\n InstallPlan,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nimport type {\n OpenAppDAError,\n OpenAppDARequiredInteraction,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\n\nexport type OpenAppWithDependenciesDAOutput = {\n deviceMetadata: GetDeviceMetadataDAOutput;\n installResult: InstallOrUpdateAppsDAOutput;\n};\n\nexport type OpenAppWithDependenciesDAInput = GetDeviceStatusDAInput & {\n readonly application: ApplicationDependency;\n readonly dependencies: ApplicationDependency[];\n readonly requireLatestFirmware?: boolean;\n};\n\nexport type OpenAppWithDependenciesDAError =\n | InstallOrUpdateAppsDAError\n | OpenAppDAError\n | UnknownDAError\n | UnsupportedFirmwareDAError\n | CommandErrorResult[\"error\"];\n\nexport type OpenAppWithDependenciesDARequiredInteraction =\n | GetDeviceMetadataDARequiredInteraction\n | InstallOrUpdateAppsDARequiredInteraction\n | OpenAppDARequiredInteraction;\n\nexport type OpenAppWithDependenciesDAIntermediateValue = {\n requiredUserInteraction: OpenAppWithDependenciesDARequiredInteraction;\n installPlan: InstallPlan | null;\n};\n\nexport type OpenAppWithDependenciesDAState = DeviceActionState<\n OpenAppWithDependenciesDAOutput,\n OpenAppWithDependenciesDAError,\n OpenAppWithDependenciesDAIntermediateValue\n>;\n"],
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
6
6
|
"names": ["types_exports", "__toCommonJS"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var
|
1
|
+
"use strict";var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var I=(o,n)=>{for(var a in n)p(o,a,{get:n[a],enumerable:!0})},l=(o,n,a,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of A(n))!S.call(o,r)&&r!==a&&p(o,r,{get:()=>n[r],enumerable:!(e=u(n,r))||e.enumerable});return o};var D=o=>l(p({},"__esModule",{value:!0}),o);var R={};I(R,{SendCommandInAppDeviceAction:()=>E});module.exports=D(R);var m=require("purify-ts"),t=require("xstate"),i=require("../../../command/model/CommandResult"),d=require("../../../device-action/model/UserInteractionRequired"),s=require("../../../device-action/os/Errors"),C=require("../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),c=require("../../../device-action/xstate-utils/XStateDeviceAction");class E extends c.XStateDeviceAction{makeStateMachine(n){const{sendCommand:a}=this.extractDependencies(n);return(0,t.setup)({types:{input:{},context:{},output:{}},actors:{sendCommand:(0,t.fromPromise)(a),openAppStateMachine:new C.OpenAppDeviceAction({input:{appName:this.input.appName}}).makeStateMachine(n)},guards:{skipOpenApp:()=>this.input.skipOpenApp,noInternalError:({context:e})=>e._internalState.error===null},actions:{assignErrorFromEvent:(0,t.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"SendCommandInAppDeviceAction",initial:"InitialState",context:({input:e})=>({input:e,intermediateValue:{requiredUserInteraction:d.UserInteractionRequired.None},_internalState:{commandResponse:null,error:null}}),states:{InitialState:{always:[{target:"SendCommand",guard:"skipOpenApp"},"OpenAppDeviceAction"]},OpenAppDeviceAction:{invoke:{id:"openAppStateMachine",input:{appName:this.input.appName},src:"openAppStateMachine",onSnapshot:{actions:(0,t.assign)({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{actions:(0,t.assign)({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:r=>({...e.context._internalState,error:r})})}),target:"CheckOpenAppDeviceActionResult"}}},CheckOpenAppDeviceActionResult:{always:[{target:"SendCommand",guard:"noInternalError"},"Error"]},SendCommand:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:this.input.requiredUserInteraction}}),exit:(0,t.assign)({intermediateValue:{requiredUserInteraction:d.UserInteractionRequired.None}}),invoke:{id:"sendCommand",src:"sendCommand",input:({context:e})=>e.input.command,onDone:{target:"SendCommandResultCheck",actions:[(0,t.assign)({_internalState:({event:e,context:r})=>(0,i.isSuccessCommandResult)(e.output)?{...r._internalState,commandResponse:e.output.data}:{...r._internalState,error:e.output.error}})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},SendCommandResultCheck:{always:[{target:"Success",guard:"noInternalError"},"Error"]},Success:{type:"final"},Error:{type:"final"}},output:({context:e})=>e._internalState.commandResponse?(0,m.Right)(e._internalState.commandResponse):(0,m.Left)(e._internalState.error||new s.UnknownDAError("No error in final state"))})}extractDependencies(n){return{sendCommand:a=>n.sendCommand(a.input)}}}0&&(module.exports={SendCommandInAppDeviceAction});
|
2
2
|
//# sourceMappingURL=SendCommandInAppDeviceAction.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.ts"],
|
4
|
-
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromPromise, setup } from \"xstate\";\n\nimport {\n type CommandResult,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nimport { type Command } from \"@api/types\";\n\nimport {\n type SendCommandInAppDAError,\n type SendCommandInAppDAInput,\n type SendCommandInAppDAIntermediateValue,\n type SendCommandInAppDAInternalState,\n type SendCommandInAppDAOutput,\n} from \"./SendCommandInAppDeviceActionTypes\";\n\n/**\n * Tries to open an app on the device, and if it is successful, sends a command\n * to the app.\n * The output will be the result of the command.\n *\n * ```ts\n * input: {\n * appName: string;\n * command: Command<CommandResult, CommandArgs>;\n * requiredUserInteraction: UserInteraction;\n * }\n * ```\n *\n * Example of usage:\n *\n * ```ts\n * const deviceAction = new SendCommandInAppDeviceAction({\n * input: {\n * appName: \"MyApp\",\n * command: new MyAppSpecificCommand({commandSpecificArg: \"foo\"}),\n * requiredUserInteraction: UserInteractionRequired.None,\n * },\n * });\n * dmk.executeDeviceAction({ sessionId: \"mySessionId\", deviceAction });\n * ```\n */\nexport class SendCommandInAppDeviceAction<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction extends UserInteractionRequired,\n> extends XStateDeviceAction<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n > {\n type types = StateMachineTypes<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n >;\n\n const { sendCommand } = this.extractDependencies(internalAPI);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n sendCommand: fromPromise(sendCommand),\n openAppStateMachine: new OpenAppDeviceAction({\n input: {\n appName: this.input.appName,\n
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2C,kBAE3CC,EAGO,4CAEPC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAAoC,yEAEpCC,EAGO,8DAqCA,MAAMR,UAKH,oBAWR,CACA,iBACES,EAYA,CAcA,KAAM,CAAE,YAAAC,CAAY,EAAI,KAAK,oBAAoBD,CAAW,EAE5D,SAAO,SAAM,CACX,MAAO,CACL,MAAO,CAAC,EACR,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,eAAa,eAAYC,CAAW,EACpC,oBAAqB,IAAI,sBAAoB,CAC3C,MAAO,CACL,QAAS,KAAK,MAAM,
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromPromise, setup } from \"xstate\";\n\nimport {\n type CommandResult,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nimport { type Command } from \"@api/types\";\n\nimport {\n type SendCommandInAppDAError,\n type SendCommandInAppDAInput,\n type SendCommandInAppDAIntermediateValue,\n type SendCommandInAppDAInternalState,\n type SendCommandInAppDAOutput,\n} from \"./SendCommandInAppDeviceActionTypes\";\n\n/**\n * Tries to open an app on the device, and if it is successful, sends a command\n * to the app.\n * The output will be the result of the command.\n *\n * ```ts\n * input: {\n * appName: string;\n * command: Command<CommandResult, CommandArgs>;\n * requiredUserInteraction: UserInteraction;\n * }\n * ```\n *\n * Example of usage:\n *\n * ```ts\n * const deviceAction = new SendCommandInAppDeviceAction({\n * input: {\n * appName: \"MyApp\",\n * command: new MyAppSpecificCommand({commandSpecificArg: \"foo\"}),\n * requiredUserInteraction: UserInteractionRequired.None,\n * },\n * });\n * dmk.executeDeviceAction({ sessionId: \"mySessionId\", deviceAction });\n * ```\n */\nexport class SendCommandInAppDeviceAction<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction extends UserInteractionRequired,\n> extends XStateDeviceAction<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n > {\n type types = StateMachineTypes<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n >;\n\n const { sendCommand } = this.extractDependencies(internalAPI);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n sendCommand: fromPromise(sendCommand),\n openAppStateMachine: new OpenAppDeviceAction({\n input: {\n appName: this.input.appName,\n },\n }).makeStateMachine(internalAPI),\n },\n guards: {\n skipOpenApp: () => this.input.skipOpenApp,\n noInternalError: ({ context }) => context._internalState.error === null,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QFEAuALA0mAngJwEsA7KAcTFQEEII85YARMANwIGMxK3UCB7IgHQB5AA5gilESKasOXHvwDEEfmAHFmvANZreYiVIDKqAIaowAWRNt0xMAG0ADAF1EoEb1gEFRNyAAeiACMQQDsAgAcACwAzKEArABMUfGpEQCcEYkANCA4iFGO8QKhjokxERUpQenp8QC+9bloWLiEJORUNHSwjCzsnNx8ggDC6GBsWqLiktL9ckP8AEpwAK4ANqiKTq5IIB5ePn6BCEFR4YkAbKE1Zemh55URufkI8fcC8TGXl0EVoelHJcio1mhhsPhiGQKNRaPQZAN5MMBGMJlN9LMEQsfCtYBstvYgrt3J5vMNjgUQgJLokHlEgldko50rEXoh3uEvj8-hEAUCQU0QC0Ie1oV04b0sYMfAJOrCerARrwALbKkxECDKVTqIiaHQCGDihVK1XqiA7PwHMn8CmnRJBASOFIxKJXJ21GLpHJ5RARGoCEL3CKXDLpS4pCKgoXgtpQuXdeHzaXI+MSxUqtUaxRgPB4Xh4AQidZmABm+eVBphCd6Jsz5pcltJRz2Jyiv0dvIeNJi8UqoWePoQIccn3iId+sSqkajRF4EDgfmFsY6VbTUqRNr2VuboBOAFpLmzTpd0iV+0EkkEylcAVEo0vISujYnZMn+MIMVJ14tfFum+SWwKb1XkSMdIhuQFEidYNSjvQUH1FVMFW-GVUUmaYDDmV8NyIXF8UbQ4AN3X0ogEF17S9eJQhiJ0ojbI8khHc54mvRwGUBXl7xjR8xXlF9ER-WVV2NDMzQI61f2IhBXUdRw5NDX54gvXkjx+CIzxuMdfnKd44LBVoeKQ-jsWRQxVjYDhenEncAmCcMBHKBlqKyIEYivGIjzDGJqQSYMamDa4BX0kU42E4y30EZBc3zayiNshBSmKFjqn7GCMgHV57lIz0aT9P0lL+S5GkaIA */\n id: \"SendCommandInAppDeviceAction\",\n initial: \"InitialState\",\n context: ({ input }) => {\n return {\n input: input,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n commandResponse: null,\n error: null,\n },\n };\n },\n states: {\n InitialState: {\n always: [\n {\n target: \"SendCommand\",\n guard: \"skipOpenApp\",\n },\n \"OpenAppDeviceAction\",\n ],\n },\n OpenAppDeviceAction: {\n invoke: {\n id: \"openAppStateMachine\",\n input: {\n appName: this.input.appName,\n },\n src: \"openAppStateMachine\",\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) =>\n _.event.snapshot.context.intermediateValue,\n }),\n },\n onDone: {\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<\n SendCommandInAppDAInternalState<\n CommandResponse,\n CommandErrorCodes\n >\n >({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n target: \"CheckOpenAppDeviceActionResult\",\n },\n },\n },\n CheckOpenAppDeviceActionResult: {\n always: [\n {\n target: \"SendCommand\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n SendCommand: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: this.input.requiredUserInteraction,\n },\n }),\n exit: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n }),\n invoke: {\n id: \"sendCommand\",\n src: \"sendCommand\",\n input: ({ context }) => context.input.command,\n onDone: {\n target: \"SendCommandResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n commandResponse: event.output.data,\n };\n }\n return {\n ...context._internalState,\n error: event.output.error,\n };\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n SendCommandResultCheck: {\n always: [\n {\n target: \"Success\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.commandResponse\n ? Right(context._internalState.commandResponse)\n : Left(\n context._internalState.error ||\n new UnknownDAError(\"No error in final state\"),\n ),\n });\n }\n\n extractDependencies(internalApi: InternalApi) {\n return {\n sendCommand: (_: {\n input: Command<CommandResponse, CommandArgs, CommandErrorCodes>;\n }): Promise<CommandResult<CommandResponse, CommandErrorCodes>> =>\n internalApi.sendCommand(_.input),\n };\n }\n}\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2C,kBAE3CC,EAGO,4CAEPC,EAAwC,4DACxCC,EAA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AE,CACF,EACF,CAAC,CAEL,CAAC,EACD,OAAQ,gCACV,CACF,CACF,EACA,+BAAgC,CAC9B,OAAQ,CACN,CACE,OAAQ,cACR,MAAO,iBACT,EACA,OACF,CACF,EACA,YAAa,CACX,SAAO,UAAO,CACZ,kBAAmB,CACjB,wBAAyB,KAAK,MAAM,uBACtC,CACF,CAAC,EACD,QAAM,UAAO,CACX,kBAAmB,CACjB,wBAAyB,0BAAwB,IACnD,CACF,CAAC,EACD,OAAQ,CACN,GAAI,cACJ,IAAK,cACL,MAAO,CAAC,CAAE,QAAAH,CAAQ,IAAMA,EAAQ,MAAM,QACtC,OAAQ,CACN,OAAQ,yBACR,QAAS,IACP,UAAO,CACL,eAAgB,CAAC,CAAE,MAAAI,EAAO,QAAAJ,CAAQ,OAC5B,0BAAuBI,EAAM,MAAM,EAC9B,CACL,GAAGJ,EAAQ,eACX,gBAAiBI,EAAM,OAAO,IAChC,EAEK,CACL,GAAGJ,EAAQ,eACX,MAAOI,EAAM,OAAO,KACtB,CAEJ,CAAC,CACH,CACF,EACA,QAAS,CACP,OAAQ,QACR,QAAS,sBACX,CACF,CACF,EACA,uBAAwB,CACtB,OAAQ,CACN,CACE,OAAQ,UACR,MAAO,iBACT,EACA,OACF,CACF,EACA,QAAS,CACP,KAAM,OACR,EACA,MAAO,CACL,KAAM,OACR,CACF,EACA,OAAQ,CAAC,CAAE,QAAAJ,CAAQ,IACjBA,EAAQ,eAAe,mBACnB,SAAMA,EAAQ,eAAe,eAAe,KAC5C,QACEA,EAAQ,eAAe,OACrB,IAAI,iBAAe,yBAAyB,CAChD,CACR,CAAC,CACH,CAEA,oBAAoBK,EAA0B,CAC5C,MAAO,CACL,YAAcJ,GAGZI,EAAY,YAAYJ,EAAE,KAAK,CACnC,CACF,CACF",
|
6
6
|
"names": ["SendCommandInAppDeviceAction_exports", "__export", "SendCommandInAppDeviceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_CommandResult", "import_UserInteractionRequired", "import_Errors", "import_OpenAppDeviceAction", "import_XStateDeviceAction", "internalAPI", "sendCommand", "context", "_", "input", "error", "event", "internalApi"]
|
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 a=Object.getOwnPropertyNames;var t=Object.prototype.hasOwnProperty;var s=(r,e,p,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of a(e))!t.call(r,o)&&o!==p&&m(r,o,{get:()=>e[o],enumerable:!(n=d(e,o))||n.enumerable});return r};var C=r=>s(m({},"__esModule",{value:!0}),r);var A={};module.exports=C(A);
|
2
2
|
//# sourceMappingURL=SendCommandInAppDeviceActionTypes.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.ts"],
|
4
|
-
"sourcesContent": ["import { type CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport {\n type OpenAppDAError,\n type OpenAppDAIntermediateValue,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\nimport { type Command } from \"@api/types\";\n\nexport type SendCommandInAppDAOutput<CommandResponse> = CommandResponse;\n\nexport type SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction,\n> = {\n readonly command: Command<CommandResponse, CommandArgs, CommandErrorCodes>;\n readonly appName: string;\n readonly skipOpenApp: boolean;\n readonly requiredUserInteraction: UserInteraction;\n
|
4
|
+
"sourcesContent": ["import { type CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport {\n type OpenAppDAError,\n type OpenAppDAIntermediateValue,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\nimport { type Command } from \"@api/types\";\n\nexport type SendCommandInAppDAOutput<CommandResponse> = CommandResponse;\n\nexport type SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction,\n> = {\n readonly command: Command<CommandResponse, CommandArgs, CommandErrorCodes>;\n readonly appName: string;\n readonly skipOpenApp: boolean;\n readonly requiredUserInteraction: UserInteraction;\n};\n\nexport type SendCommandInAppDAError<CommandErrorCodes = void> =\n | OpenAppDAError\n | CommandErrorResult<CommandErrorCodes>[\"error\"];\n\nexport type SendCommandInAppDAIntermediateValue<UserInteraction> =\n | { readonly requiredUserInteraction: UserInteraction }\n | OpenAppDAIntermediateValue;\n\nexport type SendCommandInAppDAInternalState<\n CommandResponse,\n CommandErrorCodes,\n> = {\n readonly commandResponse: CommandResponse | null;\n readonly error: SendCommandInAppDAError<CommandErrorCodes> | null;\n};\n"],
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
6
6
|
"names": ["SendCommandInAppDeviceActionTypes_exports", "__toCommonJS"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var c=Object.defineProperty;var
|
1
|
+
"use strict";var c=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var I=(r,e)=>{for(var n in e)c(r,n,{get:e[n],enumerable:!0})},y=(r,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of v(e))!g.call(r,i)&&i!==n&&c(r,i,{get:()=>e[i],enumerable:!(a=A(e,i))||a.enumerable});return r};var M=r=>y(c({},"__esModule",{value:!0}),r);var h={};I(h,{BuildAppsInstallPlanTask:()=>D});module.exports=M(h);var f=require("semver"),p=require("../../device-action/os/Errors"),u=require("../../device-session/DeviceSessionState");class D{constructor(e,n){this.api=e;this.args=n;const a=e.getDeviceModel();this.deviceModelId=a.id}deviceModelId;run(){const e=this.api.getDeviceSessionState();if(e.sessionStateType===u.DeviceSessionStateType.Connected)return{error:new p.UnknownDAError("Invalid device state")};if(e.catalog===void 0)return{error:new p.UnknownDAError("Device apps metadata not fetched")};let n=[],a=[],i=[];for(const t of this.args.applications){const o=e.catalog.applications.find(s=>s.versionName===t.name),l=e.installedApps.find(s=>s.versionName===t.name);if(l!==void 0&&this.validateConstraint(l,o,t.constraints)){a=[...a,t.name];continue}if(o!==void 0&&this.validateConstraint(o,void 0,t.constraints))n=[...n,o];else if(this.args.allowMissingApplication)i=[...i,t.name];else return o!==void 0?{error:new p.UnsupportedFirmwareDAError(`Application ${t.name} not found in the catalog`)}:{error:new p.UnknownDAError(`Application ${t.name} not found in the catalog`)}}return n=[...n.reduce((t,o)=>{const l=o.parentName;if(l){const s=e.catalog.applications.find(d=>d.versionName===l),m=e.installedApps.find(d=>d.versionName===l);if(s&&!m)return[...t,s]}return t},[]),...n],{installPlan:n.filter((t,o)=>n.findIndex(l=>l.versionName===t.versionName)===o),missingApplications:i,alreadyInstalled:a}}validateConstraint(e,n,a){if(a===void 0)return!0;for(const i of a)if(!(i.exemptModels!==void 0&&i.exemptModels.includes(this.deviceModelId))&&!(i.applicableModels!==void 0&&!i.applicableModels.includes(this.deviceModelId)))return i.minVersion==="latest"?!n||(0,f.gte)(e.version,n.version):(0,f.gte)(e.version,i.minVersion);return!0}}0&&(module.exports={BuildAppsInstallPlanTask});
|
2
2
|
//# sourceMappingURL=BuildAppsInstallPlanTask.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-action/task/BuildAppsInstallPlanTask.ts"],
|
4
|
-
"sourcesContent": ["import { gte } from \"semver\";\n\nimport type { DeviceModelId } from \"@api/device/DeviceModel\";\nimport type { InternalApi } from \"@api/device-action/DeviceAction\";\nimport {
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAoB,kBAIpBC,
|
4
|
+
"sourcesContent": ["import { gte } from \"semver\";\n\nimport type { DeviceModelId } from \"@api/device/DeviceModel\";\nimport type { InternalApi } from \"@api/device-action/DeviceAction\";\nimport {\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nimport type {\n ApplicationConstraint,\n ApplicationDependency,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\nimport type { Application } from \"@internal/manager-api/model/Application\";\n\nexport type BuildAppsInstallPlanTaskArgs = {\n /**\n * List of applications to install or update\n */\n readonly applications: ApplicationDependency[];\n\n /**\n * Indicates if the device action should fail if an application is missing from the app store.\n */\n readonly allowMissingApplication: boolean;\n};\n\nexport type BuildAppsInstallPlanTaskResult =\n | {\n installPlan: Application[];\n alreadyInstalled: string[];\n missingApplications: string[];\n }\n | {\n error: UnknownDAError | UnsupportedFirmwareDAError;\n };\n\nexport class BuildAppsInstallPlanTask {\n private readonly deviceModelId: DeviceModelId;\n\n constructor(\n private readonly api: InternalApi,\n private readonly args: BuildAppsInstallPlanTaskArgs,\n ) {\n const deviceModel = api.getDeviceModel();\n this.deviceModelId = deviceModel.id;\n }\n\n run(): BuildAppsInstallPlanTaskResult {\n // Get device session state.\n const deviceState = this.api.getDeviceSessionState();\n if (deviceState.sessionStateType === DeviceSessionStateType.Connected) {\n return { error: new UnknownDAError(\"Invalid device state\") };\n }\n\n // Ensure the device metadata were correctly fetched.\n if (deviceState.catalog === undefined) {\n return { error: new UnknownDAError(\"Device apps metadata not fetched\") };\n }\n\n // Build the install plan\n let installPlan: Application[] = [];\n let alreadyInstalled: string[] = [];\n let missingApplications: string[] = [];\n for (const app of this.args.applications) {\n // Get app entry from catalog and from installed apps\n const catalogApp = deviceState.catalog.applications.find(\n (a) => a.versionName === app.name,\n );\n const installedApp = deviceState.installedApps.find(\n (a) => a.versionName === app.name,\n );\n\n // If app is already installed, with validated constraints, continue the iteration\n if (\n installedApp !== undefined &&\n this.validateConstraint(installedApp, catalogApp, app.constraints)\n ) {\n alreadyInstalled = [...alreadyInstalled, app.name];\n continue;\n }\n\n // Handle the catalog application\n if (\n catalogApp !== undefined &&\n this.validateConstraint(catalogApp, undefined, app.constraints)\n ) {\n // Add the catalog application to the install plan\n installPlan = [...installPlan, catalogApp];\n } else if (this.args.allowMissingApplication) {\n missingApplications = [...missingApplications, app.name];\n } else {\n // Fail immediately if missing application is not allowed\n if (catalogApp !== undefined) {\n // Is application is found in the catalog in an old version,\n // it usually means the firmware is also outdated.\n return {\n error: new UnsupportedFirmwareDAError(\n `Application ${app.name} not found in the catalog`,\n ),\n };\n } else {\n return {\n error: new UnknownDAError(\n `Application ${app.name} not found in the catalog`,\n ),\n };\n }\n }\n }\n\n // Find installPlan dependencies\n const dependencies = installPlan.reduce((apps, app) => {\n const dependency = app.parentName;\n if (dependency) {\n const catalogApp = deviceState.catalog!.applications.find(\n (a) => a.versionName === dependency,\n );\n const installedApp = deviceState.installedApps.find(\n (a) => a.versionName === dependency,\n );\n if (catalogApp && !installedApp) {\n return [...apps, catalogApp];\n }\n }\n return apps;\n }, [] as Application[]);\n\n // Reorder and deduplicate the install plan with its dependencies first\n installPlan = [...dependencies, ...installPlan];\n const reorderedInstallPlan = installPlan.filter(\n (app, index) =>\n installPlan.findIndex((a) => a.versionName === app.versionName) ===\n index,\n );\n\n return {\n installPlan: reorderedInstallPlan,\n missingApplications,\n alreadyInstalled,\n };\n }\n\n private validateConstraint(\n app: Application,\n catalogApp?: Application,\n constraints?: ApplicationConstraint[],\n ): boolean {\n if (constraints === undefined) {\n // No constraint\n return true;\n }\n\n // Validate the constraint\n for (const constraint of constraints) {\n // Is current device exempt from the constraint?\n if (\n constraint.exemptModels !== undefined &&\n constraint.exemptModels.includes(this.deviceModelId)\n ) {\n continue;\n }\n\n // Is current device not applicable for the constraint?\n if (\n constraint.applicableModels !== undefined &&\n !constraint.applicableModels.includes(this.deviceModelId)\n ) {\n continue;\n }\n\n // Validate the min version\n if (constraint.minVersion === \"latest\") {\n return !catalogApp || gte(app.version, catalogApp.version);\n } else {\n return gte(app.version, constraint.minVersion);\n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AI,IAAI,2BACzB,CACF,CAGN,CAoBA,OAAAH,EAAc,CAAC,GAjBMA,EAAY,OAAO,CAACO,EAAMJ,IAAQ,CACrD,MAAMK,EAAaL,EAAI,WACvB,GAAIK,EAAY,CACd,MAAMJ,EAAaL,EAAY,QAAS,aAAa,KAClDM,GAAMA,EAAE,cAAgBG,CAC3B,EACMF,EAAeP,EAAY,cAAc,KAC5CM,GAAMA,EAAE,cAAgBG,CAC3B,EACA,GAAIJ,GAAc,CAACE,EACjB,MAAO,CAAC,GAAGC,EAAMH,CAAU,CAE/B,CACA,OAAOG,CACT,EAAG,CAAC,CAAkB,EAGU,GAAGP,CAAW,EAOvC,CACL,YAP2BA,EAAY,OACvC,CAACG,EAAKM,IACJT,EAAY,UAAWK,GAAMA,EAAE,cAAgBF,EAAI,WAAW,IAC9DM,CACJ,EAIE,oBAAAP,EACA,iBAAAD,CACF,CACF,CAEQ,mBACNE,EACAC,EACAM,EACS,CACT,GAAIA,IAAgB,OAElB,MAAO,GAIT,UAAWC,KAAcD,EAEvB,GACE,EAAAC,EAAW,eAAiB,QAC5BA,EAAW,aAAa,SAAS,KAAK,aAAa,IAOnD,EAAAA,EAAW,mBAAqB,QAChC,CAACA,EAAW,iBAAiB,SAAS,KAAK,aAAa,GAM1D,OAAIA,EAAW,aAAe,SACrB,CAACP,MAAc,OAAID,EAAI,QAASC,EAAW,OAAO,KAElD,OAAID,EAAI,QAASQ,EAAW,UAAU,EAKjD,MAAO,EACT,CACF",
|
6
6
|
"names": ["BuildAppsInstallPlanTask_exports", "__export", "BuildAppsInstallPlanTask", "__toCommonJS", "import_semver", "import_Errors", "import_DeviceSessionState", "api", "args", "deviceModel", "deviceState", "installPlan", "alreadyInstalled", "missingApplications", "app", "catalogApp", "a", "installedApp", "apps", "dependency", "index", "constraints", "constraint"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var t=require("../../device/DeviceModel"),a=require("../../device/DeviceStatus"),r=require("../../device-action/__test-utils__/makeInternalApi"),o=require("../../device-action/os/Errors"),i=require("../../device-session/DeviceSessionState"),s=require("./BuildAppsInstallPlanTask");describe("BuildAppsInstallPlanTask",()=>{const e=(0,r.makeDeviceActionInternalApiMock)();beforeEach(()=>{vi.clearAllMocks(),e.getDeviceModel.mockReturnValue({id:t.DeviceModelId.NANO_X})}),it("Success with no changes needed",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:i.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:a.DeviceStatus.CONNECTED,installedApps:[{versionName:"Ethereum",version:"1.5.0"},{versionName:"Bitcoin",version:"1.3.0"}],catalog:{applications:[],languagePackages:[]}});const n=new s.BuildAppsInstallPlanTask(e,{applications:[{name:"Ethereum"},{name:"Bitcoin"}],allowMissingApplication:!1}).run();expect(n).toStrictEqual({installPlan:[],alreadyInstalled:["Ethereum","Bitcoin"],missingApplications:[]})}),it("Success with no constraints",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:i.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:a.DeviceStatus.CONNECTED,installedApps:[{versionName:"Ethereum",version:"1.5.0"},{versionName:"Bitcoin",version:"1.3.0"}],catalog:{applications:[{versionName:"Ethereum",version:"1.6.0"},{versionName:"Bitcoin",version:"1.3.0"},{versionName:"Solana",version:"1.2.0"},{versionName:"MyShitCoin",version:"0.0.1"},{versionName:"Cardano",version:"1.1.0"}],languagePackages:[]}});const n=new s.BuildAppsInstallPlanTask(e,{applications:[{name:"Ethereum"},{name:"Solana"},{name:"Cardano"}],allowMissingApplication:!1}).run();expect(n).toStrictEqual({installPlan:[{versionName:"Solana",version:"1.2.0"},{versionName:"Cardano",version:"1.1.0"}],alreadyInstalled:["Ethereum"],missingApplications:[]})}),it("Success with applicable constraints",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:i.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:a.DeviceStatus.CONNECTED,installedApps:[{versionName:"Ethereum",version:"1.5.0"},{versionName:"Bitcoin",version:"1.2.0"},{versionName:"Solana",version:"1.1.0"},{versionName:"Cardano",version:"1.1.0"}],catalog:{applications:[{versionName:"Ethereum",version:"1.6.0"},{versionName:"Bitcoin",version:"1.3.0"},{versionName:"Solana",version:"1.2.0"},{versionName:"MyShitCoin",version:"0.0.1"},{versionName:"Cardano",version:"1.2.0"}],languagePackages:[]}});const n=new s.BuildAppsInstallPlanTask(e,{applications:[{name:"Ethereum",constraints:[{minVersion:"1.6.0",applicableModels:[t.DeviceModelId.NANO_X]}]},{name:"Bitcoin",constraints:[{minVersion:"1.2.1",exemptModels:[t.DeviceModelId.NANO_S]}]},{name:"Solana",constraints:[{minVersion:"1.2.0"}]}],allowMissingApplication:!1}).run();expect(n).toStrictEqual({installPlan:[{versionName:"Ethereum",version:"1.6.0"},{versionName:"Bitcoin",version:"1.3.0"},{versionName:"Solana",version:"1.2.0"}],alreadyInstalled:[],missingApplications:[]})}),it("Success with non-applicable constraints",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:i.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:a.DeviceStatus.CONNECTED,installedApps:[{versionName:"Ethereum",version:"1.5.0"},{versionName:"Bitcoin",version:"1.2.0"},{versionName:"Solana",version:"1.1.0"},{versionName:"Cardano",version:"1.1.0"}],catalog:{applications:[{versionName:"Ethereum",version:"1.6.0"},{versionName:"Bitcoin",version:"1.3.0"},{versionName:"Solana",version:"1.2.0"},{versionName:"MyShitCoin",version:"0.0.1"},{versionName:"Cardano",version:"1.2.0"}],languagePackages:[]}});const n=new s.BuildAppsInstallPlanTask(e,{applications:[{name:"Ethereum",constraints:[{minVersion:"1.6.0",exemptModels:[t.DeviceModelId.NANO_X]}]},{name:"Bitcoin",constraints:[{minVersion:"1.2.1",applicableModels:[t.DeviceModelId.NANO_S]}]},{name:"Cardano",constraints:[{minVersion:"1.1.0"}]}],allowMissingApplication:!1}).run();expect(n).toStrictEqual({installPlan:[],alreadyInstalled:["Ethereum","Bitcoin","Cardano"],missingApplications:[]})}),it("Success with applicable constraints latest version",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:i.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:a.DeviceStatus.CONNECTED,installedApps:[{versionName:"Ethereum",version:"1.5.0"},{versionName:"Bitcoin",version:"1.3.0"},{versionName:"Solana",version:"1.1.0"},{versionName:"MyShitCoin",version:"0.0.1"}],catalog:{applications:[{versionName:"Ethereum",version:"1.6.0"},{versionName:"Bitcoin",version:"1.3.0"},{versionName:"Solana",version:"1.2.0"},{versionName:"Cardano",version:"1.2.0"}],languagePackages:[]}});const n=new s.BuildAppsInstallPlanTask(e,{applications:[{name:"Ethereum",constraints:[{minVersion:"latest"}]},{name:"Bitcoin",constraints:[{minVersion:"latest"}]},{name:"MyShitCoin",constraints:[{minVersion:"latest"}]}],allowMissingApplication:!1}).run();expect(n).toStrictEqual({installPlan:[{versionName:"Ethereum",version:"1.6.0"}],alreadyInstalled:["Bitcoin","MyShitCoin"],missingApplications:[]})}),it("Success with dependencies",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:i.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:a.DeviceStatus.CONNECTED,installedApps:[{versionName:"AlreadyInstalledDep",version:"1.2.0"}],catalog:{applications:[{versionName:"Ethereum",version:"1.6.0",parentName:void 0},{versionName:"Solana",version:"1.2.0",parentName:void 0},{versionName:"MyEthShitCoin",version:"0.0.1",parentName:"Ethereum"},{versionName:"MySolShitCoin",version:"0.0.1",parentName:"Solana"},{versionName:"MyPumpFunShitCoin",version:"0.0.1",parentName:"Solana"},{versionName:"Cardano",version:"1.2.0",parentName:void 0},{versionName:"AlreadyInstalledDep",version:"1.2.0",parentName:"Cardano"}],languagePackages:[]}});const n=new s.BuildAppsInstallPlanTask(e,{applications:[{name:"MyEthShitCoin"},{name:"MySolShitCoin"},{name:"Solana"},{name:"MyPumpFunShitCoin"},{name:"AlreadyInstalledDep"}],allowMissingApplication:!1}).run();expect(n).toStrictEqual({installPlan:[{versionName:"Ethereum",version:"1.6.0",parentName:void 0},{versionName:"Solana",version:"1.2.0",parentName:void 0},{versionName:"MyEthShitCoin",version:"0.0.1",parentName:"Ethereum"},{versionName:"MySolShitCoin",version:"0.0.1",parentName:"Solana"},{versionName:"MyPumpFunShitCoin",version:"0.0.1",parentName:"Solana"}],alreadyInstalled:["AlreadyInstalledDep"],missingApplications:[]})}),it("Success with allowed missing applications",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:i.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:a.DeviceStatus.CONNECTED,installedApps:[{versionName:"Ethereum",version:"1.5.0"},{versionName:"Bitcoin",version:"1.3.0"}],catalog:{applications:[{versionName:"Ethereum",version:"1.6.0"},{versionName:"Bitcoin",version:"1.3.0"},{versionName:"Solana",version:"1.2.0"}],languagePackages:[]}});const n=new s.BuildAppsInstallPlanTask(e,{applications:[{name:"Ethereum"},{name:"Solana"},{name:"Cardano"}],allowMissingApplication:!0}).run();expect(n).toStrictEqual({installPlan:[{versionName:"Solana",version:"1.2.0"}],alreadyInstalled:["Ethereum"],missingApplications:["Cardano"]})}),it("Error when device is in incorrect state",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:i.DeviceSessionStateType.Connected,deviceStatus:a.DeviceStatus.CONNECTED});const n=new s.BuildAppsInstallPlanTask(e,{applications:[{name:"Ethereum"}],allowMissingApplication:!1}).run();expect(n).toStrictEqual({error:new o.UnknownDAError("Invalid device state")})}),it("Error when device session was not populated",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:i.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:a.DeviceStatus.CONNECTED,installedApps:[]});const n=new s.BuildAppsInstallPlanTask(e,{applications:[{name:"Ethereum"}],allowMissingApplication:!1}).run();expect(n).toStrictEqual({error:new o.UnknownDAError("Device apps metadata not fetched")})}),it("Error when an app is not found in the catalog",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:i.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:a.DeviceStatus.CONNECTED,installedApps:[],catalog:{applications:[],languagePackages:[]}});const n=new s.BuildAppsInstallPlanTask(e,{applications:[{name:"Ethereum"},{name:"Bitcoin"},{name:"Solana"}],allowMissingApplication:!1}).run();expect(n).toStrictEqual({error:new o.UnknownDAError("Application Ethereum not found in the catalog")})}),it("Error when an app version is not found in the catalog",()=>{e.getDeviceSessionState.mockReturnValueOnce({sessionStateType:i.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:a.DeviceStatus.CONNECTED,installedApps:[],catalog:{applications:[{versionName:"Ethereum",version:"1.5.0"}],languagePackages:[]}});const n=new s.BuildAppsInstallPlanTask(e,{applications:[{name:"Ethereum",constraints:[{minVersion:"1.6.0"}]}],allowMissingApplication:!1}).run();expect(n).toStrictEqual({error:new o.UnsupportedFirmwareDAError("Application Ethereum not found in the catalog")})})});
|
2
2
|
//# sourceMappingURL=BuildAppsInstallPlanTask.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/api/device-action/task/BuildAppsInstallPlanTask.test.ts"],
|
4
|
-
"sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport type { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nimport type { DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\nimport type { Application } from \"@internal/manager-api/model/Application\";\n\nimport { BuildAppsInstallPlanTask } from \"./BuildAppsInstallPlanTask\";\n\ndescribe(\"BuildAppsInstallPlanTask\", () => {\n const apiMock = makeDeviceActionInternalApiMock();\n\n beforeEach(() => {\n vi.clearAllMocks();\n apiMock.getDeviceModel.mockReturnValue({\n id: DeviceModelId.NANO_X,\n } as unknown as TransportDeviceModel);\n });\n\n it(\"Success with no changes needed\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [{ name: \"Ethereum\" }, { name: \"Bitcoin\" }],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [],\n alreadyInstalled: [\"Ethereum\", \"Bitcoin\"],\n missingApplications: [],\n });\n });\n\n it(\"Success with no constraints\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n { versionName: \"MyShitCoin\", version: \"0.0.1\" },\n { versionName: \"Cardano\", version: \"1.1.0\" },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n { name: \"Ethereum\" },\n { name: \"Solana\" },\n { name: \"Cardano\" },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [\n { versionName: \"Solana\", version: \"1.2.0\" },\n { versionName: \"Cardano\", version: \"1.1.0\" },\n ],\n alreadyInstalled: [\"Ethereum\"],\n missingApplications: [],\n });\n });\n\n it(\"Success with applicable constraints\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.2.0\" },\n { versionName: \"Solana\", version: \"1.1.0\" },\n { versionName: \"Cardano\", version: \"1.1.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n { versionName: \"MyShitCoin\", version: \"0.0.1\" },\n { versionName: \"Cardano\", version: \"1.2.0\" },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n {\n name: \"Ethereum\",\n constraints: [\n { minVersion: \"1.6.0\", applicableModels: [DeviceModelId.NANO_X] },\n ],\n },\n {\n name: \"Bitcoin\",\n constraints: [\n { minVersion: \"1.2.1\", exemptModels: [DeviceModelId.NANO_S] },\n ],\n },\n { name: \"Solana\", constraints: [{ minVersion: \"1.2.0\" }] },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n ],\n alreadyInstalled: [],\n missingApplications: [],\n });\n });\n\n it(\"Success with non-applicable constraints\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.2.0\" },\n { versionName: \"Solana\", version: \"1.1.0\" },\n { versionName: \"Cardano\", version: \"1.1.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n { versionName: \"MyShitCoin\", version: \"0.0.1\" },\n { versionName: \"Cardano\", version: \"1.2.0\" },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n {\n name: \"Ethereum\",\n constraints: [\n { minVersion: \"1.6.0\", exemptModels: [DeviceModelId.NANO_X] },\n ],\n },\n {\n name: \"Bitcoin\",\n constraints: [\n { minVersion: \"1.2.1\", applicableModels: [DeviceModelId.NANO_S] },\n ],\n },\n { name: \"Cardano\", constraints: [{ minVersion: \"1.1.0\" }] },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [],\n alreadyInstalled: [\"Ethereum\", \"Bitcoin\", \"Cardano\"],\n missingApplications: [],\n });\n });\n\n it(\"Success with applicable constraints latest version\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.1.0\" },\n { versionName: \"MyShitCoin\", version: \"0.0.1\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n { versionName: \"Cardano\", version: \"1.2.0\" },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n { name: \"Ethereum\", constraints: [{ minVersion: \"latest\" }] },\n { name: \"Bitcoin\", constraints: [{ minVersion: \"latest\" }] },\n { name: \"MyShitCoin\", constraints: [{ minVersion: \"latest\" }] },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [{ versionName: \"Ethereum\", version: \"1.6.0\" }],\n alreadyInstalled: [\"Bitcoin\", \"MyShitCoin\"],\n missingApplications: [],\n });\n });\n\n it(\"Success with dependencies\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"AlreadyInstalledDep\", version: \"1.2.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\", parentName: undefined },\n { versionName: \"Solana\", version: \"1.2.0\", parentName: undefined },\n {\n versionName: \"MyEthShitCoin\",\n version: \"0.0.1\",\n parentName: \"Ethereum\",\n },\n {\n versionName: \"MySolShitCoin\",\n version: \"0.0.1\",\n parentName: \"Solana\",\n },\n {\n versionName: \"MyPumpFunShitCoin\",\n version: \"0.0.1\",\n parentName: \"Solana\",\n },\n { versionName: \"Cardano\", version: \"1.2.0\", parentName: undefined },\n {\n versionName: \"AlreadyInstalledDep\",\n version: \"1.2.0\",\n parentName: \"Cardano\",\n },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n { name: \"MyEthShitCoin\" },\n { name: \"MySolShitCoin\" },\n { name: \"Solana\" },\n { name: \"MyPumpFunShitCoin\" },\n { name: \"AlreadyInstalledDep\" },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [\n { versionName: \"Ethereum\", version: \"1.6.0\", parentName: undefined },\n { versionName: \"Solana\", version: \"1.2.0\", parentName: undefined },\n {\n versionName: \"MyEthShitCoin\",\n version: \"0.0.1\",\n parentName: \"Ethereum\",\n },\n {\n versionName: \"MySolShitCoin\",\n version: \"0.0.1\",\n parentName: \"Solana\",\n },\n {\n versionName: \"MyPumpFunShitCoin\",\n version: \"0.0.1\",\n parentName: \"Solana\",\n },\n ],\n alreadyInstalled: [\"AlreadyInstalledDep\"],\n missingApplications: [],\n });\n });\n\n it(\"Success with allowed missing applications\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n { name: \"Ethereum\" },\n { name: \"Solana\" },\n { name: \"Cardano\" },\n ],\n allowMissingApplication: true,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [{ versionName: \"Solana\", version: \"1.2.0\" }],\n alreadyInstalled: [\"Ethereum\"],\n missingApplications: [\"Cardano\"],\n });\n });\n\n it(\"Error when device is in incorrect state\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n } as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [{ name: \"Ethereum\" }],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n error: new UnknownDAError(\"Invalid device state\"),\n });\n });\n\n it(\"Error when device session was not populated\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [{ name: \"Ethereum\" }],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n error: new UnknownDAError(\"Device apps metadata not fetched\"),\n });\n });\n\n it(\"Error when an app is not found in the catalog\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [] as unknown as Application[],\n catalog: {\n applications: [] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n { name: \"Ethereum\" },\n { name: \"Bitcoin\" },\n { name: \"Solana\" },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n error: new UnknownDAError(\n \"Application Ethereum not found in the catalog\",\n ),\n });\n });\n});\n"],
|
5
|
-
"mappings": "aAAA,IAAAA,EAA8B,mCAC9BC,EAA6B,oCAC7BC,EAAgD,6DAChDC,
|
4
|
+
"sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport {\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nimport type { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nimport type { DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\nimport type { Application } from \"@internal/manager-api/model/Application\";\n\nimport { BuildAppsInstallPlanTask } from \"./BuildAppsInstallPlanTask\";\n\ndescribe(\"BuildAppsInstallPlanTask\", () => {\n const apiMock = makeDeviceActionInternalApiMock();\n\n beforeEach(() => {\n vi.clearAllMocks();\n apiMock.getDeviceModel.mockReturnValue({\n id: DeviceModelId.NANO_X,\n } as unknown as TransportDeviceModel);\n });\n\n it(\"Success with no changes needed\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [{ name: \"Ethereum\" }, { name: \"Bitcoin\" }],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [],\n alreadyInstalled: [\"Ethereum\", \"Bitcoin\"],\n missingApplications: [],\n });\n });\n\n it(\"Success with no constraints\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n { versionName: \"MyShitCoin\", version: \"0.0.1\" },\n { versionName: \"Cardano\", version: \"1.1.0\" },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n { name: \"Ethereum\" },\n { name: \"Solana\" },\n { name: \"Cardano\" },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [\n { versionName: \"Solana\", version: \"1.2.0\" },\n { versionName: \"Cardano\", version: \"1.1.0\" },\n ],\n alreadyInstalled: [\"Ethereum\"],\n missingApplications: [],\n });\n });\n\n it(\"Success with applicable constraints\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.2.0\" },\n { versionName: \"Solana\", version: \"1.1.0\" },\n { versionName: \"Cardano\", version: \"1.1.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n { versionName: \"MyShitCoin\", version: \"0.0.1\" },\n { versionName: \"Cardano\", version: \"1.2.0\" },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n {\n name: \"Ethereum\",\n constraints: [\n { minVersion: \"1.6.0\", applicableModels: [DeviceModelId.NANO_X] },\n ],\n },\n {\n name: \"Bitcoin\",\n constraints: [\n { minVersion: \"1.2.1\", exemptModels: [DeviceModelId.NANO_S] },\n ],\n },\n { name: \"Solana\", constraints: [{ minVersion: \"1.2.0\" }] },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n ],\n alreadyInstalled: [],\n missingApplications: [],\n });\n });\n\n it(\"Success with non-applicable constraints\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.2.0\" },\n { versionName: \"Solana\", version: \"1.1.0\" },\n { versionName: \"Cardano\", version: \"1.1.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n { versionName: \"MyShitCoin\", version: \"0.0.1\" },\n { versionName: \"Cardano\", version: \"1.2.0\" },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n {\n name: \"Ethereum\",\n constraints: [\n { minVersion: \"1.6.0\", exemptModels: [DeviceModelId.NANO_X] },\n ],\n },\n {\n name: \"Bitcoin\",\n constraints: [\n { minVersion: \"1.2.1\", applicableModels: [DeviceModelId.NANO_S] },\n ],\n },\n { name: \"Cardano\", constraints: [{ minVersion: \"1.1.0\" }] },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [],\n alreadyInstalled: [\"Ethereum\", \"Bitcoin\", \"Cardano\"],\n missingApplications: [],\n });\n });\n\n it(\"Success with applicable constraints latest version\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.1.0\" },\n { versionName: \"MyShitCoin\", version: \"0.0.1\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n { versionName: \"Cardano\", version: \"1.2.0\" },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n { name: \"Ethereum\", constraints: [{ minVersion: \"latest\" }] },\n { name: \"Bitcoin\", constraints: [{ minVersion: \"latest\" }] },\n { name: \"MyShitCoin\", constraints: [{ minVersion: \"latest\" }] },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [{ versionName: \"Ethereum\", version: \"1.6.0\" }],\n alreadyInstalled: [\"Bitcoin\", \"MyShitCoin\"],\n missingApplications: [],\n });\n });\n\n it(\"Success with dependencies\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"AlreadyInstalledDep\", version: \"1.2.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\", parentName: undefined },\n { versionName: \"Solana\", version: \"1.2.0\", parentName: undefined },\n {\n versionName: \"MyEthShitCoin\",\n version: \"0.0.1\",\n parentName: \"Ethereum\",\n },\n {\n versionName: \"MySolShitCoin\",\n version: \"0.0.1\",\n parentName: \"Solana\",\n },\n {\n versionName: \"MyPumpFunShitCoin\",\n version: \"0.0.1\",\n parentName: \"Solana\",\n },\n { versionName: \"Cardano\", version: \"1.2.0\", parentName: undefined },\n {\n versionName: \"AlreadyInstalledDep\",\n version: \"1.2.0\",\n parentName: \"Cardano\",\n },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n { name: \"MyEthShitCoin\" },\n { name: \"MySolShitCoin\" },\n { name: \"Solana\" },\n { name: \"MyPumpFunShitCoin\" },\n { name: \"AlreadyInstalledDep\" },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [\n { versionName: \"Ethereum\", version: \"1.6.0\", parentName: undefined },\n { versionName: \"Solana\", version: \"1.2.0\", parentName: undefined },\n {\n versionName: \"MyEthShitCoin\",\n version: \"0.0.1\",\n parentName: \"Ethereum\",\n },\n {\n versionName: \"MySolShitCoin\",\n version: \"0.0.1\",\n parentName: \"Solana\",\n },\n {\n versionName: \"MyPumpFunShitCoin\",\n version: \"0.0.1\",\n parentName: \"Solana\",\n },\n ],\n alreadyInstalled: [\"AlreadyInstalledDep\"],\n missingApplications: [],\n });\n });\n\n it(\"Success with allowed missing applications\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n ] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.6.0\" },\n { versionName: \"Bitcoin\", version: \"1.3.0\" },\n { versionName: \"Solana\", version: \"1.2.0\" },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n { name: \"Ethereum\" },\n { name: \"Solana\" },\n { name: \"Cardano\" },\n ],\n allowMissingApplication: true,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n installPlan: [{ versionName: \"Solana\", version: \"1.2.0\" }],\n alreadyInstalled: [\"Ethereum\"],\n missingApplications: [\"Cardano\"],\n });\n });\n\n it(\"Error when device is in incorrect state\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n } as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [{ name: \"Ethereum\" }],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n error: new UnknownDAError(\"Invalid device state\"),\n });\n });\n\n it(\"Error when device session was not populated\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [{ name: \"Ethereum\" }],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n error: new UnknownDAError(\"Device apps metadata not fetched\"),\n });\n });\n\n it(\"Error when an app is not found in the catalog\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [] as unknown as Application[],\n catalog: {\n applications: [] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n { name: \"Ethereum\" },\n { name: \"Bitcoin\" },\n { name: \"Solana\" },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n error: new UnknownDAError(\n \"Application Ethereum not found in the catalog\",\n ),\n });\n });\n\n it(\"Error when an app version is not found in the catalog\", () => {\n // GIVEN\n apiMock.getDeviceSessionState.mockReturnValueOnce({\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [] as unknown as Application[],\n catalog: {\n applications: [\n { versionName: \"Ethereum\", version: \"1.5.0\" },\n ] as unknown as Application[],\n languagePackages: [],\n },\n } as unknown as DeviceSessionState);\n\n // WHEN\n const result = new BuildAppsInstallPlanTask(apiMock, {\n applications: [\n {\n name: \"Ethereum\",\n constraints: [{ minVersion: \"1.6.0\" }],\n },\n ],\n allowMissingApplication: false,\n }).run();\n\n // THEN\n expect(result).toStrictEqual({\n error: new UnsupportedFirmwareDAError(\n \"Application Ethereum not found in the catalog\",\n ),\n });\n });\n});\n"],
|
5
|
+
"mappings": "aAAA,IAAAA,EAA8B,mCAC9BC,EAA6B,oCAC7BC,EAAgD,6DAChDC,EAGO,wCAGPC,EAAuC,kDAGvCC,EAAyC,sCAEzC,SAAS,2BAA4B,IAAM,CACzC,MAAMC,KAAU,mCAAgC,EAEhD,WAAW,IAAM,CACf,GAAG,cAAc,EACjBA,EAAQ,eAAe,gBAAgB,CACrC,GAAI,gBAAc,MACpB,CAAoC,CACtC,CAAC,EAED,GAAG,iCAAkC,IAAM,CAEzCA,EAAQ,sBAAsB,oBAAoB,CAChD,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,cAAe,CACb,CAAE,YAAa,WAAY,QAAS,OAAQ,EAC5C,CAAE,YAAa,UAAW,QAAS,OAAQ,CAC7C,EACA,QAAS,CACP,aAAc,CAAC,EACf,iBAAkB,CAAC,CACrB,CACF,CAAkC,EAGlC,MAAMC,EAAS,IAAI,2BAAyBD,EAAS,CACnD,aAAc,CAAC,CAAE,KAAM,UAAW,EAAG,CAAE,KAAM,SAAU,CAAC,EACxD,wBAAyB,EAC3B,CAAC,EAAE,IAAI,EAGP,OAAOC,CAAM,EAAE,cAAc,CAC3B,YAAa,CAAC,EACd,iBAAkB,CAAC,WAAY,SAAS,EACx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us", "import_makeInternalApi", "import_Errors", "import_DeviceSessionState", "import_BuildAppsInstallPlanTask", "apiMock", "result"]
|
7
7
|
}
|
package/lib/cjs/src/api/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var D=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var
|
1
|
+
"use strict";var D=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var de=Object.prototype.hasOwnProperty;var De=(p,o)=>{for(var i in o)D(p,i,{get:o[i],enumerable:!0})},d=(p,o,i,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of Ae(o))!de.call(p,s)&&s!==i&&D(p,s,{get:()=>o[s],enumerable:!(l=xe(o,s))||l.enumerable});return p},r=(p,o,i)=>(d(p,o,"default"),i&&d(i,o,"default"));var le=p=>d(D({},"__esModule",{value:!0}),p);var e={};De(e,{APDU_MAX_PAYLOAD:()=>c.APDU_MAX_PAYLOAD,Apdu:()=>u.Apdu,ApduBuilder:()=>c.ApduBuilder,ApduParser:()=>v.ApduParser,ApduResponse:()=>Y.ApduResponse,AppAlreadyInstalledDAError:()=>t.AppAlreadyInstalledDAError,BatteryStatusType:()=>f.BatteryStatusType,BleDeviceInfos:()=>q.BleDeviceInfos,ByteArrayBuilder:()=>S.ByteArrayBuilder,ByteArrayParser:()=>C.ByteArrayParser,CallTaskInAppDeviceAction:()=>T.CallTaskInAppDeviceAction,CloseAppCommand:()=>L.CloseAppCommand,CommandResultFactory:()=>n.CommandResultFactory,CommandResultStatus:()=>n.CommandResultStatus,CommandUtils:()=>I.CommandUtils,ConnectedDevice:()=>ae.ConnectedDevice,ConsoleLogger:()=>ne.ConsoleLogger,DeviceActionStatus:()=>b.DeviceActionStatus,DeviceConnectionStateMachine:()=>se.DeviceConnectionStateMachine,DeviceLockedError:()=>t.DeviceLockedError,DeviceManagementKit:()=>te.DeviceManagementKit,DeviceManagementKitBuilder:()=>pe.DeviceManagementKitBuilder,DeviceModel:()=>m.DeviceModel,DeviceModelId:()=>m.DeviceModelId,DeviceSessionStateType:()=>j.DeviceSessionStateType,DeviceStatus:()=>O.DeviceStatus,FramerUtils:()=>oe.FramerUtils,GenuineCheckDeviceAction:()=>z.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>g.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>f.GetBatteryStatusCommand,GetDeviceMetadataDeviceAction:()=>U.GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction:()=>P.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>B.GetOsVersionCommand,GlobalCommandError:()=>x.GlobalCommandError,GlobalCommandErrorHandler:()=>x.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>V.GoToDashboardDeviceAction,InstallAppDeviceAction:()=>J.InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction:()=>k.InstallOrUpdateAppsDeviceAction,InvalidStatusWordError:()=>y.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>m.LEDGER_VENDOR_ID,ListAppsCommand:()=>E.ListAppsCommand,ListAppsDeviceAction:()=>W.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>_.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>Q.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>G.LoadCertificateCommand,LogLevel:()=>ie.LogLevel,OpenAppCommand:()=>M.OpenAppCommand,OpenAppDeviceAction:()=>F.OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction:()=>H.OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError:()=>t.OutOfMemoryDAError,RefusedByUserDAError:()=>t.RefusedByUserDAError,SecureChannelError:()=>$.SecureChannelError,SendCommandInAppDeviceAction:()=>w.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>X.StaticDeviceModelDataSource,TransportConnectedDevice:()=>ce.TransportConnectedDevice,TransportDeviceModel:()=>N.TransportDeviceModel,UninstallAppDeviceAction:()=>Z.UninstallAppDeviceAction,UnknownDAError:()=>t.UnknownDAError,UnsupportedFirmwareDAError:()=>t.UnsupportedFirmwareDAError,UserInteractionRequired:()=>h.UserInteractionRequired,WebLogsExporterLogger:()=>me.WebLogsExporterLogger,XStateDeviceAction:()=>K.XStateDeviceAction,base64StringToBuffer:()=>A.base64StringToBuffer,bufferToHexaString:()=>a.bufferToHexaString,connectedDeviceStubBuilder:()=>fe.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>ee.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>re.defaultApduSenderServiceStubBuilder,hexaStringToBuffer:()=>a.hexaStringToBuffer,isBase64String:()=>A.isBase64String,isCommandErrorCode:()=>R.isCommandErrorCode,isHexaString:()=>a.isHexaString,isSuccessCommandResult:()=>n.isSuccessCommandResult});module.exports=le(e);var u=require("./apdu/model/Apdu"),c=require("./apdu/utils/ApduBuilder"),v=require("./apdu/utils/ApduParser");r(e,require("./apdu/utils/AppBuilderError"),module.exports);var S=require("./apdu/utils/ByteArrayBuilder"),C=require("./apdu/utils/ByteArrayParser"),y=require("./command/Errors"),n=require("./command/model/CommandResult"),L=require("./command/os/CloseAppCommand"),g=require("./command/os/GetAppAndVersionCommand"),f=require("./command/os/GetBatteryStatusCommand"),B=require("./command/os/GetOsVersionCommand"),E=require("./command/os/ListAppsCommand"),G=require("./command/os/LoadCertificateCommand"),M=require("./command/os/OpenAppCommand"),R=require("./command/utils/CommandErrors"),I=require("./command/utils/CommandUtils"),x=require("./command/utils/GlobalCommandError"),m=require("./device/DeviceModel"),O=require("./device/DeviceStatus"),b=require("./device-action/model/DeviceActionState"),h=require("./device-action/model/UserInteractionRequired"),T=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),t=require("./device-action/os/Errors"),U=require("./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),P=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),V=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),k=require("./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),W=require("./device-action/os/ListApps/ListAppsDeviceAction"),_=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),F=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),H=require("./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction"),w=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),K=require("./device-action/xstate-utils/XStateDeviceAction"),X=require("./device-model/data/StaticDeviceModelDataSource"),q=require("./device-model/model/BleDeviceInfos"),N=require("./device-model/model/DeviceModel"),Y=require("./device-session/ApduResponse");r(e,require("./device-session/data/FramerConst"),module.exports);var j=require("./device-session/DeviceSessionState"),z=require("./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction"),J=require("./secure-channel/device-action/InstallApp/InstallAppDeviceAction"),Q=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),Z=require("./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction"),$=require("../internal/secure-channel/model/Errors"),ee=require("./device-session/service/DefaultApduReceiverService.stub"),re=require("./device-session/service/DefaultApduSenderService.stub"),oe=require("./device-session/utils/FramerUtils"),te=require("./DeviceManagementKit"),pe=require("./DeviceManagementKitBuilder");r(e,require("./Error"),module.exports);var ie=require("./logger-subscriber/model/LogLevel"),ne=require("./logger-subscriber/service/ConsoleLogger"),me=require("./logger-subscriber/service/WebLogsExporterLogger"),ae=require("./transport/model/ConnectedDevice"),se=require("./transport/model/DeviceConnectionStateMachine");r(e,require("./transport/model/Errors"),module.exports);var ce=require("./transport/model/TransportConnectedDevice"),fe=require("./transport/model/TransportConnectedDevice.stub");r(e,require("./types"),module.exports);var A=require("./utils/Base64String"),a=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,AppAlreadyInstalledDAError,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DeviceActionStatus,DeviceConnectionStateMachine,DeviceLockedError,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError,RefusedByUserDAError,SecureChannelError,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UninstallAppDeviceAction,UnknownDAError,UnsupportedFirmwareDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../src/api/index.ts"],
|
4
|
-
"sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport {\n DeviceLockedError,\n OutOfMemoryDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
5
|
-
"mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,
|
4
|
+
"sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
5
|
+
"mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,s5GAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAChCC,EAAuC,+BACvCC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAIO,kDACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAGO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCC,EAA0C,qFAC1ChB,EAOO,wCACPiB,EAA8C,iFAC9CC,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAgD,qFAChDC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAAoD,6FACpDC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/BhB,EAAqC,+CACrCiB,EAA6B,4CAC7BhC,EAAAN,EAAc,gDAxFd,gBAyFA,IAAAuC,EAGO,kDACPC,EAAyC,mFACzCC,EAAuC,+EACvCC,EAA8C,6FAC9CC,EAAyC,mFACzClC,EAAmC,iDAEnCmC,GAAsD,uEACtDC,GAAoD,qEACpDC,GAA4B,iDAC5BC,GAAoC,oCACpCC,GAA2C,2CAC3C1C,EAAAN,EAAc,sBAxGd,gBAyGA,IAAAiD,GAAyB,iDACzBC,GAA8B,wDAC9BC,GAAsC,gEACtCC,GAAgC,gDAChCC,GAGO,6DACP/C,EAAAN,EAAc,uCAjHd,gBAkHA,IAAAsD,GAAyC,yDACzCA,GAA2C,8DAC3ChD,EAAAN,EAAc,sBApHd,gBAqHA,IAAAuD,EAAqD,mCACrDC,EAIO",
|
6
6
|
"names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_OpenAppWithDependenciesDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_GenuineCheckDeviceAction", "import_InstallAppDeviceAction", "import_ListInstalledAppsDeviceAction", "import_UninstallAppDeviceAction", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_LogLevel", "import_ConsoleLogger", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_DeviceConnectionStateMachine", "import_TransportConnectedDevice", "import_Base64String", "import_HexaString"]
|
7
7
|
}
|