@ledgerhq/device-management-kit 0.12.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/lib/cjs/package.json +1 -1
  2. package/lib/cjs/src/api/DeviceManagementKit.js +1 -1
  3. package/lib/cjs/src/api/DeviceManagementKit.js.map +3 -3
  4. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js +1 -1
  5. package/lib/cjs/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  6. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js +1 -1
  7. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.js.map +3 -3
  8. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js +1 -1
  9. package/lib/cjs/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +3 -3
  10. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  11. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +3 -3
  12. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  13. package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +3 -3
  14. package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
  15. package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +3 -3
  16. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js +1 -1
  17. package/lib/cjs/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  18. package/lib/cjs/src/api/index.js +1 -1
  19. package/lib/cjs/src/api/index.js.map +3 -3
  20. package/lib/cjs/src/api/utils/apduLogs.js +2 -0
  21. package/lib/cjs/src/api/utils/apduLogs.js.map +7 -0
  22. package/lib/cjs/src/api/utils/apduLogs.test.js +2 -0
  23. package/lib/cjs/src/api/utils/apduLogs.test.js.map +7 -0
  24. package/lib/cjs/src/internal/device-session/model/DeviceSession.js +1 -1
  25. package/lib/cjs/src/internal/device-session/model/DeviceSession.js.map +3 -3
  26. package/lib/esm/package.json +1 -1
  27. package/lib/esm/src/api/DeviceManagementKit.js +1 -1
  28. package/lib/esm/src/api/DeviceManagementKit.js.map +3 -3
  29. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js +1 -1
  30. package/lib/esm/src/api/device-action/model/UserInteractionRequired.js.map +2 -2
  31. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js +1 -1
  32. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.js.map +3 -3
  33. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js +1 -1
  34. package/lib/esm/src/api/device-action/task/PredictOutOfMemoryTask.test.js.map +3 -3
  35. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
  36. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +3 -3
  37. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
  38. package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +3 -3
  39. package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
  40. package/lib/esm/src/api/device-model/model/DeviceModel.js.map +3 -3
  41. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js +1 -1
  42. package/lib/esm/src/api/device-model/model/DeviceModel.stub.js.map +2 -2
  43. package/lib/esm/src/api/index.js +1 -1
  44. package/lib/esm/src/api/index.js.map +3 -3
  45. package/lib/esm/src/api/utils/apduLogs.js +2 -0
  46. package/lib/esm/src/api/utils/apduLogs.js.map +7 -0
  47. package/lib/esm/src/api/utils/apduLogs.test.js +2 -0
  48. package/lib/esm/src/api/utils/apduLogs.test.js.map +7 -0
  49. package/lib/esm/src/internal/device-session/model/DeviceSession.js +1 -1
  50. package/lib/esm/src/internal/device-session/model/DeviceSession.js.map +3 -3
  51. package/lib/types/src/api/DeviceManagementKit.d.ts +6 -2
  52. package/lib/types/src/api/DeviceManagementKit.d.ts.map +1 -1
  53. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts +2 -1
  54. package/lib/types/src/api/device-action/model/UserInteractionRequired.d.ts.map +1 -1
  55. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts +4 -3
  56. package/lib/types/src/api/device-action/task/PredictOutOfMemoryTask.d.ts.map +1 -1
  57. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts +3 -0
  58. package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
  59. package/lib/types/src/api/device-model/model/DeviceModel.d.ts +44 -20
  60. package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
  61. package/lib/types/src/api/device-model/model/DeviceModel.stub.d.ts.map +1 -1
  62. package/lib/types/src/api/index.d.ts +1 -0
  63. package/lib/types/src/api/index.d.ts.map +1 -1
  64. package/lib/types/src/api/utils/apduLogs.d.ts +17 -0
  65. package/lib/types/src/api/utils/apduLogs.d.ts.map +1 -0
  66. package/lib/types/src/api/utils/apduLogs.test.d.ts +2 -0
  67. package/lib/types/src/api/utils/apduLogs.test.d.ts.map +1 -0
  68. package/lib/types/src/internal/device-session/model/DeviceSession.d.ts.map +1 -1
  69. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  70. package/package.json +4 -4
  71. package/lib/cjs/src/api/device-model/model/DeviceModel.test.js +0 -2
  72. package/lib/cjs/src/api/device-model/model/DeviceModel.test.js.map +0 -7
  73. package/lib/esm/src/api/device-model/model/DeviceModel.test.js +0 -2
  74. package/lib/esm/src/api/device-model/model/DeviceModel.test.js.map +0 -7
  75. package/lib/types/src/api/device-model/model/DeviceModel.test.d.ts +0 -2
  76. package/lib/types/src/api/device-model/model/DeviceModel.test.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-model/data/StaticDeviceModelDataSource.ts"],
