@ledgerhq/device-management-kit 0.0.0-develop-20241231132707 → 0.0.0-develop-20250106155719

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.
@@ -8,11 +8,6 @@
8
8
  "types": "./lib/types/index.d.ts",
9
9
  "import": "./lib/esm/index.js",
10
10
  "require": "./lib/cjs/index.js"
11
- },
12
- "./*": {
13
- "types": "./lib/types/*",
14
- "import": "./lib/esm/*",
15
- "require": "./lib/cjs/*"
16
11
  }
17
12
  },
18
13
  "files": [
@@ -1,2 +1,2 @@
1
- "use strict";var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var t=(e,r)=>{for(var n in r)s(e,n,{get:r[n],enumerable:!0})},d=(e,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of c(r))!g.call(e,o)&&o!==n&&s(e,o,{get:()=>r[o],enumerable:!(i=a(r,o))||i.enumerable});return e};var E=e=>d(s({},"__esModule",{value:!0}),e);var h={};t(h,{DeviceExchangeError:()=>p,UnknownDeviceExchangeError:()=>l});module.exports=E(h);class p{_tag;originalError;errorCode;message;constructor({tag:r,errorCode:n,originalError:i,message:o}){this._tag=r,this.originalError=i,this.errorCode=n,this.message=o??"An error occured during device exchange."}}class l{_tag="UnknownDeviceExchangeError";originalError;message;constructor(r){this.originalError=r,this.message="Unexpected device exchange error happened."}}0&&(module.exports={DeviceExchangeError,UnknownDeviceExchangeError});
1
+ "use strict";var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var t=Object.prototype.hasOwnProperty;var g=(e,r)=>{for(var n in r)s(e,n,{get:r[n],enumerable:!0})},E=(e,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of c(r))!t.call(e,o)&&o!==n&&s(e,o,{get:()=>r[o],enumerable:!(i=a(r,o))||i.enumerable});return e};var d=e=>E(s({},"__esModule",{value:!0}),e);var m={};g(m,{DeviceBusyError:()=>h,DeviceExchangeError:()=>l,UnknownDeviceExchangeError:()=>p});module.exports=d(m);class l{_tag;originalError;errorCode;message;constructor({tag:r,errorCode:n,originalError:i,message:o}){this._tag=r,this.originalError=i,this.errorCode=n,this.message=o??"An error occured during device exchange."}}class p{_tag="UnknownDeviceExchangeError";originalError;message;constructor(r){this.originalError=r,this.message="Unexpected device exchange error happened."}}class h{_tag="DeviceBusyError";originalError;constructor(r){this.originalError=r??new Error("Device is busy, please try again later")}}0&&(module.exports={DeviceBusyError,DeviceExchangeError,UnknownDeviceExchangeError});
2
2
  //# sourceMappingURL=Error.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/Error.ts"],
