@qapilot/appium-module 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +269 -0
  3. package/dist/commands/actions/perform-actions.command.d.ts +16 -0
  4. package/dist/commands/actions/perform-actions.command.d.ts.map +1 -0
  5. package/dist/commands/actions/perform-actions.command.js +23 -0
  6. package/dist/commands/actions/perform-actions.command.js.map +1 -0
  7. package/dist/commands/actions/touch-perform.command.d.ts +21 -0
  8. package/dist/commands/actions/touch-perform.command.d.ts.map +1 -0
  9. package/dist/commands/actions/touch-perform.command.js +28 -0
  10. package/dist/commands/actions/touch-perform.command.js.map +1 -0
  11. package/dist/commands/base.command.d.ts +36 -0
  12. package/dist/commands/base.command.d.ts.map +1 -0
  13. package/dist/commands/base.command.js +41 -0
  14. package/dist/commands/base.command.js.map +1 -0
  15. package/dist/commands/command.registry.d.ts +12 -0
  16. package/dist/commands/command.registry.d.ts.map +1 -0
  17. package/dist/commands/command.registry.js +111 -0
  18. package/dist/commands/command.registry.js.map +1 -0
  19. package/dist/commands/context/get-context.command.d.ts +13 -0
  20. package/dist/commands/context/get-context.command.d.ts.map +1 -0
  21. package/dist/commands/context/get-context.command.js +14 -0
  22. package/dist/commands/context/get-context.command.js.map +1 -0
  23. package/dist/commands/context/get-contexts.command.d.ts +13 -0
  24. package/dist/commands/context/get-contexts.command.d.ts.map +1 -0
  25. package/dist/commands/context/get-contexts.command.js +17 -0
  26. package/dist/commands/context/get-contexts.command.js.map +1 -0
  27. package/dist/commands/context/set-context.command.d.ts +17 -0
  28. package/dist/commands/context/set-context.command.d.ts.map +1 -0
  29. package/dist/commands/context/set-context.command.js +27 -0
  30. package/dist/commands/context/set-context.command.js.map +1 -0
  31. package/dist/commands/device/activate-app.command.d.ts +16 -0
  32. package/dist/commands/device/activate-app.command.d.ts.map +1 -0
  33. package/dist/commands/device/activate-app.command.js +23 -0
  34. package/dist/commands/device/activate-app.command.js.map +1 -0
  35. package/dist/commands/device/hide-keyboard.command.d.ts +17 -0
  36. package/dist/commands/device/hide-keyboard.command.d.ts.map +1 -0
  37. package/dist/commands/device/hide-keyboard.command.js +18 -0
  38. package/dist/commands/device/hide-keyboard.command.js.map +1 -0
  39. package/dist/commands/device/is-keyboard-shown.command.d.ts +13 -0
  40. package/dist/commands/device/is-keyboard-shown.command.d.ts.map +1 -0
  41. package/dist/commands/device/is-keyboard-shown.command.js +14 -0
  42. package/dist/commands/device/is-keyboard-shown.command.js.map +1 -0
  43. package/dist/commands/device/press-keycode.command.d.ts +19 -0
  44. package/dist/commands/device/press-keycode.command.d.ts.map +1 -0
  45. package/dist/commands/device/press-keycode.command.js +28 -0
  46. package/dist/commands/device/press-keycode.command.js.map +1 -0
  47. package/dist/commands/device/set-location.command.d.ts +16 -0
  48. package/dist/commands/device/set-location.command.d.ts.map +1 -0
  49. package/dist/commands/device/set-location.command.js +24 -0
  50. package/dist/commands/device/set-location.command.js.map +1 -0
  51. package/dist/commands/device/set-orientation.command.d.ts +16 -0
  52. package/dist/commands/device/set-orientation.command.d.ts.map +1 -0
  53. package/dist/commands/device/set-orientation.command.js +23 -0
  54. package/dist/commands/device/set-orientation.command.js.map +1 -0
  55. package/dist/commands/device/terminate-app.command.d.ts +16 -0
  56. package/dist/commands/device/terminate-app.command.d.ts.map +1 -0
  57. package/dist/commands/device/terminate-app.command.js +23 -0
  58. package/dist/commands/device/terminate-app.command.js.map +1 -0
  59. package/dist/commands/element/clear-element.command.d.ts +14 -0
  60. package/dist/commands/element/clear-element.command.d.ts.map +1 -0
  61. package/dist/commands/element/clear-element.command.js +13 -0
  62. package/dist/commands/element/clear-element.command.js.map +1 -0
  63. package/dist/commands/element/click-element.command.d.ts +14 -0
  64. package/dist/commands/element/click-element.command.d.ts.map +1 -0
  65. package/dist/commands/element/click-element.command.js +13 -0
  66. package/dist/commands/element/click-element.command.js.map +1 -0
  67. package/dist/commands/element/find-element.command.d.ts +17 -0
  68. package/dist/commands/element/find-element.command.d.ts.map +1 -0
  69. package/dist/commands/element/find-element.command.js +36 -0
  70. package/dist/commands/element/find-element.command.js.map +1 -0
  71. package/dist/commands/element/find-elements.command.d.ts +17 -0
  72. package/dist/commands/element/find-elements.command.d.ts.map +1 -0
  73. package/dist/commands/element/find-elements.command.js +39 -0
  74. package/dist/commands/element/find-elements.command.js.map +1 -0
  75. package/dist/commands/element/get-element-attribute.command.d.ts +16 -0
  76. package/dist/commands/element/get-element-attribute.command.d.ts.map +1 -0
  77. package/dist/commands/element/get-element-attribute.command.js +25 -0
  78. package/dist/commands/element/get-element-attribute.command.js.map +1 -0
  79. package/dist/commands/element/get-element-displayed.command.d.ts +14 -0
  80. package/dist/commands/element/get-element-displayed.command.d.ts.map +1 -0
  81. package/dist/commands/element/get-element-displayed.command.js +14 -0
  82. package/dist/commands/element/get-element-displayed.command.js.map +1 -0
  83. package/dist/commands/element/get-element-location.command.d.ts +15 -0
  84. package/dist/commands/element/get-element-location.command.d.ts.map +1 -0
  85. package/dist/commands/element/get-element-location.command.js +18 -0
  86. package/dist/commands/element/get-element-location.command.js.map +1 -0
  87. package/dist/commands/element/get-element-rect.command.d.ts +15 -0
  88. package/dist/commands/element/get-element-rect.command.d.ts.map +1 -0
  89. package/dist/commands/element/get-element-rect.command.js +20 -0
  90. package/dist/commands/element/get-element-rect.command.js.map +1 -0
  91. package/dist/commands/element/get-element-size.command.d.ts +15 -0
  92. package/dist/commands/element/get-element-size.command.d.ts.map +1 -0
  93. package/dist/commands/element/get-element-size.command.js +18 -0
  94. package/dist/commands/element/get-element-size.command.js.map +1 -0
  95. package/dist/commands/element/get-element-text.command.d.ts +14 -0
  96. package/dist/commands/element/get-element-text.command.d.ts.map +1 -0
  97. package/dist/commands/element/get-element-text.command.js +14 -0
  98. package/dist/commands/element/get-element-text.command.js.map +1 -0
  99. package/dist/commands/element/set-value.command.d.ts +16 -0
  100. package/dist/commands/element/set-value.command.d.ts.map +1 -0
  101. package/dist/commands/element/set-value.command.js +27 -0
  102. package/dist/commands/element/set-value.command.js.map +1 -0
  103. package/dist/commands/page/get-screenshot.command.d.ts +14 -0
  104. package/dist/commands/page/get-screenshot.command.d.ts.map +1 -0
  105. package/dist/commands/page/get-screenshot.command.js +15 -0
  106. package/dist/commands/page/get-screenshot.command.js.map +1 -0
  107. package/dist/commands/page/get-source.command.d.ts +13 -0
  108. package/dist/commands/page/get-source.command.d.ts.map +1 -0
  109. package/dist/commands/page/get-source.command.js +14 -0
  110. package/dist/commands/page/get-source.command.js.map +1 -0
  111. package/dist/commands/script/execute-script-sync.command.d.ts +20 -0
  112. package/dist/commands/script/execute-script-sync.command.d.ts.map +1 -0
  113. package/dist/commands/script/execute-script-sync.command.js +31 -0
  114. package/dist/commands/script/execute-script-sync.command.js.map +1 -0
  115. package/dist/commands/script/execute-script.command.d.ts +16 -0
  116. package/dist/commands/script/execute-script.command.d.ts.map +1 -0
  117. package/dist/commands/script/execute-script.command.js +27 -0
  118. package/dist/commands/script/execute-script.command.js.map +1 -0
  119. package/dist/commands/session/create-session.command.d.ts +16 -0
  120. package/dist/commands/session/create-session.command.d.ts.map +1 -0
  121. package/dist/commands/session/create-session.command.js +39 -0
  122. package/dist/commands/session/create-session.command.js.map +1 -0
  123. package/dist/commands/session/delete-session.command.d.ts +13 -0
  124. package/dist/commands/session/delete-session.command.d.ts.map +1 -0
  125. package/dist/commands/session/delete-session.command.js +13 -0
  126. package/dist/commands/session/delete-session.command.js.map +1 -0
  127. package/dist/commands/session/get-session.command.d.ts +14 -0
  128. package/dist/commands/session/get-session.command.d.ts.map +1 -0
  129. package/dist/commands/session/get-session.command.js +18 -0
  130. package/dist/commands/session/get-session.command.js.map +1 -0
  131. package/dist/commands/window/get-window-handles.command.d.ts +13 -0
  132. package/dist/commands/window/get-window-handles.command.d.ts.map +1 -0
  133. package/dist/commands/window/get-window-handles.command.js +17 -0
  134. package/dist/commands/window/get-window-handles.command.js.map +1 -0
  135. package/dist/commands/window/get-window.command.d.ts +13 -0
  136. package/dist/commands/window/get-window.command.d.ts.map +1 -0
  137. package/dist/commands/window/get-window.command.js +14 -0
  138. package/dist/commands/window/get-window.command.js.map +1 -0
  139. package/dist/commands/window/switch-window.command.d.ts +15 -0
  140. package/dist/commands/window/switch-window.command.d.ts.map +1 -0
  141. package/dist/commands/window/switch-window.command.js +23 -0
  142. package/dist/commands/window/switch-window.command.js.map +1 -0
  143. package/dist/http/middleware/error-handler.d.ts +3 -0
  144. package/dist/http/middleware/error-handler.d.ts.map +1 -0
  145. package/dist/http/middleware/error-handler.js +29 -0
  146. package/dist/http/middleware/error-handler.js.map +1 -0
  147. package/dist/http/middleware/request-validator.d.ts +3 -0
  148. package/dist/http/middleware/request-validator.d.ts.map +1 -0
  149. package/dist/http/middleware/request-validator.js +37 -0
  150. package/dist/http/middleware/request-validator.js.map +1 -0
  151. package/dist/http/router.d.ts +3 -0
  152. package/dist/http/router.d.ts.map +1 -0
  153. package/dist/http/router.js +43 -0
  154. package/dist/http/router.js.map +1 -0
  155. package/dist/index.d.ts +19 -0
  156. package/dist/index.d.ts.map +1 -0
  157. package/dist/index.js +19 -0
  158. package/dist/index.js.map +1 -0
  159. package/dist/invoker/command-invoker.d.ts +3 -0
  160. package/dist/invoker/command-invoker.d.ts.map +1 -0
  161. package/dist/invoker/command-invoker.js +94 -0
  162. package/dist/invoker/command-invoker.js.map +1 -0
  163. package/dist/logger/index.d.ts +4 -0
  164. package/dist/logger/index.d.ts.map +1 -0
  165. package/dist/logger/index.js +19 -0
  166. package/dist/logger/index.js.map +1 -0
  167. package/dist/providers/base.provider.d.ts +11 -0
  168. package/dist/providers/base.provider.d.ts.map +1 -0
  169. package/dist/providers/base.provider.js +51 -0
  170. package/dist/providers/base.provider.js.map +1 -0
  171. package/dist/providers/browserstack/browserstack.config.d.ts +11 -0
  172. package/dist/providers/browserstack/browserstack.config.d.ts.map +1 -0
  173. package/dist/providers/browserstack/browserstack.config.js +32 -0
  174. package/dist/providers/browserstack/browserstack.config.js.map +1 -0
  175. package/dist/providers/browserstack/browserstack.provider.d.ts +15 -0
  176. package/dist/providers/browserstack/browserstack.provider.d.ts.map +1 -0
  177. package/dist/providers/browserstack/browserstack.provider.js +80 -0
  178. package/dist/providers/browserstack/browserstack.provider.js.map +1 -0
  179. package/dist/providers/lambdatest/lambdatest.config.d.ts +11 -0
  180. package/dist/providers/lambdatest/lambdatest.config.d.ts.map +1 -0
  181. package/dist/providers/lambdatest/lambdatest.config.js +28 -0
  182. package/dist/providers/lambdatest/lambdatest.config.js.map +1 -0
  183. package/dist/providers/lambdatest/lambdatest.provider.d.ts +15 -0
  184. package/dist/providers/lambdatest/lambdatest.provider.d.ts.map +1 -0
  185. package/dist/providers/lambdatest/lambdatest.provider.js +74 -0
  186. package/dist/providers/lambdatest/lambdatest.provider.js.map +1 -0
  187. package/dist/providers/local/local.provider.d.ts +15 -0
  188. package/dist/providers/local/local.provider.d.ts.map +1 -0
  189. package/dist/providers/local/local.provider.js +40 -0
  190. package/dist/providers/local/local.provider.js.map +1 -0
  191. package/dist/providers/provider.factory.d.ts +10 -0
  192. package/dist/providers/provider.factory.d.ts.map +1 -0
  193. package/dist/providers/provider.factory.js +32 -0
  194. package/dist/providers/provider.factory.js.map +1 -0
  195. package/dist/providers/provider.interface.d.ts +30 -0
  196. package/dist/providers/provider.interface.d.ts.map +1 -0
  197. package/dist/providers/provider.interface.js +2 -0
  198. package/dist/providers/provider.interface.js.map +1 -0
  199. package/dist/server.d.ts +2 -0
  200. package/dist/server.d.ts.map +1 -0
  201. package/dist/server.js +13 -0
  202. package/dist/server.js.map +1 -0
  203. package/dist/types/command.types.d.ts +24 -0
  204. package/dist/types/command.types.d.ts.map +1 -0
  205. package/dist/types/command.types.js +2 -0
  206. package/dist/types/command.types.js.map +1 -0
  207. package/dist/types/error.types.d.ts +25 -0
  208. package/dist/types/error.types.d.ts.map +1 -0
  209. package/dist/types/error.types.js +26 -0
  210. package/dist/types/error.types.js.map +1 -0
  211. package/dist/types/provider.types.d.ts +13 -0
  212. package/dist/types/provider.types.d.ts.map +1 -0
  213. package/dist/types/provider.types.js +2 -0
  214. package/dist/types/provider.types.js.map +1 -0
  215. package/dist/types/webdriver.types.d.ts +55 -0
  216. package/dist/types/webdriver.types.d.ts.map +1 -0
  217. package/dist/types/webdriver.types.js +4 -0
  218. package/dist/types/webdriver.types.js.map +1 -0
  219. package/package.json +66 -0