4
- "sourcesContent": ["import { injectable } from \"inversify\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceModelDataSource } from \"@api/device-model/data/DeviceModelDataSource\";\nimport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nimport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\n/**\n * Static/in memory implementation of the device model data source\n */\n@injectable()\nexport class StaticDeviceModelDataSource implements DeviceModelDataSource {\n private static deviceModelByIds: {\n [_key in DeviceModelId]: TransportDeviceModel;\n } = {\n [DeviceModelId.NANO_S]: new TransportDeviceModel({\n id: DeviceModelId.NANO_S,\n productName: \"Ledger Nano S\",\n usbProductId: 0x10,\n bootloaderUsbProductId: 0x0001,\n usbOnly: true,\n memorySize: 320 * 1024,\n blockSize: 4 * 1024,\n masks: [0x31100000],\n }),\n [DeviceModelId.NANO_SP]: new TransportDeviceModel({\n id: DeviceModelId.NANO_SP,\n productName: \"Ledger Nano S Plus\",\n usbProductId: 0x50,\n bootloaderUsbProductId: 0x0005,\n usbOnly: true,\n memorySize: 1533 * 1024,\n blockSize: 32,\n masks: [0x33100000],\n }),\n [DeviceModelId.NANO_X]: new TransportDeviceModel({\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n blockSize: 4 * 1024,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.STAX]: new TransportDeviceModel({\n id: DeviceModelId.STAX,\n productName: \"Ledger Stax\",\n usbProductId: 0x60,\n bootloaderUsbProductId: 0x0006,\n usbOnly: false,\n memorySize: 1533 * 1024,\n blockSize: 32,\n masks: [0x33200000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-6004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-6004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-6004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-6004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.FLEX]: new TransportDeviceModel({\n id: DeviceModelId.FLEX,\n productName: \"Ledger Flex\",\n usbProductId: 0x70,\n bootloaderUsbProductId: 0x0007,\n usbOnly: false,\n memorySize: 1533 * 1024,\n blockSize: 32,\n masks: [0x33300000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-3004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-3004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-3004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-3004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.APEX]: new TransportDeviceModel({\n id: DeviceModelId.APEX,\n productName: \"Ledger Apex\",\n usbProductId: 0x80,\n bootloaderUsbProductId: 0x0008,\n usbOnly: false,\n memorySize: 1533 * 1024,\n blockSize: 32,\n masks: [0x33400000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-8004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-8004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-8004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-8004-0003-4c6564676572\",\n },\n ],\n }),\n };\n\n getAllDeviceModels(): TransportDeviceModel[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds);\n }\n\n getDeviceModel(params: { id: DeviceModelId }): TransportDeviceModel {\n return StaticDeviceModelDataSource.deviceModelByIds[params.id];\n }\n\n /**\n * Returns the list of device models that match all the given parameters\n */\n filterDeviceModels(\n params: Partial<TransportDeviceModel>,\n ): TransportDeviceModel[] {\n return this.getAllDeviceModels().filter((deviceModel) => {\n return Object.entries(params).every(([key, value]) => {\n return deviceModel[key as keyof TransportDeviceModel] === value;\n });\n });\n }\n\n getBluetoothServicesInfos(): Record<string, BleDeviceInfos> {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds).reduce<\n Record<string, BleDeviceInfos>\n >((acc, deviceModel) => {\n const { bluetoothSpec } = deviceModel;\n if (bluetoothSpec) {\n return {\n ...acc,\n ...bluetoothSpec.reduce<Record<string, BleDeviceInfos>>(\n (serviceToModel, bleSpec) => ({\n ...serviceToModel,\n [bleSpec.serviceUuid]: new BleDeviceInfos(\n deviceModel,\n bleSpec.serviceUuid,\n bleSpec.writeUuid,\n bleSpec.writeCmdUuid,\n bleSpec.notifyUuid,\n ),\n }),\n {},\n ),\n };\n }\n return acc;\n }, {});\n }\n\n getBluetoothServices(): string[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds)\n .map((deviceModel) =>\n (deviceModel.bluetoothSpec || []).map((spec) => spec.serviceUuid),\n )\n .flat()\n .filter((uuid) => !!uuid);\n }\n}\n"],
5
- "mappings": "gVAAA,OAAS,cAAAA,MAAkB,YAE3B,OAAS,iBAAAC,MAAqB,0BAE9B,OAAS,kBAAAC,MAAsB,yCAC/B,OAAS,wBAAAC,MAA4B,sCAM9B,IAAMC,EAAN,KAAmE,CAkGxE,oBAA6C,CAC3C,OAAO,OAAO,OAAOA,EAA4B,gBAAgB,CACnE,CAEA,eAAeC,EAAqD,CAClE,OAAOD,EAA4B,iBAAiBC,EAAO,EAAE,CAC/D,CAKA,mBACEA,EACwB,CACxB,OAAO,KAAK,mBAAmB,EAAE,OAAQC,GAChC,OAAO,QAAQD,CAAM,EAAE,MAAM,CAAC,CAACE,EAAKC,CAAK,IACvCF,EAAYC,CAAiC,IAAMC,CAC3D,CACF,CACH,CAEA,2BAA4D,CAC1D,OAAO,OAAO,OAAOJ,EAA4B,gBAAgB,EAAE,OAEjE,CAACK,EAAKH,IAAgB,CACtB,KAAM,CAAE,cAAAI,CAAc,EAAIJ,EAC1B,OAAII,EACK,CACL,GAAGD,EACH,GAAGC,EAAc,OACf,CA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WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,cACb,aAAc,IACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,UAAW,GACX,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,cACb,aAAc,IACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,UAAW,GACX,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,CACH,GAhGWb,EAANe,EAAA,CADNC,EAAW,GACChB",
6
- "names": ["injectable", "DeviceModelId", "BleDeviceInfos", "TransportDeviceModel", "StaticDeviceModelDataSource", "params", "deviceModel", "key", "value", "acc", "bluetoothSpec", "serviceToModel", "bleSpec", "BleDeviceInfos", "spec", "uuid", "__publicField", "DeviceModelId", "TransportDeviceModel", "__decorateClass", "injectable"]
4
+ "sourcesContent": ["import { injectable } from \"inversify\";\nimport semver from \"semver\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceModelDataSource } from \"@api/device-model/data/DeviceModelDataSource\";\nimport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nimport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\n/**\n * Static/in memory implementation of the device model data source\n */\n@injectable()\nexport class StaticDeviceModelDataSource implements DeviceModelDataSource {\n private static deviceModelByIds: {\n [_key in DeviceModelId]: TransportDeviceModel;\n } = {\n [DeviceModelId.NANO_S]: new TransportDeviceModel({\n id: DeviceModelId.NANO_S,\n productName: \"Ledger Nano S\",\n usbProductId: 0x10,\n bootloaderUsbProductId: 0x0001,\n usbOnly: true,\n memorySize: 320 * 1024,\n getBlockSize: (p: { firmwareVersion: string }) =>\n semver.lt(semver.coerce(p.firmwareVersion) ?? \"\", \"2.0.0\")\n ? 4 * 1024\n : 2 * 1024,\n masks: [0x31100000],\n }),\n [DeviceModelId.NANO_SP]: new TransportDeviceModel({\n id: DeviceModelId.NANO_SP,\n productName: \"Ledger Nano S Plus\",\n usbProductId: 0x50,\n bootloaderUsbProductId: 0x0005,\n usbOnly: true,\n memorySize: 1533 * 1024,\n getBlockSize: () => 32,\n masks: [0x33100000],\n }),\n [DeviceModelId.NANO_X]: new TransportDeviceModel({\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n getBlockSize: () => 4 * 1024,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.STAX]: new TransportDeviceModel({\n id: DeviceModelId.STAX,\n productName: \"Ledger Stax\",\n usbProductId: 0x60,\n bootloaderUsbProductId: 0x0006,\n usbOnly: false,\n memorySize: 1533 * 1024,\n getBlockSize: () => 32,\n masks: [0x33200000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-6004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-6004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-6004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-6004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.FLEX]: new TransportDeviceModel({\n id: DeviceModelId.FLEX,\n productName: \"Ledger Flex\",\n usbProductId: 0x70,\n bootloaderUsbProductId: 0x0007,\n usbOnly: false,\n memorySize: 1533 * 1024,\n getBlockSize: () => 32,\n masks: [0x33300000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-3004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-3004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-3004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-3004-0003-4c6564676572\",\n },\n ],\n }),\n [DeviceModelId.APEX]: new TransportDeviceModel({\n id: DeviceModelId.APEX,\n productName: \"Ledger\u00A0Nano\u00A0Gen5\",\n usbProductId: 0x80,\n bootloaderUsbProductId: 0x0008,\n usbOnly: false,\n memorySize: 1533 * 1024,\n getBlockSize: () => 32,\n masks: [0x33400000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-8004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-8004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-8004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-8004-0003-4c6564676572\",\n },\n {\n serviceUuid: \"13d63400-2c97-9004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-9004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-9004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-9004-0003-4c6564676572\",\n },\n ],\n }),\n };\n\n getAllDeviceModels(): TransportDeviceModel[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds);\n }\n\n getDeviceModel(params: { id: DeviceModelId }): TransportDeviceModel {\n return StaticDeviceModelDataSource.deviceModelByIds[params.id];\n }\n\n /**\n * Returns the list of device models that match all the given parameters\n */\n filterDeviceModels(\n params: Partial<TransportDeviceModel>,\n ): TransportDeviceModel[] {\n return this.getAllDeviceModels().filter((deviceModel) => {\n return Object.entries(params).every(([key, value]) => {\n return deviceModel[key as keyof TransportDeviceModel] === value;\n });\n });\n }\n\n /**\n * @returns A record of service UUIDs to BleDeviceInfos\n */\n getBluetoothServicesInfos(): Record<string, BleDeviceInfos> {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds).reduce<\n Record<string, BleDeviceInfos>\n >((acc, deviceModel) => {\n const { bluetoothSpec } = deviceModel;\n if (bluetoothSpec) {\n return {\n ...acc,\n ...bluetoothSpec.reduce<Record<string, BleDeviceInfos>>(\n (serviceToModel, bleSpec) => ({\n ...serviceToModel,\n [bleSpec.serviceUuid]: new BleDeviceInfos(\n deviceModel,\n bleSpec.serviceUuid,\n bleSpec.writeUuid,\n bleSpec.writeCmdUuid,\n bleSpec.notifyUuid,\n ),\n }),\n {},\n ),\n };\n }\n return acc;\n }, {});\n }\n\n getBluetoothServices(): string[] {\n return Object.values(StaticDeviceModelDataSource.deviceModelByIds)\n .map((deviceModel) =>\n (deviceModel.bluetoothSpec || []).map((spec) => spec.serviceUuid),\n )\n .flat()\n .filter((uuid) => !!uuid);\n }\n}\n"],
5
+ "mappings": "gVAAA,OAAS,cAAAA,MAAkB,YAC3B,OAAOC,MAAY,SAEnB,OAAS,iBAAAC,MAAqB,0BAE9B,OAAS,kBAAAC,MAAsB,yCAC/B,OAAS,wBAAAC,MAA4B,sCAM9B,IAAMC,EAAN,KAAmE,CA2GxE,oBAA6C,CAC3C,OAAO,OAAO,OAAOA,EAA4B,gBAAgB,CACnE,CAEA,eAAeC,EAAqD,CAClE,OAAOD,EAA4B,iBAAiBC,EAAO,EAAE,CAC/D,CAKA,mBACEA,EACwB,CACxB,OAAO,KAAK,mBAAmB,EAAE,OAAQC,GAChC,OAAO,QAAQD,CAAM,EAAE,MAAM,CAAC,CAACE,EAAKC,CAAK,IACvCF,EAAYC,CAAiC,IAAMC,CAC3D,CACF,CACH,CAKA,2BAA4D,CAC1D,OAAO,OAAO,OAAOJ,EAA4B,gBAAgB,EAAE,OAEjE,CAACK,EAAKH,IAAgB,CACtB,KAAM,CAAE,cAAAI,CAAc,EAAIJ,EAC1B,OAAII,EACK,CACL,GAAGD,EACH,GAAGC,EAAc,OACf,C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ACxB,QAAS,GACT,WAAY,KAAO,KACnB,aAAc,IAAM,GACpB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,cACb,aAAc,IACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,aAAc,IAAM,GACpB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,EACD,CAACA,EAAc,IAAI,EAAG,IAAIC,EAAqB,CAC7C,GAAID,EAAc,KAClB,YAAa,yBACb,aAAc,IACd,uBAAwB,EACxB,QAAS,GACT,WAAY,KAAO,KACnB,aAAc,IAAM,GACpB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,EACA,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,CACF,CAAC,CACH,GAzGWb,EAANiB,EAAA,CADNC,EAAW,GACClB",
6
+ "names": ["injectable", "semver", "DeviceModelId", "BleDeviceInfos", "TransportDeviceModel", "StaticDeviceModelDataSource", "params", "deviceModel", "key", "value", "acc", "bluetoothSpec", "serviceToModel", "bleSpec", "BleDeviceInfos", "spec", "uuid", "__publicField", "DeviceModelId", "TransportDeviceModel", "p", "semver", "__decorateClass", "injectable"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{DeviceModelId as e}from"../../device/DeviceModel";import{BleDeviceInfos as a}from"../../device-model/model/BleDeviceInfos";import{StaticDeviceModelDataSource as d}from"./StaticDeviceModelDataSource";describe("StaticDeviceModelDataSource",()=>{describe("getAllDeviceModels",()=>{it("should return all device models",()=>{const c=new d().getAllDeviceModels();expect(c.length).toEqual(6),expect(c).toContainEqual(expect.objectContaining({id:e.APEX})),expect(c).toContainEqual(expect.objectContaining({id:e.NANO_S})),expect(c).toContainEqual(expect.objectContaining({id:e.NANO_SP})),expect(c).toContainEqual(expect.objectContaining({id:e.NANO_X})),expect(c).toContainEqual(expect.objectContaining({id:e.STAX})),expect(c).toContainEqual(expect.objectContaining({id:e.FLEX}))})}),describe("getDeviceModel",()=>{it("should return the associated device model",()=>{const t=new d,c=t.getDeviceModel({id:e.NANO_S});expect(c).toEqual(expect.objectContaining({id:e.NANO_S}));const o=t.getDeviceModel({id:e.NANO_SP});expect(o).toEqual(expect.objectContaining({id:e.NANO_SP}));const i=t.getDeviceModel({id:e.NANO_X});expect(i).toEqual(expect.objectContaining({id:e.NANO_X}));const n=t.getDeviceModel({id:e.STAX});expect(n).toEqual(expect.objectContaining({id:e.STAX}));const l=t.getDeviceModel({id:e.FLEX});expect(l).toEqual(expect.objectContaining({id:e.FLEX}))})}),describe("filterDeviceModels",()=>{it("should return the device models that match the given single parameter",()=>{const t=new d,c=t.filterDeviceModels({usbOnly:!0});expect(c.length).toEqual(2),expect(c).toContainEqual(expect.objectContaining({id:e.NANO_SP})),expect(c).toContainEqual(expect.objectContaining({id:e.NANO_S}));const o=t.filterDeviceModels({usbProductId:16});expect(o.length).toEqual(1),expect(o[0]).toEqual(expect.objectContaining({id:e.NANO_S}));const i=t.filterDeviceModels({usbProductId:64});expect(i.length).toEqual(1),expect(i[0]).toEqual(expect.objectContaining({id:e.NANO_X}));const n=t.filterDeviceModels({usbProductId:80});expect(n.length).toEqual(1),expect(n[0]).toEqual(expect.objectContaining({id:e.NANO_SP}));const l=t.filterDeviceModels({usbProductId:96});expect(l.length).toEqual(1),expect(l[0]).toEqual(expect.objectContaining({id:e.STAX}));const s=t.filterDeviceModels({usbProductId:0});expect(s.length).toEqual(0)}),it("should return the device models that match the given multiple parameters",()=>{const t=new d,c=t.filterDeviceModels({usbOnly:!1,usbProductId:64});expect(c.length).toEqual(1),expect(c[0]).toEqual(expect.objectContaining({id:e.NANO_X}));const o=t.filterDeviceModels({usbOnly:!0,usbProductId:80});expect(o.length).toEqual(1),expect(o[0]).toEqual(expect.objectContaining({id:e.NANO_SP}));const i=t.filterDeviceModels({usbOnly:!1,usbProductId:16});expect(i.length).toEqual(0)})}),describe("getBluetoothServicesInfos",()=>{it("should return the ble service infos record",()=>{const t=new d,c=t.getBluetoothServicesInfos();expect(c).toStrictEqual({"13d63400-2c97-0004-0000-4c6564676572":new a(t.getDeviceModel({id:e.NANO_X}),"13d63400-2c97-0004-0000-4c6564676572","13d63400-2c97-0004-0002-4c6564676572","13d63400-2c97-0004-0003-4c6564676572","13d63400-2c97-0004-0001-4c6564676572"),"13d63400-2c97-6004-0000-4c6564676572":new a(t.getDeviceModel({id:e.STAX}),"13d63400-2c97-6004-0000-4c6564676572","13d63400-2c97-6004-0002-4c6564676572","13d63400-2c97-6004-0003-4c6564676572","13d63400-2c97-6004-0001-4c6564676572"),"13d63400-2c97-3004-0000-4c6564676572":new a(t.getDeviceModel({id:e.FLEX}),"13d63400-2c97-3004-0000-4c6564676572","13d63400-2c97-3004-0002-4c6564676572","13d63400-2c97-3004-0003-4c6564676572","13d63400-2c97-3004-0001-4c6564676572"),"13d63400-2c97-8004-0000-4c6564676572":new a(t.getDeviceModel({id:e.APEX}),"13d63400-2c97-8004-0000-4c6564676572","13d63400-2c97-8004-0002-4c6564676572","13d63400-2c97-8004-0003-4c6564676572","13d63400-2c97-8004-0001-4c6564676572")})})}),describe("getBluetoothServices",()=>{it("should return the bluetooth services",()=>{const c=new d().getBluetoothServices();expect(c).toStrictEqual(["13d63400-2c97-0004-0000-4c6564676572","13d63400-2c97-6004-0000-4c6564676572","13d63400-2c97-3004-0000-4c6564676572","13d63400-2c97-8004-0000-4c6564676572"])})})});
1
+ import{DeviceModelId as e}from"../../device/DeviceModel";import{BleDeviceInfos as r}from"../../device-model/model/BleDeviceInfos";import{StaticDeviceModelDataSource as n}from"./StaticDeviceModelDataSource";describe("StaticDeviceModelDataSource",()=>{describe("getAllDeviceModels",()=>{it("should return all device models",()=>{const c=new n().getAllDeviceModels();expect(c.length).toEqual(6),expect(c).toContainEqual(expect.objectContaining({id:e.APEX})),expect(c).toContainEqual(expect.objectContaining({id:e.NANO_S})),expect(c).toContainEqual(expect.objectContaining({id:e.NANO_SP})),expect(c).toContainEqual(expect.objectContaining({id:e.NANO_X})),expect(c).toContainEqual(expect.objectContaining({id:e.STAX})),expect(c).toContainEqual(expect.objectContaining({id:e.FLEX}))})}),describe("getDeviceModel",()=>{it("should return the associated device model",()=>{const t=new n,c=t.getDeviceModel({id:e.NANO_S});expect(c).toEqual(expect.objectContaining({id:e.NANO_S}));const o=t.getDeviceModel({id:e.NANO_SP});expect(o).toEqual(expect.objectContaining({id:e.NANO_SP}));const i=t.getDeviceModel({id:e.NANO_X});expect(i).toEqual(expect.objectContaining({id:e.NANO_X}));const d=t.getDeviceModel({id:e.STAX});expect(d).toEqual(expect.objectContaining({id:e.STAX}));const l=t.getDeviceModel({id:e.FLEX});expect(l).toEqual(expect.objectContaining({id:e.FLEX}))})}),describe("filterDeviceModels",()=>{it("should return the device models that match the given single parameter",()=>{const t=new n,c=t.filterDeviceModels({usbOnly:!0});expect(c.length).toEqual(2),expect(c).toContainEqual(expect.objectContaining({id:e.NANO_SP})),expect(c).toContainEqual(expect.objectContaining({id:e.NANO_S}));const o=t.filterDeviceModels({usbProductId:16});expect(o.length).toEqual(1),expect(o[0]).toEqual(expect.objectContaining({id:e.NANO_S}));const i=t.filterDeviceModels({usbProductId:64});expect(i.length).toEqual(1),expect(i[0]).toEqual(expect.objectContaining({id:e.NANO_X}));const d=t.filterDeviceModels({usbProductId:80});expect(d.length).toEqual(1),expect(d[0]).toEqual(expect.objectContaining({id:e.NANO_SP}));const l=t.filterDeviceModels({usbProductId:96});expect(l.length).toEqual(1),expect(l[0]).toEqual(expect.objectContaining({id:e.STAX}));const s=t.filterDeviceModels({usbProductId:0});expect(s.length).toEqual(0)}),it("should return the device models that match the given multiple parameters",()=>{const t=new n,c=t.filterDeviceModels({usbOnly:!1,usbProductId:64});expect(c.length).toEqual(1),expect(c[0]).toEqual(expect.objectContaining({id:e.NANO_X}));const o=t.filterDeviceModels({usbOnly:!0,usbProductId:80});expect(o.length).toEqual(1),expect(o[0]).toEqual(expect.objectContaining({id:e.NANO_SP}));const i=t.filterDeviceModels({usbOnly:!1,usbProductId:16});expect(i.length).toEqual(0)})}),describe("getBluetoothServicesInfos",()=>{it("should return the ble service infos record",()=>{const c=new n,o=c.getBluetoothServicesInfos();expect(o).toStrictEqual({"13d63400-2c97-0004-0000-4c6564676572":new r(c.getDeviceModel({id:e.NANO_X}),"13d63400-2c97-0004-0000-4c6564676572","13d63400-2c97-0004-0002-4c6564676572","13d63400-2c97-0004-0003-4c6564676572","13d63400-2c97-0004-0001-4c6564676572"),"13d63400-2c97-6004-0000-4c6564676572":new r(c.getDeviceModel({id:e.STAX}),"13d63400-2c97-6004-0000-4c6564676572","13d63400-2c97-6004-0002-4c6564676572","13d63400-2c97-6004-0003-4c6564676572","13d63400-2c97-6004-0001-4c6564676572"),"13d63400-2c97-3004-0000-4c6564676572":new r(c.getDeviceModel({id:e.FLEX}),"13d63400-2c97-3004-0000-4c6564676572","13d63400-2c97-3004-0002-4c6564676572","13d63400-2c97-3004-0003-4c6564676572","13d63400-2c97-3004-0001-4c6564676572"),"13d63400-2c97-8004-0000-4c6564676572":new r(c.getDeviceModel({id:e.APEX}),"13d63400-2c97-8004-0000-4c6564676572","13d63400-2c97-8004-0002-4c6564676572","13d63400-2c97-8004-0003-4c6564676572","13d63400-2c97-8004-0001-4c6564676572"),"13d63400-2c97-9004-0000-4c6564676572":new r(c.getDeviceModel({id:e.APEX}),"13d63400-2c97-9004-0000-4c6564676572","13d63400-2c97-9004-0002-4c6564676572","13d63400-2c97-9004-0003-4c6564676572","13d63400-2c97-9004-0001-4c6564676572")})});const t=[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",deviceModel:e.NANO_X},{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",deviceModel:e.STAX},{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",deviceModel:e.FLEX},{serviceUuid:"13d63400-2c97-8004-0000-4c6564676572",deviceModel:e.APEX},{serviceUuid:"13d63400-2c97-9004-0000-4c6564676572",deviceModel:e.APEX}];it.each(t)("should properly map the service UUID $serviceUuid to the device model $deviceModel",({serviceUuid:c,deviceModel:o})=>{const d=new n().getBluetoothServicesInfos();expect(d[c]?.deviceModel.id).toEqual(o)})}),describe("getBluetoothServices",()=>{it("should return the bluetooth services",()=>{const c=new n().getBluetoothServices();expect(c).toStrictEqual(["13d63400-2c97-0004-0000-4c6564676572","13d63400-2c97-6004-0000-4c6564676572","13d63400-2c97-3004-0000-4c6564676572","13d63400-2c97-8004-0000-4c6564676572","13d63400-2c97-9004-0000-4c6564676572"])})}),describe("getBlockSize",()=>{const t={[e.NANO_S]:[{firmwareVersion:"1.0.0",expectedBlockSize:4096},{firmwareVersion:"1.0.0-rc1",expectedBlockSize:4096},{firmwareVersion:"2.0.0",expectedBlockSize:2048},{firmwareVersion:"2.0.0-rc1",expectedBlockSize:2048}],[e.NANO_SP]:[{firmwareVersion:"1.0.0",expectedBlockSize:32}],[e.NANO_X]:[{firmwareVersion:"1.0.0",expectedBlockSize:4096}],[e.STAX]:[{firmwareVersion:"1.0.0",expectedBlockSize:32}],[e.FLEX]:[{firmwareVersion:"1.0.0",expectedBlockSize:32}],[e.APEX]:[{firmwareVersion:"1.0.0",expectedBlockSize:32}]};describe.each(Object.entries(t))("Device Model: %s",(c,o)=>{it.each(o)("should return $expectedBlockSize for firmware version $firmwareVersion",({firmwareVersion:i,expectedBlockSize:d})=>{const l=new n().getDeviceModel({id:c});expect(l.getBlockSize({firmwareVersion:i})).toBe(d)})})})});
2
2
  //# sourceMappingURL=StaticDeviceModelDataSource.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-model/data/StaticDeviceModelDataSource.test.ts"],
4
- "sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\n\nimport { StaticDeviceModelDataSource } from \"./StaticDeviceModelDataSource\";\n\ndescribe(\"StaticDeviceModelDataSource\", () => {\n describe(\"getAllDeviceModels\", () => {\n it(\"should return all device models\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n const deviceModels = dataSource.getAllDeviceModels();\n\n expect(deviceModels.length).toEqual(6);\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.APEX }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.STAX }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.FLEX }),\n );\n });\n });\n\n describe(\"getDeviceModel\", () => {\n it(\"should return the associated device model\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n\n const deviceModel1 = dataSource.getDeviceModel({\n id: DeviceModelId.NANO_S,\n });\n expect(deviceModel1).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n\n const deviceModel2 = dataSource.getDeviceModel({\n id: DeviceModelId.NANO_SP,\n });\n expect(deviceModel2).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n\n const deviceModel3 = dataSource.getDeviceModel({\n id: DeviceModelId.NANO_X,\n });\n expect(deviceModel3).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n\n const deviceModel4 = dataSource.getDeviceModel({\n id: DeviceModelId.STAX,\n });\n expect(deviceModel4).toEqual(\n expect.objectContaining({ id: DeviceModelId.STAX }),\n );\n\n const deviceModel5 = dataSource.getDeviceModel({\n id: DeviceModelId.FLEX,\n });\n expect(deviceModel5).toEqual(\n expect.objectContaining({ id: DeviceModelId.FLEX }),\n );\n });\n });\n\n describe(\"filterDeviceModels\", () => {\n it(\"should return the device models that match the given single parameter\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n\n const deviceModels1 = dataSource.filterDeviceModels({ usbOnly: true });\n expect(deviceModels1.length).toEqual(2);\n expect(deviceModels1).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n expect(deviceModels1).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n\n const deviceModels2 = dataSource.filterDeviceModels({\n usbProductId: 0x10,\n });\n expect(deviceModels2.length).toEqual(1);\n expect(deviceModels2[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n\n const deviceModels3 = dataSource.filterDeviceModels({\n usbProductId: 0x40,\n });\n expect(deviceModels3.length).toEqual(1);\n expect(deviceModels3[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n\n const deviceModels4 = dataSource.filterDeviceModels({\n usbProductId: 0x50,\n });\n expect(deviceModels4.length).toEqual(1);\n expect(deviceModels4[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n\n const deviceModels5 = dataSource.filterDeviceModels({\n usbProductId: 0x60,\n });\n expect(deviceModels5.length).toEqual(1);\n expect(deviceModels5[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.STAX }),\n );\n\n const deviceModels6 = dataSource.filterDeviceModels({\n usbProductId: 0x00,\n });\n expect(deviceModels6.length).toEqual(0);\n });\n\n it(\"should return the device models that match the given multiple parameters\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n\n const deviceModels1 = dataSource.filterDeviceModels({\n usbOnly: false,\n usbProductId: 0x40,\n });\n expect(deviceModels1.length).toEqual(1);\n expect(deviceModels1[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n\n const deviceModels2 = dataSource.filterDeviceModels({\n usbOnly: true,\n usbProductId: 0x50,\n });\n expect(deviceModels2.length).toEqual(1);\n expect(deviceModels2[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n\n // Nano S is usbOnly\n const deviceModels3 = dataSource.filterDeviceModels({\n usbOnly: false,\n usbProductId: 0x10,\n });\n expect(deviceModels3.length).toEqual(0);\n });\n });\n describe(\"getBluetoothServicesInfos\", () => {\n it(\"should return the ble service infos record\", () => {\n // given\n const dataSource = new StaticDeviceModelDataSource();\n // when\n const bleServiceInfos = dataSource.getBluetoothServicesInfos();\n // then\n expect(bleServiceInfos).toStrictEqual({\n \"13d63400-2c97-0004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.NANO_X }),\n \"13d63400-2c97-0004-0000-4c6564676572\",\n \"13d63400-2c97-0004-0002-4c6564676572\",\n \"13d63400-2c97-0004-0003-4c6564676572\",\n \"13d63400-2c97-0004-0001-4c6564676572\",\n ),\n \"13d63400-2c97-6004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.STAX }),\n \"13d63400-2c97-6004-0000-4c6564676572\",\n \"13d63400-2c97-6004-0002-4c6564676572\",\n \"13d63400-2c97-6004-0003-4c6564676572\",\n \"13d63400-2c97-6004-0001-4c6564676572\",\n ),\n \"13d63400-2c97-3004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.FLEX }),\n \"13d63400-2c97-3004-0000-4c6564676572\",\n \"13d63400-2c97-3004-0002-4c6564676572\",\n \"13d63400-2c97-3004-0003-4c6564676572\",\n \"13d63400-2c97-3004-0001-4c6564676572\",\n ),\n \"13d63400-2c97-8004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.APEX }),\n \"13d63400-2c97-8004-0000-4c6564676572\",\n \"13d63400-2c97-8004-0002-4c6564676572\",\n \"13d63400-2c97-8004-0003-4c6564676572\",\n \"13d63400-2c97-8004-0001-4c6564676572\",\n ),\n });\n });\n });\n describe(\"getBluetoothServices\", () => {\n it(\"should return the bluetooth services\", () => {\n // given\n const dataSource = new StaticDeviceModelDataSource();\n // when\n const bleServices = dataSource.getBluetoothServices();\n // then\n expect(bleServices).toStrictEqual([\n \"13d63400-2c97-0004-0000-4c6564676572\",\n \"13d63400-2c97-6004-0000-4c6564676572\",\n \"13d63400-2c97-3004-0000-4c6564676572\",\n \"13d63400-2c97-8004-0000-4c6564676572\",\n ]);\n });\n });\n});\n"],
5
- "mappings": "AAAA,OAAS,iBAAAA,MAAqB,0BAC9B,OAAS,kBAAAC,MAAsB,yCAE/B,OAAS,+BAAAC,MAAmC,gCAE5C,SAAS,8BAA+B,IAAM,CAC5C,SAAS,qBAAsB,IAAM,CACnC,GAAG,kCAAmC,IAAM,CAE1C,MAAMC,EADa,IAAID,EAA4B,EACnB,mBAAmB,EAEnD,OAAOC,EAAa,MAAM,EAAE,QAAQ,CAAC,EACrC,OAAOA,CAAY,EAAE,eACnB,OAAO,iBAAiB,CAAE,GAAIH,EAAc,IAAK,CAAC,CACpD,EACA,OAAOG,CAAY,EAAE,eACnB,OAAO,iBAAiB,CAAE,GAAIH,EAAc,MAAO,CAAC,CACtD,EACA,OAAOG,CAAY,EAAE,eACnB,OAAO,iBAAiB,CAAE,GAAIH,EAAc,OAAQ,CAAC,CACvD,EACA,OAAOG,CAAY,EAAE,eACnB,OAAO,iBAAiB,CAAE,GAAIH,EAAc,MAAO,CAAC,CACtD,EACA,OAAOG,CAAY,EAAE,eACnB,OAAO,iBAAiB,CAAE,GAAIH,EAAc,IAAK,CAAC,CACpD,EACA,OAAOG,CAAY,EAAE,eACnB,OAAO,iBAAiB,CAAE,GAAIH,EAAc,IAAK,CAAC,CACpD,CACF,CAAC,CACH,CAAC,EAED,SAAS,iBAAkB,IAAM,CAC/B,GAAG,4CAA6C,IAAM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AO,iBAAiB,CAAE,GAAIX,EAAc,OAAQ,CAAC,CACvD,EAGA,MAAMY,EAAgBR,EAAW,mBAAmB,CAClD,QAAS,GACT,aAAc,EAChB,CAAC,EACD,OAAOQ,EAAc,MAAM,EAAE,QAAQ,CAAC,CACxC,CAAC,CACH,CAAC,EACD,SAAS,4BAA6B,IAAM,CAC1C,GAAG,6CAA8C,IAAM,CAErD,MAAMR,EAAa,IAAIF,EAEjBc,EAAkBZ,EAAW,0BAA0B,EAE7D,OAAOY,CAAe,EAAE,cAAc,CACpC,uCAAwC,IAAIf,EAC1CG,EAAW,eAAe,CAAE,GAAIJ,EAAc,MAAO,CAAC,EACtD,uCACA,uCACA,uCACA,sCACF,EACA,uCAAwC,IAAIC,EAC1CG,EAAW,eAAe,CAAE,GAAIJ,EAAc,IAAK,CAAC,EACpD,uCACA,uCACA,uCACA,sCACF,EACA,uCAAwC,IAAIC,EAC1CG,EAAW,eAAe,CAAE,GAAIJ,EAAc,IAAK,CAAC,EACpD,uCACA,uCACA,uCACA,sCACF,EACA,uCAAwC,IAAIC,EAC1CG,EAAW,eAAe,CAAE,GAAIJ,EAAc,IAAK,CAAC,EACpD,uCACA,uCACA,uCACA,sCACF,CACF,CAAC,CACH,CAAC,CACH,CAAC,EACD,SAAS,uBAAwB,IAAM,CACrC,GAAG,uCAAwC,IAAM,CAI/C,MAAMiB,EAFa,IAAIf,EAA4B,EAEpB,qBAAqB,EAEpD,OAAOe,CAAW,EAAE,cAAc,CAChC,uCACA,uCACA,uCACA,sCACF,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["DeviceModelId", "BleDeviceInfos", "StaticDeviceModelDataSource", "deviceModels", "dataSource", "deviceModel1", "deviceModel2", "deviceModel3", "deviceModel4", "deviceModel5", "deviceModels1", "deviceModels2", "deviceModels3", "deviceModels4", "deviceModels5", "deviceModels6", "bleServiceInfos", "bleServices"]
4
+ "sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\n\nimport { StaticDeviceModelDataSource } from \"./StaticDeviceModelDataSource\";\n\ndescribe(\"StaticDeviceModelDataSource\", () => {\n describe(\"getAllDeviceModels\", () => {\n it(\"should return all device models\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n const deviceModels = dataSource.getAllDeviceModels();\n\n expect(deviceModels.length).toEqual(6);\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.APEX }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.STAX }),\n );\n expect(deviceModels).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.FLEX }),\n );\n });\n });\n\n describe(\"getDeviceModel\", () => {\n it(\"should return the associated device model\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n\n const deviceModel1 = dataSource.getDeviceModel({\n id: DeviceModelId.NANO_S,\n });\n expect(deviceModel1).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n\n const deviceModel2 = dataSource.getDeviceModel({\n id: DeviceModelId.NANO_SP,\n });\n expect(deviceModel2).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n\n const deviceModel3 = dataSource.getDeviceModel({\n id: DeviceModelId.NANO_X,\n });\n expect(deviceModel3).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n\n const deviceModel4 = dataSource.getDeviceModel({\n id: DeviceModelId.STAX,\n });\n expect(deviceModel4).toEqual(\n expect.objectContaining({ id: DeviceModelId.STAX }),\n );\n\n const deviceModel5 = dataSource.getDeviceModel({\n id: DeviceModelId.FLEX,\n });\n expect(deviceModel5).toEqual(\n expect.objectContaining({ id: DeviceModelId.FLEX }),\n );\n });\n });\n\n describe(\"filterDeviceModels\", () => {\n it(\"should return the device models that match the given single parameter\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n\n const deviceModels1 = dataSource.filterDeviceModels({ usbOnly: true });\n expect(deviceModels1.length).toEqual(2);\n expect(deviceModels1).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n expect(deviceModels1).toContainEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n\n const deviceModels2 = dataSource.filterDeviceModels({\n usbProductId: 0x10,\n });\n expect(deviceModels2.length).toEqual(1);\n expect(deviceModels2[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_S }),\n );\n\n const deviceModels3 = dataSource.filterDeviceModels({\n usbProductId: 0x40,\n });\n expect(deviceModels3.length).toEqual(1);\n expect(deviceModels3[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n\n const deviceModels4 = dataSource.filterDeviceModels({\n usbProductId: 0x50,\n });\n expect(deviceModels4.length).toEqual(1);\n expect(deviceModels4[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n\n const deviceModels5 = dataSource.filterDeviceModels({\n usbProductId: 0x60,\n });\n expect(deviceModels5.length).toEqual(1);\n expect(deviceModels5[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.STAX }),\n );\n\n const deviceModels6 = dataSource.filterDeviceModels({\n usbProductId: 0x00,\n });\n expect(deviceModels6.length).toEqual(0);\n });\n\n it(\"should return the device models that match the given multiple parameters\", () => {\n const dataSource = new StaticDeviceModelDataSource();\n\n const deviceModels1 = dataSource.filterDeviceModels({\n usbOnly: false,\n usbProductId: 0x40,\n });\n expect(deviceModels1.length).toEqual(1);\n expect(deviceModels1[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_X }),\n );\n\n const deviceModels2 = dataSource.filterDeviceModels({\n usbOnly: true,\n usbProductId: 0x50,\n });\n expect(deviceModels2.length).toEqual(1);\n expect(deviceModels2[0]).toEqual(\n expect.objectContaining({ id: DeviceModelId.NANO_SP }),\n );\n\n // Nano S is usbOnly\n const deviceModels3 = dataSource.filterDeviceModels({\n usbOnly: false,\n usbProductId: 0x10,\n });\n expect(deviceModels3.length).toEqual(0);\n });\n });\n describe(\"getBluetoothServicesInfos\", () => {\n it(\"should return the ble service infos record\", () => {\n // given\n const dataSource = new StaticDeviceModelDataSource();\n // when\n const bleServiceInfos = dataSource.getBluetoothServicesInfos();\n // then\n expect(bleServiceInfos).toStrictEqual({\n \"13d63400-2c97-0004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.NANO_X }),\n \"13d63400-2c97-0004-0000-4c6564676572\",\n \"13d63400-2c97-0004-0002-4c6564676572\",\n \"13d63400-2c97-0004-0003-4c6564676572\",\n \"13d63400-2c97-0004-0001-4c6564676572\",\n ),\n \"13d63400-2c97-6004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.STAX }),\n \"13d63400-2c97-6004-0000-4c6564676572\",\n \"13d63400-2c97-6004-0002-4c6564676572\",\n \"13d63400-2c97-6004-0003-4c6564676572\",\n \"13d63400-2c97-6004-0001-4c6564676572\",\n ),\n \"13d63400-2c97-3004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.FLEX }),\n \"13d63400-2c97-3004-0000-4c6564676572\",\n \"13d63400-2c97-3004-0002-4c6564676572\",\n \"13d63400-2c97-3004-0003-4c6564676572\",\n \"13d63400-2c97-3004-0001-4c6564676572\",\n ),\n \"13d63400-2c97-8004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.APEX }),\n \"13d63400-2c97-8004-0000-4c6564676572\",\n \"13d63400-2c97-8004-0002-4c6564676572\",\n \"13d63400-2c97-8004-0003-4c6564676572\",\n \"13d63400-2c97-8004-0001-4c6564676572\",\n ),\n \"13d63400-2c97-9004-0000-4c6564676572\": new BleDeviceInfos(\n dataSource.getDeviceModel({ id: DeviceModelId.APEX }),\n \"13d63400-2c97-9004-0000-4c6564676572\",\n \"13d63400-2c97-9004-0002-4c6564676572\",\n \"13d63400-2c97-9004-0003-4c6564676572\",\n \"13d63400-2c97-9004-0001-4c6564676572\",\n ),\n });\n });\n const expectedMatches = [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n deviceModel: DeviceModelId.NANO_X,\n },\n {\n serviceUuid: \"13d63400-2c97-6004-0000-4c6564676572\",\n deviceModel: DeviceModelId.STAX,\n },\n {\n serviceUuid: \"13d63400-2c97-3004-0000-4c6564676572\",\n deviceModel: DeviceModelId.FLEX,\n },\n {\n serviceUuid: \"13d63400-2c97-8004-0000-4c6564676572\",\n deviceModel: DeviceModelId.APEX,\n },\n {\n serviceUuid: \"13d63400-2c97-9004-0000-4c6564676572\",\n deviceModel: DeviceModelId.APEX,\n },\n ];\n\n it.each(expectedMatches)(\n \"should properly map the service UUID $serviceUuid to the device model $deviceModel\",\n ({ serviceUuid, deviceModel }) => {\n // given\n const dataSource = new StaticDeviceModelDataSource();\n // when\n const bleServiceInfos = dataSource.getBluetoothServicesInfos();\n // then\n expect(bleServiceInfos[serviceUuid]?.deviceModel.id).toEqual(\n deviceModel,\n );\n },\n );\n });\n describe(\"getBluetoothServices\", () => {\n it(\"should return the bluetooth services\", () => {\n // given\n const dataSource = new StaticDeviceModelDataSource();\n // when\n const bleServices = dataSource.getBluetoothServices();\n // then\n expect(bleServices).toStrictEqual([\n \"13d63400-2c97-0004-0000-4c6564676572\",\n \"13d63400-2c97-6004-0000-4c6564676572\",\n \"13d63400-2c97-3004-0000-4c6564676572\",\n \"13d63400-2c97-8004-0000-4c6564676572\",\n \"13d63400-2c97-9004-0000-4c6564676572\",\n ]);\n });\n });\n\n describe(\"getBlockSize\", () => {\n const testData: Record<\n DeviceModelId,\n Array<{ firmwareVersion: string; expectedBlockSize: number }>\n > = {\n [DeviceModelId.NANO_S]: [\n { firmwareVersion: \"1.0.0\", expectedBlockSize: 4 * 1024 },\n { firmwareVersion: \"1.0.0-rc1\", expectedBlockSize: 4 * 1024 },\n { firmwareVersion: \"2.0.0\", expectedBlockSize: 2 * 1024 },\n { firmwareVersion: \"2.0.0-rc1\", expectedBlockSize: 2 * 1024 },\n ],\n [DeviceModelId.NANO_SP]: [\n { firmwareVersion: \"1.0.0\", expectedBlockSize: 32 },\n ],\n [DeviceModelId.NANO_X]: [\n { firmwareVersion: \"1.0.0\", expectedBlockSize: 4 * 1024 },\n ],\n [DeviceModelId.STAX]: [\n { firmwareVersion: \"1.0.0\", expectedBlockSize: 32 },\n ],\n [DeviceModelId.FLEX]: [\n { firmwareVersion: \"1.0.0\", expectedBlockSize: 32 },\n ],\n [DeviceModelId.APEX]: [\n { firmwareVersion: \"1.0.0\", expectedBlockSize: 32 },\n ],\n };\n\n describe.each(Object.entries(testData))(\n \"Device Model: %s\",\n (deviceModelId, scenarios) => {\n it.each(scenarios)(\n \"should return $expectedBlockSize for firmware version $firmwareVersion\",\n ({ firmwareVersion, expectedBlockSize }) => {\n const deviceModel =\n new StaticDeviceModelDataSource().getDeviceModel({\n id: deviceModelId as DeviceModelId,\n });\n expect(deviceModel.getBlockSize({ firmwareVersion })).toBe(\n expectedBlockSize,\n );\n },\n );\n },\n );\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,iBAAAA,MAAqB,0BAC9B,OAAS,kBAAAC,MAAsB,yCAE/B,OAAS,+BAAAC,MAAmC,gCAE5C,SAAS,8BAA+B,IAAM,CAC5C,SAAS,qBAAsB,IAAM,CACnC,GAAG,kCAAmC,IAAM,CAE1C,MAAMC,EADa,IAAID,EAA4B,EACnB,mBAAmB,EAEnD,OAAOC,EAAa,MAAM,EAAE,QAAQ,CAAC,EACrC,OAAOA,CAAY,EAAE,eACnB,OAAO,iBAAiB,CAAE,GAAIH,EAAc,IAAK,CAAC,CACpD,EACA,OAAOG,CAAY,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CACpD,EACA,CAACA,EAAc,IAAI,EAAG,CACpB,CAAE,gBAAiB,QAAS,kBAAmB,EAAG,CACpD,EACA,CAACA,EAAc,IAAI,EAAG,CACpB,CAAE,gBAAiB,QAAS,kBAAmB,EAAG,CACpD,CACF,EAEA,SAAS,KAAK,OAAO,QAAQqB,CAAQ,CAAC,EACpC,mBACA,CAACC,EAAeC,IAAc,CAC5B,GAAG,KAAKA,CAAS,EACf,yEACA,CAAC,CAAE,gBAAAC,EAAiB,kBAAAC,CAAkB,IAAM,CAC1C,MAAMN,EACJ,IAAIjB,EAA4B,EAAE,eAAe,CAC/C,GAAIoB,CACN,CAAC,EACH,OAAOH,EAAY,aAAa,CAAE,gBAAAK,CAAgB,CAAC,CAAC,EAAE,KACpDC,CACF,CACF,CACF,CACF,CACF,CACF,CAAC,CACH,CAAC",
6
+ "names": ["DeviceModelId", "BleDeviceInfos", "StaticDeviceModelDataSource", "deviceModels", "dataSource", "deviceModel1", "deviceModel2", "deviceModel3", "deviceModel4", "deviceModel5", "deviceModels1", "deviceModels2", "deviceModels3", "deviceModels4", "deviceModels5", "deviceModels6", "bleServiceInfos", "expectedMatches", "serviceUuid", "deviceModel", "bleServices", "testData", "deviceModelId", "scenarios", "firmwareVersion", "expectedBlockSize"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import i from"semver";import{DeviceModelId as t}from"../../device/DeviceModel";class u{id;productName;usbProductId;bootloaderUsbProductId;usbOnly;memorySize;blockSize;masks;bluetoothSpec;constructor(e){this.id=e.id,this.productName=e.productName,this.usbProductId=e.usbProductId,this.bootloaderUsbProductId=e.bootloaderUsbProductId,this.usbOnly=e.usbOnly,this.memorySize=e.memorySize,this.blockSize=e.blockSize,this.masks=e.masks,this.bluetoothSpec=e.bluetoothSpec}getBlockSize(e){switch(this.id){case t.NANO_S:return i.lt(i.coerce(e)??"","2.0.0")?4*1024:2*1024;case t.NANO_X:return 4*1024;case t.NANO_SP:case t.STAX:case t.FLEX:case t.APEX:return 32}}}export{u as TransportDeviceModel};
1
+ class i{id;productName;usbProductId;bootloaderUsbProductId;usbOnly;memorySize;getBlockSize;masks;bluetoothSpec;constructor(e){this.id=e.id,this.productName=e.productName,this.usbProductId=e.usbProductId,this.bootloaderUsbProductId=e.bootloaderUsbProductId,this.usbOnly=e.usbOnly,this.memorySize=e.memorySize,this.getBlockSize=e.getBlockSize,this.masks=e.masks,this.bluetoothSpec=e.bluetoothSpec}}export{i as TransportDeviceModel};
2
2
  //# sourceMappingURL=DeviceModel.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-model/model/DeviceModel.ts"],
4
- "sourcesContent": ["import semver from \"semver\";\n\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\n/**\n * The info of a device model\n */\nexport class TransportDeviceModel {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n blockSize: number;\n masks: number[];\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n\n constructor(props: {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n blockSize: number;\n masks: number[];\n\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n }) {\n this.id = props.id;\n this.productName = props.productName;\n this.usbProductId = props.usbProductId;\n this.bootloaderUsbProductId = props.bootloaderUsbProductId;\n this.usbOnly = props.usbOnly;\n this.memorySize = props.memorySize;\n this.blockSize = props.blockSize;\n this.masks = props.masks;\n this.bluetoothSpec = props.bluetoothSpec;\n }\n\n getBlockSize(firmwareVersion: string): number {\n switch (this.id) {\n case DeviceModelId.NANO_S:\n return semver.lt(semver.coerce(firmwareVersion) ?? \"\", \"2.0.0\")\n ? 4 * 1024\n : 2 * 1024;\n case DeviceModelId.NANO_X:\n return 4 * 1024;\n case DeviceModelId.NANO_SP:\n case DeviceModelId.STAX:\n case DeviceModelId.FLEX:\n case DeviceModelId.APEX:\n return 32;\n }\n }\n}\n"],
5
- "mappings": "AAAA,OAAOA,MAAY,SAEnB,OAAS,iBAAAC,MAAqB,0BAKvB,MAAMC,CAAqB,CAChC,GACA,YACA,aACA,uBACA,QACA,WACA,UACA,MACA,cAOA,YAAYC,EAgBT,CACD,KAAK,GAAKA,EAAM,GAChB,KAAK,YAAcA,EAAM,YACzB,KAAK,aAAeA,EAAM,aAC1B,KAAK,uBAAyBA,EAAM,uBACpC,KAAK,QAAUA,EAAM,QACrB,KAAK,WAAaA,EAAM,WACxB,KAAK,UAAYA,EAAM,UACvB,KAAK,MAAQA,EAAM,MACnB,KAAK,cAAgBA,EAAM,aAC7B,CAEA,aAAaC,EAAiC,CAC5C,OAAQ,KAAK,GAAI,CACf,KAAKH,EAAc,OACjB,OAAOD,EAAO,GAAGA,EAAO,OAAOI,CAAe,GAAK,GAAI,OAAO,EAC1D,EAAI,KACJ,EAAI,KACV,KAAKH,EAAc,OACjB,MAAO,GAAI,KACb,KAAKA,EAAc,QACnB,KAAKA,EAAc,KACnB,KAAKA,EAAc,KACnB,KAAKA,EAAc,KACjB,MAAO,GACX,CACF,CACF",
6
- "names": ["semver", "DeviceModelId", "TransportDeviceModel", "props", "firmwareVersion"]
4
+ "sourcesContent": ["import { type DeviceModelId } from \"@api/device/DeviceModel\";\n\ntype DeviceModel = {\n /** Identifier of the device model */\n id: DeviceModelId;\n\n /** Displayed name of the device model */\n productName: string;\n\n /** USB product ID of the device model */\n usbProductId: number;\n\n /** USB product ID of the device model, in bootloader mode */\n bootloaderUsbProductId: number;\n\n /** Whether the device model is only USB-based */\n usbOnly: boolean;\n\n /** Memory size of the device model, in bytes */\n memorySize: number;\n\n /**\n * Function to get the block size of the device model, in bytes\n * Blocks are the smallest units of memory that can be written to the device.\n * The block size can be different for different firmware versions.\n */\n getBlockSize: (p: { firmwareVersion: string }) => number;\n\n /**\n * When applying 0xffff0000 to a device target id (obtained from the getOSVersion command),\n * the result will be one of the masks for the device model.\n */\n masks: number[];\n\n /**\n * Bluetooth specifications for the device model.\n * Only available for devices that support Bluetooth.\n */\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n};\n\n/**\n * The info of a device model\n */\nexport class TransportDeviceModel implements DeviceModel {\n id: DeviceModelId;\n productName: string;\n usbProductId: number;\n bootloaderUsbProductId: number;\n usbOnly: boolean;\n memorySize: number;\n getBlockSize: (p: { firmwareVersion: string }) => number;\n masks: number[];\n bluetoothSpec?: {\n serviceUuid: string;\n writeUuid: string;\n writeCmdUuid: string;\n notifyUuid: string;\n }[];\n\n constructor(props: DeviceModel) {\n this.id = props.id;\n this.productName = props.productName;\n this.usbProductId = props.usbProductId;\n this.bootloaderUsbProductId = props.bootloaderUsbProductId;\n this.usbOnly = props.usbOnly;\n this.memorySize = props.memorySize;\n this.getBlockSize = props.getBlockSize;\n this.masks = props.masks;\n this.bluetoothSpec = props.bluetoothSpec;\n }\n}\n"],
5
+ "mappings": "AAiDO,MAAMA,CAA4C,CACvD,GACA,YACA,aACA,uBACA,QACA,WACA,aACA,MACA,cAOA,YAAYC,EAAoB,CAC9B,KAAK,GAAKA,EAAM,GAChB,KAAK,YAAcA,EAAM,YACzB,KAAK,aAAeA,EAAM,aAC1B,KAAK,uBAAyBA,EAAM,uBACpC,KAAK,QAAUA,EAAM,QACrB,KAAK,WAAaA,EAAM,WACxB,KAAK,aAAeA,EAAM,aAC1B,KAAK,MAAQA,EAAM,MACnB,KAAK,cAAgBA,EAAM,aAC7B,CACF",
6
+ "names": ["TransportDeviceModel", "props"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{DeviceModelId as o}from"../../device/DeviceModel";function r(e={}){return{id:o.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,blockSize:32,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}],getBlockSize:()=>4*1024,...e}}export{r as deviceModelStubBuilder};
1
+ import{DeviceModelId as o}from"../../device/DeviceModel";function r(e={}){return{id:o.NANO_X,productName:"Ledger Nano X",usbProductId:64,bootloaderUsbProductId:4,usbOnly:!1,memorySize:2*1024*1024,getBlockSize:()=>4*1024,masks:[855638016],bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}],...e}}export{r as deviceModelStubBuilder};
2
2
  //# sourceMappingURL=DeviceModel.stub.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/api/device-model/model/DeviceModel.stub.ts"],
4
- "sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\nexport function deviceModelStubBuilder(\n props: Partial<TransportDeviceModel> = {},\n): TransportDeviceModel {\n return {\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n blockSize: 32,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n getBlockSize: () => 4 * 1024,\n ...props,\n };\n}\n"],
5
- "mappings": "AAAA,OAAS,iBAAAA,MAAqB,0BAGvB,SAASC,EACdC,EAAuC,CAAC,EAClB,CACtB,MAAO,CACL,GAAIF,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,EAAI,KAAO,KACvB,UAAW,GACX,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,EACA,aAAc,IAAM,EAAI,KACxB,GAAGE,CACL,CACF",
4
+ "sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\n\nexport function deviceModelStubBuilder(\n props: Partial<TransportDeviceModel> = {},\n): TransportDeviceModel {\n return {\n id: DeviceModelId.NANO_X,\n productName: \"Ledger Nano X\",\n usbProductId: 0x40,\n bootloaderUsbProductId: 0x0004,\n usbOnly: false,\n memorySize: 2 * 1024 * 1024,\n getBlockSize: () => 4 * 1024,\n masks: [0x33000000],\n bluetoothSpec: [\n {\n serviceUuid: \"13d63400-2c97-0004-0000-4c6564676572\",\n notifyUuid: \"13d63400-2c97-0004-0001-4c6564676572\",\n writeUuid: \"13d63400-2c97-0004-0002-4c6564676572\",\n writeCmdUuid: \"13d63400-2c97-0004-0003-4c6564676572\",\n },\n ],\n ...props,\n };\n}\n"],
5
+ "mappings": "AAAA,OAAS,iBAAAA,MAAqB,0BAGvB,SAASC,EACdC,EAAuC,CAAC,EAClB,CACtB,MAAO,CACL,GAAIF,EAAc,OAClB,YAAa,gBACb,aAAc,GACd,uBAAwB,EACxB,QAAS,GACT,WAAY,EAAI,KAAO,KACvB,aAAc,IAAM,EAAI,KACxB,MAAO,CAAC,SAAU,EAClB,cAAe,CACb,CACE,YAAa,uCACb,WAAY,uCACZ,UAAW,uCACX,aAAc,sCAChB,CACF,EACA,GAAGE,CACL,CACF",
6
6
  "names": ["DeviceModelId", "deviceModelStubBuilder", "props"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Apdu as o}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as i}from"./apdu/utils/ApduBuilder";import{ApduParser as m}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as c}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as x}from"./apdu/utils/ByteArrayParser";import{InvalidGetFirmwareMetadataResponseError as A,InvalidStatusWordError as D}from"./command/Errors";import{CommandResultFactory as v,CommandResultStatus as u,isSuccessCommandResult as S}from"./command/model/CommandResult";import{CloseAppCommand as y}from"./command/os/CloseAppCommand";import{GetAppAndVersionCommand as L}from"./command/os/GetAppAndVersionCommand";import{BatteryStatusType as B,GetBatteryStatusCommand as G}from"./command/os/GetBatteryStatusCommand";import{GetOsVersionCommand as R}from"./command/os/GetOsVersionCommand";import{ListAppsCommand as O}from"./command/os/ListAppsCommand";import{LoadCertificateCommand as h}from"./command/os/LoadCertificateCommand";import{OpenAppCommand as U}from"./command/os/OpenAppCommand";import{isCommandErrorCode as V}from"./command/utils/CommandErrors";import{CommandUtils as F}from"./command/utils/CommandUtils";import{GlobalCommandError as _,GlobalCommandErrorHandler as w}from"./command/utils/GlobalCommandError";import{DeviceModel as K,DeviceModelId as X,LEDGER_VENDOR_ID as q}from"./device/DeviceModel";import{DeviceStatus as Y}from"./device/DeviceStatus";import{DeviceActionStatus as z}from"./device-action/model/DeviceActionState";import{UserInteractionRequired as Q}from"./device-action/model/UserInteractionRequired";import{CallTaskInAppDeviceAction as $}from"./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction";import{AppAlreadyInstalledDAError as re,DeviceLockedError as oe,OutOfMemoryDAError as te,RefusedByUserDAError as pe,UnknownDAError as ie,UnsupportedFirmwareDAError as ne}from"./device-action/os/Errors";import{GetDeviceMetadataDeviceAction as ae}from"./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction";import{GetDeviceStatusDeviceAction as ce}from"./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as xe}from"./device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{InstallOrUpdateAppsDeviceAction as Ae}from"./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction";import{ListAppsDeviceAction as le}from"./device-action/os/ListApps/ListAppsDeviceAction";import{ListAppsWithMetadataDeviceAction as ue}from"./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction";import{OpenAppDeviceAction as Ce}from"./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{OpenAppWithDependenciesDeviceAction as Ee}from"./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction";import{SendCommandInAppDeviceAction as ge}from"./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction";import{XStateDeviceAction as Ge}from"./device-action/xstate-utils/XStateDeviceAction";import{StaticDeviceModelDataSource as Re}from"./device-model/data/StaticDeviceModelDataSource";import{BleDeviceInfos as Oe}from"./device-model/model/BleDeviceInfos";import{TransportDeviceModel as he}from"./device-model/model/DeviceModel";import{ApduResponse as Ue}from"./device-session/ApduResponse";export*from"./device-session/data/FramerConst";import{DeviceSessionStateType as ke}from"./device-session/DeviceSessionState";import{GenuineCheckDeviceAction as We}from"./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction";import{InstallAppDeviceAction as we}from"./secure-channel/device-action/InstallApp/InstallAppDeviceAction";import{ListInstalledAppsDeviceAction as Ke}from"./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{UninstallAppDeviceAction as qe}from"./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction";import{SecureChannelError as Ye}from"../internal/secure-channel/model/Errors";import{defaultApduReceiverServiceStubBuilder as ze}from"./device-session/service/DefaultApduReceiverService.stub";import{defaultApduSenderServiceStubBuilder as Qe}from"./device-session/service/DefaultApduSenderService.stub";import{FramerUtils as $e}from"./device-session/utils/FramerUtils";import{DeviceManagementKit as rr}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as tr}from"./DeviceManagementKitBuilder";export*from"./Error";import{LogLevel as nr}from"./logger-subscriber/model/LogLevel";import{ConsoleLogger as ar}from"./logger-subscriber/service/ConsoleLogger";import{WebLogsExporterLogger as cr}from"./logger-subscriber/service/WebLogsExporterLogger";import{ConnectedDevice as xr}from"./transport/model/ConnectedDevice";import{DeviceConnectionStateMachine as Ar}from"./transport/model/DeviceConnectionStateMachine";export*from"./transport/model/Errors";import{TransportConnectedDevice as vr}from"./transport/model/TransportConnectedDevice";import{connectedDeviceStubBuilder as Sr}from"./transport/model/TransportConnectedDevice.stub";export*from"./types";import{base64StringToBuffer as Er,isBase64String as Lr}from"./utils/Base64String";import{bufferToHexaString as Br,hexaStringToBuffer as Gr,isHexaString as Mr}from"./utils/HexaString";export{p as APDU_MAX_PAYLOAD,o as Apdu,i as ApduBuilder,m as ApduParser,Ue as ApduResponse,re as AppAlreadyInstalledDAError,B as BatteryStatusType,Oe as BleDeviceInfos,c as ByteArrayBuilder,x as ByteArrayParser,$ as CallTaskInAppDeviceAction,y as CloseAppCommand,v as CommandResultFactory,u as CommandResultStatus,F as CommandUtils,xr as ConnectedDevice,ar as ConsoleLogger,z as DeviceActionStatus,Ar as DeviceConnectionStateMachine,oe as DeviceLockedError,rr as DeviceManagementKit,tr as DeviceManagementKitBuilder,K as DeviceModel,X as DeviceModelId,ke as DeviceSessionStateType,Y as DeviceStatus,$e as FramerUtils,We as GenuineCheckDeviceAction,L as GetAppAndVersionCommand,G as GetBatteryStatusCommand,ae as GetDeviceMetadataDeviceAction,ce as GetDeviceStatusDeviceAction,R as GetOsVersionCommand,_ as GlobalCommandError,w as GlobalCommandErrorHandler,xe as GoToDashboardDeviceAction,we as InstallAppDeviceAction,Ae as InstallOrUpdateAppsDeviceAction,A as InvalidGetFirmwareMetadataResponseError,D as InvalidStatusWordError,q as LEDGER_VENDOR_ID,O as ListAppsCommand,le as ListAppsDeviceAction,ue as ListAppsWithMetadataDeviceAction,Ke as ListInstalledAppsDeviceAction,h as LoadCertificateCommand,nr as LogLevel,U as OpenAppCommand,Ce as OpenAppDeviceAction,Ee as OpenAppWithDependenciesDeviceAction,te as OutOfMemoryDAError,pe as RefusedByUserDAError,Ye as SecureChannelError,ge as SendCommandInAppDeviceAction,Re as StaticDeviceModelDataSource,vr as TransportConnectedDevice,he as TransportDeviceModel,qe as UninstallAppDeviceAction,ie as UnknownDAError,ne as UnsupportedFirmwareDAError,Q as UserInteractionRequired,cr as WebLogsExporterLogger,Ge as XStateDeviceAction,Er as base64StringToBuffer,Br as bufferToHexaString,Sr as connectedDeviceStubBuilder,ze as defaultApduReceiverServiceStubBuilder,Qe as defaultApduSenderServiceStubBuilder,Gr as hexaStringToBuffer,Lr as isBase64String,V as isCommandErrorCode,Mr as isHexaString,S as isSuccessCommandResult};