4
- "sourcesContent": ["export interface DmkError {\n readonly _tag: string;\n readonly originalError?: unknown;\n message?: string;\n}\n\nexport type DeviceExchangeErrorArgs<SpecificErrorCodes> = {\n tag: string;\n originalError?: unknown;\n errorCode: SpecificErrorCodes;\n message: string;\n};\n\nexport type CommandErrorArgs<SpecificErrorCodes> = Omit<\n DeviceExchangeErrorArgs<SpecificErrorCodes>,\n \"tag\"\n>;\n\nexport abstract class DeviceExchangeError<SpecificErrorCodes = void> {\n readonly _tag: string;\n readonly originalError?: unknown;\n readonly errorCode: SpecificErrorCodes;\n readonly message: string;\n\n protected constructor({\n tag,\n errorCode,\n originalError,\n message,\n }: DeviceExchangeErrorArgs<SpecificErrorCodes>) {\n this._tag = tag;\n this.originalError = originalError;\n this.errorCode = errorCode;\n this.message = message ?? \"An error occured during device exchange.\";\n }\n}\n\nexport class UnknownDeviceExchangeError implements DmkError {\n readonly _tag = \"UnknownDeviceExchangeError\";\n readonly originalError?: unknown;\n readonly message: string;\n\n constructor(originalError?: unknown) {\n this.originalError = originalError;\n this.message = \"Unexpected device exchange error happened.\";\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,+BAAAC,IAAA,eAAAC,EAAAJ,GAkBO,MAAeE,CAA+C,CAC1D,KACA,cACA,UACA,QAEC,YAAY,CACpB,IAAAG,EACA,UAAAC,EACA,cAAAC,EACA,QAAAC,CACF,EAAgD,CAC9C,KAAK,KAAOH,EACZ,KAAK,cAAgBE,EACrB,KAAK,UAAYD,EACjB,KAAK,QAAUE,GAAW,0CAC5B,CACF,CAEO,MAAML,CAA+C,CACjD,KAAO,6BACP,cACA,QAET,YAAYI,EAAyB,CACnC,KAAK,cAAgBA,EACrB,KAAK,QAAU,4CACjB,CACF",
6
- "names": ["Error_exports", "__export", "DeviceExchangeError", "UnknownDeviceExchangeError", "__toCommonJS", "tag", "errorCode", "originalError", "message"]
4
+ "sourcesContent": ["export interface DmkError {\n readonly _tag: string;\n readonly originalError?: unknown;\n message?: string;\n}\n\nexport type DeviceExchangeErrorArgs<SpecificErrorCodes> = {\n tag: string;\n originalError?: unknown;\n errorCode: SpecificErrorCodes;\n message: string;\n};\n\nexport type CommandErrorArgs<SpecificErrorCodes> = Omit<\n DeviceExchangeErrorArgs<SpecificErrorCodes>,\n \"tag\"\n>;\n\nexport abstract class DeviceExchangeError<SpecificErrorCodes = void> {\n readonly _tag: string;\n readonly originalError?: unknown;\n readonly errorCode: SpecificErrorCodes;\n readonly message: string;\n\n protected constructor({\n tag,\n errorCode,\n originalError,\n message,\n }: DeviceExchangeErrorArgs<SpecificErrorCodes>) {\n this._tag = tag;\n this.originalError = originalError;\n this.errorCode = errorCode;\n this.message = message ?? \"An error occured during device exchange.\";\n }\n}\n\nexport class UnknownDeviceExchangeError implements DmkError {\n readonly _tag = \"UnknownDeviceExchangeError\";\n readonly originalError?: unknown;\n readonly message: string;\n\n constructor(originalError?: unknown) {\n this.originalError = originalError;\n this.message = \"Unexpected device exchange error happened.\";\n }\n}\n\nexport class DeviceBusyError implements DmkError {\n readonly _tag = \"DeviceBusyError\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError =\n originalError ?? new Error(\"Device is busy, please try again later\");\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,EAAA,wBAAAC,EAAA,+BAAAC,IAAA,eAAAC,EAAAL,GAkBO,MAAeG,CAA+C,CAC1D,KACA,cACA,UACA,QAEC,YAAY,CACpB,IAAAG,EACA,UAAAC,EACA,cAAAC,EACA,QAAAC,CACF,EAAgD,CAC9C,KAAK,KAAOH,EACZ,KAAK,cAAgBE,EACrB,KAAK,UAAYD,EACjB,KAAK,QAAUE,GAAW,0CAC5B,CACF,CAEO,MAAML,CAA+C,CACjD,KAAO,6BACP,cACA,QAET,YAAYI,EAAyB,CACnC,KAAK,cAAgBA,EACrB,KAAK,QAAU,4CACjB,CACF,CAEO,MAAMN,CAAoC,CACtC,KAAO,kBAChB,cAEA,YAAYM,EAAuB,CACjC,KAAK,cACHA,GAAiB,IAAI,MAAM,wCAAwC,CACvE,CACF",
6
+ "names": ["Error_exports", "__export", "DeviceBusyError", "DeviceExchangeError", "UnknownDeviceExchangeError", "__toCommonJS", "tag", "errorCode", "originalError", "message"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var u=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var me=(t,o)=>{for(var p in o)u(t,p,{get:o[p],enumerable:!0})},A=(t,o,p,D)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of te(o))!pe.call(t,s)&&s!==p&&u(t,s,{get:()=>o[s],enumerable:!(D=oe(o,s))||D.enumerable});return t},r=(t,o,p)=>(A(t,o,"default"),p&&A(p,o,"default"));var ie=t=>A(u({},"__esModule",{value:!0}),t);var e={};me(e,{APDU_MAX_PAYLOAD:()=>a.APDU_MAX_PAYLOAD,Apdu:()=>v.Apdu,ApduBuilder:()=>a.ApduBuilder,ApduParser:()=>S.ApduParser,ApduResponse:()=>K.ApduResponse,BatteryStatusType:()=>f.BatteryStatusType,BleDeviceInfos:()=>w.BleDeviceInfos,ByteArrayBuilder:()=>l.ByteArrayBuilder,ByteArrayParser:()=>y.ByteArrayParser,CloseAppCommand:()=>g.CloseAppCommand,CommandResultFactory:()=>m.CommandResultFactory,CommandResultStatus:()=>m.CommandResultStatus,CommandUtils:()=>b.CommandUtils,ConnectedDevice:()=>$.ConnectedDevice,ConsoleLogger:()=>Q.ConsoleLogger,DeviceActionStatus:()=>T.DeviceActionStatus,DeviceExchangeError:()=>c.DeviceExchangeError,DeviceManagementKit:()=>j.DeviceManagementKit,DeviceManagementKitBuilder:()=>z.DeviceManagementKitBuilder,DeviceModel:()=>i.DeviceModel,DeviceModelId:()=>i.DeviceModelId,DeviceSessionStateType:()=>X.DeviceSessionStateType,DeviceStatus:()=>M.DeviceStatus,FramerUtils:()=>Y.FramerUtils,GetAppAndVersionCommand:()=>B.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>f.GetBatteryStatusCommand,GetDeviceStatusDeviceAction:()=>h.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>E.GetOsVersionCommand,GlobalCommandError:()=>x.GlobalCommandError,GlobalCommandErrorHandler:()=>x.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>U.GoToDashboardDeviceAction,InvalidStatusWordError:()=>C.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>i.LEDGER_VENDOR_ID,ListAppsCommand:()=>L.ListAppsCommand,ListAppsDeviceAction:()=>V.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>P.ListAppsWithMetadataDeviceAction,LogLevel:()=>J.LogLevel,OpenAppCommand:()=>G.OpenAppCommand,OpenAppDeviceAction:()=>_.OpenAppDeviceAction,SendCommandInAppDeviceAction:()=>H.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>k.StaticDeviceModelDataSource,TransportConnectedDevice:()=>ee.TransportConnectedDevice,TransportDeviceModel:()=>F.TransportDeviceModel,UnknownDAError:()=>O.UnknownDAError,UnknownDeviceExchangeError:()=>c.UnknownDeviceExchangeError,UserInteractionRequired:()=>I.UserInteractionRequired,WebLogsExporterLogger:()=>Z.WebLogsExporterLogger,XStateDeviceAction:()=>W.XStateDeviceAction,base64StringToBuffer:()=>d.base64StringToBuffer,bufferToHexaString:()=>n.bufferToHexaString,connectedDeviceStubBuilder:()=>re.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>q.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>N.defaultApduSenderServiceStubBuilder,hexaStringToBuffer:()=>n.hexaStringToBuffer,isBase64String:()=>d.isBase64String,isCommandErrorCode:()=>R.isCommandErrorCode,isHexaString:()=>n.isHexaString,isSuccessCommandResult:()=>m.isSuccessCommandResult});module.exports=ie(e);var v=require("./apdu/model/Apdu"),a=require("./apdu/utils/ApduBuilder"),S=require("./apdu/utils/ApduParser");r(e,require("./apdu/utils/AppBuilderError"),module.exports);var l=require("./apdu/utils/ByteArrayBuilder"),y=require("./apdu/utils/ByteArrayParser"),C=require("./command/Errors"),m=require("./command/model/CommandResult"),g=require("./command/os/CloseAppCommand"),B=require("./command/os/GetAppAndVersionCommand"),f=require("./command/os/GetBatteryStatusCommand"),E=require("./command/os/GetOsVersionCommand"),L=require("./command/os/ListAppsCommand"),G=require("./command/os/OpenAppCommand"),R=require("./command/utils/CommandErrors"),b=require("./command/utils/CommandUtils"),x=require("./command/utils/GlobalCommandError"),i=require("./device/DeviceModel"),M=require("./device/DeviceStatus"),T=require("./device-action/model/DeviceActionState"),I=require("./device-action/model/UserInteractionRequired"),O=require("./device-action/os/Errors"),h=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),U=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),V=require("./device-action/os/ListApps/ListAppsDeviceAction"),P=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),_=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),H=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),W=require("./device-action/xstate-utils/XStateDeviceAction"),k=require("./device-model/data/StaticDeviceModelDataSource"),w=require("./device-model/model/BleDeviceInfos"),F=require("./device-model/model/DeviceModel"),K=require("./device-session/ApduResponse");r(e,require("./device-session/data/FramerConst"),module.exports);var X=require("./device-session/DeviceSessionState"),q=require("./device-session/service/DefaultApduReceiverService.stub"),N=require("./device-session/service/DefaultApduSenderService.stub"),Y=require("./device-session/utils/FramerUtils"),j=require("./DeviceManagementKit"),z=require("./DeviceManagementKitBuilder"),c=require("./Error"),J=require("./logger-subscriber/model/LogLevel"),Q=require("./logger-subscriber/service/ConsoleLogger"),Z=require("./logger-subscriber/service/WebLogsExporterLogger"),$=require("./transport/model/ConnectedDevice");r(e,require("./transport/model/Errors"),module.exports);var ee=require("./transport/model/TransportConnectedDevice"),re=require("./transport/model/TransportConnectedDevice.stub");r(e,require("./types"),module.exports);var d=require("./utils/Base64String"),n=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DeviceActionStatus,DeviceExchangeError,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,LogLevel,OpenAppCommand,OpenAppDeviceAction,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UnknownDAError,UnknownDeviceExchangeError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./transport/model/Errors"),...require("./types")});
1
+ "use strict";var A=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var pe=(t,o)=>{for(var p in o)A(t,p,{get:o[p],enumerable:!0})},d=(t,o,p,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of oe(o))!te.call(t,s)&&s!==p&&A(t,s,{get:()=>o[s],enumerable:!(u=re(o,s))||u.enumerable});return t},r=(t,o,p)=>(d(t,o,"default"),p&&d(p,o,"default"));var me=t=>d(A({},"__esModule",{value:!0}),t);var e={};pe(e,{APDU_MAX_PAYLOAD:()=>a.APDU_MAX_PAYLOAD,Apdu:()=>D.Apdu,ApduBuilder:()=>a.ApduBuilder,ApduParser:()=>S.ApduParser,ApduResponse:()=>X.ApduResponse,BatteryStatusType:()=>f.BatteryStatusType,BleDeviceInfos:()=>F.BleDeviceInfos,ByteArrayBuilder:()=>v.ByteArrayBuilder,ByteArrayParser:()=>l.ByteArrayParser,CloseAppCommand:()=>C.CloseAppCommand,CommandResultFactory:()=>m.CommandResultFactory,CommandResultStatus:()=>m.CommandResultStatus,CommandUtils:()=>E.CommandUtils,ConnectedDevice:()=>Z.ConnectedDevice,ConsoleLogger:()=>J.ConsoleLogger,DeviceActionStatus:()=>M.DeviceActionStatus,DeviceManagementKit:()=>Y.DeviceManagementKit,DeviceManagementKitBuilder:()=>j.DeviceManagementKitBuilder,DeviceModel:()=>i.DeviceModel,DeviceModelId:()=>i.DeviceModelId,DeviceSessionStateType:()=>k.DeviceSessionStateType,DeviceStatus:()=>b.DeviceStatus,FramerUtils:()=>N.FramerUtils,GetAppAndVersionCommand:()=>g.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>f.GetBatteryStatusCommand,GetDeviceStatusDeviceAction:()=>O.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>B.GetOsVersionCommand,GlobalCommandError:()=>x.GlobalCommandError,GlobalCommandErrorHandler:()=>x.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>U.GoToDashboardDeviceAction,InvalidStatusWordError:()=>y.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>i.LEDGER_VENDOR_ID,ListAppsCommand:()=>L.ListAppsCommand,ListAppsDeviceAction:()=>V.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>h.ListAppsWithMetadataDeviceAction,LogLevel:()=>z.LogLevel,OpenAppCommand:()=>G.OpenAppCommand,OpenAppDeviceAction:()=>P.OpenAppDeviceAction,SendCommandInAppDeviceAction:()=>_.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>W.StaticDeviceModelDataSource,TransportConnectedDevice:()=>$.TransportConnectedDevice,TransportDeviceModel:()=>K.TransportDeviceModel,UnknownDAError:()=>I.UnknownDAError,UserInteractionRequired:()=>T.UserInteractionRequired,WebLogsExporterLogger:()=>Q.WebLogsExporterLogger,XStateDeviceAction:()=>H.XStateDeviceAction,base64StringToBuffer:()=>c.base64StringToBuffer,bufferToHexaString:()=>n.bufferToHexaString,connectedDeviceStubBuilder:()=>ee.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>q.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>w.defaultApduSenderServiceStubBuilder,hexaStringToBuffer:()=>n.hexaStringToBuffer,isBase64String:()=>c.isBase64String,isCommandErrorCode:()=>R.isCommandErrorCode,isHexaString:()=>n.isHexaString,isSuccessCommandResult:()=>m.isSuccessCommandResult});module.exports=me(e);var D=require("./apdu/model/Apdu"),a=require("./apdu/utils/ApduBuilder"),S=require("./apdu/utils/ApduParser");r(e,require("./apdu/utils/AppBuilderError"),module.exports);var v=require("./apdu/utils/ByteArrayBuilder"),l=require("./apdu/utils/ByteArrayParser"),y=require("./command/Errors"),m=require("./command/model/CommandResult"),C=require("./command/os/CloseAppCommand"),g=require("./command/os/GetAppAndVersionCommand"),f=require("./command/os/GetBatteryStatusCommand"),B=require("./command/os/GetOsVersionCommand"),L=require("./command/os/ListAppsCommand"),G=require("./command/os/OpenAppCommand"),R=require("./command/utils/CommandErrors"),E=require("./command/utils/CommandUtils"),x=require("./command/utils/GlobalCommandError"),i=require("./device/DeviceModel"),b=require("./device/DeviceStatus"),M=require("./device-action/model/DeviceActionState"),T=require("./device-action/model/UserInteractionRequired"),I=require("./device-action/os/Errors"),O=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),U=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),V=require("./device-action/os/ListApps/ListAppsDeviceAction"),h=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),P=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),_=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),H=require("./device-action/xstate-utils/XStateDeviceAction"),W=require("./device-model/data/StaticDeviceModelDataSource"),F=require("./device-model/model/BleDeviceInfos"),K=require("./device-model/model/DeviceModel"),X=require("./device-session/ApduResponse");r(e,require("./device-session/data/FramerConst"),module.exports);var k=require("./device-session/DeviceSessionState"),q=require("./device-session/service/DefaultApduReceiverService.stub"),w=require("./device-session/service/DefaultApduSenderService.stub"),N=require("./device-session/utils/FramerUtils"),Y=require("./DeviceManagementKit"),j=require("./DeviceManagementKitBuilder");r(e,require("./Error"),module.exports);var z=require("./logger-subscriber/model/LogLevel"),J=require("./logger-subscriber/service/ConsoleLogger"),Q=require("./logger-subscriber/service/WebLogsExporterLogger"),Z=require("./transport/model/ConnectedDevice");r(e,require("./transport/model/Errors"),module.exports);var $=require("./transport/model/TransportConnectedDevice"),ee=require("./transport/model/TransportConnectedDevice.stub");r(e,require("./types"),module.exports);var c=require("./utils/Base64String"),n=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DeviceActionStatus,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,LogLevel,OpenAppCommand,OpenAppDeviceAction,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UnknownDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/index.ts"],
4
- "sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { UnknownDAError } from \"@api/device-action/os/Errors\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\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 { 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\";\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 { DeviceExchangeError, UnknownDeviceExchangeError } from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
- "mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,kmFAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAChCC,EAAuC,+BACvCC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAGO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCd,EAA+B,wCAC/Be,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/BZ,EAAqC,+CACrCa,EAA6B,4CAC7B3B,EAAAN,EAAc,gDAxEd,gBAyEA,IAAAkC,EAGO,kDAEPC,EAAsD,uEACtDC,EAAoD,qEACpDC,EAA4B,iDAC5BC,EAAoC,oCACpCC,EAA2C,2CAC3CC,EAAgE,sBAChEC,EAAyB,iDACzBC,EAA8B,wDAC9BC,EAAsC,gEACtCC,EAAgC,gDAChCtC,EAAAN,EAAc,uCAxFd,gBAyFA,IAAA6C,GAAyC,yDACzCA,GAA2C,8DAC3CvC,EAAAN,EAAc,sBA3Fd,gBA4FA,IAAA8C,EAAqD,mCACrDC,EAIO",
6
- "names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_Error", "import_LogLevel", "import_ConsoleLogger", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_TransportConnectedDevice", "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 { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { UnknownDAError } from \"@api/device-action/os/Errors\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\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 { 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\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
+ "mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,u/EAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAChCC,EAAuC,+BACvCC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAGO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCd,EAA+B,wCAC/Be,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/BZ,EAAqC,+CACrCa,EAA6B,4CAC7B3B,EAAAN,EAAc,gDAxEd,gBAyEA,IAAAkC,EAGO,kDAEPC,EAAsD,uEACtDC,EAAoD,qEACpDC,EAA4B,iDAC5BC,EAAoC,oCACpCC,EAA2C,2CAC3CjC,EAAAN,EAAc,sBAnFd,gBAoFA,IAAAwC,EAAyB,iDACzBC,EAA8B,wDAC9BC,EAAsC,gEACtCC,EAAgC,gDAChCrC,EAAAN,EAAc,uCAxFd,gBAyFA,IAAA4C,EAAyC,yDACzCA,GAA2C,8DAC3CtC,EAAAN,EAAc,sBA3Fd,gBA4FA,IAAA6C,EAAqD,mCACrDC,EAIO",
6
+ "names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_LogLevel", "import_ConsoleLogger", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_TransportConnectedDevice", "import_Base64String", "import_HexaString"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var A=(r,e)=>{for(var s in e)a(r,s,{get:e[s],enumerable:!0})},_=(r,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of g(e))!f.call(r,t)&&t!==s&&a(r,t,{get:()=>e[t],enumerable:!(o=l(e,t))||o.enumerable});return r};var E=r=>_(a({},"__esModule",{value:!0}),r);var y={};A(y,{DeviceSession:()=>C});module.exports=E(y);var c=require("purify-ts"),p=require("rxjs"),d=require("uuid"),v=require("../../../api/command/utils/CommandUtils"),i=require("../../../api/device/DeviceStatus"),u=require("../../../api/device-session/DeviceSessionState"),S=require("../../device-session/data/DeviceSessionRefresherConst"),m=require("./DeviceSessionRefresher"),D=require("./Errors");class C{_id;_connectedDevice;_deviceState;_refresher;_managerApiService;constructor({connectedDevice:e,id:s=(0,d.v4)()},o,t){this._id=s,this._connectedDevice=e,this._deviceState=new p.BehaviorSubject({sessionStateType:u.DeviceSessionStateType.Connected,deviceStatus:i.DeviceStatus.CONNECTED}),this._refresher=new m.DeviceSessionRefresher({refreshInterval:S.DEVICE_SESSION_REFRESH_INTERVAL,deviceStatus:i.DeviceStatus.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id,sendApduFn:n=>this.sendApdu(n,{isPolling:!0,triggersDisconnection:!1}),updateStateFn:n=>{const h=this._deviceState.getValue();this.setDeviceSessionState(n(h))}},o("device-session-refresher")),this._managerApiService=t}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}setDeviceSessionState(e){this._deviceState.next(e)}updateDeviceStatus(e){const s=this._deviceState.getValue();this._refresher.setDeviceStatus(e),this._deviceState.next({...s,deviceStatus:e})}async sendApdu(e,s={isPolling:!1,triggersDisconnection:!1}){return this._deviceState.getValue().deviceStatus===i.DeviceStatus.BUSY?(0,c.Left)(new D.DeviceBusyError):(s.isPolling||this.updateDeviceStatus(i.DeviceStatus.BUSY),(await this._connectedDevice.sendApdu(e,s.triggersDisconnection)).ifRight(n=>{v.CommandUtils.isLockedDeviceResponse(n)?this.updateDeviceStatus(i.DeviceStatus.LOCKED):this.updateDeviceStatus(i.DeviceStatus.CONNECTED)}).ifLeft(()=>{this.updateDeviceStatus(i.DeviceStatus.CONNECTED)}))}async sendCommand(e){const s=e.getApdu();return(await this.sendApdu(s.getRawApdu(),{isPolling:!1,triggersDisconnection:e.triggersDisconnection??!1})).caseOf({Left:t=>{throw t},Right:t=>e.parseResponse(t,this._connectedDevice.deviceModel.id)})}executeDeviceAction(e){const{observable:s,cancel:o}=e._execute({sendCommand:async t=>this.sendCommand(t),getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:t=>(this.setDeviceSessionState(t),this._deviceState.getValue()),getMetadataForAppHashes:t=>this._managerApiService.getAppsByHash(t)});return{observable:s,cancel:o}}close(){this.updateDeviceStatus(i.DeviceStatus.NOT_CONNECTED),this._deviceState.complete(),this._refresher.stop()}toggleRefresher(e){e?this._refresher.start():this._refresher.stop()}}0&&(module.exports={DeviceSession});
1
+ "use strict";var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var A=(r,e)=>{for(var s in e)a(r,s,{get:e[s],enumerable:!0})},_=(r,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of g(e))!f.call(r,t)&&t!==s&&a(r,t,{get:()=>e[t],enumerable:!(o=l(e,t))||o.enumerable});return r};var E=r=>_(a({},"__esModule",{value:!0}),r);var y={};A(y,{DeviceSession:()=>C});module.exports=E(y);var c=require("purify-ts"),p=require("rxjs"),d=require("uuid"),v=require("../../../api/command/utils/CommandUtils"),i=require("../../../api/device/DeviceStatus"),u=require("../../../api/device-session/DeviceSessionState"),S=require("../../../api/Error"),m=require("../../device-session/data/DeviceSessionRefresherConst"),D=require("./DeviceSessionRefresher");class C{_id;_connectedDevice;_deviceState;_refresher;_managerApiService;constructor({connectedDevice:e,id:s=(0,d.v4)()},o,t){this._id=s,this._connectedDevice=e,this._deviceState=new p.BehaviorSubject({sessionStateType:u.DeviceSessionStateType.Connected,deviceStatus:i.DeviceStatus.CONNECTED}),this._refresher=new D.DeviceSessionRefresher({refreshInterval:m.DEVICE_SESSION_REFRESH_INTERVAL,deviceStatus:i.DeviceStatus.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id,sendApduFn:n=>this.sendApdu(n,{isPolling:!0,triggersDisconnection:!1}),updateStateFn:n=>{const h=this._deviceState.getValue();this.setDeviceSessionState(n(h))}},o("device-session-refresher")),this._managerApiService=t}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}setDeviceSessionState(e){this._deviceState.next(e)}updateDeviceStatus(e){const s=this._deviceState.getValue();this._refresher.setDeviceStatus(e),this._deviceState.next({...s,deviceStatus:e})}async sendApdu(e,s={isPolling:!1,triggersDisconnection:!1}){return this._deviceState.getValue().deviceStatus===i.DeviceStatus.BUSY?(0,c.Left)(new S.DeviceBusyError):(s.isPolling||this.updateDeviceStatus(i.DeviceStatus.BUSY),(await this._connectedDevice.sendApdu(e,s.triggersDisconnection)).ifRight(n=>{v.CommandUtils.isLockedDeviceResponse(n)?this.updateDeviceStatus(i.DeviceStatus.LOCKED):this.updateDeviceStatus(i.DeviceStatus.CONNECTED)}).ifLeft(()=>{this.updateDeviceStatus(i.DeviceStatus.CONNECTED)}))}async sendCommand(e){const s=e.getApdu();return(await this.sendApdu(s.getRawApdu(),{isPolling:!1,triggersDisconnection:e.triggersDisconnection??!1})).caseOf({Left:t=>{throw t},Right:t=>e.parseResponse(t,this._connectedDevice.deviceModel.id)})}executeDeviceAction(e){const{observable:s,cancel:o}=e._execute({sendCommand:async t=>this.sendCommand(t),getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:t=>(this.setDeviceSessionState(t),this._deviceState.getValue()),getMetadataForAppHashes:t=>this._managerApiService.getAppsByHash(t)});return{observable:s,cancel:o}}close(){this.updateDeviceStatus(i.DeviceStatus.NOT_CONNECTED),this._deviceState.complete(),this._refresher.stop()}toggleRefresher(e){e?this._refresher.start():this._refresher.stop()}}0&&(module.exports={DeviceSession});
2
2
  //# sourceMappingURL=DeviceSession.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-session/model/DeviceSession.ts"],
