@ledgerhq/device-management-kit 0.0.0-develop-20260308001300 → 0.0.0-develop-20260310001152
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 +1 -1
- package/lib/cjs/src/api/index.js +1 -1
- package/lib/cjs/src/api/index.js.map +3 -3
- package/lib/cjs/src/api/utils/ApplicationChecker.js +2 -0
- package/lib/cjs/src/api/utils/ApplicationChecker.js.map +7 -0
- package/lib/cjs/src/api/utils/ApplicationChecker.test.js +2 -0
- package/lib/cjs/src/api/utils/ApplicationChecker.test.js.map +7 -0
- package/lib/cjs/src/api/utils/ApplicationResolver.js +2 -0
- package/lib/cjs/src/api/utils/ApplicationResolver.js.map +7 -0
- package/lib/esm/package.json +1 -1
- package/lib/esm/src/api/index.js +1 -1
- package/lib/esm/src/api/index.js.map +3 -3
- package/lib/esm/src/api/utils/ApplicationChecker.js +2 -0
- package/lib/esm/src/api/utils/ApplicationChecker.js.map +7 -0
- package/lib/esm/src/api/utils/ApplicationChecker.test.js +2 -0
- package/lib/esm/src/api/utils/ApplicationChecker.test.js.map +7 -0
- package/lib/esm/src/api/utils/ApplicationResolver.js +1 -0
- package/lib/esm/src/api/utils/ApplicationResolver.js.map +7 -0
- package/lib/types/src/api/index.d.ts +2 -0
- package/lib/types/src/api/index.d.ts.map +1 -1
- package/lib/types/src/api/utils/ApplicationChecker.d.ts +14 -0
- package/lib/types/src/api/utils/ApplicationChecker.d.ts.map +1 -0
- package/lib/types/src/api/utils/ApplicationChecker.test.d.ts +2 -0
- package/lib/types/src/api/utils/ApplicationChecker.test.d.ts.map +1 -0
- package/lib/types/src/api/utils/ApplicationResolver.d.ts +12 -0
- package/lib/types/src/api/utils/ApplicationResolver.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +3 -3
package/lib/cjs/package.json
CHANGED
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
65
65
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
66
66
|
},
|
|
67
|
-
"version": "0.0.0-develop-
|
|
67
|
+
"version": "0.0.0-develop-20260310001152"
|
|
68
68
|
}
|
package/lib/cjs/src/api/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var S=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var Se=Object.prototype.hasOwnProperty;var ge=(p,t)=>{for(var a in t)S(p,a,{get:t[a],enumerable:!0})},v=(p,t,a,g)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of ve(t))!Se.call(p,f)&&f!==a&&S(p,f,{get:()=>t[f],enumerable:!(g=le(t,f))||g.enumerable});return p},o=(p,t,a)=>(v(p,t,"default"),a&&v(a,t,"default"));var ye=p=>v(S({},"__esModule",{value:!0}),p);var e={};ge(e,{APDU_MAX_PAYLOAD:()=>d.APDU_MAX_PAYLOAD,Apdu:()=>y.Apdu,ApduBuilder:()=>d.ApduBuilder,ApduParser:()=>C.ApduParser,ApduResponse:()=>Q.ApduResponse,AppAlreadyInstalledDAError:()=>r.AppAlreadyInstalledDAError,BatteryStatusType:()=>D.BatteryStatusType,BleDeviceInfos:()=>j.BleDeviceInfos,ByteArrayBuilder:()=>G.ByteArrayBuilder,ByteArrayParser:()=>L.ByteArrayParser,CallTaskInAppDeviceAction:()=>F.CallTaskInAppDeviceAction,CloseAppCommand:()=>E.CloseAppCommand,CommandResultFactory:()=>i.CommandResultFactory,CommandResultStatus:()=>i.CommandResultStatus,CommandUtils:()=>h.CommandUtils,ConnectedDevice:()=>xe.ConnectedDevice,ConsoleLogger:()=>ce.ConsoleLogger,DEFAULT_UNLOCK_TIMEOUT_MS:()=>_.DEFAULT_UNLOCK_TIMEOUT_MS,DefaultLogTagFormatter:()=>fe.DefaultLogTagFormatter,DeviceActionStatus:()=>U.DeviceActionStatus,DeviceConnectionStateMachine:()=>Ae.DeviceConnectionStateMachine,DeviceLockedError:()=>r.DeviceLockedError,DeviceManagementKit:()=>me.DeviceManagementKit,DeviceManagementKitBuilder:()=>ne.DeviceManagementKitBuilder,DeviceModel:()=>n.DeviceModel,DeviceModelId:()=>n.DeviceModelId,DeviceNotOnboardedError:()=>r.DeviceNotOnboardedError,DeviceSessionStateType:()=>Z.DeviceSessionStateType,DeviceStatus:()=>M.DeviceStatus,FramerUtils:()=>ie.FramerUtils,GLOBAL_ERRORS:()=>m.GLOBAL_ERRORS,GenuineCheckDeviceAction:()=>$.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>B.GetAppAndVersionCommand,GetBackgroundImageSizeCommand:()=>A.GetBackgroundImageSizeCommand,GetBackgroundImageSizeCommandError:()=>A.GetBackgroundImageSizeCommandError,GetBatteryStatusCommand:()=>D.GetBatteryStatusCommand,GetDeviceMetadataDeviceAction:()=>V.GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction:()=>z.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>I.GetOsVersionCommand,GlobalCommandError:()=>m.GlobalCommandError,GlobalCommandErrorHandler:()=>m.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>P.GoToDashboardDeviceAction,InstallAppDeviceAction:()=>ee.InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction:()=>W.InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError:()=>x.InvalidGetFirmwareMetadataResponseError,InvalidStatusWordError:()=>x.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>n.LEDGER_VENDOR_ID,ListAppsCommand:()=>T.ListAppsCommand,ListAppsDeviceAction:()=>w.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>H.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>oe.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>R.LoadCertificateCommand,LogLevel:()=>se.LogLevel,OpenAppCommand:()=>b.OpenAppCommand,OpenAppDeviceAction:()=>K.OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction:()=>N.OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError:()=>r.OutOfMemoryDAError,RefusedByUserDAError:()=>r.RefusedByUserDAError,SecureChannelError:()=>te.SecureChannelError,SendCommandInAppDeviceAction:()=>q.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>Y.StaticDeviceModelDataSource,TransportConnectedDevice:()=>De.TransportConnectedDevice,TransportDeviceModel:()=>J.TransportDeviceModel,UninstallAppDeviceAction:()=>re.UninstallAppDeviceAction,UnknownDAError:()=>r.UnknownDAError,UnsupportedFirmwareDAError:()=>r.UnsupportedFirmwareDAError,UserInteractionRequired:()=>k.UserInteractionRequired,WebLogsExporterLogger:()=>de.WebLogsExporterLogger,XStateDeviceAction:()=>X.XStateDeviceAction,base64StringToBuffer:()=>s.base64StringToBuffer,bufferToBase64String:()=>s.bufferToBase64String,bufferToHexaString:()=>c.bufferToHexaString,connectedDeviceStubBuilder:()=>ue.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>pe.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>ae.defaultApduSenderServiceStubBuilder,formatApduReceivedLog:()=>l.formatApduReceivedLog,formatApduSentLog:()=>l.formatApduSentLog,hexaStringToBuffer:()=>c.hexaStringToBuffer,isBase64String:()=>s.isBase64String,isCommandErrorCode:()=>O.isCommandErrorCode,isHexaString:()=>c.isHexaString,isSuccessCommandResult:()=>i.isSuccessCommandResult,noopLogger:()=>u.noopLogger,noopLoggerFactory:()=>u.noopLoggerFactory});module.exports=ye(e);var y=require("./apdu/model/Apdu"),d=require("./apdu/utils/ApduBuilder"),C=require("./apdu/utils/ApduParser");o(e,require("./apdu/utils/AppBuilderError"),module.exports);var G=require("./apdu/utils/ByteArrayBuilder"),L=require("./apdu/utils/ByteArrayParser"),x=require("./command/Errors"),i=require("./command/model/CommandResult"),E=require("./command/os/CloseAppCommand"),B=require("./command/os/GetAppAndVersionCommand"),A=require("./command/os/GetBackgroundImageSizeCommand"),D=require("./command/os/GetBatteryStatusCommand"),I=require("./command/os/GetOsVersionCommand"),T=require("./command/os/ListAppsCommand"),R=require("./command/os/LoadCertificateCommand"),b=require("./command/os/OpenAppCommand"),O=require("./command/utils/CommandErrors"),h=require("./command/utils/CommandUtils"),m=require("./command/utils/GlobalCommandError"),n=require("./device/DeviceModel"),M=require("./device/DeviceStatus"),U=require("./device-action/model/DeviceActionState"),k=require("./device-action/model/UserInteractionRequired"),F=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),_=require("./device-action/os/Const"),r=require("./device-action/os/Errors"),V=require("./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),z=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),P=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),W=require("./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),w=require("./device-action/os/ListApps/ListAppsDeviceAction"),H=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),K=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),N=require("./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction"),q=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),X=require("./device-action/xstate-utils/XStateDeviceAction"),Y=require("./device-model/data/StaticDeviceModelDataSource"),j=require("./device-model/model/BleDeviceInfos"),J=require("./device-model/model/DeviceModel"),Q=require("./device-session/ApduResponse");o(e,require("./device-session/data/FramerConst"),module.exports);var Z=require("./device-session/DeviceSessionState"),$=require("./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction"),ee=require("./secure-channel/device-action/InstallApp/InstallAppDeviceAction"),oe=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),re=require("./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction"),te=require("../internal/secure-channel/model/Errors"),pe=require("./device-session/service/DefaultApduReceiverService.stub"),ae=require("./device-session/service/DefaultApduSenderService.stub"),ie=require("./device-session/utils/FramerUtils"),me=require("./DeviceManagementKit"),ne=require("./DeviceManagementKitBuilder");o(e,require("./Error"),module.exports);var u=require("./logger-publisher/utils/noopLoggerFactory"),se=require("./logger-subscriber/model/LogLevel"),ce=require("./logger-subscriber/service/ConsoleLogger"),fe=require("./logger-subscriber/service/DefaultLogTagFormatter"),de=require("./logger-subscriber/service/WebLogsExporterLogger"),xe=require("./transport/model/ConnectedDevice"),Ae=require("./transport/model/DeviceConnectionStateMachine");o(e,require("./transport/model/Errors"),module.exports);var De=require("./transport/model/TransportConnectedDevice"),ue=require("./transport/model/TransportConnectedDevice.stub");o(e,require("./types"),module.exports);var l=require("./utils/apduLogs"),s=require("./utils/Base64String"),c=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,AppAlreadyInstalledDAError,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DEFAULT_UNLOCK_TIMEOUT_MS,DefaultLogTagFormatter,DeviceActionStatus,DeviceConnectionStateMachine,DeviceLockedError,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceNotOnboardedError,DeviceSessionStateType,DeviceStatus,FramerUtils,GLOBAL_ERRORS,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBackgroundImageSizeCommand,GetBackgroundImageSizeCommandError,GetBatteryStatusCommand,GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError,RefusedByUserDAError,SecureChannelError,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UninstallAppDeviceAction,UnknownDAError,UnsupportedFirmwareDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToBase64String,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,formatApduReceivedLog,formatApduSentLog,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,noopLogger,noopLoggerFactory,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
|
|
1
|
+
"use strict";var S=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Se=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var ge=(p,t)=>{for(var a in t)S(p,a,{get:t[a],enumerable:!0})},v=(p,t,a,y)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of Se(t))!ye.call(p,f)&&f!==a&&S(p,f,{get:()=>t[f],enumerable:!(y=ve(t,f))||y.enumerable});return p},o=(p,t,a)=>(v(p,t,"default"),a&&v(a,t,"default"));var Ce=p=>v(S({},"__esModule",{value:!0}),p);var e={};ge(e,{APDU_MAX_PAYLOAD:()=>d.APDU_MAX_PAYLOAD,Apdu:()=>g.Apdu,ApduBuilder:()=>d.ApduBuilder,ApduParser:()=>C.ApduParser,ApduResponse:()=>Q.ApduResponse,AppAlreadyInstalledDAError:()=>r.AppAlreadyInstalledDAError,ApplicationChecker:()=>le.ApplicationChecker,BatteryStatusType:()=>D.BatteryStatusType,BleDeviceInfos:()=>j.BleDeviceInfos,ByteArrayBuilder:()=>G.ByteArrayBuilder,ByteArrayParser:()=>L.ByteArrayParser,CallTaskInAppDeviceAction:()=>F.CallTaskInAppDeviceAction,CloseAppCommand:()=>E.CloseAppCommand,CommandResultFactory:()=>i.CommandResultFactory,CommandResultStatus:()=>i.CommandResultStatus,CommandUtils:()=>O.CommandUtils,ConnectedDevice:()=>xe.ConnectedDevice,ConsoleLogger:()=>ce.ConsoleLogger,DEFAULT_UNLOCK_TIMEOUT_MS:()=>_.DEFAULT_UNLOCK_TIMEOUT_MS,DefaultLogTagFormatter:()=>fe.DefaultLogTagFormatter,DeviceActionStatus:()=>U.DeviceActionStatus,DeviceConnectionStateMachine:()=>Ae.DeviceConnectionStateMachine,DeviceLockedError:()=>r.DeviceLockedError,DeviceManagementKit:()=>ne.DeviceManagementKit,DeviceManagementKitBuilder:()=>me.DeviceManagementKitBuilder,DeviceModel:()=>m.DeviceModel,DeviceModelId:()=>m.DeviceModelId,DeviceNotOnboardedError:()=>r.DeviceNotOnboardedError,DeviceSessionStateType:()=>Z.DeviceSessionStateType,DeviceStatus:()=>M.DeviceStatus,FramerUtils:()=>ie.FramerUtils,GLOBAL_ERRORS:()=>n.GLOBAL_ERRORS,GenuineCheckDeviceAction:()=>$.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>B.GetAppAndVersionCommand,GetBackgroundImageSizeCommand:()=>A.GetBackgroundImageSizeCommand,GetBackgroundImageSizeCommandError:()=>A.GetBackgroundImageSizeCommandError,GetBatteryStatusCommand:()=>D.GetBatteryStatusCommand,GetDeviceMetadataDeviceAction:()=>V.GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction:()=>z.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>R.GetOsVersionCommand,GlobalCommandError:()=>n.GlobalCommandError,GlobalCommandErrorHandler:()=>n.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>P.GoToDashboardDeviceAction,InstallAppDeviceAction:()=>ee.InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction:()=>W.InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError:()=>x.InvalidGetFirmwareMetadataResponseError,InvalidStatusWordError:()=>x.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>m.LEDGER_VENDOR_ID,ListAppsCommand:()=>I.ListAppsCommand,ListAppsDeviceAction:()=>w.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>H.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>oe.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>T.LoadCertificateCommand,LogLevel:()=>se.LogLevel,OpenAppCommand:()=>b.OpenAppCommand,OpenAppDeviceAction:()=>K.OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction:()=>N.OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError:()=>r.OutOfMemoryDAError,RefusedByUserDAError:()=>r.RefusedByUserDAError,SecureChannelError:()=>te.SecureChannelError,SendCommandInAppDeviceAction:()=>q.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>Y.StaticDeviceModelDataSource,TransportConnectedDevice:()=>De.TransportConnectedDevice,TransportDeviceModel:()=>J.TransportDeviceModel,UninstallAppDeviceAction:()=>re.UninstallAppDeviceAction,UnknownDAError:()=>r.UnknownDAError,UnsupportedFirmwareDAError:()=>r.UnsupportedFirmwareDAError,UserInteractionRequired:()=>k.UserInteractionRequired,WebLogsExporterLogger:()=>de.WebLogsExporterLogger,XStateDeviceAction:()=>X.XStateDeviceAction,base64StringToBuffer:()=>s.base64StringToBuffer,bufferToBase64String:()=>s.bufferToBase64String,bufferToHexaString:()=>c.bufferToHexaString,connectedDeviceStubBuilder:()=>ue.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>pe.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>ae.defaultApduSenderServiceStubBuilder,formatApduReceivedLog:()=>l.formatApduReceivedLog,formatApduSentLog:()=>l.formatApduSentLog,hexaStringToBuffer:()=>c.hexaStringToBuffer,isBase64String:()=>s.isBase64String,isCommandErrorCode:()=>h.isCommandErrorCode,isHexaString:()=>c.isHexaString,isSuccessCommandResult:()=>i.isSuccessCommandResult,noopLogger:()=>u.noopLogger,noopLoggerFactory:()=>u.noopLoggerFactory});module.exports=Ce(e);var g=require("./apdu/model/Apdu"),d=require("./apdu/utils/ApduBuilder"),C=require("./apdu/utils/ApduParser");o(e,require("./apdu/utils/AppBuilderError"),module.exports);var G=require("./apdu/utils/ByteArrayBuilder"),L=require("./apdu/utils/ByteArrayParser"),x=require("./command/Errors"),i=require("./command/model/CommandResult"),E=require("./command/os/CloseAppCommand"),B=require("./command/os/GetAppAndVersionCommand"),A=require("./command/os/GetBackgroundImageSizeCommand"),D=require("./command/os/GetBatteryStatusCommand"),R=require("./command/os/GetOsVersionCommand"),I=require("./command/os/ListAppsCommand"),T=require("./command/os/LoadCertificateCommand"),b=require("./command/os/OpenAppCommand"),h=require("./command/utils/CommandErrors"),O=require("./command/utils/CommandUtils"),n=require("./command/utils/GlobalCommandError"),m=require("./device/DeviceModel"),M=require("./device/DeviceStatus"),U=require("./device-action/model/DeviceActionState"),k=require("./device-action/model/UserInteractionRequired"),F=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),_=require("./device-action/os/Const"),r=require("./device-action/os/Errors"),V=require("./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),z=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),P=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),W=require("./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),w=require("./device-action/os/ListApps/ListAppsDeviceAction"),H=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),K=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),N=require("./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction"),q=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),X=require("./device-action/xstate-utils/XStateDeviceAction"),Y=require("./device-model/data/StaticDeviceModelDataSource"),j=require("./device-model/model/BleDeviceInfos"),J=require("./device-model/model/DeviceModel"),Q=require("./device-session/ApduResponse");o(e,require("./device-session/data/FramerConst"),module.exports);var Z=require("./device-session/DeviceSessionState"),$=require("./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction"),ee=require("./secure-channel/device-action/InstallApp/InstallAppDeviceAction"),oe=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),re=require("./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction"),te=require("../internal/secure-channel/model/Errors"),pe=require("./device-session/service/DefaultApduReceiverService.stub"),ae=require("./device-session/service/DefaultApduSenderService.stub"),ie=require("./device-session/utils/FramerUtils"),ne=require("./DeviceManagementKit"),me=require("./DeviceManagementKitBuilder");o(e,require("./Error"),module.exports);var u=require("./logger-publisher/utils/noopLoggerFactory"),se=require("./logger-subscriber/model/LogLevel"),ce=require("./logger-subscriber/service/ConsoleLogger"),fe=require("./logger-subscriber/service/DefaultLogTagFormatter"),de=require("./logger-subscriber/service/WebLogsExporterLogger"),xe=require("./transport/model/ConnectedDevice"),Ae=require("./transport/model/DeviceConnectionStateMachine");o(e,require("./transport/model/Errors"),module.exports);var De=require("./transport/model/TransportConnectedDevice"),ue=require("./transport/model/TransportConnectedDevice.stub");o(e,require("./types"),module.exports);var l=require("./utils/apduLogs"),le=require("./utils/ApplicationChecker"),s=require("./utils/Base64String"),c=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,AppAlreadyInstalledDAError,ApplicationChecker,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DEFAULT_UNLOCK_TIMEOUT_MS,DefaultLogTagFormatter,DeviceActionStatus,DeviceConnectionStateMachine,DeviceLockedError,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceNotOnboardedError,DeviceSessionStateType,DeviceStatus,FramerUtils,GLOBAL_ERRORS,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBackgroundImageSizeCommand,GetBackgroundImageSizeCommandError,GetBatteryStatusCommand,GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError,RefusedByUserDAError,SecureChannelError,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UninstallAppDeviceAction,UnknownDAError,UnsupportedFirmwareDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToBase64String,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,formatApduReceivedLog,formatApduSentLog,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,noopLogger,noopLoggerFactory,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/api/index.ts"],
|
|
4
|
-
"sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { type Command } from \"@api/command/Command\";\nexport {\n InvalidGetFirmwareMetadataResponseError,\n InvalidStatusWordError,\n} from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n GetBackgroundImageSizeCommand,\n GetBackgroundImageSizeCommandError,\n type GetBackgroundImageSizeCommandResult,\n type GetBackgroundImageSizeErrorCodes,\n type GetBackgroundImageSizeResponse,\n} from \"@api/command/os/GetBackgroundImageSizeCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nexport {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n DeviceNotOnboardedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport type {\n GoToDashboardDAError,\n GoToDashboardDAInput,\n GoToDashboardDAIntermediateValue,\n GoToDashboardDAOutput,\n GoToDashboardDARequiredInteraction,\n GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport {\n noopLogger,\n noopLoggerFactory,\n} from \"@api/logger-publisher/utils/noopLoggerFactory\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { DefaultLogTagFormatter } from \"@api/logger-subscriber/service/DefaultLogTagFormatter\";\nexport { type LogTagFormatter } from \"@api/logger-subscriber/service/LogTagFormatter\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { formatApduReceivedLog, formatApduSentLog } from \"@api/utils/apduLogs\";\nexport {\n base64StringToBuffer,\n bufferToBase64String,\n isBase64String,\n} from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
|
5
|
-
"mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,
|
|
6
|
-
"names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBackgroundImageSizeCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_Const", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_OpenAppWithDependenciesDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_GenuineCheckDeviceAction", "import_InstallAppDeviceAction", "import_ListInstalledAppsDeviceAction", "import_UninstallAppDeviceAction", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_noopLoggerFactory", "import_LogLevel", "import_ConsoleLogger", "import_DefaultLogTagFormatter", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_DeviceConnectionStateMachine", "import_TransportConnectedDevice", "import_apduLogs", "import_Base64String", "import_HexaString"]
|
|
4
|
+
"sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { type Command } from \"@api/command/Command\";\nexport {\n InvalidGetFirmwareMetadataResponseError,\n InvalidStatusWordError,\n} from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n GetBackgroundImageSizeCommand,\n GetBackgroundImageSizeCommandError,\n type GetBackgroundImageSizeCommandResult,\n type GetBackgroundImageSizeErrorCodes,\n type GetBackgroundImageSizeResponse,\n} from \"@api/command/os/GetBackgroundImageSizeCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nexport {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n DeviceNotOnboardedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport type {\n GoToDashboardDAError,\n GoToDashboardDAInput,\n GoToDashboardDAIntermediateValue,\n GoToDashboardDAOutput,\n GoToDashboardDARequiredInteraction,\n GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport {\n noopLogger,\n noopLoggerFactory,\n} from \"@api/logger-publisher/utils/noopLoggerFactory\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { DefaultLogTagFormatter } from \"@api/logger-subscriber/service/DefaultLogTagFormatter\";\nexport { type LogTagFormatter } from \"@api/logger-subscriber/service/LogTagFormatter\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { formatApduReceivedLog, formatApduSentLog } from \"@api/utils/apduLogs\";\nexport { ApplicationChecker } from \"@api/utils/ApplicationChecker\";\nexport {\n type AppConfig,\n type ApplicationResolver,\n type ResolvedApp,\n} from \"@api/utils/ApplicationResolver\";\nexport {\n base64StringToBuffer,\n bufferToBase64String,\n isBase64String,\n} from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
|
5
|
+
"mappings": "meA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
6
|
+
"names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBackgroundImageSizeCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_Const", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_OpenAppWithDependenciesDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_GenuineCheckDeviceAction", "import_InstallAppDeviceAction", "import_ListInstalledAppsDeviceAction", "import_UninstallAppDeviceAction", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_noopLoggerFactory", "import_LogLevel", "import_ConsoleLogger", "import_DefaultLogTagFormatter", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_DeviceConnectionStateMachine", "import_TransportConnectedDevice", "import_apduLogs", "import_ApplicationChecker", "import_Base64String", "import_HexaString"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var a=(i,e)=>{for(var o in e)p(i,o,{get:e[o],enumerable:!0})},h=(i,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of n(e))!c.call(i,t)&&t!==o&&p(i,t,{get:()=>e[t],enumerable:!(s=l(e,t))||s.enumerable});return i};var v=i=>h(p({},"__esModule",{value:!0}),i);var d={};a(d,{ApplicationChecker:()=>m});module.exports=v(d);var r=require("semver");class m{isCompatible;version;modelId;constructor(e,o,s){this.modelId=e.deviceModelId;const t=s.resolve(e,o);this.isCompatible=t.isCompatible,this.version=t.version}withMinVersionInclusive(e){return(0,r.gte)(this.version,e)||(this.isCompatible=!1),this}withMinVersionExclusive(e){return(0,r.gt)(this.version,e)||(this.isCompatible=!1),this}excludeDeviceModel(e){return this.modelId===e&&(this.isCompatible=!1),this}check(){return this.isCompatible}}0&&(module.exports={ApplicationChecker});
|
|
2
|
+
//# sourceMappingURL=ApplicationChecker.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/api/utils/ApplicationChecker.ts"],
|
|
4
|
+
"sourcesContent": ["import { gt, gte } from \"semver\";\n\nimport { type DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\n\nimport {\n type AppConfig,\n type ApplicationResolver,\n} from \"./ApplicationResolver\";\n\nexport class ApplicationChecker {\n private isCompatible: boolean;\n private version: string;\n private modelId: DeviceModelId;\n\n constructor(\n deviceState: DeviceSessionState,\n appConfig: AppConfig,\n resolver: ApplicationResolver,\n ) {\n this.modelId = deviceState.deviceModelId;\n const resolved = resolver.resolve(deviceState, appConfig);\n this.isCompatible = resolved.isCompatible;\n this.version = resolved.version;\n }\n\n withMinVersionInclusive(version: string): ApplicationChecker {\n if (!gte(this.version, version)) this.isCompatible = false;\n return this;\n }\n\n withMinVersionExclusive(version: string): ApplicationChecker {\n if (!gt(this.version, version)) this.isCompatible = false;\n return this;\n }\n\n excludeDeviceModel(modelId: DeviceModelId): ApplicationChecker {\n if (this.modelId === modelId) this.isCompatible = false;\n return this;\n }\n\n check(): boolean {\n return this.isCompatible;\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAwB,kBAUjB,MAAMF,CAAmB,CACtB,aACA,QACA,QAER,YACEG,EACAC,EACAC,EACA,CACA,KAAK,QAAUF,EAAY,cAC3B,MAAMG,EAAWD,EAAS,QAAQF,EAAaC,CAAS,EACxD,KAAK,aAAeE,EAAS,aAC7B,KAAK,QAAUA,EAAS,OAC1B,CAEA,wBAAwBC,EAAqC,CAC3D,SAAK,OAAI,KAAK,QAASA,CAAO,IAAG,KAAK,aAAe,IAC9C,IACT,CAEA,wBAAwBA,EAAqC,CAC3D,SAAK,MAAG,KAAK,QAASA,CAAO,IAAG,KAAK,aAAe,IAC7C,IACT,CAEA,mBAAmBC,EAA4C,CAC7D,OAAI,KAAK,UAAYA,IAAS,KAAK,aAAe,IAC3C,IACT,CAEA,OAAiB,CACf,OAAO,KAAK,YACd,CACF",
|
|
6
|
+
"names": ["ApplicationChecker_exports", "__export", "ApplicationChecker", "__toCommonJS", "import_semver", "deviceState", "appConfig", "resolver", "resolved", "version", "modelId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=require("../device/DeviceModel"),n=require("../device/DeviceStatus"),l=require("../device-session/DeviceSessionState"),i=require("./ApplicationChecker");describe("ApplicationChecker",()=>{function s(e=r.DeviceModelId.FLEX){return{sessionStateType:l.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:n.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"TestApp",version:"1.0.0"},deviceModelId:e,isSecureConnectionAllowed:!1}}function o(e){return{resolve:()=>e}}const c={version:"1.0.0"};it("should pass check when resolved as compatible",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),c,e).check();expect(t).toStrictEqual(!0)}),it("should reject check when resolved as incompatible",()=>{const e=o({isCompatible:!1,version:"0.0.1"}),t=new i.ApplicationChecker(s(),c,e).check();expect(t).toStrictEqual(!1)}),it("should pass with min version inclusive when version matches",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!0)}),it("should reject with min version inclusive when version is too low",()=>{const e=o({isCompatible:!0,version:"1.11.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!1)}),it("should pass with min version exclusive when version is greater",()=>{const e=o({isCompatible:!0,version:"1.13.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionExclusive("1.12.0").check();expect(t).toStrictEqual(!0)}),it("should reject with min version exclusive when version is equal",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionExclusive("1.12.0").check();expect(t).toStrictEqual(!1)}),it("should pass when device model is not excluded",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(r.DeviceModelId.FLEX),c,e).excludeDeviceModel(r.DeviceModelId.NANO_S).check();expect(t).toStrictEqual(!0)}),it("should reject when device model is excluded",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(r.DeviceModelId.FLEX),c,e).excludeDeviceModel(r.DeviceModelId.FLEX).check();expect(t).toStrictEqual(!1)}),it("should pass with chained conditions when all are met",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionInclusive("1.11.0").excludeDeviceModel(r.DeviceModelId.NANO_S).check();expect(t).toStrictEqual(!0)}),it("should reject with chained conditions when one fails",()=>{const e=o({isCompatible:!0,version:"1.10.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionInclusive("1.11.0").excludeDeviceModel(r.DeviceModelId.NANO_S).check();expect(t).toStrictEqual(!1)}),it("should not override incompatible resolution even if constraints pass",()=>{const e=o({isCompatible:!1,version:"1.15.0"}),t=new i.ApplicationChecker(s(),c,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!1)})});
|
|
2
|
+
//# sourceMappingURL=ApplicationChecker.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/api/utils/ApplicationChecker.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\n\nimport { ApplicationChecker } from \"./ApplicationChecker\";\nimport {\n type ApplicationResolver,\n type ResolvedApp,\n} from \"./ApplicationResolver\";\n\ndescribe(\"ApplicationChecker\", () => {\n function createReadyState(modelId: DeviceModelId = DeviceModelId.FLEX) {\n return {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"TestApp\", version: \"1.0.0\" },\n deviceModelId: modelId,\n isSecureConnectionAllowed: false,\n };\n }\n\n function createMockResolver(resolved: ResolvedApp): ApplicationResolver {\n return {\n resolve: () => resolved,\n };\n }\n\n const appConfig = { version: \"1.0.0\" };\n\n it(\"should pass check when resolved as compatible\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n ).check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject check when resolved as incompatible\", () => {\n const resolver = createMockResolver({\n isCompatible: false,\n version: \"0.0.1\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n ).check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with min version inclusive when version matches\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with min version inclusive when version is too low\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.11.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with min version exclusive when version is greater\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.13.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with min version exclusive when version is equal\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass when device model is not excluded\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(DeviceModelId.FLEX),\n appConfig,\n resolver,\n )\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject when device model is excluded\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(DeviceModelId.FLEX),\n appConfig,\n resolver,\n )\n .excludeDeviceModel(DeviceModelId.FLEX)\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with chained conditions when all are met\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with chained conditions when one fails\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.10.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should not override incompatible resolution even if constraints pass\", () => {\n const resolver = createMockResolver({\n isCompatible: false,\n version: \"1.15.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n});\n"],
|
|
5
|
+
"mappings": "aAAA,IAAAA,EAA8B,mCAC9BC,EAA6B,oCAC7BC,EAAuC,kDAEvCC,EAAmC,gCAMnC,SAAS,qBAAsB,IAAM,CACnC,SAASC,EAAiBC,EAAyB,gBAAc,KAAM,CACrE,MAAO,CACL,iBAAkB,yBAAuB,0BACzC,aAAc,eAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,OAAQ,EAChD,cAAeA,EACf,0BAA2B,EAC7B,CACF,CAEA,SAASC,EAAmBC,EAA4C,CACtE,MAAO,CACL,QAAS,IAAMA,CACjB,CACF,CAEA,MAAMC,EAAY,CAAE,QAAS,OAAQ,EAErC,GAAG,gDAAiD,IAAM,CACxD,MAAMC,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAI,qBACjBN,EAAiB,EACjBI,EACAC,CACF,EAAE,MAAM,EACR,OAAOC,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,oDAAqD,IAAM,CAC5D,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,OACX,CAAC,EACKI,EAAS,IAAI,qBACjBN,EAAiB,EACjBI,EACAC,CACF,EAAE,MAAM,EACR,OAAOC,CAAM,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EACKI,EAAS,IAAI,qBACjBN,EAAiB,gBAAc,IAAI,EACnCI,EACAC,CACF,EACG,mBAAmB,gBAAc,IAAI,EACrC,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAI,qBACjBN,EAAiB,EACjBI,EACAC,CACF,EACG,wBAAwB,QAAQ,EAChC,mBAAmB,gBAAc,MAAM,EACvC,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAI,qBACjBN,EAAiB,EACjBI,EACAC,CACF,EACG,wBAAwB,QAAQ,EAChC,mBAAmB,gBAAc,MAAM,EACvC,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,uEAAwE,IAAM,CAC/E,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAI,qBACjBN,EAAiB,EACjBI,EACAC,CACF,EACG,wBAAwB,QAAQ,EAChC,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["import_DeviceModel", "import_DeviceStatus", "import_DeviceSessionState", "import_ApplicationChecker", "createReadyState", "modelId", "createMockResolver", "resolved", "appConfig", "resolver", "result"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var l=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of s(e))!a.call(o,p)&&p!==t&&n(o,p,{get:()=>e[p],enumerable:!(i=r(e,p))||i.enumerable});return o};var v=o=>l(n({},"__esModule",{value:!0}),o);var d={};module.exports=v(d);
|
|
2
|
+
//# sourceMappingURL=ApplicationResolver.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/api/utils/ApplicationResolver.ts"],
|
|
4
|
+
"sourcesContent": ["import { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\n\nexport type AppConfig = Record<string, unknown> & {\n readonly version: string;\n};\n\nexport type ResolvedApp = {\n readonly isCompatible: boolean;\n readonly version: string;\n};\n\nexport interface ApplicationResolver {\n resolve(deviceState: DeviceSessionState, appConfig: AppConfig): ResolvedApp;\n}\n"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["ApplicationResolver_exports", "__toCommonJS"]
|
|
7
|
+
}
|
package/lib/esm/package.json
CHANGED
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
65
65
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
66
66
|
},
|
|
67
|
-
"version": "0.0.0-develop-
|
|
67
|
+
"version": "0.0.0-develop-20260310001152"
|
|
68
68
|
}
|
package/lib/esm/src/api/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Apdu as r}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as a}from"./apdu/utils/ApduBuilder";import{ApduParser as
|
|
1
|
+
import{Apdu as r}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as a}from"./apdu/utils/ApduBuilder";import{ApduParser as n}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as c}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as d}from"./apdu/utils/ByteArrayParser";import{InvalidGetFirmwareMetadataResponseError as A,InvalidStatusWordError as D}from"./command/Errors";import{CommandResultFactory as l,CommandResultStatus as v,isSuccessCommandResult as S}from"./command/model/CommandResult";import{CloseAppCommand as g}from"./command/os/CloseAppCommand";import{GetAppAndVersionCommand as G}from"./command/os/GetAppAndVersionCommand";import{GetBackgroundImageSizeCommand as E,GetBackgroundImageSizeCommandError as B}from"./command/os/GetBackgroundImageSizeCommand";import{BatteryStatusType as I,GetBatteryStatusCommand as T}from"./command/os/GetBatteryStatusCommand";import{GetOsVersionCommand as h}from"./command/os/GetOsVersionCommand";import{ListAppsCommand as M}from"./command/os/ListAppsCommand";import{LoadCertificateCommand as k}from"./command/os/LoadCertificateCommand";import{OpenAppCommand as _}from"./command/os/OpenAppCommand";import{isCommandErrorCode as z}from"./command/utils/CommandErrors";import{CommandUtils as W}from"./command/utils/CommandUtils";import{GLOBAL_ERRORS as H,GlobalCommandError as K,GlobalCommandErrorHandler as N}from"./command/utils/GlobalCommandError";import{DeviceModel as X,DeviceModelId as Y,LEDGER_VENDOR_ID as j}from"./device/DeviceModel";import{DeviceStatus as Q}from"./device/DeviceStatus";import{DeviceActionStatus as $}from"./device-action/model/DeviceActionState";import{UserInteractionRequired as oe}from"./device-action/model/UserInteractionRequired";import{CallTaskInAppDeviceAction as te}from"./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction";import{DEFAULT_UNLOCK_TIMEOUT_MS as ae}from"./device-action/os/Const";import{AppAlreadyInstalledDAError as ne,DeviceLockedError as me,DeviceNotOnboardedError as se,OutOfMemoryDAError as ce,RefusedByUserDAError as fe,UnknownDAError as de,UnsupportedFirmwareDAError as xe}from"./device-action/os/Errors";import{GetDeviceMetadataDeviceAction as De}from"./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction";import{GetDeviceStatusDeviceAction as le}from"./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as Se}from"./device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{InstallOrUpdateAppsDeviceAction as ge}from"./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction";import{ListAppsDeviceAction as Ge}from"./device-action/os/ListApps/ListAppsDeviceAction";import{ListAppsWithMetadataDeviceAction as Ee}from"./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction";import{OpenAppDeviceAction as Re}from"./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{OpenAppWithDependenciesDeviceAction as Te}from"./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction";import{SendCommandInAppDeviceAction as he}from"./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction";import{XStateDeviceAction as Me}from"./device-action/xstate-utils/XStateDeviceAction";import{StaticDeviceModelDataSource as ke}from"./device-model/data/StaticDeviceModelDataSource";import{BleDeviceInfos as _e}from"./device-model/model/BleDeviceInfos";import{TransportDeviceModel as ze}from"./device-model/model/DeviceModel";import{ApduResponse as We}from"./device-session/ApduResponse";export*from"./device-session/data/FramerConst";import{DeviceSessionStateType as Ke}from"./device-session/DeviceSessionState";import{GenuineCheckDeviceAction as qe}from"./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction";import{InstallAppDeviceAction as Ye}from"./secure-channel/device-action/InstallApp/InstallAppDeviceAction";import{ListInstalledAppsDeviceAction as Je}from"./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{UninstallAppDeviceAction as Ze}from"./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction";import{SecureChannelError as eo}from"../internal/secure-channel/model/Errors";import{defaultApduReceiverServiceStubBuilder as ro}from"./device-session/service/DefaultApduReceiverService.stub";import{defaultApduSenderServiceStubBuilder as po}from"./device-session/service/DefaultApduSenderService.stub";import{FramerUtils as io}from"./device-session/utils/FramerUtils";import{DeviceManagementKit as mo}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as co}from"./DeviceManagementKitBuilder";export*from"./Error";import{noopLogger as Ao,noopLoggerFactory as Do}from"./logger-publisher/utils/noopLoggerFactory";import{LogLevel as lo}from"./logger-subscriber/model/LogLevel";import{ConsoleLogger as So}from"./logger-subscriber/service/ConsoleLogger";import{DefaultLogTagFormatter as go}from"./logger-subscriber/service/DefaultLogTagFormatter";import{WebLogsExporterLogger as Go}from"./logger-subscriber/service/WebLogsExporterLogger";import{ConnectedDevice as Eo}from"./transport/model/ConnectedDevice";import{DeviceConnectionStateMachine as Ro}from"./transport/model/DeviceConnectionStateMachine";export*from"./transport/model/Errors";import{TransportConnectedDevice as bo}from"./transport/model/TransportConnectedDevice";import{connectedDeviceStubBuilder as Oo}from"./transport/model/TransportConnectedDevice.stub";export*from"./types";import{formatApduReceivedLog as ko,formatApduSentLog as Fo}from"./utils/apduLogs";import{ApplicationChecker as Vo}from"./utils/ApplicationChecker";import{base64StringToBuffer as Po,bufferToBase64String as Wo,isBase64String as wo}from"./utils/Base64String";import{bufferToHexaString as Ko,hexaStringToBuffer as No,isHexaString as qo}from"./utils/HexaString";export{p as APDU_MAX_PAYLOAD,r as Apdu,a as ApduBuilder,n as ApduParser,We as ApduResponse,ne as AppAlreadyInstalledDAError,Vo as ApplicationChecker,I as BatteryStatusType,_e as BleDeviceInfos,c as ByteArrayBuilder,d as ByteArrayParser,te as CallTaskInAppDeviceAction,g as CloseAppCommand,l as CommandResultFactory,v as CommandResultStatus,W as CommandUtils,Eo as ConnectedDevice,So as ConsoleLogger,ae as DEFAULT_UNLOCK_TIMEOUT_MS,go as DefaultLogTagFormatter,$ as DeviceActionStatus,Ro as DeviceConnectionStateMachine,me as DeviceLockedError,mo as DeviceManagementKit,co as DeviceManagementKitBuilder,X as DeviceModel,Y as DeviceModelId,se as DeviceNotOnboardedError,Ke as DeviceSessionStateType,Q as DeviceStatus,io as FramerUtils,H as GLOBAL_ERRORS,qe as GenuineCheckDeviceAction,G as GetAppAndVersionCommand,E as GetBackgroundImageSizeCommand,B as GetBackgroundImageSizeCommandError,T as GetBatteryStatusCommand,De as GetDeviceMetadataDeviceAction,le as GetDeviceStatusDeviceAction,h as GetOsVersionCommand,K as GlobalCommandError,N as GlobalCommandErrorHandler,Se as GoToDashboardDeviceAction,Ye as InstallAppDeviceAction,ge as InstallOrUpdateAppsDeviceAction,A as InvalidGetFirmwareMetadataResponseError,D as InvalidStatusWordError,j as LEDGER_VENDOR_ID,M as ListAppsCommand,Ge as ListAppsDeviceAction,Ee as ListAppsWithMetadataDeviceAction,Je as ListInstalledAppsDeviceAction,k as LoadCertificateCommand,lo as LogLevel,_ as OpenAppCommand,Re as OpenAppDeviceAction,Te as OpenAppWithDependenciesDeviceAction,ce as OutOfMemoryDAError,fe as RefusedByUserDAError,eo as SecureChannelError,he as SendCommandInAppDeviceAction,ke as StaticDeviceModelDataSource,bo as TransportConnectedDevice,ze as TransportDeviceModel,Ze as UninstallAppDeviceAction,de as UnknownDAError,xe as UnsupportedFirmwareDAError,oe as UserInteractionRequired,Go as WebLogsExporterLogger,Me as XStateDeviceAction,Po as base64StringToBuffer,Wo as bufferToBase64String,Ko as bufferToHexaString,Oo as connectedDeviceStubBuilder,ro as defaultApduReceiverServiceStubBuilder,po as defaultApduSenderServiceStubBuilder,ko as formatApduReceivedLog,Fo as formatApduSentLog,No as hexaStringToBuffer,wo as isBase64String,z as isCommandErrorCode,qo as isHexaString,S as isSuccessCommandResult,Ao as noopLogger,Do as noopLoggerFactory};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/api/index.ts"],
|
|
4
|
-
"sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { type Command } from \"@api/command/Command\";\nexport {\n InvalidGetFirmwareMetadataResponseError,\n InvalidStatusWordError,\n} from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n GetBackgroundImageSizeCommand,\n GetBackgroundImageSizeCommandError,\n type GetBackgroundImageSizeCommandResult,\n type GetBackgroundImageSizeErrorCodes,\n type GetBackgroundImageSizeResponse,\n} from \"@api/command/os/GetBackgroundImageSizeCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nexport {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n DeviceNotOnboardedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport type {\n GoToDashboardDAError,\n GoToDashboardDAInput,\n GoToDashboardDAIntermediateValue,\n GoToDashboardDAOutput,\n GoToDashboardDARequiredInteraction,\n GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport {\n noopLogger,\n noopLoggerFactory,\n} from \"@api/logger-publisher/utils/noopLoggerFactory\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { DefaultLogTagFormatter } from \"@api/logger-subscriber/service/DefaultLogTagFormatter\";\nexport { type LogTagFormatter } from \"@api/logger-subscriber/service/LogTagFormatter\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { formatApduReceivedLog, formatApduSentLog } from \"@api/utils/apduLogs\";\nexport {\n base64StringToBuffer,\n bufferToBase64String,\n isBase64String,\n} from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
|
5
|
-
"mappings": "AAEA,OAAS,QAAAA,MAAY,uBACrB,OAAS,oBAAAC,EAAkB,eAAAC,MAAmB,8BAC9C,OAAS,cAAAC,MAAkB,6BAC3B,WAAc,kCACd,OAAS,oBAAAC,MAAwB,mCACjC,OAAS,mBAAAC,MAAuB,kCAEhC,OACE,2CAAAC,EACA,0BAAAC,MACK,sBACP,OACE,wBAAAC,EACA,uBAAAC,EACA,0BAAAC,MACK,mCACP,OAAS,mBAAAC,MAAuB,kCAChC,OACE,2BAAAC,MAEK,0CACP,OACE,iCAAAC,EACA,sCAAAC,MAIK,gDACP,OACE,qBAAAC,EAEA,2BAAAC,MAEK,0CACP,OACE,uBAAAC,MAEK,sCACP,OAEE,mBAAAC,MAGK,kCACP,OAEE,0BAAAC,MAEK,yCACP,OAEE,kBAAAC,MACK,iCACP,OAAS,sBAAAC,MAA0B,mCACnC,OAAS,gBAAAC,MAAoB,kCAC7B,OACE,iBAAAC,EACA,sBAAAC,EACA,6BAAAC,MACK,wCACP,OACE,eAAAC,EACA,iBAAAC,EACA,oBAAAC,MACK,0BACP,OAAS,gBAAAC,MAAoB,2BAE7B,OAEE,sBAAAC,MACK,6CACP,OAAS,2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AAAC,GAAuB,qBAAAC,OAAyB,sBACzD,OACE,wBAAAC,GACA,wBAAAC,GACA,kBAAAC,OACK,0BACP,OACE,sBAAAC,GACA,sBAAAC,GACA,gBAAAC,OACK",
|
|
6
|
-
"names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidGetFirmwareMetadataResponseError", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "GetAppAndVersionCommand", "GetBackgroundImageSizeCommand", "GetBackgroundImageSizeCommandError", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "LoadCertificateCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GLOBAL_ERRORS", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "DeviceActionStatus", "UserInteractionRequired", "CallTaskInAppDeviceAction", "DEFAULT_UNLOCK_TIMEOUT_MS", "AppAlreadyInstalledDAError", "DeviceLockedError", "DeviceNotOnboardedError", "OutOfMemoryDAError", "RefusedByUserDAError", "UnknownDAError", "UnsupportedFirmwareDAError", "GetDeviceMetadataDeviceAction", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "InstallOrUpdateAppsDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "OpenAppWithDependenciesDeviceAction", "SendCommandInAppDeviceAction", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "GenuineCheckDeviceAction", "InstallAppDeviceAction", "ListInstalledAppsDeviceAction", "UninstallAppDeviceAction", "SecureChannelError", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "noopLogger", "noopLoggerFactory", "LogLevel", "ConsoleLogger", "DefaultLogTagFormatter", "WebLogsExporterLogger", "ConnectedDevice", "DeviceConnectionStateMachine", "TransportConnectedDevice", "connectedDeviceStubBuilder", "formatApduReceivedLog", "formatApduSentLog", "base64StringToBuffer", "bufferToBase64String", "isBase64String", "bufferToHexaString", "hexaStringToBuffer", "isHexaString"]
|
|
4
|
+
"sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { type Command } from \"@api/command/Command\";\nexport {\n InvalidGetFirmwareMetadataResponseError,\n InvalidStatusWordError,\n} from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n GetBackgroundImageSizeCommand,\n GetBackgroundImageSizeCommandError,\n type GetBackgroundImageSizeCommandResult,\n type GetBackgroundImageSizeErrorCodes,\n type GetBackgroundImageSizeResponse,\n} from \"@api/command/os/GetBackgroundImageSizeCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nexport {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n DeviceNotOnboardedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport type {\n GoToDashboardDAError,\n GoToDashboardDAInput,\n GoToDashboardDAIntermediateValue,\n GoToDashboardDAOutput,\n GoToDashboardDARequiredInteraction,\n GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport {\n noopLogger,\n noopLoggerFactory,\n} from \"@api/logger-publisher/utils/noopLoggerFactory\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { DefaultLogTagFormatter } from \"@api/logger-subscriber/service/DefaultLogTagFormatter\";\nexport { type LogTagFormatter } from \"@api/logger-subscriber/service/LogTagFormatter\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { formatApduReceivedLog, formatApduSentLog } from \"@api/utils/apduLogs\";\nexport { ApplicationChecker } from \"@api/utils/ApplicationChecker\";\nexport {\n type AppConfig,\n type ApplicationResolver,\n type ResolvedApp,\n} from \"@api/utils/ApplicationResolver\";\nexport {\n base64StringToBuffer,\n bufferToBase64String,\n isBase64String,\n} from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
|
5
|
+
"mappings": "AAEA,OAAS,QAAAA,MAAY,uBACrB,OAAS,oBAAAC,EAAkB,eAAAC,MAAmB,8BAC9C,OAAS,cAAAC,MAAkB,6BAC3B,WAAc,kCACd,OAAS,oBAAAC,MAAwB,mCACjC,OAAS,mBAAAC,MAAuB,kCAEhC,OACE,2CAAAC,EACA,0BAAAC,MACK,sBACP,OACE,wBAAAC,EACA,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EACzC,OAAS,sBAAAC,OAA0B,wCAEnC,OAAS,yCAAAC,OAA6C,8DACtD,OAAS,uCAAAC,OAA2C,4DACpD,OAAS,eAAAC,OAAmB,wCAC5B,OAAS,uBAAAC,OAA2B,2BACpC,OAAS,8BAAAC,OAAkC,kCAC3C,WAAc,aACd,OACE,cAAAC,GACA,qBAAAC,OACK,gDACP,OAAS,YAAAC,OAAgB,wCACzB,OAAS,iBAAAC,OAAqB,+CAC9B,OAAS,0BAAAC,OAA8B,wDAEvC,OAAS,yBAAAC,OAA6B,uDACtC,OAAS,mBAAAC,OAAuB,uCAChC,OACE,gCAAAC,OAEK,oDACP,WAAc,8BACd,OAAS,4BAAAC,OAAgC,gDACzC,OAAS,8BAAAC,OAAkC,qDAC3C,WAAc,aACd,OAAS,yBAAAC,GAAuB,qBAAAC,OAAyB,sBACzD,OAAS,sBAAAC,OAA0B,gCAMnC,OACE,wBAAAC,GACA,wBAAAC,GACA,kBAAAC,OACK,0BACP,OACE,sBAAAC,GACA,sBAAAC,GACA,gBAAAC,OACK",
|
|
6
|
+
"names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidGetFirmwareMetadataResponseError", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "GetAppAndVersionCommand", "GetBackgroundImageSizeCommand", "GetBackgroundImageSizeCommandError", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "LoadCertificateCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GLOBAL_ERRORS", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "DeviceActionStatus", "UserInteractionRequired", "CallTaskInAppDeviceAction", "DEFAULT_UNLOCK_TIMEOUT_MS", "AppAlreadyInstalledDAError", "DeviceLockedError", "DeviceNotOnboardedError", "OutOfMemoryDAError", "RefusedByUserDAError", "UnknownDAError", "UnsupportedFirmwareDAError", "GetDeviceMetadataDeviceAction", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "InstallOrUpdateAppsDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "OpenAppWithDependenciesDeviceAction", "SendCommandInAppDeviceAction", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "GenuineCheckDeviceAction", "InstallAppDeviceAction", "ListInstalledAppsDeviceAction", "UninstallAppDeviceAction", "SecureChannelError", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "noopLogger", "noopLoggerFactory", "LogLevel", "ConsoleLogger", "DefaultLogTagFormatter", "WebLogsExporterLogger", "ConnectedDevice", "DeviceConnectionStateMachine", "TransportConnectedDevice", "connectedDeviceStubBuilder", "formatApduReceivedLog", "formatApduSentLog", "ApplicationChecker", "base64StringToBuffer", "bufferToBase64String", "isBase64String", "bufferToHexaString", "hexaStringToBuffer", "isHexaString"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{gt as s,gte as r}from"semver";class n{isCompatible;version;modelId;constructor(e,t,o){this.modelId=e.deviceModelId;const i=o.resolve(e,t);this.isCompatible=i.isCompatible,this.version=i.version}withMinVersionInclusive(e){return r(this.version,e)||(this.isCompatible=!1),this}withMinVersionExclusive(e){return s(this.version,e)||(this.isCompatible=!1),this}excludeDeviceModel(e){return this.modelId===e&&(this.isCompatible=!1),this}check(){return this.isCompatible}}export{n as ApplicationChecker};
|
|
2
|
+
//# sourceMappingURL=ApplicationChecker.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/api/utils/ApplicationChecker.ts"],
|
|
4
|
+
"sourcesContent": ["import { gt, gte } from \"semver\";\n\nimport { type DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\n\nimport {\n type AppConfig,\n type ApplicationResolver,\n} from \"./ApplicationResolver\";\n\nexport class ApplicationChecker {\n private isCompatible: boolean;\n private version: string;\n private modelId: DeviceModelId;\n\n constructor(\n deviceState: DeviceSessionState,\n appConfig: AppConfig,\n resolver: ApplicationResolver,\n ) {\n this.modelId = deviceState.deviceModelId;\n const resolved = resolver.resolve(deviceState, appConfig);\n this.isCompatible = resolved.isCompatible;\n this.version = resolved.version;\n }\n\n withMinVersionInclusive(version: string): ApplicationChecker {\n if (!gte(this.version, version)) this.isCompatible = false;\n return this;\n }\n\n withMinVersionExclusive(version: string): ApplicationChecker {\n if (!gt(this.version, version)) this.isCompatible = false;\n return this;\n }\n\n excludeDeviceModel(modelId: DeviceModelId): ApplicationChecker {\n if (this.modelId === modelId) this.isCompatible = false;\n return this;\n }\n\n check(): boolean {\n return this.isCompatible;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,MAAAA,EAAI,OAAAC,MAAW,SAUjB,MAAMC,CAAmB,CACtB,aACA,QACA,QAER,YACEC,EACAC,EACAC,EACA,CACA,KAAK,QAAUF,EAAY,cAC3B,MAAMG,EAAWD,EAAS,QAAQF,EAAaC,CAAS,EACxD,KAAK,aAAeE,EAAS,aAC7B,KAAK,QAAUA,EAAS,OAC1B,CAEA,wBAAwBC,EAAqC,CAC3D,OAAKN,EAAI,KAAK,QAASM,CAAO,IAAG,KAAK,aAAe,IAC9C,IACT,CAEA,wBAAwBA,EAAqC,CAC3D,OAAKP,EAAG,KAAK,QAASO,CAAO,IAAG,KAAK,aAAe,IAC7C,IACT,CAEA,mBAAmBC,EAA4C,CAC7D,OAAI,KAAK,UAAYA,IAAS,KAAK,aAAe,IAC3C,IACT,CAEA,OAAiB,CACf,OAAO,KAAK,YACd,CACF",
|
|
6
|
+
"names": ["gt", "gte", "ApplicationChecker", "deviceState", "appConfig", "resolver", "resolved", "version", "modelId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{DeviceModelId as r}from"../device/DeviceModel";import{DeviceStatus as n}from"../device/DeviceStatus";import{DeviceSessionStateType as l}from"../device-session/DeviceSessionState";import{ApplicationChecker as c}from"./ApplicationChecker";describe("ApplicationChecker",()=>{function i(e=r.FLEX){return{sessionStateType:l.ReadyWithoutSecureChannel,deviceStatus:n.CONNECTED,installedApps:[],currentApp:{name:"TestApp",version:"1.0.0"},deviceModelId:e,isSecureConnectionAllowed:!1}}function s(e){return{resolve:()=>e}}const o={version:"1.0.0"};it("should pass check when resolved as compatible",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new c(i(),o,e).check();expect(t).toStrictEqual(!0)}),it("should reject check when resolved as incompatible",()=>{const e=s({isCompatible:!1,version:"0.0.1"}),t=new c(i(),o,e).check();expect(t).toStrictEqual(!1)}),it("should pass with min version inclusive when version matches",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new c(i(),o,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!0)}),it("should reject with min version inclusive when version is too low",()=>{const e=s({isCompatible:!0,version:"1.11.0"}),t=new c(i(),o,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!1)}),it("should pass with min version exclusive when version is greater",()=>{const e=s({isCompatible:!0,version:"1.13.0"}),t=new c(i(),o,e).withMinVersionExclusive("1.12.0").check();expect(t).toStrictEqual(!0)}),it("should reject with min version exclusive when version is equal",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new c(i(),o,e).withMinVersionExclusive("1.12.0").check();expect(t).toStrictEqual(!1)}),it("should pass when device model is not excluded",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new c(i(r.FLEX),o,e).excludeDeviceModel(r.NANO_S).check();expect(t).toStrictEqual(!0)}),it("should reject when device model is excluded",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new c(i(r.FLEX),o,e).excludeDeviceModel(r.FLEX).check();expect(t).toStrictEqual(!1)}),it("should pass with chained conditions when all are met",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new c(i(),o,e).withMinVersionInclusive("1.11.0").excludeDeviceModel(r.NANO_S).check();expect(t).toStrictEqual(!0)}),it("should reject with chained conditions when one fails",()=>{const e=s({isCompatible:!0,version:"1.10.0"}),t=new c(i(),o,e).withMinVersionInclusive("1.11.0").excludeDeviceModel(r.NANO_S).check();expect(t).toStrictEqual(!1)}),it("should not override incompatible resolution even if constraints pass",()=>{const e=s({isCompatible:!1,version:"1.15.0"}),t=new c(i(),o,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!1)})});
|
|
2
|
+
//# sourceMappingURL=ApplicationChecker.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/api/utils/ApplicationChecker.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\n\nimport { ApplicationChecker } from \"./ApplicationChecker\";\nimport {\n type ApplicationResolver,\n type ResolvedApp,\n} from \"./ApplicationResolver\";\n\ndescribe(\"ApplicationChecker\", () => {\n function createReadyState(modelId: DeviceModelId = DeviceModelId.FLEX) {\n return {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"TestApp\", version: \"1.0.0\" },\n deviceModelId: modelId,\n isSecureConnectionAllowed: false,\n };\n }\n\n function createMockResolver(resolved: ResolvedApp): ApplicationResolver {\n return {\n resolve: () => resolved,\n };\n }\n\n const appConfig = { version: \"1.0.0\" };\n\n it(\"should pass check when resolved as compatible\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n ).check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject check when resolved as incompatible\", () => {\n const resolver = createMockResolver({\n isCompatible: false,\n version: \"0.0.1\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n ).check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with min version inclusive when version matches\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with min version inclusive when version is too low\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.11.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with min version exclusive when version is greater\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.13.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with min version exclusive when version is equal\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass when device model is not excluded\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(DeviceModelId.FLEX),\n appConfig,\n resolver,\n )\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject when device model is excluded\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(DeviceModelId.FLEX),\n appConfig,\n resolver,\n )\n .excludeDeviceModel(DeviceModelId.FLEX)\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with chained conditions when all are met\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with chained conditions when one fails\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.10.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should not override incompatible resolution even if constraints pass\", () => {\n const resolver = createMockResolver({\n isCompatible: false,\n version: \"1.15.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,iBAAAA,MAAqB,0BAC9B,OAAS,gBAAAC,MAAoB,2BAC7B,OAAS,0BAAAC,MAA8B,yCAEvC,OAAS,sBAAAC,MAA0B,uBAMnC,SAAS,qBAAsB,IAAM,CACnC,SAASC,EAAiBC,EAAyBL,EAAc,KAAM,CACrE,MAAO,CACL,iBAAkBE,EAAuB,0BACzC,aAAcD,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,OAAQ,EAChD,cAAeI,EACf,0BAA2B,EAC7B,CACF,CAEA,SAASC,EAAmBC,EAA4C,CACtE,MAAO,CACL,QAAS,IAAMA,CACjB,CACF,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EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["DeviceModelId", "DeviceStatus", "DeviceSessionStateType", "ApplicationChecker", "createReadyState", "modelId", "createMockResolver", "resolved", "appConfig", "resolver", "result"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=ApplicationResolver.js.map
|
|
@@ -67,6 +67,8 @@ export { TransportConnectedDevice } from "./transport/model/TransportConnectedDe
|
|
|
67
67
|
export { connectedDeviceStubBuilder } from "./transport/model/TransportConnectedDevice.stub";
|
|
68
68
|
export * from "./types";
|
|
69
69
|
export { formatApduReceivedLog, formatApduSentLog } from "./utils/apduLogs";
|
|
70
|
+
export { ApplicationChecker } from "./utils/ApplicationChecker";
|
|
71
|
+
export { type AppConfig, type ApplicationResolver, type ResolvedApp, } from "./utils/ApplicationResolver";
|
|
70
72
|
export { base64StringToBuffer, bufferToBase64String, isBase64String, } from "./utils/Base64String";
|
|
71
73
|
export { bufferToHexaString, hexaStringToBuffer, isHexaString, } from "./utils/HexaString";
|
|
72
74
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,uCAAuC,EACvC,sBAAsB,GACvB,MAAM,qBAA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AAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,UAAU,EACV,iBAAiB,GAClB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAC/F,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EACL,4BAA4B,EAC5B,KAAK,kCAAkC,GACxC,MAAM,mDAAmD,CAAC;AAC3D,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,oDAAoD,CAAC;AAChG,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EACL,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,GACb,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type DeviceModelId } from "../device/DeviceModel";
|
|
2
|
+
import { type DeviceSessionState } from "../device-session/DeviceSessionState";
|
|
3
|
+
import { type AppConfig, type ApplicationResolver } from "./ApplicationResolver";
|
|
4
|
+
export declare class ApplicationChecker {
|
|
5
|
+
private isCompatible;
|
|
6
|
+
private version;
|
|
7
|
+
private modelId;
|
|
8
|
+
constructor(deviceState: DeviceSessionState, appConfig: AppConfig, resolver: ApplicationResolver);
|
|
9
|
+
withMinVersionInclusive(version: string): ApplicationChecker;
|
|
10
|
+
withMinVersionExclusive(version: string): ApplicationChecker;
|
|
11
|
+
excludeDeviceModel(modelId: DeviceModelId): ApplicationChecker;
|
|
12
|
+
check(): boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ApplicationChecker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApplicationChecker.d.ts","sourceRoot":"","sources":["../../../../../src/api/utils/ApplicationChecker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EACL,KAAK,SAAS,EACd,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAE/B,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAgB;gBAG7B,WAAW,EAAE,kBAAkB,EAC/B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,mBAAmB;IAQ/B,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAK5D,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAK5D,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,kBAAkB;IAK9D,KAAK,IAAI,OAAO;CAGjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApplicationChecker.test.d.ts","sourceRoot":"","sources":["../../../../../src/api/utils/ApplicationChecker.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DeviceSessionState } from "../device-session/DeviceSessionState";
|
|
2
|
+
export type AppConfig = Record<string, unknown> & {
|
|
3
|
+
readonly version: string;
|
|
4
|
+
};
|
|
5
|
+
export type ResolvedApp = {
|
|
6
|
+
readonly isCompatible: boolean;
|
|
7
|
+
readonly version: string;
|
|
8
|
+
};
|
|
9
|
+
export interface ApplicationResolver {
|
|
10
|
+
resolve(deviceState: DeviceSessionState, appConfig: AppConfig): ResolvedApp;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ApplicationResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApplicationResolver.d.ts","sourceRoot":"","sources":["../../../../../src/api/utils/ApplicationResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAChD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,WAAW,EAAE,kBAAkB,EAAE,SAAS,EAAE,SAAS,GAAG,WAAW,CAAC;CAC7E"}
|