askui 0.12.0 → 0.12.2

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 (349) hide show
  1. package/dist/cjs/core/reporting/default-step.js +4 -3
  2. package/dist/cjs/core/reporting/index.d.ts +0 -1
  3. package/dist/cjs/core/reporting/index.js +0 -1
  4. package/dist/cjs/core/reporting/snapshot-detail-level.d.ts +1 -0
  5. package/dist/cjs/core/reporting/snapshot-detail-level.js +8 -0
  6. package/dist/cjs/core/reporting/step-reporter.d.ts +7 -6
  7. package/dist/cjs/core/reporting/step-reporter.js +49 -34
  8. package/dist/cjs/execution/ui-control-client-dependency-builder.d.ts +0 -1
  9. package/dist/cjs/execution/ui-control-client-dependency-builder.js +1 -13
  10. package/dist/cjs/execution/ui-controller-client-interface.d.ts +4 -6
  11. package/dist/cjs/utils/base_64_image/base-64-image.d.ts +6 -9
  12. package/dist/cjs/utils/base_64_image/base-64-image.js +32 -33
  13. package/dist/cjs/utils/base_64_image/sharp.d.ts +2 -0
  14. package/dist/cjs/utils/base_64_image/sharp.js +56 -0
  15. package/dist/cjs/utils/proxy/proxy-builder.js +3 -1
  16. package/dist/cjs/utils/transformations.js +4 -2
  17. package/dist/esm/core/reporting/default-step.js +4 -3
  18. package/dist/esm/core/reporting/index.d.ts +0 -1
  19. package/dist/esm/core/reporting/index.js +0 -1
  20. package/dist/esm/core/reporting/snapshot-detail-level.d.ts +1 -0
  21. package/dist/esm/core/reporting/snapshot-detail-level.js +6 -1
  22. package/dist/esm/core/reporting/step-reporter.d.ts +7 -6
  23. package/dist/esm/core/reporting/step-reporter.js +49 -34
  24. package/dist/esm/execution/ui-control-client-dependency-builder.d.ts +0 -1
  25. package/dist/esm/execution/ui-control-client-dependency-builder.js +2 -14
  26. package/dist/esm/execution/ui-controller-client-interface.d.ts +4 -6
  27. package/dist/esm/utils/base_64_image/base-64-image.d.ts +6 -9
  28. package/dist/esm/utils/base_64_image/base-64-image.js +32 -33
  29. package/dist/esm/utils/base_64_image/sharp.d.ts +2 -0
  30. package/dist/esm/utils/base_64_image/sharp.js +33 -0
  31. package/dist/esm/utils/proxy/proxy-builder.js +3 -1
  32. package/dist/esm/utils/transformations.js +4 -2
  33. package/package.json +6 -3
  34. package/dist/cjs/core/reporting/default-reporter.d.ts +0 -10
  35. package/dist/cjs/core/reporting/default-reporter.js +0 -12
  36. package/dist/cjs/core/ui-control-commands/action-class-tdk-v1.d.ts +0 -19
  37. package/dist/cjs/core/ui-control-commands/action-class-tdk-v1.js +0 -23
  38. package/dist/cjs/core/ui-control-commands/action-tdk-v1.d.ts +0 -10
  39. package/dist/cjs/core/ui-control-commands/action-tdk-v1.js +0 -100
  40. package/dist/cjs/execution/annotation-level.d.ts +0 -5
  41. package/dist/cjs/execution/annotation-level.js +0 -9
  42. package/dist/cjs/execution/ui-control-client-error.d.ts +0 -2
  43. package/dist/cjs/execution/ui-control-client-error.js +0 -6
  44. package/dist/cjs/execution/ui-controller-client-facade.d.ts +0 -15
  45. package/dist/cjs/execution/ui-controller-client-facade.js +0 -2
  46. package/dist/cjs/execution/ui-controller-client-grpc.d.ts +0 -24
  47. package/dist/cjs/execution/ui-controller-client-grpc.js +0 -159
  48. package/dist/cjs/execution/ui-controller-client-tdk-v1.d.ts +0 -26
  49. package/dist/cjs/execution/ui-controller-client-tdk-v1.js +0 -221
  50. package/dist/cjs/proto/Askui/API/TDKv1/ActionClassID.d.ts +0 -21
  51. package/dist/cjs/proto/Askui/API/TDKv1/ActionClassID.js +0 -23
  52. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters.d.ts +0 -57
  53. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters.js +0 -3
  54. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_Press.d.ts +0 -8
  55. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_Press.js +0 -3
  56. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_PressAndRelease.d.ts +0 -8
  57. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_PressAndRelease.js +0 -3
  58. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_Release.d.ts +0 -8
  59. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_Release.js +0 -3
  60. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_Press.d.ts +0 -8
  61. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_Press.js +0 -3
  62. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_PressAndRelease.d.ts +0 -8
  63. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_PressAndRelease.js +0 -3
  64. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_Release.d.ts +0 -8
  65. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_Release.js +0 -3
  66. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardType_Text.d.ts +0 -13
  67. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardType_Text.js +0 -3
  68. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardType_UnicodeText.d.ts +0 -14
  69. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_KeyboardType_UnicodeText.js +0 -3
  70. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseButton_Press.d.ts +0 -7
  71. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseButton_Press.js +0 -3
  72. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseButton_PressAndRelease.d.ts +0 -9
  73. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseButton_PressAndRelease.js +0 -3
  74. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseButton_Release.d.ts +0 -7
  75. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseButton_Release.js +0 -3
  76. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseMove.d.ts +0 -11
  77. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseMove.js +0 -3
  78. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseMove_Delta.d.ts +0 -11
  79. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseMove_Delta.js +0 -3
  80. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseWheelScroll.d.ts +0 -14
  81. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_MouseWheelScroll.js +0 -3
  82. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_RunCommand.d.ts +0 -6
  83. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_RunCommand.js +0 -3
  84. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_Wait.d.ts +0 -6
  85. package/dist/cjs/proto/Askui/API/TDKv1/ActionParameters_Wait.js +0 -3
  86. package/dist/cjs/proto/Askui/API/TDKv1/Bitmap.d.ts +0 -17
  87. package/dist/cjs/proto/Askui/API/TDKv1/Bitmap.js +0 -3
  88. package/dist/cjs/proto/Askui/API/TDKv1/CaptureArea.d.ts +0 -13
  89. package/dist/cjs/proto/Askui/API/TDKv1/CaptureArea.js +0 -3
  90. package/dist/cjs/proto/Askui/API/TDKv1/Color.d.ts +0 -10
  91. package/dist/cjs/proto/Askui/API/TDKv1/Color.js +0 -3
  92. package/dist/cjs/proto/Askui/API/TDKv1/ControllerAPI.d.ts +0 -239
  93. package/dist/cjs/proto/Askui/API/TDKv1/ControllerAPI.js +0 -3
  94. package/dist/cjs/proto/Askui/API/TDKv1/Coordinate2.d.ts +0 -8
  95. package/dist/cjs/proto/Askui/API/TDKv1/Coordinate2.js +0 -3
  96. package/dist/cjs/proto/Askui/API/TDKv1/Delta2.d.ts +0 -8
  97. package/dist/cjs/proto/Askui/API/TDKv1/Delta2.js +0 -3
  98. package/dist/cjs/proto/Askui/API/TDKv1/DisplayInformation.d.ts +0 -14
  99. package/dist/cjs/proto/Askui/API/TDKv1/DisplayInformation.js +0 -3
  100. package/dist/cjs/proto/Askui/API/TDKv1/GUID.d.ts +0 -9
  101. package/dist/cjs/proto/Askui/API/TDKv1/GUID.js +0 -3
  102. package/dist/cjs/proto/Askui/API/TDKv1/MouseButton.d.ts +0 -8
  103. package/dist/cjs/proto/Askui/API/TDKv1/MouseButton.js +0 -10
  104. package/dist/cjs/proto/Askui/API/TDKv1/MouseWheelDeltaType.d.ts +0 -7
  105. package/dist/cjs/proto/Askui/API/TDKv1/MouseWheelDeltaType.js +0 -9
  106. package/dist/cjs/proto/Askui/API/TDKv1/MouseWheelScrollDirection.d.ts +0 -7
  107. package/dist/cjs/proto/Askui/API/TDKv1/MouseWheelScrollDirection.js +0 -9
  108. package/dist/cjs/proto/Askui/API/TDKv1/PollEventID.d.ts +0 -6
  109. package/dist/cjs/proto/Askui/API/TDKv1/PollEventID.js +0 -8
  110. package/dist/cjs/proto/Askui/API/TDKv1/PollEventParameters.d.ts +0 -9
  111. package/dist/cjs/proto/Askui/API/TDKv1/PollEventParameters.js +0 -3
  112. package/dist/cjs/proto/Askui/API/TDKv1/PollEventParameters_ActionFinished.d.ts +0 -6
  113. package/dist/cjs/proto/Askui/API/TDKv1/PollEventParameters_ActionFinished.js +0 -3
  114. package/dist/cjs/proto/Askui/API/TDKv1/Rectangle.d.ts +0 -12
  115. package/dist/cjs/proto/Askui/API/TDKv1/Rectangle.js +0 -3
  116. package/dist/cjs/proto/Askui/API/TDKv1/Request_CaptureScreen.d.ts +0 -12
  117. package/dist/cjs/proto/Askui/API/TDKv1/Request_CaptureScreen.js +0 -3
  118. package/dist/cjs/proto/Askui/API/TDKv1/Request_EndSession.d.ts +0 -7
  119. package/dist/cjs/proto/Askui/API/TDKv1/Request_EndSession.js +0 -3
  120. package/dist/cjs/proto/Askui/API/TDKv1/Request_GetAction.d.ts +0 -9
  121. package/dist/cjs/proto/Askui/API/TDKv1/Request_GetAction.js +0 -3
  122. package/dist/cjs/proto/Askui/API/TDKv1/Request_GetActionCount.d.ts +0 -7
  123. package/dist/cjs/proto/Askui/API/TDKv1/Request_GetActionCount.js +0 -3
  124. package/dist/cjs/proto/Askui/API/TDKv1/Request_GetColor.d.ts +0 -11
  125. package/dist/cjs/proto/Askui/API/TDKv1/Request_GetColor.js +0 -3
  126. package/dist/cjs/proto/Askui/API/TDKv1/Request_GetPixelColor.d.ts +0 -8
  127. package/dist/cjs/proto/Askui/API/TDKv1/Request_GetPixelColor.js +0 -3
  128. package/dist/cjs/proto/Askui/API/TDKv1/Request_Poll.d.ts +0 -10
  129. package/dist/cjs/proto/Askui/API/TDKv1/Request_Poll.js +0 -3
  130. package/dist/cjs/proto/Askui/API/TDKv1/Request_RemoveAction.d.ts +0 -9
  131. package/dist/cjs/proto/Askui/API/TDKv1/Request_RemoveAction.js +0 -3
  132. package/dist/cjs/proto/Askui/API/TDKv1/Request_RemoveAllActions.d.ts +0 -7
  133. package/dist/cjs/proto/Askui/API/TDKv1/Request_RemoveAllActions.js +0 -3
  134. package/dist/cjs/proto/Askui/API/TDKv1/Request_RunRecordedAction.d.ts +0 -13
  135. package/dist/cjs/proto/Askui/API/TDKv1/Request_RunRecordedAction.js +0 -3
  136. package/dist/cjs/proto/Askui/API/TDKv1/Request_ScheduleBatchedAction.d.ts +0 -13
  137. package/dist/cjs/proto/Askui/API/TDKv1/Request_ScheduleBatchedAction.js +0 -3
  138. package/dist/cjs/proto/Askui/API/TDKv1/Request_SetDisplayLabel.d.ts +0 -11
  139. package/dist/cjs/proto/Askui/API/TDKv1/Request_SetDisplayLabel.js +0 -3
  140. package/dist/cjs/proto/Askui/API/TDKv1/Request_SetKeyboardDelay.d.ts +0 -9
  141. package/dist/cjs/proto/Askui/API/TDKv1/Request_SetKeyboardDelay.js +0 -3
  142. package/dist/cjs/proto/Askui/API/TDKv1/Request_SetMouseDelay.d.ts +0 -9
  143. package/dist/cjs/proto/Askui/API/TDKv1/Request_SetMouseDelay.js +0 -3
  144. package/dist/cjs/proto/Askui/API/TDKv1/Request_StartBatchRun.d.ts +0 -7
  145. package/dist/cjs/proto/Askui/API/TDKv1/Request_StartBatchRun.js +0 -3
  146. package/dist/cjs/proto/Askui/API/TDKv1/Request_StartSession.d.ts +0 -8
  147. package/dist/cjs/proto/Askui/API/TDKv1/Request_StartSession.js +0 -3
  148. package/dist/cjs/proto/Askui/API/TDKv1/Request_StopBatchRun.d.ts +0 -7
  149. package/dist/cjs/proto/Askui/API/TDKv1/Request_StopBatchRun.js +0 -3
  150. package/dist/cjs/proto/Askui/API/TDKv1/Request_Void.d.ts +0 -4
  151. package/dist/cjs/proto/Askui/API/TDKv1/Request_Void.js +0 -3
  152. package/dist/cjs/proto/Askui/API/TDKv1/Response_CaptureScreen.d.ts +0 -7
  153. package/dist/cjs/proto/Askui/API/TDKv1/Response_CaptureScreen.js +0 -3
  154. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetAction.d.ts +0 -12
  155. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetAction.js +0 -3
  156. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetActionCount.d.ts +0 -6
  157. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetActionCount.js +0 -3
  158. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetColor.d.ts +0 -7
  159. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetColor.js +0 -3
  160. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetContinuousCapturedScreen.d.ts +0 -7
  161. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetContinuousCapturedScreen.js +0 -3
  162. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetDisplayInformation.d.ts +0 -10
  163. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetDisplayInformation.js +0 -3
  164. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetMousePosition.d.ts +0 -8
  165. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetMousePosition.js +0 -3
  166. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetPixelColor.d.ts +0 -7
  167. package/dist/cjs/proto/Askui/API/TDKv1/Response_GetPixelColor.js +0 -3
  168. package/dist/cjs/proto/Askui/API/TDKv1/Response_Poll.d.ts +0 -10
  169. package/dist/cjs/proto/Askui/API/TDKv1/Response_Poll.js +0 -3
  170. package/dist/cjs/proto/Askui/API/TDKv1/Response_RunRecordedAction.d.ts +0 -6
  171. package/dist/cjs/proto/Askui/API/TDKv1/Response_RunRecordedAction.js +0 -3
  172. package/dist/cjs/proto/Askui/API/TDKv1/Response_ScheduleBatchedAction.d.ts +0 -6
  173. package/dist/cjs/proto/Askui/API/TDKv1/Response_ScheduleBatchedAction.js +0 -3
  174. package/dist/cjs/proto/Askui/API/TDKv1/Response_StartSession.d.ts +0 -7
  175. package/dist/cjs/proto/Askui/API/TDKv1/Response_StartSession.js +0 -3
  176. package/dist/cjs/proto/Askui/API/TDKv1/Response_Void.d.ts +0 -4
  177. package/dist/cjs/proto/Askui/API/TDKv1/Response_Void.js +0 -3
  178. package/dist/cjs/proto/Askui/API/TDKv1/Reuqest_SetTestConfiguration.d.ts +0 -14
  179. package/dist/cjs/proto/Askui/API/TDKv1/Reuqest_SetTestConfiguration.js +0 -3
  180. package/dist/cjs/proto/Askui/API/TDKv1/SessionInfo.d.ts +0 -10
  181. package/dist/cjs/proto/Askui/API/TDKv1/SessionInfo.js +0 -3
  182. package/dist/cjs/proto/Askui/API/TDKv1/Size2.d.ts +0 -8
  183. package/dist/cjs/proto/Askui/API/TDKv1/Size2.js +0 -3
  184. package/dist/cjs/proto/Askui/API/TDKv1/TypingSpeedValue.d.ts +0 -7
  185. package/dist/cjs/proto/Askui/API/TDKv1/TypingSpeedValue.js +0 -9
  186. package/dist/cjs/proto/Askui/API/TDKv1/VirtualScreen.d.ts +0 -10
  187. package/dist/cjs/proto/Askui/API/TDKv1/VirtualScreen.js +0 -3
  188. package/dist/cjs/proto/Askui/API/TDKv1/Void.d.ts +0 -4
  189. package/dist/cjs/proto/Askui/API/TDKv1/Void.js +0 -3
  190. package/dist/cjs/proto/tdk-v1.d.ts +0 -87
  191. package/dist/cjs/proto/tdk-v1.js +0 -2
  192. package/dist/esm/core/reporting/default-reporter.d.ts +0 -10
  193. package/dist/esm/core/reporting/default-reporter.js +0 -9
  194. package/dist/esm/core/ui-control-commands/action-class-tdk-v1.d.ts +0 -19
  195. package/dist/esm/core/ui-control-commands/action-class-tdk-v1.js +0 -20
  196. package/dist/esm/core/ui-control-commands/action-tdk-v1.d.ts +0 -10
  197. package/dist/esm/core/ui-control-commands/action-tdk-v1.js +0 -96
  198. package/dist/esm/execution/annotation-level.d.ts +0 -5
  199. package/dist/esm/execution/annotation-level.js +0 -6
  200. package/dist/esm/execution/ui-control-client-error.d.ts +0 -2
  201. package/dist/esm/execution/ui-control-client-error.js +0 -2
  202. package/dist/esm/execution/ui-controller-client-facade.d.ts +0 -15
  203. package/dist/esm/execution/ui-controller-client-facade.js +0 -1
  204. package/dist/esm/execution/ui-controller-client-grpc.d.ts +0 -24
  205. package/dist/esm/execution/ui-controller-client-grpc.js +0 -133
  206. package/dist/esm/execution/ui-controller-client-tdk-v1.d.ts +0 -26
  207. package/dist/esm/execution/ui-controller-client-tdk-v1.js +0 -195
  208. package/dist/esm/proto/Askui/API/TDKv1/ActionClassID.d.ts +0 -21
  209. package/dist/esm/proto/Askui/API/TDKv1/ActionClassID.js +0 -20
  210. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters.d.ts +0 -57
  211. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters.js +0 -2
  212. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_Press.d.ts +0 -8
  213. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_Press.js +0 -2
  214. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_PressAndRelease.d.ts +0 -8
  215. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_PressAndRelease.js +0 -2
  216. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_Release.d.ts +0 -8
  217. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKey_Release.js +0 -2
  218. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_Press.d.ts +0 -8
  219. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_Press.js +0 -2
  220. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_PressAndRelease.d.ts +0 -8
  221. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_PressAndRelease.js +0 -2
  222. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_Release.d.ts +0 -8
  223. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardKeys_Release.js +0 -2
  224. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardType_Text.d.ts +0 -13
  225. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardType_Text.js +0 -2
  226. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardType_UnicodeText.d.ts +0 -14
  227. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_KeyboardType_UnicodeText.js +0 -2
  228. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseButton_Press.d.ts +0 -7
  229. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseButton_Press.js +0 -2
  230. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseButton_PressAndRelease.d.ts +0 -9
  231. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseButton_PressAndRelease.js +0 -2
  232. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseButton_Release.d.ts +0 -7
  233. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseButton_Release.js +0 -2
  234. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseMove.d.ts +0 -11
  235. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseMove.js +0 -2
  236. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseMove_Delta.d.ts +0 -11
  237. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseMove_Delta.js +0 -2
  238. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseWheelScroll.d.ts +0 -14
  239. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_MouseWheelScroll.js +0 -2
  240. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_RunCommand.d.ts +0 -6
  241. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_RunCommand.js +0 -2
  242. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_Wait.d.ts +0 -6
  243. package/dist/esm/proto/Askui/API/TDKv1/ActionParameters_Wait.js +0 -2
  244. package/dist/esm/proto/Askui/API/TDKv1/Bitmap.d.ts +0 -17
  245. package/dist/esm/proto/Askui/API/TDKv1/Bitmap.js +0 -2
  246. package/dist/esm/proto/Askui/API/TDKv1/CaptureArea.d.ts +0 -13
  247. package/dist/esm/proto/Askui/API/TDKv1/CaptureArea.js +0 -2
  248. package/dist/esm/proto/Askui/API/TDKv1/Color.d.ts +0 -10
  249. package/dist/esm/proto/Askui/API/TDKv1/Color.js +0 -2
  250. package/dist/esm/proto/Askui/API/TDKv1/ControllerAPI.d.ts +0 -239
  251. package/dist/esm/proto/Askui/API/TDKv1/ControllerAPI.js +0 -2
  252. package/dist/esm/proto/Askui/API/TDKv1/Coordinate2.d.ts +0 -8
  253. package/dist/esm/proto/Askui/API/TDKv1/Coordinate2.js +0 -2
  254. package/dist/esm/proto/Askui/API/TDKv1/Delta2.d.ts +0 -8
  255. package/dist/esm/proto/Askui/API/TDKv1/Delta2.js +0 -2
  256. package/dist/esm/proto/Askui/API/TDKv1/DisplayInformation.d.ts +0 -14
  257. package/dist/esm/proto/Askui/API/TDKv1/DisplayInformation.js +0 -2
  258. package/dist/esm/proto/Askui/API/TDKv1/GUID.d.ts +0 -9
  259. package/dist/esm/proto/Askui/API/TDKv1/GUID.js +0 -2
  260. package/dist/esm/proto/Askui/API/TDKv1/MouseButton.d.ts +0 -8
  261. package/dist/esm/proto/Askui/API/TDKv1/MouseButton.js +0 -7
  262. package/dist/esm/proto/Askui/API/TDKv1/MouseWheelDeltaType.d.ts +0 -7
  263. package/dist/esm/proto/Askui/API/TDKv1/MouseWheelDeltaType.js +0 -6
  264. package/dist/esm/proto/Askui/API/TDKv1/MouseWheelScrollDirection.d.ts +0 -7
  265. package/dist/esm/proto/Askui/API/TDKv1/MouseWheelScrollDirection.js +0 -6
  266. package/dist/esm/proto/Askui/API/TDKv1/PollEventID.d.ts +0 -6
  267. package/dist/esm/proto/Askui/API/TDKv1/PollEventID.js +0 -5
  268. package/dist/esm/proto/Askui/API/TDKv1/PollEventParameters.d.ts +0 -9
  269. package/dist/esm/proto/Askui/API/TDKv1/PollEventParameters.js +0 -2
  270. package/dist/esm/proto/Askui/API/TDKv1/PollEventParameters_ActionFinished.d.ts +0 -6
  271. package/dist/esm/proto/Askui/API/TDKv1/PollEventParameters_ActionFinished.js +0 -2
  272. package/dist/esm/proto/Askui/API/TDKv1/Rectangle.d.ts +0 -12
  273. package/dist/esm/proto/Askui/API/TDKv1/Rectangle.js +0 -2
  274. package/dist/esm/proto/Askui/API/TDKv1/Request_CaptureScreen.d.ts +0 -12
  275. package/dist/esm/proto/Askui/API/TDKv1/Request_CaptureScreen.js +0 -2
  276. package/dist/esm/proto/Askui/API/TDKv1/Request_EndSession.d.ts +0 -7
  277. package/dist/esm/proto/Askui/API/TDKv1/Request_EndSession.js +0 -2
  278. package/dist/esm/proto/Askui/API/TDKv1/Request_GetAction.d.ts +0 -9
  279. package/dist/esm/proto/Askui/API/TDKv1/Request_GetAction.js +0 -2
  280. package/dist/esm/proto/Askui/API/TDKv1/Request_GetActionCount.d.ts +0 -7
  281. package/dist/esm/proto/Askui/API/TDKv1/Request_GetActionCount.js +0 -2
  282. package/dist/esm/proto/Askui/API/TDKv1/Request_GetColor.d.ts +0 -11
  283. package/dist/esm/proto/Askui/API/TDKv1/Request_GetColor.js +0 -2
  284. package/dist/esm/proto/Askui/API/TDKv1/Request_GetPixelColor.d.ts +0 -8
  285. package/dist/esm/proto/Askui/API/TDKv1/Request_GetPixelColor.js +0 -2
  286. package/dist/esm/proto/Askui/API/TDKv1/Request_Poll.d.ts +0 -10
  287. package/dist/esm/proto/Askui/API/TDKv1/Request_Poll.js +0 -2
  288. package/dist/esm/proto/Askui/API/TDKv1/Request_RemoveAction.d.ts +0 -9
  289. package/dist/esm/proto/Askui/API/TDKv1/Request_RemoveAction.js +0 -2
  290. package/dist/esm/proto/Askui/API/TDKv1/Request_RemoveAllActions.d.ts +0 -7
  291. package/dist/esm/proto/Askui/API/TDKv1/Request_RemoveAllActions.js +0 -2
  292. package/dist/esm/proto/Askui/API/TDKv1/Request_RunRecordedAction.d.ts +0 -13
  293. package/dist/esm/proto/Askui/API/TDKv1/Request_RunRecordedAction.js +0 -2
  294. package/dist/esm/proto/Askui/API/TDKv1/Request_ScheduleBatchedAction.d.ts +0 -13
  295. package/dist/esm/proto/Askui/API/TDKv1/Request_ScheduleBatchedAction.js +0 -2
  296. package/dist/esm/proto/Askui/API/TDKv1/Request_SetDisplayLabel.d.ts +0 -11
  297. package/dist/esm/proto/Askui/API/TDKv1/Request_SetDisplayLabel.js +0 -2
  298. package/dist/esm/proto/Askui/API/TDKv1/Request_SetKeyboardDelay.d.ts +0 -9
  299. package/dist/esm/proto/Askui/API/TDKv1/Request_SetKeyboardDelay.js +0 -2
  300. package/dist/esm/proto/Askui/API/TDKv1/Request_SetMouseDelay.d.ts +0 -9
  301. package/dist/esm/proto/Askui/API/TDKv1/Request_SetMouseDelay.js +0 -2
  302. package/dist/esm/proto/Askui/API/TDKv1/Request_StartBatchRun.d.ts +0 -7
  303. package/dist/esm/proto/Askui/API/TDKv1/Request_StartBatchRun.js +0 -2
  304. package/dist/esm/proto/Askui/API/TDKv1/Request_StartSession.d.ts +0 -8
  305. package/dist/esm/proto/Askui/API/TDKv1/Request_StartSession.js +0 -2
  306. package/dist/esm/proto/Askui/API/TDKv1/Request_StopBatchRun.d.ts +0 -7
  307. package/dist/esm/proto/Askui/API/TDKv1/Request_StopBatchRun.js +0 -2
  308. package/dist/esm/proto/Askui/API/TDKv1/Request_Void.d.ts +0 -4
  309. package/dist/esm/proto/Askui/API/TDKv1/Request_Void.js +0 -2
  310. package/dist/esm/proto/Askui/API/TDKv1/Response_CaptureScreen.d.ts +0 -7
  311. package/dist/esm/proto/Askui/API/TDKv1/Response_CaptureScreen.js +0 -2
  312. package/dist/esm/proto/Askui/API/TDKv1/Response_GetAction.d.ts +0 -12
  313. package/dist/esm/proto/Askui/API/TDKv1/Response_GetAction.js +0 -2
  314. package/dist/esm/proto/Askui/API/TDKv1/Response_GetActionCount.d.ts +0 -6
  315. package/dist/esm/proto/Askui/API/TDKv1/Response_GetActionCount.js +0 -2
  316. package/dist/esm/proto/Askui/API/TDKv1/Response_GetColor.d.ts +0 -7
  317. package/dist/esm/proto/Askui/API/TDKv1/Response_GetColor.js +0 -2
  318. package/dist/esm/proto/Askui/API/TDKv1/Response_GetContinuousCapturedScreen.d.ts +0 -7
  319. package/dist/esm/proto/Askui/API/TDKv1/Response_GetContinuousCapturedScreen.js +0 -2
  320. package/dist/esm/proto/Askui/API/TDKv1/Response_GetDisplayInformation.d.ts +0 -10
  321. package/dist/esm/proto/Askui/API/TDKv1/Response_GetDisplayInformation.js +0 -2
  322. package/dist/esm/proto/Askui/API/TDKv1/Response_GetMousePosition.d.ts +0 -8
  323. package/dist/esm/proto/Askui/API/TDKv1/Response_GetMousePosition.js +0 -2
  324. package/dist/esm/proto/Askui/API/TDKv1/Response_GetPixelColor.d.ts +0 -7
  325. package/dist/esm/proto/Askui/API/TDKv1/Response_GetPixelColor.js +0 -2
  326. package/dist/esm/proto/Askui/API/TDKv1/Response_Poll.d.ts +0 -10
  327. package/dist/esm/proto/Askui/API/TDKv1/Response_Poll.js +0 -2
  328. package/dist/esm/proto/Askui/API/TDKv1/Response_RunRecordedAction.d.ts +0 -6
  329. package/dist/esm/proto/Askui/API/TDKv1/Response_RunRecordedAction.js +0 -2
  330. package/dist/esm/proto/Askui/API/TDKv1/Response_ScheduleBatchedAction.d.ts +0 -6
  331. package/dist/esm/proto/Askui/API/TDKv1/Response_ScheduleBatchedAction.js +0 -2
  332. package/dist/esm/proto/Askui/API/TDKv1/Response_StartSession.d.ts +0 -7
  333. package/dist/esm/proto/Askui/API/TDKv1/Response_StartSession.js +0 -2
  334. package/dist/esm/proto/Askui/API/TDKv1/Response_Void.d.ts +0 -4
  335. package/dist/esm/proto/Askui/API/TDKv1/Response_Void.js +0 -2
  336. package/dist/esm/proto/Askui/API/TDKv1/Reuqest_SetTestConfiguration.d.ts +0 -14
  337. package/dist/esm/proto/Askui/API/TDKv1/Reuqest_SetTestConfiguration.js +0 -2
  338. package/dist/esm/proto/Askui/API/TDKv1/SessionInfo.d.ts +0 -10
  339. package/dist/esm/proto/Askui/API/TDKv1/SessionInfo.js +0 -2
  340. package/dist/esm/proto/Askui/API/TDKv1/Size2.d.ts +0 -8
  341. package/dist/esm/proto/Askui/API/TDKv1/Size2.js +0 -2
  342. package/dist/esm/proto/Askui/API/TDKv1/TypingSpeedValue.d.ts +0 -7
  343. package/dist/esm/proto/Askui/API/TDKv1/TypingSpeedValue.js +0 -6
  344. package/dist/esm/proto/Askui/API/TDKv1/VirtualScreen.d.ts +0 -10
  345. package/dist/esm/proto/Askui/API/TDKv1/VirtualScreen.js +0 -2
  346. package/dist/esm/proto/Askui/API/TDKv1/Void.d.ts +0 -4
  347. package/dist/esm/proto/Askui/API/TDKv1/Void.js +0 -2
  348. package/dist/esm/proto/tdk-v1.d.ts +0 -87
  349. package/dist/esm/proto/tdk-v1.js +0 -1