4
- "sourcesContent": ["import { type Either, Left } from \"purify-ts\";\nimport { BehaviorSubject } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { type ListAppsResponse } from \"@api/command/os/ListAppsCommand\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { type DmkError } from \"@api/Error\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESH_INTERVAL } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\nimport { DeviceBusyError } from \"./Errors\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _refresher: DeviceSessionRefresher;\n private readonly _managerApiService: ManagerApiService;\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n });\n this._refresher = new DeviceSessionRefresher(\n {\n refreshInterval: DEVICE_SESSION_REFRESH_INTERVAL,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n sendApduFn: (rawApdu: Uint8Array) =>\n this.sendApdu(rawApdu, {\n isPolling: true,\n triggersDisconnection: false,\n }),\n updateStateFn: (callback) => {\n const state = this._deviceState.getValue();\n this.setDeviceSessionState(callback(state));\n },\n },\n loggerModuleFactory(\"device-session-refresher\"),\n );\n this._managerApiService = managerApiService;\n }\n\n public get id() {\n return this._id;\n }\n\n public get connectedDevice() {\n return this._connectedDevice;\n }\n\n public get state() {\n return this._deviceState.asObservable();\n }\n\n public setDeviceSessionState(state: DeviceSessionState) {\n this._deviceState.next(state);\n }\n\n private updateDeviceStatus(deviceStatus: DeviceStatus) {\n const sessionState = this._deviceState.getValue();\n this._refresher.setDeviceStatus(deviceStatus);\n this._deviceState.next({\n ...sessionState,\n deviceStatus,\n });\n }\n\n async sendApdu(\n rawApdu: Uint8Array,\n options: {\n isPolling: boolean;\n triggersDisconnection: boolean;\n } = {\n isPolling: false,\n triggersDisconnection: false,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n const sessionState = this._deviceState.getValue();\n if (sessionState.deviceStatus === DeviceStatus.BUSY) {\n return Left(new DeviceBusyError());\n }\n\n if (!options.isPolling) this.updateDeviceStatus(DeviceStatus.BUSY);\n\n const errorOrResponse = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n );\n\n return errorOrResponse\n .ifRight((response: ApduResponse) => {\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this.updateDeviceStatus(DeviceStatus.LOCKED);\n } else {\n this.updateDeviceStatus(DeviceStatus.CONNECTED);\n }\n })\n .ifLeft(() => {\n this.updateDeviceStatus(DeviceStatus.CONNECTED);\n });\n }\n\n async sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n const apdu = command.getApdu();\n const response = await this.sendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n });\n\n return response.caseOf({\n Left: (err) => {\n throw err;\n },\n Right: (r) =>\n command.parseResponse(r, this._connectedDevice.deviceModel.id),\n });\n }\n\n executeDeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, Error, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n ) => this.sendCommand(command),\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n getMetadataForAppHashes: (apps: ListAppsResponse) =>\n this._managerApiService.getAppsByHash(apps),\n });\n\n return {\n observable,\n cancel,\n };\n }\n\n close() {\n this.updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._refresher.stop();\n }\n\n toggleRefresher(enabled: boolean) {\n if (enabled) {\n this._refresher.start();\n } else {\n this._refresher.stop();\n }\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,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Session_exports", "__export", "DeviceSession", "__toCommonJS", "import_purify_ts", "import_rxjs", "import_uuid", "import_CommandUtils", "import_DeviceStatus", "import_DeviceSessionState", "import_DeviceSessionRefresherConst", "import_DeviceSessionRefresher", "import_Errors", "connectedDevice", "id", "uuidv4", "loggerModuleFactory", "managerApiService", "rawApdu", "callback", "state", "deviceStatus", "sessionState", "options", "response", "command", "apdu", "err", "r", "deviceAction", "observable", "cancel", "apps", "enabled"]
4
+ "sourcesContent": ["import { type Either, Left } from \"purify-ts\";\nimport { BehaviorSubject } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { type ListAppsResponse } from \"@api/command/os/ListAppsCommand\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { DeviceBusyError, type DmkError } from \"@api/Error\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESH_INTERVAL } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _refresher: DeviceSessionRefresher;\n private readonly _managerApiService: ManagerApiService;\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n });\n this._refresher = new DeviceSessionRefresher(\n {\n refreshInterval: DEVICE_SESSION_REFRESH_INTERVAL,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n sendApduFn: (rawApdu: Uint8Array) =>\n this.sendApdu(rawApdu, {\n isPolling: true,\n triggersDisconnection: false,\n }),\n updateStateFn: (callback) => {\n const state = this._deviceState.getValue();\n this.setDeviceSessionState(callback(state));\n },\n },\n loggerModuleFactory(\"device-session-refresher\"),\n );\n this._managerApiService = managerApiService;\n }\n\n public get id() {\n return this._id;\n }\n\n public get connectedDevice() {\n return this._connectedDevice;\n }\n\n public get state() {\n return this._deviceState.asObservable();\n }\n\n public setDeviceSessionState(state: DeviceSessionState) {\n this._deviceState.next(state);\n }\n\n private updateDeviceStatus(deviceStatus: DeviceStatus) {\n const sessionState = this._deviceState.getValue();\n this._refresher.setDeviceStatus(deviceStatus);\n this._deviceState.next({\n ...sessionState,\n deviceStatus,\n });\n }\n\n async sendApdu(\n rawApdu: Uint8Array,\n options: {\n isPolling: boolean;\n triggersDisconnection: boolean;\n } = {\n isPolling: false,\n triggersDisconnection: false,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n const sessionState = this._deviceState.getValue();\n if (sessionState.deviceStatus === DeviceStatus.BUSY) {\n return Left(new DeviceBusyError());\n }\n\n if (!options.isPolling) this.updateDeviceStatus(DeviceStatus.BUSY);\n\n const errorOrResponse = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n );\n\n return errorOrResponse\n .ifRight((response: ApduResponse) => {\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this.updateDeviceStatus(DeviceStatus.LOCKED);\n } else {\n this.updateDeviceStatus(DeviceStatus.CONNECTED);\n }\n })\n .ifLeft(() => {\n this.updateDeviceStatus(DeviceStatus.CONNECTED);\n });\n }\n\n async sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n const apdu = command.getApdu();\n const response = await this.sendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n });\n\n return response.caseOf({\n Left: (err) => {\n throw err;\n },\n Right: (r) =>\n command.parseResponse(r, this._connectedDevice.deviceModel.id),\n });\n }\n\n executeDeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, Error, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n ) => this.sendCommand(command),\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n getMetadataForAppHashes: (apps: ListAppsResponse) =>\n this._managerApiService.getAppsByHash(apps),\n });\n\n return {\n observable,\n cancel,\n };\n }\n\n close() {\n this.updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._refresher.stop();\n }\n\n toggleRefresher(enabled: boolean) {\n if (enabled) {\n this._refresher.start();\n } else {\n this._refresher.stop();\n }\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA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toCommonJS", "import_purify_ts", "import_rxjs", "import_uuid", "import_CommandUtils", "import_DeviceStatus", "import_DeviceSessionState", "import_Error", "import_DeviceSessionRefresherConst", "import_DeviceSessionRefresher", "connectedDevice", "id", "uuidv4", "loggerModuleFactory", "managerApiService", "rawApdu", "callback", "state", "deviceStatus", "sessionState", "options", "response", "command", "apdu", "err", "r", "deviceAction", "observable", "cancel", "apps", "enabled"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var s=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var l=(o,r)=>{for(var i in r)s(o,i,{get:r[i],enumerable:!0})},c=(o,r,i,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of a(r))!E.call(o,e)&&e!==i&&s(o,e,{get:()=>r[e],enumerable:!(n=t(r,e))||n.enumerable});return o};var m=o=>c(s({},"__esModule",{value:!0}),o);var v={};l(v,{DeviceBusyError:()=>h,DeviceSessionNotFound:()=>d,DeviceSessionRefresherError:()=>D,FramerApduError:()=>p,FramerOverflowError:()=>g,ReceiverApduError:()=>u});module.exports=m(v);class g{_tag="FramerOverflowError";originalError;constructor(){this.originalError=new Error("Frame header length is greater than frame size")}}class p{_tag="FramerApduError";originalError;constructor(){this.originalError=new Error("Frame offset is greater than apdu length")}}class u{_tag="ReceiverApduError";originalError;constructor(r){this.originalError=new Error(r??"Unable to parse apdu")}}class d{_tag="DeviceSessionNotFound";originalError;constructor(r){this.originalError=r??new Error("Device session not found")}}class D{_tag="DeviceSessionRefresherError";originalError;constructor(r){this.originalError=r??new Error("Device session refresher error")}}class h{_tag="DeviceBusyError";originalError;constructor(r){this.originalError=r??new Error("Device is busy, please try again later")}}0&&(module.exports={DeviceBusyError,DeviceSessionNotFound,DeviceSessionRefresherError,FramerApduError,FramerOverflowError,ReceiverApduError});
1
+ "use strict";var s=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var l=(o,r)=>{for(var i in r)s(o,i,{get:r[i],enumerable:!0})},m=(o,r,i,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of a(r))!E.call(o,e)&&e!==i&&s(o,e,{get:()=>r[e],enumerable:!(n=t(r,e))||n.enumerable});return o};var c=o=>m(s({},"__esModule",{value:!0}),o);var D={};l(D,{DeviceSessionNotFound:()=>u,DeviceSessionRefresherError:()=>h,FramerApduError:()=>p,FramerOverflowError:()=>g,ReceiverApduError:()=>d});module.exports=c(D);class g{_tag="FramerOverflowError";originalError;constructor(){this.originalError=new Error("Frame header length is greater than frame size")}}class p{_tag="FramerApduError";originalError;constructor(){this.originalError=new Error("Frame offset is greater than apdu length")}}class d{_tag="ReceiverApduError";originalError;constructor(r){this.originalError=new Error(r??"Unable to parse apdu")}}class u{_tag="DeviceSessionNotFound";originalError;constructor(r){this.originalError=r??new Error("Device session not found")}}class h{_tag="DeviceSessionRefresherError";originalError;constructor(r){this.originalError=r??new Error("Device session refresher error")}}0&&(module.exports={DeviceSessionNotFound,DeviceSessionRefresherError,FramerApduError,FramerOverflowError,ReceiverApduError});
2
2
  //# sourceMappingURL=Errors.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-session/model/Errors.ts"],