1
+ import{Apdu as o}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as i}from"./apdu/utils/ApduBuilder";import{ApduParser as m}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as c}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as x}from"./apdu/utils/ByteArrayParser";import{InvalidGetFirmwareMetadataResponseError as A,InvalidStatusWordError as D}from"./command/Errors";import{CommandResultFactory as u,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 B,GetBatteryStatusCommand as G}from"./command/os/GetBatteryStatusCommand";import{GetOsVersionCommand as M}from"./command/os/GetOsVersionCommand";import{ListAppsCommand as O}from"./command/os/ListAppsCommand";import{LoadCertificateCommand as h}from"./command/os/LoadCertificateCommand";import{OpenAppCommand as U}from"./command/os/OpenAppCommand";import{isCommandErrorCode as V}from"./command/utils/CommandErrors";import{CommandUtils as F}from"./command/utils/CommandUtils";import{GlobalCommandError as _,GlobalCommandErrorHandler as w}from"./command/utils/GlobalCommandError";import{DeviceModel as K,DeviceModelId as X,LEDGER_VENDOR_ID as q}from"./device/DeviceModel";import{DeviceStatus as Y}from"./device/DeviceStatus";import{DeviceActionStatus as z}from"./device-action/model/DeviceActionState";import{UserInteractionRequired as Q}from"./device-action/model/UserInteractionRequired";import{CallTaskInAppDeviceAction as $}from"./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction";import{AppAlreadyInstalledDAError as re,DeviceLockedError as oe,OutOfMemoryDAError as te,RefusedByUserDAError as pe,UnknownDAError as ie,UnsupportedFirmwareDAError as ne}from"./device-action/os/Errors";import{GetDeviceMetadataDeviceAction as ae}from"./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction";import{GetDeviceStatusDeviceAction as ce}from"./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as xe}from"./device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{InstallOrUpdateAppsDeviceAction as Ae}from"./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction";import{ListAppsDeviceAction as le}from"./device-action/os/ListApps/ListAppsDeviceAction";import{ListAppsWithMetadataDeviceAction as ve}from"./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction";import{OpenAppDeviceAction as Ce}from"./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{OpenAppWithDependenciesDeviceAction as Le}from"./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction";import{SendCommandInAppDeviceAction as Ee}from"./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction";import{XStateDeviceAction as Ge}from"./device-action/xstate-utils/XStateDeviceAction";import{StaticDeviceModelDataSource as Me}from"./device-model/data/StaticDeviceModelDataSource";import{BleDeviceInfos as Oe}from"./device-model/model/BleDeviceInfos";import{TransportDeviceModel as he}from"./device-model/model/DeviceModel";import{ApduResponse as Ue}from"./device-session/ApduResponse";export*from"./device-session/data/FramerConst";import{DeviceSessionStateType as ke}from"./device-session/DeviceSessionState";import{GenuineCheckDeviceAction as We}from"./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction";import{InstallAppDeviceAction as we}from"./secure-channel/device-action/InstallApp/InstallAppDeviceAction";import{ListInstalledAppsDeviceAction as Ke}from"./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{UninstallAppDeviceAction as qe}from"./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction";import{SecureChannelError as Ye}from"../internal/secure-channel/model/Errors";import{defaultApduReceiverServiceStubBuilder as ze}from"./device-session/service/DefaultApduReceiverService.stub";import{defaultApduSenderServiceStubBuilder as Qe}from"./device-session/service/DefaultApduSenderService.stub";import{FramerUtils as $e}from"./device-session/utils/FramerUtils";import{DeviceManagementKit as rr}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as tr}from"./DeviceManagementKitBuilder";export*from"./Error";import{LogLevel as nr}from"./logger-subscriber/model/LogLevel";import{ConsoleLogger as ar}from"./logger-subscriber/service/ConsoleLogger";import{WebLogsExporterLogger as cr}from"./logger-subscriber/service/WebLogsExporterLogger";import{ConnectedDevice as xr}from"./transport/model/ConnectedDevice";import{DeviceConnectionStateMachine as Ar}from"./transport/model/DeviceConnectionStateMachine";export*from"./transport/model/Errors";import{TransportConnectedDevice as ur}from"./transport/model/TransportConnectedDevice";import{connectedDeviceStubBuilder as Sr}from"./transport/model/TransportConnectedDevice.stub";export*from"./types";import{formatApduReceivedLog as Lr,formatApduSentLog as gr}from"./utils/apduLogs";import{base64StringToBuffer as Br,isBase64String as Gr}from"./utils/Base64String";import{bufferToHexaString as Mr,hexaStringToBuffer as Ir,isHexaString as Or}from"./utils/HexaString";export{p as APDU_MAX_PAYLOAD,o as Apdu,i as ApduBuilder,m as ApduParser,Ue as ApduResponse,re as AppAlreadyInstalledDAError,B as BatteryStatusType,Oe as BleDeviceInfos,c as ByteArrayBuilder,x as ByteArrayParser,$ as CallTaskInAppDeviceAction,y as CloseAppCommand,u as CommandResultFactory,v as CommandResultStatus,F as CommandUtils,xr as ConnectedDevice,ar as ConsoleLogger,z as DeviceActionStatus,Ar as DeviceConnectionStateMachine,oe as DeviceLockedError,rr as DeviceManagementKit,tr as DeviceManagementKitBuilder,K as DeviceModel,X as DeviceModelId,ke as DeviceSessionStateType,Y as DeviceStatus,$e as FramerUtils,We as GenuineCheckDeviceAction,g as GetAppAndVersionCommand,G as GetBatteryStatusCommand,ae as GetDeviceMetadataDeviceAction,ce as GetDeviceStatusDeviceAction,M as GetOsVersionCommand,_ as GlobalCommandError,w as GlobalCommandErrorHandler,xe as GoToDashboardDeviceAction,we as InstallAppDeviceAction,Ae as InstallOrUpdateAppsDeviceAction,A as InvalidGetFirmwareMetadataResponseError,D as InvalidStatusWordError,q as LEDGER_VENDOR_ID,O as ListAppsCommand,le as ListAppsDeviceAction,ve as ListAppsWithMetadataDeviceAction,Ke as ListInstalledAppsDeviceAction,h as LoadCertificateCommand,nr as LogLevel,U as OpenAppCommand,Ce as OpenAppDeviceAction,Le as OpenAppWithDependenciesDeviceAction,te as OutOfMemoryDAError,pe as RefusedByUserDAError,Ye as SecureChannelError,Ee as SendCommandInAppDeviceAction,Me as StaticDeviceModelDataSource,ur as TransportConnectedDevice,he as TransportDeviceModel,qe as UninstallAppDeviceAction,ie as UnknownDAError,ne as UnsupportedFirmwareDAError,Q as UserInteractionRequired,cr as WebLogsExporterLogger,Ge as XStateDeviceAction,Br as base64StringToBuffer,Mr as bufferToHexaString,Sr as connectedDeviceStubBuilder,ze as defaultApduReceiverServiceStubBuilder,Qe as defaultApduSenderServiceStubBuilder,Lr as formatApduReceivedLog,gr as formatApduSentLog,Ir as hexaStringToBuffer,Gr as isBase64String,V as isCommandErrorCode,Or as isHexaString,S 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 {\n InvalidGetFirmwareMetadataResponseError,\n InvalidStatusWordError,\n} from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
- "mapp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ACd,OAEE,0BAAAC,OACK,yCACP,OAAS,4BAAAC,OAAgC,0EACzC,OAAS,0BAAAC,OAA8B,sEACvC,OAAS,iCAAAC,OAAqC,oFAC9C,OAAS,4BAAAC,OAAgC,0EACzC,OAAS,sBAAAC,OAA0B,wCAEnC,OAAS,yCAAAC,OAA6C,8DACtD,OAAS,uCAAAC,OAA2C,4DACpD,OAAS,eAAAC,OAAmB,wCAC5B,OAAS,uBAAAC,OAA2B,2BACpC,OAAS,8BAAAC,OAAkC,kCAC3C,WAAc,aACd,OAAS,YAAAC,OAAgB,wCACzB,OAAS,iBAAAC,OAAqB,+CAC9B,OAAS,yBAAAC,OAA6B,uDACtC,OAAS,mBAAAC,OAAuB,uCAChC,OACE,gCAAAC,OAEK,oDACP,WAAc,8BACd,OAAS,4BAAAC,OAAgC,gDACzC,OAAS,8BAAAC,OAAkC,qDAC3C,WAAc,aACd,OAAS,wBAAAC,GAAsB,kBAAAC,OAAsB,0BACrD,OACE,sBAAAC,GACA,sBAAAC,GACA,gBAAAC,OACK",
6
- "names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidGetFirmwareMetadataResponseError", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "GetAppAndVersionCommand", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "LoadCertificateCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "DeviceActionStatus", "UserInteractionRequired", "CallTaskInAppDeviceAction", "AppAlreadyInstalledDAError", "DeviceLockedError", "OutOfMemoryDAError", "RefusedByUserDAError", "UnknownDAError", "UnsupportedFirmwareDAError", "GetDeviceMetadataDeviceAction", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "InstallOrUpdateAppsDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "OpenAppWithDependenciesDeviceAction", "SendCommandInAppDeviceAction", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "GenuineCheckDeviceAction", "InstallAppDeviceAction", "ListInstalledAppsDeviceAction", "UninstallAppDeviceAction", "SecureChannelError", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "LogLevel", "ConsoleLogger", "WebLogsExporterLogger", "ConnectedDevice", "DeviceConnectionStateMachine", "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 {\n InvalidGetFirmwareMetadataResponseError,\n InvalidStatusWordError,\n} from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { formatApduReceivedLog, formatApduSentLog } from \"@api/utils/apduLogs\";\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,OACE,2CAAAC,EACA,0BAAAC,MACK,sBACP,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,0BAAAC,MAEK,yCACP,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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AAAC,GACA,gBAAAC,OACK",
6
+ "names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidGetFirmwareMetadataResponseError", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "GetAppAndVersionCommand", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "LoadCertificateCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "DeviceActionStatus", "UserInteractionRequired", "CallTaskInAppDeviceAction", "AppAlreadyInstalledDAError", "DeviceLockedError", "OutOfMemoryDAError", "RefusedByUserDAError", "UnknownDAError", "UnsupportedFirmwareDAError", "GetDeviceMetadataDeviceAction", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "InstallOrUpdateAppsDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "OpenAppWithDependenciesDeviceAction", "SendCommandInAppDeviceAction", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "GenuineCheckDeviceAction", "InstallAppDeviceAction", "ListInstalledAppsDeviceAction", "UninstallAppDeviceAction", "SecureChannelError", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "LogLevel", "ConsoleLogger", "WebLogsExporterLogger", "ConnectedDevice", "DeviceConnectionStateMachine", "TransportConnectedDevice", "connectedDeviceStubBuilder", "formatApduReceivedLog", "formatApduSentLog", "base64StringToBuffer", "isBase64String", "bufferToHexaString", "hexaStringToBuffer", "isHexaString"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ import{bufferToHexaString as r}from"./HexaString";function n(e){return`[will send APDU] ~...> ${r(e,!1)}`}function o(e){return`[exchange] => ${r(e,!1)}`}function a(e){return`[exchange] <= ${r(e.data,!1)}${r(e.statusCode,!1)}`}export{a as formatApduReceivedLog,n as formatApduSendingLog,o as formatApduSentLog};
2
+ //# sourceMappingURL=apduLogs.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/api/utils/apduLogs.ts"],
4
+ "sourcesContent": ["import { type ApduResponse } from \"@api/device-session/ApduResponse\";\n\nimport { bufferToHexaString } from \"./HexaString\";\n\n/**\n * Formats the log message for an APDU that is about to be sent.\n * Only call this at the device session layer, before calling sendApdu on the connected device.\n */\nexport function formatApduSendingLog(apdu: Uint8Array): string {\n return `[will send APDU] ~...> ${bufferToHexaString(apdu, false)}`;\n}\n\n/**\n * Formats the log message for an APDU that was sent.\n * Only call this at the transport layer, after the APDU sending logic has been executed\n * without any error.\n */\nexport function formatApduSentLog(apdu: Uint8Array): string {\n return `[exchange] => ${bufferToHexaString(apdu, false)}`;\n}\n\n/**\n * Formats the log message for an APDU response received from the device.\n */\nexport function formatApduReceivedLog(apduResponse: ApduResponse): string {\n return `[exchange] <= ${bufferToHexaString(apduResponse.data, false)}${bufferToHexaString(apduResponse.statusCode, false)}`;\n}\n"],
5
+ "mappings": "AAEA,OAAS,sBAAAA,MAA0B,eAM5B,SAASC,EAAqBC,EAA0B,CAC7D,MAAO,0BAA0BF,EAAmBE,EAAM,EAAK,CAAC,EAClE,CAOO,SAASC,EAAkBD,EAA0B,CAC1D,MAAO,iBAAiBF,EAAmBE,EAAM,EAAK,CAAC,EACzD,CAKO,SAASE,EAAsBC,EAAoC,CACxE,MAAO,iBAAiBL,EAAmBK,EAAa,KAAM,EAAK,CAAC,GAAGL,EAAmBK,EAAa,WAAY,EAAK,CAAC,EAC3H",
6
+ "names": ["bufferToHexaString", "formatApduSendingLog", "apdu", "formatApduSentLog", "formatApduReceivedLog", "apduResponse"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{describe as r,expect as t,it as e}from"vitest";import{formatApduReceivedLog as a,formatApduSendingLog as d,formatApduSentLog as n}from"./apduLogs";r("apduLogs",()=>{r("formatApduSendingLog",()=>{e("should format APDU with correct format before sending",()=>{const o=Uint8Array.from([224,1,0,0,4]);t(d(o)).toBe("[will send APDU] ~...> e001000004")}),e("should handle empty APDU",()=>{const o=Uint8Array.from([]);t(d(o)).toBe("[will send APDU] ~...> ")})}),r("formatApduSentLog",()=>{e("should format APDU with correct format after sending",()=>{const o=Uint8Array.from([224,1,0,0,4]);t(n(o)).toBe("[exchange] => e001000004")}),e("should handle empty APDU",()=>{const o=Uint8Array.from([]);t(n(o)).toBe("[exchange] => ")})}),r("formatApduReceivedLog",()=>{e("should format APDU response with data and status code",()=>{const o={data:Uint8Array.from([1,2,3]),statusCode:Uint8Array.from([144,0])};t(a(o)).toBe("[exchange] <= 0102039000")}),e("should format APDU response with only status code when data is empty",()=>{const o={data:Uint8Array.from([]),statusCode:Uint8Array.from([144,0])};t(a(o)).toBe("[exchange] <= 9000")}),e("should format error status code correctly",()=>{const o={data:Uint8Array.from([]),statusCode:Uint8Array.from([105,133])};t(a(o)).toBe("[exchange] <= 6985")})})});
2
+ //# sourceMappingURL=apduLogs.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/api/utils/apduLogs.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from \"vitest\";\n\nimport {\n formatApduReceivedLog,\n formatApduSendingLog,\n formatApduSentLog,\n} from \"./apduLogs\";\n\ndescribe(\"apduLogs\", () => {\n describe(\"formatApduSendingLog\", () => {\n it(\"should format APDU with correct format before sending\", () => {\n const apdu = Uint8Array.from([0xe0, 0x01, 0x00, 0x00, 0x04]);\n expect(formatApduSendingLog(apdu)).toBe(\n \"[will send APDU] ~...> e001000004\",\n );\n });\n\n it(\"should handle empty APDU\", () => {\n const apdu = Uint8Array.from([]);\n expect(formatApduSendingLog(apdu)).toBe(\"[will send APDU] ~...> \");\n });\n });\n\n describe(\"formatApduSentLog\", () => {\n it(\"should format APDU with correct format after sending\", () => {\n const apdu = Uint8Array.from([0xe0, 0x01, 0x00, 0x00, 0x04]);\n expect(formatApduSentLog(apdu)).toBe(\"[exchange] => e001000004\");\n });\n\n it(\"should handle empty APDU\", () => {\n const apdu = Uint8Array.from([]);\n expect(formatApduSentLog(apdu)).toBe(\"[exchange] => \");\n });\n });\n\n describe(\"formatApduReceivedLog\", () => {\n it(\"should format APDU response with data and status code\", () => {\n const apduResponse = {\n data: Uint8Array.from([0x01, 0x02, 0x03]),\n statusCode: Uint8Array.from([0x90, 0x00]),\n };\n expect(formatApduReceivedLog(apduResponse)).toBe(\n \"[exchange] <= 0102039000\",\n );\n });\n\n it(\"should format APDU response with only status code when data is empty\", () => {\n const apduResponse = {\n data: Uint8Array.from([]),\n statusCode: Uint8Array.from([0x90, 0x00]),\n };\n expect(formatApduReceivedLog(apduResponse)).toBe(\"[exchange] <= 9000\");\n });\n\n it(\"should format error status code correctly\", () => {\n const apduResponse = {\n data: Uint8Array.from([]),\n statusCode: Uint8Array.from([0x69, 0x85]),\n };\n expect(formatApduReceivedLog(apduResponse)).toBe(\"[exchange] <= 6985\");\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,YAAAA,EAAU,UAAAC,EAAQ,MAAAC,MAAU,SAErC,OACE,yBAAAC,EACA,wBAAAC,EACA,qBAAAC,MACK,aAEPL,EAAS,WAAY,IAAM,CACzBA,EAAS,uBAAwB,IAAM,CACrCE,EAAG,wDAAyD,IAAM,CAChE,MAAMI,EAAO,WAAW,KAAK,CAAC,IAAM,EAAM,EAAM,EAAM,CAAI,CAAC,EAC3DL,EAAOG,EAAqBE,CAAI,CAAC,EAAE,KACjC,mCACF,CACF,CAAC,EAEDJ,EAAG,2BAA4B,IAAM,CACnC,MAAMI,EAAO,WAAW,KAAK,CAAC,CAAC,EAC/BL,EAAOG,EAAqBE,CAAI,CAAC,EAAE,KAAK,yBAAyB,CACnE,CAAC,CACH,CAAC,EAEDN,EAAS,oBAAqB,IAAM,CAClCE,EAAG,uDAAwD,IAAM,CAC/D,MAAMI,EAAO,WAAW,KAAK,CAAC,IAAM,EAAM,EAAM,EAAM,CAAI,CAAC,EAC3DL,EAAOI,EAAkBC,CAAI,CAAC,EAAE,KAAK,0BAA0B,CACjE,CAAC,EAEDJ,EAAG,2BAA4B,IAAM,CACnC,MAAMI,EAAO,WAAW,KAAK,CAAC,CAAC,EAC/BL,EAAOI,EAAkBC,CAAI,CAAC,EAAE,KAAK,gBAAgB,CACvD,CAAC,CACH,CAAC,EAEDN,EAAS,wBAAyB,IAAM,CACtCE,EAAG,wDAAyD,IAAM,CAChE,MAAMK,EAAe,CACnB,KAAM,WAAW,KAAK,CAAC,EAAM,EAAM,CAAI,CAAC,EACxC,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,CAC1C,EACAN,EAAOE,EAAsBI,CAAY,CAAC,EAAE,KAC1C,0BACF,CACF,CAAC,EAEDL,EAAG,uEAAwE,IAAM,CAC/E,MAAMK,EAAe,CACnB,KAAM,WAAW,KAAK,CAAC,CAAC,EACxB,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,CAC1C,EACAN,EAAOE,EAAsBI,CAAY,CAAC,EAAE,KAAK,oBAAoB,CACvE,CAAC,EAEDL,EAAG,4CAA6C,IAAM,CACpD,MAAMK,EAAe,CACnB,KAAM,WAAW,KAAK,CAAC,CAAC,EACxB,WAAY,WAAW,KAAK,CAAC,IAAM,GAAI,CAAC,CAC1C,EACAN,EAAOE,EAAsBI,CAAY,CAAC,EAAE,KAAK,oBAAoB,CACvE,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["describe", "expect", "it", "formatApduReceivedLog", "formatApduSendingLog", "formatApduSentLog", "apdu", "apduResponse"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{BehaviorSubject as d}from"rxjs";import{v4 as h}from"uuid";import{CommandUtils as S}from"../../../api/command/utils/CommandUtils";import{DeviceStatus as v}from"../../../api/device/DeviceStatus";import{DeviceSessionStateType as u}from"../../../api/device-session/DeviceSessionState";import{bufferToHexaString as a}from"../../../api/index";import{DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS as m}from"../../device-session/data/DeviceSessionRefresherConst";import{MutexService as l}from"../../device-session/service/MutexService";import{RefresherService as D}from"../../device-session/service/RefresherService";import{DevicePinger as _}from"./DevicePinger";import{DeviceSessionEventDispatcher as g,SessionEvents as o}from"./DeviceSessionEventDispatcher";import{DeviceSessionRefresher as f}from"./DeviceSessionRefresher";import{DeviceSessionStateHandler as E}from"./DeviceSessionStateHandler";class L{_id;_connectedDevice;_deviceState;_managerApiService;_secureChannelService;_logger;_refresherOptions;_pinger;_deviceSessionRefresher;_refresherService;_commandMutex=new l;_sessionEventDispatcher=new g;constructor({connectedDevice:e,id:r=h()},s,t,i,n){this._id=r,this._connectedDevice=e,this._logger=s("device-session"),this._managerApiService=t,this._secureChannelService=i,this._refresherOptions={...m,...n},this._deviceState=new d({sessionStateType:u.Connected,deviceStatus:v.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id}),this._pinger=new _(s,e,this._sessionEventDispatcher,(c,p)=>this.sendCommand(c,p)),this._deviceSessionRefresher=new f(s,this._refresherOptions,this._sessionEventDispatcher,this._connectedDevice),new E(s,this._sessionEventDispatcher,this._connectedDevice,this._deviceState,c=>this.setDeviceSessionState(c)),this._refresherService=new D(s,{start:()=>this._deviceSessionRefresher.restartRefresher(),stop:()=>this._deviceSessionRefresher.stopRefresher()})}async initialiseSession(){try{await this._pinger.ping()}catch(e){throw this._logger.error("Error while initialising session",{data:{error:e}}),e}finally{this._refresherOptions.isRefresherDisabled||this._deviceSessionRefresher.startRefresher()}}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}getDeviceSessionState(){return this._deviceState.getValue()}setDeviceSessionState(e){this._deviceState.next(e)}async sendApdu(e,r={isPolling:!1,triggersDisconnection:!1,abortTimeout:void 0}){const s=await this._commandMutex.lock();try{this._sessionEventDispatcher.dispatch({eventName:o.DEVICE_STATE_UPDATE_BUSY}),this._logger.debug(`[exchange] => ${a(e,!1)}`);const t=await this._connectedDevice.sendApdu(e,r.triggersDisconnection,r.abortTimeout);return t.ifRight(i=>{this._logger.debug(`[exchange] <= ${a(i.data,!1)}${a(i.statusCode,!1)}`),S.isLockedDeviceResponse(i)?this._sessionEventDispatcher.dispatch({eventName:o.DEVICE_STATE_UPDATE_LOCKED}):this._sessionEventDispatcher.dispatch({eventName:o.DEVICE_STATE_UPDATE_CONNECTED})}).ifLeft(()=>{this._sessionEventDispatcher.dispatch({eventName:o.DEVICE_STATE_UPDATE_CONNECTED})}),t}finally{s()}}async sendCommand(e,r){this._logger.debug(`[sendCommand] ${e.name}`);const s=e.getApdu();return(await this.sendApdu(s.getRawApdu(),{isPolling:!1,triggersDisconnection:e.triggersDisconnection??!1,abortTimeout:r})).caseOf({Left:i=>{throw this._logger.error("[sendCommand] error",{data:{err:i}}),i},Right:i=>{const n=e.parseResponse(i,this._connectedDevice.deviceModel.id);return this._logger.debug("[sendCommand] result",{data:{result:n}}),n}})}executeDeviceAction(e){const{observable:r,cancel:s}=e._execute({sendApdu:async t=>this.sendApdu(t),sendCommand:async(t,i)=>this.sendCommand(t,i),getDeviceModel:()=>this._connectedDevice.deviceModel,getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:t=>(this.setDeviceSessionState(t),this._deviceState.getValue()),disableRefresher:t=>this._refresherService.disableRefresher(t),getManagerApiService:()=>this._managerApiService,getSecureChannelService:()=>this._secureChannelService});return{observable:r,cancel:s}}close(){this._updateDeviceStatus(v.NOT_CONNECTED),this._deviceState.complete(),this._deviceSessionRefresher.stopRefresher()}disableRefresher(e){return this._refresherService.disableRefresher(e)}_updateDeviceStatus(e){const r=this._deviceState.getValue();this._deviceState.next({...r,deviceStatus:e})}}export{L as DeviceSession};
1
+ import{BehaviorSubject as v}from"rxjs";import{v4 as d}from"uuid";import{CommandUtils as h}from"../../../api/command/utils/CommandUtils";import{DeviceStatus as a}from"../../../api/device/DeviceStatus";import{DeviceSessionStateType as S}from"../../../api/device-session/DeviceSessionState";import{formatApduSendingLog as u}from"../../../api/utils/apduLogs";import{DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS as m}from"../../device-session/data/DeviceSessionRefresherConst";import{MutexService as l}from"../../device-session/service/MutexService";import{RefresherService as D}from"../../device-session/service/RefresherService";import{DevicePinger as _}from"./DevicePinger";import{DeviceSessionEventDispatcher as g,SessionEvents as o}from"./DeviceSessionEventDispatcher";import{DeviceSessionRefresher as f}from"./DeviceSessionRefresher";import{DeviceSessionStateHandler as E}from"./DeviceSessionStateHandler";class U{_id;_connectedDevice;_deviceState;_managerApiService;_secureChannelService;_logger;_refresherOptions;_pinger;_deviceSessionRefresher;_refresherService;_commandMutex=new l;_sessionEventDispatcher=new g;constructor({connectedDevice:e,id:s=d()},i,t,r,n){this._id=s,this._connectedDevice=e,this._logger=i("device-session"),this._managerApiService=t,this._secureChannelService=r,this._refresherOptions={...m,...n},this._deviceState=new v({sessionStateType:S.Connected,deviceStatus:a.CONNECTED,deviceModelId:this._connectedDevice.deviceModel.id}),this._pinger=new _(i,e,this._sessionEventDispatcher,(c,p)=>this.sendCommand(c,p)),this._deviceSessionRefresher=new f(i,this._refresherOptions,this._sessionEventDispatcher,this._connectedDevice),new E(i,this._sessionEventDispatcher,this._connectedDevice,this._deviceState,c=>this.setDeviceSessionState(c)),this._refresherService=new D(i,{start:()=>this._deviceSessionRefresher.restartRefresher(),stop:()=>this._deviceSessionRefresher.stopRefresher()})}async initialiseSession(){try{await this._pinger.ping()}catch(e){throw this._logger.error("Error while initialising session",{data:{error:e}}),e}finally{this._refresherOptions.isRefresherDisabled||this._deviceSessionRefresher.startRefresher()}}get id(){return this._id}get connectedDevice(){return this._connectedDevice}get state(){return this._deviceState.asObservable()}getDeviceSessionState(){return this._deviceState.getValue()}setDeviceSessionState(e){this._deviceState.next(e)}async sendApdu(e,s={isPolling:!1,triggersDisconnection:!1,abortTimeout:void 0}){const i=await this._commandMutex.lock();try{this._sessionEventDispatcher.dispatch({eventName:o.DEVICE_STATE_UPDATE_BUSY}),this._logger.debug(u(e));const t=await this._connectedDevice.sendApdu(e,s.triggersDisconnection,s.abortTimeout);return t.ifRight(r=>{h.isLockedDeviceResponse(r)?this._sessionEventDispatcher.dispatch({eventName:o.DEVICE_STATE_UPDATE_LOCKED}):this._sessionEventDispatcher.dispatch({eventName:o.DEVICE_STATE_UPDATE_CONNECTED})}).ifLeft(()=>{this._sessionEventDispatcher.dispatch({eventName:o.DEVICE_STATE_UPDATE_CONNECTED})}),t}finally{i()}}async sendCommand(e,s){this._logger.debug(`[sendCommand] ${e.name}`);const i=e.getApdu();return(await this.sendApdu(i.getRawApdu(),{isPolling:!1,triggersDisconnection:e.triggersDisconnection??!1,abortTimeout:s})).caseOf({Left:r=>{throw this._logger.error("[sendCommand] error",{data:{err:r}}),r},Right:r=>{const n=e.parseResponse(r,this._connectedDevice.deviceModel.id);return this._logger.debug("[sendCommand] result",{data:{result:n}}),n}})}executeDeviceAction(e){const{observable:s,cancel:i}=e._execute({sendApdu:async t=>this.sendApdu(t),sendCommand:async(t,r)=>this.sendCommand(t,r),getDeviceModel:()=>this._connectedDevice.deviceModel,getDeviceSessionState:()=>this._deviceState.getValue(),getDeviceSessionStateObservable:()=>this.state,setDeviceSessionState:t=>(this.setDeviceSessionState(t),this._deviceState.getValue()),disableRefresher:t=>this._refresherService.disableRefresher(t),getManagerApiService:()=>this._managerApiService,getSecureChannelService:()=>this._secureChannelService});return{observable:s,cancel:i}}close(){this._updateDeviceStatus(a.NOT_CONNECTED),this._deviceState.complete(),this._deviceSessionRefresher.stopRefresher()}disableRefresher(e){return this._refresherService.disableRefresher(e)}_updateDeviceStatus(e){const s=this._deviceState.getValue();this._deviceState.next({...s,deviceStatus:e})}}export{U 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 } from \"purify-ts\";\nimport { BehaviorSubject, type Observable } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { type DmkError } from \"@api/Error\";\nimport { bufferToHexaString } from \"@api/index\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { MutexService } from \"@internal/device-session/service/MutexService\";\nimport { RefresherService } from \"@internal/device-session/service/RefresherService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { DevicePinger } from \"./DevicePinger\";\nimport {\n DeviceSessionEventDispatcher,\n SessionEvents,\n} from \"./DeviceSessionEventDispatcher\";\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\nimport { DeviceSessionStateHandler } from \"./DeviceSessionStateHandler\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\nexport type DeviceSessionRefresherOptions = {\n isRefresherDisabled: boolean;\n pollingInterval?: number;\n};\n\ntype SendApduOptions = {\n isPolling?: boolean;\n triggersDisconnection?: boolean;\n abortTimeout?: number;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _managerApiService: ManagerApiService;\n private readonly _secureChannelService: SecureChannelService;\n private readonly _logger: LoggerPublisherService;\n private readonly _refresherOptions: DeviceSessionRefresherOptions;\n private _pinger: DevicePinger;\n private _deviceSessionRefresher: DeviceSessionRefresher;\n private readonly _refresherService: RefresherService;\n private _commandMutex = new MutexService();\n private _sessionEventDispatcher = new DeviceSessionEventDispatcher();\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n secureChannelService: SecureChannelService,\n deviceSessionRefresherOptions: DeviceSessionRefresherOptions | undefined,\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._logger = loggerModuleFactory(\"device-session\");\n this._managerApiService = managerApiService;\n this._secureChannelService = secureChannelService;\n this._refresherOptions = {\n ...DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n ...deviceSessionRefresherOptions,\n };\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n });\n\n this._pinger = new DevicePinger(\n loggerModuleFactory,\n connectedDevice,\n this._sessionEventDispatcher,\n (command, abortTimeout) => this.sendCommand(command, abortTimeout),\n );\n this._deviceSessionRefresher = new DeviceSessionRefresher(\n loggerModuleFactory,\n this._refresherOptions,\n this._sessionEventDispatcher,\n this._connectedDevice,\n );\n new DeviceSessionStateHandler(\n loggerModuleFactory,\n this._sessionEventDispatcher,\n this._connectedDevice,\n this._deviceState,\n (state) => this.setDeviceSessionState(state),\n );\n\n this._refresherService = new RefresherService(loggerModuleFactory, {\n start: () => this._deviceSessionRefresher.restartRefresher(),\n stop: () => this._deviceSessionRefresher.stopRefresher(),\n });\n }\n\n public async initialiseSession(): Promise<void> {\n try {\n await this._pinger.ping();\n } catch (error) {\n this._logger.error(\"Error while initialising session\", {\n data: { error },\n });\n throw error;\n } finally {\n if (!this._refresherOptions.isRefresherDisabled) {\n this._deviceSessionRefresher.startRefresher();\n }\n }\n }\n\n public get id(): DeviceSessionId {\n return this._id;\n }\n\n public get connectedDevice(): TransportConnectedDevice {\n return this._connectedDevice;\n }\n\n public get state(): Observable<DeviceSessionState> {\n return this._deviceState.asObservable();\n }\n\n public getDeviceSessionState(): DeviceSessionState {\n return this._deviceState.getValue();\n }\n\n public setDeviceSessionState(state: DeviceSessionState): void {\n this._deviceState.next(state);\n }\n\n public async sendApdu(\n rawApdu: Uint8Array,\n options: SendApduOptions = {\n isPolling: false,\n triggersDisconnection: false,\n abortTimeout: undefined,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n const release = await this._commandMutex.lock();\n\n try {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_BUSY,\n });\n\n this._logger.debug(`[exchange] => ${bufferToHexaString(rawApdu, false)}`);\n const result = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n options.abortTimeout,\n );\n\n result\n .ifRight((response: ApduResponse) => {\n this._logger.debug(\n `[exchange] <= ${bufferToHexaString(response.data, false)}${bufferToHexaString(response.statusCode, false)}`,\n );\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n } else {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n }\n })\n .ifLeft(() => {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n });\n return result;\n } finally {\n release();\n }\n }\n\n public async sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n this._logger.debug(`[sendCommand] ${command.name}`);\n const apdu = command.getApdu();\n\n const response = await this.sendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n abortTimeout,\n });\n\n return response.caseOf({\n Left: (err) => {\n this._logger.error(\"[sendCommand] error\", { data: { err } });\n throw err;\n },\n Right: (r) => {\n const result = command.parseResponse(\n r,\n this._connectedDevice.deviceModel.id,\n );\n this._logger.debug(\"[sendCommand] result\", { data: { result } });\n return result;\n },\n });\n }\n\n public executeDeviceAction<\n Output,\n Input,\n E extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, E, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, E, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendApdu: async (apdu: Uint8Array) => this.sendApdu(apdu),\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n abortTimeout?: number,\n ) => this.sendCommand(command, abortTimeout),\n getDeviceModel: () => this._connectedDevice.deviceModel,\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n disableRefresher: (blockerId: string) =>\n this._refresherService.disableRefresher(blockerId),\n getManagerApiService: () => this._managerApiService,\n getSecureChannelService: () => this._secureChannelService,\n });\n return { observable, cancel };\n }\n\n public close(): void {\n this._updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._deviceSessionRefresher.stopRefresher();\n }\n\n public disableRefresher(id: string): () => void {\n return this._refresherService.disableRefresher(id);\n }\n\n private _updateDeviceStatus(deviceStatus: DeviceStatus): void {\n const state = this._deviceState.getValue();\n this._deviceState.next({ ...state, deviceStatus });\n }\n}\n"],
5
- "mappings": "AACA,OAAS,mBAAAA,MAAwC,OACjD,OAAS,MAAMC,MAAc,OAI7B,OAAS,gBAAAC,MAAoB,kCAC7B,OAAS,gBAAAC,MAAoB,2BAO7B,OAEE,0BAAAC,MACK,yCAGP,OAAS,sBAAAC,MAA0B,aAGnC,OAAS,4CAAAC,MAAgD,4DACzD,OAAS,gBAAAC,MAAoB,gDAC7B,OAAS,oBAAAC,MAAwB,oDAIjC,OAAS,gBAAAC,MAAoB,iBAC7B,OACE,gCAAAC,EACA,iBAAAC,MACK,iCACP,OAAS,0BAAAC,MAA8B,2BACvC,OAAS,6BAAAC,MAAiC,8BAqBnC,MAAMC,CAAc,CACR,IACA,iBACA,aACA,mBACA,sBACA,QACA,kBACT,QACA,wBACS,kBACT,cAAgB,IAAIP,EACpB,wBAA0B,IAAIG,EAEtC,YACE,CAAE,gBAAAK,EAAiB,GAAAC,EAAKf,EAAO,CAAE,EACjCgB,EACAC,EACAC,EACAC,EACA,CACA,KAAK,IAAMJ,EACX,KAAK,iBAAmBD,EACxB,KAAK,QAAUE,EAAoB,gBAAgB,EACnD,KAAK,mBAAqBC,EAC1B,KAAK,sBAAwBC,EAC7B,KAAK,kBAAoB,CACvB,GAAGb,EACH,GAAGc,CACL,EACA,KAAK,aAAe,IAAIpB,EAAoC,CAC1D,iBAAkBI,EAAuB,UACzC,aAAcD,EAAa,UAC3B,cAAe,KAAK,iBAAiB,YAAY,EACnD,CAAC,EAED,KAAK,QAAU,IAAIM,EACjBQ,EACAF,EACA,KAAK,wBACL,CAACM,EAASC,IAAiB,KAAK,YAAYD,EAASC,CAAY,CACnE,EACA,KAAK,wBAA0B,IAAIV,EACjCK,EACA,KAAK,kBACL,KAAK,wBACL,KAAK,gBACP,EACA,IAAIJ,EACFI,EACA,KAAK,wBAC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jC,wBAAyB,IAAM,KAAK,qBACtC,CAAC,EACD,MAAO,CAAE,WAAAF,EAAY,OAAAC,CAAO,CAC9B,CAEO,OAAc,CACnB,KAAK,oBAAoBhC,EAAa,aAAa,EACnD,KAAK,aAAa,SAAS,EAC3B,KAAK,wBAAwB,cAAc,CAC7C,CAEO,iBAAiBa,EAAwB,CAC9C,OAAO,KAAK,kBAAkB,iBAAiBA,CAAE,CACnD,CAEQ,oBAAoBqB,EAAkC,CAC5D,MAAMd,EAAQ,KAAK,aAAa,SAAS,EACzC,KAAK,aAAa,KAAK,CAAE,GAAGA,EAAO,aAAAc,CAAa,CAAC,CACnD,CACF",
6
- "names": ["BehaviorSubject", "uuidv4", "CommandUtils", "DeviceStatus", "DeviceSessionStateType", "bufferToHexaString", "DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS", "MutexService", "RefresherService", "DevicePinger", "DeviceSessionEventDispatcher", "SessionEvents", "DeviceSessionRefresher", "DeviceSessionStateHandler", "DeviceSession", "connectedDevice", "id", "loggerModuleFactory", "managerApiService", "secureChannelService", "deviceSessionRefresherOptions", "command", "abortTimeout", "state", "error", "rawApdu", "options", "release", "result", "response", "apdu", "err", "r", "deviceAction", "observable", "cancel", "blockerId", "deviceStatus"]
4
+ "sourcesContent": ["import { type Either } from \"purify-ts\";\nimport { BehaviorSubject, type Observable } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { type Command } from \"@api/command/Command\";\nimport { type CommandResult } from \"@api/command/model/CommandResult\";\nimport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nimport { type ApduResponse } from \"@api/device-session/ApduResponse\";\nimport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nimport { type DeviceSessionId } from \"@api/device-session/types\";\nimport { type DmkError } from \"@api/Error\";\nimport { type LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { type TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nimport { formatApduSendingLog } from \"@api/utils/apduLogs\";\nimport { DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS } from \"@internal/device-session/data/DeviceSessionRefresherConst\";\nimport { MutexService } from \"@internal/device-session/service/MutexService\";\nimport { RefresherService } from \"@internal/device-session/service/RefresherService\";\nimport { type ManagerApiService } from \"@internal/manager-api/service/ManagerApiService\";\nimport { type SecureChannelService } from \"@internal/secure-channel/service/SecureChannelService\";\n\nimport { DevicePinger } from \"./DevicePinger\";\nimport {\n DeviceSessionEventDispatcher,\n SessionEvents,\n} from \"./DeviceSessionEventDispatcher\";\nimport { DeviceSessionRefresher } from \"./DeviceSessionRefresher\";\nimport { DeviceSessionStateHandler } from \"./DeviceSessionStateHandler\";\n\nexport type SessionConstructorArgs = {\n connectedDevice: TransportConnectedDevice;\n id?: DeviceSessionId;\n};\n\nexport type DeviceSessionRefresherOptions = {\n isRefresherDisabled: boolean;\n pollingInterval?: number;\n};\n\ntype SendApduOptions = {\n isPolling?: boolean;\n triggersDisconnection?: boolean;\n abortTimeout?: number;\n};\n\n/**\n * Represents a session with a device.\n */\nexport class DeviceSession {\n private readonly _id: DeviceSessionId;\n private readonly _connectedDevice: TransportConnectedDevice;\n private readonly _deviceState: BehaviorSubject<DeviceSessionState>;\n private readonly _managerApiService: ManagerApiService;\n private readonly _secureChannelService: SecureChannelService;\n private readonly _logger: LoggerPublisherService;\n private readonly _refresherOptions: DeviceSessionRefresherOptions;\n private _pinger: DevicePinger;\n private _deviceSessionRefresher: DeviceSessionRefresher;\n private readonly _refresherService: RefresherService;\n private _commandMutex = new MutexService();\n private _sessionEventDispatcher = new DeviceSessionEventDispatcher();\n\n constructor(\n { connectedDevice, id = uuidv4() }: SessionConstructorArgs,\n loggerModuleFactory: (tag: string) => LoggerPublisherService,\n managerApiService: ManagerApiService,\n secureChannelService: SecureChannelService,\n deviceSessionRefresherOptions: DeviceSessionRefresherOptions | undefined,\n ) {\n this._id = id;\n this._connectedDevice = connectedDevice;\n this._logger = loggerModuleFactory(\"device-session\");\n this._managerApiService = managerApiService;\n this._secureChannelService = secureChannelService;\n this._refresherOptions = {\n ...DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS,\n ...deviceSessionRefresherOptions,\n };\n this._deviceState = new BehaviorSubject<DeviceSessionState>({\n sessionStateType: DeviceSessionStateType.Connected,\n deviceStatus: DeviceStatus.CONNECTED,\n deviceModelId: this._connectedDevice.deviceModel.id,\n });\n\n this._pinger = new DevicePinger(\n loggerModuleFactory,\n connectedDevice,\n this._sessionEventDispatcher,\n (command, abortTimeout) => this.sendCommand(command, abortTimeout),\n );\n this._deviceSessionRefresher = new DeviceSessionRefresher(\n loggerModuleFactory,\n this._refresherOptions,\n this._sessionEventDispatcher,\n this._connectedDevice,\n );\n new DeviceSessionStateHandler(\n loggerModuleFactory,\n this._sessionEventDispatcher,\n this._connectedDevice,\n this._deviceState,\n (state) => this.setDeviceSessionState(state),\n );\n\n this._refresherService = new RefresherService(loggerModuleFactory, {\n start: () => this._deviceSessionRefresher.restartRefresher(),\n stop: () => this._deviceSessionRefresher.stopRefresher(),\n });\n }\n\n public async initialiseSession(): Promise<void> {\n try {\n await this._pinger.ping();\n } catch (error) {\n this._logger.error(\"Error while initialising session\", {\n data: { error },\n });\n throw error;\n } finally {\n if (!this._refresherOptions.isRefresherDisabled) {\n this._deviceSessionRefresher.startRefresher();\n }\n }\n }\n\n public get id(): DeviceSessionId {\n return this._id;\n }\n\n public get connectedDevice(): TransportConnectedDevice {\n return this._connectedDevice;\n }\n\n public get state(): Observable<DeviceSessionState> {\n return this._deviceState.asObservable();\n }\n\n public getDeviceSessionState(): DeviceSessionState {\n return this._deviceState.getValue();\n }\n\n public setDeviceSessionState(state: DeviceSessionState): void {\n this._deviceState.next(state);\n }\n\n public async sendApdu(\n rawApdu: Uint8Array,\n options: SendApduOptions = {\n isPolling: false,\n triggersDisconnection: false,\n abortTimeout: undefined,\n },\n ): Promise<Either<DmkError, ApduResponse>> {\n const release = await this._commandMutex.lock();\n\n try {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_BUSY,\n });\n\n this._logger.debug(formatApduSendingLog(rawApdu));\n const result = await this._connectedDevice.sendApdu(\n rawApdu,\n options.triggersDisconnection,\n options.abortTimeout,\n );\n\n result\n .ifRight((response: ApduResponse) => {\n if (CommandUtils.isLockedDeviceResponse(response)) {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_LOCKED,\n });\n } else {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n }\n })\n .ifLeft(() => {\n this._sessionEventDispatcher.dispatch({\n eventName: SessionEvents.DEVICE_STATE_UPDATE_CONNECTED,\n });\n });\n return result;\n } finally {\n release();\n }\n }\n\n public async sendCommand<Response, Args, ErrorStatusCodes>(\n command: Command<Response, Args, ErrorStatusCodes>,\n abortTimeout?: number,\n ): Promise<CommandResult<Response, ErrorStatusCodes>> {\n this._logger.debug(`[sendCommand] ${command.name}`);\n const apdu = command.getApdu();\n\n const response = await this.sendApdu(apdu.getRawApdu(), {\n isPolling: false,\n triggersDisconnection: command.triggersDisconnection ?? false,\n abortTimeout,\n });\n\n return response.caseOf({\n Left: (err) => {\n this._logger.error(\"[sendCommand] error\", { data: { err } });\n throw err;\n },\n Right: (r) => {\n const result = command.parseResponse(\n r,\n this._connectedDevice.deviceModel.id,\n );\n this._logger.debug(\"[sendCommand] result\", { data: { result } });\n return result;\n },\n });\n }\n\n public executeDeviceAction<\n Output,\n Input,\n E extends DmkError,\n IntermediateValue extends DeviceActionIntermediateValue,\n >(\n deviceAction: DeviceAction<Output, Input, E, IntermediateValue>,\n ): ExecuteDeviceActionReturnType<Output, E, IntermediateValue> {\n const { observable, cancel } = deviceAction._execute({\n sendApdu: async (apdu: Uint8Array) => this.sendApdu(apdu),\n sendCommand: async <Response, ErrorStatusCodes, Args>(\n command: Command<Response, ErrorStatusCodes, Args>,\n abortTimeout?: number,\n ) => this.sendCommand(command, abortTimeout),\n getDeviceModel: () => this._connectedDevice.deviceModel,\n getDeviceSessionState: () => this._deviceState.getValue(),\n getDeviceSessionStateObservable: () => this.state,\n setDeviceSessionState: (state: DeviceSessionState) => {\n this.setDeviceSessionState(state);\n return this._deviceState.getValue();\n },\n disableRefresher: (blockerId: string) =>\n this._refresherService.disableRefresher(blockerId),\n getManagerApiService: () => this._managerApiService,\n getSecureChannelService: () => this._secureChannelService,\n });\n return { observable, cancel };\n }\n\n public close(): void {\n this._updateDeviceStatus(DeviceStatus.NOT_CONNECTED);\n this._deviceState.complete();\n this._deviceSessionRefresher.stopRefresher();\n }\n\n public disableRefresher(id: string): () => void {\n return this._refresherService.disableRefresher(id);\n }\n\n private _updateDeviceStatus(deviceStatus: DeviceStatus): void {\n const state = this._deviceState.getValue();\n this._deviceState.next({ ...state, deviceStatus });\n }\n}\n"],
5
+ "mappings": "AACA,OAAS,mBAAAA,MAAwC,OACjD,OAAS,MAAMC,MAAc,OAI7B,OAAS,gBAAAC,MAAoB,kCAC7B,OAAS,gBAAAC,MAAoB,2BAO7B,OAEE,0BAAAC,MACK,yCAKP,OAAS,wBAAAC,MAA4B,sBACrC,OAAS,4CAAAC,MAAgD,4DACzD,OAAS,gBAAAC,MAAoB,gDAC7B,OAAS,oBAAAC,MAAwB,oDAIjC,OAAS,gBAAAC,MAAoB,iBAC7B,OACE,gCAAAC,EACA,iBAAAC,MACK,iCACP,OAAS,0BAAAC,MAA8B,2BACvC,OAAS,6BAAAC,MAAiC,8BAqBnC,MAAMC,CAAc,CACR,IACA,iBACA,aACA,mBACA,sBACA,QACA,kBACT,QACA,wBACS,kBACT,cAAgB,IAAIP,EACpB,wBAA0B,IAAIG,EAEtC,YACE,CAAE,gB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CAEO,oBAMLI,EAC6D,CAC7D,KAAM,CAAE,WAAAC,EAAY,OAAAC,CAAO,EAAIF,EAAa,SAAS,CACnD,SAAU,MAAOF,GAAqB,KAAK,SAASA,CAAI,EACxD,YAAa,MACXT,EACAC,IACG,KAAK,YAAYD,EAASC,CAAY,EAC3C,eAAgB,IAAM,KAAK,iBAAiB,YAC5C,sBAAuB,IAAM,KAAK,aAAa,SAAS,EACxD,gCAAiC,IAAM,KAAK,MAC5C,sBAAwBC,IACtB,KAAK,sBAAsBA,CAAK,EACzB,KAAK,aAAa,SAAS,GAEpC,iBAAmBY,GACjB,KAAK,kBAAkB,iBAAiBA,CAAS,EACnD,qBAAsB,IAAM,KAAK,mBACjC,wBAAyB,IAAM,KAAK,qBACtC,CAAC,EACD,MAAO,CAAE,WAAAF,EAAY,OAAAC,CAAO,CAC9B,CAEO,OAAc,CACnB,KAAK,oBAAoB/B,EAAa,aAAa,EACnD,KAAK,aAAa,SAAS,EAC3B,KAAK,wBAAwB,cAAc,CAC7C,CAEO,iBAAiBa,EAAwB,CAC9C,OAAO,KAAK,kBAAkB,iBAAiBA,CAAE,CACnD,CAEQ,oBAAoBoB,EAAkC,CAC5D,MAAMb,EAAQ,KAAK,aAAa,SAAS,EACzC,KAAK,aAAa,KAAK,CAAE,GAAGA,EAAO,aAAAa,CAAa,CAAC,CACnD,CACF",
6
+ "names": ["BehaviorSubject", "uuidv4", "CommandUtils", "DeviceStatus", "DeviceSessionStateType", "formatApduSendingLog", "DEVICE_SESSION_REFRESHER_DEFAULT_OPTIONS", "MutexService", "RefresherService", "DevicePinger", "DeviceSessionEventDispatcher", "SessionEvents", "DeviceSessionRefresher", "DeviceSessionStateHandler", "DeviceSession", "connectedDevice", "id", "loggerModuleFactory", "managerApiService", "secureChannelService", "deviceSessionRefresherOptions", "command", "abortTimeout", "state", "error", "rawApdu", "options", "release", "result", "response", "apdu", "err", "deviceAction", "observable", "cancel", "blockerId", "deviceStatus"]
7
7
  }