@@ -9,68 +9,83 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { DefaultStep } from './default-step';
11
11
  import { logger } from '../../lib/logger';
12
+ import { maxSnapshotDetailLevel } from './snapshot-detail-level';
13
+ function buildReportersWithPromiseQueue(reporter) {
14
+ if (reporter === undefined) {
15
+ return [];
16
+ }
17
+ if (Array.isArray(reporter)) {
18
+ return reporter.map((r) => ({
19
+ reporter: r,
20
+ promiseQueue: Promise.resolve(),
21
+ }));
22
+ }
23
+ return [
24
+ {
25
+ reporter,
26
+ promiseQueue: Promise.resolve(),
27
+ },
28
+ ];
29
+ }
12
30
  export class StepReporter {
13
31
  constructor(reporter) {
14
- this.reporter = reporter;
32
+ this.reporters = buildReportersWithPromiseQueue(reporter);
33
+ this.config = {
34
+ withScreenshots: maxSnapshotDetailLevel(...this.reporters.map((r) => { var _a, _b; return (_b = (_a = r.reporter.config) === null || _a === void 0 ? void 0 : _a.withScreenshots) !== null && _b !== void 0 ? _b : 'onFailure'; })),
35
+ withDetectedElements: maxSnapshotDetailLevel(...this.reporters.map((r) => { var _a, _b; return (_b = (_a = r.reporter.config) === null || _a === void 0 ? void 0 : _a.withDetectedElements) !== null && _b !== void 0 ? _b : 'onFailure'; })),
36
+ };
15
37
  }
16
- get config() {
17
- return this.reporter.config;
38
+ flush() {
39
+ return Promise.all(this.reporters.map((reporter) => reporter.promiseQueue)).then(() => { });
40
+ }
41
+ get currentStep() {
42
+ return this._currentStep;
18
43
  }
19
44
  resetStep(instruction) {
20
- this.currentStep = new DefaultStep(instruction);
45
+ this._currentStep = new DefaultStep(instruction);
46
+ }
47
+ enqueueReporterCalls(type, step) {
48
+ this.reporters = this.reporters.map((reporter) => (Object.assign(Object.assign({}, reporter), { promiseQueue: reporter.promiseQueue
49
+ .then(() => { var _a, _b, _c; return (_c = (_b = (_a = reporter.reporter)[type]) === null || _b === void 0 ? void 0 : _b.call(_a, step)) !== null && _c !== void 0 ? _c : Promise.resolve(); })
50
+ .catch((error) => {
51
+ logger.error(error);
52
+ return Promise.resolve();
53
+ }) })));
21
54
  }
22
55
  onStepBegin(snapshot) {
23
- var _a, _b;
24
56
  return __awaiter(this, void 0, void 0, function* () {
25
- if (this.currentStep === undefined) {
57
+ if (this._currentStep === undefined) {
26
58
  throw new Error('Cannot begin step if step is undefined.');
27
59
  }
28
- if (this.currentStep.status !== 'pending') {
60
+ if (this._currentStep.status !== 'pending') {
29
61
  throw new Error('Cannot begin step that is not pending.');
30
62
  }
31
- this.currentStep.onBegin(snapshot);
32
- try {
33
- yield ((_b = (_a = this.reporter).onStepBegin) === null || _b === void 0 ? void 0 : _b.call(_a, this.currentStep));
34
- }
35
- catch (reporterError) {
36
- logger.error(reporterError);
37
- }
63
+ this._currentStep = this._currentStep.onBegin(snapshot);
64
+ this.enqueueReporterCalls('onStepBegin', this._currentStep);
38
65
  });
39
66
  }
40
67
  onStepRetry(snapshot, error) {
41
- var _a, _b;
42
68
  return __awaiter(this, void 0, void 0, function* () {
43
- if (this.currentStep === undefined) {
69
+ if (this._currentStep === undefined) {
44
70
  throw new Error('Cannot retry step if step is undefined.');
45
71
  }
46
- if (this.currentStep.status !== 'running') {
72
+ if (this._currentStep.status !== 'running') {
47
73
  throw new Error('Cannot retry step that has not been running.');
48
74
  }
49
- this.currentStep.onRetry(snapshot, error);
50
- try {
51
- yield ((_b = (_a = this.reporter).onStepRetry) === null || _b === void 0 ? void 0 : _b.call(_a, this.currentStep));
52
- }
53
- catch (reporterError) {
54
- logger.error(reporterError);
55
- }
75
+ this._currentStep = this._currentStep.onRetry(snapshot, error);
76
+ this.enqueueReporterCalls('onStepRetry', this._currentStep);
56
77
  });
57
78
  }
58
79
  onStepEnd(snapshot, error) {
59
- var _a, _b;
60
80
  return __awaiter(this, void 0, void 0, function* () {
61
- if (this.currentStep === undefined) {
81
+ if (this._currentStep === undefined) {
62
82
  throw new Error('Cannot end step if step is undefined.');
63
83
  }
64
- if (this.currentStep.status !== 'running') {
84
+ if (this._currentStep.status !== 'running') {
65
85
  throw new Error('Cannot end step that has not been running.');
66
86
  }
67
- this.currentStep.onEnd(snapshot, error);
68
- try {
69
- yield ((_b = (_a = this.reporter).onStepEnd) === null || _b === void 0 ? void 0 : _b.call(_a, this.currentStep));
70
- }
71
- catch (reporterError) {
72
- logger.error(reporterError);
73
- }
87
+ this._currentStep = this._currentStep.onEnd(snapshot, error);
88
+ this.enqueueReporterCalls('onStepEnd', this._currentStep);
74
89
  });
75
90
  }
76
91
  }
@@ -9,6 +9,5 @@ export declare class UiControlClientDependencyBuilder {
9
9
  executionRuntime: ExecutionRuntime;
10
10
  stepReporter: StepReporter;
11
11
  }>;
12
- private static buildReporter;
13
12
  static getClientArgsWithDefaults(clientArgs: ClientArgs): Promise<ClientArgsWithDefaults>;
14
13
  }
@@ -14,7 +14,7 @@ import { envCredentials } from './read-environment-credentials';
14
14
  import { Analytics } from '../utils/analytics';
15
15
  import { envProxyAgents } from '../utils/proxy/proxy-builder';
16
16
  import { ExecutionRuntime } from './execution-runtime';
17
- import { DEFAULT_REPORTER, StepReporter, } from '../core/reporting';
17
+ import { StepReporter } from '../core/reporting';
18
18
  export class UiControlClientDependencyBuilder {
19
19
  static buildHttpClient(clientArgs) {
20
20
  var _a;
@@ -46,22 +46,10 @@ export class UiControlClientDependencyBuilder {
46
46
  };
47
47
  });
48
48
  }
49
- static buildReporter(reporterArg) {
50
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
51
- return {
52
- config: {
53
- withScreenshots: (_b = (_a = reporterArg === null || reporterArg === void 0 ? void 0 : reporterArg.config) === null || _a === void 0 ? void 0 : _a.withScreenshots) !== null && _b !== void 0 ? _b : DEFAULT_REPORTER.config.withScreenshots,
54
- withDetectedElements: (_d = (_c = reporterArg === null || reporterArg === void 0 ? void 0 : reporterArg.config) === null || _c === void 0 ? void 0 : _c.withDetectedElements) !== null && _d !== void 0 ? _d : DEFAULT_REPORTER.config.withDetectedElements,
55
- },
56
- onStepBegin: (_f = (_e = reporterArg === null || reporterArg === void 0 ? void 0 : reporterArg.onStepBegin) === null || _e === void 0 ? void 0 : _e.bind(reporterArg)) !== null && _f !== void 0 ? _f : DEFAULT_REPORTER.onStepBegin.bind(DEFAULT_REPORTER),
57
- onStepRetry: (_h = (_g = reporterArg === null || reporterArg === void 0 ? void 0 : reporterArg.onStepRetry) === null || _g === void 0 ? void 0 : _g.bind(reporterArg)) !== null && _h !== void 0 ? _h : DEFAULT_REPORTER.onStepRetry.bind(DEFAULT_REPORTER),
58
- onStepEnd: (_k = (_j = reporterArg === null || reporterArg === void 0 ? void 0 : reporterArg.onStepEnd) === null || _j === void 0 ? void 0 : _j.bind(reporterArg)) !== null && _k !== void 0 ? _k : DEFAULT_REPORTER.onStepEnd.bind(DEFAULT_REPORTER),
59
- };
60
- }
61
49
  static getClientArgsWithDefaults(clientArgs) {
62
50
  var _a, _b, _c, _d;
63
51
  return __awaiter(this, void 0, void 0, function* () {
64
- return Object.assign(Object.assign({}, clientArgs), { uiControllerUrl: (_a = clientArgs.uiControllerUrl) !== null && _a !== void 0 ? _a : 'http://127.0.0.1:6769', inferenceServerUrl: (_b = clientArgs.inferenceServerUrl) !== null && _b !== void 0 ? _b : 'https://inference.askui.com', credentials: (_c = clientArgs.credentials) !== null && _c !== void 0 ? _c : envCredentials(), proxyAgents: (_d = clientArgs.proxyAgents) !== null && _d !== void 0 ? _d : yield envProxyAgents(), reporter: UiControlClientDependencyBuilder.buildReporter(clientArgs.reporter) });
52
+ return Object.assign(Object.assign({}, clientArgs), { uiControllerUrl: (_a = clientArgs.uiControllerUrl) !== null && _a !== void 0 ? _a : 'http://127.0.0.1:6769', inferenceServerUrl: (_b = clientArgs.inferenceServerUrl) !== null && _b !== void 0 ? _b : 'https://inference.askui.com', credentials: (_c = clientArgs.credentials) !== null && _c !== void 0 ? _c : envCredentials(), proxyAgents: (_d = clientArgs.proxyAgents) !== null && _d !== void 0 ? _d : yield envProxyAgents() });
65
53
  });
66
54
  }
67
55
  }
@@ -1,7 +1,7 @@
1
1
  import { CredentialArgs } from './credentials-args';
2
2
  import { ProxyAgentArgs } from '../shared/proxy-agent-args';
3
3
  import { ModelCompositionBranch } from './model-composition-branch';
4
- import { Reporter, ReporterConfig } from '../core/reporting';
4
+ import { Reporter } from '../core/reporting';
5
5
  /**
6
6
  * Configuration options for the askui UI Control Client
7
7
  *
@@ -21,7 +21,8 @@ import { Reporter, ReporterConfig } from '../core/reporting';
21
21
  * the authentication of the askui Inference Server.
22
22
  * You have three options: `DISABLED`, `ON_FAILURE`, `ALL`.
23
23
  * @param {ProxyAgentArgs} proxyAgents - To configure the proxy agents for http(s) requests.
24
- * @param {Reporter} reporter - To configure the reporter to report on step runs.
24
+ * @param {Reporter | Reporter[]} reporter - To configure the reporter(s)
25
+ * to report on step runs/executions.
25
26
  */
26
27
  export interface ClientArgs {
27
28
  readonly uiControllerUrl?: string;
@@ -30,12 +31,9 @@ export interface ClientArgs {
30
31
  readonly proxyAgents?: ProxyAgentArgs | undefined;
31
32
  readonly resize?: number;
32
33
  readonly modelComposition?: ModelCompositionBranch[];
33
- readonly reporter?: Reporter | undefined;
34
+ readonly reporter?: Reporter | Reporter[] | undefined;
34
35
  }
35
36
  export interface ClientArgsWithDefaults extends ClientArgs {
36
37
  readonly uiControllerUrl: string;
37
38
  readonly inferenceServerUrl: string;
38
- readonly reporter: Required<Reporter> & {
39
- config: Required<ReporterConfig>;
40
- };
41
39
  }
@@ -1,18 +1,15 @@
1
- /// <reference types="node" />
1
+ import type sharp from 'sharp';
2
2
  export declare class Base64Image {
3
- private readonly aSharp;
4
- private info;
5
3
  private buffer;
6
4
  static readonly strPrefix = "data:image/png;base64,";
5
+ private _sharp?;
7
6
  private constructor();
8
- private static fromSharp;
9
7
  static fromPathOrString(pathOrStr: string): Promise<Base64Image>;
10
- static fromPath(path: string): Promise<Base64Image>;
8
+ static fromPath(filePath: string): Promise<Base64Image>;
11
9
  static fromString(str: string): Promise<Base64Image>;
12
- static fromBuffer(buffer: Buffer): Promise<Base64Image>;
13
- get width(): number;
14
- get height(): number;
10
+ private static fromBuffer;
11
+ private getSharp;
12
+ getInfo(): Promise<sharp.OutputInfo>;
15
13
  resizeToFitInto(dimension: number): Promise<Base64Image>;
16
14
  toString(): string;
17
- toBuffer(): Buffer;
18
15
  }
@@ -7,36 +7,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import sharp from 'sharp';
10
+ import fs from 'fs';
11
+ import { getSharpFactory } from './sharp';
11
12
  import { Base64ImageStringError } from './base-64-image-string-error';
12
13
  export class Base64Image {
13
- constructor(aSharp, info, buffer) {
14
- this.aSharp = aSharp;
15
- this.info = info;
14
+ constructor(buffer) {
16
15
  this.buffer = buffer;
17
16
  }
18
- static fromSharp(s) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- const { info, data } = yield s.toBuffer({ resolveWithObject: true });
21
- return new Base64Image(s, info, data);
22
- });
23
- }
24
17
  static fromPathOrString(pathOrStr) {
25
18
  return __awaiter(this, void 0, void 0, function* () {
26
- try {
27
- return yield Base64Image.fromString(pathOrStr);
28
- }
29
- catch (error) {
30
- if (!(error instanceof Base64ImageStringError)) {
31
- throw error;
32
- }
19
+ if (pathOrStr.startsWith(Base64Image.strPrefix)) {
20
+ return Base64Image.fromString(pathOrStr);
33
21
  }
34
22
  return Base64Image.fromPath(pathOrStr);
35
23
  });
36
24
  }
37
- static fromPath(path) {
25
+ static fromPath(filePath) {
38
26
  return __awaiter(this, void 0, void 0, function* () {
39
- return Base64Image.fromSharp(sharp(path));
27
+ const data = yield fs.promises.readFile(filePath, 'base64');
28
+ return Base64Image.fromString(`${Base64Image.strPrefix}${data}`);
40
29
  });
41
30
  }
42
31
  static fromString(str) {
@@ -45,35 +34,45 @@ export class Base64Image {
45
34
  throw new Base64ImageStringError(str, Base64Image.strPrefix);
46
35
  }
47
36
  const data = str.substring(Base64Image.strPrefix.length);
48
- return Base64Image.fromSharp(sharp(Buffer.from(data, 'base64')));
37
+ return new Base64Image(Buffer.from(data, 'base64'));
49
38
  });
50
39
  }
51
40
  static fromBuffer(buffer) {
52
41
  return __awaiter(this, void 0, void 0, function* () {
53
- return Base64Image.fromSharp(sharp(buffer));
42
+ return new Base64Image(buffer);
54
43
  });
55
44
  }
56
- get width() {
57
- return this.info.width;
45
+ getSharp() {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ if (this._sharp === undefined) {
48
+ const createSharp = yield getSharpFactory();
49
+ this._sharp = createSharp(this.buffer);
50
+ }
51
+ return this._sharp;
52
+ });
58
53
  }
59
- get height() {
60
- return this.info.height;
54
+ getInfo() {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ return (yield this.getSharp())
57
+ .toBuffer({ resolveWithObject: true })
58
+ .then(({ info }) => info);
59
+ });
61
60
  }
62
61
  resizeToFitInto(dimension) {
63
62
  return __awaiter(this, void 0, void 0, function* () {
64
- const buffer = yield this.aSharp.resize({
65
- width: this.width >= this.height ? dimension : undefined,
66
- height: this.height > this.width ? dimension : undefined,
67
- fit: sharp.fit.contain,
68
- }).toBuffer();
63
+ const { width, height } = yield this.getInfo();
64
+ const buffer = yield (yield this.getSharp())
65
+ .resize({
66
+ width: width >= height ? dimension : undefined,
67
+ height: height > width ? dimension : undefined,
68
+ fit: 'contain',
69
+ })
70
+ .toBuffer();
69
71
  return Base64Image.fromBuffer(buffer);
70
72
  });
71
73
  }
72
74
  toString() {
73
75
  return `${Base64Image.strPrefix}${this.buffer.toString('base64')}`;
74
76
  }
75
- toBuffer() {
76
- return this.buffer;
77
- }
78
77
  }
79
78
  Base64Image.strPrefix = 'data:image/png;base64,';
@@ -0,0 +1,2 @@
1
+ import type sharp from 'sharp';
2
+ export declare function getSharpFactory(): Promise<typeof sharp>;
@@ -0,0 +1,33 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ let lazilyInitializedSharpFactory;
11
+ class SharpImportError extends Error {
12
+ }
13
+ function dynamicallyImportSharp() {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ try {
16
+ const sharp = yield import('sharp');
17
+ return sharp.default;
18
+ }
19
+ catch (err) {
20
+ throw new SharpImportError('Can\'t find "sharp" module to do resizing of image!'
21
+ + ' Please, install sharp for resizing support with'
22
+ + ' "npm install --save-dev sharp" or "npm install --save sharp".');
23
+ }
24
+ });
25
+ }
26
+ export function getSharpFactory() {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ if (lazilyInitializedSharpFactory === undefined) {
29
+ lazilyInitializedSharpFactory = yield dynamicallyImportSharp();
30
+ }
31
+ return lazilyInitializedSharpFactory;
32
+ });
33
+ }
@@ -17,7 +17,9 @@ function dynmicImportHpagent() {
17
17
  return yield import('hpagent');
18
18
  }