4
- "sourcesContent": ["import { type DmkError } from \"@root/src/api/Error\";\n\nexport class FramerOverflowError implements DmkError {\n readonly _tag = \"FramerOverflowError\";\n originalError?: Error;\n constructor() {\n this.originalError = new Error(\n \"Frame header length is greater than frame size\",\n );\n }\n}\n\nexport class FramerApduError implements DmkError {\n readonly _tag = \"FramerApduError\";\n originalError?: Error;\n\n constructor() {\n this.originalError = new Error(\"Frame offset is greater than apdu length\");\n }\n}\n\nexport class ReceiverApduError implements DmkError {\n readonly _tag = \"ReceiverApduError\";\n originalError: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Unable to parse apdu\");\n }\n}\n\nexport class DeviceSessionNotFound implements DmkError {\n readonly _tag = \"DeviceSessionNotFound\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError = originalError ?? new Error(\"Device session not found\");\n }\n}\n\nexport class DeviceSessionRefresherError implements DmkError {\n readonly _tag = \"DeviceSessionRefresherError\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError =\n originalError ?? new Error(\"Device session refresher error\");\n }\n}\n\nexport class DeviceBusyError implements DmkError {\n readonly _tag = \"DeviceBusyError\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError =\n originalError ?? new Error(\"Device is busy, please try again later\");\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,EAAA,0BAAAC,EAAA,gCAAAC,EAAA,oBAAAC,EAAA,wBAAAC,EAAA,sBAAAC,IAAA,eAAAC,EAAAR,GAEO,MAAMM,CAAwC,CAC1C,KAAO,sBAChB,cACA,aAAc,CACZ,KAAK,cAAgB,IAAI,MACvB,gDACF,CACF,CACF,CAEO,MAAMD,CAAoC,CACtC,KAAO,kBAChB,cAEA,aAAc,CACZ,KAAK,cAAgB,IAAI,MAAM,0CAA0C,CAC3E,CACF,CAEO,MAAME,CAAsC,CACxC,KAAO,oBAChB,cAEA,YAAYE,EAAkB,CAC5B,KAAK,cAAgB,IAAI,MAAMA,GAAW,sBAAsB,CAClE,CACF,CAEO,MAAMN,CAA0C,CAC5C,KAAO,wBAChB,cAEA,YAAYO,EAAuB,CACjC,KAAK,cAAgBA,GAAiB,IAAI,MAAM,0BAA0B,CAC5E,CACF,CAEO,MAAMN,CAAgD,CAClD,KAAO,8BAChB,cAEA,YAAYM,EAAuB,CACjC,KAAK,cACHA,GAAiB,IAAI,MAAM,gCAAgC,CAC/D,CACF,CAEO,MAAMR,CAAoC,CACtC,KAAO,kBAChB,cAEA,YAAYQ,EAAuB,CACjC,KAAK,cACHA,GAAiB,IAAI,MAAM,wCAAwC,CACvE,CACF",
6
- "names": ["Errors_exports", "__export", "DeviceBusyError", "DeviceSessionNotFound", "DeviceSessionRefresherError", "FramerApduError", "FramerOverflowError", "ReceiverApduError", "__toCommonJS", "message", "originalError"]
4
+ "sourcesContent": ["import { type DmkError } from \"@api/Error\";\n\nexport class FramerOverflowError implements DmkError {\n readonly _tag = \"FramerOverflowError\";\n originalError?: Error;\n constructor() {\n this.originalError = new Error(\n \"Frame header length is greater than frame size\",\n );\n }\n}\n\nexport class FramerApduError implements DmkError {\n readonly _tag = \"FramerApduError\";\n originalError?: Error;\n\n constructor() {\n this.originalError = new Error(\"Frame offset is greater than apdu length\");\n }\n}\n\nexport class ReceiverApduError implements DmkError {\n readonly _tag = \"ReceiverApduError\";\n originalError: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Unable to parse apdu\");\n }\n}\n\nexport class DeviceSessionNotFound implements DmkError {\n readonly _tag = \"DeviceSessionNotFound\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError = originalError ?? new Error(\"Device session not found\");\n }\n}\n\nexport class DeviceSessionRefresherError implements DmkError {\n readonly _tag = \"DeviceSessionRefresherError\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError =\n originalError ?? new Error(\"Device session refresher error\");\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,EAAA,gCAAAC,EAAA,oBAAAC,EAAA,wBAAAC,EAAA,sBAAAC,IAAA,eAAAC,EAAAP,GAEO,MAAMK,CAAwC,CAC1C,KAAO,sBAChB,cACA,aAAc,CACZ,KAAK,cAAgB,IAAI,MACvB,gDACF,CACF,CACF,CAEO,MAAMD,CAAoC,CACtC,KAAO,kBAChB,cAEA,aAAc,CACZ,KAAK,cAAgB,IAAI,MAAM,0CAA0C,CAC3E,CACF,CAEO,MAAME,CAAsC,CACxC,KAAO,oBAChB,cAEA,YAAYE,EAAkB,CAC5B,KAAK,cAAgB,IAAI,MAAMA,GAAW,sBAAsB,CAClE,CACF,CAEO,MAAMN,CAA0C,CAC5C,KAAO,wBAChB,cAEA,YAAYO,EAAuB,CACjC,KAAK,cAAgBA,GAAiB,IAAI,MAAM,0BAA0B,CAC5E,CACF,CAEO,MAAMN,CAAgD,CAClD,KAAO,8BAChB,cAEA,YAAYM,EAAuB,CACjC,KAAK,cACHA,GAAiB,IAAI,MAAM,gCAAgC,CAC/D,CACF",
6
+ "names": ["Errors_exports", "__export", "DeviceSessionNotFound", "DeviceSessionRefresherError", "FramerApduError", "FramerOverflowError", "ReceiverApduError", "__toCommonJS", "message", "originalError"]
7
7
  }
@@ -8,11 +8,6 @@
8
8
  "types": "./lib/types/index.d.ts",
9
9
  "import": "./lib/esm/index.js",
10
10
  "require": "./lib/cjs/index.js"
11
- },
12
- "./*": {
13
- "types": "./lib/types/*",
14
- "import": "./lib/esm/*",
15
- "require": "./lib/cjs/*"
16
11
  }
17
12
  },
