@ledgerhq/device-management-kit 0.0.0-fix-rn-ble-20250502082216 → 0.0.0-hid-candidate-20250523130730
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/package.json +22 -23
- package/lib/cjs/src/api/DeviceManagementKit.test.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKit.test.js.map +2 -2
- package/lib/cjs/src/api/command/di/commandModule.js +1 -1
- package/lib/cjs/src/api/command/di/commandModule.js.map +3 -3
- package/lib/cjs/src/api/command/di/commandModule.test.js +1 -1
- package/lib/cjs/src/api/command/di/commandModule.test.js.map +2 -2
- package/lib/cjs/src/api/device-action/DeviceAction.js +1 -1
- package/lib/cjs/src/api/device-action/DeviceAction.js.map +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
- package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
- package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
- package/lib/cjs/src/api/device-action/di/deviceActionModule.js +1 -1
- package/lib/cjs/src/api/device-action/di/deviceActionModule.js.map +3 -3
- package/lib/cjs/src/api/device-action/di/deviceActionModule.test.js +1 -1
- package/lib/cjs/src/api/device-action/di/deviceActionModule.test.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/CallTaskInAppDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.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/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +1 -1
- package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
- package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +1 -1
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +2 -0
- package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +2 -0
- package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
- 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/SendCommandInAppDeviceAction.test.js +1 -1
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
- package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +1 -1
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
- package/lib/cjs/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
- package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
- package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
- package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
- package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
- package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
- package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
- package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +1 -1
- package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
- package/lib/cjs/src/api/index.js +1 -1
- package/lib/cjs/src/api/index.js.map +3 -3
- package/lib/cjs/src/api/secure-channel/device-action/InstallApp/InstallAppDeviceAction.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/transport/model/Errors.js +1 -1
- package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
- package/lib/cjs/src/api/types.js +1 -1
- package/lib/cjs/src/api/types.js.map +1 -1
- package/lib/cjs/src/di.js +1 -1
- package/lib/cjs/src/di.js.map +2 -2
- package/lib/cjs/src/internal/config/di/configModule.js +1 -1
- package/lib/cjs/src/internal/config/di/configModule.js.map +3 -3
- package/lib/cjs/src/internal/config/di/configModule.test.js +1 -1
- package/lib/cjs/src/internal/config/di/configModule.test.js.map +2 -2
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.js +1 -1
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.js.map +3 -3
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js +1 -1
- package/lib/cjs/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js +1 -1
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
- package/lib/cjs/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
- package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
- package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +2 -2
- package/lib/cjs/src/internal/discovery/di/discoveryModule.js +1 -1
- package/lib/cjs/src/internal/discovery/di/discoveryModule.js.map +3 -3
- package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js +1 -1
- package/lib/cjs/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
- package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
- package/lib/cjs/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
- package/lib/cjs/src/internal/manager-api/di/managerApiModule.js +1 -1
- package/lib/cjs/src/internal/manager-api/di/managerApiModule.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js +1 -1
- package/lib/cjs/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js +1 -1
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
- package/lib/cjs/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
- package/lib/cjs/src/internal/send/di/sendModule.js +1 -1
- package/lib/cjs/src/internal/send/di/sendModule.js.map +3 -3
- package/lib/cjs/src/internal/send/di/sendModule.test.js +1 -1
- package/lib/cjs/src/internal/send/di/sendModule.test.js.map +2 -2
- package/lib/cjs/src/internal/transport/di/transportModule.js +1 -1
- package/lib/cjs/src/internal/transport/di/transportModule.js.map +3 -3
- package/lib/cjs/src/internal/transport/di/transportModule.test.js +1 -1
- package/lib/cjs/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/esm/package.json +22 -23
- package/lib/esm/src/api/DeviceManagementKit.test.js +1 -1
- package/lib/esm/src/api/DeviceManagementKit.test.js.map +2 -2
- package/lib/esm/src/api/command/di/commandModule.js +1 -1
- package/lib/esm/src/api/command/di/commandModule.js.map +3 -3
- package/lib/esm/src/api/command/di/commandModule.test.js +1 -1
- package/lib/esm/src/api/command/di/commandModule.test.js.map +2 -2
- package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/makeInternalApi.js.map +3 -3
- package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
- package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
- package/lib/esm/src/api/device-action/di/deviceActionModule.js +1 -1
- package/lib/esm/src/api/device-action/di/deviceActionModule.js.map +3 -3
- package/lib/esm/src/api/device-action/di/deviceActionModule.test.js +1 -1
- package/lib/esm/src/api/device-action/di/deviceActionModule.test.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/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.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/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +2 -0
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +7 -0
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +2 -0
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +7 -0
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
- package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +7 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +2 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +7 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +2 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +7 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
- package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +7 -0
- 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/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
- package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +2 -2
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js +2 -0
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.js.map +7 -0
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js +2 -0
- package/lib/esm/src/api/device-action/task/BuildAppsInstallPlanTask.test.js.map +7 -0
- package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +2 -0
- package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +7 -0
- package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +2 -0
- package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +7 -0
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
- package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
- package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
- package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
- package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
- 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/InstallApp/InstallAppDeviceAction.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/transport/model/Errors.js +1 -1
- package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
- package/lib/esm/src/di.js +1 -1
- package/lib/esm/src/di.js.map +2 -2
- package/lib/esm/src/internal/config/di/configModule.js +1 -1
- package/lib/esm/src/internal/config/di/configModule.js.map +3 -3
- package/lib/esm/src/internal/config/di/configModule.test.js +1 -1
- package/lib/esm/src/internal/config/di/configModule.test.js.map +2 -2
- package/lib/esm/src/internal/device-model/di/deviceModelModule.js +1 -1
- package/lib/esm/src/internal/device-model/di/deviceModelModule.js.map +3 -3
- package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js +1 -1
- package/lib/esm/src/internal/device-model/di/deviceModelModule.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.js +1 -1
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.js.map +3 -3
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js +1 -1
- package/lib/esm/src/internal/device-session/di/deviceSessionModule.test.js.map +2 -2
- package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
- package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +2 -2
- package/lib/esm/src/internal/discovery/di/discoveryModule.js +1 -1
- package/lib/esm/src/internal/discovery/di/discoveryModule.js.map +3 -3
- package/lib/esm/src/internal/discovery/di/discoveryModule.test.js +1 -1
- package/lib/esm/src/internal/discovery/di/discoveryModule.test.js.map +2 -2
- package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/DisconnectUseCase.test.js.map +2 -2
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js +1 -1
- package/lib/esm/src/internal/discovery/use-case/StopDiscoveringUseCase.test.js.map +3 -3
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.js +1 -1
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.js.map +3 -3
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js +1 -1
- package/lib/esm/src/internal/logger-publisher/di/loggerModule.test.js.map +2 -2
- package/lib/esm/src/internal/manager-api/di/managerApiModule.js +1 -1
- package/lib/esm/src/internal/manager-api/di/managerApiModule.js.map +3 -3
- package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js +1 -1
- package/lib/esm/src/internal/manager-api/di/managerApiModule.test.js.map +2 -2
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js +1 -1
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.js.map +3 -3
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js +1 -1
- package/lib/esm/src/internal/secure-channel/di/secureChannelModule.test.js.map +2 -2
- package/lib/esm/src/internal/send/di/sendModule.js +1 -1
- package/lib/esm/src/internal/send/di/sendModule.js.map +3 -3
- package/lib/esm/src/internal/send/di/sendModule.test.js +1 -1
- package/lib/esm/src/internal/send/di/sendModule.test.js.map +2 -2
- package/lib/esm/src/internal/transport/di/transportModule.js +1 -1
- package/lib/esm/src/internal/transport/di/transportModule.js.map +3 -3
- package/lib/esm/src/internal/transport/di/transportModule.test.js +1 -1
- package/lib/esm/src/internal/transport/di/transportModule.test.js.map +2 -2
- package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ApduParser.d.ts.map +1 -1
- package/lib/types/src/api/apdu/utils/ByteArrayBuilder.d.ts.map +1 -1
- package/lib/types/src/api/command/di/commandModule.d.ts.map +1 -1
- package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
- package/lib/types/src/api/command/utils/CommandErrors.d.ts.map +1 -1
- package/lib/types/src/api/device-action/DeviceAction.d.ts +2 -0
- package/lib/types/src/api/device-action/DeviceAction.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
- package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts +5 -0
- package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
- package/lib/types/src/api/device-action/di/deviceActionModule.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +1 -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/types.d.ts +5 -6
- package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +3 -4
- package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts +40 -0
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts +2 -0
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +64 -0
- package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts +15 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts +2 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +25 -0
- package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -0
- package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +1 -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 +30 -0
- package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.d.ts.map +1 -0
- package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts +2 -0
- package/lib/types/src/api/device-action/task/BuildAppsInstallPlanTask.test.d.ts.map +1 -0
- package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +21 -0
- package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -0
- package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts +2 -0
- package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.test.d.ts.map +1 -0
- package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
- package/lib/types/src/api/device-model/model/DeviceModel.d.ts +2 -0
- package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
- package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
- package/lib/types/src/api/device-session/service/DefaultApduReceiverService.stub.d.ts.map +1 -1
- package/lib/types/src/api/device-session/service/DefaultApduSenderService.stub.d.ts.map +1 -1
- package/lib/types/src/api/index.d.ts +4 -1
- package/lib/types/src/api/index.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/Errors.d.ts +5 -0
- package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
- package/lib/types/src/api/types.d.ts +3 -1
- package/lib/types/src/api/types.d.ts.map +1 -1
- package/lib/types/src/api/utils/HexaString.d.ts.map +1 -1
- package/lib/types/src/di.d.ts.map +1 -1
- package/lib/types/src/internal/config/di/configModule.d.ts.map +1 -1
- package/lib/types/src/internal/device-model/di/deviceModelModule.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/di/deviceSessionModule.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/model/DeviceSession.stub.d.ts.map +1 -1
- package/lib/types/src/internal/device-session/utils/deviceSessionUtils.d.ts.map +1 -1
- package/lib/types/src/internal/discovery/di/discoveryModule.d.ts.map +1 -1
- package/lib/types/src/internal/logger-publisher/di/loggerModule.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/di/managerApiModule.d.ts.map +1 -1
- package/lib/types/src/internal/secure-channel/di/secureChannelModule.d.ts.map +1 -1
- package/lib/types/src/internal/send/di/sendModule.d.ts.map +1 -1
- package/lib/types/src/internal/transport/di/transportModule.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +14 -15
package/lib/cjs/src/di.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/di.ts"],
|
4
|
-
"sourcesContent": ["import { Container } from \"inversify\";\n\
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA0B,
|
4
|
+
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { commandModuleFactory } from \"@api/command/di/commandModule\";\nimport { deviceActionModuleFactory } from \"@api/device-action/di/deviceActionModule\";\nimport { type DmkConfig } from \"@api/DmkConfig\";\nimport { type LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nimport { type TransportFactory } from \"@api/transport/model/Transport\";\nimport { configModuleFactory } from \"@internal/config/di/configModule\";\nimport { deviceModelModuleFactory } from \"@internal/device-model/di/deviceModelModule\";\nimport { deviceSessionModuleFactory } from \"@internal/device-session/di/deviceSessionModule\";\nimport { discoveryModuleFactory } from \"@internal/discovery/di/discoveryModule\";\nimport { loggerModuleFactory } from \"@internal/logger-publisher/di/loggerModule\";\nimport { managerApiModuleFactory } from \"@internal/manager-api/di/managerApiModule\";\nimport {\n DEFAULT_FIRMWARE_DISTRIBUTION_SALT,\n DEFAULT_MANAGER_API_BASE_URL,\n DEFAULT_MOCK_SERVER_BASE_URL,\n DEFAULT_PROVIDER,\n} from \"@internal/manager-api/model/Const\";\nimport { secureChannelModuleFactory } from \"@internal/secure-channel/di/secureChannelModule\";\nimport { DEFAULT_WEB_SOCKET_BASE_URL } from \"@internal/secure-channel/model/Const\";\nimport { sendModuleFactory } from \"@internal/send/di/sendModule\";\nimport { transportModuleFactory } from \"@internal/transport//di/transportModule\";\n\nexport type MakeContainerProps = {\n stub: boolean;\n transports: TransportFactory[];\n loggers: LoggerSubscriberService[];\n config: DmkConfig;\n};\n\nexport const makeContainer = ({\n stub = false,\n transports = [],\n loggers = [],\n config = {\n mockUrl: DEFAULT_MOCK_SERVER_BASE_URL,\n managerApiUrl: DEFAULT_MANAGER_API_BASE_URL,\n webSocketUrl: DEFAULT_WEB_SOCKET_BASE_URL,\n provider: DEFAULT_PROVIDER,\n firmwareDistributionSalt: DEFAULT_FIRMWARE_DISTRIBUTION_SALT,\n },\n}: Partial<MakeContainerProps>) => {\n const container = new Container();\n\n container.loadSync(\n configModuleFactory({ stub }),\n deviceModelModuleFactory({ stub }),\n transportModuleFactory({ stub, transports, config }),\n managerApiModuleFactory({ stub, config }),\n secureChannelModuleFactory({ stub, config }),\n discoveryModuleFactory({ stub }),\n loggerModuleFactory({ subscribers: loggers }),\n deviceSessionModuleFactory({ stub }),\n sendModuleFactory({ stub }),\n commandModuleFactory({ stub }),\n deviceActionModuleFactory({ stub }),\n // modules go here\n );\n\n return container;\n};\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA0B,qBAE1BC,EAAqC,yCACrCC,EAA0C,oDAI1CC,EAAoC,4CACpCC,EAAyC,uDACzCC,EAA2C,2DAC3CC,EAAuC,kDACvCC,EAAoC,sDACpCC,EAAwC,qDACxCC,EAKO,6CACPC,EAA2C,2DAC3CD,EAA4C,gDAC5CE,EAAkC,wCAClCC,EAAuC,mDAShC,MAAMd,EAAgB,CAAC,CAC5B,KAAAe,EAAO,GACP,WAAAC,EAAa,CAAC,EACd,QAAAC,EAAU,CAAC,EACX,OAAAC,EAAS,CACP,QAAS,+BACT,cAAe,+BACf,aAAc,8BACd,SAAU,mBACV,yBAA0B,oCAC5B,CACF,IAAmC,CACjC,MAAMC,EAAY,IAAI,YAEtB,OAAAA,EAAU,YACR,uBAAoB,CAAE,KAAAJ,CAAK,CAAC,KAC5B,4BAAyB,CAAE,KAAAA,CAAK,CAAC,KACjC,0BAAuB,CAAE,KAAAA,EAAM,WAAAC,EAAY,OAAAE,CAAO,CAAC,KACnD,2BAAwB,CAAE,KAAAH,EAAM,OAAAG,CAAO,CAAC,KACxC,8BAA2B,CAAE,KAAAH,EAAM,OAAAG,CAAO,CAAC,KAC3C,0BAAuB,CAAE,KAAAH,CAAK,CAAC,KAC/B,uBAAoB,CAAE,YAAaE,CAAQ,CAAC,KAC5C,8BAA2B,CAAE,KAAAF,CAAK,CAAC,KACnC,qBAAkB,CAAE,KAAAA,CAAK,CAAC,KAC1B,wBAAqB,CAAE,KAAAA,CAAK,CAAC,KAC7B,6BAA0B,CAAE,KAAAA,CAAK,CAAC,CAEpC,EAEOI,CACT",
|
6
6
|
"names": ["di_exports", "__export", "makeContainer", "__toCommonJS", "import_inversify", "import_commandModule", "import_deviceActionModule", "import_configModule", "import_deviceModelModule", "import_deviceSessionModule", "import_discoveryModule", "import_loggerModule", "import_managerApiModule", "import_Const", "import_secureChannelModule", "import_sendModule", "import_transportModule", "stub", "transports", "loggers", "config", "container"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var l=(t,o)=>{for(var e in o)i(t,e,{get:o[e],enumerable:!0})},R=(t,o,e,f)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of D(o))!S.call(t,a)&&a!==e&&i(t,a,{get:()=>o[a],enumerable:!(f=s(o,a))||f.enumerable});return t};var y=t=>R(i({},"__esModule",{value:!0}),t);var L={};l(L,{configModuleFactory:()=>F});module.exports=y(L);var m=require("inversify"),c=require("../../config/data/LocalConfigDataSource"),n=require("../../config/data/LocalConfigDataSource.stub"),u=require("../../config/data/RemoteConfigDataSource"),p=require("../../config/data/RemoteConfigDataSource.stub"),C=require("../../config/service/DefaultConfigService"),g=require("../../config/use-case/GetDmkVersionUseCase"),r=require("./configTypes");const F=({stub:t})=>new m.ContainerModule(({bind:o,rebindSync:e})=>{o(r.configTypes.LocalConfigDataSource).to(c.FileLocalConfigDataSource),o(r.configTypes.RemoteConfigDataSource).to(u.RestRemoteConfigDataSource),o(r.configTypes.GetDmkVersionUseCase).to(g.GetDmkVersionUseCase),o(r.configTypes.ConfigService).to(C.DefaultConfigService),t&&(e(r.configTypes.LocalConfigDataSource).to(n.StubLocalConfigDataSource),e(r.configTypes.RemoteConfigDataSource).to(p.StubRemoteConfigDataSource))});0&&(module.exports={configModuleFactory});
|
2
2
|
//# sourceMappingURL=configModule.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/config/di/configModule.ts"],
|
4
|
-
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { FileLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource\";\nimport { StubLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource.stub\";\nimport { RestRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource\";\nimport { StubRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource.stub\";\nimport { DefaultConfigService } from \"@internal/config/service/DefaultConfigService\";\nimport { GetDmkVersionUseCase } from \"@internal/config/use-case/GetDmkVersionUseCase\";\n\nimport { configTypes } from \"./configTypes\";\n\n// This module is used to configure the dependency injection container\n// This is where we will bind our interfaces to their implementations (or mocks...)\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const configModuleFactory = ({ stub }: FactoryProps) =>\n new ContainerModule((bind,
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA0C,uDAC1CA,EAA0C,4DAC1CC,EAA2C,wDAC3CA,EAA2C,6DAC3CC,EAAqC,yDACrCC,EAAqC,0DAErCC,EAA4B,yBAQrB,MAAMP,EAAsB,CAAC,CAAE,KAAAQ,CAAK,IACzC,IAAI,kBAAgB,
|
6
|
-
"names": ["configModule_exports", "__export", "configModuleFactory", "__toCommonJS", "import_inversify", "import_LocalConfigDataSource", "import_RemoteConfigDataSource", "import_DefaultConfigService", "import_GetDmkVersionUseCase", "import_configTypes", "stub", "bind", "
|
4
|
+
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { FileLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource\";\nimport { StubLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource.stub\";\nimport { RestRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource\";\nimport { StubRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource.stub\";\nimport { DefaultConfigService } from \"@internal/config/service/DefaultConfigService\";\nimport { GetDmkVersionUseCase } from \"@internal/config/use-case/GetDmkVersionUseCase\";\n\nimport { configTypes } from \"./configTypes\";\n\n// This module is used to configure the dependency injection container\n// This is where we will bind our interfaces to their implementations (or mocks...)\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const configModuleFactory = ({ stub }: FactoryProps) =>\n new ContainerModule(({ bind, rebindSync }) => {\n bind(configTypes.LocalConfigDataSource).to(FileLocalConfigDataSource);\n bind(configTypes.RemoteConfigDataSource).to(RestRemoteConfigDataSource);\n bind(configTypes.GetDmkVersionUseCase).to(GetDmkVersionUseCase);\n bind(configTypes.ConfigService).to(DefaultConfigService);\n\n if (stub) {\n // We can rebind our interfaces to their mock implementations\n rebindSync(configTypes.LocalConfigDataSource).to(\n StubLocalConfigDataSource,\n );\n rebindSync(configTypes.RemoteConfigDataSource).to(\n StubRemoteConfigDataSource,\n );\n }\n });\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA0C,uDAC1CA,EAA0C,4DAC1CC,EAA2C,wDAC3CA,EAA2C,6DAC3CC,EAAqC,yDACrCC,EAAqC,0DAErCC,EAA4B,yBAQrB,MAAMP,EAAsB,CAAC,CAAE,KAAAQ,CAAK,IACzC,IAAI,kBAAgB,CAAC,CAAE,KAAAC,EAAM,WAAAC,CAAW,IAAM,CAC5CD,EAAK,cAAY,qBAAqB,EAAE,GAAG,2BAAyB,EACpEA,EAAK,cAAY,sBAAsB,EAAE,GAAG,4BAA0B,EACtEA,EAAK,cAAY,oBAAoB,EAAE,GAAG,sBAAoB,EAC9DA,EAAK,cAAY,aAAa,EAAE,GAAG,sBAAoB,EAEnDD,IAEFE,EAAW,cAAY,qBAAqB,EAAE,GAC5C,2BACF,EACAA,EAAW,cAAY,sBAAsB,EAAE,GAC7C,4BACF,EAEJ,CAAC",
|
6
|
+
"names": ["configModule_exports", "__export", "configModuleFactory", "__toCommonJS", "import_inversify", "import_LocalConfigDataSource", "import_RemoteConfigDataSource", "import_DefaultConfigService", "import_GetDmkVersionUseCase", "import_configTypes", "stub", "bind", "rebindSync"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var a=require("inversify"),i=require("../../config/data/LocalConfigDataSource"),u=require("../../config/data/LocalConfigDataSource.stub"),f=require("../../config/data/RemoteConfigDataSource"),l=require("../../config/data/RemoteConfigDataSource.stub"),n=require("./configModule"),t=require("./configTypes");describe("configModuleFactory",()=>{describe("Default",()=>{let e,o;beforeEach(()=>{o=(0,n.configModuleFactory)({stub:!1}),e=new a.Container,e.
|
1
|
+
"use strict";var a=require("inversify"),i=require("../../config/data/LocalConfigDataSource"),u=require("../../config/data/LocalConfigDataSource.stub"),f=require("../../config/data/RemoteConfigDataSource"),l=require("../../config/data/RemoteConfigDataSource.stub"),n=require("./configModule"),t=require("./configTypes");describe("configModuleFactory",()=>{describe("Default",()=>{let e,o;beforeEach(()=>{o=(0,n.configModuleFactory)({stub:!1}),e=new a.Container,e.loadSync(o)}),it("should return the config module",()=>{expect(o).toBeDefined()}),it("should return none mocked data sources",()=>{const c=e.get(t.configTypes.LocalConfigDataSource),r=e.get(t.configTypes.RemoteConfigDataSource);expect(c).toBeInstanceOf(i.FileLocalConfigDataSource),expect(r).toBeInstanceOf(f.RestRemoteConfigDataSource)})}),describe("Mocked",()=>{let e,o;beforeEach(()=>{o=(0,n.configModuleFactory)({stub:!0}),e=new a.Container,e.loadSync(o)}),it("should return the config module",()=>{expect(o).toBeDefined()}),it("should return mocked data sources",()=>{const c=e.get(t.configTypes.LocalConfigDataSource),r=e.get(t.configTypes.RemoteConfigDataSource);expect(c).toBeInstanceOf(u.StubLocalConfigDataSource),expect(r).toBeInstanceOf(l.StubRemoteConfigDataSource)})})});
|
2
2
|
//# sourceMappingURL=configModule.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/config/di/configModule.test.ts"],
|
4
|
-
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { FileLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource\";\nimport { StubLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource.stub\";\nimport { RestRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource\";\nimport { StubRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource.stub\";\n\nimport { configModuleFactory } from \"./configModule\";\nimport { configTypes } from \"./configTypes\";\n\ndescribe(\"configModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof configModuleFactory>;\n beforeEach(() => {\n mod = configModuleFactory({ stub: false });\n container = new Container();\n container.
|
5
|
-
"mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA0C,uDAC1CA,EAA0C,4DAC1CC,EAA2C,wDAC3CA,EAA2C,6DAE3CC,EAAoC,0BACpCC,EAA4B,yBAE5B,SAAS,sBAAuB,IAAM,CACpC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,uBAAoB,CAAE,KAAM,EAAM,CAAC,EACzCD,EAAY,IAAI,YAChBA,EAAU,
|
4
|
+
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { FileLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource\";\nimport { StubLocalConfigDataSource } from \"@internal/config/data/LocalConfigDataSource.stub\";\nimport { RestRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource\";\nimport { StubRemoteConfigDataSource } from \"@internal/config/data/RemoteConfigDataSource.stub\";\n\nimport { configModuleFactory } from \"./configModule\";\nimport { configTypes } from \"./configTypes\";\n\ndescribe(\"configModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof configModuleFactory>;\n beforeEach(() => {\n mod = configModuleFactory({ stub: false });\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return none mocked data sources\", () => {\n const localDataSource = container.get(configTypes.LocalConfigDataSource);\n const remoteDataSource = container.get(\n configTypes.RemoteConfigDataSource,\n );\n expect(localDataSource).toBeInstanceOf(FileLocalConfigDataSource);\n expect(remoteDataSource).toBeInstanceOf(RestRemoteConfigDataSource);\n });\n });\n\n describe(\"Mocked\", () => {\n let container: Container;\n let mod: ReturnType<typeof configModuleFactory>;\n beforeEach(() => {\n mod = configModuleFactory({ stub: true });\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return mocked data sources\", () => {\n const localDataSource = container.get(configTypes.LocalConfigDataSource);\n const remoteDataSource = container.get(\n configTypes.RemoteConfigDataSource,\n );\n expect(localDataSource).toBeInstanceOf(StubLocalConfigDataSource);\n expect(remoteDataSource).toBeInstanceOf(StubRemoteConfigDataSource);\n });\n });\n});\n"],
|
5
|
+
"mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA0C,uDAC1CA,EAA0C,4DAC1CC,EAA2C,wDAC3CA,EAA2C,6DAE3CC,EAAoC,0BACpCC,EAA4B,yBAE5B,SAAS,sBAAuB,IAAM,CACpC,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,uBAAoB,CAAE,KAAM,EAAM,CAAC,EACzCD,EAAY,IAAI,YAChBA,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,yCAA0C,IAAM,CACjD,MAAMC,EAAkBF,EAAU,IAAI,cAAY,qBAAqB,EACjEG,EAAmBH,EAAU,IACjC,cAAY,sBACd,EACA,OAAOE,CAAe,EAAE,eAAe,2BAAyB,EAChE,OAAOC,CAAgB,EAAE,eAAe,4BAA0B,CACpE,CAAC,CACH,CAAC,EAED,SAAS,SAAU,IAAM,CACvB,IAAIH,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,uBAAoB,CAAE,KAAM,EAAK,CAAC,EACxCD,EAAY,IAAI,YAChBA,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,oCAAqC,IAAM,CAC5C,MAAMC,EAAkBF,EAAU,IAAI,cAAY,qBAAqB,EACjEG,EAAmBH,EAAU,IACjC,cAAY,sBACd,EACA,OAAOE,CAAe,EAAE,eAAe,2BAAyB,EAChE,OAAOC,CAAgB,EAAE,eAAe,4BAA0B,CACpE,CAAC,CACH,CAAC,CACH,CAAC",
|
6
6
|
"names": ["import_inversify", "import_LocalConfigDataSource", "import_RemoteConfigDataSource", "import_configModule", "import_configTypes", "container", "mod", "localDataSource", "remoteDataSource"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var c=Object.defineProperty;var
|
1
|
+
"use strict";var c=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var n=(e,o)=>{for(var r in o)c(e,r,{get:o[r],enumerable:!0})},s=(e,o,r,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of m(o))!M.call(e,t)&&t!==r&&c(e,t,{get:()=>o[t],enumerable:!(a=l(o,t))||a.enumerable});return e};var u=e=>s(c({},"__esModule",{value:!0}),e);var f={};n(f,{deviceModelModuleFactory:()=>y});module.exports=u(f);var i=require("inversify"),d=require("../../../api/device-model/data/StaticDeviceModelDataSource"),p=require("./deviceModelTypes");const y=({stub:e})=>new i.ContainerModule(({bind:o})=>{o(p.deviceModelTypes.DeviceModelDataSource).to(d.StaticDeviceModelDataSource)});0&&(module.exports={deviceModelModuleFactory});
|
2
2
|
//# sourceMappingURL=deviceModelModule.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-model/di/deviceModelModule.ts"],
|
4
|
-
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\n\nimport { deviceModelTypes } from \"./deviceModelTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const deviceModelModuleFactory = ({ stub }: FactoryProps) =>\n new ContainerModule((bind
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA4C,8DAE5CC,EAAiC,8BAM1B,MAAMJ,EAA2B,CAAC,CAAE,KAAAK,CAAK,IAC9C,IAAI,kBAAgB,
|
6
|
-
"names": ["deviceModelModule_exports", "__export", "deviceModelModuleFactory", "__toCommonJS", "import_inversify", "import_StaticDeviceModelDataSource", "import_deviceModelTypes", "stub", "bind"
|
4
|
+
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\n\nimport { deviceModelTypes } from \"./deviceModelTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const deviceModelModuleFactory = ({ stub }: FactoryProps) =>\n new ContainerModule(({ bind }) => {\n bind(deviceModelTypes.DeviceModelDataSource).to(\n StaticDeviceModelDataSource,\n );\n\n if (stub) {\n // We can rebind our interfaces to their mock implementations\n // rebind(...).to(....);\n }\n });\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA4C,8DAE5CC,EAAiC,8BAM1B,MAAMJ,EAA2B,CAAC,CAAE,KAAAK,CAAK,IAC9C,IAAI,kBAAgB,CAAC,CAAE,KAAAC,CAAK,IAAM,CAChCA,EAAK,mBAAiB,qBAAqB,EAAE,GAC3C,6BACF,CAMF,CAAC",
|
6
|
+
"names": ["deviceModelModule_exports", "__export", "deviceModelModuleFactory", "__toCommonJS", "import_inversify", "import_StaticDeviceModelDataSource", "import_deviceModelTypes", "stub", "bind"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var t=require("inversify"),
|
1
|
+
"use strict";var t=require("inversify"),c=require("../../../api/device-model/data/StaticDeviceModelDataSource"),d=require("./deviceModelModule"),r=require("./deviceModelTypes");describe("deviceModelModuleFactory",()=>{let e,o;beforeEach(()=>{o=(0,d.deviceModelModuleFactory)({stub:!1}),e=new t.Container,e.loadSync(o)}),it("should return the device module",()=>{expect(o).toBeDefined()}),it("should return none mocked services and data sources",()=>{const i=e.get(r.deviceModelTypes.DeviceModelDataSource);expect(i).toBeInstanceOf(c.StaticDeviceModelDataSource)})});
|
2
2
|
//# sourceMappingURL=deviceModelModule.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-model/di/deviceModelModule.test.ts"],
|
4
|
-
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\n\nimport { deviceModelModuleFactory } from \"./deviceModelModule\";\nimport { deviceModelTypes } from \"./deviceModelTypes\";\n\ndescribe(\"deviceModelModuleFactory\", () => {\n let container: Container;\n let mod: ReturnType<typeof deviceModelModuleFactory>;\n beforeEach(() => {\n mod = deviceModelModuleFactory({ stub: false });\n container = new Container();\n container.
|
5
|
-
"mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA4C,8DAE5CC,EAAyC,+BACzCC,EAAiC,8BAEjC,SAAS,2BAA4B,IAAM,CACzC,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,4BAAyB,CAAE,KAAM,EAAM,CAAC,EAC9CD,EAAY,IAAI,YAChBA,EAAU,
|
4
|
+
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\n\nimport { deviceModelModuleFactory } from \"./deviceModelModule\";\nimport { deviceModelTypes } from \"./deviceModelTypes\";\n\ndescribe(\"deviceModelModuleFactory\", () => {\n let container: Container;\n let mod: ReturnType<typeof deviceModelModuleFactory>;\n beforeEach(() => {\n mod = deviceModelModuleFactory({ stub: false });\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the device module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return none mocked services and data sources\", () => {\n const deviceModelDataSource = container.get(\n deviceModelTypes.DeviceModelDataSource,\n );\n expect(deviceModelDataSource).toBeInstanceOf(StaticDeviceModelDataSource);\n });\n});\n"],
|
5
|
+
"mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA4C,8DAE5CC,EAAyC,+BACzCC,EAAiC,8BAEjC,SAAS,2BAA4B,IAAM,CACzC,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,4BAAyB,CAAE,KAAM,EAAM,CAAC,EAC9CD,EAAY,IAAI,YAChBA,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,sDAAuD,IAAM,CAC9D,MAAMC,EAAwBF,EAAU,IACtC,mBAAiB,qBACnB,EACA,OAAOE,CAAqB,EAAE,eAAe,6BAA2B,CAC1E,CAAC,CACH,CAAC",
|
6
6
|
"names": ["import_inversify", "import_StaticDeviceModelDataSource", "import_deviceModelModule", "import_deviceModelTypes", "container", "mod", "deviceModelDataSource"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var S=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var C=(r,e)=>{for(var t in e)S(r,t,{get:e[t],enumerable:!0})},D=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of y(e))!A.call(r,o)&&o!==t&&S(r,o,{get:()=>e[o],enumerable:!(i=d(e,o))||i.enumerable});return r};var F=r=>D(S({},"__esModule",{value:!0}),r);var U={};C(U,{deviceSessionModuleFactory:()=>R});module.exports=F(U);var a=require("inversify"),u=require("../../../api/device-session/use-case/DisableDeviceSessionRefresher"),v=require("../../device-session/service/DefaultApduReceiverService"),m=require("../../device-session/service/DefaultApduSenderService"),g=require("../../device-session/service/DefaultDeviceSessionService"),l=require("../../device-session/use-case/CloseSessionsUseCase"),f=require("../../device-session/use-case/GetDeviceSessionStateUseCase"),p=require("../../logger-publisher/di/loggerTypes"),n=require("../../../../src/di.stub"),s=require("./deviceSessionTypes");const R=({stub:r}={stub:!1})=>new a.ContainerModule(({bind:e,rebindSync:t})=>{e(s.deviceSessionTypes.ApduSenderServiceFactory).toFactory(i=>{const o=i.get(p.loggerTypes.LoggerPublisherServiceFactory);return c=>new m.DefaultApduSenderService(c,o)}),e(s.deviceSessionTypes.ApduReceiverServiceFactory).toFactory(i=>{const o=i.get(p.loggerTypes.LoggerPublisherServiceFactory);return(c={})=>new v.DefaultApduReceiverService(c,o)}),e(s.deviceSessionTypes.DeviceSessionService).to(g.DefaultDeviceSessionService).inSingletonScope(),e(s.deviceSessionTypes.GetDeviceSessionStateUseCase).to(f.GetDeviceSessionStateUseCase),e(s.deviceSessionTypes.CloseSessionsUseCase).to(l.CloseSessionsUseCase),e(s.deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(u.DisableDeviceSessionRefresherUseCase),r&&(t(s.deviceSessionTypes.GetDeviceSessionStateUseCase).to(n.StubUseCase),t(s.deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(n.StubUseCase))});0&&(module.exports={deviceSessionModuleFactory});
|
2
2
|
//# sourceMappingURL=deviceSessionModule.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/di/deviceSessionModule.ts"],
|
4
|
-
"sourcesContent": ["import { ContainerModule, type
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,
|
6
|
-
"names": ["deviceSessionModule_exports", "__export", "deviceSessionModuleFactory", "__toCommonJS", "import_inversify", "import_DisableDeviceSessionRefresher", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_DefaultDeviceSessionService", "import_CloseSessionsUseCase", "import_GetDeviceSessionStateUseCase", "import_loggerTypes", "import_di", "import_deviceSessionTypes", "stub", "bind", "
|
4
|
+
"sourcesContent": ["import { ContainerModule, type Factory } from \"inversify\";\n\nimport { type ApduReceiverService } from \"@api/device-session/service/ApduReceiverService\";\nimport { type ApduReceiverConstructorArgs } from \"@api/device-session/service/ApduReceiverService\";\nimport { type ApduSenderService } from \"@api/device-session/service/ApduSenderService\";\nimport { type ApduSenderServiceConstructorArgs } from \"@api/device-session/service/ApduSenderService\";\nimport { DisableDeviceSessionRefresherUseCase } from \"@api/device-session/use-case/DisableDeviceSessionRefresher\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { DefaultApduReceiverService } from \"@internal/device-session/service/DefaultApduReceiverService\";\nimport { DefaultApduSenderService } from \"@internal/device-session/service/DefaultApduSenderService\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { CloseSessionsUseCase } from \"@internal/device-session/use-case/CloseSessionsUseCase\";\nimport { GetDeviceSessionStateUseCase } from \"@internal/device-session/use-case/GetDeviceSessionStateUseCase\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { deviceSessionTypes } from \"./deviceSessionTypes\";\n\nexport type DeviceSessionModuleArgs = Partial<{\n stub: boolean;\n}>;\n\nexport const deviceSessionModuleFactory = (\n { stub }: DeviceSessionModuleArgs = { stub: false },\n) =>\n new ContainerModule(({ bind, rebindSync }) => {\n bind<Factory<ApduSenderService>>(\n deviceSessionTypes.ApduSenderServiceFactory,\n ).toFactory((context) => {\n const logger = context.get<(name: string) => LoggerPublisherService>(\n loggerTypes.LoggerPublisherServiceFactory,\n );\n\n return (args: ApduSenderServiceConstructorArgs) => {\n return new DefaultApduSenderService(args, logger);\n };\n });\n\n bind<Factory<ApduReceiverService>>(\n deviceSessionTypes.ApduReceiverServiceFactory,\n ).toFactory((context) => {\n const logger = context.get<(name: string) => LoggerPublisherService>(\n loggerTypes.LoggerPublisherServiceFactory,\n );\n\n return (args: ApduReceiverConstructorArgs = {}) => {\n return new DefaultApduReceiverService(args, logger);\n };\n });\n\n bind(deviceSessionTypes.DeviceSessionService)\n .to(DefaultDeviceSessionService)\n .inSingletonScope();\n\n bind(deviceSessionTypes.GetDeviceSessionStateUseCase).to(\n GetDeviceSessionStateUseCase,\n );\n bind(deviceSessionTypes.CloseSessionsUseCase).to(CloseSessionsUseCase);\n bind(deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(\n DisableDeviceSessionRefresherUseCase,\n );\n\n if (stub) {\n rebindSync(deviceSessionTypes.GetDeviceSessionStateUseCase).to(\n StubUseCase,\n );\n rebindSync(deviceSessionTypes.DisableDeviceSessionRefresherUseCase).to(\n StubUseCase,\n );\n }\n });\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA8C,qBAM9CC,EAAqD,sEAErDC,EAA2C,uEAC3CC,EAAyC,qEACzCC,EAA4C,wEAC5CC,EAAqC,kEACrCC,EAA6C,0EAC7CC,EAA4B,qDAC5BC,EAA4B,6BAE5BC,EAAmC,gCAM5B,MAAMX,EAA6B,CACxC,CAAE,KAAAY,CAAK,EAA6B,CAAE,KAAM,EAAM,IAElD,IAAI,kBAAgB,CAAC,CAAE,KAAAC,EAAM,WAAAC,CAAW,IAAM,CAC5CD,EACE,qBAAmB,wBACrB,EAAE,UAAWE,GAAY,CACvB,MAAMC,EAASD,EAAQ,IACrB,cAAY,6BACd,EAEA,OAAQE,GACC,IAAI,2BAAyBA,EAAMD,CAAM,CAEpD,CAAC,EAEDH,EACE,qBAAmB,0BACrB,EAAE,UAAWE,GAAY,CACvB,MAAMC,EAASD,EAAQ,IACrB,cAAY,6BACd,EAEA,MAAO,CAACE,EAAoC,CAAC,IACpC,IAAI,6BAA2BA,EAAMD,CAAM,CAEtD,CAAC,EAEDH,EAAK,qBAAmB,oBAAoB,EACzC,GAAG,6BAA2B,EAC9B,iBAAiB,EAEpBA,EAAK,qBAAmB,4BAA4B,EAAE,GACpD,8BACF,EACAA,EAAK,qBAAmB,oBAAoB,EAAE,GAAG,sBAAoB,EACrEA,EAAK,qBAAmB,oCAAoC,EAAE,GAC5D,sCACF,EAEID,IACFE,EAAW,qBAAmB,4BAA4B,EAAE,GAC1D,aACF,EACAA,EAAW,qBAAmB,oCAAoC,EAAE,GAClE,aACF,EAEJ,CAAC",
|
6
|
+
"names": ["deviceSessionModule_exports", "__export", "deviceSessionModuleFactory", "__toCommonJS", "import_inversify", "import_DisableDeviceSessionRefresher", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_DefaultDeviceSessionService", "import_CloseSessionsUseCase", "import_GetDeviceSessionStateUseCase", "import_loggerTypes", "import_di", "import_deviceSessionTypes", "stub", "bind", "rebindSync", "context", "logger", "args"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var t=require("inversify"),i=require("./deviceSessionModule");describe("deviceSessionModuleFactory",()=>{describe("Default",()=>{let o,e;beforeEach(()=>{e=(0,i.deviceSessionModuleFactory)(),o=new t.Container,o.
|
1
|
+
"use strict";var t=require("inversify"),i=require("./deviceSessionModule");describe("deviceSessionModuleFactory",()=>{describe("Default",()=>{let o,e;beforeEach(()=>{e=(0,i.deviceSessionModuleFactory)(),o=new t.Container,o.loadSync(e)}),it("should return the config module",()=>{expect(e).toBeDefined()})})});
|
2
2
|
//# sourceMappingURL=deviceSessionModule.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/di/deviceSessionModule.test.ts"],
|
4
|
-
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { deviceSessionModuleFactory } from \"./deviceSessionModule\";\n\ndescribe(\"deviceSessionModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof deviceSessionModuleFactory>;\n beforeEach(() => {\n mod = deviceSessionModuleFactory();\n container = new Container();\n container.
|
5
|
-
"mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA2C,iCAE3C,SAAS,6BAA8B,IAAM,CAC3C,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,8BAA2B,EACjCD,EAAY,IAAI,YAChBA,EAAU,
|
4
|
+
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { deviceSessionModuleFactory } from \"./deviceSessionModule\";\n\ndescribe(\"deviceSessionModuleFactory\", () => {\n describe(\"Default\", () => {\n let container: Container;\n let mod: ReturnType<typeof deviceSessionModuleFactory>;\n beforeEach(() => {\n mod = deviceSessionModuleFactory();\n container = new Container();\n container.loadSync(mod);\n });\n\n it(\"should return the config module\", () => {\n expect(mod).toBeDefined();\n });\n });\n});\n"],
|
5
|
+
"mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA2C,iCAE3C,SAAS,6BAA8B,IAAM,CAC3C,SAAS,UAAW,IAAM,CACxB,IAAIC,EACAC,EACJ,WAAW,IAAM,CACfA,KAAM,8BAA2B,EACjCD,EAAY,IAAI,YAChBA,EAAU,SAASC,CAAG,CACxB,CAAC,EAED,GAAG,kCAAmC,IAAM,CAC1C,OAAOA,CAAG,EAAE,YAAY,CAC1B,CAAC,CACH,CAAC,CACH,CAAC",
|
6
6
|
"names": ["import_inversify", "import_deviceSessionModule", "container", "mod"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var a=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var b=(n,e)=>{for(var t in e)a(n,t,{get:e[t],enumerable:!0})},y=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of C(e))!R.call(n,i)&&i!==t&&a(n,i,{get:()=>e[i],enumerable:!(s=A(e,i))||s.enumerable});return n};var T=n=>y(a({},"__esModule",{value:!0}),n);var I={};b(I,{DeviceSession:()=>O});module.exports=T(I);var v=require("rxjs"),d=require("uuid"),h=require("../../../api/command/utils/CommandUtils"),p=require("../../../api/device/DeviceStatus"),S=require("../../../api/device-session/DeviceSessionState"),u=require("../../device-session/data/DeviceSessionRefresherConst"),m=require("../../device-session/service/MutexService"),D=require("../../device-session/service/RefresherService"),l=require("./DevicePinger"),o=require("./DeviceSessionEventDispatcher"),_=require("./DeviceSessionRefresher"),f=require("./DeviceSessionStateHandler");class O{_id;_connectedDevice;_deviceState;_managerApiService;_secureChannelService;_logger;_refresherOptions;_pinger;_deviceSessionRefresher;_refresherService;_commandMutex=new m.MutexService;_sessionEventDispatcher=new o.DeviceSessionEventDispatcher;constructor({connectedDevice:e,id:t=(0,d.v4)()},s,i,r,g){this._id=t,this._connectedDevice=e,this._logger=s("device-session"),this._managerApiService=i,this._secureChannelService=r,this._refresherOptions={...u.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,...g},this._deviceState=new v.BehaviorSubject({sessionStateType:S.DeviceSessionStateType.Connected,deviceStatus:p.DeviceStatus.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id}),this._pinger=new l.DevicePinger(s,e,this._sessionEventDispatcher,(c,E)=>this.sendCommand(c,E)),this._deviceSessionRefresher=new _.DeviceSessionRefresher(s,this._refresherOptions,this._sessionEventDispatcher,this._connectedDevice),new f.DeviceSessionStateHandler(s,this._sessionEventDispatcher,this._connectedDevice,this._deviceState,c=>this.setDeviceSessionState(c)),this._refresherService=new D.RefresherService(s,{start:()=>this._deviceSessionRefresher.restartRefresher(),stop:()=>this._deviceSessionRefresher.stopRefresher()})}async initialiseSession(){try{await this._pinger.ping()}catch(e){throw this._logger.error("Error while initialising session",{data:{error:e}}),e}finally{this._refresherOptions.isRefresherDisabled||this._deviceSessionRefresher.startRefresher()}}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}getDeviceSessionState(){return this._deviceState.getValue()}setDeviceSessionState(e){this._deviceState.next(e)}async sendApdu(e,t={isPolling:!1,triggersDisconnection:!1,abortTimeout:void 0}){const s=await this._commandMutex.lock();try{this._sessionEventDispatcher.dispatch({eventName:o.SessionEvents.DEVICE_STATE_UPDATE_BUSY});const i=await this._connectedDevice.sendApdu(e,t.triggersDisconnection,t.abortTimeout);return i.ifRight(r=>{h.CommandUtils.isLockedDeviceResponse(r)?this._sessionEventDispatcher.dispatch({eventName:o.SessionEvents.DEVICE_STATE_UPDATE_LOCKED}):this._sessionEventDispatcher.dispatch({eventName:o.SessionEvents.DEVICE_STATE_UPDATE_CONNECTED})}).ifLeft(()=>{this._sessionEventDispatcher.dispatch({eventName:o.SessionEvents.DEVICE_STATE_UPDATE_CONNECTED})}),i}finally{s()}}async sendCommand(e,t){const s=e.getApdu();return(await this.sendApdu(s.getRawApdu(),{isPolling:!1,triggersDisconnection:e.triggersDisconnection??!1,abortTimeout:t})).caseOf({Left:r=>{throw r},Right:r=>e.parseResponse(r,this._connectedDevice.deviceModel.id)})}executeDeviceAction(e){const{observable:t,cancel:s}=e._execute({sendApdu:async i=>this.sendApdu(i),sendCommand:async(i,r)=>this.sendCommand(i,r),getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:i=>(this.setDeviceSessionState(i),this._deviceState.getValue()),disableRefresher:i=>this._refresherService.disableRefresher(i),getManagerApiService:()=>this._managerApiService,getSecureChannelService:()=>this._secureChannelService});return{observable:t,cancel:s}}close(){this._updateDeviceStatus(p.DeviceStatus.NOT_CONNECTED),this._deviceState.complete(),this._deviceSessionRefresher.stopRefresher()}disableRefresher(e){return this._refresherService.disableRefresher(e)}_updateDeviceStatus(e){const t=this._deviceState.getValue();this._deviceState.next({...t,deviceStatus:e})}}0&&(module.exports={DeviceSession});
|
1
|
+
"use strict";var a=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var b=(n,e)=>{for(var t in e)a(n,t,{get:e[t],enumerable:!0})},y=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of C(e))!R.call(n,i)&&i!==t&&a(n,i,{get:()=>e[i],enumerable:!(s=A(e,i))||s.enumerable});return n};var T=n=>y(a({},"__esModule",{value:!0}),n);var I={};b(I,{DeviceSession:()=>O});module.exports=T(I);var v=require("rxjs"),d=require("uuid"),h=require("../../../api/command/utils/CommandUtils"),p=require("../../../api/device/DeviceStatus"),S=require("../../../api/device-session/DeviceSessionState"),u=require("../../device-session/data/DeviceSessionRefresherConst"),m=require("../../device-session/service/MutexService"),D=require("../../device-session/service/RefresherService"),l=require("./DevicePinger"),o=require("./DeviceSessionEventDispatcher"),_=require("./DeviceSessionRefresher"),f=require("./DeviceSessionStateHandler");class O{_id;_connectedDevice;_deviceState;_managerApiService;_secureChannelService;_logger;_refresherOptions;_pinger;_deviceSessionRefresher;_refresherService;_commandMutex=new m.MutexService;_sessionEventDispatcher=new o.DeviceSessionEventDispatcher;constructor({connectedDevice:e,id:t=(0,d.v4)()},s,i,r,g){this._id=t,this._connectedDevice=e,this._logger=s("device-session"),this._managerApiService=i,this._secureChannelService=r,this._refresherOptions={...u.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,...g},this._deviceState=new v.BehaviorSubject({sessionStateType:S.DeviceSessionStateType.Connected,deviceStatus:p.DeviceStatus.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id}),this._pinger=new l.DevicePinger(s,e,this._sessionEventDispatcher,(c,E)=>this.sendCommand(c,E)),this._deviceSessionRefresher=new _.DeviceSessionRefresher(s,this._refresherOptions,this._sessionEventDispatcher,this._connectedDevice),new f.DeviceSessionStateHandler(s,this._sessionEventDispatcher,this._connectedDevice,this._deviceState,c=>this.setDeviceSessionState(c)),this._refresherService=new D.RefresherService(s,{start:()=>this._deviceSessionRefresher.restartRefresher(),stop:()=>this._deviceSessionRefresher.stopRefresher()})}async initialiseSession(){try{await this._pinger.ping()}catch(e){throw this._logger.error("Error while initialising session",{data:{error:e}}),e}finally{this._refresherOptions.isRefresherDisabled||this._deviceSessionRefresher.startRefresher()}}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}getDeviceSessionState(){return this._deviceState.getValue()}setDeviceSessionState(e){this._deviceState.next(e)}async sendApdu(e,t={isPolling:!1,triggersDisconnection:!1,abortTimeout:void 0}){const s=await this._commandMutex.lock();try{this._sessionEventDispatcher.dispatch({eventName:o.SessionEvents.DEVICE_STATE_UPDATE_BUSY});const i=await this._connectedDevice.sendApdu(e,t.triggersDisconnection,t.abortTimeout);return i.ifRight(r=>{h.CommandUtils.isLockedDeviceResponse(r)?this._sessionEventDispatcher.dispatch({eventName:o.SessionEvents.DEVICE_STATE_UPDATE_LOCKED}):this._sessionEventDispatcher.dispatch({eventName:o.SessionEvents.DEVICE_STATE_UPDATE_CONNECTED})}).ifLeft(()=>{this._sessionEventDispatcher.dispatch({eventName:o.SessionEvents.DEVICE_STATE_UPDATE_CONNECTED})}),i}finally{s()}}async sendCommand(e,t){const s=e.getApdu();return(await this.sendApdu(s.getRawApdu(),{isPolling:!1,triggersDisconnection:e.triggersDisconnection??!1,abortTimeout:t})).caseOf({Left:r=>{throw r},Right:r=>e.parseResponse(r,this._connectedDevice.deviceModel.id)})}executeDeviceAction(e){const{observable:t,cancel:s}=e._execute({sendApdu:async i=>this.sendApdu(i),sendCommand:async(i,r)=>this.sendCommand(i,r),getDeviceModel:()=>this._connectedDevice.deviceModel,getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:i=>(this.setDeviceSessionState(i),this._deviceState.getValue()),disableRefresher:i=>this._refresherService.disableRefresher(i),getManagerApiService:()=>this._managerApiService,getSecureChannelService:()=>this._secureChannelService});return{observable:t,cancel:s}}close(){this._updateDeviceStatus(p.DeviceStatus.NOT_CONNECTED),this._deviceState.complete(),this._deviceSessionRefresher.stopRefresher()}disableRefresher(e){return this._refresherService.disableRefresher(e)}_updateDeviceStatus(e){const t=this._deviceState.getValue();this._deviceState.next({...t,deviceStatus:e})}}0&&(module.exports={DeviceSession});
|
2
2
|
//# sourceMappingURL=DeviceSession.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/model/DeviceSession.ts"],
|
4
|
-
"sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { BehaviorSubject, type Observable } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { type DmkError } from \"@api/Error\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { MutexService } from \"@internal/device-session/service/MutexService\";\nimport { RefresherService } from \"@internal/device-session/service/RefresherService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { DevicePinger } from \"./DevicePinger\";\nimport {\n DeviceSessionEventDispatcher,\n SessionEvents,\n} from \"./DeviceSessionEventDispatcher\";\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\nimport { DeviceSessionStateHandler } from \"./DeviceSessionStateHandler\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\nexport type DeviceSessionRefresherOptions = {\n isRefresherDisabled: boolean;\n pollingInterval?: number;\n};\n\ntype SendApduOptions = {\n isPolling?: boolean;\n triggersDisconnection?: boolean;\n abortTimeout?: number;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _managerApiService: ManagerApiService;\n private readonly _secureChannelService: SecureChannelService;\n private readonly _logger: LoggerPublisherService;\n private readonly _refresherOptions: DeviceSessionRefresherOptions;\n private _pinger: DevicePinger;\n private _deviceSessionRefresher: DeviceSessionRefresher;\n private readonly _refresherService: RefresherService;\n private _commandMutex = new MutexService();\n private _sessionEventDispatcher = new DeviceSessionEventDispatcher();\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n secureChannelService: SecureChannelService,\n deviceSessionRefresherOptions: DeviceSessionRefresherOptions | undefined,\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._logger = loggerModuleFactory(\"device-session\");\n this._managerApiService = managerApiService;\n this._secureChannelService = secureChannelService;\n this._refresherOptions = {\n ...DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n ...deviceSessionRefresherOptions,\n };\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n });\n\n this._pinger = new DevicePinger(\n loggerModuleFactory,\n connectedDevice,\n this._sessionEventDispatcher,\n (command, abortTimeout) => this.sendCommand(command, abortTimeout),\n );\n this._deviceSessionRefresher = new DeviceSessionRefresher(\n loggerModuleFactory,\n this._refresherOptions,\n this._sessionEventDispatcher,\n this._connectedDevice,\n );\n new DeviceSessionStateHandler(\n loggerModuleFactory,\n this._sessionEventDispatcher,\n this._connectedDevice,\n this._deviceState,\n (state) => this.setDeviceSessionState(state),\n );\n\n this._refresherService = new RefresherService(loggerModuleFactory, {\n start: () => this._deviceSessionRefresher.restartRefresher(),\n stop: () => this._deviceSessionRefresher.stopRefresher(),\n });\n }\n\n public async initialiseSession(): Promise<void> {\n try {\n await this._pinger.ping();\n } catch (error) {\n this._logger.error(\"Error while initialising session\", {\n data: { error },\n });\n throw error;\n } finally {\n if (!this._refresherOptions.isRefresherDisabled) {\n this._deviceSessionRefresher.startRefresher();\n }\n }\n }\n\n public get id(): DeviceSessionId {\n return this._id;\n }\n\n public get connectedDevice(): TransportConnectedDevice {\n return this._connectedDevice;\n }\n\n public get state(): Observable<DeviceSessionState> {\n return this._deviceState.asObservable();\n }\n\n public getDeviceSessionState(): DeviceSessionState {\n return this._deviceState.getValue();\n }\n\n public setDeviceSessionState(state: DeviceSessionState): void {\n this._deviceState.next(state);\n }\n\n public async sendApdu(\n rawApdu: Uint8Array,\n options: SendApduOptions = {\n isPolling: false,\n triggersDisconnection: false,\n abortTimeout: undefined,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n const release = await this._commandMutex.lock();\n\n try {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_BUSY,\n });\n const result = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n options.abortTimeout,\n );\n\n result\n .ifRight((response: ApduResponse) => {\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n } else {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n }\n })\n .ifLeft(() => {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n });\n return result;\n } finally {\n release();\n }\n }\n\n public async sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n const apdu = command.getApdu();\n\n const response = await this.sendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n abortTimeout,\n });\n\n return response.caseOf({\n Left: (err) => {\n throw err;\n },\n Right: (r) =>\n command.parseResponse(r, this._connectedDevice.deviceModel.id),\n });\n }\n\n public executeDeviceAction<\n Output,\n Input,\n E extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, E, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, E, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendApdu: async (apdu: Uint8Array) => this.sendApdu(apdu),\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n abortTimeout?: number,\n ) => this.sendCommand(command, abortTimeout),\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n disableRefresher: (blockerId: string) =>\n this._refresherService.disableRefresher(blockerId),\n getManagerApiService: () => this._managerApiService,\n getSecureChannelService: () => this._secureChannelService,\n });\n return { observable, cancel };\n }\n\n public close(): void {\n this._updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._deviceSessionRefresher.stopRefresher();\n }\n\n public disableRefresher(id: string): () => void {\n return this._refresherService.disableRefresher(id);\n }\n\n private _updateDeviceStatus(deviceStatus: DeviceStatus): void {\n const state = this._deviceState.getValue();\n this._deviceState.next({ ...state, deviceStatus });\n }\n}\n"],
|
5
|
-
"mappings": "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",
|
4
|
+
"sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { BehaviorSubject, type Observable } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { type DmkError } from \"@api/Error\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { MutexService } from \"@internal/device-session/service/MutexService\";\nimport { RefresherService } from \"@internal/device-session/service/RefresherService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { DevicePinger } from \"./DevicePinger\";\nimport {\n DeviceSessionEventDispatcher,\n SessionEvents,\n} from \"./DeviceSessionEventDispatcher\";\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\nimport { DeviceSessionStateHandler } from \"./DeviceSessionStateHandler\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\nexport type DeviceSessionRefresherOptions = {\n isRefresherDisabled: boolean;\n pollingInterval?: number;\n};\n\ntype SendApduOptions = {\n isPolling?: boolean;\n triggersDisconnection?: boolean;\n abortTimeout?: number;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _managerApiService: ManagerApiService;\n private readonly _secureChannelService: SecureChannelService;\n private readonly _logger: LoggerPublisherService;\n private readonly _refresherOptions: DeviceSessionRefresherOptions;\n private _pinger: DevicePinger;\n private _deviceSessionRefresher: DeviceSessionRefresher;\n private readonly _refresherService: RefresherService;\n private _commandMutex = new MutexService();\n private _sessionEventDispatcher = new DeviceSessionEventDispatcher();\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n secureChannelService: SecureChannelService,\n deviceSessionRefresherOptions: DeviceSessionRefresherOptions | undefined,\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._logger = loggerModuleFactory(\"device-session\");\n this._managerApiService = managerApiService;\n this._secureChannelService = secureChannelService;\n this._refresherOptions = {\n ...DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n ...deviceSessionRefresherOptions,\n };\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n });\n\n this._pinger = new DevicePinger(\n loggerModuleFactory,\n connectedDevice,\n this._sessionEventDispatcher,\n (command, abortTimeout) => this.sendCommand(command, abortTimeout),\n );\n this._deviceSessionRefresher = new DeviceSessionRefresher(\n loggerModuleFactory,\n this._refresherOptions,\n this._sessionEventDispatcher,\n this._connectedDevice,\n );\n new DeviceSessionStateHandler(\n loggerModuleFactory,\n this._sessionEventDispatcher,\n this._connectedDevice,\n this._deviceState,\n (state) => this.setDeviceSessionState(state),\n );\n\n this._refresherService = new RefresherService(loggerModuleFactory, {\n start: () => this._deviceSessionRefresher.restartRefresher(),\n stop: () => this._deviceSessionRefresher.stopRefresher(),\n });\n }\n\n public async initialiseSession(): Promise<void> {\n try {\n await this._pinger.ping();\n } catch (error) {\n this._logger.error(\"Error while initialising session\", {\n data: { error },\n });\n throw error;\n } finally {\n if (!this._refresherOptions.isRefresherDisabled) {\n this._deviceSessionRefresher.startRefresher();\n }\n }\n }\n\n public get id(): DeviceSessionId {\n return this._id;\n }\n\n public get connectedDevice(): TransportConnectedDevice {\n return this._connectedDevice;\n }\n\n public get state(): Observable<DeviceSessionState> {\n return this._deviceState.asObservable();\n }\n\n public getDeviceSessionState(): DeviceSessionState {\n return this._deviceState.getValue();\n }\n\n public setDeviceSessionState(state: DeviceSessionState): void {\n this._deviceState.next(state);\n }\n\n public async sendApdu(\n rawApdu: Uint8Array,\n options: SendApduOptions = {\n isPolling: false,\n triggersDisconnection: false,\n abortTimeout: undefined,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n const release = await this._commandMutex.lock();\n\n try {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_BUSY,\n });\n const result = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n options.abortTimeout,\n );\n\n result\n .ifRight((response: ApduResponse) => {\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n } else {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n }\n })\n .ifLeft(() => {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n });\n return result;\n } finally {\n release();\n }\n }\n\n public async sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n const apdu = command.getApdu();\n\n const response = await this.sendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n abortTimeout,\n });\n\n return response.caseOf({\n Left: (err) => {\n throw err;\n },\n Right: (r) =>\n command.parseResponse(r, this._connectedDevice.deviceModel.id),\n });\n }\n\n public executeDeviceAction<\n Output,\n Input,\n E extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, E, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, E, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendApdu: async (apdu: Uint8Array) => this.sendApdu(apdu),\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n abortTimeout?: number,\n ) => this.sendCommand(command, abortTimeout),\n getDeviceModel: () => this._connectedDevice.deviceModel,\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n disableRefresher: (blockerId: string) =>\n this._refresherService.disableRefresher(blockerId),\n getManagerApiService: () => this._managerApiService,\n getSecureChannelService: () => this._secureChannelService,\n });\n return { observable, cancel };\n }\n\n public close(): void {\n this._updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._deviceSessionRefresher.stopRefresher();\n }\n\n public disableRefresher(id: string): () => void {\n return this._refresherService.disableRefresher(id);\n }\n\n private _updateDeviceStatus(deviceStatus: DeviceStatus): void {\n const state = this._deviceState.getValue();\n this._deviceState.next({ ...state, deviceStatus });\n }\n}\n"],
|
5
|
+
"mappings": "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",
|
6
6
|
"names": ["DeviceSession_exports", "__export", "DeviceSession", "__toCommonJS", "import_rxjs", "import_uuid", "import_CommandUtils", "import_DeviceStatus", "import_DeviceSessionState", "import_DeviceSessionRefresherConst", "import_MutexService", "import_RefresherService", "import_DevicePinger", "import_DeviceSessionEventDispatcher", "import_DeviceSessionRefresher", "import_DeviceSessionStateHandler", "connectedDevice", "id", "uuidv4", "loggerModuleFactory", "managerApiService", "secureChannelService", "deviceSessionRefresherOptions", "command", "abortTimeout", "state", "error", "rawApdu", "options", "release", "result", "response", "apdu", "err", "deviceAction", "observable", "cancel", "blockerId", "deviceStatus"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var C=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var
|
1
|
+
"use strict";var C=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var s in e)C(t,s,{get:e[s],enumerable:!0})},A=(t,e,s,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of T(e))!g.call(t,i)&&i!==s&&C(t,i,{get:()=>e[i],enumerable:!(c=L(e,i))||c.enumerable});return t};var F=t=>A(C({},"__esModule",{value:!0}),t);var M={};u(M,{discoveryModuleFactory:()=>G});module.exports=F(M);var r=require("inversify"),n=require("../../discovery/use-case/ConnectUseCase"),U=require("../../discovery/use-case/DisconnectUseCase"),v=require("../../discovery/use-case/GetConnectedDeviceUseCase"),m=require("../../discovery/use-case/ListConnectedDevicesUseCase"),D=require("../../discovery/use-case/ListenToAvailableDevicesUseCase"),p=require("../../discovery/use-case/ListenToConnectedDeviceUseCase"),f=require("../../discovery/use-case/StartDiscoveringUseCase"),l=require("../../discovery/use-case/StopDiscoveringUseCase"),a=require("../../../../src/di.stub"),o=require("./discoveryTypes");const G=({stub:t=!1})=>new r.ContainerModule(({bind:e,rebindSync:s})=>{e(o.discoveryTypes.ConnectUseCase).to(n.ConnectUseCase),e(o.discoveryTypes.DisconnectUseCase).to(U.DisconnectUseCase),e(o.discoveryTypes.StartDiscoveringUseCase).to(f.StartDiscoveringUseCase),e(o.discoveryTypes.StopDiscoveringUseCase).to(l.StopDiscoveringUseCase),e(o.discoveryTypes.GetConnectedDeviceUseCase).to(v.GetConnectedDeviceUseCase),e(o.discoveryTypes.ListenToAvailableDevicesUseCase).to(D.ListenToAvailableDevicesUseCase),e(o.discoveryTypes.ListenToConnectedDeviceUseCase).to(p.ListenToConnectedDeviceUseCase),e(o.discoveryTypes.ListConnectedDevicesUseCase).to(m.ListConnectedDevicesUseCase),t&&(s(o.discoveryTypes.ConnectUseCase).to(a.StubUseCase),s(o.discoveryTypes.DisconnectUseCase).to(a.StubUseCase),s(o.discoveryTypes.StartDiscoveringUseCase).to(a.StubUseCase),s(o.discoveryTypes.StopDiscoveringUseCase).to(a.StubUseCase),s(o.discoveryTypes.GetConnectedDeviceUseCase).to(a.StubUseCase),s(o.discoveryTypes.ListenToAvailableDevicesUseCase).to(a.StubUseCase),s(o.discoveryTypes.ListenToConnectedDeviceUseCase).to(a.StubUseCase),s(o.discoveryTypes.ListConnectedDevicesUseCase).to(a.StubUseCase))});0&&(module.exports={discoveryModuleFactory});
|
2
2
|
//# sourceMappingURL=discoveryModule.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/discovery/di/discoveryModule.ts"],
|
4
|
-
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { ConnectUseCase } from \"@internal/discovery/use-case/ConnectUseCase\";\nimport { DisconnectUseCase } from \"@internal/discovery/use-case/DisconnectUseCase\";\nimport { GetConnectedDeviceUseCase } from \"@internal/discovery/use-case/GetConnectedDeviceUseCase\";\nimport { ListConnectedDevicesUseCase } from \"@internal/discovery/use-case/ListConnectedDevicesUseCase\";\nimport { ListenToAvailableDevicesUseCase } from \"@internal/discovery/use-case/ListenToAvailableDevicesUseCase\";\nimport { ListenToConnectedDeviceUseCase } from \"@internal/discovery/use-case/ListenToConnectedDeviceUseCase\";\nimport { StartDiscoveringUseCase } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nimport { StopDiscoveringUseCase } from \"@internal/discovery/use-case/StopDiscoveringUseCase\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { discoveryTypes } from \"./discoveryTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const discoveryModuleFactory = ({ stub = false }: FactoryProps) =>\n new ContainerModule((bind,
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA+B,uDAC/BC,EAAkC,0DAClCC,EAA0C,kEAC1CC,EAA4C,oEAC5CC,EAAgD,wEAChDC,EAA+C,uEAC/CC,EAAwC,gEACxCC,EAAuC,+DACvCC,EAA4B,6BAE5BC,EAA+B,4BAMxB,MAAMZ,EAAyB,CAAC,CAAE,KAAAa,EAAO,EAAM,IACpD,IAAI,kBAAgB,
|
6
|
-
"names": ["discoveryModule_exports", "__export", "discoveryModuleFactory", "__toCommonJS", "import_inversify", "import_ConnectUseCase", "import_DisconnectUseCase", "import_GetConnectedDeviceUseCase", "import_ListConnectedDevicesUseCase", "import_ListenToAvailableDevicesUseCase", "import_ListenToConnectedDeviceUseCase", "import_StartDiscoveringUseCase", "import_StopDiscoveringUseCase", "import_di", "import_discoveryTypes", "stub", "bind", "
|
4
|
+
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { ConnectUseCase } from \"@internal/discovery/use-case/ConnectUseCase\";\nimport { DisconnectUseCase } from \"@internal/discovery/use-case/DisconnectUseCase\";\nimport { GetConnectedDeviceUseCase } from \"@internal/discovery/use-case/GetConnectedDeviceUseCase\";\nimport { ListConnectedDevicesUseCase } from \"@internal/discovery/use-case/ListConnectedDevicesUseCase\";\nimport { ListenToAvailableDevicesUseCase } from \"@internal/discovery/use-case/ListenToAvailableDevicesUseCase\";\nimport { ListenToConnectedDeviceUseCase } from \"@internal/discovery/use-case/ListenToConnectedDeviceUseCase\";\nimport { StartDiscoveringUseCase } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nimport { StopDiscoveringUseCase } from \"@internal/discovery/use-case/StopDiscoveringUseCase\";\nimport { StubUseCase } from \"@root/src/di.stub\";\n\nimport { discoveryTypes } from \"./discoveryTypes\";\n\ntype FactoryProps = {\n stub: boolean;\n};\n\nexport const discoveryModuleFactory = ({ stub = false }: FactoryProps) =>\n new ContainerModule(({ bind, rebindSync }) => {\n bind(discoveryTypes.ConnectUseCase).to(ConnectUseCase);\n bind(discoveryTypes.DisconnectUseCase).to(DisconnectUseCase);\n bind(discoveryTypes.StartDiscoveringUseCase).to(StartDiscoveringUseCase);\n bind(discoveryTypes.StopDiscoveringUseCase).to(StopDiscoveringUseCase);\n bind(discoveryTypes.GetConnectedDeviceUseCase).to(\n GetConnectedDeviceUseCase,\n );\n bind(discoveryTypes.ListenToAvailableDevicesUseCase).to(\n ListenToAvailableDevicesUseCase,\n );\n bind(discoveryTypes.ListenToConnectedDeviceUseCase).to(\n ListenToConnectedDeviceUseCase,\n );\n bind(discoveryTypes.ListConnectedDevicesUseCase).to(\n ListConnectedDevicesUseCase,\n );\n\n if (stub) {\n rebindSync(discoveryTypes.ConnectUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.DisconnectUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.StartDiscoveringUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.StopDiscoveringUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.GetConnectedDeviceUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.ListenToAvailableDevicesUseCase).to(\n StubUseCase,\n );\n rebindSync(discoveryTypes.ListenToConnectedDeviceUseCase).to(StubUseCase);\n rebindSync(discoveryTypes.ListConnectedDevicesUseCase).to(StubUseCase);\n }\n });\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA+B,uDAC/BC,EAAkC,0DAClCC,EAA0C,kEAC1CC,EAA4C,oEAC5CC,EAAgD,wEAChDC,EAA+C,uEAC/CC,EAAwC,gEACxCC,EAAuC,+DACvCC,EAA4B,6BAE5BC,EAA+B,4BAMxB,MAAMZ,EAAyB,CAAC,CAAE,KAAAa,EAAO,EAAM,IACpD,IAAI,kBAAgB,CAAC,CAAE,KAAAC,EAAM,WAAAC,CAAW,IAAM,CAC5CD,EAAK,iBAAe,cAAc,EAAE,GAAG,gBAAc,EACrDA,EAAK,iBAAe,iBAAiB,EAAE,GAAG,mBAAiB,EAC3DA,EAAK,iBAAe,uBAAuB,EAAE,GAAG,yBAAuB,EACvEA,EAAK,iBAAe,sBAAsB,EAAE,GAAG,wBAAsB,EACrEA,EAAK,iBAAe,yBAAyB,EAAE,GAC7C,2BACF,EACAA,EAAK,iBAAe,+BAA+B,EAAE,GACnD,iCACF,EACAA,EAAK,iBAAe,8BAA8B,EAAE,GAClD,gCACF,EACAA,EAAK,iBAAe,2BAA2B,EAAE,GAC/C,6BACF,EAEID,IACFE,EAAW,iBAAe,cAAc,EAAE,GAAG,aAAW,EACxDA,EAAW,iBAAe,iBAAiB,EAAE,GAAG,aAAW,EAC3DA,EAAW,iBAAe,uBAAuB,EAAE,GAAG,aAAW,EACjEA,EAAW,iBAAe,sBAAsB,EAAE,GAAG,aAAW,EAChEA,EAAW,iBAAe,yBAAyB,EAAE,GAAG,aAAW,EACnEA,EAAW,iBAAe,+BAA+B,EAAE,GACzD,aACF,EACAA,EAAW,iBAAe,8BAA8B,EAAE,GAAG,aAAW,EACxEA,EAAW,iBAAe,2BAA2B,EAAE,GAAG,aAAW,EAEzE,CAAC",
|
6
|
+
"names": ["discoveryModule_exports", "__export", "discoveryModuleFactory", "__toCommonJS", "import_inversify", "import_ConnectUseCase", "import_DisconnectUseCase", "import_GetConnectedDeviceUseCase", "import_ListConnectedDevicesUseCase", "import_ListenToAvailableDevicesUseCase", "import_ListenToConnectedDeviceUseCase", "import_StartDiscoveringUseCase", "import_StopDiscoveringUseCase", "import_di", "import_discoveryTypes", "stub", "bind", "rebindSync"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var r=require("inversify"),n=require("../../../api/transport/model/__mocks__/TransportMock"),c=require("../../device-model/di/deviceModelModule"),i=require("../../device-session/di/deviceSessionModule"),a=require("../../discovery/use-case/ConnectUseCase"),m=require("../../discovery/use-case/DisconnectUseCase"),p=require("../../discovery/use-case/ListConnectedDevicesUseCase"),f=require("../../discovery/use-case/ListenToAvailableDevicesUseCase"),l=require("../../discovery/use-case/StartDiscoveringUseCase"),d=require("../../discovery/use-case/StopDiscoveringUseCase"),C=require("../../logger-publisher/di/loggerModule"),v=require("../../manager-api/di/managerApiModule"),u=require("../../secure-channel/di/secureChannelModule"),g=require("../../transport/di/transportModule"),U=require("./discoveryModule"),o=require("./discoveryTypes");describe("discoveryModuleFactory",()=>{let e,t,s;beforeEach(()=>{t=(0,U.discoveryModuleFactory)({stub:!1}),e=new r.Container,s=new n.TransportMock,e.
|
1
|
+
"use strict";var r=require("inversify"),n=require("../../../api/transport/model/__mocks__/TransportMock"),c=require("../../device-model/di/deviceModelModule"),i=require("../../device-session/di/deviceSessionModule"),a=require("../../discovery/use-case/ConnectUseCase"),m=require("../../discovery/use-case/DisconnectUseCase"),p=require("../../discovery/use-case/ListConnectedDevicesUseCase"),f=require("../../discovery/use-case/ListenToAvailableDevicesUseCase"),l=require("../../discovery/use-case/StartDiscoveringUseCase"),d=require("../../discovery/use-case/StopDiscoveringUseCase"),C=require("../../logger-publisher/di/loggerModule"),v=require("../../manager-api/di/managerApiModule"),u=require("../../secure-channel/di/secureChannelModule"),g=require("../../transport/di/transportModule"),U=require("./discoveryModule"),o=require("./discoveryTypes");describe("discoveryModuleFactory",()=>{let e,t,s;beforeEach(()=>{t=(0,U.discoveryModuleFactory)({stub:!1}),e=new r.Container,s=new n.TransportMock,e.loadSync(t,(0,C.loggerModuleFactory)(),(0,c.deviceModelModuleFactory)({stub:!1}),(0,i.deviceSessionModuleFactory)(),(0,g.transportModuleFactory)({transports:[vi.fn().mockImplementation(()=>s)]}),(0,v.managerApiModuleFactory)({config:{managerApiUrl:"http://fake.url",mockUrl:"http://fake-mock.url"}}),(0,u.secureChannelModuleFactory)({config:{webSocketUrl:"http://fake-websocket.url"}}))}),it("should return the device module",()=>{expect(t).toBeDefined()}),it("should return none mocked use cases",()=>{const y=e.get(o.discoveryTypes.StartDiscoveringUseCase);expect(y).toBeInstanceOf(l.StartDiscoveringUseCase);const D=e.get(o.discoveryTypes.StopDiscoveringUseCase);expect(D).toBeInstanceOf(d.StopDiscoveringUseCase);const k=e.get(o.discoveryTypes.DisconnectUseCase);expect(k).toBeInstanceOf(m.DisconnectUseCase);const M=e.get(o.discoveryTypes.ConnectUseCase);expect(M).toBeInstanceOf(a.ConnectUseCase);const b=e.get(o.discoveryTypes.ListenToAvailableDevicesUseCase);expect(b).toBeInstanceOf(f.ListenToAvailableDevicesUseCase);const F=e.get(o.discoveryTypes.ListConnectedDevicesUseCase);expect(F).toBeInstanceOf(p.ListConnectedDevicesUseCase)})});
|
2
2
|
//# sourceMappingURL=discoveryModule.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/discovery/di/discoveryModule.test.ts"],
|
4
|
-
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { type DmkConfig, type Transport } from \"@api/types\";\nimport { deviceModelModuleFactory } from \"@internal/device-model/di/deviceModelModule\";\nimport { deviceSessionModuleFactory } from \"@internal/device-session/di/deviceSessionModule\";\nimport { ConnectUseCase } from \"@internal/discovery/use-case/ConnectUseCase\";\nimport { DisconnectUseCase } from \"@internal/discovery/use-case/DisconnectUseCase\";\nimport { ListConnectedDevicesUseCase } from \"@internal/discovery/use-case/ListConnectedDevicesUseCase\";\nimport { ListenToAvailableDevicesUseCase } from \"@internal/discovery/use-case/ListenToAvailableDevicesUseCase\";\nimport { StartDiscoveringUseCase } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nimport { StopDiscoveringUseCase } from \"@internal/discovery/use-case/StopDiscoveringUseCase\";\nimport { loggerModuleFactory } from \"@internal/logger-publisher/di/loggerModule\";\nimport { managerApiModuleFactory } from \"@internal/manager-api/di/managerApiModule\";\nimport { secureChannelModuleFactory } from \"@internal/secure-channel/di/secureChannelModule\";\nimport { transportModuleFactory } from \"@internal/transport/di/transportModule\";\n\nimport { discoveryModuleFactory } from \"./discoveryModule\";\nimport { discoveryTypes } from \"./discoveryTypes\";\n\ndescribe(\"discoveryModuleFactory\", () => {\n let container: Container;\n let mod: ReturnType<typeof discoveryModuleFactory>;\n let transport: Transport;\n beforeEach(() => {\n mod = discoveryModuleFactory({ stub: false });\n container = new Container();\n transport = new TransportMock();\n\n container.
|
5
|
-
"mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA8B,wDAE9BC,EAAyC,uDACzCC,EAA2C,2DAC3CC,EAA+B,uDAC/BC,EAAkC,0DAClCC,EAA4C,oEAC5CC,EAAgD,wEAChDC,EAAwC,gEACxCC,EAAuC,+DACvCC,EAAoC,sDACpCC,EAAwC,qDACxCC,EAA2C,2DAC3CC,EAAuC,kDAEvCC,EAAuC,6BACvCC,EAA+B,4BAE/B,SAAS,yBAA0B,IAAM,CACvC,IAAIC,EACAC,EACAC,EACJ,WAAW,IAAM,CACfD,KAAM,0BAAuB,CAAE,KAAM,EAAM,CAAC,EAC5CD,EAAY,IAAI,YAChBE,EAAY,IAAI,gBAEhBF,EAAU,
|
4
|
+
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { type DmkConfig, type Transport } from \"@api/types\";\nimport { deviceModelModuleFactory } from \"@internal/device-model/di/deviceModelModule\";\nimport { deviceSessionModuleFactory } from \"@internal/device-session/di/deviceSessionModule\";\nimport { ConnectUseCase } from \"@internal/discovery/use-case/ConnectUseCase\";\nimport { DisconnectUseCase } from \"@internal/discovery/use-case/DisconnectUseCase\";\nimport { ListConnectedDevicesUseCase } from \"@internal/discovery/use-case/ListConnectedDevicesUseCase\";\nimport { ListenToAvailableDevicesUseCase } from \"@internal/discovery/use-case/ListenToAvailableDevicesUseCase\";\nimport { StartDiscoveringUseCase } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nimport { StopDiscoveringUseCase } from \"@internal/discovery/use-case/StopDiscoveringUseCase\";\nimport { loggerModuleFactory } from \"@internal/logger-publisher/di/loggerModule\";\nimport { managerApiModuleFactory } from \"@internal/manager-api/di/managerApiModule\";\nimport { secureChannelModuleFactory } from \"@internal/secure-channel/di/secureChannelModule\";\nimport { transportModuleFactory } from \"@internal/transport/di/transportModule\";\n\nimport { discoveryModuleFactory } from \"./discoveryModule\";\nimport { discoveryTypes } from \"./discoveryTypes\";\n\ndescribe(\"discoveryModuleFactory\", () => {\n let container: Container;\n let mod: ReturnType<typeof discoveryModuleFactory>;\n let transport: Transport;\n beforeEach(() => {\n mod = discoveryModuleFactory({ stub: false });\n container = new Container();\n transport = new TransportMock();\n\n container.loadSync(\n mod,\n // The following modules are injected into discovery module\n loggerModuleFactory(),\n deviceModelModuleFactory({ stub: false }),\n deviceSessionModuleFactory(),\n transportModuleFactory({\n transports: [vi.fn().mockImplementation(() => transport)],\n }),\n managerApiModuleFactory({\n config: {\n managerApiUrl: \"http://fake.url\",\n mockUrl: \"http://fake-mock.url\",\n } as DmkConfig,\n }),\n secureChannelModuleFactory({\n config: {\n webSocketUrl: \"http://fake-websocket.url\",\n } as DmkConfig,\n }),\n );\n });\n it(\"should return the device module\", () => {\n expect(mod).toBeDefined();\n });\n\n it(\"should return none mocked use cases\", () => {\n const startDiscoveringUseCase = container.get(\n discoveryTypes.StartDiscoveringUseCase,\n );\n expect(startDiscoveringUseCase).toBeInstanceOf(StartDiscoveringUseCase);\n\n const stopDiscoveringUseCase = container.get(\n discoveryTypes.StopDiscoveringUseCase,\n );\n expect(stopDiscoveringUseCase).toBeInstanceOf(StopDiscoveringUseCase);\n\n const disconnectUseCase = container.get(discoveryTypes.DisconnectUseCase);\n expect(disconnectUseCase).toBeInstanceOf(DisconnectUseCase);\n\n const connectUseCase = container.get(discoveryTypes.ConnectUseCase);\n expect(connectUseCase).toBeInstanceOf(ConnectUseCase);\n\n const listenToAvailableDevicesUseCase = container.get(\n discoveryTypes.ListenToAvailableDevicesUseCase,\n );\n expect(listenToAvailableDevicesUseCase).toBeInstanceOf(\n ListenToAvailableDevicesUseCase,\n );\n const listConnectedDevicesUseCase = container.get(\n discoveryTypes.ListConnectedDevicesUseCase,\n );\n expect(listConnectedDevicesUseCase).toBeInstanceOf(\n ListConnectedDevicesUseCase,\n );\n });\n});\n"],
|
5
|
+
"mappings": "aAAA,IAAAA,EAA0B,qBAE1BC,EAA8B,wDAE9BC,EAAyC,uDACzCC,EAA2C,2DAC3CC,EAA+B,uDAC/BC,EAAkC,0DAClCC,EAA4C,oEAC5CC,EAAgD,wEAChDC,EAAwC,gEACxCC,EAAuC,+DACvCC,EAAoC,sDACpCC,EAAwC,qDACxCC,EAA2C,2DAC3CC,EAAuC,kDAEvCC,EAAuC,6BACvCC,EAA+B,4BAE/B,SAAS,yBAA0B,IAAM,CACvC,IAAIC,EACAC,EACAC,EACJ,WAAW,IAAM,CACfD,KAAM,0BAAuB,CAAE,KAAM,EAAM,CAAC,EAC5CD,EAAY,IAAI,YAChBE,EAAY,IAAI,gBAEhBF,EAAU,SACRC,KAEA,uBAAoB,KACpB,4BAAyB,CAAE,KAAM,EAAM,CAAC,KACxC,8BAA2B,KAC3B,0BAAuB,CACrB,WAAY,CAAC,GAAG,GAAG,EAAE,mBAAmB,IAAMC,CAAS,CAAC,CAC1D,CAAC,KACD,2BAAwB,CACtB,OAAQ,CACN,cAAe,kBACf,QAAS,sBACX,CACF,CAAC,KACD,8BAA2B,CACzB,OAAQ,CACN,aAAc,2BAChB,CACF,CAAC,CACH,CACF,CAAC,EACD,GAAG,kCAAmC,IAAM,CAC1C,OAAOD,CAAG,EAAE,YAAY,CAC1B,CAAC,EAED,GAAG,sCAAuC,IAAM,CAC9C,MAAME,EAA0BH,EAAU,IACxC,iBAAe,uBACjB,EACA,OAAOG,CAAuB,EAAE,eAAe,yBAAuB,EAEtE,MAAMC,EAAyBJ,EAAU,IACvC,iBAAe,sBACjB,EACA,OAAOI,CAAsB,EAAE,eAAe,wBAAsB,EAEpE,MAAMC,EAAoBL,EAAU,IAAI,iBAAe,iBAAiB,EACxE,OAAOK,CAAiB,EAAE,eAAe,mBAAiB,EAE1D,MAAMC,EAAiBN,EAAU,IAAI,iBAAe,cAAc,EAClE,OAAOM,CAAc,EAAE,eAAe,gBAAc,EAEpD,MAAMC,EAAkCP,EAAU,IAChD,iBAAe,+BACjB,EACA,OAAOO,CAA+B,EAAE,eACtC,iCACF,EACA,MAAMC,EAA8BR,EAAU,IAC5C,iBAAe,2BACjB,EACA,OAAOQ,CAA2B,EAAE,eAClC,6BACF,CACF,CAAC,CACH,CAAC",
|
6
6
|
"names": ["import_inversify", "import_TransportMock", "import_deviceModelModule", "import_deviceSessionModule", "import_ConnectUseCase", "import_DisconnectUseCase", "import_ListConnectedDevicesUseCase", "import_ListenToAvailableDevicesUseCase", "import_StartDiscoveringUseCase", "import_StopDiscoveringUseCase", "import_loggerModule", "import_managerApiModule", "import_secureChannelModule", "import_transportModule", "import_discoveryModule", "import_discoveryTypes", "container", "mod", "transport", "startDiscoveringUseCase", "stopDiscoveringUseCase", "disconnectUseCase", "connectUseCase", "listenToAvailableDevicesUseCase", "listConnectedDevicesUseCase"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var o=require("purify-ts"),D=require("../../../api/transport/model/__mocks__/TransportMock"),S=require("../../../api/transport/model/Errors"),y=require("../../../api/transport/model/TransportConnectedDevice.stub"),
|
1
|
+
"use strict";var o=require("purify-ts"),D=require("../../../api/transport/model/__mocks__/TransportMock"),S=require("../../../api/transport/model/Errors"),y=require("../../../api/transport/model/TransportConnectedDevice.stub"),u=require("../../device-session/data/DeviceSessionRefresherConst"),v=require("../../device-session/model/DeviceSession.stub"),C=require("../../device-session/model/Errors"),h=require("../../device-session/service/DefaultDeviceSessionService"),w=require("../../logger-publisher/service/DefaultLoggerPublisherService"),g=require("../../manager-api/data/AxiosManagerApiDataSource"),T=require("../../manager-api/service/DefaultManagerApiService"),k=require("../../secure-channel/data/DefaultSecureChannelDataSource"),A=require("../../secure-channel/service/DefaultSecureChannelService"),E=require("../../transport/service/DefaultTransportService"),a=require("./DisconnectUseCase");vi.mock("@internal/transport/service/DefaultTransportService");let e,p,s=[];const n=vi.fn().mockReturnValue(new w.DefaultLoggerPublisherService([],"DisconnectUseCaseTest"));let c,m,f,d,l;const i="sessionId";describe("DisconnectUseCase",()=>{beforeAll(()=>{p=new D.TransportMock,s=[p],e=new h.DefaultDeviceSessionService(n),c=new E.DefaultTransportService,vi.spyOn(c,"getTransport").mockReturnValue(o.Maybe.of(p))}),it("should disconnect from a device",async()=>{const r=(0,y.connectedDeviceStubBuilder)();f=new g.AxiosManagerApiDataSource({}),m=new T.DefaultManagerApiService(f),d=new k.DefaultSecureChannelDataSource({}),l=new A.DefaultSecureChannelService(d);const t=(0,v.deviceSessionStubBuilder)({id:i,connectedDevice:r},n,m,l,u.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS);vi.spyOn(e,"getDeviceSessionById").mockImplementation(()=>(0,o.Right)(t)),vi.spyOn(t,"close"),vi.spyOn(e,"removeDeviceSession"),vi.spyOn(s[0],"disconnect").mockImplementation(()=>Promise.resolve((0,o.Right)(void 0))),await new a.DisconnectUseCase(c,e,n).execute({sessionId:i}),expect(t.close).toHaveBeenCalled(),expect(e.removeDeviceSession).toHaveBeenCalledWith(i),expect(s[0].disconnect).toHaveBeenCalledWith({connectedDevice:r})}),it("should throw an error when deviceSession not found",async()=>{const r=new a.DisconnectUseCase(c,e,n);try{await r.execute({sessionId:i})}catch(t){expect(t).toStrictEqual(new C.DeviceSessionNotFound)}}),it("should throw an error if usb hid disconnection fails",async()=>{vi.spyOn(e,"getDeviceSessionById").mockImplementation(()=>(0,o.Right)((0,v.deviceSessionStubBuilder)({id:i},n,m,l,u.DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS))),vi.spyOn(s[0],"disconnect").mockResolvedValue((0,o.Left)(new S.DisconnectError));const r=new a.DisconnectUseCase(c,e,n);try{await r.execute({sessionId:i})}catch(t){expect(t).toStrictEqual(new S.DisconnectError)}})});
|
2
2
|
//# sourceMappingURL=DisconnectUseCase.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/discovery/use-case/DisconnectUseCase.test.ts"],
|
4
|
-
"sourcesContent": ["import { Left, Maybe, Right } from \"purify-ts\";\n\nimport { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { DisconnectError } from \"@api/transport/model/Errors\";\nimport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nimport type { DmkConfig, Transport } from \"@api/types\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DeviceSessionNotFound } from \"@internal/device-session/model/Errors\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { type SecureChannelDataSource } from \"@internal/secure-channel/data/SecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\nimport { DefaultTransportService } from \"@internal/transport/service/DefaultTransportService\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nimport { DisconnectUseCase } from \"./DisconnectUseCase\";\n\nvi.mock(\"@internal/transport/service/DefaultTransportService\");\n\nlet sessionService: DefaultDeviceSessionService;\n// TODO test several transports\nlet transport: Transport;\nlet transports: Transport[] = [];\nconst loggerFactory = vi\n .fn()\n .mockReturnValue(\n new DefaultLoggerPublisherService([], \"DisconnectUseCaseTest\"),\n );\nlet transportService: TransportService;\nlet managerApi: ManagerApiService;\nlet managerApiDataSource: ManagerApiDataSource;\nlet secureChannelDataSource: SecureChannelDataSource;\nlet secureChannel: SecureChannelService;\n\nconst sessionId = \"sessionId\";\n\ndescribe(\"DisconnectUseCase\", () => {\n beforeAll(() => {\n transport = new TransportMock();\n transports = [transport];\n sessionService = new DefaultDeviceSessionService(loggerFactory);\n // @ts-expect-error mock\n transportService = new DefaultTransportService();\n vi.spyOn(transportService, \"getTransport\").mockReturnValue(\n Maybe.of(transport),\n );\n });\n\n it(\"should disconnect from a device\", async () => {\n // Given\n const connectedDevice = connectedDeviceStubBuilder();\n managerApiDataSource = new AxiosManagerApiDataSource({} as DmkConfig);\n managerApi = new DefaultManagerApiService(managerApiDataSource);\n secureChannelDataSource = new DefaultSecureChannelDataSource(\n {} as DmkConfig,\n );\n secureChannel = new DefaultSecureChannelService(secureChannelDataSource);\n const deviceSession = deviceSessionStubBuilder(\n {\n id: sessionId,\n connectedDevice,\n },\n loggerFactory,\n managerApi,\n secureChannel,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n );\n vi.spyOn(sessionService, \"getDeviceSessionById\").mockImplementation(() =>\n Right(deviceSession),\n );\n vi.spyOn(deviceSession, \"close\");\n vi.spyOn(sessionService, \"removeDeviceSession\");\n vi.spyOn(transports[0]!, \"disconnect\").mockImplementation(() =>\n Promise.resolve(Right(
|
5
|
-
"mappings": "aAAA,IAAAA,EAAmC,qBAEnCC,EAA8B,wDAC9BC,EAAgC,uCAChCC,EAA2C,8DAE3CC,EAAyD,qEACzDC,EAAyC,6DACzCH,EAAsC,iDACtCI,EAA4C,wEAC5CC,EAA8C,4EAC9CC,EAA0C,gEAE1CC,EAAyC,kEAEzCC,EAA+C,wEAE/CC,EAA4C,wEAE5CC,EAAwC,+DAGxCC,EAAkC,+BAElC,GAAG,KAAK,qDAAqD,EAE7D,IAAIC,EAEAC,EACAC,EAA0B,CAAC,EAC/B,MAAMC,EAAgB,GACnB,GAAG,EACH,gBACC,IAAI,gCAA8B,CAAC,EAAG,uBAAuB,CAC/D,EACF,IAAIC,EACAC,EACAC,EACAC,EACAC,EAEJ,MAAMC,EAAY,YAElB,SAAS,oBAAqB,IAAM,CAClC,UAAU,IAAM,CACdR,EAAY,IAAI,gBAChBC,EAAa,CAACD,CAAS,EACvBD,EAAiB,IAAI,8BAA4BG,CAAa,EAE9DC,EAAmB,IAAI,0BACvB,GAAG,MAAMA,EAAkB,cAAc,EAAE,gBACzC,QAAM,GAAGH,CAAS,CACpB,CACF,CAAC,EAED,GAAG,kCAAmC,SAAY,CAEhD,MAAMS,KAAkB,8BAA2B,EACnDJ,EAAuB,IAAI,4BAA0B,CAAC,CAAc,EACpED,EAAa,IAAI,2BAAyBC,CAAoB,EAC9DC,EAA0B,IAAI,iCAC5B,CAAC,CACH,EACAC,EAAgB,IAAI,8BAA4BD,CAAuB,EACvE,MAAMI,KAAgB,4BACpB,CACE,GAAIF,EACJ,gBAAAC,CACF,EACAP,EACAE,EACAG,EACA,0CACF,EACA,GAAG,MAAMR,EAAgB,sBAAsB,EAAE,mBAAmB,OAClE,SAAMW,CAAa,CACrB,EACA,GAAG,MAAMA,EAAe,OAAO,EAC/B,GAAG,MAAMX,EAAgB,qBAAqB,EAC9C,GAAG,MAAME,EAAW,CAAC,EAAI,YAAY,EAAE,mBAAmB,IACxD,QAAQ,WAAQ,SAAM,
|
4
|
+
"sourcesContent": ["import { Left, Maybe, Right } from \"purify-ts\";\n\nimport { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { DisconnectError } from \"@api/transport/model/Errors\";\nimport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nimport type { DmkConfig, Transport } from \"@api/types\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { deviceSessionStubBuilder } from \"@internal/device-session/model/DeviceSession.stub\";\nimport { DeviceSessionNotFound } from \"@internal/device-session/model/Errors\";\nimport { DefaultDeviceSessionService } from \"@internal/device-session/service/DefaultDeviceSessionService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\nimport { AxiosManagerApiDataSource } from \"@internal/manager-api/data/AxiosManagerApiDataSource\";\nimport { type ManagerApiDataSource } from \"@internal/manager-api/data/ManagerApiDataSource\";\nimport { DefaultManagerApiService } from \"@internal/manager-api/service/DefaultManagerApiService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { DefaultSecureChannelDataSource } from \"@internal/secure-channel/data/DefaultSecureChannelDataSource\";\nimport { type SecureChannelDataSource } from \"@internal/secure-channel/data/SecureChannelDataSource\";\nimport { DefaultSecureChannelService } from \"@internal/secure-channel/service/DefaultSecureChannelService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\nimport { DefaultTransportService } from \"@internal/transport/service/DefaultTransportService\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nimport { DisconnectUseCase } from \"./DisconnectUseCase\";\n\nvi.mock(\"@internal/transport/service/DefaultTransportService\");\n\nlet sessionService: DefaultDeviceSessionService;\n// TODO test several transports\nlet transport: Transport;\nlet transports: Transport[] = [];\nconst loggerFactory = vi\n .fn()\n .mockReturnValue(\n new DefaultLoggerPublisherService([], \"DisconnectUseCaseTest\"),\n );\nlet transportService: TransportService;\nlet managerApi: ManagerApiService;\nlet managerApiDataSource: ManagerApiDataSource;\nlet secureChannelDataSource: SecureChannelDataSource;\nlet secureChannel: SecureChannelService;\n\nconst sessionId = \"sessionId\";\n\ndescribe(\"DisconnectUseCase\", () => {\n beforeAll(() => {\n transport = new TransportMock();\n transports = [transport];\n sessionService = new DefaultDeviceSessionService(loggerFactory);\n // @ts-expect-error mock\n transportService = new DefaultTransportService();\n vi.spyOn(transportService, \"getTransport\").mockReturnValue(\n Maybe.of(transport),\n );\n });\n\n it(\"should disconnect from a device\", async () => {\n // Given\n const connectedDevice = connectedDeviceStubBuilder();\n managerApiDataSource = new AxiosManagerApiDataSource({} as DmkConfig);\n managerApi = new DefaultManagerApiService(managerApiDataSource);\n secureChannelDataSource = new DefaultSecureChannelDataSource(\n {} as DmkConfig,\n );\n secureChannel = new DefaultSecureChannelService(secureChannelDataSource);\n const deviceSession = deviceSessionStubBuilder(\n {\n id: sessionId,\n connectedDevice,\n },\n loggerFactory,\n managerApi,\n secureChannel,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n );\n vi.spyOn(sessionService, \"getDeviceSessionById\").mockImplementation(() =>\n Right(deviceSession),\n );\n vi.spyOn(deviceSession, \"close\");\n vi.spyOn(sessionService, \"removeDeviceSession\");\n vi.spyOn(transports[0]!, \"disconnect\").mockImplementation(() =>\n Promise.resolve(Right(undefined)),\n );\n const disconnectUseCase = new DisconnectUseCase(\n transportService,\n sessionService,\n loggerFactory,\n );\n // When\n await disconnectUseCase.execute({ sessionId });\n\n // Then\n expect(deviceSession.close).toHaveBeenCalled();\n expect(sessionService.removeDeviceSession).toHaveBeenCalledWith(sessionId);\n expect(transports[0]!.disconnect).toHaveBeenCalledWith({\n connectedDevice,\n });\n });\n\n it(\"should throw an error when deviceSession not found\", async () => {\n // Given\n const disconnectUseCase = new DisconnectUseCase(\n transportService,\n sessionService,\n loggerFactory,\n );\n\n // When\n try {\n await disconnectUseCase.execute({ sessionId });\n } catch (e) {\n // Then\n expect(e).toStrictEqual(new DeviceSessionNotFound());\n }\n });\n\n it(\"should throw an error if usb hid disconnection fails\", async () => {\n // Given\n vi.spyOn(sessionService, \"getDeviceSessionById\").mockImplementation(() =>\n Right(\n deviceSessionStubBuilder(\n { id: sessionId },\n loggerFactory,\n managerApi,\n secureChannel,\n DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n ),\n ),\n );\n\n vi.spyOn(transports[0]!, \"disconnect\").mockResolvedValue(\n Left(new DisconnectError()),\n );\n\n const disconnectUseCase = new DisconnectUseCase(\n transportService,\n sessionService,\n loggerFactory,\n );\n\n // When\n try {\n await disconnectUseCase.execute({ sessionId });\n } catch (e) {\n // Then\n expect(e).toStrictEqual(new DisconnectError());\n }\n });\n});\n"],
|
5
|
+
"mappings": "aAAA,IAAAA,EAAmC,qBAEnCC,EAA8B,wDAC9BC,EAAgC,uCAChCC,EAA2C,8DAE3CC,EAAyD,qEACzDC,EAAyC,6DACzCH,EAAsC,iDACtCI,EAA4C,wEAC5CC,EAA8C,4EAC9CC,EAA0C,gEAE1CC,EAAyC,kEAEzCC,EAA+C,wEAE/CC,EAA4C,wEAE5CC,EAAwC,+DAGxCC,EAAkC,+BAElC,GAAG,KAAK,qDAAqD,EAE7D,IAAIC,EAEAC,EACAC,EAA0B,CAAC,EAC/B,MAAMC,EAAgB,GACnB,GAAG,EACH,gBACC,IAAI,gCAA8B,CAAC,EAAG,uBAAuB,CAC/D,EACF,IAAIC,EACAC,EACAC,EACAC,EACAC,EAEJ,MAAMC,EAAY,YAElB,SAAS,oBAAqB,IAAM,CAClC,UAAU,IAAM,CACdR,EAAY,IAAI,gBAChBC,EAAa,CAACD,CAAS,EACvBD,EAAiB,IAAI,8BAA4BG,CAAa,EAE9DC,EAAmB,IAAI,0BACvB,GAAG,MAAMA,EAAkB,cAAc,EAAE,gBACzC,QAAM,GAAGH,CAAS,CACpB,CACF,CAAC,EAED,GAAG,kCAAmC,SAAY,CAEhD,MAAMS,KAAkB,8BAA2B,EACnDJ,EAAuB,IAAI,4BAA0B,CAAC,CAAc,EACpED,EAAa,IAAI,2BAAyBC,CAAoB,EAC9DC,EAA0B,IAAI,iCAC5B,CAAC,CACH,EACAC,EAAgB,IAAI,8BAA4BD,CAAuB,EACvE,MAAMI,KAAgB,4BACpB,CACE,GAAIF,EACJ,gBAAAC,CACF,EACAP,EACAE,EACAG,EACA,0CACF,EACA,GAAG,MAAMR,EAAgB,sBAAsB,EAAE,mBAAmB,OAClE,SAAMW,CAAa,CACrB,EACA,GAAG,MAAMA,EAAe,OAAO,EAC/B,GAAG,MAAMX,EAAgB,qBAAqB,EAC9C,GAAG,MAAME,EAAW,CAAC,EAAI,YAAY,EAAE,mBAAmB,IACxD,QAAQ,WAAQ,SAAM,MAAS,CAAC,CAClC,EAOA,MAN0B,IAAI,oBAC5BE,EACAJ,EACAG,CACF,EAEwB,QAAQ,CAAE,UAAAM,CAAU,CAAC,EAG7C,OAAOE,EAAc,KAAK,EAAE,iBAAiB,EAC7C,OAAOX,EAAe,mBAAmB,EAAE,qBAAqBS,CAAS,EACzE,OAAOP,EAAW,CAAC,EAAG,UAAU,EAAE,qBAAqB,CACrD,gBAAAQ,CACF,CAAC,CACH,CAAC,EAED,GAAG,qDAAsD,SAAY,CAEnE,MAAME,EAAoB,IAAI,oBAC5BR,EACAJ,EACAG,CACF,EAGA,GAAI,CACF,MAAMS,EAAkB,QAAQ,CAAE,UAAAH,CAAU,CAAC,CAC/C,OAASI,EAAG,CAEV,OAAOA,CAAC,EAAE,cAAc,IAAI,uBAAuB,CACrD,CACF,CAAC,EAED,GAAG,uDAAwD,SAAY,CAErE,GAAG,MAAMb,EAAgB,sBAAsB,EAAE,mBAAmB,OAClE,YACE,4BACE,CAAE,GAAIS,CAAU,EAChBN,EACAE,EACAG,EACA,0CACF,CACF,CACF,EAEA,GAAG,MAAMN,EAAW,CAAC,EAAI,YAAY,EAAE,qBACrC,QAAK,IAAI,iBAAiB,CAC5B,EAEA,MAAMU,EAAoB,IAAI,oBAC5BR,EACAJ,EACAG,CACF,EAGA,GAAI,CACF,MAAMS,EAAkB,QAAQ,CAAE,UAAAH,CAAU,CAAC,CAC/C,OAASI,EAAG,CAEV,OAAOA,CAAC,EAAE,cAAc,IAAI,iBAAiB,CAC/C,CACF,CAAC,CACH,CAAC",
|
6
6
|
"names": ["import_purify_ts", "import_TransportMock", "import_Errors", "import_TransportConnectedDevice", "import_DeviceSessionRefresherConst", "import_DeviceSession", "import_DefaultDeviceSessionService", "import_DefaultLoggerPublisherService", "import_AxiosManagerApiDataSource", "import_DefaultManagerApiService", "import_DefaultSecureChannelDataSource", "import_DefaultSecureChannelService", "import_DefaultTransportService", "import_DisconnectUseCase", "sessionService", "transport", "transports", "loggerFactory", "transportService", "managerApi", "managerApiDataSource", "secureChannelDataSource", "secureChannel", "sessionId", "connectedDevice", "deviceSession", "disconnectUseCase", "e"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var s=require("../../../api/transport/model/__mocks__/TransportMock"),
|
1
|
+
"use strict";var s=require("../../../api/transport/model/__mocks__/TransportMock"),i=require("../../transport/service/DefaultTransportService"),a=require("./StopDiscoveringUseCase");vi.mock("@internal/transport/service/DefaultTransportService");let e,r,o,t,n;describe("StopDiscoveringUseCase",()=>{beforeEach(()=>{e=new s.TransportMock,r=new s.TransportMock,o=[e,r],n={debug:vi.fn()},t=new i.DefaultTransportService(o)}),afterEach(()=>{vi.clearAllMocks()}),test("should call stop discovering",async()=>{vi.spyOn(e,"stopDiscovering").mockImplementation(vi.fn()),vi.spyOn(r,"stopDiscovering").mockImplementation(async()=>Promise.resolve(void 0)),vi.spyOn(t,"getAllTransports").mockReturnValue(o),await new a.StopDiscoveringUseCase(t,vi.fn().mockImplementation(()=>n)).execute(),expect(e.stopDiscovering).toHaveBeenCalled(),expect(r.stopDiscovering).toHaveBeenCalled()})});
|
2
2
|
//# sourceMappingURL=StopDiscoveringUseCase.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/discovery/use-case/StopDiscoveringUseCase.test.ts"],
|
4
|
-
"sourcesContent": ["import { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { type Transport } from \"@api/types\";\nimport { DefaultTransportService } from \"@internal/transport/service/DefaultTransportService\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nimport { StopDiscoveringUseCase } from \"./StopDiscoveringUseCase\";\n\nvi.mock(\"@internal/transport/service/DefaultTransportService\");\n\n// TODO test several transports\nlet transport: Transport;\nlet transport2: Transport;\nlet transports: Transport[];\nlet transportService: TransportService;\n\ndescribe(\"StopDiscoveringUseCase\", () => {\n beforeEach(() => {\n transport = new TransportMock();\n transport2 = new TransportMock();\n transports = [transport, transport2];\n // @ts-expect-error mock\n transportService = new DefaultTransportService(transports);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n });\n\n test(\"should call stop discovering\", async () => {\n vi.spyOn(transport, \"stopDiscovering\").mockImplementation(vi.fn());\n vi.spyOn(transport2, \"stopDiscovering\").mockImplementation(async () =>\n Promise.resolve(undefined),\n );\n\n vi.spyOn(transportService, \"getAllTransports\").mockReturnValue(transports);\n\n const usecase = new StopDiscoveringUseCase(transportService
|
5
|
-
"mappings": "aAAA,IAAAA,EAA8B,wDAE9BC,EAAwC,+DAGxCC,EAAuC,oCAEvC,GAAG,KAAK,qDAAqD,EAG7D,IAAIC,EACAC,EACAC,EACAC,EAEJ,SAAS,yBAA0B,IAAM,CACvC,WAAW,IAAM,
|
6
|
-
"names": ["import_TransportMock", "import_DefaultTransportService", "import_StopDiscoveringUseCase", "transport", "transport2", "transports", "transportService"]
|
4
|
+
"sourcesContent": ["import { TransportMock } from \"@api/transport/model/__mocks__/TransportMock\";\nimport { type LoggerPublisherService, type Transport } from \"@api/types\";\nimport { DefaultTransportService } from \"@internal/transport/service/DefaultTransportService\";\nimport { type TransportService } from \"@internal/transport/service/TransportService\";\n\nimport { StopDiscoveringUseCase } from \"./StopDiscoveringUseCase\";\n\nvi.mock(\"@internal/transport/service/DefaultTransportService\");\n\n// TODO test several transports\nlet transport: Transport;\nlet transport2: Transport;\nlet transports: Transport[];\nlet transportService: TransportService;\nlet logger: LoggerPublisherService;\n\ndescribe(\"StopDiscoveringUseCase\", () => {\n beforeEach(() => {\n transport = new TransportMock();\n transport2 = new TransportMock();\n transports = [transport, transport2];\n logger = {\n debug: vi.fn(),\n } as unknown as LoggerPublisherService;\n // @ts-expect-error mock\n transportService = new DefaultTransportService(transports);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n });\n\n test(\"should call stop discovering\", async () => {\n vi.spyOn(transport, \"stopDiscovering\").mockImplementation(vi.fn());\n vi.spyOn(transport2, \"stopDiscovering\").mockImplementation(async () =>\n Promise.resolve(undefined),\n );\n\n vi.spyOn(transportService, \"getAllTransports\").mockReturnValue(transports);\n\n const usecase = new StopDiscoveringUseCase(\n transportService,\n vi.fn().mockImplementation(() => logger),\n );\n\n await usecase.execute();\n\n expect(transport.stopDiscovering).toHaveBeenCalled();\n expect(transport2.stopDiscovering).toHaveBeenCalled();\n });\n});\n"],
|
5
|
+
"mappings": "aAAA,IAAAA,EAA8B,wDAE9BC,EAAwC,+DAGxCC,EAAuC,oCAEvC,GAAG,KAAK,qDAAqD,EAG7D,IAAIC,EACAC,EACAC,EACAC,EACAC,EAEJ,SAAS,yBAA0B,IAAM,CACvC,WAAW,IAAM,CACfJ,EAAY,IAAI,gBAChBC,EAAa,IAAI,gBACjBC,EAAa,CAACF,EAAWC,CAAU,EACnCG,EAAS,CACP,MAAO,GAAG,GAAG,CACf,EAEAD,EAAmB,IAAI,0BAAwBD,CAAU,CAC3D,CAAC,EAED,UAAU,IAAM,CACd,GAAG,cAAc,CACnB,CAAC,EAED,KAAK,+BAAgC,SAAY,CAC/C,GAAG,MAAMF,EAAW,iBAAiB,EAAE,mBAAmB,GAAG,GAAG,CAAC,EACjE,GAAG,MAAMC,EAAY,iBAAiB,EAAE,mBAAmB,SACzD,QAAQ,QAAQ,MAAS,CAC3B,EAEA,GAAG,MAAME,EAAkB,kBAAkB,EAAE,gBAAgBD,CAAU,EAOzE,MALgB,IAAI,yBAClBC,EACA,GAAG,GAAG,EAAE,mBAAmB,IAAMC,CAAM,CACzC,EAEc,QAAQ,EAEtB,OAAOJ,EAAU,eAAe,EAAE,iBAAiB,EACnD,OAAOC,EAAW,eAAe,EAAE,iBAAiB,CACtD,CAAC,CACH,CAAC",
|
6
|
+
"names": ["import_TransportMock", "import_DefaultTransportService", "import_StopDiscoveringUseCase", "transport", "transport2", "transports", "transportService", "logger"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var c=Object.defineProperty;var
|
1
|
+
"use strict";var c=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var m=(e,r)=>{for(var o in r)c(e,o,{get:r[o],enumerable:!0})},a=(e,r,o,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of u(r))!y.call(e,t)&&t!==o&&c(e,t,{get:()=>r[t],enumerable:!(i=b(r,t))||i.enumerable});return e};var l=e=>a(c({},"__esModule",{value:!0}),e);var S={};m(S,{loggerModuleFactory:()=>n});module.exports=l(S);var g=require("inversify"),s=require("../../logger-publisher/service/DefaultLoggerPublisherService"),p=require("./loggerTypes");const n=({subscribers:e}={subscribers:[]})=>new g.ContainerModule(({bind:r})=>{r(p.loggerTypes.LoggerPublisherServiceFactory).toFactory(o=>i=>new s.DefaultLoggerPublisherService(e,i))});0&&(module.exports={loggerModuleFactory});
|
2
2
|
//# sourceMappingURL=loggerModule.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/logger-publisher/di/loggerModule.ts"],
|
4
|
-
"sourcesContent": ["import { ContainerModule, type
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,
|
6
|
-
"names": ["loggerModule_exports", "__export", "loggerModuleFactory", "__toCommonJS", "import_inversify", "import_DefaultLoggerPublisherService", "import_loggerTypes", "subscribers", "bind", "
|
4
|
+
"sourcesContent": ["import { ContainerModule, type Factory } from \"inversify\";\n\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\n\nimport { loggerTypes } from \"./loggerTypes\";\n\ntype FactoryProps = {\n subscribers: LoggerSubscriberService[];\n};\n\nexport const loggerModuleFactory = (\n { subscribers }: FactoryProps = { subscribers: [] },\n) =>\n new ContainerModule(({ bind }) => {\n bind<Factory<LoggerPublisherService>>(\n loggerTypes.LoggerPublisherServiceFactory,\n ).toFactory((_context) => {\n return (tag: string) =>\n new DefaultLoggerPublisherService(subscribers, tag);\n });\n });\n"],
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA8C,qBAI9CC,EAA8C,4EAE9CC,EAA4B,yBAMrB,MAAMJ,EAAsB,CACjC,CAAE,YAAAK,CAAY,EAAkB,CAAE,YAAa,CAAC,CAAE,IAElD,IAAI,kBAAgB,CAAC,CAAE,KAAAC,CAAK,IAAM,CAChCA,EACE,cAAY,6BACd,EAAE,UAAWC,GACHC,GACN,IAAI,gCAA8BH,EAAaG,CAAG,CACrD,CACH,CAAC",
|
6
|
+
"names": ["loggerModule_exports", "__export", "loggerModuleFactory", "__toCommonJS", "import_inversify", "import_DefaultLoggerPublisherService", "import_loggerTypes", "subscribers", "bind", "_context", "tag"]
|
7
7
|
}
|