@@ -1,4 +1,4 @@
1
- import { type Container } from "inversify";
1
+ import { type Container, type Factory } from "inversify";
2
2
  import { type Observable } from "rxjs";
3
3
  import { type CommandResult } from "./command/model/CommandResult";
4
4
  import { type SendCommandUseCaseArgs } from "./command/use-case/SendCommandUseCase";
@@ -7,7 +7,7 @@ import { type ApduResponse } from "./device-session/ApduResponse";
7
7
  import { type DeviceSessionState } from "./device-session/DeviceSessionState";
8
8
  import { type DeviceSessionId } from "./device-session/types";
9
9
  import { type ConnectedDevice } from "./transport/model/ConnectedDevice";
10
- import { type ConnectUseCaseArgs, type DisconnectUseCaseArgs, type DiscoveredDevice, type GetConnectedDeviceUseCaseArgs, type SendApduUseCaseArgs, type StartDiscoveringUseCaseArgs } from "./types";
10
+ import { type ConnectUseCaseArgs, type DisconnectUseCaseArgs, type DiscoveredDevice, type GetConnectedDeviceUseCaseArgs, type LoggerPublisherService, type SendApduUseCaseArgs, type StartDiscoveringUseCaseArgs } from "./types";
11
11
  import { type ListenToAvailableDevicesUseCaseArgs } from "../internal/discovery/use-case/ListenToAvailableDevicesUseCase";