18
13
  "files": [
@@ -1,2 +1,2 @@
1
- class s{_tag;originalError;errorCode;message;constructor({tag:r,errorCode:o,originalError:n,message:i}){this._tag=r,this.originalError=n,this.errorCode=o,this.message=i??"An error occured during device exchange."}}class a{_tag="UnknownDeviceExchangeError";originalError;message;constructor(r){this.originalError=r,this.message="Unexpected device exchange error happened."}}export{s as DeviceExchangeError,a as UnknownDeviceExchangeError};
1
+ class s{_tag;originalError;errorCode;message;constructor({tag:r,errorCode:o,originalError:n,message:i}){this._tag=r,this.originalError=n,this.errorCode=o,this.message=i??"An error occured during device exchange."}}class a{_tag="UnknownDeviceExchangeError";originalError;message;constructor(r){this.originalError=r,this.message="Unexpected device exchange error happened."}}class c{_tag="DeviceBusyError";originalError;constructor(r){this.originalError=r??new Error("Device is busy, please try again later")}}export{c as DeviceBusyError,s as DeviceExchangeError,a as UnknownDeviceExchangeError};
2
2
  //# sourceMappingURL=Error.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/Error.ts"],
4
- "sourcesContent": ["export interface DmkError {\n readonly _tag: string;\n readonly originalError?: unknown;\n message?: string;\n}\n\nexport type DeviceExchangeErrorArgs<SpecificErrorCodes> = {\n tag: string;\n originalError?: unknown;\n errorCode: SpecificErrorCodes;\n message: string;\n};\n\nexport type CommandErrorArgs<SpecificErrorCodes> = Omit<\n DeviceExchangeErrorArgs<SpecificErrorCodes>,\n \"tag\"\n>;\n\nexport abstract class DeviceExchangeError<SpecificErrorCodes = void> {\n readonly _tag: string;\n readonly originalError?: unknown;\n readonly errorCode: SpecificErrorCodes;\n readonly message: string;\n\n protected constructor({\n tag,\n errorCode,\n originalError,\n message,\n }: DeviceExchangeErrorArgs<SpecificErrorCodes>) {\n this._tag = tag;\n this.originalError = originalError;\n this.errorCode = errorCode;\n this.message = message ?? \"An error occured during device exchange.\";\n }\n}\n\nexport class UnknownDeviceExchangeError implements DmkError {\n readonly _tag = \"UnknownDeviceExchangeError\";\n readonly originalError?: unknown;\n readonly message: string;\n\n constructor(originalError?: unknown) {\n this.originalError = originalError;\n this.message = \"Unexpected device exchange error happened.\";\n }\n}\n"],
5
- "mappings": "AAkBO,MAAeA,CAA+C,CAC1D,KACA,cACA,UACA,QAEC,YAAY,CACpB,IAAAC,EACA,UAAAC,EACA,cAAAC,EACA,QAAAC,CACF,EAAgD,CAC9C,KAAK,KAAOH,EACZ,KAAK,cAAgBE,EACrB,KAAK,UAAYD,EACjB,KAAK,QAAUE,GAAW,0CAC5B,CACF,CAEO,MAAMC,CAA+C,CACjD,KAAO,6BACP,cACA,QAET,YAAYF,EAAyB,CACnC,KAAK,cAAgBA,EACrB,KAAK,QAAU,4CACjB,CACF",
6
- "names": ["DeviceExchangeError", "tag", "errorCode", "originalError", "message", "UnknownDeviceExchangeError"]
4
+ "sourcesContent": ["export interface DmkError {\n readonly _tag: string;\n readonly originalError?: unknown;\n message?: string;\n}\n\nexport type DeviceExchangeErrorArgs<SpecificErrorCodes> = {\n tag: string;\n originalError?: unknown;\n errorCode: SpecificErrorCodes;\n message: string;\n};\n\nexport type CommandErrorArgs<SpecificErrorCodes> = Omit<\n DeviceExchangeErrorArgs<SpecificErrorCodes>,\n \"tag\"\n>;\n\nexport abstract class DeviceExchangeError<SpecificErrorCodes = void> {\n readonly _tag: string;\n readonly originalError?: unknown;\n readonly errorCode: SpecificErrorCodes;\n readonly message: string;\n\n protected constructor({\n tag,\n errorCode,\n originalError,\n message,\n }: DeviceExchangeErrorArgs<SpecificErrorCodes>) {\n this._tag = tag;\n this.originalError = originalError;\n this.errorCode = errorCode;\n this.message = message ?? \"An error occured during device exchange.\";\n }\n}\n\nexport class UnknownDeviceExchangeError implements DmkError {\n readonly _tag = \"UnknownDeviceExchangeError\";\n readonly originalError?: unknown;\n readonly message: string;\n\n constructor(originalError?: unknown) {\n this.originalError = originalError;\n this.message = \"Unexpected device exchange error happened.\";\n }\n}\n\nexport class DeviceBusyError implements DmkError {\n readonly _tag = \"DeviceBusyError\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError =\n originalError ?? new Error(\"Device is busy, please try again later\");\n }\n}\n"],
5
+ "mappings": "AAkBO,MAAeA,CAA+C,CAC1D,KACA,cACA,UACA,QAEC,YAAY,CACpB,IAAAC,EACA,UAAAC,EACA,cAAAC,EACA,QAAAC,CACF,EAAgD,CAC9C,KAAK,KAAOH,EACZ,KAAK,cAAgBE,EACrB,KAAK,UAAYD,EACjB,KAAK,QAAUE,GAAW,0CAC5B,CACF,CAEO,MAAMC,CAA+C,CACjD,KAAO,6BACP,cACA,QAET,YAAYF,EAAyB,CACnC,KAAK,cAAgBA,EACrB,KAAK,QAAU,4CACjB,CACF,CAEO,MAAMG,CAAoC,CACtC,KAAO,kBAChB,cAEA,YAAYH,EAAuB,CACjC,KAAK,cACHA,GAAiB,IAAI,MAAM,wCAAwC,CACvE,CACF",
6
+ "names": ["DeviceExchangeError", "tag", "errorCode", "originalError", "message", "UnknownDeviceExchangeError", "DeviceBusyError"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Apdu as o}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as m}from"./apdu/utils/ApduBuilder";import{ApduParser as n}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as f}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as c}from"./apdu/utils/ByteArrayParser";import{InvalidStatusWordError as A}from"./command/Errors";import{CommandResultFactory as D,CommandResultStatus as v,isSuccessCommandResult as S}from"./command/model/CommandResult";import{CloseAppCommand as y}from"./command/os/CloseAppCommand";import{GetAppAndVersionCommand as g}from"./command/os/GetAppAndVersionCommand";import{BatteryStatusType as E,GetBatteryStatusCommand as L}from"./command/os/GetBatteryStatusCommand";import{GetOsVersionCommand as R}from"./command/os/GetOsVersionCommand";import{ListAppsCommand as M}from"./command/os/ListAppsCommand";import{OpenAppCommand as I}from"./command/os/OpenAppCommand";import{isCommandErrorCode as h}from"./command/utils/CommandErrors";import{CommandUtils as V}from"./command/utils/CommandUtils";import{GlobalCommandError as _,GlobalCommandErrorHandler as H}from"./command/utils/GlobalCommandError";import{DeviceModel as k,DeviceModelId as w,LEDGER_VENDOR_ID as F}from"./device/DeviceModel";import{DeviceStatus as X}from"./device/DeviceStatus";import{DeviceActionStatus as N}from"./device-action/model/DeviceActionState";import{UserInteractionRequired as j}from"./device-action/model/UserInteractionRequired";import{UnknownDAError as J}from"./device-action/os/Errors";import{GetDeviceStatusDeviceAction as Z}from"./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as ee}from"./device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{ListAppsDeviceAction as oe}from"./device-action/os/ListApps/ListAppsDeviceAction";import{ListAppsWithMetadataDeviceAction as pe}from"./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction";import{OpenAppDeviceAction as ie}from"./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{SendCommandInAppDeviceAction as se}from"./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction";import{XStateDeviceAction as fe}from"./device-action/xstate-utils/XStateDeviceAction";import{StaticDeviceModelDataSource as ce}from"./device-model/data/StaticDeviceModelDataSource";import{BleDeviceInfos as Ae}from"./device-model/model/BleDeviceInfos";import{TransportDeviceModel as De}from"./device-model/model/DeviceModel";import{ApduResponse as Se}from"./device-session/ApduResponse";export*from"./device-session/data/FramerConst";import{DeviceSessionStateType as Ce}from"./device-session/DeviceSessionState";import{defaultApduReceiverServiceStubBuilder as Be}from"./device-session/service/DefaultApduReceiverService.stub";import{defaultApduSenderServiceStubBuilder as Le}from"./device-session/service/DefaultApduSenderService.stub";import{FramerUtils as Re}from"./device-session/utils/FramerUtils";import{DeviceManagementKit as Me}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as Ie}from"./DeviceManagementKitBuilder";import{DeviceExchangeError as he,UnknownDeviceExchangeError as Ue}from"./Error";import{LogLevel as Pe}from"./logger-subscriber/model/LogLevel";import{ConsoleLogger as He}from"./logger-subscriber/service/ConsoleLogger";import{WebLogsExporterLogger as ke}from"./logger-subscriber/service/WebLogsExporterLogger";import{ConnectedDevice as Fe}from"./transport/model/ConnectedDevice";export*from"./transport/model/Errors";import{TransportConnectedDevice as qe}from"./transport/model/TransportConnectedDevice";import{connectedDeviceStubBuilder as Ye}from"./transport/model/TransportConnectedDevice.stub";export*from"./types";import{base64StringToBuffer as Je,isBase64String as Qe}from"./utils/Base64String";import{bufferToHexaString as $e,hexaStringToBuffer as er,isHexaString as rr}from"./utils/HexaString";export{p as APDU_MAX_PAYLOAD,o as Apdu,m as ApduBuilder,n as ApduParser,Se as ApduResponse,E as BatteryStatusType,Ae as BleDeviceInfos,f as ByteArrayBuilder,c as ByteArrayParser,y as CloseAppCommand,D as CommandResultFactory,v as CommandResultStatus,V as CommandUtils,Fe as ConnectedDevice,He as ConsoleLogger,N as DeviceActionStatus,he as DeviceExchangeError,Me as DeviceManagementKit,Ie as DeviceManagementKitBuilder,k as DeviceModel,w as DeviceModelId,Ce as DeviceSessionStateType,X as DeviceStatus,Re as FramerUtils,g as GetAppAndVersionCommand,L as GetBatteryStatusCommand,Z as GetDeviceStatusDeviceAction,R as GetOsVersionCommand,_ as GlobalCommandError,H as GlobalCommandErrorHandler,ee as GoToDashboardDeviceAction,A as InvalidStatusWordError,F as LEDGER_VENDOR_ID,M as ListAppsCommand,oe as ListAppsDeviceAction,pe as ListAppsWithMetadataDeviceAction,Pe as LogLevel,I as OpenAppCommand,ie as OpenAppDeviceAction,se as SendCommandInAppDeviceAction,ce as StaticDeviceModelDataSource,qe as TransportConnectedDevice,De as TransportDeviceModel,J as UnknownDAError,Ue as UnknownDeviceExchangeError,j as UserInteractionRequired,ke as WebLogsExporterLogger,fe as XStateDeviceAction,Je as base64StringToBuffer,$e as bufferToHexaString,Ye as connectedDeviceStubBuilder,Be as defaultApduReceiverServiceStubBuilder,Le as defaultApduSenderServiceStubBuilder,er as hexaStringToBuffer,Qe as isBase64String,h as isCommandErrorCode,rr as isHexaString,S as isSuccessCommandResult};
1
+ import{Apdu as o}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as m}from"./apdu/utils/ApduBuilder";import{ApduParser as n}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as f}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as c}from"./apdu/utils/ByteArrayParser";import{InvalidStatusWordError as A}from"./command/Errors";import{CommandResultFactory as D,CommandResultStatus as S,isSuccessCommandResult as v}from"./command/model/CommandResult";import{CloseAppCommand as y}from"./command/os/CloseAppCommand";import{GetAppAndVersionCommand as g}from"./command/os/GetAppAndVersionCommand";import{BatteryStatusType as L,GetBatteryStatusCommand as G}from"./command/os/GetBatteryStatusCommand";import{GetOsVersionCommand as E}from"./command/os/GetOsVersionCommand";import{ListAppsCommand as M}from"./command/os/ListAppsCommand";import{OpenAppCommand as I}from"./command/os/OpenAppCommand";import{isCommandErrorCode as U}from"./command/utils/CommandErrors";import{CommandUtils as h}from"./command/utils/CommandUtils";import{GlobalCommandError as _,GlobalCommandErrorHandler as H}from"./command/utils/GlobalCommandError";import{DeviceModel as F,DeviceModelId as K,LEDGER_VENDOR_ID as X}from"./device/DeviceModel";import{DeviceStatus as q}from"./device/DeviceStatus";import{DeviceActionStatus as N}from"./device-action/model/DeviceActionState";import{UserInteractionRequired as j}from"./device-action/model/UserInteractionRequired";import{UnknownDAError as J}from"./device-action/os/Errors";import{GetDeviceStatusDeviceAction as Z}from"./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as ee}from"./device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{ListAppsDeviceAction as oe}from"./device-action/os/ListApps/ListAppsDeviceAction";import{ListAppsWithMetadataDeviceAction as pe}from"./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction";import{OpenAppDeviceAction as ie}from"./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{SendCommandInAppDeviceAction as se}from"./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction";import{XStateDeviceAction as fe}from"./device-action/xstate-utils/XStateDeviceAction";import{StaticDeviceModelDataSource as ce}from"./device-model/data/StaticDeviceModelDataSource";import{BleDeviceInfos as Ae}from"./device-model/model/BleDeviceInfos";import{TransportDeviceModel as De}from"./device-model/model/DeviceModel";import{ApduResponse as ve}from"./device-session/ApduResponse";export*from"./device-session/data/FramerConst";import{DeviceSessionStateType as Ce}from"./device-session/DeviceSessionState";import{defaultApduReceiverServiceStubBuilder as Be}from"./device-session/service/DefaultApduReceiverService.stub";import{defaultApduSenderServiceStubBuilder as Ge}from"./device-session/service/DefaultApduSenderService.stub";import{FramerUtils as Ee}from"./device-session/utils/FramerUtils";import{DeviceManagementKit as Me}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as Ie}from"./DeviceManagementKitBuilder";export*from"./Error";import{LogLevel as Ve}from"./logger-subscriber/model/LogLevel";import{ConsoleLogger as Pe}from"./logger-subscriber/service/ConsoleLogger";import{WebLogsExporterLogger as He}from"./logger-subscriber/service/WebLogsExporterLogger";import{ConnectedDevice as Fe}from"./transport/model/ConnectedDevice";export*from"./transport/model/Errors";import{TransportConnectedDevice as ke}from"./transport/model/TransportConnectedDevice";import{connectedDeviceStubBuilder as we}from"./transport/model/TransportConnectedDevice.stub";export*from"./types";import{base64StringToBuffer as je,isBase64String as ze}from"./utils/Base64String";import{bufferToHexaString as Qe,hexaStringToBuffer as Ze,isHexaString as $e}from"./utils/HexaString";export{p as APDU_MAX_PAYLOAD,o as Apdu,m as ApduBuilder,n as ApduParser,ve as ApduResponse,L as BatteryStatusType,Ae as BleDeviceInfos,f as ByteArrayBuilder,c as ByteArrayParser,y as CloseAppCommand,D as CommandResultFactory,S as CommandResultStatus,h as CommandUtils,Fe as ConnectedDevice,Pe as ConsoleLogger,N as DeviceActionStatus,Me as DeviceManagementKit,Ie as DeviceManagementKitBuilder,F as DeviceModel,K as DeviceModelId,Ce as DeviceSessionStateType,q as DeviceStatus,Ee as FramerUtils,g as GetAppAndVersionCommand,G as GetBatteryStatusCommand,Z as GetDeviceStatusDeviceAction,E as GetOsVersionCommand,_ as GlobalCommandError,H as GlobalCommandErrorHandler,ee as GoToDashboardDeviceAction,A as InvalidStatusWordError,X as LEDGER_VENDOR_ID,M as ListAppsCommand,oe as ListAppsDeviceAction,pe as ListAppsWithMetadataDeviceAction,Ve as LogLevel,I as OpenAppCommand,ie as OpenAppDeviceAction,se as SendCommandInAppDeviceAction,ce as StaticDeviceModelDataSource,ke as TransportConnectedDevice,De as TransportDeviceModel,J as UnknownDAError,j as UserInteractionRequired,He as WebLogsExporterLogger,fe as XStateDeviceAction,je as base64StringToBuffer,Qe as bufferToHexaString,we as connectedDeviceStubBuilder,Be as defaultApduReceiverServiceStubBuilder,Ge as defaultApduSenderServiceStubBuilder,Ze as hexaStringToBuffer,ze as isBase64String,U as isCommandErrorCode,$e as isHexaString,v as isSuccessCommandResult};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/index.ts"],
4
- "sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { UnknownDAError } from \"@api/device-action/os/Errors\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\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 { 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\";\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 { DeviceExchangeError, UnknownDeviceExchangeError } from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
- "mappings": "AAEA,OAAS,QAAAA,MAAY,uBACrB,OAAS,oBAAAC,EAAkB,eAAAC,MAAmB,8BAC9C,OAAS,cAAAC,MAAkB,6BAC3B,WAAc,kCACd,OAAS,oBAAAC,MAAwB,mCACjC,OAAS,mBAAAC,MAAuB,kCAChC,OAAS,0BAAAC,MAA8B,sBACvC,OACE,wBAAAC,EACA,uBAAAC,EACA,0BAAAC,MACK,mCACP,OAAS,mBAAAC,MAAuB,kCAChC,OACE,2BAAAC,MAEK,0CACP,OACE,qBAAAC,EAEA,2BAAAC,MAEK,0CACP,OACE,uBAAAC,MAEK,sCACP,OAEE,mBAAAC,MAGK,kCACP,OAEE,kBAAAC,MACK,iCACP,OAAS,sBAAAC,MAA0B,mCACnC,OAAS,gBAAAC,MAAoB,kCAC7B,OACE,sBAAAC,EACA,6BAAAC,MACK,wCACP,OACE,eAAAC,EACA,iBAAAC,EACA,oBAAAC,MACK,0BACP,OAAS,gBAAAC,MAAoB,2BAE7B,OAEE,sBAAAC,MACK,6CACP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,kBAAAC,MAAsB,+BAC/B,OAAS,+BAAAC,MAAmC,oEAC5C,OAAS,6BAAAC,OAAiC,gEAC1C,OAAS,wBAAAC,OAA4B,sDACrC,OAAS,oCAAAC,OAAwC,8EACjD,OAAS,uBAAAC,OAA2B,gEACpC,OAAS,gCAAAC,OAAoC,kFAC7C,OAEE,sBAAAC,OACK,qDACP,OAAS,+BAAAC,OAAmC,qDAC5C,OAAS,kBAAAC,OAAsB,yCAC/B,OAAS,wBAAAC,OAA4B,sCACrC,OAAS,gBAAAC,OAAoB,mCAC7B,WAAc,uCACd,OAEE,0BAAAC,OACK,yCAEP,OAAS,yCAAAC,OAA6C,8DACtD,OAAS,uCAAAC,OAA2C,4DACpD,OAAS,eAAAC,OAAmB,wCAC5B,OAAS,uBAAAC,OAA2B,2BACpC,OAAS,8BAAAC,OAAkC,kCAC3C,OAAS,uBAAAC,GAAqB,8BAAAC,OAAkC,aAChE,OAAS,YAAAC,OAAgB,wCACzB,OAAS,iBAAAC,OAAqB,+CAC9B,OAAS,yBAAAC,OAA6B,uDACtC,OAAS,mBAAAC,OAAuB,uCAChC,WAAc,8BACd,OAAS,4BAAAC,OAAgC,gDACzC,OAAS,8BAAAC,OAAkC,qDAC3C,WAAc,aACd,OAAS,wBAAAC,GAAsB,kBAAAC,OAAsB,0BACrD,OACE,sBAAAC,GACA,sBAAAC,GACA,gBAAAC,OACK",
6
- "names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "GetAppAndVersionCommand", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "DeviceActionStatus", "UserInteractionRequired", "UnknownDAError", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "SendCommandInAppDeviceAction", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "DeviceExchangeError", "UnknownDeviceExchangeError", "LogLevel", "ConsoleLogger", "WebLogsExporterLogger", "ConnectedDevice", "TransportConnectedDevice", "connectedDeviceStubBuilder", "base64StringToBuffer", "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 { InvalidStatusWordError } from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { UnknownDAError } from \"@api/device-action/os/Errors\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\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 { 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\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
+ "mappings": "AAEA,OAAS,QAAAA,MAAY,uBACrB,OAAS,oBAAAC,EAAkB,eAAAC,MAAmB,8BAC9C,OAAS,cAAAC,MAAkB,6BAC3B,WAAc,kCACd,OAAS,oBAAAC,MAAwB,mCACjC,OAAS,mBAAAC,MAAuB,kCAChC,OAAS,0BAAAC,MAA8B,sBACvC,OACE,wBAAAC,EACA,uBAAAC,EACA,0BAAAC,MACK,mCACP,OAAS,mBAAAC,MAAuB,kCAChC,OACE,2BAAAC,MAEK,0CACP,OACE,qBAAAC,EAEA,2BAAAC,MAEK,0CACP,OACE,uBAAAC,MAEK,sCACP,OAEE,mBAAAC,MAGK,kCACP,OAEE,kBAAAC,MACK,iCACP,OAAS,sBAAAC,MAA0B,mCACnC,OAAS,gBAAAC,MAAoB,kCAC7B,OACE,sBAAAC,EACA,6BAAAC,MACK,wCACP,OACE,eAAAC,EACA,iBAAAC,EACA,oBAAAC,MACK,0BACP,OAAS,gBAAAC,MAAoB,2BAE7B,OAEE,sBAAAC,MACK,6CACP,OAAS,2BAAAC,MAA+B,mDACxC,OAAS,kBAAAC,MAAsB,+BAC/B,OAAS,+BAAAC,MAAmC,oEAC5C,OAAS,6BAAAC,OAAiC,gEAC1C,OAAS,wBAAAC,OAA4B,sDACrC,OAAS,oCAAAC,OAAwC,8EACjD,OAAS,uBAAAC,OAA2B,gEACpC,OAAS,gCAAAC,OAAoC,kFAC7C,OAEE,sBAAAC,OACK,qDACP,OAAS,+BAAAC,OAAmC,qDAC5C,OAAS,kBAAAC,OAAsB,yCAC/B,OAAS,wBAAAC,OAA4B,sCACrC,OAAS,gBAAAC,OAAoB,mCAC7B,WAAc,uCACd,OAEE,0BAAAC,OACK,yCAEP,OAAS,yCAAAC,OAA6C,8DACtD,OAAS,uCAAAC,OAA2C,4DACpD,OAAS,eAAAC,OAAmB,wCAC5B,OAAS,uBAAAC,OAA2B,2BACpC,OAAS,8BAAAC,OAAkC,kCAC3C,WAAc,aACd,OAAS,YAAAC,OAAgB,wCACzB,OAAS,iBAAAC,OAAqB,+CAC9B,OAAS,yBAAAC,OAA6B,uDACtC,OAAS,mBAAAC,OAAuB,uCAChC,WAAc,8BACd,OAAS,4BAAAC,OAAgC,gDACzC,OAAS,8BAAAC,OAAkC,qDAC3C,WAAc,aACd,OAAS,wBAAAC,GAAsB,kBAAAC,OAAsB,0BACrD,OACE,sBAAAC,GACA,sBAAAC,GACA,gBAAAC,OACK",
6
+ "names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "GetAppAndVersionCommand", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "DeviceActionStatus", "UserInteractionRequired", "UnknownDAError", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "SendCommandInAppDeviceAction", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "LogLevel", "ConsoleLogger", "WebLogsExporterLogger", "ConnectedDevice", "TransportConnectedDevice", "connectedDeviceStubBuilder", "base64StringToBuffer", "isBase64String", "bufferToHexaString", "hexaStringToBuffer", "isHexaString"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Left as a}from"purify-ts";import{BehaviorSubject as c}from"rxjs";import{v4 as p}from"uuid";import{CommandUtils as d}from"../../../api/command/utils/CommandUtils";import{DeviceStatus as i}from"../../../api/device/DeviceStatus";import{DeviceSessionStateType as v}from"../../../api/device-session/DeviceSessionState";import{DEVICE_SESSION_REFRESH_INTERVAL as u}from"../../device-session/data/DeviceSessionRefresherConst";import{DeviceSessionRefresher as S}from"./DeviceSessionRefresher";import{DeviceBusyError as m}from"./Errors";class R{_id;_connectedDevice;_deviceState;_refresher;_managerApiService;constructor({connectedDevice:e,id:s=p()},r,t){this._id=s,this._connectedDevice=e,this._deviceState=new c({sessionStateType:v.Connected,deviceStatus:i.CONNECTED}),this._refresher=new S({refreshInterval:u,deviceStatus:i.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id,sendApduFn:o=>this.sendApdu(o,{isPolling:!0,triggersDisconnection:!1}),updateStateFn:o=>{const n=this._deviceState.getValue();this.setDeviceSessionState(o(n))}},r("device-session-refresher")),this._managerApiService=t}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}setDeviceSessionState(e){this._deviceState.next(e)}updateDeviceStatus(e){const s=this._deviceState.getValue();this._refresher.setDeviceStatus(e),this._deviceState.next({...s,deviceStatus:e})}async sendApdu(e,s={isPolling:!1,triggersDisconnection:!1}){return this._deviceState.getValue().deviceStatus===i.BUSY?a(new m):(s.isPolling||this.updateDeviceStatus(i.BUSY),(await this._connectedDevice.sendApdu(e,s.triggersDisconnection)).ifRight(o=>{d.isLockedDeviceResponse(o)?this.updateDeviceStatus(i.LOCKED):this.updateDeviceStatus(i.CONNECTED)}).ifLeft(()=>{this.updateDeviceStatus(i.CONNECTED)}))}async sendCommand(e){const s=e.getApdu();return(await this.sendApdu(s.getRawApdu(),{isPolling:!1,triggersDisconnection:e.triggersDisconnection??!1})).caseOf({Left:t=>{throw t},Right:t=>e.parseResponse(t,this._connectedDevice.deviceModel.id)})}executeDeviceAction(e){const{observable:s,cancel:r}=e._execute({sendCommand:async t=>this.sendCommand(t),getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:t=>(this.setDeviceSessionState(t),this._deviceState.getValue()),getMetadataForAppHashes:t=>this._managerApiService.getAppsByHash(t)});return{observable:s,cancel:r}}close(){this.updateDeviceStatus(i.NOT_CONNECTED),this._deviceState.complete(),this._refresher.stop()}toggleRefresher(e){e?this._refresher.start():this._refresher.stop()}}export{R as DeviceSession};
1
+ import{Left as a}from"purify-ts";import{BehaviorSubject as c}from"rxjs";import{v4 as p}from"uuid";import{CommandUtils as d}from"../../../api/command/utils/CommandUtils";import{DeviceStatus as i}from"../../../api/device/DeviceStatus";import{DeviceSessionStateType as v}from"../../../api/device-session/DeviceSessionState";import{DeviceBusyError as u}from"../../../api/Error";import{DEVICE_SESSION_REFRESH_INTERVAL as S}from"../../device-session/data/DeviceSessionRefresherConst";import{DeviceSessionRefresher as m}from"./DeviceSessionRefresher";class R{_id;_connectedDevice;_deviceState;_refresher;_managerApiService;constructor({connectedDevice:e,id:s=p()},r,t){this._id=s,this._connectedDevice=e,this._deviceState=new c({sessionStateType:v.Connected,deviceStatus:i.CONNECTED}),this._refresher=new m({refreshInterval:S,deviceStatus:i.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id,sendApduFn:o=>this.sendApdu(o,{isPolling:!0,triggersDisconnection:!1}),updateStateFn:o=>{const n=this._deviceState.getValue();this.setDeviceSessionState(o(n))}},r("device-session-refresher")),this._managerApiService=t}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}setDeviceSessionState(e){this._deviceState.next(e)}updateDeviceStatus(e){const s=this._deviceState.getValue();this._refresher.setDeviceStatus(e),this._deviceState.next({...s,deviceStatus:e})}async sendApdu(e,s={isPolling:!1,triggersDisconnection:!1}){return this._deviceState.getValue().deviceStatus===i.BUSY?a(new u):(s.isPolling||this.updateDeviceStatus(i.BUSY),(await this._connectedDevice.sendApdu(e,s.triggersDisconnection)).ifRight(o=>{d.isLockedDeviceResponse(o)?this.updateDeviceStatus(i.LOCKED):this.updateDeviceStatus(i.CONNECTED)}).ifLeft(()=>{this.updateDeviceStatus(i.CONNECTED)}))}async sendCommand(e){const s=e.getApdu();return(await this.sendApdu(s.getRawApdu(),{isPolling:!1,triggersDisconnection:e.triggersDisconnection??!1})).caseOf({Left:t=>{throw t},Right:t=>e.parseResponse(t,this._connectedDevice.deviceModel.id)})}executeDeviceAction(e){const{observable:s,cancel:r}=e._execute({sendCommand:async t=>this.sendCommand(t),getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:t=>(this.setDeviceSessionState(t),this._deviceState.getValue()),getMetadataForAppHashes:t=>this._managerApiService.getAppsByHash(t)});return{observable:s,cancel:r}}close(){this.updateDeviceStatus(i.NOT_CONNECTED),this._deviceState.complete(),this._refresher.stop()}toggleRefresher(e){e?this._refresher.start():this._refresher.stop()}}export{R as DeviceSession};
2
2
  //# sourceMappingURL=DeviceSession.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-session/model/DeviceSession.ts"],