19
19
  catch (err) {
20
- throw new ProxyImportError('Can\'t find "hpagent" module to configure proxy! Please, install hpagent for proxy support with "npm install --save-dev hpagent".');
20
+ throw new ProxyImportError('Can\'t find "hpagent" module to configure proxy!'
21
+ + ' Please, install hpagent for proxy support with'
22
+ + ' "npm install --save-dev hpagent" or "npm install --save hpagent".');
21
23
  }
22
24
  });
23
25
  }
@@ -25,13 +25,15 @@ export function resizeBase64ImageWithSameRatio(base64ImageString, maxEdge = 1400
25
25
  logger.debug('Image resizing');
26
26
  try {
27
27
  const image = yield Base64Image.fromString(base64ImageString);
28
- if (image.height <= maxEdge && image.width <= maxEdge) {
28
+ const imageInfo = yield image.getInfo();
29
+ if (imageInfo.height <= maxEdge && imageInfo.width <= maxEdge) {
29
30
  return { base64Image: base64ImageString, resizeRatio: 1 };
30
31
  }
31
32
  const resizedImage = yield image.resizeToFitInto(maxEdge);
33
+ const resizedImageInfo = yield resizedImage.getInfo();
32
34
  return {
33
35
  base64Image: resizedImage.toString(),
34
- resizeRatio: image.width / resizedImage.width,
36
+ resizeRatio: imageInfo.width / resizedImageInfo.width,
35
37
  };
36
38
  }
37
39
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askui",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "license": "MIT",
5
5
  "author": "askui GmbH <info@askui.com> (http://www.askui.com/)",
6
6
  "description": "Reliable, automated end-to-end-testing that depends on what is shown on your screen instead of the technology you are running on",
@@ -54,10 +54,10 @@
54
54
  "fs-extra": "10.0.0",
55
55
  "got": "11.8.6",
56
56
  "jsdom": "20.0.0",
57
+ "lodash": "^4.17.21",
57
58
  "node-machine-id": "1.1.12",
58
59
  "pino": "7.8.1",
59
60
  "pino-pretty": "7.5.3",
60
- "sharp": "0.30.6",
61
61
  "tough-cookie": "4.1.2",
62
62
  "url-join": "4.0.1",
63
63
  "wait-port": "0.2.9",
@@ -75,14 +75,17 @@
75
75
  "@types/ws": "7.4.4",
76
76
  "hpagent": "^1.2.0",
77
77
  "jest": "28.1.1",
78
+ "jest-extended": "^4.0.1",
78
79
  "proxy": "^1.0.2",
79
80
  "proxy-agent": "^5.0.0",
80
- "sharp": "0.30.6",
81
81
  "shx": "0.3.4",
82
82
  "ts-jest": "28.0.4",
83
83
  "typescript": "4.5.4"
84
84
  },
85
85
  "lint-staged": {
86
86
  "./**/*.{js,ts}": "eslint --cache --fix --max-warnings 0"
87
+ },
88
+ "optionalDependencies": {
89
+ "sharp": "^0.32.6"
87
90
  }
88
91
  }