@@ -0,0 +1,39 @@
1
+ import { AppiumError, AppiumErrorCode } from '../../types/error.types.js';
2
+ import { BaseCommand } from '../base.command.js';
3
+ export class CreateSessionCommand extends BaseCommand {
4
+ name = 'createSession';
5
+ method = 'POST';
6
+ pathTemplate = '/session';
7
+ validate(params) {
8
+ if (!params.capabilities || typeof params.capabilities !== 'object') {
9
+ throw new AppiumError({
10
+ code: AppiumErrorCode.VALIDATION_ERROR,
11
+ message: '"capabilities" is required and must be an object',
12
+ httpStatus: 400,
13
+ });
14
+ }
15
+ }
16
+ buildBody(params) {
17
+ return {
18
+ capabilities: {
19
+ alwaysMatch: params.capabilities,
20
+ firstMatch: [{}],
21
+ },
22
+ ...(params.desiredCapabilities && { desiredCapabilities: params.desiredCapabilities }),
23
+ };
24
+ }
25
+ parseResponse(raw) {
26
+ const body = raw;
27
+ const value = body['value'];
28
+ return {
29
+ // BrowserStack W3C puts sessionId at the root level; standard W3C puts it inside value
30
+ sessionId: body['sessionId'] ||
31
+ value?.['sessionId'] ||
32
+ '',
33
+ capabilities: value?.['capabilities'] ??
34
+ value ??
35
+ {},
36
+ };
37
+ }
38
+ }
39
+ //# sourceMappingURL=create-session.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-session.command.js","sourceRoot":"","sources":["../../../src/commands/session/create-session.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOjD,MAAM,OAAO,oBAAqB,SAAQ,WAAkD;IACjF,IAAI,GAAG,eAAe,CAAC;IACvB,MAAM,GAAG,MAAe,CAAC;IACzB,YAAY,GAAG,UAAU,CAAC;IAE1B,QAAQ,CAAC,MAA2B;QAC3C,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;YACpE,MAAM,IAAI,WAAW,CAAC;gBACpB,IAAI,EAAE,eAAe,CAAC,gBAAgB;gBACtC,OAAO,EAAE,kDAAkD;gBAC3D,UAAU,EAAE,GAAG;aAChB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,SAAS,CAAC,MAA2B;QACnC,OAAO;YACL,YAAY,EAAE;gBACZ,WAAW,EAAE,MAAM,CAAC,YAAY;gBAChC,UAAU,EAAE,CAAC,EAAE,CAAC;aACjB;YACD,GAAG,CAAC,MAAM,CAAC,mBAAmB,IAAI,EAAE,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,EAAE,CAAC;SACvF,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,GAAY;QACxB,MAAM,IAAI,GAAG,GAA8B,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAmC,CAAC;QAC9D,OAAO;YACL,uFAAuF;YACvF,SAAS,EACN,IAAI,CAAC,WAAW,CAAY;gBAC5B,KAAK,EAAE,CAAC,WAAW,CAAY;gBAChC,EAAE;YACJ,YAAY,EACT,KAAK,EAAE,CAAC,cAAc,CAA6B;gBACnD,KAAiC;gBAClC,EAAE;SACL,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../base.command.js';
2
+ interface DeleteSessionParams extends Record<string, unknown> {
3
+ sessionId: string;
4
+ }
5
+ export declare class DeleteSessionCommand extends BaseCommand<DeleteSessionParams, null> {
6
+ readonly name = "deleteSession";
7
+ readonly method: "DELETE";
8
+ readonly pathTemplate = "/session/{sessionId}";
9
+ buildBody(_params: DeleteSessionParams): undefined;
10
+ parseResponse(_raw: unknown): null;
11
+ }
12
+ export {};
13
+ //# sourceMappingURL=delete-session.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-session.command.d.ts","sourceRoot":"","sources":["../../../src/commands/session/delete-session.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,UAAU,mBAAoB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,oBAAqB,SAAQ,WAAW,CAAC,mBAAmB,EAAE,IAAI,CAAC;IAC9E,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,MAAM,EAAG,QAAQ,CAAU;IACpC,QAAQ,CAAC,YAAY,0BAA0B;IAE/C,SAAS,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS;IAIlD,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;CAGnC"}
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../base.command.js';
2
+ export class DeleteSessionCommand extends BaseCommand {
3
+ name = 'deleteSession';
4
+ method = 'DELETE';
5
+ pathTemplate = '/session/{sessionId}';
6
+ buildBody(_params) {
7
+ return undefined;
8
+ }
9
+ parseResponse(_raw) {
10
+ return null;
11
+ }
12
+ }
13
+ //# sourceMappingURL=delete-session.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-session.command.js","sourceRoot":"","sources":["../../../src/commands/session/delete-session.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,OAAO,oBAAqB,SAAQ,WAAsC;IACrE,IAAI,GAAG,eAAe,CAAC;IACvB,MAAM,GAAG,QAAiB,CAAC;IAC3B,YAAY,GAAG,sBAAsB,CAAC;IAE/C,SAAS,CAAC,OAA4B;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,aAAa,CAAC,IAAa;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,14 @@
1
+ import type { WebDriverSession } from '../../types/webdriver.types.js';
2
+ import { BaseCommand } from '../base.command.js';
3
+ interface GetSessionParams extends Record<string, unknown> {
4
+ sessionId: string;
5
+ }
6
+ export declare class GetSessionCommand extends BaseCommand<GetSessionParams, WebDriverSession> {
7
+ readonly name = "getSession";
8
+ readonly method: "GET";
9
+ readonly pathTemplate = "/session/{sessionId}";
10
+ buildBody(_params: GetSessionParams): undefined;
11
+ parseResponse(raw: unknown): WebDriverSession;
12
+ }
13
+ export {};
14
+ //# sourceMappingURL=get-session.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-session.command.d.ts","sourceRoot":"","sources":["../../../src/commands/session/get-session.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,UAAU,gBAAiB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACxD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,iBAAkB,SAAQ,WAAW,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpF,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,MAAM,EAAG,KAAK,CAAU;IACjC,QAAQ,CAAC,YAAY,0BAA0B;IAE/C,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS;IAI/C,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB;CAQ9C"}
@@ -0,0 +1,18 @@
1
+ import { BaseCommand } from '../base.command.js';
2
+ export class GetSessionCommand extends BaseCommand {
3
+ name = 'getSession';
4
+ method = 'GET';
5
+ pathTemplate = '/session/{sessionId}';
6
+ buildBody(_params) {
7
+ return undefined;
8
+ }
9
+ parseResponse(raw) {
10
+ const body = raw;
11
+ const value = body['value'];
12
+ return {
13
+ sessionId: value['sessionId'] ?? '',
14
+ capabilities: value,
15
+ };
16
+ }
17
+ }
18
+ //# sourceMappingURL=get-session.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-session.command.js","sourceRoot":"","sources":["../../../src/commands/session/get-session.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,OAAO,iBAAkB,SAAQ,WAA+C;IAC3E,IAAI,GAAG,YAAY,CAAC;IACpB,MAAM,GAAG,KAAc,CAAC;IACxB,YAAY,GAAG,sBAAsB,CAAC;IAE/C,SAAS,CAAC,OAAyB;QACjC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,aAAa,CAAC,GAAY;QACxB,MAAM,IAAI,GAAG,GAA8B,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAA4B,CAAC;QACvD,OAAO;YACL,SAAS,EAAG,KAAK,CAAC,WAAW,CAAY,IAAI,EAAE;YAC/C,YAAY,EAAE,KAAK;SACpB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../base.command.js';
2
+ interface GetWindowHandlesParams extends Record<string, unknown> {
3
+ sessionId: string;
4
+ }
5
+ export declare class GetWindowHandlesCommand extends BaseCommand<GetWindowHandlesParams, string[]> {
6
+ readonly name = "getWindowHandles";
7
+ readonly method: "GET";
8
+ readonly pathTemplate = "/session/{sessionId}/window/handles";
9
+ buildBody(_params: GetWindowHandlesParams): undefined;
10
+ parseResponse(raw: unknown): string[];
11
+ }
12
+ export {};
13
+ //# sourceMappingURL=get-window-handles.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-window-handles.command.d.ts","sourceRoot":"","sources":["../../../src/commands/window/get-window-handles.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,UAAU,sBAAuB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,uBAAwB,SAAQ,WAAW,CAAC,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACxF,QAAQ,CAAC,IAAI,sBAAsB;IACnC,QAAQ,CAAC,MAAM,EAAG,KAAK,CAAU;IACjC,QAAQ,CAAC,YAAY,yCAAyC;IAE9D,SAAS,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS;IAIrD,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,EAAE;CAMtC"}
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from '../base.command.js';
2
+ export class GetWindowHandlesCommand extends BaseCommand {
3
+ name = 'getWindowHandles';
4
+ method = 'GET';
5
+ pathTemplate = '/session/{sessionId}/window/handles';
6
+ buildBody(_params) {
7
+ return undefined;
8
+ }
9
+ parseResponse(raw) {
10
+ const body = raw;
11
+ const value = body['value'];
12
+ if (!Array.isArray(value))
13
+ return [];
14
+ return value.map(String);
15
+ }
16
+ }
17
+ //# sourceMappingURL=get-window-handles.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-window-handles.command.js","sourceRoot":"","sources":["../../../src/commands/window/get-window-handles.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,OAAO,uBAAwB,SAAQ,WAA6C;IAC/E,IAAI,GAAG,kBAAkB,CAAC;IAC1B,MAAM,GAAG,KAAc,CAAC;IACxB,YAAY,GAAG,qCAAqC,CAAC;IAE9D,SAAS,CAAC,OAA+B;QACvC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,aAAa,CAAC,GAAY;QACxB,MAAM,IAAI,GAAG,GAA8B,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACrC,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../base.command.js';
2
+ interface GetWindowParams extends Record<string, unknown> {
3
+ sessionId: string;
4
+ }
5
+ export declare class GetWindowCommand extends BaseCommand<GetWindowParams, string> {
6
+ readonly name = "getWindow";
7
+ readonly method: "GET";
8
+ readonly pathTemplate = "/session/{sessionId}/window";
9
+ buildBody(_params: GetWindowParams): undefined;
10
+ parseResponse(raw: unknown): string;
11
+ }
12
+ export {};
13
+ //# sourceMappingURL=get-window.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-window.command.d.ts","sourceRoot":"","sources":["../../../src/commands/window/get-window.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,UAAU,eAAgB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACvD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,gBAAiB,SAAQ,WAAW,CAAC,eAAe,EAAE,MAAM,CAAC;IACxE,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,MAAM,EAAG,KAAK,CAAU;IACjC,QAAQ,CAAC,YAAY,iCAAiC;IAEtD,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS;IAI9C,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;CAIpC"}
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from '../base.command.js';
2
+ export class GetWindowCommand extends BaseCommand {
3
+ name = 'getWindow';
4
+ method = 'GET';
5
+ pathTemplate = '/session/{sessionId}/window';
6
+ buildBody(_params) {
7
+ return undefined;
8
+ }
9
+ parseResponse(raw) {
10
+ const body = raw;
11
+ return String(body['value'] ?? '');
12
+ }
13
+ }
14
+ //# sourceMappingURL=get-window.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-window.command.js","sourceRoot":"","sources":["../../../src/commands/window/get-window.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,OAAO,gBAAiB,SAAQ,WAAoC;IAC/D,IAAI,GAAG,WAAW,CAAC;IACnB,MAAM,GAAG,KAAc,CAAC;IACxB,YAAY,GAAG,6BAA6B,CAAC;IAEtD,SAAS,CAAC,OAAwB;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,aAAa,CAAC,GAAY;QACxB,MAAM,IAAI,GAAG,GAA8B,CAAC;QAC5C,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../base.command.js';
2
+ interface SwitchWindowParams extends Record<string, unknown> {
3
+ sessionId: string;
4
+ handle: string;
5
+ }
6
+ export declare class SwitchWindowCommand extends BaseCommand<SwitchWindowParams, null> {
7
+ readonly name = "switchWindow";
8
+ readonly method: "POST";
9
+ readonly pathTemplate = "/session/{sessionId}/window";
10
+ validate(params: SwitchWindowParams): void;
11
+ buildBody(params: SwitchWindowParams): unknown;
12
+ parseResponse(_raw: unknown): null;
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=switch-window.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch-window.command.d.ts","sourceRoot":"","sources":["../../../src/commands/window/switch-window.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,UAAU,kBAAmB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,mBAAoB,SAAQ,WAAW,CAAC,kBAAkB,EAAE,IAAI,CAAC;IAC5E,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAU;IAClC,QAAQ,CAAC,YAAY,iCAAiC;IAE7C,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI;IAUnD,SAAS,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO;IAI9C,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;CAGnC"}
@@ -0,0 +1,23 @@
1
+ import { AppiumError, AppiumErrorCode } from '../../types/error.types.js';
2
+ import { BaseCommand } from '../base.command.js';
3
+ export class SwitchWindowCommand extends BaseCommand {
4
+ name = 'switchWindow';
5
+ method = 'POST';
6
+ pathTemplate = '/session/{sessionId}/window';
7
+ validate(params) {
8
+ if (!params.handle) {
9
+ throw new AppiumError({
10
+ code: AppiumErrorCode.VALIDATION_ERROR,
11
+ message: '"handle" (window handle) is required',
12
+ httpStatus: 400,
13
+ });
14
+ }
15
+ }
16
+ buildBody(params) {
17
+ return { handle: params.handle };
18
+ }
19
+ parseResponse(_raw) {
20
+ return null;
21
+ }
22
+ }
23
+ //# sourceMappingURL=switch-window.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch-window.command.js","sourceRoot":"","sources":["../../../src/commands/window/switch-window.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOjD,MAAM,OAAO,mBAAoB,SAAQ,WAAqC;IACnE,IAAI,GAAG,cAAc,CAAC;IACtB,MAAM,GAAG,MAAe,CAAC;IACzB,YAAY,GAAG,6BAA6B,CAAC;IAE7C,QAAQ,CAAC,MAA0B;QAC1C,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,IAAI,WAAW,CAAC;gBACpB,IAAI,EAAE,eAAe,CAAC,gBAAgB;gBACtC,OAAO,EAAE,sCAAsC;gBAC/C,UAAU,EAAE,GAAG;aAChB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,SAAS,CAAC,MAA0B;QAClC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IACnC,CAAC;IAED,aAAa,CAAC,IAAa;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ import type { Request, Response, NextFunction } from 'express';
2
+ export declare function errorHandler(err: unknown, _req: Request, res: Response, _next: NextFunction): void;
3
+ //# sourceMappingURL=error-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../../src/http/middleware/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI/D,wBAAgB,YAAY,CAC1B,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,QAAQ,EAEb,KAAK,EAAE,YAAY,GAClB,IAAI,CAyBN"}
@@ -0,0 +1,29 @@
1
+ import { AppiumError, AppiumErrorCode } from '../../types/error.types.js';
2
+ import logger from '../../logger/index.js';
3
+ export function errorHandler(err, _req, res,
4
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
+ _next) {
6
+ if (err instanceof AppiumError) {
7
+ res.status(err.httpStatus).json({
8
+ success: false,
9
+ error: {
10
+ code: err.code,
11
+ message: err.message,
12
+ httpStatus: err.httpStatus,
13
+ raw: err.raw,
14
+ },
15
+ });
16
+ return;
17
+ }
18
+ const message = err instanceof Error ? err.message : String(err);
19
+ logger.error({ err }, 'Unhandled error in request pipeline');
20
+ res.status(500).json({
21
+ success: false,
22
+ error: {
23
+ code: AppiumErrorCode.UNKNOWN_ERROR,
24
+ message,
25
+ httpStatus: 500,
26
+ },
27
+ });
28
+ }
29
+ //# sourceMappingURL=error-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../../src/http/middleware/error-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,MAAM,UAAU,YAAY,CAC1B,GAAY,EACZ,IAAa,EACb,GAAa;AACb,6DAA6D;AAC7D,KAAmB;IAEnB,IAAI,GAAG,YAAY,WAAW,EAAE,CAAC;QAC/B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;YAC9B,OAAO,EAAE,KAAK;YACd,KAAK,EAAE;gBACL,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,UAAU,EAAE,GAAG,CAAC,UAAU;gBAC1B,GAAG,EAAE,GAAG,CAAC,GAAG;aACb;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,qCAAqC,CAAC,CAAC;IAE7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;QACnB,OAAO,EAAE,KAAK;QACd,KAAK,EAAE;YACL,IAAI,EAAE,eAAe,CAAC,aAAa;YACnC,OAAO;YACP,UAAU,EAAE,GAAG;SAChB;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Request, Response, NextFunction } from 'express';
2
+ export declare function validateExecuteRequest(req: Request, res: Response, next: NextFunction): void;
3
+ //# sourceMappingURL=request-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-validator.d.ts","sourceRoot":"","sources":["../../../src/http/middleware/request-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAsB/D,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAgB5F"}
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod';
2
+ import { AppiumErrorCode } from '../../types/error.types.js';
3
+ const executeRequestSchema = z.object({
4
+ commandName: z.string().min(1, 'commandName is required'),
5
+ provider: z.enum(['browserstack', 'lambdatest', 'local'], {
6
+ errorMap: () => ({
7
+ message: 'provider must be one of: browserstack, lambdatest, local',
8
+ }),
9
+ }),
10
+ credentials: z
11
+ .object({
12
+ username: z.string().optional(),
13
+ accessKey: z.string().optional(),
14
+ hubUrl: z.string().url().optional(),
15
+ })
16
+ .optional()
17
+ .default({}),
18
+ params: z.record(z.unknown()).optional().default({}),
19
+ });
20
+ export function validateExecuteRequest(req, res, next) {
21
+ const result = executeRequestSchema.safeParse(req.body);
22
+ if (!result.success) {
23
+ const issues = result.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`).join('; ');
24
+ res.status(400).json({
25
+ success: false,
26
+ error: {
27
+ code: AppiumErrorCode.VALIDATION_ERROR,
28
+ message: `Invalid request: ${issues}`,
29
+ httpStatus: 400,
30
+ },
31
+ });
32
+ return;
33
+ }
34
+ req.body = result.data;
35
+ next();
36
+ }
37
+ //# sourceMappingURL=request-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-validator.js","sourceRoot":"","sources":["../../../src/http/middleware/request-validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CA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E,oBAAoB,MAAM,EAAE;gBACrC,UAAU,EAAE,GAAG;aAChB;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IACD,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACvB,IAAI,EAAE,CAAC;AACT,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const router: import("express-serve-static-core").Router;
2
+ export default router;
3
+ //# sourceMappingURL=router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/http/router.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAwCxB,eAAe,MAAM,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { Router } from 'express';
2
+ import { invokeCommand } from '../invoker/command-invoker.js';
3
+ import { getSupportedCommands } from '../commands/command.registry.js';
4
+ import { getSupportedProviders } from '../providers/provider.factory.js';
5
+ import { validateExecuteRequest } from './middleware/request-validator.js';
6
+ const router = Router();
7
+ /**
8
+ * POST /api/v1/execute
9
+ * Execute a single Appium W3C command against a given provider hub.
10
+ */
11
+ router.post('/execute', validateExecuteRequest, async (req, res, next) => {
12
+ try {
13
+ const result = await invokeCommand(req.body);
14
+ const httpStatus = result.success ? 200 : (result.error?.httpStatus ?? 500);
15
+ res.status(httpStatus).json(result);
16
+ }
17
+ catch (err) {
18
+ next(err);
19
+ }
20
+ });
21
+ /**
22
+ * GET /api/v1/commands
23
+ * Returns the list of all registered command names.
24
+ */
25
+ router.get('/commands', (_req, res) => {
26
+ res.json({ commands: getSupportedCommands() });
27
+ });
28
+ /**
29
+ * GET /api/v1/providers
30
+ * Returns the list of all registered provider names.
31
+ */
32
+ router.get('/providers', (_req, res) => {
33
+ res.json({ providers: getSupportedProviders() });
34
+ });
35
+ /**
36
+ * GET /api/v1/health
37
+ * Simple liveness probe.
38
+ */
39
+ router.get('/health', (_req, res) => {
40
+ res.json({ status: 'ok', timestamp: new Date().toISOString() });
41
+ });
42
+ export default router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,GAAG,EAAE,EAAE;IACrC,GAAG,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IAClC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -0,0 +1,19 @@
1
+ export { invokeCommand } from './invoker/command-invoker.js';
2
+ export { getCommand, hasCommand, getSupportedCommands, registerCommand, } from './commands/command.registry.js';
3
+ export { BaseCommand } from './commands/base.command.js';
4
+ export { getProvider, registerProvider, getSupportedProviders, } from './providers/provider.factory.js';
5
+ export { BaseProvider } from './providers/base.provider.js';
6
+ export type { IAppiumProvider } from './providers/provider.interface.js';
7
+ export { BrowserStackProvider } from './providers/browserstack/browserstack.provider.js';
8
+ export { BROWSERSTACK_CONFIG, BROWSERSTACK_DEFAULT_CAPS } from './providers/browserstack/browserstack.config.js';
9
+ export { LambdaTestProvider } from './providers/lambdatest/lambdatest.provider.js';
10
+ export { LAMBDATEST_CONFIG, LAMBDATEST_DEFAULT_CAPS } from './providers/lambdatest/lambdatest.config.js';
11
+ export { LocalProvider } from './providers/local/local.provider.js';
12
+ export type { ExecuteRequest, ExecuteResponse, CommandRequestConfig, } from './types/command.types.js';
13
+ export type { ProviderName, ProviderCredentials, ProviderConfig, } from './types/provider.types.js';
14
+ export { AppiumError, AppiumErrorCode } from './types/error.types.js';
15
+ export type { AppiumServiceError } from './types/error.types.js';
16
+ export { W3C_ELEMENT_KEY, LEGACY_ELEMENT_KEY, } from './types/webdriver.types.js';
17
+ export type { WebDriverElement, WebDriverRect, WebDriverLocation, WebDriverSize, WebDriverSession, HttpMethod, W3CPointerAction, W3CKeyAction, W3CAction, TouchAction, SelectorStrategy, Orientation, GeoLocation, } from './types/webdriver.types.js';
18
+ export { default as logger } from './logger/index.js';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EACL,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,eAAe,GAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGzD,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AACjH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAGpE,YAAY,EACV,cAAc,EACd,eAAe,EACf,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACL,eAAe,EACf,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,WAAW,GACZ,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ // Core invoker
2
+ export { invokeCommand } from './invoker/command-invoker.js';
3
+ // Command registry
4
+ export { getCommand, hasCommand, getSupportedCommands, registerCommand, } from './commands/command.registry.js';
5
+ export { BaseCommand } from './commands/base.command.js';
6
+ // Provider factory
7
+ export { getProvider, registerProvider, getSupportedProviders, } from './providers/provider.factory.js';
8
+ export { BaseProvider } from './providers/base.provider.js';
9
+ // Concrete providers
10
+ export { BrowserStackProvider } from './providers/browserstack/browserstack.provider.js';
11
+ export { BROWSERSTACK_CONFIG, BROWSERSTACK_DEFAULT_CAPS } from './providers/browserstack/browserstack.config.js';
12
+ export { LambdaTestProvider } from './providers/lambdatest/lambdatest.provider.js';
13
+ export { LAMBDATEST_CONFIG, LAMBDATEST_DEFAULT_CAPS } from './providers/lambdatest/lambdatest.config.js';
14
+ export { LocalProvider } from './providers/local/local.provider.js';
15
+ export { AppiumError, AppiumErrorCode } from './types/error.types.js';
16
+ export { W3C_ELEMENT_KEY, LEGACY_ELEMENT_KEY, } from './types/webdriver.types.js';
17
+ // Logger
18
+ export { default as logger } from './logger/index.js';
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,mBAAmB;AACnB,OAAO,EACL,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,eAAe,GAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,mBAAmB;AACnB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,qBAAqB;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AACjH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAapE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EACL,eAAe,EACf,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAiBpC,SAAS;AACT,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ExecuteRequest, ExecuteResponse } from '../types/command.types.js';
2
+ export declare function invokeCommand(request: ExecuteRequest): Promise<ExecuteResponse>;
3
+ //# sourceMappingURL=command-invoker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-invoker.d.ts","sourceRoot":"","sources":["../../src/invoker/command-invoker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAcjF,wBAAsB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAqGrF"}
@@ -0,0 +1,94 @@
1
+ import axios, { AxiosError } from 'axios';
2
+ import { AppiumError, AppiumErrorCode } from '../types/error.types.js';
3
+ import { getCommand } from '../commands/command.registry.js';
4
+ import { getProvider } from '../providers/provider.factory.js';
5
+ import logger from '../logger/index.js';
6
+ function createAxiosInstance() {
7
+ return axios.create({
8
+ timeout: 120_000,
9
+ validateStatus: () => true, // handle all statuses manually
10
+ });
11
+ }
12
+ const http = createAxiosInstance();
13
+ export async function invokeCommand(request) {
14
+ const { commandName, provider: providerName, credentials, params } = request;
15
+ const command = getCommand(commandName);
16
+ const provider = getProvider(providerName);
17
+ // For session creation, merge provider defaults under user-supplied caps.
18
+ // User caps always win: { ...defaults, ...userCaps }
19
+ const resolvedParams = commandName === 'createSession' && params['capabilities'] != null
20
+ ? {
21
+ ...params,
22
+ capabilities: {
23
+ ...provider.getDefaultCapabilities(),
24
+ ...params['capabilities'],
25
+ },
26
+ }
27
+ : params;
28
+ const requestConfig = command.buildRequestConfig(resolvedParams);
29
+ const sessionId = typeof resolvedParams['sessionId'] === 'string' ? resolvedParams['sessionId'] : null;
30
+ const url = provider.buildUrl(sessionId, requestConfig.path, credentials);
31
+ const headers = provider.buildHeaders(credentials);
32
+ logger.debug({ commandName, providerName, url, method: requestConfig.method }, 'Executing command');
33
+ try {
34
+ const response = await http.request({
35
+ method: requestConfig.method,
36
+ url,
37
+ headers,
38
+ data: requestConfig.body,
39
+ });
40
+ if (response.status >= 400) {
41
+ const error = provider.normalizeError(response.status, response.data);
42
+ logger.warn({ commandName, providerName, url, httpStatus: response.status, errorCode: error.code }, 'Command failed with HTTP error');
43
+ return {
44
+ success: false,
45
+ error: {
46
+ code: error.code,
47
+ message: error.message,
48
+ httpStatus: error.httpStatus,
49
+ raw: error.raw,
50
+ },
51
+ };
52
+ }
53
+ const data = command.parseResponse(response.data);
54
+ logger.debug({ commandName, providerName, httpStatus: response.status }, 'Command succeeded');
55
+ return { success: true, data };
56
+ }
57
+ catch (err) {
58
+ if (err instanceof AppiumError) {
59
+ return {
60
+ success: false,
61
+ error: {
62
+ code: err.code,
63
+ message: err.message,
64
+ httpStatus: err.httpStatus,
65
+ raw: err.raw,
66
+ },
67
+ };
68
+ }
69
+ if (err instanceof AxiosError) {
70
+ const isNetworkError = !err.response;
71
+ logger.error({ commandName, providerName, url, message: err.message }, isNetworkError ? 'Provider unreachable' : 'Axios request error');
72
+ return {
73
+ success: false,
74
+ error: {
75
+ code: isNetworkError ? AppiumErrorCode.PROVIDER_UNREACHABLE : AppiumErrorCode.UNKNOWN_ERROR,
76
+ message: err.message,
77
+ httpStatus: err.response?.status ?? 503,
78
+ raw: err.response?.data,
79
+ },
80
+ };
81
+ }
82
+ const message = err instanceof Error ? err.message : String(err);
83
+ logger.error({ commandName, providerName, message }, 'Unexpected error during command execution');
84
+ return {
85
+ success: false,
86
+ error: {
87
+ code: AppiumErrorCode.UNKNOWN_ERROR,
88
+ message,
89
+ httpStatus: 500,
90
+ },
91
+ };
92
+ }
93
+ }
94
+ //# sourceMappingURL=command-invoker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-invoker.js","sourceRoot":"","sources":["../../src/invoker/command-invoker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAsB,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,SAAS,mBAAmB;IAC1B,OAAO,KAAK,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,OAAO;QAChB,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,+BAA+B;KAC5D,CAAC,CAAC;AACL,CAAC;AAED,MAAM,IAAI,GAAG,mBAAmB,EAAE,CAAC;AAEnC,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAuB;IACzD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE7E,MA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AAC,sBAAsB,CAAC,CAAC,CAAC,qBAAqB,CAChE,CAAC;YACF,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACL,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,eAAe,CAAC,aAAa;oBAC3F,OAAO,EAAE,GAAG,CAAC,OAAO;oBACpB,UAAU,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG;oBACvC,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE,IAAI;iBACxB;aACF,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,MAAM,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,2CAA2C,CAAC,CAAC;QAClG,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE;gBACL,IAAI,EAAE,eAAe,CAAC,aAAa;gBACnC,OAAO;gBACP,UAAU,EAAE,GAAG;aAChB;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import pino from 'pino';
2
+ declare const logger: pino.Logger<never, boolean>;
3
+ export default logger;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAgBxB,QAAA,MAAM,MAAM,6BAMX,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,19 @@
1
+ import pino from 'pino';
2
+ const isDev = process.env['NODE_ENV'] !== 'production';
3
+ const level = process.env['LOG_LEVEL'] ?? 'info';
4
+ const transport = isDev
5
+ ? pino.transport({
6
+ target: 'pino-pretty',
7
+ options: {
8
+ colorize: true,
9
+ translateTime: 'SYS:standard',
10
+ ignore: 'pid,hostname',
11
+ },
12
+ })
13
+ : undefined;
14
+ const logger = pino({
15
+ level,
16
+ base: { service: 'appium-http-service' },
17
+ }, transport);
18
+ export default logger;
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,YAAY,CAAC;AACvD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC;AAEjD,MAAM,SAAS,GAAG,KAAK;IACrB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;QACb,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE;YACP,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,cAAc;YAC7B,MAAM,EAAE,cAAc;SACvB;KACF,CAAC;IACJ,CAAC,CAAC,SAAS,CAAC;AAEd,MAAM,MAAM,GAAG,IAAI,CACjB;IACE,KAAK;IACL,IAAI,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;CACzC,EACD,SAAS,CACV,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type AppiumServiceError } from '../types/error.types.js';
2
+ import type { ProviderCredentials } from '../types/provider.types.js';
3
+ export declare abstract class BaseProvider {
4
+ protected abstract readonly hubBaseUrl: string;
5
+ protected abstract readonly wdHubPath: string;
6
+ protected buildBaseUrl(credentials: ProviderCredentials): string;
7
+ protected buildBasicAuthHeader(credentials: ProviderCredentials): string;
8
+ protected mapW3CError(statusCode: number, body: unknown): AppiumServiceError;
9
+ private httpStatusToErrorCode;
10
+ }
11
+ //# sourceMappingURL=base.provider.d.ts.map