4
- "sourcesContent": ["import { type Either, Left } from \"purify-ts\";\nimport { BehaviorSubject } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { type ListAppsResponse } from \"@api/command/os/ListAppsCommand\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { type DmkError } from \"@api/Error\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESH_INTERVAL } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\nimport { DeviceBusyError } from \"./Errors\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _refresher: DeviceSessionRefresher;\n private readonly _managerApiService: ManagerApiService;\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n });\n this._refresher = new DeviceSessionRefresher(\n {\n refreshInterval: DEVICE_SESSION_REFRESH_INTERVAL,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n sendApduFn: (rawApdu: Uint8Array) =>\n this.sendApdu(rawApdu, {\n isPolling: true,\n triggersDisconnection: false,\n }),\n updateStateFn: (callback) => {\n const state = this._deviceState.getValue();\n this.setDeviceSessionState(callback(state));\n },\n },\n loggerModuleFactory(\"device-session-refresher\"),\n );\n this._managerApiService = managerApiService;\n }\n\n public get id() {\n return this._id;\n }\n\n public get connectedDevice() {\n return this._connectedDevice;\n }\n\n public get state() {\n return this._deviceState.asObservable();\n }\n\n public setDeviceSessionState(state: DeviceSessionState) {\n this._deviceState.next(state);\n }\n\n private updateDeviceStatus(deviceStatus: DeviceStatus) {\n const sessionState = this._deviceState.getValue();\n this._refresher.setDeviceStatus(deviceStatus);\n this._deviceState.next({\n ...sessionState,\n deviceStatus,\n });\n }\n\n async sendApdu(\n rawApdu: Uint8Array,\n options: {\n isPolling: boolean;\n triggersDisconnection: boolean;\n } = {\n isPolling: false,\n triggersDisconnection: false,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n const sessionState = this._deviceState.getValue();\n if (sessionState.deviceStatus === DeviceStatus.BUSY) {\n return Left(new DeviceBusyError());\n }\n\n if (!options.isPolling) this.updateDeviceStatus(DeviceStatus.BUSY);\n\n const errorOrResponse = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n );\n\n return errorOrResponse\n .ifRight((response: ApduResponse) => {\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this.updateDeviceStatus(DeviceStatus.LOCKED);\n } else {\n this.updateDeviceStatus(DeviceStatus.CONNECTED);\n }\n })\n .ifLeft(() => {\n this.updateDeviceStatus(DeviceStatus.CONNECTED);\n });\n }\n\n async sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n const apdu = command.getApdu();\n const response = await this.sendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n });\n\n return response.caseOf({\n Left: (err) => {\n throw err;\n },\n Right: (r) =>\n command.parseResponse(r, this._connectedDevice.deviceModel.id),\n });\n }\n\n executeDeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, Error, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n ) => this.sendCommand(command),\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n getMetadataForAppHashes: (apps: ListAppsResponse) =>\n this._managerApiService.getAppsByHash(apps),\n });\n\n return {\n observable,\n cancel,\n };\n }\n\n close() {\n this.updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._refresher.stop();\n }\n\n toggleRefresher(enabled: boolean) {\n if (enabled) {\n this._refresher.start();\n } else {\n this._refresher.stop();\n }\n }\n}\n"],
5
- "mappings": "AAAA,OAAsB,QAAAA,MAAY,YAClC,OAAS,mBAAAC,MAAuB,OAChC,OAAS,MAAMC,MAAc,OAK7B,OAAS,gBAAAC,MAAoB,kCAC7B,OAAS,gBAAAC,MAAoB,2BAO7B,OAEE,0BAAAC,MACK,yCAKP,OAAS,mCAAAC,MAAuC,4DAGhD,OAAS,0BAAAC,MAA8B,2BACvC,OAAS,mBAAAC,MAAuB,WAUzB,MAAMC,CAAc,CACR,IACA,iBACA,aACA,WACA,mBAEjB,YACE,CAAE,gB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3C,KAAK,mBAAmBA,EAAa,SAAS,CAElD,CAAC,EACA,OAAO,IAAM,CACZ,KAAK,mBAAmBA,EAAa,SAAS,CAChD,CAAC,EACL,CAEA,MAAM,YACJiB,EACoD,CACpD,MAAMC,EAAOD,EAAQ,QAAQ,EAM7B,OALiB,MAAM,KAAK,SAASC,EAAK,WAAW,EAAG,CACtD,UAAW,GACX,sBAAuBD,EAAQ,uBAAyB,EAC1D,CAAC,GAEe,OAAO,CACrB,KAAOE,GAAQ,CACb,MAAMA,CACR,EACA,MAAQC,GACNH,EAAQ,cAAcG,EAAG,KAAK,iBAAiB,YAAY,EAAE,CACjE,CAAC,CACH,CAEA,oBAMEC,EACiE,CACjE,KAAM,CAAE,WAAAC,EAAY,OAAAC,CAAO,EAAIF,EAAa,SAAS,CACnD,YAAa,MACXJ,GACG,KAAK,YAAYA,CAAO,EAC7B,sBAAuB,IAAM,KAAK,aAAa,SAAS,EACxD,gCAAiC,IAAM,KAAK,MAC5C,sBAAwBL,IACtB,KAAK,sBAAsBA,CAAK,EACzB,KAAK,aAAa,SAAS,GAEpC,wBAA0BY,GACxB,KAAK,mBAAmB,cAAcA,CAAI,CAC9C,CAAC,EAED,MAAO,CACL,WAAAF,EACA,OAAAC,CACF,CACF,CAEA,OAAQ,CACN,KAAK,mBAAmBvB,EAAa,aAAa,EAClD,KAAK,aAAa,SAAS,EAC3B,KAAK,WAAW,KAAK,CACvB,CAEA,gBAAgByB,EAAkB,CAC5BA,EACF,KAAK,WAAW,MAAM,EAEtB,KAAK,WAAW,KAAK,CAEzB,CACF",
6
- "names": ["Left", "BehaviorSubject", "uuidv4", "CommandUtils", "DeviceStatus", "DeviceSessionStateType", "DEVICE_SESSION_REFRESH_INTERVAL", "DeviceSessionRefresher", "DeviceBusyError", "DeviceSession", "connectedDevice", "id", "loggerModuleFactory", "managerApiService", "rawApdu", "callback", "state", "deviceStatus", "sessionState", "options", "response", "command", "apdu", "err", "r", "deviceAction", "observable", "cancel", "apps", "enabled"]
4
+ "sourcesContent": ["import { type Either, Left } from \"purify-ts\";\nimport { BehaviorSubject } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { type ListAppsResponse } from \"@api/command/os/ListAppsCommand\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { DeviceBusyError, type DmkError } from \"@api/Error\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESH_INTERVAL } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\n\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _refresher: DeviceSessionRefresher;\n private readonly _managerApiService: ManagerApiService;\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n });\n this._refresher = new DeviceSessionRefresher(\n {\n refreshInterval: DEVICE_SESSION_REFRESH_INTERVAL,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n sendApduFn: (rawApdu: Uint8Array) =>\n this.sendApdu(rawApdu, {\n isPolling: true,\n triggersDisconnection: false,\n }),\n updateStateFn: (callback) => {\n const state = this._deviceState.getValue();\n this.setDeviceSessionState(callback(state));\n },\n },\n loggerModuleFactory(\"device-session-refresher\"),\n );\n this._managerApiService = managerApiService;\n }\n\n public get id() {\n return this._id;\n }\n\n public get connectedDevice() {\n return this._connectedDevice;\n }\n\n public get state() {\n return this._deviceState.asObservable();\n }\n\n public setDeviceSessionState(state: DeviceSessionState) {\n this._deviceState.next(state);\n }\n\n private updateDeviceStatus(deviceStatus: DeviceStatus) {\n const sessionState = this._deviceState.getValue();\n this._refresher.setDeviceStatus(deviceStatus);\n this._deviceState.next({\n ...sessionState,\n deviceStatus,\n });\n }\n\n async sendApdu(\n rawApdu: Uint8Array,\n options: {\n isPolling: boolean;\n triggersDisconnection: boolean;\n } = {\n isPolling: false,\n triggersDisconnection: false,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n const sessionState = this._deviceState.getValue();\n if (sessionState.deviceStatus === DeviceStatus.BUSY) {\n return Left(new DeviceBusyError());\n }\n\n if (!options.isPolling) this.updateDeviceStatus(DeviceStatus.BUSY);\n\n const errorOrResponse = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n );\n\n return errorOrResponse\n .ifRight((response: ApduResponse) => {\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this.updateDeviceStatus(DeviceStatus.LOCKED);\n } else {\n this.updateDeviceStatus(DeviceStatus.CONNECTED);\n }\n })\n .ifLeft(() => {\n this.updateDeviceStatus(DeviceStatus.CONNECTED);\n });\n }\n\n async sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n const apdu = command.getApdu();\n const response = await this.sendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n });\n\n return response.caseOf({\n Left: (err) => {\n throw err;\n },\n Right: (r) =>\n command.parseResponse(r, this._connectedDevice.deviceModel.id),\n });\n }\n\n executeDeviceAction<\n Output,\n Input,\n Error extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, Error, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, Error, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n ) => this.sendCommand(command),\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n getMetadataForAppHashes: (apps: ListAppsResponse) =>\n this._managerApiService.getAppsByHash(apps),\n });\n\n return {\n observable,\n cancel,\n };\n }\n\n close() {\n this.updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._refresher.stop();\n }\n\n toggleRefresher(enabled: boolean) {\n if (enabled) {\n this._refresher.start();\n } else {\n this._refresher.stop();\n }\n }\n}\n"],
5
+ "mappings": "AAAA,OAAsB,QAAAA,MAAY,YAClC,OAAS,mBAAAC,MAAuB,OAChC,OAAS,MAAMC,MAAc,OAK7B,OAAS,gBAAAC,MAAoB,kCAC7B,OAAS,gBAAAC,MAAoB,2BAO7B,OAEE,0BAAAC,MACK,yCAEP,OAAS,mBAAAC,MAAsC,aAG/C,OAAS,mCAAAC,MAAuC,4DAGhD,OAAS,0BAAAC,MAA8B,2BAUhC,MAAMC,CAAc,CACR,IACA,iBACA,aACA,WACA,mBAEjB,YACE,CAAE,gBAAAC,EAAiB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AmBA,EAAa,SAAS,CAElD,CAAC,EACA,OAAO,IAAM,CACZ,KAAK,mBAAmBA,EAAa,SAAS,CAChD,CAAC,EACL,CAEA,MAAM,YACJiB,EACoD,CACpD,MAAMC,EAAOD,EAAQ,QAAQ,EAM7B,OALiB,MAAM,KAAK,SAASC,EAAK,WAAW,EAAG,CACtD,UAAW,GACX,sBAAuBD,EAAQ,uBAAyB,EAC1D,CAAC,GAEe,OAAO,CACrB,KAAOE,GAAQ,CACb,MAAMA,CACR,EACA,MAAQC,GACNH,EAAQ,cAAcG,EAAG,KAAK,iBAAiB,YAAY,EAAE,CACjE,CAAC,CACH,CAEA,oBAMEC,EACiE,CACjE,KAAM,CAAE,WAAAC,EAAY,OAAAC,CAAO,EAAIF,EAAa,SAAS,CACnD,YAAa,MACXJ,GACG,KAAK,YAAYA,CAAO,EAC7B,sBAAuB,IAAM,KAAK,aAAa,SAAS,EACxD,gCAAiC,IAAM,KAAK,MAC5C,sBAAwBL,IACtB,KAAK,sBAAsBA,CAAK,EACzB,KAAK,aAAa,SAAS,GAEpC,wBAA0BY,GACxB,KAAK,mBAAmB,cAAcA,CAAI,CAC9C,CAAC,EAED,MAAO,CACL,WAAAF,EACA,OAAAC,CACF,CACF,CAEA,OAAQ,CACN,KAAK,mBAAmBvB,EAAa,aAAa,EAClD,KAAK,aAAa,SAAS,EAC3B,KAAK,WAAW,KAAK,CACvB,CAEA,gBAAgByB,EAAkB,CAC5BA,EACF,KAAK,WAAW,MAAM,EAEtB,KAAK,WAAW,KAAK,CAEzB,CACF",
6
+ "names": ["Left", "BehaviorSubject", "uuidv4", "CommandUtils", "DeviceStatus", "DeviceSessionStateType", "DeviceBusyError", "DEVICE_SESSION_REFRESH_INTERVAL", "DeviceSessionRefresher", "DeviceSession", "connectedDevice", "id", "loggerModuleFactory", "managerApiService", "rawApdu", "callback", "state", "deviceStatus", "sessionState", "options", "response", "command", "apdu", "err", "r", "deviceAction", "observable", "cancel", "apps", "enabled"]
7
7
  }
