@ledgerhq/device-management-kit 1.1.0 → 1.2.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 (204) hide show
  1. package/lib/cjs/package.json +1 -1
  2. package/lib/cjs/src/api/apdu/utils/ApduBuilder.js +1 -1
  3. package/lib/cjs/src/api/apdu/utils/ApduBuilder.js.map +3 -3
  4. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  5. package/lib/cjs/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  6. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  7. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +3 -3
  8. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  9. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +3 -3
  10. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -1
  11. package/lib/cjs/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +3 -3
  12. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +1 -1
  13. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +2 -2
  14. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +1 -1
  15. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +3 -3
  16. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js +1 -1
  17. package/lib/cjs/src/api/device-action/os/GetDeviceMetadata/types.js.map +3 -3
  18. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  19. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +3 -3
  20. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  21. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
  22. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/types.js +1 -1
  23. package/lib/cjs/src/api/device-action/os/GetDeviceStatus/types.js.map +3 -3
  24. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  25. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  26. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
  27. package/lib/cjs/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
  28. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js +1 -1
  29. package/lib/cjs/src/api/device-action/os/GoToDashboard/types.js.map +3 -3
  30. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +1 -1
  31. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +2 -2
  32. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +1 -1
  33. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +2 -2
  34. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -1
  35. package/lib/cjs/src/api/device-action/os/InstallOrUpdateApps/types.js.map +3 -3
  36. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  37. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +3 -3
  38. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
  39. package/lib/cjs/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
  40. package/lib/cjs/src/api/device-action/os/ListApps/types.js +1 -1
  41. package/lib/cjs/src/api/device-action/os/ListApps/types.js.map +3 -3
  42. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
  43. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +3 -3
  44. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
  45. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
  46. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/types.js +1 -1
  47. package/lib/cjs/src/api/device-action/os/ListAppsWithMetadata/types.js.map +3 -3
  48. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  49. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  50. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  51. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
  52. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -1
  53. package/lib/cjs/src/api/device-action/os/OpenAppDeviceAction/types.js.map +3 -3
  54. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +1 -1
  55. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +3 -3
  56. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +1 -1
  57. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +3 -3
  58. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -1
  59. package/lib/cjs/src/api/device-action/os/OpenAppWithDependencies/types.js.map +3 -3
  60. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  61. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +3 -3
  62. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  63. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
  64. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -1
  65. package/lib/cjs/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +3 -3
  66. package/lib/cjs/src/api/index.js +1 -1
  67. package/lib/cjs/src/api/index.js.map +3 -3
  68. package/lib/cjs/src/api/types.js +1 -1
  69. package/lib/cjs/src/api/types.js.map +1 -1
  70. package/lib/cjs/src/api/utils/ApplicationChecker.js +2 -0
  71. package/lib/cjs/src/api/utils/ApplicationChecker.js.map +7 -0
  72. package/lib/cjs/src/api/utils/ApplicationChecker.test.js +2 -0
  73. package/lib/cjs/src/api/utils/ApplicationChecker.test.js.map +7 -0
  74. package/lib/cjs/src/api/utils/ApplicationResolver.js +2 -0
  75. package/lib/cjs/src/api/utils/ApplicationResolver.js.map +7 -0
  76. package/lib/cjs/src/api/utils/Base64String.js +1 -1
  77. package/lib/cjs/src/api/utils/Base64String.js.map +3 -3
  78. package/lib/cjs/src/api/utils/Base64String.test.js +1 -1
  79. package/lib/cjs/src/api/utils/Base64String.test.js.map +3 -3
  80. package/lib/esm/package.json +1 -1
  81. package/lib/esm/src/api/apdu/utils/ApduBuilder.js +1 -1
  82. package/lib/esm/src/api/apdu/utils/ApduBuilder.js.map +3 -3
  83. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js +1 -1
  84. package/lib/esm/src/api/device-action/__test-utils__/setupTestMachine.js.map +3 -3
  85. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js +1 -1
  86. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.js.map +3 -3
  87. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js +1 -1
  88. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.test.js.map +3 -3
  89. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js +1 -0
  90. package/lib/esm/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.js.map +4 -4
  91. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js +1 -1
  92. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.js.map +3 -3
  93. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js +1 -1
  94. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.test.js.map +3 -3
  95. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js +1 -0
  96. package/lib/esm/src/api/device-action/os/GetDeviceMetadata/types.js.map +4 -4
  97. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js +1 -1
  98. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.js.map +3 -3
  99. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js +1 -1
  100. package/lib/esm/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.test.js.map +3 -3
  101. package/lib/esm/src/api/device-action/os/GetDeviceStatus/types.js +1 -0
  102. package/lib/esm/src/api/device-action/os/GetDeviceStatus/types.js.map +4 -4
  103. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js +1 -1
  104. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.js.map +3 -3
  105. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js +1 -1
  106. package/lib/esm/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.test.js.map +3 -3
  107. package/lib/esm/src/api/device-action/os/GoToDashboard/types.js +1 -0
  108. package/lib/esm/src/api/device-action/os/GoToDashboard/types.js.map +4 -4
  109. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js +1 -1
  110. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.js.map +3 -3
  111. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js +1 -1
  112. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.test.js.map +3 -3
  113. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js +1 -0
  114. package/lib/esm/src/api/device-action/os/InstallOrUpdateApps/types.js.map +4 -4
  115. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js +1 -1
  116. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.js.map +3 -3
  117. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js +1 -1
  118. package/lib/esm/src/api/device-action/os/ListApps/ListAppsDeviceAction.test.js.map +3 -3
  119. package/lib/esm/src/api/device-action/os/ListApps/types.js +1 -0
  120. package/lib/esm/src/api/device-action/os/ListApps/types.js.map +4 -4
  121. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js +1 -1
  122. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.js.map +3 -3
  123. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js +1 -1
  124. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.test.js.map +3 -3
  125. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/types.js +1 -0
  126. package/lib/esm/src/api/device-action/os/ListAppsWithMetadata/types.js.map +4 -4
  127. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js +1 -1
  128. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.js.map +3 -3
  129. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js +1 -1
  130. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.test.js.map +3 -3
  131. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/types.js +1 -0
  132. package/lib/esm/src/api/device-action/os/OpenAppDeviceAction/types.js.map +4 -4
  133. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js +1 -1
  134. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.js.map +3 -3
  135. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js +1 -1
  136. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.js.map +3 -3
  137. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js +1 -0
  138. package/lib/esm/src/api/device-action/os/OpenAppWithDependencies/types.js.map +4 -4
  139. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js +1 -1
  140. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.js.map +3 -3
  141. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js +1 -1
  142. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.js.map +3 -3
  143. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js +1 -0
  144. package/lib/esm/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.js.map +4 -4
  145. package/lib/esm/src/api/index.js +1 -1
  146. package/lib/esm/src/api/index.js.map +3 -3
  147. package/lib/esm/src/api/utils/ApplicationChecker.js +2 -0
  148. package/lib/esm/src/api/utils/ApplicationChecker.js.map +7 -0
  149. package/lib/esm/src/api/utils/ApplicationChecker.test.js +2 -0
  150. package/lib/esm/src/api/utils/ApplicationChecker.test.js.map +7 -0
  151. package/lib/esm/src/api/utils/ApplicationResolver.js +1 -0
  152. package/lib/esm/src/api/utils/ApplicationResolver.js.map +7 -0
  153. package/lib/esm/src/api/utils/Base64String.js +1 -1
  154. package/lib/esm/src/api/utils/Base64String.js.map +3 -3
  155. package/lib/esm/src/api/utils/Base64String.test.js +1 -1
  156. package/lib/esm/src/api/utils/Base64String.test.js.map +3 -3
  157. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts +7 -0
  158. package/lib/types/src/api/apdu/utils/ApduBuilder.d.ts.map +1 -1
  159. package/lib/types/src/api/device-action/__test-utils__/setupTestMachine.d.ts.map +1 -1
  160. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction.d.ts.map +1 -1
  161. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts +9 -1
  162. package/lib/types/src/api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes.d.ts.map +1 -1
  163. package/lib/types/src/api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction.d.ts.map +1 -1
  164. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts +13 -2
  165. package/lib/types/src/api/device-action/os/GetDeviceMetadata/types.d.ts.map +1 -1
  166. package/lib/types/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.d.ts.map +1 -1
  167. package/lib/types/src/api/device-action/os/GetDeviceStatus/types.d.ts +6 -0
  168. package/lib/types/src/api/device-action/os/GetDeviceStatus/types.d.ts.map +1 -1
  169. package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts +1 -1
  170. package/lib/types/src/api/device-action/os/GoToDashboard/GoToDashboardDeviceAction.d.ts.map +1 -1
  171. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts +9 -1
  172. package/lib/types/src/api/device-action/os/GoToDashboard/types.d.ts.map +1 -1
  173. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction.d.ts.map +1 -1
  174. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts +9 -1
  175. package/lib/types/src/api/device-action/os/InstallOrUpdateApps/types.d.ts.map +1 -1
  176. package/lib/types/src/api/device-action/os/ListApps/ListAppsDeviceAction.d.ts.map +1 -1
  177. package/lib/types/src/api/device-action/os/ListApps/types.d.ts +6 -0
  178. package/lib/types/src/api/device-action/os/ListApps/types.d.ts.map +1 -1
  179. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction.d.ts.map +1 -1
  180. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/types.d.ts +8 -1
  181. package/lib/types/src/api/device-action/os/ListAppsWithMetadata/types.d.ts.map +1 -1
  182. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction.d.ts.map +1 -1
  183. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts +12 -2
  184. package/lib/types/src/api/device-action/os/OpenAppDeviceAction/types.d.ts.map +1 -1
  185. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.d.ts.map +1 -1
  186. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts +8 -0
  187. package/lib/types/src/api/device-action/os/OpenAppWithDependencies/types.d.ts.map +1 -1
  188. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.d.ts.map +1 -1
  189. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts +9 -1
  190. package/lib/types/src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.d.ts.map +1 -1
  191. package/lib/types/src/api/index.d.ts +4 -2
  192. package/lib/types/src/api/index.d.ts.map +1 -1
  193. package/lib/types/src/api/types.d.ts +1 -0
  194. package/lib/types/src/api/types.d.ts.map +1 -1
  195. package/lib/types/src/api/utils/ApplicationChecker.d.ts +14 -0
  196. package/lib/types/src/api/utils/ApplicationChecker.d.ts.map +1 -0
  197. package/lib/types/src/api/utils/ApplicationChecker.test.d.ts +2 -0
  198. package/lib/types/src/api/utils/ApplicationChecker.test.d.ts.map +1 -0
  199. package/lib/types/src/api/utils/ApplicationResolver.d.ts +12 -0
  200. package/lib/types/src/api/utils/ApplicationResolver.d.ts.map +1 -0
  201. package/lib/types/src/api/utils/Base64String.d.ts +1 -0
  202. package/lib/types/src/api/utils/Base64String.d.ts.map +1 -1
  203. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  204. package/package.json +5 -5
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction.test.ts"],
4
- "sourcesContent": ["import { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport {\n setupGetDeviceMetadataMock,\n setupInstallOrUpdateAppsMock,\n setupOpenAppMock,\n} from \"@api/device-action/__test-utils__/setupTestMachine\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport { DeviceActionStatus } from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport {\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nimport type { GetDeviceMetadataDAOutput } from \"@api/device-action/os/GetDeviceMetadata/types\";\nimport type { InstallOrUpdateAppsDAIntermediateValue } from \"@api/device-action/os/InstallOrUpdateApps/types\";\nimport type { Application } from \"@internal/manager-api/model/Application\";\n\nimport { OpenAppWithDependenciesDeviceAction } from \"./OpenAppWithDependenciesDeviceAction\";\nimport type { OpenAppWithDependenciesDAState } from \"./types\";\n\nvi.mock(\"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\");\nvi.mock(\n \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\",\n);\nvi.mock(\n \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\",\n);\n\ndescribe(\"OpenAppWithDependenciesDeviceAction\", () => {\n const apiMock = makeDeviceActionInternalApiMock();\n\n const DEVICE_METADATA = {\n firmwareUpdateContext: {},\n } as unknown as GetDeviceMetadataDAOutput;\n\n const INSTALL_INTERMEDIATE_VALUE: InstallOrUpdateAppsDAIntermediateValue = {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: {\n installPlan: [{ versionName: \"1inch\" }] as unknown as Application[],\n alreadyInstalled: [\"Ethereum\", \"Uniswap\"],\n missingApplications: [\"\"],\n currentIndex: 0,\n currentProgress: 0.5,\n },\n };\n\n const INSTALL_RESULT = {\n successfullyInstalled: [\n { versionName: \"1inch\" },\n ] as unknown as Application[],\n alreadyInstalled: [\"Ethereum\", \"Uniswap\"],\n missingApplications: [\"\"],\n };\n\n beforeEach(() => {\n vi.clearAllMocks();\n });\n\n describe(\"success cases\", () => {\n it(\"Open app with dependencies\", () =>\n new Promise<void>((resolve, reject) => {\n setupGetDeviceMetadataMock(DEVICE_METADATA);\n setupInstallOrUpdateAppsMock(\n INSTALL_RESULT,\n INSTALL_INTERMEDIATE_VALUE,\n );\n setupOpenAppMock();\n const deviceAction = new OpenAppWithDependenciesDeviceAction({\n input: {\n application: { name: \"Ethereum\" },\n dependencies: [{ name: \"Uniswap\" }, { name: \"1inch\" }],\n requireLatestFirmware: false,\n },\n });\n\n const expectedStates: Array<OpenAppWithDependenciesDAState> = [\n // GetDeviceMetadata\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n // InstallOrUpdateApps\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: INSTALL_INTERMEDIATE_VALUE,\n status: DeviceActionStatus.Pending,\n },\n // OpenApp\n {\n intermediateValue: INSTALL_INTERMEDIATE_VALUE,\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n // Success\n {\n output: {\n deviceMetadata: DEVICE_METADATA,\n installResult: INSTALL_RESULT,\n },\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(deviceAction, expectedStates, apiMock, {\n onDone: resolve,\n onError: reject,\n });\n }));\n });\n\n describe(\"error cases\", () => {\n it(\"Get device metadata error\", () =>\n new Promise<void>((resolve, reject) => {\n setupGetDeviceMetadataMock(DEVICE_METADATA, true);\n const deviceAction = new OpenAppWithDependenciesDeviceAction({\n input: {\n application: { name: \"Ethereum\" },\n dependencies: [{ name: \"Uniswap\" }, { name: \"1inch\" }],\n requireLatestFirmware: false,\n },\n });\n\n const expectedStates: Array<OpenAppWithDependenciesDAState> = [\n // GetDeviceMetadata\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n // Error\n {\n error: new UnknownDAError(\"GetDeviceMetadata failed\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(deviceAction, expectedStates, apiMock, {\n onDone: resolve,\n onError: reject,\n });\n }));\n\n it(\"Unsupported firmware\", () =>\n new Promise<void>((resolve, reject) => {\n const metadataWithUpdate = {\n firmwareUpdateContext: {\n availableUpdate: \"mockUpdate\",\n },\n } as unknown as GetDeviceMetadataDAOutput;\n setupGetDeviceMetadataMock(metadataWithUpdate);\n const deviceAction = new OpenAppWithDependenciesDeviceAction({\n input: {\n application: { name: \"Ethereum\" },\n dependencies: [{ name: \"Uniswap\" }, { name: \"1inch\" }],\n requireLatestFirmware: true,\n },\n });\n\n const expectedStates: Array<OpenAppWithDependenciesDAState> = [\n // GetDeviceMetadata\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n // Error\n {\n error: new UnsupportedFirmwareDAError(\n \"Firmware is not the latest version\",\n ),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(deviceAction, expectedStates, apiMock, {\n onDone: resolve,\n onError: reject,\n });\n }));\n\n it(\"Install apps error\", () =>\n new Promise<void>((resolve, reject) => {\n const metadataWithUpdate = {\n firmwareUpdateContext: {\n availableUpdate: \"mockUpdate\",\n },\n } as unknown as GetDeviceMetadataDAOutput;\n setupGetDeviceMetadataMock(metadataWithUpdate);\n setupInstallOrUpdateAppsMock(\n INSTALL_RESULT,\n INSTALL_INTERMEDIATE_VALUE,\n true,\n );\n const deviceAction = new OpenAppWithDependenciesDeviceAction({\n input: {\n application: { name: \"Ethereum\" },\n dependencies: [{ name: \"Uniswap\" }, { name: \"1inch\" }],\n requireLatestFirmware: false,\n },\n });\n\n const expectedStates: Array<OpenAppWithDependenciesDAState> = [\n // GetDeviceMetadata\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n // InstallOrUpdateApps\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: INSTALL_INTERMEDIATE_VALUE,\n status: DeviceActionStatus.Pending,\n },\n // Error\n {\n error: new UnknownDAError(\"InstallOrUpdateApps failed\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(deviceAction, expectedStates, apiMock, {\n onDone: resolve,\n onError: reject,\n });\n }));\n\n it(\"Open app error\", () =>\n new Promise<void>((resolve, reject) => {\n setupGetDeviceMetadataMock(DEVICE_METADATA);\n setupInstallOrUpdateAppsMock(\n INSTALL_RESULT,\n INSTALL_INTERMEDIATE_VALUE,\n );\n setupOpenAppMock(true);\n const deviceAction = new OpenAppWithDependenciesDeviceAction({\n input: {\n application: { name: \"Ethereum\" },\n dependencies: [{ name: \"Uniswap\" }, { name: \"1inch\" }],\n requireLatestFirmware: false,\n },\n });\n\n const expectedStates: Array<OpenAppWithDependenciesDAState> = [\n // GetDeviceMetadata\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n // InstallOrUpdateApps\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: INSTALL_INTERMEDIATE_VALUE,\n status: DeviceActionStatus.Pending,\n },\n // OpenApp\n {\n intermediateValue: INSTALL_INTERMEDIATE_VALUE,\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n installPlan: null,\n },\n status: DeviceActionStatus.Pending,\n },\n // Error\n {\n error: new UnknownDAError(\"OpenApp failed\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(deviceAction, expectedStates, apiMock, {\n onDone: resolve,\n onError: reject,\n });\n }));\n });\n});\n"],
5
- "mappings": "aAAA,IAAAA,EAAgD,6DAChDC,EAIO,8DACPC,EAAuC,oEACvCC,EAAmC,sDACnCC,EAAwC,4DACxCC,EAGO,wCAKPC,EAAoD,iDAGpD,GAAG,KAAK,+DAA+D,EACvE,GAAG,KACD,2EACF,EACA,GAAG,KACD,uEACF,EAEA,SAAS,sCAAuC,IAAM,CACpD,MAAMC,KAAU,mCAAgC,EAE1CC,EAAkB,CACtB,sBAAuB,CAAC,CAC1B,EAEMC,EAAqE,CACzE,wBAAyB,0BAAwB,KACjD,YAAa,CACX,YAAa,CAAC,CAAE,YAAa,OAAQ,CAAC,EACtC,iBAAkB,CAAC,WAAY,SAAS,EACxC,oBAAqB,CAAC,EAAE,EACxB,aAAc,EACd,gBAAiB,EACnB,CACF,EAEMC,EAAiB,CACrB,sBAAuB,CACrB,CAAE,YAAa,OAAQ,CACzB,EACA,iBAAkB,CAAC,WAAY,SAAS,EACxC,oBAAqB,CAAC,EAAE,CAC1B,EAEA,WAAW,IAAM,CACf,GAAG,cAAc,CACnB,CAAC,EAED,SAAS,gBAAiB,IAAM,CAC9B,GAAG,6BAA8B,IAC/B,IAAI,QAAc,CAACC,EAASC,IAAW,IACrC,8BAA2BJ,CAAe,KAC1C,gCACEE,EACAD,CACF,KACA,oBAAiB,EACjB,MAAMI,EAAe,IAAI,sCAAoC,CAC3D,MAAO,CACL,YAAa,CAAE,KAAM,UAAW,EAChC,aAAc,CAAC,CAA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,CACX,CAAC,CACH,CAAC,CAAC,CACN,CAAC,CACH,CAAC",
6
- "names": ["import_makeInternalApi", "import_setupTestMachine", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_OpenAppWithDependenciesDeviceAction", "apiMock", "DEVICE_METADATA", "INSTALL_INTERMEDIATE_VALUE", "INSTALL_RESULT", "resolve", "reject", "deviceAction", "expectedStates"]
4
+ "sourcesContent": ["import { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport {\n setupGetDeviceMetadataMock,\n setupInstallOrUpdateAppsMock,\n setupOpenAppMock,\n} from \"@api/device-action/__test-utils__/setupTestMachine\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport { DeviceActionStatus } from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport {\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nimport type { GetDeviceMetadataDAOutput } from \"@api/device-action/os/GetDeviceMetadata/types\";\nimport {\n type InstallOrUpdateAppsDAIntermediateValue,\n installOrUpdateAppsDAStateStep,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nimport type { Application } from \"@internal/manager-api/model/Application\";\n\nimport { OpenAppWithDependenciesDeviceAction } from \"./OpenAppWithDependenciesDeviceAction\";\nimport {\n type OpenAppWithDependenciesDAState,\n openAppWithDependenciesDAStateStep,\n} from \"./types\";\n\nvi.mock(\"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\");\nvi.mock(\n \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\",\n);\nvi.mock(\n \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\",\n);\n\ndescribe(\"OpenAppWithDependenciesDeviceAction\", () => {\n const apiMock = makeDeviceActionInternalApiMock();\n\n const DEVICE_METADATA = {\n firmwareUpdateContext: {},\n } as unknown as GetDeviceMetadataDAOutput;\n\n const INSTALL_INTERMEDIATE_VALUE: InstallOrUpdateAppsDAIntermediateValue = {\n requiredUserInteraction: UserInteractionRequired.None,\n step: installOrUpdateAppsDAStateStep.INSTALL_APPLICATION,\n installPlan: {\n installPlan: [{ versionName: \"1inch\" }] as unknown as Application[],\n alreadyInstalled: [\"Ethereum\", \"Uniswap\"],\n missingApplications: [\"\"],\n currentIndex: 0,\n currentProgress: 0.5,\n },\n };\n\n const INSTALL_RESULT = {\n successfullyInstalled: [\n { versionName: \"1inch\" },\n ] as unknown as Application[],\n alreadyInstalled: [\"Ethereum\", \"Uniswap\"],\n missingApplications: [\"\"],\n };\n\n beforeEach(() => {\n vi.clearAllMocks();\n });\n\n describe(\"success cases\", () => {\n it(\"Open app with dependencies\", () =>\n new Promise<void>((resolve, reject) => {\n setupGetDeviceMetadataMock(DEVICE_METADATA);\n setupInstallOrUpdateAppsMock(\n INSTALL_RESULT,\n INSTALL_INTERMEDIATE_VALUE,\n );\n setupOpenAppMock();\n const deviceAction = new OpenAppWithDependenciesDeviceAction({\n input: {\n application: { name: \"Ethereum\" },\n dependencies: [{ name: \"Uniswap\" }, { name: \"1inch\" }],\n requireLatestFirmware: false,\n },\n });\n\n const expectedStates: Array<OpenAppWithDependenciesDAState> = [\n // GetDeviceMetadata\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n // InstallOrUpdateApps\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n ...INSTALL_INTERMEDIATE_VALUE,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n // OpenApp\n {\n intermediateValue: {\n ...INSTALL_INTERMEDIATE_VALUE,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n installPlan: null,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n // Success\n {\n output: {\n deviceMetadata: DEVICE_METADATA,\n installResult: INSTALL_RESULT,\n },\n status: DeviceActionStatus.Completed,\n },\n ];\n\n testDeviceActionStates(deviceAction, expectedStates, apiMock, {\n onDone: resolve,\n onError: reject,\n });\n }));\n });\n\n describe(\"error cases\", () => {\n it(\"Get device metadata error\", () =>\n new Promise<void>((resolve, reject) => {\n setupGetDeviceMetadataMock(DEVICE_METADATA, true);\n const deviceAction = new OpenAppWithDependenciesDeviceAction({\n input: {\n application: { name: \"Ethereum\" },\n dependencies: [{ name: \"Uniswap\" }, { name: \"1inch\" }],\n requireLatestFirmware: false,\n },\n });\n\n const expectedStates: Array<OpenAppWithDependenciesDAState> = [\n // GetDeviceMetadata\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n // Error\n {\n error: new UnknownDAError(\"GetDeviceMetadata failed\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(deviceAction, expectedStates, apiMock, {\n onDone: resolve,\n onError: reject,\n });\n }));\n\n it(\"Unsupported firmware\", () =>\n new Promise<void>((resolve, reject) => {\n const metadataWithUpdate = {\n firmwareUpdateContext: {\n availableUpdate: \"mockUpdate\",\n },\n } as unknown as GetDeviceMetadataDAOutput;\n setupGetDeviceMetadataMock(metadataWithUpdate);\n const deviceAction = new OpenAppWithDependenciesDeviceAction({\n input: {\n application: { name: \"Ethereum\" },\n dependencies: [{ name: \"Uniswap\" }, { name: \"1inch\" }],\n requireLatestFirmware: true,\n },\n });\n\n const expectedStates: Array<OpenAppWithDependenciesDAState> = [\n // GetDeviceMetadata\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n // Error\n {\n error: new UnsupportedFirmwareDAError(\n \"Firmware is not the latest version\",\n ),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(deviceAction, expectedStates, apiMock, {\n onDone: resolve,\n onError: reject,\n });\n }));\n\n it(\"Install apps error\", () =>\n new Promise<void>((resolve, reject) => {\n const metadataWithUpdate = {\n firmwareUpdateContext: {\n availableUpdate: \"mockUpdate\",\n },\n } as unknown as GetDeviceMetadataDAOutput;\n setupGetDeviceMetadataMock(metadataWithUpdate);\n setupInstallOrUpdateAppsMock(\n INSTALL_RESULT,\n INSTALL_INTERMEDIATE_VALUE,\n true,\n );\n const deviceAction = new OpenAppWithDependenciesDeviceAction({\n input: {\n application: { name: \"Ethereum\" },\n dependencies: [{ name: \"Uniswap\" }, { name: \"1inch\" }],\n requireLatestFirmware: false,\n },\n });\n\n const expectedStates: Array<OpenAppWithDependenciesDAState> = [\n // GetDeviceMetadata\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n // InstallOrUpdateApps\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n ...INSTALL_INTERMEDIATE_VALUE,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n // Error\n {\n error: new UnknownDAError(\"InstallOrUpdateApps failed\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(deviceAction, expectedStates, apiMock, {\n onDone: resolve,\n onError: reject,\n });\n }));\n\n it(\"Open app error\", () =>\n new Promise<void>((resolve, reject) => {\n setupGetDeviceMetadataMock(DEVICE_METADATA);\n setupInstallOrUpdateAppsMock(\n INSTALL_RESULT,\n INSTALL_INTERMEDIATE_VALUE,\n );\n setupOpenAppMock(true);\n const deviceAction = new OpenAppWithDependenciesDeviceAction({\n input: {\n application: { name: \"Ethereum\" },\n dependencies: [{ name: \"Uniswap\" }, { name: \"1inch\" }],\n requireLatestFirmware: false,\n },\n });\n\n const expectedStates: Array<OpenAppWithDependenciesDAState> = [\n // GetDeviceMetadata\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n // InstallOrUpdateApps\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n installPlan: null,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n ...INSTALL_INTERMEDIATE_VALUE,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n // OpenApp\n {\n intermediateValue: {\n ...INSTALL_INTERMEDIATE_VALUE,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n {\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n installPlan: null,\n deviceId: undefined,\n step: openAppWithDependenciesDAStateStep.GET_DEVICE_METADATA,\n },\n status: DeviceActionStatus.Pending,\n },\n // Error\n {\n error: new UnknownDAError(\"OpenApp failed\"),\n status: DeviceActionStatus.Error,\n },\n ];\n\n testDeviceActionStates(deviceAction, expectedStates, apiMock, {\n onDone: resolve,\n onError: reject,\n });\n }));\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAgD,6DAChDC,EAIO,8DACPC,EAAuC,oEACvCC,EAAmC,sDACnCC,EAAwC,4DACxCC,EAGO,wCAEPC,EAGO,2DAGPC,EAAoD,iDACpDD,EAGO,mBAEP,GAAG,KAAK,+DAA+D,EACvE,GAAG,KACD,2EACF,EACA,GAAG,KACD,uEACF,EAEA,SAAS,sCAAuC,IAAM,CACpD,MAAME,KAAU,mCAAgC,EAE1CC,EAAkB,CACtB,sBAAuB,CAAC,CAC1B,EAEMC,EAAqE,CACzE,wBAAyB,0BAAwB,KACjD,KAAM,iCAA+B,oBACrC,YAAa,CACX,YAAa,CA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QAASC,CACX,CAAC,CACH,CAAC,CAAC,CACN,CAAC,CACH,CAAC",
6
+ "names": ["import_makeInternalApi", "import_setupTestMachine", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_types", "import_OpenAppWithDependenciesDeviceAction", "apiMock", "DEVICE_METADATA", "INSTALL_INTERMEDIATE_VALUE", "INSTALL_RESULT", "resolve", "reject", "deviceAction", "expectedStates"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var d=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of o(e))!A.call(t,p)&&p!==i&&r(t,p,{get:()=>e[p],enumerable:!(n=a(e,p))||n.enumerable});return t};var c=t=>d(r({},"__esModule",{value:!0}),t);var D={};module.exports=c(D);
1
+ "use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var s=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})},D=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of o(e))!A.call(t,p)&&p!==n&&i(t,p,{get:()=>e[p],enumerable:!(r=a(e,p))||r.enumerable});return t};var c=t=>D(i({},"__esModule",{value:!0}),t);var l={};s(l,{openAppWithDependenciesDAStateStep:()=>d});module.exports=c(l);const d=Object.freeze({GET_DEVICE_METADATA:"os.openAppWithDependencies.steps.getDeviceMetadata",INSTALL_OR_UPDATE_APPS:"os.openAppWithDependencies.steps.installOrUpdateApps",OPEN_APP:"os.openAppWithDependencies.steps.openApp"});0&&(module.exports={openAppWithDependenciesDAStateStep});
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/device-action/os/OpenAppWithDependencies/types.ts"],
4
- "sourcesContent": ["import type { CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport type { DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport type {\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nimport type {\n GetDeviceMetadataDAOutput,\n GetDeviceMetadataDARequiredInteraction,\n} from \"@api/device-action/os/GetDeviceMetadata/types\";\nimport type { GetDeviceStatusDAInput } from \"@api/device-action/os/GetDeviceStatus/types\";\nimport type {\n ApplicationDependency,\n InstallOrUpdateAppsDAError,\n InstallOrUpdateAppsDAOutput,\n InstallOrUpdateAppsDARequiredInteraction,\n InstallPlan,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nimport type {\n OpenAppDAError,\n OpenAppDARequiredInteraction,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\n\nexport type OpenAppWithDependenciesDAOutput = {\n deviceMetadata: GetDeviceMetadataDAOutput;\n installResult: InstallOrUpdateAppsDAOutput;\n};\n\nexport type OpenAppWithDependenciesDAInput = GetDeviceStatusDAInput & {\n readonly application: ApplicationDependency;\n readonly dependencies: ApplicationDependency[];\n readonly requireLatestFirmware?: boolean;\n};\n\nexport type OpenAppWithDependenciesDAError =\n | InstallOrUpdateAppsDAError\n | OpenAppDAError\n | UnknownDAError\n | UnsupportedFirmwareDAError\n | CommandErrorResult[\"error\"];\n\nexport type OpenAppWithDependenciesDARequiredInteraction =\n | GetDeviceMetadataDARequiredInteraction\n | InstallOrUpdateAppsDARequiredInteraction\n | OpenAppDARequiredInteraction;\n\nexport type OpenAppWithDependenciesDAIntermediateValue = {\n requiredUserInteraction: OpenAppWithDependenciesDARequiredInteraction;\n installPlan: InstallPlan | null;\n deviceId?: Uint8Array;\n};\n\nexport type OpenAppWithDependenciesDAState = DeviceActionState<\n OpenAppWithDependenciesDAOutput,\n OpenAppWithDependenciesDAError,\n OpenAppWithDependenciesDAIntermediateValue\n>;\n"],
5
- "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
- "names": ["types_exports", "__toCommonJS"]
4
+ "sourcesContent": ["import type { CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport type { DeviceActionState } from \"@api/device-action/model/DeviceActionState\";\nimport type {\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nimport type {\n GetDeviceMetadataDAOutput,\n GetDeviceMetadataDARequiredInteraction,\n} from \"@api/device-action/os/GetDeviceMetadata/types\";\nimport type { GetDeviceStatusDAInput } from \"@api/device-action/os/GetDeviceStatus/types\";\nimport type {\n ApplicationDependency,\n InstallOrUpdateAppsDAError,\n InstallOrUpdateAppsDAOutput,\n InstallOrUpdateAppsDARequiredInteraction,\n InstallPlan,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nimport type {\n OpenAppDAError,\n OpenAppDARequiredInteraction,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\n\nexport const openAppWithDependenciesDAStateStep = Object.freeze({\n GET_DEVICE_METADATA: \"os.openAppWithDependencies.steps.getDeviceMetadata\",\n INSTALL_OR_UPDATE_APPS:\n \"os.openAppWithDependencies.steps.installOrUpdateApps\",\n OPEN_APP: \"os.openAppWithDependencies.steps.openApp\",\n} as const);\n\nexport type OpenAppWithDependenciesDAStateStep =\n (typeof openAppWithDependenciesDAStateStep)[keyof typeof openAppWithDependenciesDAStateStep];\n\nexport type OpenAppWithDependenciesDAOutput = {\n deviceMetadata: GetDeviceMetadataDAOutput;\n installResult: InstallOrUpdateAppsDAOutput;\n};\n\nexport type OpenAppWithDependenciesDAInput = GetDeviceStatusDAInput & {\n readonly application: ApplicationDependency;\n readonly dependencies: ApplicationDependency[];\n readonly requireLatestFirmware?: boolean;\n readonly allowMissingApplication?: boolean;\n};\n\nexport type OpenAppWithDependenciesDAError =\n | InstallOrUpdateAppsDAError\n | OpenAppDAError\n | UnknownDAError\n | UnsupportedFirmwareDAError\n | CommandErrorResult[\"error\"];\n\nexport type OpenAppWithDependenciesDARequiredInteraction =\n | GetDeviceMetadataDARequiredInteraction\n | InstallOrUpdateAppsDARequiredInteraction\n | OpenAppDARequiredInteraction;\n\nexport type OpenAppWithDependenciesDAIntermediateValue = {\n requiredUserInteraction: OpenAppWithDependenciesDARequiredInteraction;\n installPlan: InstallPlan | null;\n deviceId?: Uint8Array;\n step: OpenAppWithDependenciesDAStateStep;\n};\n\nexport type OpenAppWithDependenciesDAState = DeviceActionState<\n OpenAppWithDependenciesDAOutput,\n OpenAppWithDependenciesDAError,\n OpenAppWithDependenciesDAIntermediateValue\n>;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wCAAAE,IAAA,eAAAC,EAAAH,GAuBO,MAAME,EAAqC,OAAO,OAAO,CAC9D,oBAAqB,qDACrB,uBACE,uDACF,SAAU,0CACZ,CAAU",
6
+ "names": ["types_exports", "__export", "openAppWithDependenciesDAStateStep", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var I=(o,n)=>{for(var a in n)p(o,a,{get:n[a],enumerable:!0})},l=(o,n,a,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of A(n))!S.call(o,r)&&r!==a&&p(o,r,{get:()=>n[r],enumerable:!(e=u(n,r))||e.enumerable});return o};var D=o=>l(p({},"__esModule",{value:!0}),o);var R={};I(R,{SendCommandInAppDeviceAction:()=>E});module.exports=D(R);var m=require("purify-ts"),t=require("xstate"),i=require("../../../command/model/CommandResult"),d=require("../../../device-action/model/UserInteractionRequired"),s=require("../../../device-action/os/Errors"),C=require("../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),c=require("../../../device-action/xstate-utils/XStateDeviceAction");class E extends c.XStateDeviceAction{makeStateMachine(n){const{sendCommand:a}=this.extractDependencies(n);return(0,t.setup)({types:{input:{},context:{},output:{}},actors:{sendCommand:(0,t.fromPromise)(a),openAppStateMachine:new C.OpenAppDeviceAction({input:{appName:this.input.appName}}).makeStateMachine(n)},guards:{skipOpenApp:()=>this.input.skipOpenApp,noInternalError:({context:e})=>e._internalState.error===null},actions:{assignErrorFromEvent:(0,t.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"SendCommandInAppDeviceAction",initial:"InitialState",context:({input:e})=>({input:e,intermediateValue:{requiredUserInteraction:d.UserInteractionRequired.None},_internalState:{commandResponse:null,error:null}}),states:{InitialState:{always:[{target:"SendCommand",guard:"skipOpenApp"},"OpenAppDeviceAction"]},OpenAppDeviceAction:{invoke:{id:"openAppStateMachine",input:{appName:this.input.appName},src:"openAppStateMachine",onSnapshot:{actions:(0,t.assign)({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{actions:(0,t.assign)({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:r=>({...e.context._internalState,error:r})})}),target:"CheckOpenAppDeviceActionResult"}}},CheckOpenAppDeviceActionResult:{always:[{target:"SendCommand",guard:"noInternalError"},"Error"]},SendCommand:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:this.input.requiredUserInteraction}}),exit:(0,t.assign)({intermediateValue:{requiredUserInteraction:d.UserInteractionRequired.None}}),invoke:{id:"sendCommand",src:"sendCommand",input:({context:e})=>e.input.command,onDone:{target:"SendCommandResultCheck",actions:[(0,t.assign)({_internalState:({event:e,context:r})=>(0,i.isSuccessCommandResult)(e.output)?{...r._internalState,commandResponse:e.output.data}:{...r._internalState,error:e.output.error}})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},SendCommandResultCheck:{always:[{target:"Success",guard:"noInternalError"},"Error"]},Success:{type:"final"},Error:{type:"final"}},output:({context:e})=>e._internalState.commandResponse?(0,m.Right)(e._internalState.commandResponse):(0,m.Left)(e._internalState.error||new s.UnknownDAError("No error in final state"))})}extractDependencies(n){return{sendCommand:a=>n.sendCommand(a.input)}}}0&&(module.exports={SendCommandInAppDeviceAction});
1
+ "use strict";var d=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var l=(o,n)=>{for(var a in n)d(o,a,{get:n[a],enumerable:!0})},D=(o,n,a,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of S(n))!I.call(o,r)&&r!==a&&d(o,r,{get:()=>n[r],enumerable:!(e=A(n,r))||e.enumerable});return o};var E=o=>D(d({},"__esModule",{value:!0}),o);var y={};l(y,{SendCommandInAppDeviceAction:()=>R});module.exports=E(y);var p=require("purify-ts"),t=require("xstate"),s=require("../../../command/model/CommandResult"),i=require("../../../device-action/model/UserInteractionRequired"),C=require("../../../device-action/os/Errors"),c=require("../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),u=require("../../../device-action/xstate-utils/XStateDeviceAction"),m=require("./SendCommandInAppDeviceActionTypes");class R extends u.XStateDeviceAction{makeStateMachine(n){const{sendCommand:a}=this.extractDependencies(n);return(0,t.setup)({types:{input:{},context:{},output:{}},actors:{sendCommand:(0,t.fromPromise)(a),openAppStateMachine:new c.OpenAppDeviceAction({input:{appName:this.input.appName}}).makeStateMachine(n)},guards:{skipOpenApp:()=>this.input.skipOpenApp,noInternalError:({context:e})=>e._internalState.error===null},actions:{assignErrorFromEvent:(0,t.assign)({_internalState:e=>({...e.context._internalState,error:e.event.error})})}}).createMachine({id:"SendCommandInAppDeviceAction",initial:"InitialState",context:({input:e})=>({input:e,intermediateValue:{requiredUserInteraction:i.UserInteractionRequired.None,step:m.sendCommandInAppDAStateStep.OPEN_APP},_internalState:{commandResponse:null,error:null}}),states:{InitialState:{always:[{target:"SendCommand",guard:"skipOpenApp"},"OpenAppDeviceAction"]},OpenAppDeviceAction:{invoke:{id:"openAppStateMachine",input:{appName:this.input.appName},src:"openAppStateMachine",onSnapshot:{actions:(0,t.assign)({intermediateValue:e=>e.event.snapshot.context.intermediateValue})},onDone:{actions:(0,t.assign)({_internalState:e=>e.event.output.caseOf({Right:()=>e.context._internalState,Left:r=>({...e.context._internalState,error:r})})}),target:"CheckOpenAppDeviceActionResult"}}},CheckOpenAppDeviceActionResult:{always:[{target:"SendCommand",guard:"noInternalError"},"Error"]},SendCommand:{entry:(0,t.assign)({intermediateValue:{requiredUserInteraction:this.input.requiredUserInteraction,step:m.sendCommandInAppDAStateStep.SEND_COMMAND}}),exit:(0,t.assign)({intermediateValue:{requiredUserInteraction:i.UserInteractionRequired.None,step:m.sendCommandInAppDAStateStep.SEND_COMMAND}}),invoke:{id:"sendCommand",src:"sendCommand",input:({context:e})=>e.input.command,onDone:{target:"SendCommandResultCheck",actions:[(0,t.assign)({_internalState:({event:e,context:r})=>(0,s.isSuccessCommandResult)(e.output)?{...r._internalState,commandResponse:e.output.data}:{...r._internalState,error:e.output.error}})]},onError:{target:"Error",actions:"assignErrorFromEvent"}}},SendCommandResultCheck:{always:[{target:"Success",guard:"noInternalError"},"Error"]},Success:{type:"final"},Error:{type:"final"}},output:({context:e})=>e._internalState.commandResponse?(0,p.Right)(e._internalState.commandResponse):(0,p.Left)(e._internalState.error||new C.UnknownDAError("No error in final state"))})}extractDependencies(n){return{sendCommand:a=>n.sendCommand(a.input)}}}0&&(module.exports={SendCommandInAppDeviceAction});
2
2
  //# sourceMappingURL=SendCommandInAppDeviceAction.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.ts"],
4
- "sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromPromise, setup } from \"xstate\";\n\nimport {\n type CommandResult,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nimport { type Command } from \"@api/types\";\n\nimport {\n type SendCommandInAppDAError,\n type SendCommandInAppDAInput,\n type SendCommandInAppDAIntermediateValue,\n type SendCommandInAppDAInternalState,\n type SendCommandInAppDAOutput,\n} from \"./SendCommandInAppDeviceActionTypes\";\n\n/**\n * Tries to open an app on the device, and if it is successful, sends a command\n * to the app.\n * The output will be the result of the command.\n *\n * ```ts\n * input: {\n * appName: string;\n * command: Command<CommandResult, CommandArgs>;\n * requiredUserInteraction: UserInteraction;\n * }\n * ```\n *\n * Example of usage:\n *\n * ```ts\n * const deviceAction = new SendCommandInAppDeviceAction({\n * input: {\n * appName: \"MyApp\",\n * command: new MyAppSpecificCommand({commandSpecificArg: \"foo\"}),\n * requiredUserInteraction: UserInteractionRequired.None,\n * },\n * });\n * dmk.executeDeviceAction({ sessionId: \"mySessionId\", deviceAction });\n * ```\n */\nexport class SendCommandInAppDeviceAction<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction extends UserInteractionRequired,\n> extends XStateDeviceAction<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n > {\n type types = StateMachineTypes<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n >;\n\n const { sendCommand } = this.extractDependencies(internalAPI);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n sendCommand: fromPromise(sendCommand),\n openAppStateMachine: new OpenAppDeviceAction({\n input: {\n appName: this.input.appName,\n },\n }).makeStateMachine(internalAPI),\n },\n guards: {\n skipOpenApp: () => this.input.skipOpenApp,\n noInternalError: ({ context }) => context._internalState.error === null,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QFEAuALA0mAngJwEsA7KAcTFQEEII85YARMANwIGMxK3UCB7IgHQB5AA5gilESKasOXHvwDEEfmAHFmvANZreYiVIDKqAIaowAWRNt0xMAG0ADAF1EoEb1gEFRNyAAeiACMQQDsAgAcACwAzKEArABMUfGpEQCcEYkANCA4iFGO8QKhjokxERUpQenp8QC+9bloWLiEJORUNHSwjCzsnNx8ggDC6GBsWqLiktL9ckP8AEpwAK4ANqiKTq5IIB5ePn6BCEFR4YkAbKE1Zemh55URufkI8fcC8TGXl0EVoelHJcio1mhhsPhiGQKNRaPQZAN5MMBGMJlN9LMEQsfCtYBstvYgrt3J5vMNjgUQgJLokHlEgldko50rEXoh3uEvj8-hEAUCQU0QC0Ie1oV04b0sYMfAJOrCerARrwALbKkxECDKVTqIiaHQCGDihVK1XqiA7PwHMn8CmnRJBASOFIxKJXJ21GLpHJ5RARGoCEL3CKXDLpS4pCKgoXgtpQuXdeHzaXI+MSxUqtUaxRgPB4Xh4AQidZmABm+eVBphCd6Jsz5pcltJRz2Jyiv0dvIeNJi8UqoWePoQIccn3iId+sSqkajRF4EDgfmFsY6VbTUqRNr2VuboBOAFpLmzTpd0iV+0EkkEylcAVEo0vISujYnZMn+MIMVJ14tfFum+SWwKb1XkSMdIhuQFEidYNSjvQUH1FVMFW-GVUUmaYDDmV8NyIXF8UbQ4AN3X0ogEF17S9eJQhiJ0ojbI8khHc54mvRwGUBXl7xjR8xXlF9ER-WVV2NDMzQI61f2IhBXUdRw5NDX54gvXkjx+CIzxuMdfnKd44LBVoeKQ-jsWRQxVjYDhenEncAmCcMBHKBlqKyIEYivGIjzDGJqQSYMamDa4BX0kU42E4y30EZBc3zayiNshBSmKFjqn7GCMgHV57lIz0aT9P0lL+S5GkaIA */\n id: \"SendCommandInAppDeviceAction\",\n initial: \"InitialState\",\n context: ({ input }) => {\n return {\n input: input,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n _internalState: {\n commandResponse: null,\n error: null,\n },\n };\n },\n states: {\n InitialState: {\n always: [\n {\n target: \"SendCommand\",\n guard: \"skipOpenApp\",\n },\n \"OpenAppDeviceAction\",\n ],\n },\n OpenAppDeviceAction: {\n invoke: {\n id: \"openAppStateMachine\",\n input: {\n appName: this.input.appName,\n },\n src: \"openAppStateMachine\",\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) =>\n _.event.snapshot.context.intermediateValue,\n }),\n },\n onDone: {\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<\n SendCommandInAppDAInternalState<\n CommandResponse,\n CommandErrorCodes\n >\n >({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n target: \"CheckOpenAppDeviceActionResult\",\n },\n },\n },\n CheckOpenAppDeviceActionResult: {\n always: [\n {\n target: \"SendCommand\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n SendCommand: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: this.input.requiredUserInteraction,\n },\n }),\n exit: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n }),\n invoke: {\n id: \"sendCommand\",\n src: \"sendCommand\",\n input: ({ context }) => context.input.command,\n onDone: {\n target: \"SendCommandResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n commandResponse: event.output.data,\n };\n }\n return {\n ...context._internalState,\n error: event.output.error,\n };\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n SendCommandResultCheck: {\n always: [\n {\n target: \"Success\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.commandResponse\n ? Right(context._internalState.commandResponse)\n : Left(\n context._internalState.error ||\n new UnknownDAError(\"No error in final state\"),\n ),\n });\n }\n\n extractDependencies(internalApi: InternalApi) {\n return {\n sendCommand: (_: {\n input: Command<CommandResponse, CommandArgs, CommandErrorCodes>;\n }): Promise<CommandResult<CommandResponse, CommandErrorCodes>> =>\n internalApi.sendCommand(_.input),\n };\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2C,kBAE3CC,EAGO,4CAEPC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAAoC,yEAEpCC,EAGO,8DAqCA,MAAMR,UAKH,oBAWR,CACA,iBACES,EAYA,CAcA,KAAM,CAAE,YAAAC,CAAY,EAAI,KAAK,oBAAoBD,CAAW,EAE5D,SAAO,SAAM,CACX,MAAO,CACL,MAAO,CAAC,EACR,QAAS,CAAC,EACV,OAAQ,CAAC,CACX,EACA,OAAQ,CACN,eAAa,eAAYC,CAAW,EACpC,oBAAq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ACnD,CACF,CAAC,EACD,OAAQ,CACN,GAAI,cACJ,IAAK,cACL,MAAO,CAAC,CAAE,QAAAH,CAAQ,IAAMA,EAAQ,MAAM,QACtC,OAAQ,CACN,OAAQ,yBACR,QAAS,IACP,UAAO,CACL,eAAgB,CAAC,CAAE,MAAAI,EAAO,QAAAJ,CAAQ,OAC5B,0BAAuBI,EAAM,MAAM,EAC9B,CACL,GAAGJ,EAAQ,eACX,gBAAiBI,EAAM,OAAO,IAChC,EAEK,CACL,GAAGJ,EAAQ,eACX,MAAOI,EAAM,OAAO,KACtB,CAEJ,CAAC,CACH,CACF,EACA,QAAS,CACP,OAAQ,QACR,QAAS,sBACX,CACF,CACF,EACA,uBAAwB,CACtB,OAAQ,CACN,CACE,OAAQ,UACR,MAAO,iBACT,EACA,OACF,CACF,EACA,QAAS,CACP,KAAM,OACR,EACA,MAAO,CACL,KAAM,OACR,CACF,EACA,OAAQ,CAAC,CAAE,QAAAJ,CAAQ,IACjBA,EAAQ,eAAe,mBACnB,SAAMA,EAAQ,eAAe,eAAe,KAC5C,QACEA,EAAQ,eAAe,OACrB,IAAI,iBAAe,yBAAyB,CAChD,CACR,CAAC,CACH,CAEA,oBAAoBK,EAA0B,CAC5C,MAAO,CACL,YAAcJ,GAGZI,EAAY,YAAYJ,EAAE,KAAK,CACnC,CACF,CACF",
6
- "names": ["SendCommandInAppDeviceAction_exports", "__export", "SendCommandInAppDeviceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_CommandResult", "import_UserInteractionRequired", "import_Errors", "import_OpenAppDeviceAction", "import_XStateDeviceAction", "internalAPI", "sendCommand", "context", "_", "input", "error", "event", "internalApi"]
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\nimport { assign, fromPromise, setup } from \"xstate\";\n\nimport {\n type CommandResult,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nimport { type InternalApi } from \"@api/device-action/DeviceAction\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nimport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nimport { type Command } from \"@api/types\";\n\nimport {\n type SendCommandInAppDAError,\n type SendCommandInAppDAInput,\n type SendCommandInAppDAIntermediateValue,\n type SendCommandInAppDAInternalState,\n type SendCommandInAppDAOutput,\n sendCommandInAppDAStateStep,\n} from \"./SendCommandInAppDeviceActionTypes\";\n\n/**\n * Tries to open an app on the device, and if it is successful, sends a command\n * to the app.\n * The output will be the result of the command.\n *\n * ```ts\n * input: {\n * appName: string;\n * command: Command<CommandResult, CommandArgs>;\n * requiredUserInteraction: UserInteraction;\n * }\n * ```\n *\n * Example of usage:\n *\n * ```ts\n * const deviceAction = new SendCommandInAppDeviceAction({\n * input: {\n * appName: \"MyApp\",\n * command: new MyAppSpecificCommand({commandSpecificArg: \"foo\"}),\n * requiredUserInteraction: UserInteractionRequired.None,\n * },\n * });\n * dmk.executeDeviceAction({ sessionId: \"mySessionId\", deviceAction });\n * ```\n */\nexport class SendCommandInAppDeviceAction<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction extends UserInteractionRequired,\n> extends XStateDeviceAction<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n> {\n makeStateMachine(\n internalAPI: InternalApi,\n ): DeviceActionStateMachine<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n > {\n type types = StateMachineTypes<\n SendCommandInAppDAOutput<CommandResponse>,\n SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction\n >,\n SendCommandInAppDAError<CommandErrorCodes>,\n SendCommandInAppDAIntermediateValue<UserInteraction>,\n SendCommandInAppDAInternalState<CommandResponse, CommandErrorCodes>\n >;\n\n const { sendCommand } = this.extractDependencies(internalAPI);\n\n return setup({\n types: {\n input: {} as types[\"input\"],\n context: {} as types[\"context\"],\n output: {} as types[\"output\"],\n },\n actors: {\n sendCommand: fromPromise(sendCommand),\n openAppStateMachine: new OpenAppDeviceAction({\n input: {\n appName: this.input.appName,\n },\n }).makeStateMachine(internalAPI),\n },\n guards: {\n skipOpenApp: () => this.input.skipOpenApp,\n noInternalError: ({ context }) => context._internalState.error === null,\n },\n actions: {\n assignErrorFromEvent: assign({\n _internalState: (_) => ({\n ..._.context._internalState,\n error: _.event[\"error\"], // NOTE: it should never happen, the error is not typed anymore here\n }),\n }),\n },\n }).createMachine({\n /** @xstate-layout N4IgpgJg5mDOIC5QFEAuALA0mAngJwEsA7KAcTFQEEII85YARMANwIGMxK3UCB7IgHQB5AA5gilESKasOXHvwDEEfmAHFmvANZreYiVIDKqAIaowAWRNt0xMAG0ADAF1EoEb1gEFRNyAAeiACMQQDsAgAcACwAzKEArABMUfGpEQCcEYkANCA4iFGO8QKhjokxERUpQenp8QC+9bloWLiEJORUNHSwjCzsnNx8ggDC6GBsWqLiktL9ckP8AEpwAK4ANqiKTq5IIB5ePn6BCEFR4YkAbKE1Zemh55URufkI8fcC8TGXl0EVoelHJcio1mhhsPhiGQKNRaPQZAN5MMBGMJlN9LMEQsfCtYBstvYgrt3J5vMNjgUQgJLokHlEgldko50rEXoh3uEvj8-hEAUCQU0QC0Ie1oV04b0sYMfAJOrCerARrwALbKkxECDKVTqIiaHQCGDihVK1XqiA7PwHMn8CmnRJBASOFIxKJXJ21GLpHJ5RARGoCEL3CKXDLpS4pCKgoXgtpQuXdeHzaXI+MSxUqtUaxRgPB4Xh4AQidZmABm+eVBphCd6Jsz5pcltJRz2Jyiv0dvIeNJi8UqoWePoQIccn3iId+sSqkajRF4EDgfmFsY6VbTUqRNr2VuboBOAFpLmzTpd0iV+0EkkEylcAVEo0vISujYnZMn+MIMVJ14tfFum+SWwKb1XkSMdIhuQFEidYNSjvQUH1FVMFW-GVUUmaYDDmV8NyIXF8UbQ4AN3X0ogEF17S9eJQhiJ0ojbI8khHc54mvRwGUBXl7xjR8xXlF9ER-WVV2NDMzQI61f2IhBXUdRw5NDX54gvXkjx+CIzxuMdfnKd44LBVoeKQ-jsWRQxVjYDhenEncAmCcMBHKBlqKyIEYivGIjzDGJqQSYMamDa4BX0kU42E4y30EZBc3zayiNshBSmKFjqn7GCMgHV57lIz0aT9P0lL+S5GkaIA */\n id: \"SendCommandInAppDeviceAction\",\n initial: \"InitialState\",\n context: ({ input }) => {\n return {\n input: input,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: sendCommandInAppDAStateStep.OPEN_APP,\n },\n _internalState: {\n commandResponse: null,\n error: null,\n },\n };\n },\n states: {\n InitialState: {\n always: [\n {\n target: \"SendCommand\",\n guard: \"skipOpenApp\",\n },\n \"OpenAppDeviceAction\",\n ],\n },\n OpenAppDeviceAction: {\n invoke: {\n id: \"openAppStateMachine\",\n input: {\n appName: this.input.appName,\n },\n src: \"openAppStateMachine\",\n onSnapshot: {\n actions: assign({\n intermediateValue: (_) =>\n _.event.snapshot.context.intermediateValue,\n }),\n },\n onDone: {\n actions: assign({\n _internalState: (_) => {\n return _.event.output.caseOf<\n SendCommandInAppDAInternalState<\n CommandResponse,\n CommandErrorCodes\n >\n >({\n Right: () => _.context._internalState,\n Left: (error) => ({\n ..._.context._internalState,\n error,\n }),\n });\n },\n }),\n target: \"CheckOpenAppDeviceActionResult\",\n },\n },\n },\n CheckOpenAppDeviceActionResult: {\n always: [\n {\n target: \"SendCommand\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n SendCommand: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: this.input.requiredUserInteraction,\n step: sendCommandInAppDAStateStep.SEND_COMMAND,\n },\n }),\n exit: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: sendCommandInAppDAStateStep.SEND_COMMAND,\n },\n }),\n invoke: {\n id: \"sendCommand\",\n src: \"sendCommand\",\n input: ({ context }) => context.input.command,\n onDone: {\n target: \"SendCommandResultCheck\",\n actions: [\n assign({\n _internalState: ({ event, context }) => {\n if (isSuccessCommandResult(event.output)) {\n return {\n ...context._internalState,\n commandResponse: event.output.data,\n };\n }\n return {\n ...context._internalState,\n error: event.output.error,\n };\n },\n }),\n ],\n },\n onError: {\n target: \"Error\",\n actions: \"assignErrorFromEvent\",\n },\n },\n },\n SendCommandResultCheck: {\n always: [\n {\n target: \"Success\",\n guard: \"noInternalError\",\n },\n \"Error\",\n ],\n },\n Success: {\n type: \"final\",\n },\n Error: {\n type: \"final\",\n },\n },\n output: ({ context }) =>\n context._internalState.commandResponse\n ? Right(context._internalState.commandResponse)\n : Left(\n context._internalState.error ||\n new UnknownDAError(\"No error in final state\"),\n ),\n });\n }\n\n extractDependencies(internalApi: InternalApi) {\n return {\n sendCommand: (_: {\n input: Command<CommandResponse, CommandArgs, CommandErrorCodes>;\n }): Promise<CommandResult<CommandResponse, CommandErrorCodes>> =>\n internalApi.sendCommand(_.input),\n };\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,qBAC5BC,EAA2C,kBAE3CC,EAGO,4CAEPC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAAoC,yEAEpCC,EAGO,8DAGPC,E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ACF,CAAC,CAEL,CAAC,EACD,OAAQ,gCACV,CACF,CACF,EACA,+BAAgC,CAC9B,OAAQ,CACN,CACE,OAAQ,cACR,MAAO,iBACT,EACA,OACF,CACF,EACA,YAAa,CACX,SAAO,UAAO,CACZ,kBAAmB,CACjB,wBAAyB,KAAK,MAAM,wBACpC,KAAM,8BAA4B,YACpC,CACF,CAAC,EACD,QAAM,UAAO,CACX,kBAAmB,CACjB,wBAAyB,0BAAwB,KACjD,KAAM,8BAA4B,YACpC,CACF,CAAC,EACD,OAAQ,CACN,GAAI,cACJ,IAAK,cACL,MAAO,CAAC,CAAE,QAAAH,CAAQ,IAAMA,EAAQ,MAAM,QACtC,OAAQ,CACN,OAAQ,yBACR,QAAS,IACP,UAAO,CACL,eAAgB,CAAC,CAAE,MAAAI,EAAO,QAAAJ,CAAQ,OAC5B,0BAAuBI,EAAM,MAAM,EAC9B,CACL,GAAGJ,EAAQ,eACX,gBAAiBI,EAAM,OAAO,IAChC,EAEK,CACL,GAAGJ,EAAQ,eACX,MAAOI,EAAM,OAAO,KACtB,CAEJ,CAAC,CACH,CACF,EACA,QAAS,CACP,OAAQ,QACR,QAAS,sBACX,CACF,CACF,EACA,uBAAwB,CACtB,OAAQ,CACN,CACE,OAAQ,UACR,MAAO,iBACT,EACA,OACF,CACF,EACA,QAAS,CACP,KAAM,OACR,EACA,MAAO,CACL,KAAM,OACR,CACF,EACA,OAAQ,CAAC,CAAE,QAAAJ,CAAQ,IACjBA,EAAQ,eAAe,mBACnB,SAAMA,EAAQ,eAAe,eAAe,KAC5C,QACEA,EAAQ,eAAe,OACrB,IAAI,iBAAe,yBAAyB,CAChD,CACR,CAAC,CACH,CAEA,oBAAoBK,EAA0B,CAC5C,MAAO,CACL,YAAcJ,GAGZI,EAAY,YAAYJ,EAAE,KAAK,CACnC,CACF,CACF",
6
+ "names": ["SendCommandInAppDeviceAction_exports", "__export", "SendCommandInAppDeviceAction", "__toCommonJS", "import_purify_ts", "import_xstate", "import_CommandResult", "import_UserInteractionRequired", "import_Errors", "import_OpenAppDeviceAction", "import_XStateDeviceAction", "import_SendCommandInAppDeviceActionTypes", "internalAPI", "sendCommand", "context", "_", "input", "error", "event", "internalApi"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var y=require("purify-ts"),C=require("xstate"),k=require("../../../apdu/utils/ApduBuilder"),c=require("../../../command/model/CommandResult"),i=require("../../../device-action/__test-utils__/makeInternalApi"),l=require("../../../device-action/__test-utils__/testDeviceActionStates"),n=require("../../../device-action/model/DeviceActionState"),e=require("../../../device-action/model/UserInteractionRequired"),v=require("../../../device-action/os/Errors"),I=require("../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),D=require("../../../../../src"),s=require("./SendCommandInAppDeviceAction");vi.mock("@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction",async r=>({...await r(),OpenAppDeviceAction:vi.fn(()=>({makeStateMachine:vi.fn()}))}));const A=r=>{I.OpenAppDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,C.createMachine)({initial:"pending",states:{pending:{entry:(0,C.assign)({intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp}}),after:{0:"done"}},done:{type:"final"}},output:()=>r?(0,y.Left)(r):(0,y.Right)(void 0)}))}))};describe("SendCommandInAppDeviceAction",()=>{const r=vi.fn(),m=()=>({sendCommand:r}),{sendCommand:S}=(0,i.makeDeviceActionInternalApiMock)(),d={paramString:"aParameter",paramNumber:1234},f={aNumber:5678,aString:"mockedResponseString"};beforeEach(()=>{vi.resetAllMocks()}),describe("without mocking extractDependencies",()=>{it("should call sendCommand on internalApi with the correct parameters",async()=>{A(),S.mockResolvedValue((0,c.CommandResultFactory)({data:void 0}));const o=new s.SendCommandInAppDeviceAction({input:{command:new p(d),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}});await new Promise((a,t)=>{o._execute((0,i.makeDeviceActionInternalApiMock)()).observable.subscribe({error:()=>t(),complete:()=>a(),next:()=>{}})}),expect(S).toHaveBeenCalledWith(new p(d))})}),describe("error cases",()=>{it("should error and output the error if the open app fails",()=>new Promise((o,a)=>{A(new v.UnknownDAError("Mocked error"));const t=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.None}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp}},{status:n.DeviceActionStatus.Error,error:new v.UnknownDAError("Mocked error")}];(0,l.testDeviceActionStates)(new s.SendCommandInAppDeviceAction({input:{command:new p(d),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}}),t,(0,i.makeDeviceActionInternalApiMock)(),{onDone:o,onError:a})})),it("should error and output an error if the send command fails",()=>new Promise((o,a)=>{A(),r.mockResolvedValue((0,c.CommandResultFactory)({error:new D.UnknownDeviceExchangeError("Mocked error")}));const t=new s.SendCommandInAppDeviceAction({input:{command:new p(d),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}});vi.spyOn(t,"extractDependencies").mockImplementation(m);const u=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.None}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.VerifyAddress}},{status:n.DeviceActionStatus.Error,error:new D.UnknownDeviceExchangeError("Mocked error")}];(0,l.testDeviceActionStates)(t,u,(0,i.makeDeviceActionInternalApiMock)(),{onDone:o,onError:a})}))}),describe("success cases",()=>{it("should succeed and output the command result if the send command succeeds",()=>new Promise((o,a)=>{A(),r.mockResolvedValue((0,c.CommandResultFactory)({data:f}));const t=new s.SendCommandInAppDeviceAction({input:{command:new p(d),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}});vi.spyOn(t,"extractDependencies").mockImplementation(m);const u=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.None}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.VerifyAddress}},{status:n.DeviceActionStatus.Completed,output:f}];(0,l.testDeviceActionStates)(t,u,(0,i.makeDeviceActionInternalApiMock)(),{onDone:o,onError:a})})),it("should succeed while skipping OpenApp",()=>new Promise((o,a)=>{A(),r.mockResolvedValue((0,c.CommandResultFactory)({data:f}));const t=new s.SendCommandInAppDeviceAction({input:{command:new p(d),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!0}});vi.spyOn(t,"extractDependencies").mockImplementation(m);const u=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.VerifyAddress}},{status:n.DeviceActionStatus.Completed,output:f}];(0,l.testDeviceActionStates)(t,u,(0,i.makeDeviceActionInternalApiMock)(),{onDone:o,onError:a})}))})});class p{name="testCommand";params;constructor(m){this.params=m}getApdu(){return new k.ApduBuilder({cla:0,ins:1,p1:2,p2:3}).add32BitUIntToData(this.params.paramNumber).addAsciiStringToData(this.params.paramString).build()}parseResponse(){return(0,c.CommandResultFactory)({data:{aNumber:1,aString:"aString"}})}}
1
+ "use strict";var f=require("purify-ts"),y=require("xstate"),k=require("../../../apdu/utils/ApduBuilder"),u=require("../../../command/model/CommandResult"),i=require("../../../device-action/__test-utils__/makeInternalApi"),S=require("../../../device-action/__test-utils__/testDeviceActionStates"),n=require("../../../device-action/model/DeviceActionState"),e=require("../../../device-action/model/UserInteractionRequired"),I=require("../../../device-action/os/Errors"),E=require("../../../device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),C=require("../../../device-action/os/OpenAppDeviceAction/types"),v=require("../../../../../src"),c=require("./SendCommandInAppDeviceAction"),m=require("./SendCommandInAppDeviceActionTypes");vi.mock("@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction",async r=>({...await r(),OpenAppDeviceAction:vi.fn(()=>({makeStateMachine:vi.fn()}))}));const l=r=>{E.OpenAppDeviceAction.mockImplementation(()=>({makeStateMachine:vi.fn().mockImplementation(()=>(0,y.createMachine)({initial:"pending",states:{pending:{entry:(0,y.assign)({intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp,step:C.openAppDAStateStep.GET_DEVICE_STATUS}}),after:{0:"done"}},done:{type:"final"}},output:()=>r?(0,f.Left)(r):(0,f.Right)(void 0)}))}))};describe("SendCommandInAppDeviceAction",()=>{const r=vi.fn(),p=()=>({sendCommand:r}),{sendCommand:M}=(0,i.makeDeviceActionInternalApiMock)(),s={paramString:"aParameter",paramNumber:1234},D={aNumber:5678,aString:"mockedResponseString"};beforeEach(()=>{vi.resetAllMocks()}),describe("without mocking extractDependencies",()=>{it("should call sendCommand on internalApi with the correct parameters",async()=>{l(),M.mockResolvedValue((0,u.CommandResultFactory)({data:void 0}));const o=new c.SendCommandInAppDeviceAction({input:{command:new d(s),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}});await new Promise((a,t)=>{o._execute((0,i.makeDeviceActionInternalApiMock)()).observable.subscribe({error:()=>t(),complete:()=>a(),next:()=>{}})}),expect(M).toHaveBeenCalledWith(new d(s))})}),describe("error cases",()=>{it("should error and output the error if the open app fails",()=>new Promise((o,a)=>{l(new I.UnknownDAError("Mocked error"));const t=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.None,step:m.sendCommandInAppDAStateStep.OPEN_APP}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp,step:C.openAppDAStateStep.GET_DEVICE_STATUS}},{status:n.DeviceActionStatus.Error,error:new I.UnknownDAError("Mocked error")}];(0,S.testDeviceActionStates)(new c.SendCommandInAppDeviceAction({input:{command:new d(s),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}}),t,(0,i.makeDeviceActionInternalApiMock)(),{onDone:o,onError:a})})),it("should error and output an error if the send command fails",()=>new Promise((o,a)=>{l(),r.mockResolvedValue((0,u.CommandResultFactory)({error:new v.UnknownDeviceExchangeError("Mocked error")}));const t=new c.SendCommandInAppDeviceAction({input:{command:new d(s),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}});vi.spyOn(t,"extractDependencies").mockImplementation(p);const A=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.None,step:m.sendCommandInAppDAStateStep.OPEN_APP}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp,step:C.openAppDAStateStep.GET_DEVICE_STATUS}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,step:m.sendCommandInAppDAStateStep.SEND_COMMAND}},{status:n.DeviceActionStatus.Error,error:new v.UnknownDeviceExchangeError("Mocked error")}];(0,S.testDeviceActionStates)(t,A,(0,i.makeDeviceActionInternalApiMock)(),{onDone:o,onError:a})}))}),describe("success cases",()=>{it("should succeed and output the command result if the send command succeeds",()=>new Promise((o,a)=>{l(),r.mockResolvedValue((0,u.CommandResultFactory)({data:D}));const t=new c.SendCommandInAppDeviceAction({input:{command:new d(s),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!1}});vi.spyOn(t,"extractDependencies").mockImplementation(p);const A=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.None,step:m.sendCommandInAppDAStateStep.OPEN_APP}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.ConfirmOpenApp,step:C.openAppDAStateStep.GET_DEVICE_STATUS}},{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,step:m.sendCommandInAppDAStateStep.SEND_COMMAND}},{status:n.DeviceActionStatus.Completed,output:D}];(0,S.testDeviceActionStates)(t,A,(0,i.makeDeviceActionInternalApiMock)(),{onDone:o,onError:a})})),it("should succeed while skipping OpenApp",()=>new Promise((o,a)=>{l(),r.mockResolvedValue((0,u.CommandResultFactory)({data:D}));const t=new c.SendCommandInAppDeviceAction({input:{command:new d(s),appName:"MyApp",requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,skipOpenApp:!0}});vi.spyOn(t,"extractDependencies").mockImplementation(p);const A=[{status:n.DeviceActionStatus.Pending,intermediateValue:{requiredUserInteraction:e.UserInteractionRequired.VerifyAddress,step:m.sendCommandInAppDAStateStep.SEND_COMMAND}},{status:n.DeviceActionStatus.Completed,output:D}];(0,S.testDeviceActionStates)(t,A,(0,i.makeDeviceActionInternalApiMock)(),{onDone:o,onError:a})}))})});class d{name="testCommand";params;constructor(p){this.params=p}getApdu(){return new k.ApduBuilder({cla:0,ins:1,p1:2,p2:3}).add32BitUIntToData(this.params.paramNumber).addAsciiStringToData(this.params.paramString).build()}parseResponse(){return(0,u.CommandResultFactory)({data:{aNumber:1,aString:"aString"}})}}
2
2
  //# sourceMappingURL=SendCommandInAppDeviceAction.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction.test.ts"],
4
- "sourcesContent": ["/* eslint @typescript-eslint/consistent-type-imports:0 */\nimport { Left, Right } from \"purify-ts\";\nimport { type Mock } from \"vitest\";\nimport { assign, createMachine } from \"xstate\";\n\nimport { type Apdu } from \"@api/apdu/model/Apdu\";\nimport { ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { type Command } from \"@api/types\";\nimport { UnknownDeviceExchangeError } from \"@root/src\";\n\nimport { SendCommandInAppDeviceAction } from \"./SendCommandInAppDeviceAction\";\nimport {\n type SendCommandInAppDAError,\n type SendCommandInAppDAIntermediateValue,\n type SendCommandInAppDAOutput,\n} from \"./SendCommandInAppDeviceActionTypes\";\n\nvi.mock(\n \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\",\n async (importOriginal) => {\n const original =\n await importOriginal<\n typeof import(\"../OpenAppDeviceAction/OpenAppDeviceAction\")\n >();\n\n return {\n ...original,\n OpenAppDeviceAction: vi.fn(() => ({\n makeStateMachine: vi.fn(),\n })),\n };\n },\n);\n\nconst setupOpenAppDAMock = (error?: unknown) => {\n (OpenAppDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n initial: \"pending\",\n states: {\n pending: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n }),\n after: {\n 0: \"done\",\n },\n },\n done: {\n type: \"final\",\n },\n },\n output: () => (error ? Left(error) : Right(undefined)),\n }),\n ),\n }));\n};\n\ndescribe(\"SendCommandInAppDeviceAction\", () => {\n const sendMyCommand = vi.fn();\n\n const extractDependenciesMock = () => ({\n sendCommand: sendMyCommand,\n });\n\n const { sendCommand: apiSendCommandMock } = makeDeviceActionInternalApiMock();\n\n const commandParams = {\n paramString: \"aParameter\",\n paramNumber: 1234,\n };\n const mockedCommandResponse = {\n aNumber: 5678,\n aString: \"mockedResponseString\",\n };\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n describe(\"without mocking extractDependencies\", () => {\n it(\"should call sendCommand on internalApi with the correct parameters\", async () => {\n setupOpenAppDAMock();\n apiSendCommandMock.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n\n const deviceAction = new SendCommandInAppDeviceAction({\n input: {\n command: new TestCommand(commandParams),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n });\n await new Promise<void>((resolve, reject) => {\n deviceAction\n ._execute(makeDeviceActionInternalApiMock())\n .observable.subscribe({\n error: () => reject(),\n complete: () => resolve(),\n next: () => {},\n });\n });\n\n expect(apiSendCommandMock).toHaveBeenCalledWith(\n new TestCommand(commandParams),\n );\n });\n });\n\n describe(\"error cases\", () => {\n it(\"should error and output the error if the open app fails\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock(new UnknownDAError(\"Mocked error\"));\n\n const expectedStates: MyCommandSendCommandDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"Mocked error\"),\n },\n ];\n\n testDeviceActionStates(\n new SendCommandInAppDeviceAction({\n input: {\n command: new TestCommand(commandParams),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n }),\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should error and output an error if the send command fails\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n sendMyCommand.mockResolvedValue(\n CommandResultFactory({\n error: new UnknownDeviceExchangeError(\"Mocked error\"),\n }),\n );\n\n const deviceAction = new SendCommandInAppDeviceAction({\n input: {\n command: new TestCommand(commandParams),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandSendCommandDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDeviceExchangeError(\"Mocked error\"),\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n\n describe(\"success cases\", () => {\n it(\"should succeed and output the command result if the send command succeeds\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n sendMyCommand.mockResolvedValue(\n CommandResultFactory({ data: mockedCommandResponse }),\n );\n\n const deviceAction = new SendCommandInAppDeviceAction({\n input: {\n command: new TestCommand(commandParams),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandSendCommandDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n },\n {\n status: DeviceActionStatus.Completed,\n output: mockedCommandResponse,\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should succeed while skipping OpenApp\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n sendMyCommand.mockResolvedValue(\n CommandResultFactory({ data: mockedCommandResponse }),\n );\n\n const deviceAction = new SendCommandInAppDeviceAction({\n input: {\n command: new TestCommand(commandParams),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: true,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandSendCommandDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n },\n },\n {\n status: DeviceActionStatus.Completed,\n output: mockedCommandResponse,\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n});\n\ntype MyCommandResponse = {\n aNumber: number;\n aString: string;\n};\n\ntype MyCommandParams = {\n paramString: string;\n paramNumber: number;\n};\n\nclass TestCommand implements Command<MyCommandResponse, MyCommandParams> {\n readonly name = \"testCommand\";\n\n params: MyCommandParams;\n constructor(params: MyCommandParams) {\n this.params = params;\n }\n getApdu(): Apdu {\n return new ApduBuilder({ cla: 0x00, ins: 0x01, p1: 0x02, p2: 0x03 })\n .add32BitUIntToData(this.params.paramNumber)\n .addAsciiStringToData(this.params.paramString)\n .build();\n }\n parseResponse() {\n return CommandResultFactory({ data: { aNumber: 1, aString: \"aString\" } });\n }\n}\n\ntype MyCommandSendCommandDAState = DeviceActionState<\n SendCommandInAppDAOutput<MyCommandResponse>,\n SendCommandInAppDAError<UnknownDAError>,\n SendCommandInAppDAIntermediateValue<\n UserInteractionRequired.None | UserInteractionRequired.VerifyAddress\n >\n>;\n"],
5
- "mappings": "aACA,IAAAA,EAA4B,qBAE5BC,EAAsC,kBAGtCC,EAA4B,uCAC5BC,EAAqC,4CACrCC,EAAgD,6DAChDC,EAAuC,oEACvCC,EAGO,sDACPC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAAoC,yEAEpCC,EAA2C,qBAE3CC,EAA6C,0CAO7C,GAAG,KACD,gEACA,MAAOC,IAME,CACL,GALA,MAAMA,EAEJ,EAIF,oBAAqB,GAAG,GAAG,KAAO,CAChC,iBAAkB,GAAG,GAAG,CAC1B,EAAE,CACJ,EAEJ,EAEA,MAAMC,EAAsBC,GAAoB,CAC7C,sBAA6B,mBAAmB,KAAO,CACtD,iBAAkB,GAAG,GAAG,EAAE,mBAAmB,OAC3C,iBAAc,CACZ,QAAS,UACT,OAAQ,CACN,QAAS,CACP,SAAO,UAAO,CACZ,kBAAmB,CACjB,wBAAyB,0BAAwB,cACnD,CACF,CAAC,EACD,MAAO,CACL,EAAG,MACL,CACF,EACA,KAAM,CACJ,KAAM,OACR,CACF,EACA,OAAQ,IAAOA,KAAQ,QAAKA,CAAK,KAAI,SAAM,MAAS,CACtD,CAAC,CACH,CACF,EAAE,CACJ,EAEA,SAAS,+BAAgC,IAAM,CAC7C,MAAMC,EAAgB,GAAG,GAAG,EAEtBC,EAA0B,KAAO,CACrC,YAAaD,CACf,GAEM,CAAE,YAAaE,CAAmB,KAAI,mCAAgC,EAEtEC,EAAgB,CACpB,YAAa,aACb,YAAa,IACf,EACMC,EAAwB,CAC5B,QAAS,KACT,QAAS,sBACX,EACA,WAAW,IAAM,CACf,GAAG,cAAc,CACnB,CAAC,EAED,SAAS,sCAAuC,IAAM,CACpD,GAAG,qEAAsE,SAAY,CACnFN,EAAmB,EACnBI,EAAmB,qBACjB,wBAAq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,OAAQF,EACR,QAASC,CACX,CACF,CACF,CAAC,CAAC,EAEJ,GAAG,wCAAyC,IAC1C,IAAI,QAAc,CAACD,EAASC,IAAW,CACrCV,EAAmB,EAEnBE,EAAc,qBACZ,wBAAqB,CAAE,KAAMI,CAAsB,CAAC,CACtD,EAEA,MAAMC,EAAe,IAAI,+BAA6B,CACpD,MAAO,CACL,QAAS,IAAIC,EAAYH,CAAa,EACtC,QAAS,QACT,wBAAyB,0BAAwB,cACjD,YAAa,EACf,CACF,CAAC,EAED,GAAG,MAAME,EAAc,qBAAqB,EAAE,mBAC5CJ,CACF,EAEA,MAAMQ,EAAgD,CACpD,CACE,OAAQ,qBAAmB,QAC3B,kBAAmB,CACjB,wBAAyB,0BAAwB,aACnD,CACF,EACA,CACE,OAAQ,qBAAmB,UAC3B,OAAQL,CACV,CACF,KAEA,0BACEC,EACAI,KACA,mCAAgC,EAChC,CACE,OAAQF,EACR,QAASC,CACX,CACF,CACF,CAAC,CAAC,CACN,CAAC,CACH,CAAC,EAYD,MAAMF,CAAmE,CAC9D,KAAO,cAEhB,OACA,YAAYI,EAAyB,CACnC,KAAK,OAASA,CAChB,CACA,SAAgB,CACd,OAAO,IAAI,cAAY,CAAE,IAAK,EAAM,IAAK,EAAM,GAAI,EAAM,GAAI,CAAK,CAAC,EAChE,mBAAmB,KAAK,OAAO,WAAW,EAC1C,qBAAqB,KAAK,OAAO,WAAW,EAC5C,MAAM,CACX,CACA,eAAgB,CACd,SAAO,wBAAqB,CAAE,KAAM,CAAE,QAAS,EAAG,QAAS,SAAU,CAAE,CAAC,CAC1E,CACF",
6
- "names": ["import_purify_ts", "import_xstate", "import_ApduBuilder", "import_CommandResult", "import_makeInternalApi", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_OpenAppDeviceAction", "import_src", "import_SendCommandInAppDeviceAction", "importOriginal", "setupOpenAppDAMock", "error", "sendMyCommand", "extractDependenciesMock", "apiSendCommandMock", "commandParams", "mockedCommandResponse", "deviceAction", "TestCommand", "resolve", "reject", "expectedStates", "params"]
4
+ "sourcesContent": ["/* eslint @typescript-eslint/consistent-type-imports:0 */\n\nimport { Left, Right } from \"purify-ts\";\nimport { type Mock } from \"vitest\";\nimport { assign, createMachine } from \"xstate\";\n\nimport { type Apdu } from \"@api/apdu/model/Apdu\";\nimport { ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nimport { CommandResultFactory } from \"@api/command/model/CommandResult\";\nimport { makeDeviceActionInternalApiMock } from \"@api/device-action/__test-utils__/makeInternalApi\";\nimport { testDeviceActionStates } from \"@api/device-action/__test-utils__/testDeviceActionStates\";\nimport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nimport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport { UnknownDAError } from \"@api/device-action/os/Errors\";\nimport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nimport { openAppDAStateStep } from \"@api/device-action/os/OpenAppDeviceAction/types\";\nimport { type Command } from \"@api/types\";\nimport { UnknownDeviceExchangeError } from \"@root/src\";\n\nimport { SendCommandInAppDeviceAction } from \"./SendCommandInAppDeviceAction\";\nimport {\n type SendCommandInAppDAError,\n type SendCommandInAppDAIntermediateValue,\n type SendCommandInAppDAOutput,\n sendCommandInAppDAStateStep,\n} from \"./SendCommandInAppDeviceActionTypes\";\n\nvi.mock(\n \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\",\n async (importOriginal) => {\n const original =\n await importOriginal<\n typeof import(\"../OpenAppDeviceAction/OpenAppDeviceAction\")\n >();\n\n return {\n ...original,\n OpenAppDeviceAction: vi.fn(() => ({\n makeStateMachine: vi.fn(),\n })),\n };\n },\n);\n\nconst setupOpenAppDAMock = (error?: unknown) => {\n (OpenAppDeviceAction as Mock).mockImplementation(() => ({\n makeStateMachine: vi.fn().mockImplementation(() =>\n createMachine({\n initial: \"pending\",\n states: {\n pending: {\n entry: assign({\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n step: openAppDAStateStep.GET_DEVICE_STATUS,\n },\n }),\n after: {\n 0: \"done\",\n },\n },\n done: {\n type: \"final\",\n },\n },\n output: () => (error ? Left(error) : Right(undefined)),\n }),\n ),\n }));\n};\n\ndescribe(\"SendCommandInAppDeviceAction\", () => {\n const sendMyCommand = vi.fn();\n\n const extractDependenciesMock = () => ({\n sendCommand: sendMyCommand,\n });\n\n const { sendCommand: apiSendCommandMock } = makeDeviceActionInternalApiMock();\n\n const commandParams = {\n paramString: \"aParameter\",\n paramNumber: 1234,\n };\n const mockedCommandResponse = {\n aNumber: 5678,\n aString: \"mockedResponseString\",\n };\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n describe(\"without mocking extractDependencies\", () => {\n it(\"should call sendCommand on internalApi with the correct parameters\", async () => {\n setupOpenAppDAMock();\n apiSendCommandMock.mockResolvedValue(\n CommandResultFactory({ data: undefined }),\n );\n\n const deviceAction = new SendCommandInAppDeviceAction({\n input: {\n command: new TestCommand(commandParams),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n });\n await new Promise<void>((resolve, reject) => {\n deviceAction\n ._execute(makeDeviceActionInternalApiMock())\n .observable.subscribe({\n error: () => reject(),\n complete: () => resolve(),\n next: () => {},\n });\n });\n\n expect(apiSendCommandMock).toHaveBeenCalledWith(\n new TestCommand(commandParams),\n );\n });\n });\n\n describe(\"error cases\", () => {\n it(\"should error and output the error if the open app fails\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock(new UnknownDAError(\"Mocked error\"));\n\n const expectedStates: MyCommandSendCommandDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: sendCommandInAppDAStateStep.OPEN_APP,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n step: openAppDAStateStep.GET_DEVICE_STATUS,\n },\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDAError(\"Mocked error\"),\n },\n ];\n\n testDeviceActionStates(\n new SendCommandInAppDeviceAction({\n input: {\n command: new TestCommand(commandParams),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n }),\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should error and output an error if the send command fails\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n sendMyCommand.mockResolvedValue(\n CommandResultFactory({\n error: new UnknownDeviceExchangeError(\"Mocked error\"),\n }),\n );\n\n const deviceAction = new SendCommandInAppDeviceAction({\n input: {\n command: new TestCommand(commandParams),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandSendCommandDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: sendCommandInAppDAStateStep.OPEN_APP,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n step: openAppDAStateStep.GET_DEVICE_STATUS,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n step: sendCommandInAppDAStateStep.SEND_COMMAND,\n },\n },\n {\n status: DeviceActionStatus.Error,\n error: new UnknownDeviceExchangeError(\"Mocked error\"),\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n\n describe(\"success cases\", () => {\n it(\"should succeed and output the command result if the send command succeeds\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n sendMyCommand.mockResolvedValue(\n CommandResultFactory({ data: mockedCommandResponse }),\n );\n\n const deviceAction = new SendCommandInAppDeviceAction({\n input: {\n command: new TestCommand(commandParams),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: false,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandSendCommandDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.None,\n step: sendCommandInAppDAStateStep.OPEN_APP,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.ConfirmOpenApp,\n step: openAppDAStateStep.GET_DEVICE_STATUS,\n },\n },\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n step: sendCommandInAppDAStateStep.SEND_COMMAND,\n },\n },\n {\n status: DeviceActionStatus.Completed,\n output: mockedCommandResponse,\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n\n it(\"should succeed while skipping OpenApp\", () =>\n new Promise<void>((resolve, reject) => {\n setupOpenAppDAMock();\n\n sendMyCommand.mockResolvedValue(\n CommandResultFactory({ data: mockedCommandResponse }),\n );\n\n const deviceAction = new SendCommandInAppDeviceAction({\n input: {\n command: new TestCommand(commandParams),\n appName: \"MyApp\",\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n skipOpenApp: true,\n },\n });\n\n vi.spyOn(deviceAction, \"extractDependencies\").mockImplementation(\n extractDependenciesMock,\n );\n\n const expectedStates: MyCommandSendCommandDAState[] = [\n {\n status: DeviceActionStatus.Pending,\n intermediateValue: {\n requiredUserInteraction: UserInteractionRequired.VerifyAddress,\n step: sendCommandInAppDAStateStep.SEND_COMMAND,\n },\n },\n {\n status: DeviceActionStatus.Completed,\n output: mockedCommandResponse,\n },\n ];\n\n testDeviceActionStates(\n deviceAction,\n expectedStates,\n makeDeviceActionInternalApiMock(),\n {\n onDone: resolve,\n onError: reject,\n },\n );\n }));\n });\n});\n\ntype MyCommandResponse = {\n aNumber: number;\n aString: string;\n};\n\ntype MyCommandParams = {\n paramString: string;\n paramNumber: number;\n};\n\nclass TestCommand implements Command<MyCommandResponse, MyCommandParams> {\n readonly name = \"testCommand\";\n\n params: MyCommandParams;\n constructor(params: MyCommandParams) {\n this.params = params;\n }\n getApdu(): Apdu {\n return new ApduBuilder({ cla: 0x00, ins: 0x01, p1: 0x02, p2: 0x03 })\n .add32BitUIntToData(this.params.paramNumber)\n .addAsciiStringToData(this.params.paramString)\n .build();\n }\n parseResponse() {\n return CommandResultFactory({ data: { aNumber: 1, aString: \"aString\" } });\n }\n}\n\ntype MyCommandSendCommandDAState = DeviceActionState<\n SendCommandInAppDAOutput<MyCommandResponse>,\n SendCommandInAppDAError<UnknownDAError>,\n SendCommandInAppDAIntermediateValue<\n UserInteractionRequired.None | UserInteractionRequired.VerifyAddress\n >\n>;\n"],
5
+ "mappings": "aAEA,IAAAA,EAA4B,qBAE5BC,EAAsC,kBAGtCC,EAA4B,uCAC5BC,EAAqC,4CACrCC,EAAgD,6DAChDC,EAAuC,oEACvCC,EAGO,sDACPC,EAAwC,4DACxCC,EAA+B,wCAC/BC,EAAoC,yEACpCC,EAAmC,2DAEnCC,EAA2C,qBAE3CC,EAA6C,0CAC7CC,EAKO,+CAEP,GAAG,KACD,gEACA,MAAOC,IAME,CACL,GALA,MAAMA,EAEJ,EAIF,oBAAqB,GAAG,GAAG,KAAO,CAChC,iBAAkB,GAAG,GAAG,CAC1B,EAAE,CACJ,EAEJ,EAEA,MAAMC,EAAsBC,GAAoB,CAC7C,sBAA6B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Ac,qBAAqB,EAAE,mBAC5CJ,CACF,EAEA,MAAMQ,EAAgD,CACpD,CACE,OAAQ,qBAAmB,QAC3B,kBAAmB,CACjB,wBAAyB,0BAAwB,cACjD,KAAM,8BAA4B,YACpC,CACF,EACA,CACE,OAAQ,qBAAmB,UAC3B,OAAQL,CACV,CACF,KAEA,0BACEC,EACAI,KACA,mCAAgC,EAChC,CACE,OAAQF,EACR,QAASC,CACX,CACF,CACF,CAAC,CAAC,CACN,CAAC,CACH,CAAC,EAYD,MAAMF,CAAmE,CAC9D,KAAO,cAEhB,OACA,YAAYI,EAAyB,CACnC,KAAK,OAASA,CAChB,CACA,SAAgB,CACd,OAAO,IAAI,cAAY,CAAE,IAAK,EAAM,IAAK,EAAM,GAAI,EAAM,GAAI,CAAK,CAAC,EAChE,mBAAmB,KAAK,OAAO,WAAW,EAC1C,qBAAqB,KAAK,OAAO,WAAW,EAC5C,MAAM,CACX,CACA,eAAgB,CACd,SAAO,wBAAqB,CAAE,KAAM,CAAE,QAAS,EAAG,QAAS,SAAU,CAAE,CAAC,CAC1E,CACF",
6
+ "names": ["import_purify_ts", "import_xstate", "import_ApduBuilder", "import_CommandResult", "import_makeInternalApi", "import_testDeviceActionStates", "import_DeviceActionState", "import_UserInteractionRequired", "import_Errors", "import_OpenAppDeviceAction", "import_types", "import_src", "import_SendCommandInAppDeviceAction", "import_SendCommandInAppDeviceActionTypes", "importOriginal", "setupOpenAppDAMock", "error", "sendMyCommand", "extractDependenciesMock", "apiSendCommandMock", "commandParams", "mockedCommandResponse", "deviceAction", "TestCommand", "resolve", "reject", "expectedStates", "params"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var m=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var t=Object.prototype.hasOwnProperty;var s=(r,e,p,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of a(e))!t.call(r,o)&&o!==p&&m(r,o,{get:()=>e[o],enumerable:!(n=d(e,o))||n.enumerable});return r};var C=r=>s(m({},"__esModule",{value:!0}),r);var A={};module.exports=C(A);
1
+ "use strict";var p=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var s=(n,e)=>{for(var r in e)p(n,r,{get:e[r],enumerable:!0})},A=(n,e,r,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of d(e))!a.call(n,o)&&o!==r&&p(n,o,{get:()=>e[o],enumerable:!(m=t(e,o))||m.enumerable});return n};var C=n=>A(p({},"__esModule",{value:!0}),n);var i={};s(i,{sendCommandInAppDAStateStep:()=>I});module.exports=C(i);const I=Object.freeze({OPEN_APP:"os.sendCommandInApp.steps.openApp",SEND_COMMAND:"os.sendCommandInApp.steps.sendCommand"});0&&(module.exports={sendCommandInAppDAStateStep});
2
2
  //# sourceMappingURL=SendCommandInAppDeviceActionTypes.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes.ts"],
4
- "sourcesContent": ["import { type CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport {\n type OpenAppDAError,\n type OpenAppDAIntermediateValue,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\nimport { type Command } from \"@api/types\";\n\nexport type SendCommandInAppDAOutput<CommandResponse> = CommandResponse;\n\nexport type SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction,\n> = {\n readonly command: Command<CommandResponse, CommandArgs, CommandErrorCodes>;\n readonly appName: string;\n readonly skipOpenApp: boolean;\n readonly requiredUserInteraction: UserInteraction;\n};\n\nexport type SendCommandInAppDAError<CommandErrorCodes = void> =\n | OpenAppDAError\n | CommandErrorResult<CommandErrorCodes>[\"error\"];\n\nexport type SendCommandInAppDAIntermediateValue<UserInteraction> =\n | { readonly requiredUserInteraction: UserInteraction }\n | OpenAppDAIntermediateValue;\n\nexport type SendCommandInAppDAInternalState<\n CommandResponse,\n CommandErrorCodes,\n> = {\n readonly commandResponse: CommandResponse | null;\n readonly error: SendCommandInAppDAError<CommandErrorCodes> | null;\n};\n"],
5
- "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
- "names": ["SendCommandInAppDeviceActionTypes_exports", "__toCommonJS"]
4
+ "sourcesContent": ["import { type CommandErrorResult } from \"@api/command/model/CommandResult\";\nimport { type UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nimport {\n type OpenAppDAError,\n type OpenAppDAIntermediateValue,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\nimport { type Command } from \"@api/types\";\n\nexport const sendCommandInAppDAStateStep = Object.freeze({\n OPEN_APP: \"os.sendCommandInApp.steps.openApp\",\n SEND_COMMAND: \"os.sendCommandInApp.steps.sendCommand\",\n} as const);\n\nexport type SendCommandInAppDAStateStep =\n (typeof sendCommandInAppDAStateStep)[keyof typeof sendCommandInAppDAStateStep];\n\nexport type SendCommandInAppDAOutput<CommandResponse> = CommandResponse;\n\nexport type SendCommandInAppDAInput<\n CommandResponse,\n CommandArgs,\n CommandErrorCodes,\n UserInteraction,\n> = {\n readonly command: Command<CommandResponse, CommandArgs, CommandErrorCodes>;\n readonly appName: string;\n readonly skipOpenApp: boolean;\n readonly requiredUserInteraction: UserInteraction;\n};\n\nexport type SendCommandInAppDAError<CommandErrorCodes = void> =\n | OpenAppDAError\n | CommandErrorResult<CommandErrorCodes>[\"error\"];\n\nexport type SendCommandInAppDARequiredInteraction =\n UserInteractionRequired.None;\n\nexport type SendCommandInAppDAIntermediateValue<UserInteraction> =\n | {\n readonly requiredUserInteraction:\n | UserInteraction\n | SendCommandInAppDARequiredInteraction;\n readonly step: SendCommandInAppDAStateStep;\n }\n | OpenAppDAIntermediateValue;\n\nexport type SendCommandInAppDAInternalState<\n CommandResponse,\n CommandErrorCodes,\n> = {\n readonly commandResponse: CommandResponse | null;\n readonly error: SendCommandInAppDAError<CommandErrorCodes> | null;\n};\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAQO,MAAME,EAA8B,OAAO,OAAO,CACvD,SAAU,oCACV,aAAc,uCAChB,CAAU",
6
+ "names": ["SendCommandInAppDeviceActionTypes_exports", "__export", "sendCommandInAppDAStateStep", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var S=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var Se=Object.prototype.hasOwnProperty;var ge=(p,t)=>{for(var a in t)S(p,a,{get:t[a],enumerable:!0})},v=(p,t,a,g)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of ve(t))!Se.call(p,c)&&c!==a&&S(p,c,{get:()=>t[c],enumerable:!(g=le(t,c))||g.enumerable});return p},o=(p,t,a)=>(v(p,t,"default"),a&&v(a,t,"default"));var ye=p=>v(S({},"__esModule",{value:!0}),p);var e={};ge(e,{APDU_MAX_PAYLOAD:()=>d.APDU_MAX_PAYLOAD,Apdu:()=>y.Apdu,ApduBuilder:()=>d.ApduBuilder,ApduParser:()=>C.ApduParser,ApduResponse:()=>Q.ApduResponse,AppAlreadyInstalledDAError:()=>r.AppAlreadyInstalledDAError,BatteryStatusType:()=>A.BatteryStatusType,BleDeviceInfos:()=>j.BleDeviceInfos,ByteArrayBuilder:()=>G.ByteArrayBuilder,ByteArrayParser:()=>L.ByteArrayParser,CallTaskInAppDeviceAction:()=>F.CallTaskInAppDeviceAction,CloseAppCommand:()=>E.CloseAppCommand,CommandResultFactory:()=>i.CommandResultFactory,CommandResultStatus:()=>i.CommandResultStatus,CommandUtils:()=>h.CommandUtils,ConnectedDevice:()=>xe.ConnectedDevice,ConsoleLogger:()=>ce.ConsoleLogger,DEFAULT_UNLOCK_TIMEOUT_MS:()=>_.DEFAULT_UNLOCK_TIMEOUT_MS,DefaultLogTagFormatter:()=>de.DefaultLogTagFormatter,DeviceActionStatus:()=>U.DeviceActionStatus,DeviceConnectionStateMachine:()=>Ae.DeviceConnectionStateMachine,DeviceLockedError:()=>r.DeviceLockedError,DeviceManagementKit:()=>me.DeviceManagementKit,DeviceManagementKitBuilder:()=>ne.DeviceManagementKitBuilder,DeviceModel:()=>n.DeviceModel,DeviceModelId:()=>n.DeviceModelId,DeviceNotOnboardedError:()=>r.DeviceNotOnboardedError,DeviceSessionStateType:()=>Z.DeviceSessionStateType,DeviceStatus:()=>M.DeviceStatus,FramerUtils:()=>ie.FramerUtils,GLOBAL_ERRORS:()=>m.GLOBAL_ERRORS,GenuineCheckDeviceAction:()=>$.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>B.GetAppAndVersionCommand,GetBackgroundImageSizeCommand:()=>x.GetBackgroundImageSizeCommand,GetBackgroundImageSizeCommandError:()=>x.GetBackgroundImageSizeCommandError,GetBatteryStatusCommand:()=>A.GetBatteryStatusCommand,GetDeviceMetadataDeviceAction:()=>V.GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction:()=>z.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>I.GetOsVersionCommand,GlobalCommandError:()=>m.GlobalCommandError,GlobalCommandErrorHandler:()=>m.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>P.GoToDashboardDeviceAction,InstallAppDeviceAction:()=>ee.InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction:()=>W.InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError:()=>f.InvalidGetFirmwareMetadataResponseError,InvalidStatusWordError:()=>f.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>n.LEDGER_VENDOR_ID,ListAppsCommand:()=>R.ListAppsCommand,ListAppsDeviceAction:()=>w.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>H.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>oe.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>T.LoadCertificateCommand,LogLevel:()=>se.LogLevel,OpenAppCommand:()=>b.OpenAppCommand,OpenAppDeviceAction:()=>K.OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction:()=>N.OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError:()=>r.OutOfMemoryDAError,RefusedByUserDAError:()=>r.RefusedByUserDAError,SecureChannelError:()=>te.SecureChannelError,SendCommandInAppDeviceAction:()=>q.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>Y.StaticDeviceModelDataSource,TransportConnectedDevice:()=>De.TransportConnectedDevice,TransportDeviceModel:()=>J.TransportDeviceModel,UninstallAppDeviceAction:()=>re.UninstallAppDeviceAction,UnknownDAError:()=>r.UnknownDAError,UnsupportedFirmwareDAError:()=>r.UnsupportedFirmwareDAError,UserInteractionRequired:()=>k.UserInteractionRequired,WebLogsExporterLogger:()=>fe.WebLogsExporterLogger,XStateDeviceAction:()=>X.XStateDeviceAction,base64StringToBuffer:()=>l.base64StringToBuffer,bufferToHexaString:()=>s.bufferToHexaString,connectedDeviceStubBuilder:()=>ue.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>pe.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>ae.defaultApduSenderServiceStubBuilder,formatApduReceivedLog:()=>u.formatApduReceivedLog,formatApduSentLog:()=>u.formatApduSentLog,hexaStringToBuffer:()=>s.hexaStringToBuffer,isBase64String:()=>l.isBase64String,isCommandErrorCode:()=>O.isCommandErrorCode,isHexaString:()=>s.isHexaString,isSuccessCommandResult:()=>i.isSuccessCommandResult,noopLogger:()=>D.noopLogger,noopLoggerFactory:()=>D.noopLoggerFactory});module.exports=ye(e);var y=require("./apdu/model/Apdu"),d=require("./apdu/utils/ApduBuilder"),C=require("./apdu/utils/ApduParser");o(e,require("./apdu/utils/AppBuilderError"),module.exports);var G=require("./apdu/utils/ByteArrayBuilder"),L=require("./apdu/utils/ByteArrayParser"),f=require("./command/Errors"),i=require("./command/model/CommandResult"),E=require("./command/os/CloseAppCommand"),B=require("./command/os/GetAppAndVersionCommand"),x=require("./command/os/GetBackgroundImageSizeCommand"),A=require("./command/os/GetBatteryStatusCommand"),I=require("./command/os/GetOsVersionCommand"),R=require("./command/os/ListAppsCommand"),T=require("./command/os/LoadCertificateCommand"),b=require("./command/os/OpenAppCommand"),O=require("./command/utils/CommandErrors"),h=require("./command/utils/CommandUtils"),m=require("./command/utils/GlobalCommandError"),n=require("./device/DeviceModel"),M=require("./device/DeviceStatus"),U=require("./device-action/model/DeviceActionState"),k=require("./device-action/model/UserInteractionRequired"),F=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),_=require("./device-action/os/Const"),r=require("./device-action/os/Errors"),V=require("./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),z=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),P=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),W=require("./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),w=require("./device-action/os/ListApps/ListAppsDeviceAction"),H=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),K=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),N=require("./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction"),q=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),X=require("./device-action/xstate-utils/XStateDeviceAction"),Y=require("./device-model/data/StaticDeviceModelDataSource"),j=require("./device-model/model/BleDeviceInfos"),J=require("./device-model/model/DeviceModel"),Q=require("./device-session/ApduResponse");o(e,require("./device-session/data/FramerConst"),module.exports);var Z=require("./device-session/DeviceSessionState"),$=require("./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction"),ee=require("./secure-channel/device-action/InstallApp/InstallAppDeviceAction"),oe=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),re=require("./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction"),te=require("../internal/secure-channel/model/Errors"),pe=require("./device-session/service/DefaultApduReceiverService.stub"),ae=require("./device-session/service/DefaultApduSenderService.stub"),ie=require("./device-session/utils/FramerUtils"),me=require("./DeviceManagementKit"),ne=require("./DeviceManagementKitBuilder");o(e,require("./Error"),module.exports);var D=require("./logger-publisher/utils/noopLoggerFactory"),se=require("./logger-subscriber/model/LogLevel"),ce=require("./logger-subscriber/service/ConsoleLogger"),de=require("./logger-subscriber/service/DefaultLogTagFormatter"),fe=require("./logger-subscriber/service/WebLogsExporterLogger"),xe=require("./transport/model/ConnectedDevice"),Ae=require("./transport/model/DeviceConnectionStateMachine");o(e,require("./transport/model/Errors"),module.exports);var De=require("./transport/model/TransportConnectedDevice"),ue=require("./transport/model/TransportConnectedDevice.stub");o(e,require("./types"),module.exports);var u=require("./utils/apduLogs"),l=require("./utils/Base64String"),s=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,AppAlreadyInstalledDAError,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DEFAULT_UNLOCK_TIMEOUT_MS,DefaultLogTagFormatter,DeviceActionStatus,DeviceConnectionStateMachine,DeviceLockedError,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceNotOnboardedError,DeviceSessionStateType,DeviceStatus,FramerUtils,GLOBAL_ERRORS,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBackgroundImageSizeCommand,GetBackgroundImageSizeCommandError,GetBatteryStatusCommand,GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError,RefusedByUserDAError,SecureChannelError,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UninstallAppDeviceAction,UnknownDAError,UnsupportedFirmwareDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,formatApduReceivedLog,formatApduSentLog,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,noopLogger,noopLoggerFactory,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
1
+ "use strict";var S=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Se=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var ge=(p,t)=>{for(var a in t)S(p,a,{get:t[a],enumerable:!0})},v=(p,t,a,y)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of Se(t))!ye.call(p,d)&&d!==a&&S(p,d,{get:()=>t[d],enumerable:!(y=ve(t,d))||y.enumerable});return p},o=(p,t,a)=>(v(p,t,"default"),a&&v(a,t,"default"));var Ce=p=>v(S({},"__esModule",{value:!0}),p);var e={};ge(e,{APDU_MAX_PAYLOAD:()=>x.APDU_MAX_PAYLOAD,Apdu:()=>g.Apdu,ApduBuilder:()=>x.ApduBuilder,ApduParser:()=>C.ApduParser,ApduResponse:()=>Q.ApduResponse,AppAlreadyInstalledDAError:()=>r.AppAlreadyInstalledDAError,ApplicationChecker:()=>le.ApplicationChecker,BatteryStatusType:()=>D.BatteryStatusType,BleDeviceInfos:()=>j.BleDeviceInfos,ByteArrayBuilder:()=>G.ByteArrayBuilder,ByteArrayParser:()=>L.ByteArrayParser,CallTaskInAppDeviceAction:()=>F.CallTaskInAppDeviceAction,CloseAppCommand:()=>E.CloseAppCommand,CommandResultFactory:()=>n.CommandResultFactory,CommandResultStatus:()=>n.CommandResultStatus,CommandUtils:()=>O.CommandUtils,ConnectedDevice:()=>xe.ConnectedDevice,ConsoleLogger:()=>ce.ConsoleLogger,DEFAULT_UNLOCK_TIMEOUT_MS:()=>_.DEFAULT_UNLOCK_TIMEOUT_MS,DefaultLogTagFormatter:()=>fe.DefaultLogTagFormatter,DeviceActionStatus:()=>U.DeviceActionStatus,DeviceConnectionStateMachine:()=>Ae.DeviceConnectionStateMachine,DeviceLockedError:()=>r.DeviceLockedError,DeviceManagementKit:()=>ne.DeviceManagementKit,DeviceManagementKitBuilder:()=>me.DeviceManagementKitBuilder,DeviceModel:()=>s.DeviceModel,DeviceModelId:()=>s.DeviceModelId,DeviceNotOnboardedError:()=>r.DeviceNotOnboardedError,DeviceSessionStateType:()=>Z.DeviceSessionStateType,DeviceStatus:()=>M.DeviceStatus,FramerUtils:()=>ie.FramerUtils,GLOBAL_ERRORS:()=>m.GLOBAL_ERRORS,GenuineCheckDeviceAction:()=>$.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>B.GetAppAndVersionCommand,GetBackgroundImageSizeCommand:()=>A.GetBackgroundImageSizeCommand,GetBackgroundImageSizeCommandError:()=>A.GetBackgroundImageSizeCommandError,GetBatteryStatusCommand:()=>D.GetBatteryStatusCommand,GetDeviceMetadataDeviceAction:()=>V.GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction:()=>z.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>R.GetOsVersionCommand,GlobalCommandError:()=>m.GlobalCommandError,GlobalCommandErrorHandler:()=>m.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>P.GoToDashboardDeviceAction,InstallAppDeviceAction:()=>ee.InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction:()=>W.InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError:()=>i.InvalidGetFirmwareMetadataResponseError,InvalidResponseFormatError:()=>i.InvalidResponseFormatError,InvalidStatusWordError:()=>i.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>s.LEDGER_VENDOR_ID,ListAppsCommand:()=>I.ListAppsCommand,ListAppsDeviceAction:()=>w.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>H.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>oe.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>T.LoadCertificateCommand,LogLevel:()=>se.LogLevel,OpenAppCommand:()=>b.OpenAppCommand,OpenAppDeviceAction:()=>K.OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction:()=>N.OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError:()=>r.OutOfMemoryDAError,RefusedByUserDAError:()=>r.RefusedByUserDAError,SecureChannelError:()=>te.SecureChannelError,SendCommandInAppDeviceAction:()=>q.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>Y.StaticDeviceModelDataSource,TransportConnectedDevice:()=>De.TransportConnectedDevice,TransportDeviceModel:()=>J.TransportDeviceModel,UninstallAppDeviceAction:()=>re.UninstallAppDeviceAction,UnknownDAError:()=>r.UnknownDAError,UnsupportedFirmwareDAError:()=>r.UnsupportedFirmwareDAError,UserInteractionRequired:()=>k.UserInteractionRequired,WebLogsExporterLogger:()=>de.WebLogsExporterLogger,XStateDeviceAction:()=>X.XStateDeviceAction,base64StringToBuffer:()=>c.base64StringToBuffer,bufferToBase64String:()=>c.bufferToBase64String,bufferToHexaString:()=>f.bufferToHexaString,connectedDeviceStubBuilder:()=>ue.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>pe.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>ae.defaultApduSenderServiceStubBuilder,formatApduReceivedLog:()=>l.formatApduReceivedLog,formatApduSentLog:()=>l.formatApduSentLog,hexaStringToBuffer:()=>f.hexaStringToBuffer,isBase64String:()=>c.isBase64String,isCommandErrorCode:()=>h.isCommandErrorCode,isHexaString:()=>f.isHexaString,isSuccessCommandResult:()=>n.isSuccessCommandResult,noopLogger:()=>u.noopLogger,noopLoggerFactory:()=>u.noopLoggerFactory});module.exports=Ce(e);var g=require("./apdu/model/Apdu"),x=require("./apdu/utils/ApduBuilder"),C=require("./apdu/utils/ApduParser");o(e,require("./apdu/utils/AppBuilderError"),module.exports);var G=require("./apdu/utils/ByteArrayBuilder"),L=require("./apdu/utils/ByteArrayParser"),i=require("./command/Errors"),n=require("./command/model/CommandResult"),E=require("./command/os/CloseAppCommand"),B=require("./command/os/GetAppAndVersionCommand"),A=require("./command/os/GetBackgroundImageSizeCommand"),D=require("./command/os/GetBatteryStatusCommand"),R=require("./command/os/GetOsVersionCommand"),I=require("./command/os/ListAppsCommand"),T=require("./command/os/LoadCertificateCommand"),b=require("./command/os/OpenAppCommand"),h=require("./command/utils/CommandErrors"),O=require("./command/utils/CommandUtils"),m=require("./command/utils/GlobalCommandError"),s=require("./device/DeviceModel"),M=require("./device/DeviceStatus"),U=require("./device-action/model/DeviceActionState"),k=require("./device-action/model/UserInteractionRequired"),F=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),_=require("./device-action/os/Const"),r=require("./device-action/os/Errors"),V=require("./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),z=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),P=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),W=require("./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),w=require("./device-action/os/ListApps/ListAppsDeviceAction"),H=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),K=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),N=require("./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction"),q=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),X=require("./device-action/xstate-utils/XStateDeviceAction"),Y=require("./device-model/data/StaticDeviceModelDataSource"),j=require("./device-model/model/BleDeviceInfos"),J=require("./device-model/model/DeviceModel"),Q=require("./device-session/ApduResponse");o(e,require("./device-session/data/FramerConst"),module.exports);var Z=require("./device-session/DeviceSessionState"),$=require("./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction"),ee=require("./secure-channel/device-action/InstallApp/InstallAppDeviceAction"),oe=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),re=require("./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction"),te=require("../internal/secure-channel/model/Errors"),pe=require("./device-session/service/DefaultApduReceiverService.stub"),ae=require("./device-session/service/DefaultApduSenderService.stub"),ie=require("./device-session/utils/FramerUtils"),ne=require("./DeviceManagementKit"),me=require("./DeviceManagementKitBuilder");o(e,require("./Error"),module.exports);var u=require("./logger-publisher/utils/noopLoggerFactory"),se=require("./logger-subscriber/model/LogLevel"),ce=require("./logger-subscriber/service/ConsoleLogger"),fe=require("./logger-subscriber/service/DefaultLogTagFormatter"),de=require("./logger-subscriber/service/WebLogsExporterLogger"),xe=require("./transport/model/ConnectedDevice"),Ae=require("./transport/model/DeviceConnectionStateMachine");o(e,require("./transport/model/Errors"),module.exports);var De=require("./transport/model/TransportConnectedDevice"),ue=require("./transport/model/TransportConnectedDevice.stub");o(e,require("./types"),module.exports);var l=require("./utils/apduLogs"),le=require("./utils/ApplicationChecker"),c=require("./utils/Base64String"),f=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,AppAlreadyInstalledDAError,ApplicationChecker,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DEFAULT_UNLOCK_TIMEOUT_MS,DefaultLogTagFormatter,DeviceActionStatus,DeviceConnectionStateMachine,DeviceLockedError,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceNotOnboardedError,DeviceSessionStateType,DeviceStatus,FramerUtils,GLOBAL_ERRORS,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBackgroundImageSizeCommand,GetBackgroundImageSizeCommandError,GetBatteryStatusCommand,GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError,InvalidResponseFormatError,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError,RefusedByUserDAError,SecureChannelError,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UninstallAppDeviceAction,UnknownDAError,UnsupportedFirmwareDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToBase64String,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,formatApduReceivedLog,formatApduSentLog,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,noopLogger,noopLoggerFactory,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/index.ts"],
4
- "sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { type Command } from \"@api/command/Command\";\nexport {\n InvalidGetFirmwareMetadataResponseError,\n InvalidStatusWordError,\n} from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n GetBackgroundImageSizeCommand,\n GetBackgroundImageSizeCommandError,\n type GetBackgroundImageSizeCommandResult,\n type GetBackgroundImageSizeErrorCodes,\n type GetBackgroundImageSizeResponse,\n} from \"@api/command/os/GetBackgroundImageSizeCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nexport {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n DeviceNotOnboardedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport type {\n GoToDashboardDAError,\n GoToDashboardDAInput,\n GoToDashboardDAIntermediateValue,\n GoToDashboardDAOutput,\n GoToDashboardDARequiredInteraction,\n GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport {\n noopLogger,\n noopLoggerFactory,\n} from \"@api/logger-publisher/utils/noopLoggerFactory\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { DefaultLogTagFormatter } from \"@api/logger-subscriber/service/DefaultLogTagFormatter\";\nexport { type LogTagFormatter } from \"@api/logger-subscriber/service/LogTagFormatter\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { formatApduReceivedLog, formatApduSentLog } from \"@api/utils/apduLogs\";\nexport { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
- "mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,u+HAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAEhCC,EAGO,+BACPC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAMO,yDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAIO,kDACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAIO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCC,EAA0C,qFAC1CC,EAA0C,uCAC1ClB,EAQO,wCACPmB,EAA8C,iFAC9CC,EAA4C,6EAC5CC,EAA0C,yEAS1CC,EAAgD,qFAChDC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAAoD,6FACpDC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/BjB,EAAqC,+CACrCkB,EAA6B,4CAC7BlC,EAAAN,EAAc,gDA9Gd,gBA+GA,IAAAyC,EAGO,kDACPC,EAAyC,mFACzCC,GAAuC,+EACvCC,GAA8C,6FAC9CC,GAAyC,mFACzCpC,GAAmC,iDAEnCqC,GAAsD,uEACtDC,GAAoD,qEACpDC,GAA4B,iDAC5BC,GAAoC,oCACpCC,GAA2C,2CAC3C5C,EAAAN,EAAc,sBA9Hd,gBA+HA,IAAAmD,EAGO,yDACPC,GAAyB,iDACzBC,GAA8B,wDAC9BC,GAAuC,iEAEvCC,GAAsC,gEACtCC,GAAgC,gDAChCC,GAGO,6DACPnD,EAAAN,EAAc,uCA7Id,gBA8IA,IAAA0D,GAAyC,yDACzCA,GAA2C,8DAC3CpD,EAAAN,EAAc,sBAhJd,gBAiJA,IAAA2D,EAAyD,+BACzDC,EAAqD,mCACrDC,EAIO",
6
- "names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBackgroundImageSizeCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_Const", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_OpenAppWithDependenciesDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_GenuineCheckDeviceAction", "import_InstallAppDeviceAction", "import_ListInstalledAppsDeviceAction", "import_UninstallAppDeviceAction", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_noopLoggerFactory", "import_LogLevel", "import_ConsoleLogger", "import_DefaultLogTagFormatter", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_DeviceConnectionStateMachine", "import_TransportConnectedDevice", "import_apduLogs", "import_Base64String", "import_HexaString"]
4
+ "sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { type Command } from \"@api/command/Command\";\nexport {\n InvalidGetFirmwareMetadataResponseError,\n InvalidResponseFormatError,\n InvalidStatusWordError,\n} from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n GetBackgroundImageSizeCommand,\n GetBackgroundImageSizeCommandError,\n type GetBackgroundImageSizeCommandResult,\n type GetBackgroundImageSizeErrorCodes,\n type GetBackgroundImageSizeResponse,\n} from \"@api/command/os/GetBackgroundImageSizeCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nexport {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\n DeviceNotOnboardedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport type {\n GoToDashboardDAError,\n GoToDashboardDAInput,\n GoToDashboardDAIntermediateValue,\n GoToDashboardDAOutput,\n GoToDashboardDARequiredInteraction,\n GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport {\n noopLogger,\n noopLoggerFactory,\n} from \"@api/logger-publisher/utils/noopLoggerFactory\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { DefaultLogTagFormatter } from \"@api/logger-subscriber/service/DefaultLogTagFormatter\";\nexport { type LogTagFormatter } from \"@api/logger-subscriber/service/LogTagFormatter\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { formatApduReceivedLog, formatApduSentLog } from \"@api/utils/apduLogs\";\nexport { ApplicationChecker } from \"@api/utils/ApplicationChecker\";\nexport {\n type AppConfig,\n type ApplicationResolver,\n type ResolvedApp,\n} from \"@api/utils/ApplicationResolver\";\nexport {\n base64StringToBuffer,\n bufferToBase64String,\n isBase64String,\n} from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
5
+ "mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,goIAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAEhCC,EAIO,+BACPC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAMO,yDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAIO,kDACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAIO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCC,EAA0C,qFAC1CC,EAA0C,uCAC1ClB,EAQO,wCACPmB,EAA8C,iFAC9CC,EAA4C,6EAC5CC,EAA0C,yEAS1CC,EAAgD,qFAChDC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAAoD,6FACpDC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/BjB,EAAqC,+CACrCkB,EAA6B,4CAC7BlC,EAAAN,EAAc,gDA/Gd,gBAgHA,IAAAyC,EAGO,kDACPC,EAAyC,mFACzCC,GAAuC,+EACvCC,GAA8C,6FAC9CC,GAAyC,mFACzCpC,GAAmC,iDAEnCqC,GAAsD,uEACtDC,GAAoD,qEACpDC,GAA4B,iDAC5BC,GAAoC,oCACpCC,GAA2C,2CAC3C5C,EAAAN,EAAc,sBA/Hd,gBAgIA,IAAAmD,EAGO,yDACPC,GAAyB,iDACzBC,GAA8B,wDAC9BC,GAAuC,iEAEvCC,GAAsC,gEACtCC,GAAgC,gDAChCC,GAGO,6DACPnD,EAAAN,EAAc,uCA9Id,gBA+IA,IAAA0D,GAAyC,yDACzCA,GAA2C,8DAC3CpD,EAAAN,EAAc,sBAjJd,gBAkJA,IAAA2D,EAAyD,+BACzDC,GAAmC,yCAMnCC,EAIO,mCACPC,EAIO",
6
+ "names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBackgroundImageSizeCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_Const", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_OpenAppWithDependenciesDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_GenuineCheckDeviceAction", "import_InstallAppDeviceAction", "import_ListInstalledAppsDeviceAction", "import_UninstallAppDeviceAction", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_noopLoggerFactory", "import_LogLevel", "import_ConsoleLogger", "import_DefaultLogTagFormatter", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_DeviceConnectionStateMachine", "import_TransportConnectedDevice", "import_apduLogs", "import_ApplicationChecker", "import_Base64String", "import_HexaString"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var A=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of i(e))!s.call(t,p)&&p!==n&&o(t,p,{get:()=>e[p],enumerable:!(r=a(e,p))||r.enumerable});return t};var d=t=>A(o({},"__esModule",{value:!0}),t);var y={};module.exports=d(y);
1
+ "use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var A=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of s(e))!i.call(t,p)&&p!==n&&o(t,p,{get:()=>e[p],enumerable:!(r=a(e,p))||r.enumerable});return t};var d=t=>A(o({},"__esModule",{value:!0}),t);var y={};module.exports=d(y);
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/types.ts"],
4
- "sourcesContent": ["export type { OpenAppErrorCodes } from \"./command/os/OpenAppCommand\";\nexport type { CommandErrors } from \"./command/utils/CommandErrors\";\nexport type { DeviceId } from \"./device/DeviceModel\";\nexport type { ConnectionType } from \"./discovery/ConnectionType\";\nexport type { CommandErrorArgs } from \"./Error\";\nexport type { LogSubscriberOptions } from \"./logger-subscriber/model/LogSubscriberOptions\";\nexport type { DiscoveredDevice } from \"./transport/model/DiscoveredDevice\";\nexport type {\n Transport,\n TransportArgs,\n TransportFactory,\n} from \"./transport/model/Transport\";\nexport type { TransportIdentifier } from \"./transport/model/TransportIdentifier\";\nexport type { ApduBuilderArgs } from \"@api/apdu/utils/ApduBuilder\";\nexport type { Command } from \"@api/command/Command\";\nexport type {\n CommandErrorResult,\n CommandResult,\n CommandSuccessResult,\n} from \"@api/command/model/CommandResult\";\nexport type { SendCommandUseCaseArgs } from \"@api/command/use-case/SendCommandUseCase\";\nexport type { DeviceModelId } from \"@api/device/DeviceModel\";\nexport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nexport {\n type GetDeviceMetadataDAError,\n type GetDeviceMetadataDAInput,\n type GetDeviceMetadataDAIntermediateValue,\n type GetDeviceMetadataDAOutput,\n type GetDeviceMetadataDAState,\n} from \"@api/device-action/os/GetDeviceMetadata/types\";\nexport {\n type GetDeviceStatusDAError,\n type GetDeviceStatusDAInput,\n type GetDeviceStatusDAIntermediateValue,\n type GetDeviceStatusDAOutput,\n type GetDeviceStatusDAState,\n} from \"@api/device-action/os/GetDeviceStatus/types\";\nexport {\n type GoToDashboardDAError,\n type GoToDashboardDAInput,\n type GoToDashboardDAIntermediateValue,\n type GoToDashboardDAOutput,\n type GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport {\n type ApplicationConstraint,\n type ApplicationDependency,\n type ApplicationVersionConstraint,\n type InstallOrUpdateAppsDAError,\n type InstallOrUpdateAppsDAInput,\n type InstallOrUpdateAppsDAIntermediateValue,\n type InstallOrUpdateAppsDAOutput,\n type InstallOrUpdateAppsDAState,\n type InstallPlan,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nexport {\n type ListAppsDAError,\n type ListAppsDAInput,\n type ListAppsDAIntermediateValue,\n type ListAppsDAOutput,\n type ListAppsDAState,\n} from \"@api/device-action/os/ListApps/types\";\nexport {\n type ListAppsWithMetadataDAError,\n type ListAppsWithMetadataDAInput,\n type ListAppsWithMetadataDAIntermediateValue,\n type ListAppsWithMetadataDAOutput,\n type ListAppsWithMetadataDAState,\n} from \"@api/device-action/os/ListAppsWithMetadata/types\";\nexport {\n type OpenAppDAError,\n type OpenAppDAInput,\n type OpenAppDAIntermediateValue,\n type OpenAppDAOutput,\n type OpenAppDARequiredInteraction,\n type OpenAppDAState,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\nexport {\n type OpenAppWithDependenciesDAError,\n type OpenAppWithDependenciesDAInput,\n type OpenAppWithDependenciesDAIntermediateValue,\n type OpenAppWithDependenciesDAOutput,\n type OpenAppWithDependenciesDARequiredInteraction,\n type OpenAppWithDependenciesDAState,\n} from \"@api/device-action/os/OpenAppWithDependencies/types\";\nexport {\n type SendCommandInAppDAError,\n type SendCommandInAppDAInput,\n type SendCommandInAppDAIntermediateValue,\n type SendCommandInAppDAOutput,\n} from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes\";\nexport type { ExecuteDeviceActionUseCaseArgs } from \"@api/device-action/use-case/ExecuteDeviceActionUseCase\";\nexport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nexport { type DeviceModelDataSource } from \"@api/device-model/data/DeviceModelDataSource\";\nexport type {\n Catalog,\n CustomImage,\n DeviceSessionState,\n FirmwareUpdate,\n FirmwareUpdateContext,\n FirmwareVersion,\n InstalledLanguagePackage,\n RunningApp,\n} from \"@api/device-session/DeviceSessionState\";\nexport { type ApduReceiverService } from \"@api/device-session/service/ApduReceiverService\";\nexport { type ApduReceiverServiceFactory } from \"@api/device-session/service/ApduReceiverService\";\nexport { type ApduSenderServiceFactory } from \"@api/device-session/service/ApduSenderService\";\nexport { type ApduSenderService } from \"@api/device-session/service/ApduSenderService\";\nexport type { DeviceSessionId } from \"@api/device-session/types\";\nexport type { DmkConfig } from \"@api/DmkConfig\";\nexport type { DmkError } from \"@api/Error\";\nexport type { LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nexport type {\n LoggerSubscriberService,\n LogParams,\n} from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nexport {\n type GenuineCheckDAError,\n type GenuineCheckDAInput,\n type GenuineCheckDAIntermediateValue,\n type GenuineCheckDAOutput,\n type GenuineCheckDARequiredInteraction,\n type GenuineCheckDAState,\n} from \"@api/secure-channel/device-action/GenuineCheck/types\";\nexport {\n type InstallAppDAError,\n type InstallAppDAInput,\n type InstallAppDAIntermediateValue,\n type InstallAppDAOutput,\n type InstallAppDARequiredInteraction,\n type InstallAppDAState,\n} from \"@api/secure-channel/device-action/InstallApp/types\";\nexport {\n type ListInstalledAppsDAError,\n type ListInstalledAppsDAInput,\n type ListInstalledAppsDAIntermediateValue,\n type ListInstalledAppsDAOutput,\n type ListInstalledAppsDARequiredInteraction,\n type ListInstalledAppsDAState,\n} from \"@api/secure-channel/device-action/ListInstalledApps/types\";\nexport {\n type UninstallAppDAError,\n type UninstallAppDAInput,\n type UninstallAppDAIntermediateValue,\n type UninstallAppDAOutput,\n type UninstallAppDARequiredInteraction,\n type UninstallAppDAState,\n} from \"@api/secure-channel/device-action/UninstallApp/types\";\nexport { type DeviceApduSender } from \"@api/transport/model/DeviceApduSender\";\nexport {\n type DeviceConnection,\n type DisconnectHandler,\n type SendApduFnType,\n type SendApduResult,\n} from \"@api/transport/model/DeviceConnection\";\nexport { type TransportDiscoveredDevice } from \"@api/transport/model/TransportDiscoveredDevice\";\nexport type { HexaString } from \"@api/utils/HexaString\";\nexport type { ConnectUseCaseArgs } from \"@internal/discovery/use-case/ConnectUseCase\";\nexport type { DisconnectUseCaseArgs } from \"@internal/discovery/use-case/DisconnectUseCase\";\nexport type { GetConnectedDeviceUseCaseArgs } from \"@internal/discovery/use-case/GetConnectedDeviceUseCase\";\nexport type { StartDiscoveringUseCaseArgs } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nexport type { SendApduUseCaseArgs } from \"@internal/send/use-case/SendApduUseCase\";\n"],
4
+ "sourcesContent": ["export type { OpenAppErrorCodes } from \"./command/os/OpenAppCommand\";\nexport type { CommandErrors } from \"./command/utils/CommandErrors\";\nexport type { DeviceId } from \"./device/DeviceModel\";\nexport type { ConnectionType } from \"./discovery/ConnectionType\";\nexport type { CommandErrorArgs } from \"./Error\";\nexport type { LogSubscriberOptions } from \"./logger-subscriber/model/LogSubscriberOptions\";\nexport type { DiscoveredDevice } from \"./transport/model/DiscoveredDevice\";\nexport type {\n Transport,\n TransportArgs,\n TransportFactory,\n} from \"./transport/model/Transport\";\nexport type { TransportIdentifier } from \"./transport/model/TransportIdentifier\";\nexport type { ApduBuilderArgs } from \"@api/apdu/utils/ApduBuilder\";\nexport type { Command } from \"@api/command/Command\";\nexport type {\n CommandErrorResult,\n CommandResult,\n CommandSuccessResult,\n} from \"@api/command/model/CommandResult\";\nexport type { SendCommandUseCaseArgs } from \"@api/command/use-case/SendCommandUseCase\";\nexport type { DeviceModelId } from \"@api/device/DeviceModel\";\nexport {\n type DeviceAction,\n type DeviceActionIntermediateValue,\n type ExecuteDeviceActionReturnType,\n} from \"@api/device-action/DeviceAction\";\nexport {\n type CallTaskInAppDAError,\n type CallTaskInAppDAIntermediateValue,\n type CallTaskInAppDAOutput,\n} from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceActionTypes\";\nexport {\n type GetDeviceMetadataDAError,\n type GetDeviceMetadataDAInput,\n type GetDeviceMetadataDAIntermediateValue,\n type GetDeviceMetadataDAOutput,\n type GetDeviceMetadataDAState,\n} from \"@api/device-action/os/GetDeviceMetadata/types\";\nexport {\n type GetDeviceStatusDAError,\n type GetDeviceStatusDAInput,\n type GetDeviceStatusDAIntermediateValue,\n type GetDeviceStatusDAOutput,\n type GetDeviceStatusDAState,\n} from \"@api/device-action/os/GetDeviceStatus/types\";\nexport {\n type GoToDashboardDAError,\n type GoToDashboardDAInput,\n type GoToDashboardDAIntermediateValue,\n type GoToDashboardDAOutput,\n type GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport {\n type ApplicationConstraint,\n type ApplicationDependency,\n type ApplicationVersionConstraint,\n type InstallOrUpdateAppsDAError,\n type InstallOrUpdateAppsDAInput,\n type InstallOrUpdateAppsDAIntermediateValue,\n type InstallOrUpdateAppsDAOutput,\n type InstallOrUpdateAppsDAState,\n type InstallPlan,\n} from \"@api/device-action/os/InstallOrUpdateApps/types\";\nexport {\n type ListAppsDAError,\n type ListAppsDAInput,\n type ListAppsDAIntermediateValue,\n type ListAppsDAOutput,\n type ListAppsDAState,\n} from \"@api/device-action/os/ListApps/types\";\nexport {\n type ListAppsWithMetadataDAError,\n type ListAppsWithMetadataDAInput,\n type ListAppsWithMetadataDAIntermediateValue,\n type ListAppsWithMetadataDAOutput,\n type ListAppsWithMetadataDAState,\n} from \"@api/device-action/os/ListAppsWithMetadata/types\";\nexport {\n type OpenAppDAError,\n type OpenAppDAInput,\n type OpenAppDAIntermediateValue,\n type OpenAppDAOutput,\n type OpenAppDARequiredInteraction,\n type OpenAppDAState,\n} from \"@api/device-action/os/OpenAppDeviceAction/types\";\nexport {\n type OpenAppWithDependenciesDAError,\n type OpenAppWithDependenciesDAInput,\n type OpenAppWithDependenciesDAIntermediateValue,\n type OpenAppWithDependenciesDAOutput,\n type OpenAppWithDependenciesDARequiredInteraction,\n type OpenAppWithDependenciesDAState,\n} from \"@api/device-action/os/OpenAppWithDependencies/types\";\nexport {\n type SendCommandInAppDAError,\n type SendCommandInAppDAInput,\n type SendCommandInAppDAIntermediateValue,\n type SendCommandInAppDAOutput,\n} from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceActionTypes\";\nexport type { ExecuteDeviceActionUseCaseArgs } from \"@api/device-action/use-case/ExecuteDeviceActionUseCase\";\nexport { type StateMachineTypes } from \"@api/device-action/xstate-utils/StateMachineTypes\";\nexport { type DeviceModelDataSource } from \"@api/device-model/data/DeviceModelDataSource\";\nexport type {\n Catalog,\n CustomImage,\n DeviceSessionState,\n FirmwareUpdate,\n FirmwareUpdateContext,\n FirmwareVersion,\n InstalledLanguagePackage,\n RunningApp,\n} from \"@api/device-session/DeviceSessionState\";\nexport { type ApduReceiverService } from \"@api/device-session/service/ApduReceiverService\";\nexport { type ApduReceiverServiceFactory } from \"@api/device-session/service/ApduReceiverService\";\nexport { type ApduSenderServiceFactory } from \"@api/device-session/service/ApduSenderService\";\nexport { type ApduSenderService } from \"@api/device-session/service/ApduSenderService\";\nexport type { DeviceSessionId } from \"@api/device-session/types\";\nexport type { DmkConfig } from \"@api/DmkConfig\";\nexport type { DmkError } from \"@api/Error\";\nexport type { LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nexport type {\n LoggerSubscriberService,\n LogParams,\n} from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nexport {\n type GenuineCheckDAError,\n type GenuineCheckDAInput,\n type GenuineCheckDAIntermediateValue,\n type GenuineCheckDAOutput,\n type GenuineCheckDARequiredInteraction,\n type GenuineCheckDAState,\n} from \"@api/secure-channel/device-action/GenuineCheck/types\";\nexport {\n type InstallAppDAError,\n type InstallAppDAInput,\n type InstallAppDAIntermediateValue,\n type InstallAppDAOutput,\n type InstallAppDARequiredInteraction,\n type InstallAppDAState,\n} from \"@api/secure-channel/device-action/InstallApp/types\";\nexport {\n type ListInstalledAppsDAError,\n type ListInstalledAppsDAInput,\n type ListInstalledAppsDAIntermediateValue,\n type ListInstalledAppsDAOutput,\n type ListInstalledAppsDARequiredInteraction,\n type ListInstalledAppsDAState,\n} from \"@api/secure-channel/device-action/ListInstalledApps/types\";\nexport {\n type UninstallAppDAError,\n type UninstallAppDAInput,\n type UninstallAppDAIntermediateValue,\n type UninstallAppDAOutput,\n type UninstallAppDARequiredInteraction,\n type UninstallAppDAState,\n} from \"@api/secure-channel/device-action/UninstallApp/types\";\nexport { type DeviceApduSender } from \"@api/transport/model/DeviceApduSender\";\nexport {\n type DeviceConnection,\n type DisconnectHandler,\n type SendApduFnType,\n type SendApduResult,\n} from \"@api/transport/model/DeviceConnection\";\nexport { type TransportDiscoveredDevice } from \"@api/transport/model/TransportDiscoveredDevice\";\nexport type { HexaString } from \"@api/utils/HexaString\";\nexport type { ConnectUseCaseArgs } from \"@internal/discovery/use-case/ConnectUseCase\";\nexport type { DisconnectUseCaseArgs } from \"@internal/discovery/use-case/DisconnectUseCase\";\nexport type { GetConnectedDeviceUseCaseArgs } from \"@internal/discovery/use-case/GetConnectedDeviceUseCase\";\nexport type { StartDiscoveringUseCaseArgs } from \"@internal/discovery/use-case/StartDiscoveringUseCase\";\nexport type { SendApduUseCaseArgs } from \"@internal/send/use-case/SendApduUseCase\";\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var a=(i,e)=>{for(var o in e)p(i,o,{get:e[o],enumerable:!0})},h=(i,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of n(e))!c.call(i,t)&&t!==o&&p(i,t,{get:()=>e[t],enumerable:!(s=l(e,t))||s.enumerable});return i};var v=i=>h(p({},"__esModule",{value:!0}),i);var d={};a(d,{ApplicationChecker:()=>m});module.exports=v(d);var r=require("semver");class m{isCompatible;version;modelId;constructor(e,o,s){this.modelId=e.deviceModelId;const t=s.resolve(e,o);this.isCompatible=t.isCompatible,this.version=t.version}withMinVersionInclusive(e){return(0,r.gte)(this.version,e)||(this.isCompatible=!1),this}withMinVersionExclusive(e){return(0,r.gt)(this.version,e)||(this.isCompatible=!1),this}excludeDeviceModel(e){return this.modelId===e&&(this.isCompatible=!1),this}check(){return this.isCompatible}}0&&(module.exports={ApplicationChecker});
2
+ //# sourceMappingURL=ApplicationChecker.js.map