@@ -1,10 +0,0 @@
1
- import { Step } from './step';
2
- export declare const DEFAULT_REPORTER: {
3
- config: {
4
- readonly withScreenshots: "onFailure";
5
- readonly withDetectedElements: "onFailure";
6
- };
7
- onStepBegin: (_step: Step) => Promise<void>;
8
- onStepRetry: (_step: Step) => Promise<void>;
9
- onStepEnd: (_step: Step) => Promise<void>;
10
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_REPORTER = void 0;
4
- exports.DEFAULT_REPORTER = {
5
- config: {
6
- withScreenshots: 'onFailure',
7
- withDetectedElements: 'onFailure',
8
- },
9
- onStepBegin: (_step) => Promise.resolve(),
10
- onStepRetry: (_step) => Promise.resolve(),
11
- onStepEnd: (_step) => Promise.resolve(),
12
- };
@@ -1,19 +0,0 @@
1
- export declare enum ActionClassIdTdkV1 {
2
- ActionClassID_Undefined = "ActionClassID_Undefined",
3
- ActionClassID_Wait = "ActionClassID_Wait",
4
- ActionClassID_MouseButton_Press = "ActionClassID_MouseButton_Press",
5
- ActionClassID_MouseButton_Release = "ActionClassID_MouseButton_Release",
6
- ActionClassID_MouseButton_PressAndRelease = "ActionClassID_MouseButton_PressAndRelease",
7
- ActionClassID_MouseWheelScroll = "ActionClassID_MouseWheelScroll",
8
- ActionClassID_MouseMove = "ActionClassID_MouseMove",
9
- ActionClassID_MouseMove_Delta = "ActionClassID_MouseMove_Delta",
10
- ActionClassID_KeyboardKey_Press = "ActionClassID_KeyboardKey_Press",
11
- ActionClassID_KeyboardKey_Release = "ActionClassID_KeyboardKey_Release",
12
- ActionClassID_KeyboardKey_PressAndRelease = "ActionClassID_KeyboardKey_PressAndRelease",
13
- ActionClassID_KeyboardKeys_Press = "ActionClassID_KeyboardKeys_Press",
14
- ActionClassID_KeyboardKeys_Release = "ActionClassID_KeyboardKeys_Release",
15
- ActionClassID_KeyboardKeys_PressAndRelease = "ActionClassID_KeyboardKeys_PressAndRelease",
16
- ActionClassID_KeyboardType_Text = "ActionClassID_KeyboardType_Text",
17
- ActionClassID_KeyboardType_UnicodeText = "ActionClassID_KeyboardType_UnicodeText",
18
- ActionClassID_RunCommand = "ActionClassID_RunCommand"
19
- }
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionClassIdTdkV1 = void 0;
4
- var ActionClassIdTdkV1;
5
- (function (ActionClassIdTdkV1) {
6
- ActionClassIdTdkV1["ActionClassID_Undefined"] = "ActionClassID_Undefined";
7
- ActionClassIdTdkV1["ActionClassID_Wait"] = "ActionClassID_Wait";
8
- ActionClassIdTdkV1["ActionClassID_MouseButton_Press"] = "ActionClassID_MouseButton_Press";
9
- ActionClassIdTdkV1["ActionClassID_MouseButton_Release"] = "ActionClassID_MouseButton_Release";
10
- ActionClassIdTdkV1["ActionClassID_MouseButton_PressAndRelease"] = "ActionClassID_MouseButton_PressAndRelease";
11
- ActionClassIdTdkV1["ActionClassID_MouseWheelScroll"] = "ActionClassID_MouseWheelScroll";
12
- ActionClassIdTdkV1["ActionClassID_MouseMove"] = "ActionClassID_MouseMove";
13
- ActionClassIdTdkV1["ActionClassID_MouseMove_Delta"] = "ActionClassID_MouseMove_Delta";
14
- ActionClassIdTdkV1["ActionClassID_KeyboardKey_Press"] = "ActionClassID_KeyboardKey_Press";
15
- ActionClassIdTdkV1["ActionClassID_KeyboardKey_Release"] = "ActionClassID_KeyboardKey_Release";
16
- ActionClassIdTdkV1["ActionClassID_KeyboardKey_PressAndRelease"] = "ActionClassID_KeyboardKey_PressAndRelease";
17
- ActionClassIdTdkV1["ActionClassID_KeyboardKeys_Press"] = "ActionClassID_KeyboardKeys_Press";
18
- ActionClassIdTdkV1["ActionClassID_KeyboardKeys_Release"] = "ActionClassID_KeyboardKeys_Release";
19
- ActionClassIdTdkV1["ActionClassID_KeyboardKeys_PressAndRelease"] = "ActionClassID_KeyboardKeys_PressAndRelease";
20
- ActionClassIdTdkV1["ActionClassID_KeyboardType_Text"] = "ActionClassID_KeyboardType_Text";
21
- ActionClassIdTdkV1["ActionClassID_KeyboardType_UnicodeText"] = "ActionClassID_KeyboardType_UnicodeText";
22
- ActionClassIdTdkV1["ActionClassID_RunCommand"] = "ActionClassID_RunCommand";
23
- })(ActionClassIdTdkV1 = exports.ActionClassIdTdkV1 || (exports.ActionClassIdTdkV1 = {}));
@@ -1,10 +0,0 @@
1
- import { ActionParameters } from '../../proto/Askui/API/TDKv1/ActionParameters';
2
- import { ActionClassIdTdkV1 } from './action-class-tdk-v1';
3
- import { Action } from './action';
4
- export declare class ActionTdkV1 {
5
- actionClassID: ActionClassIdTdkV1;
6
- actionParameters: ActionParameters;
7
- constructor(actionClassID: ActionClassIdTdkV1, actionParameters: ActionParameters);
8
- static fromJson(json: unknown, _resizeRatio?: number): ActionTdkV1;
9
- static fromAction(action: Action, _resizeRatio?: number): ActionTdkV1;
10
- }
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionTdkV1 = void 0;
4
- const action_class_tdk_v1_1 = require("./action-class-tdk-v1");
5
- const actionMapper = {
6
- NO_COMMAND: (_action) => [
7
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_Undefined,
8
- {},
9
- ],
10
- MOUSE_CLICK_LEFT: (_action) => [
11
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_MouseButton_PressAndRelease,
12
- { mouseButtonPressAndRelease: { count: 1, mouseButton: 'MouseButton_Left' } },
13
- ],
14
- MOUSE_CLICK_RIGHT: (_action) => [
15
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_MouseButton_PressAndRelease,
16
- { mouseButtonPressAndRelease: { count: 1, mouseButton: 'MouseButton_Right' } },
17
- ],
18
- MOUSE_CLICK_MIDDLE: (_action) => [
19
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_MouseButton_PressAndRelease,
20
- { mouseButtonPressAndRelease: { count: 1, mouseButton: 'MouseButton_Middle' } },
21
- ],
22
- MOUSE_CLICK_DOUBLE_LEFT: (_action) => [
23
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_MouseButton_PressAndRelease,
24
- { mouseButtonPressAndRelease: { count: 2, mouseButton: 'MouseButton_Left' } },
25
- ],
26
- MOUSE_CLICK_DOUBLE_RIGHT: (_action) => [
27
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_MouseButton_PressAndRelease,
28
- { mouseButtonPressAndRelease: { count: 2, mouseButton: 'MouseButton_Right' } },
29
- ],
30
- MOUSE_CLICK_DOUBLE_MIDDLE: (_action) => [
31
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_MouseButton_PressAndRelease,
32
- { mouseButtonPressAndRelease: { count: 2, mouseButton: 'MouseButton_Middle' } },
33
- ],
34
- MOUSE_SCROLL: (action) => [
35
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_MouseWheelScroll,
36
- {
37
- mouseWheelScroll: {
38
- direction: action.position.x !== 0
39
- ? 'MouseWheelScrollDirection_Horizontal'
40
- : 'MouseWheelScrollDirection_Vertical',
41
- delta: action.position.x !== 0 ? action.position.x : action.position.y,
42
- },
43
- },
44
- ],
45
- TYPE_TEXT: (_action) => [
46
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_Undefined,
47
- {},
48
- ],
49
- TYPE: (action) => [
50
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_KeyboardType_UnicodeText,
51
- { keyboardTypeUnicodeText: { text: action.text } },
52
- ],
53
- PRESS_KEY_SEQUENCE: (_action) => [
54
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_Undefined,
55
- {},
56
- ],
57
- PRESS_ANDROID_KEY_SEQUENCE: (_action) => [
58
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_Undefined,
59
- {},
60
- ],
61
- PRESS_ANDROID_SINGLE_KEY: (_action) => [
62
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_Undefined,
63
- {},
64
- ],
65
- MOUSE_MOVE_RELATIVELY: (action) => [
66
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_MouseMove_Delta,
67
- { mouseMoveDelta: { delta: { x: action.position.x, y: action.position.y } } },
68
- ],
69
- MOUSE_MOVE: (action) => [
70
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_MouseMove,
71
- { mouseMove: { position: { x: action.position.x, y: action.position.y } } },
72
- ],
73
- MOUSE_DOWN: (_action) => [
74
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_MouseButton_Press,
75
- { mouseButtonPress: { mouseButton: 'MouseButton_Left' } },
76
- ],
77
- MOUSE_UP: (_action) => [
78
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_MouseButton_Release,
79
- { mouseButtonPress: { mouseButton: 'MouseButton_Left' } },
80
- ],
81
- EXECUTE_COMMAND: (_action) => [
82
- action_class_tdk_v1_1.ActionClassIdTdkV1.ActionClassID_Undefined,
83
- {},
84
- ],
85
- };
86
- class ActionTdkV1 {
87
- constructor(actionClassID, actionParameters) {
88
- this.actionClassID = actionClassID;
89
- this.actionParameters = actionParameters;
90
- }
91
- static fromJson(json, _resizeRatio = 1) {
92
- const actionTdk = json;
93
- return new ActionTdkV1(action_class_tdk_v1_1.ActionClassIdTdkV1[actionTdk.actionClassID], actionTdk.actionParameters);
94
- }
95
- static fromAction(action, _resizeRatio = 1) {
96
- const [classId, parameters] = actionMapper[action.inputEvent](action);
97
- return new ActionTdkV1(classId, parameters);
98
- }
99
- }
100
- exports.ActionTdkV1 = ActionTdkV1;
@@ -1,5 +0,0 @@
1
- export declare enum AnnotationLevel {
2
- DISABLED = "disabled",
3
- ON_FAILURE = "onFailure",
4
- ALL = "all"
5
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnnotationLevel = void 0;
4
- var AnnotationLevel;
5
- (function (AnnotationLevel) {
6
- AnnotationLevel["DISABLED"] = "disabled";
7
- AnnotationLevel["ON_FAILURE"] = "onFailure";
8
- AnnotationLevel["ALL"] = "all";
9
- })(AnnotationLevel = exports.AnnotationLevel || (exports.AnnotationLevel = {}));
@@ -1,2 +0,0 @@
1
- export declare class UiControlClientError extends Error {
2
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UiControlClientError = void 0;
4
- class UiControlClientError extends Error {
5
- }
6
- exports.UiControlClientError = UiControlClientError;