@@ -1,2 +1,2 @@
1
- class e{_tag="FramerOverflowError";originalError;constructor(){this.originalError=new Error("Frame header length is greater than frame size")}}class i{_tag="FramerApduError";originalError;constructor(){this.originalError=new Error("Frame offset is greater than apdu length")}}class s{_tag="ReceiverApduError";originalError;constructor(r){this.originalError=new Error(r??"Unable to parse apdu")}}class n{_tag="DeviceSessionNotFound";originalError;constructor(r){this.originalError=r??new Error("Device session not found")}}class t{_tag="DeviceSessionRefresherError";originalError;constructor(r){this.originalError=r??new Error("Device session refresher error")}}class a{_tag="DeviceBusyError";originalError;constructor(r){this.originalError=r??new Error("Device is busy, please try again later")}}export{a as DeviceBusyError,n as DeviceSessionNotFound,t as DeviceSessionRefresherError,i as FramerApduError,e as FramerOverflowError,s as ReceiverApduError};
1
+ class e{_tag="FramerOverflowError";originalError;constructor(){this.originalError=new Error("Frame header length is greater than frame size")}}class i{_tag="FramerApduError";originalError;constructor(){this.originalError=new Error("Frame offset is greater than apdu length")}}class s{_tag="ReceiverApduError";originalError;constructor(r){this.originalError=new Error(r??"Unable to parse apdu")}}class n{_tag="DeviceSessionNotFound";originalError;constructor(r){this.originalError=r??new Error("Device session not found")}}class t{_tag="DeviceSessionRefresherError";originalError;constructor(r){this.originalError=r??new Error("Device session refresher error")}}export{n as DeviceSessionNotFound,t as DeviceSessionRefresherError,i as FramerApduError,e as FramerOverflowError,s as ReceiverApduError};
2
2
  //# sourceMappingURL=Errors.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/device-session/model/Errors.ts"],