12
12
  import { type ReconnectUseCaseArgs } from "../internal/discovery/use-case/ReconnectUseCase";
13
13
  import { type DeviceActionIntermediateValue, type ExecuteDeviceActionReturnType } from "./device-action/DeviceAction";
@@ -147,5 +147,9 @@ export declare class DeviceManagementKit {
147
147
  * Check if the current environment is supported by any transport.
148
148
  */
149
149
  isEnvironmentSupported(): boolean;
150
+ /**
151
+ * Returns the DMK logger factory with configured logger subscribers.
152
+ */
153
+ getLoggerFactory(): Factory<LoggerPublisherService>;
150
154
  }
151
155
  //# sourceMappingURL=DeviceManagementKit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceManagementKit.d.ts","sourceRoot":"","sources":["../../../../src/api/DeviceManagementKit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAGv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kB,CAAC;IAQlC;;;OAGG;IACH,KAAK;IAML;;;;OAIG;IACH,oBAAoB,IAAI,eAAe,EAAE;IAQzC;;;;OAIG;IACH,uBAAuB,IAAI,UAAU,CAAC,eAAe,CAAC;IAQtD;;;;;OAKG;IACH,6BAA6B,CAAC,IAAI,EAAE;QAClC,SAAS,EAAE,eAAe,CAAC;QAC3B,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,MAAM,IAAI;IAOd;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMnC;;OAEG;IACH,WAAW,IAAI,MAAM;IAMrB;;OAEG;IACH,sBAAsB,IAAI,OAAO;IAOjC;;OAEG;IACH,gBAAgB,IAAI,OAAO,CAAC,sBAAsB,CAAC;CAGpD"}
@@ -14,6 +14,7 @@ export declare enum UserInteractionRequired {
14
14
  SignPersonalMessage = "sign-personal-message",
15
15
  SignDelegationAuthorization = "sign-delegation-authorization",
16
16
  Web3ChecksOptIn = "web3-checks-opt-in",
17
- VerifySafeAddress = "verify-safe-address"
17
+ VerifySafeAddress = "verify-safe-address",
18
+ RegisterWallet = "register-wallet"
18
19
  }
19
20
  //# sourceMappingURL=UserInteractionRequired.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserInteractionRequired.d.ts","sourceRoot":"","sources":["../../../../../../src/api/device-action/model/UserInteractionRequired.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,uBAAuB;IACjC,IAAI,SAAS;IACb,YAAY,kBAAkB;IAC9B,qBAAqB,4BAA4B;IACjD,cAAc,qBAAqB;IACnC,eAAe,qBAAqB;IACpC,aAAa,oBAAoB;IACjC,aAAa,oBAAoB;IACjC,aAAa,mBAAmB;IAChC,mBAAmB,0BAA0B;IAC7C,2BAA2B,kCAAkC;IAC7D,eAAe,uBAAuB;IACtC,iBAAiB,wBAAwB;CAC1C"}
1
+ {"version":3,"file":"UserInteractionRequired.d.ts","sourceRoot":"","sources":["../../../../../../src/api/device-action/model/UserInteractionRequired.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,uBAAuB;IACjC,IAAI,SAAS;IACb,YAAY,kBAAkB;IAC9B,qBAAqB,4BAA4B;IACjD,cAAc,qBAAqB;IACnC,eAAe,qBAAqB;IACpC,aAAa,oBAAoB;IACjC,aAAa,oBAAoB;IACjC,aAAa,mBAAmB;IAChC,mBAAmB,0BAA0B;IAC7C,2BAA2B,kCAAkC;IAC7D,eAAe,uBAAuB;IACtC,iBAAiB,wBAAwB;IACzC,cAAc,oBAAoB;CACnC"}
@@ -12,10 +12,11 @@ export type PredictOutOfMemoryTaskResult = {
12
12
  export declare class PredictOutOfMemoryTask {
13
13
  private readonly api;
14
14
  private readonly args;
15
- private readonly blockSize;
16
- private readonly memoryBlocks;
15
+ private readonly deviceModel;
17
16
  constructor(api: InternalApi, args: PredictOutOfMemoryTaskArgs);
18
17
  run(): PredictOutOfMemoryTaskResult;
19
- private bytesToBlocks;
18
+ private getMemoryConstants;
19
+ private getCurrentMemoryBlocksUsage;
20
+ private getInstallPlanMemoryBlocksUsage;
20
21
  }
21
22
  //# sourceMappingURL=PredictOutOfMemoryTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PredictOutOfMemoryTask.d.ts","sourceRoot":"","sources":["../../../../../../src/api/device-action/task/PredictOutOfMemoryTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAE3E,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,WAAW,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GACpC;IACE,WAAW,EAAE,OAAO,CAAC;CACtB,GACD;IACE,KAAK,EAAE,cAAc,CAAC;CACvB,CAAC;AAEN,qBAAa,sBAAsB;IAK/B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IALvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAGnB,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,0BAA0B;IAOnD,GAAG,IAAI,4BAA4B;IA2CnC,OAAO,CAAC,aAAa;CAGtB"}
1
+ {"version":3,"file":"PredictOutOfMemoryTask.d.ts","sourceRoot":"","sources":["../../../../../../src/api/device-action/task/PredictOutOfMemoryTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAS9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAE3E,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,WAAW,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GACpC;IACE,WAAW,EAAE,OAAO,CAAC;CACtB,GACD;IACE,KAAK,EAAE,cAAc,CAAC;CACvB,CAAC;AAEN,qBAAa,sBAAsB;IAI/B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;gBAGhC,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,0BAA0B;IAKnD,GAAG,IAAI,4BAA4B;IA8CnC,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,2BAA2B;IA+BnC,OAAO,CAAC,+BAA+B;CAUxC"}
@@ -15,6 +15,9 @@ export declare class StaticDeviceModelDataSource implements DeviceModelDataSourc
15
15
  * Returns the list of device models that match all the given parameters
16
16
  */
17
17
  filterDeviceModels(params: Partial<TransportDeviceModel>): TransportDeviceModel[];
18
+ /**
19
+ * @returns A record of service UUIDs to BleDeviceInfos
20
+ */
18
21
  getBluetoothServicesInfos(): Record<string, BleDeviceInfos>;
19
22
  getBluetoothServices(): string[];
20
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StaticDeviceModelDataSource.d.ts","sourceRoot":"","sources":["../../../../../../src/api/device-model/data/StaticDeviceModelDataSource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E;;GAEG;AACH,qBACa,2BAA4B,YAAW,qBAAqB;IACvE,OAAO,CAAC,MAAM,CAAC,gBAAgB,CA+F7B;IAEF,kBAAkB,IAAI,oBAAoB,EAAE;IAI5C,cAAc,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,aAAa,CAAA;KAAE,GAAG,oBAAoB;IAInE;;OAEG;IACH,kBAAkB,CAChB,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACpC,oBAAoB,EAAE;IAQzB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC;IA2B3D,oBAAoB,IAAI,MAAM,EAAE;CAQjC"}
1
+ {"version":3,"file":"StaticDeviceModelDataSource.d.ts","sourceRoot":"","sources":["../../../../../../src/api/device-model/data/StaticDeviceModelDataSource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E;;GAEG;AACH,qBACa,2BAA4B,YAAW,qBAAqB;IACvE,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAwG7B;IAEF,kBAAkB,IAAI,oBAAoB,EAAE;IAI5C,cAAc,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,aAAa,CAAA;KAAE,GAAG,oBAAoB;IAInE;;OAEG;IACH,kBAAkB,CAChB,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACpC,oBAAoB,EAAE;IAQzB;;OAEG;IACH,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC;IA2B3D,oBAAoB,IAAI,MAAM,EAAE;CAQjC"}