4
- "sourcesContent": ["import { type DmkError } from \"@root/src/api/Error\";\n\nexport class FramerOverflowError implements DmkError {\n readonly _tag = \"FramerOverflowError\";\n originalError?: Error;\n constructor() {\n this.originalError = new Error(\n \"Frame header length is greater than frame size\",\n );\n }\n}\n\nexport class FramerApduError implements DmkError {\n readonly _tag = \"FramerApduError\";\n originalError?: Error;\n\n constructor() {\n this.originalError = new Error(\"Frame offset is greater than apdu length\");\n }\n}\n\nexport class ReceiverApduError implements DmkError {\n readonly _tag = \"ReceiverApduError\";\n originalError: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Unable to parse apdu\");\n }\n}\n\nexport class DeviceSessionNotFound implements DmkError {\n readonly _tag = \"DeviceSessionNotFound\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError = originalError ?? new Error(\"Device session not found\");\n }\n}\n\nexport class DeviceSessionRefresherError implements DmkError {\n readonly _tag = \"DeviceSessionRefresherError\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError =\n originalError ?? new Error(\"Device session refresher error\");\n }\n}\n\nexport class DeviceBusyError implements DmkError {\n readonly _tag = \"DeviceBusyError\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError =\n originalError ?? new Error(\"Device is busy, please try again later\");\n }\n}\n"],
5
- "mappings": "AAEO,MAAMA,CAAwC,CAC1C,KAAO,sBAChB,cACA,aAAc,CACZ,KAAK,cAAgB,IAAI,MACvB,gDACF,CACF,CACF,CAEO,MAAMC,CAAoC,CACtC,KAAO,kBAChB,cAEA,aAAc,CACZ,KAAK,cAAgB,IAAI,MAAM,0CAA0C,CAC3E,CACF,CAEO,MAAMC,CAAsC,CACxC,KAAO,oBAChB,cAEA,YAAYC,EAAkB,CAC5B,KAAK,cAAgB,IAAI,MAAMA,GAAW,sBAAsB,CAClE,CACF,CAEO,MAAMC,CAA0C,CAC5C,KAAO,wBAChB,cAEA,YAAYC,EAAuB,CACjC,KAAK,cAAgBA,GAAiB,IAAI,MAAM,0BAA0B,CAC5E,CACF,CAEO,MAAMC,CAAgD,CAClD,KAAO,8BAChB,cAEA,YAAYD,EAAuB,CACjC,KAAK,cACHA,GAAiB,IAAI,MAAM,gCAAgC,CAC/D,CACF,CAEO,MAAME,CAAoC,CACtC,KAAO,kBAChB,cAEA,YAAYF,EAAuB,CACjC,KAAK,cACHA,GAAiB,IAAI,MAAM,wCAAwC,CACvE,CACF",
6
- "names": ["FramerOverflowError", "FramerApduError", "ReceiverApduError", "message", "DeviceSessionNotFound", "originalError", "DeviceSessionRefresherError", "DeviceBusyError"]
4
+ "sourcesContent": ["import { type DmkError } from \"@api/Error\";\n\nexport class FramerOverflowError implements DmkError {\n readonly _tag = \"FramerOverflowError\";\n originalError?: Error;\n constructor() {\n this.originalError = new Error(\n \"Frame header length is greater than frame size\",\n );\n }\n}\n\nexport class FramerApduError implements DmkError {\n readonly _tag = \"FramerApduError\";\n originalError?: Error;\n\n constructor() {\n this.originalError = new Error(\"Frame offset is greater than apdu length\");\n }\n}\n\nexport class ReceiverApduError implements DmkError {\n readonly _tag = \"ReceiverApduError\";\n originalError: Error;\n\n constructor(message?: string) {\n this.originalError = new Error(message ?? \"Unable to parse apdu\");\n }\n}\n\nexport class DeviceSessionNotFound implements DmkError {\n readonly _tag = \"DeviceSessionNotFound\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError = originalError ?? new Error(\"Device session not found\");\n }\n}\n\nexport class DeviceSessionRefresherError implements DmkError {\n readonly _tag = \"DeviceSessionRefresherError\";\n originalError?: Error;\n\n constructor(originalError?: Error) {\n this.originalError =\n originalError ?? new Error(\"Device session refresher error\");\n }\n}\n"],
5
+ "mappings": "AAEO,MAAMA,CAAwC,CAC1C,KAAO,sBAChB,cACA,aAAc,CACZ,KAAK,cAAgB,IAAI,MACvB,gDACF,CACF,CACF,CAEO,MAAMC,CAAoC,CACtC,KAAO,kBAChB,cAEA,aAAc,CACZ,KAAK,cAAgB,IAAI,MAAM,0CAA0C,CAC3E,CACF,CAEO,MAAMC,CAAsC,CACxC,KAAO,oBAChB,cAEA,YAAYC,EAAkB,CAC5B,KAAK,cAAgB,IAAI,MAAMA,GAAW,sBAAsB,CAClE,CACF,CAEO,MAAMC,CAA0C,CAC5C,KAAO,wBAChB,cAEA,YAAYC,EAAuB,CACjC,KAAK,cAAgBA,GAAiB,IAAI,MAAM,0BAA0B,CAC5E,CACF,CAEO,MAAMC,CAAgD,CAClD,KAAO,8BAChB,cAEA,YAAYD,EAAuB,CACjC,KAAK,cACHA,GAAiB,IAAI,MAAM,gCAAgC,CAC/D,CACF",
6
+ "names": ["FramerOverflowError", "FramerApduError", "ReceiverApduError", "message", "DeviceSessionNotFound", "originalError", "DeviceSessionRefresherError"]
7
7
  }
@@ -23,4 +23,9 @@ export declare class UnknownDeviceExchangeError implements DmkError {
23
23
  readonly message: string;
24
24
  constructor(originalError?: unknown);
25
25
  }
26
+ export declare class DeviceBusyError implements DmkError {
27
+ readonly _tag = "DeviceBusyError";
28
+ originalError?: Error;
29
+ constructor(originalError?: Error);
30
+ }
26
31
  //# sourceMappingURL=Error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../../../src/api/Error.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,uBAAuB,CAAC,kBAAkB,IAAI;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,kBAAkB,IAAI,IAAI,CACrD,uBAAuB,CAAC,kBAAkB,CAAC,EAC3C,KAAK,CACN,CAAC;AAEF,8BAAsB,mBAAmB,CAAC,kBAAkB,GAAG,IAAI;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,SAAS,aAAa,EACpB,GA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C,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,aAAa,CAAC,EAAE,OAAO;CAIpC;AAED,qBAAa,eAAgB,YAAW,QAAQ;IAC9C,QAAQ,CAAC,IAAI,qBAAqB;IAClC,aAAa,CAAC,EAAE,KAAK,CAAC;gBAEV,aAAa,CAAC,EAAE,KAAK;CAIlC"}
@@ -39,7 +39,7 @@ export { defaultApduSenderServiceStubBuilder } from "./device-session/service/De
39
39
  export { FramerUtils } from "./device-session/utils/FramerUtils";
40
40
  export { DeviceManagementKit } from "./DeviceManagementKit";
41
41
  export { DeviceManagementKitBuilder } from "./DeviceManagementKitBuilder";
42
- export { DeviceExchangeError, UnknownDeviceExchangeError } from "./Error";
42
+ export * from "./Error";
43
43
  export { LogLevel } from "./logger-subscriber/model/LogLevel";
44
44
  export { ConsoleLogger } from "./logger-subscriber/service/ConsoleLogger";
45
45
  export { WebLogsExporterLogger } from "./logger-subscriber/service/WebLogsExporterLogger";
@@ -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,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,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;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,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,oBAAoB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,GACb,MAAM,uBAAuB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceSession.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/device-session/model/DeviceSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,WAAW,CAAC;AAI9C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAItE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EACnC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,KAAK,sBAAsB,EAAE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QAAQ,EACtB,iBAAiB,SAAS,6BAA6B,EAEvD,YAAY,EAAE,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,CAAC,GAClE,6BAA6B,CAAC,MAAM,EAAE,KAAK,EAAE,iBAAiB,CAAC;IAqBlE,KAAK;IAML,eAAe,CAAC,OAAO,EAAE,OAAO;CAOjC"}
1
+ {"version":3,"file":"DeviceSession.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/device-session/model/DeviceSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,WAAW,CAAC;AAI9C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAItE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EACnC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AACnG,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAE9F,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAIzF,MAAM,MAAM,sBAAsB,GAAG;IACnC,eAAe,EAAE,wBAAwB,CAAC;IAC1C,EAAE,CAAC,EAAE,eAAe,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAkB;IACtC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA2B;IAC5D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsC;IACnE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAoB;gBAGrD,EAAE,eAAe,EAAE,EAAa,EAAE,EAAE,sBAAsB,EAC1D,mBAAmB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,sBAAsB,EAC5D,iBAAiB,EAAE,iBAAiB;IA4BtC,IAAW,EAAE,WAEZ;IAED,IAAW,eAAe,6BAEzB;IAED,IAAW,KAAK,kDAEf;IAEM,qBAAqB,CAAC,KAAK,EAAE,kBAAkB;IAItD,OAAO,CAAC,kBAAkB;IASpB,QAAQ,CACZ,OAAO,EAAE,UAAU,EACnB,OAAO,GAAE;QACP,SAAS,EAAE,OAAO,CAAC;QACnB,qBAAqB,EAAE,OAAO,CAAC;KAIhC,GACA,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IA0BpC,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAChD,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,gBAAgB,CAAC,GACjD,OAAO,CAAC,aAAa,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IAgBrD,mBAAmB,CACjB,MAAM,EACN,KAAK,EACL,KAAK,SAAS,QAAQ,EACtB,iBAAiB,SAAS,6BAA6B,EAEvD,YAAY,EAAE,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,CAAC,GAClE,6BAA6B,CAAC,MAAM,EAAE,KAAK,EAAE,iBAAiB,CAAC;IAqBlE,KAAK;IAML,eAAe,CAAC,OAAO,EAAE,OAAO;CAOjC"}
@@ -1,4 +1,4 @@
1
- import { type DmkError } from "../../../../src/api/Error";
1
+ import { type DmkError } from "../../../api/Error";
2
2
  export declare class FramerOverflowError implements DmkError {
3
3
  readonly _tag = "FramerOverflowError";
4
4
  originalError?: Error;
@@ -24,9 +24,4 @@ export declare class DeviceSessionRefresherError implements DmkError {
24
24
  originalError?: Error;
25
25
  constructor(originalError?: Error);
26
26
  }
27
- export declare class DeviceBusyError implements DmkError {
28
- readonly _tag = "DeviceBusyError";
29
- originalError?: Error;
30
- constructor(originalError?: Error);
31
- }
32
27
  //# sourceMappingURL=Errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/device-session/model/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,qBAAa,mBAAoB,YAAW,QAAQ;IAClD,QAAQ,CAAC,IAAI,yBAAyB;IACtC,aAAa,CAAC,EAAE,KAAK,CAAC;;CAMvB;AAED,qBAAa,eAAgB,YAAW,QAAQ;IAC9C,QAAQ,CAAC,IAAI,qBAAqB;IAClC,aAAa,CAAC,EAAE,KAAK,CAAC;;CAKvB;AAED,qBAAa,iBAAkB,YAAW,QAAQ;IAChD,QAAQ,CAAC,IAAI,uBAAuB;IACpC,aAAa,EAAE,KAAK,CAAC;gBAET,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,qBAAa,qBAAsB,YAAW,QAAQ;IACpD,QAAQ,CAAC,IAAI,2BAA2B;IACxC,aAAa,CAAC,EAAE,KAAK,CAAC;gBAEV,aAAa,CAAC,EAAE,KAAK;CAGlC;AAED,qBAAa,2BAA4B,YAAW,QAAQ;IAC1D,QAAQ,CAAC,IAAI,iCAAiC;IAC9C,aAAa,CAAC,EAAE,KAAK,CAAC;gBAEV,aAAa,CAAC,EAAE,KAAK;CAIlC;AAED,qBAAa,eAAgB,YAAW,QAAQ;IAC9C,QAAQ,CAAC,IAAI,qBAAqB;IAClC,aAAa,CAAC,EAAE,KAAK,CAAC;gBAEV,aAAa,CAAC,EAAE,KAAK;CAIlC"}
1
+ {"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../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