@mobilerun/sdk 2.2.0 → 4.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 (261) hide show
  1. package/CHANGELOG.md +513 -0
  2. package/README.md +46 -2
  3. package/client.d.mts +33 -5
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +33 -5
  6. package/client.d.ts.map +1 -1
  7. package/client.js +29 -7
  8. package/client.js.map +1 -1
  9. package/client.mjs +29 -7
  10. package/client.mjs.map +1 -1
  11. package/internal/tslib.js +6 -6
  12. package/internal/utils/env.js +2 -2
  13. package/internal/utils/env.js.map +1 -1
  14. package/internal/utils/env.mjs +2 -2
  15. package/internal/utils/env.mjs.map +1 -1
  16. package/internal/utils/query.d.mts +2 -0
  17. package/internal/utils/query.d.mts.map +1 -0
  18. package/internal/utils/query.d.ts +2 -0
  19. package/internal/utils/query.d.ts.map +1 -0
  20. package/internal/utils/query.js +10 -0
  21. package/internal/utils/query.js.map +1 -0
  22. package/internal/utils/query.mjs +6 -0
  23. package/internal/utils/query.mjs.map +1 -0
  24. package/internal/utils.d.mts +1 -0
  25. package/internal/utils.d.ts +1 -0
  26. package/internal/utils.js +1 -0
  27. package/internal/utils.js.map +1 -1
  28. package/internal/utils.mjs +1 -0
  29. package/package.json +7 -1
  30. package/resources/agents.d.mts +30 -0
  31. package/resources/agents.d.mts.map +1 -0
  32. package/resources/agents.d.ts +30 -0
  33. package/resources/agents.d.ts.map +1 -0
  34. package/resources/agents.js +18 -0
  35. package/resources/agents.js.map +1 -0
  36. package/resources/agents.mjs +14 -0
  37. package/resources/agents.mjs.map +1 -0
  38. package/resources/apps.d.mts +10 -12
  39. package/resources/apps.d.mts.map +1 -1
  40. package/resources/apps.d.ts +10 -12
  41. package/resources/apps.d.ts.map +1 -1
  42. package/resources/apps.js.map +1 -1
  43. package/resources/apps.mjs.map +1 -1
  44. package/resources/carriers.d.mts +233 -0
  45. package/resources/carriers.d.mts.map +1 -0
  46. package/resources/carriers.d.ts +233 -0
  47. package/resources/carriers.d.ts.map +1 -0
  48. package/resources/carriers.js +46 -0
  49. package/resources/carriers.js.map +1 -0
  50. package/resources/carriers.mjs +42 -0
  51. package/resources/carriers.mjs.map +1 -0
  52. package/resources/credentials/credentials.d.mts +4 -13
  53. package/resources/credentials/credentials.d.mts.map +1 -1
  54. package/resources/credentials/credentials.d.ts +4 -13
  55. package/resources/credentials/credentials.d.ts.map +1 -1
  56. package/resources/credentials/credentials.js.map +1 -1
  57. package/resources/credentials/credentials.mjs.map +1 -1
  58. package/resources/devices/actions.d.mts +37 -1
  59. package/resources/devices/actions.d.mts.map +1 -1
  60. package/resources/devices/actions.d.ts +37 -1
  61. package/resources/devices/actions.d.ts.map +1 -1
  62. package/resources/devices/actions.js +36 -0
  63. package/resources/devices/actions.js.map +1 -1
  64. package/resources/devices/actions.mjs +36 -0
  65. package/resources/devices/actions.mjs.map +1 -1
  66. package/resources/devices/apps.d.mts +4 -0
  67. package/resources/devices/apps.d.mts.map +1 -1
  68. package/resources/devices/apps.d.ts +4 -0
  69. package/resources/devices/apps.d.ts.map +1 -1
  70. package/resources/devices/devices.d.mts +63 -35
  71. package/resources/devices/devices.d.mts.map +1 -1
  72. package/resources/devices/devices.d.ts +63 -35
  73. package/resources/devices/devices.d.ts.map +1 -1
  74. package/resources/devices/devices.js +32 -2
  75. package/resources/devices/devices.js.map +1 -1
  76. package/resources/devices/devices.mjs +33 -3
  77. package/resources/devices/devices.mjs.map +1 -1
  78. package/resources/devices/esim.d.mts +95 -0
  79. package/resources/devices/esim.d.mts.map +1 -0
  80. package/resources/devices/esim.d.ts +95 -0
  81. package/resources/devices/esim.d.ts.map +1 -0
  82. package/resources/devices/esim.js +84 -0
  83. package/resources/devices/esim.js.map +1 -0
  84. package/resources/devices/esim.mjs +80 -0
  85. package/resources/devices/esim.mjs.map +1 -0
  86. package/resources/devices/files.d.mts +108 -0
  87. package/resources/devices/files.d.mts.map +1 -0
  88. package/resources/devices/files.d.ts +108 -0
  89. package/resources/devices/files.d.ts.map +1 -0
  90. package/resources/devices/files.js +87 -0
  91. package/resources/devices/files.js.map +1 -0
  92. package/resources/devices/files.mjs +83 -0
  93. package/resources/devices/files.mjs.map +1 -0
  94. package/resources/devices/index.d.mts +9 -3
  95. package/resources/devices/index.d.mts.map +1 -1
  96. package/resources/devices/index.d.ts +9 -3
  97. package/resources/devices/index.d.ts.map +1 -1
  98. package/resources/devices/index.js +13 -1
  99. package/resources/devices/index.js.map +1 -1
  100. package/resources/devices/index.mjs +7 -1
  101. package/resources/devices/index.mjs.map +1 -1
  102. package/resources/devices/keyboard.d.mts +10 -2
  103. package/resources/devices/keyboard.d.mts.map +1 -1
  104. package/resources/devices/keyboard.d.ts +10 -2
  105. package/resources/devices/keyboard.d.ts.map +1 -1
  106. package/resources/devices/location.d.mts +42 -0
  107. package/resources/devices/location.d.mts.map +1 -0
  108. package/resources/devices/location.d.ts +42 -0
  109. package/resources/devices/location.d.ts.map +1 -0
  110. package/resources/devices/location.js +47 -0
  111. package/resources/devices/location.js.map +1 -0
  112. package/resources/devices/location.mjs +43 -0
  113. package/resources/devices/location.mjs.map +1 -0
  114. package/resources/devices/packages.d.mts +4 -0
  115. package/resources/devices/packages.d.mts.map +1 -1
  116. package/resources/devices/packages.d.ts +4 -0
  117. package/resources/devices/packages.d.ts.map +1 -1
  118. package/resources/devices/profile.d.mts +23 -0
  119. package/resources/devices/profile.d.mts.map +1 -0
  120. package/resources/devices/profile.d.ts +23 -0
  121. package/resources/devices/profile.d.ts.map +1 -0
  122. package/resources/devices/profile.js +30 -0
  123. package/resources/devices/profile.js.map +1 -0
  124. package/resources/devices/profile.mjs +26 -0
  125. package/resources/devices/profile.mjs.map +1 -0
  126. package/resources/devices/proxy.d.mts +92 -0
  127. package/resources/devices/proxy.d.mts.map +1 -0
  128. package/resources/devices/proxy.d.ts +92 -0
  129. package/resources/devices/proxy.d.ts.map +1 -0
  130. package/resources/devices/proxy.js +65 -0
  131. package/resources/devices/proxy.js.map +1 -0
  132. package/resources/devices/proxy.mjs +61 -0
  133. package/resources/devices/proxy.mjs.map +1 -0
  134. package/resources/devices/state.d.mts +8 -19
  135. package/resources/devices/state.d.mts.map +1 -1
  136. package/resources/devices/state.d.ts +8 -19
  137. package/resources/devices/state.d.ts.map +1 -1
  138. package/resources/devices/state.js +0 -17
  139. package/resources/devices/state.js.map +1 -1
  140. package/resources/devices/state.mjs +0 -17
  141. package/resources/devices/state.mjs.map +1 -1
  142. package/resources/devices/tasks.d.mts +2 -9
  143. package/resources/devices/tasks.d.mts.map +1 -1
  144. package/resources/devices/tasks.d.ts +2 -9
  145. package/resources/devices/tasks.d.ts.map +1 -1
  146. package/resources/devices/tasks.js.map +1 -1
  147. package/resources/devices/tasks.mjs.map +1 -1
  148. package/resources/devices/time.d.mts +45 -0
  149. package/resources/devices/time.d.mts.map +1 -0
  150. package/resources/devices/time.d.ts +45 -0
  151. package/resources/devices/time.d.ts.map +1 -0
  152. package/resources/devices/time.js +64 -0
  153. package/resources/devices/time.js.map +1 -0
  154. package/resources/devices/time.mjs +60 -0
  155. package/resources/devices/time.mjs.map +1 -0
  156. package/resources/hooks.d.mts +5 -30
  157. package/resources/hooks.d.mts.map +1 -1
  158. package/resources/hooks.d.ts +5 -30
  159. package/resources/hooks.d.ts.map +1 -1
  160. package/resources/hooks.js +3 -0
  161. package/resources/hooks.js.map +1 -1
  162. package/resources/hooks.mjs +3 -0
  163. package/resources/hooks.mjs.map +1 -1
  164. package/resources/index.d.mts +7 -2
  165. package/resources/index.d.mts.map +1 -1
  166. package/resources/index.d.ts +7 -2
  167. package/resources/index.d.ts.map +1 -1
  168. package/resources/index.js +11 -1
  169. package/resources/index.js.map +1 -1
  170. package/resources/index.mjs +5 -0
  171. package/resources/index.mjs.map +1 -1
  172. package/resources/profiles.d.mts +84 -0
  173. package/resources/profiles.d.mts.map +1 -0
  174. package/resources/profiles.d.ts +84 -0
  175. package/resources/profiles.d.ts.map +1 -0
  176. package/resources/profiles.js +40 -0
  177. package/resources/profiles.js.map +1 -0
  178. package/resources/profiles.mjs +36 -0
  179. package/resources/profiles.mjs.map +1 -0
  180. package/resources/proxies.d.mts +103 -0
  181. package/resources/proxies.d.mts.map +1 -0
  182. package/resources/proxies.d.ts +103 -0
  183. package/resources/proxies.d.ts.map +1 -0
  184. package/resources/proxies.js +40 -0
  185. package/resources/proxies.js.map +1 -0
  186. package/resources/proxies.mjs +36 -0
  187. package/resources/proxies.mjs.map +1 -0
  188. package/resources/shared.d.mts +104 -0
  189. package/resources/shared.d.mts.map +1 -0
  190. package/resources/shared.d.ts +104 -0
  191. package/resources/shared.d.ts.map +1 -0
  192. package/resources/shared.js +4 -0
  193. package/resources/shared.js.map +1 -0
  194. package/resources/shared.mjs +3 -0
  195. package/resources/shared.mjs.map +1 -0
  196. package/resources/tasks/index.d.mts +1 -1
  197. package/resources/tasks/index.d.mts.map +1 -1
  198. package/resources/tasks/index.d.ts +1 -1
  199. package/resources/tasks/index.d.ts.map +1 -1
  200. package/resources/tasks/index.js.map +1 -1
  201. package/resources/tasks/index.mjs.map +1 -1
  202. package/resources/tasks/screenshots.d.mts +3 -0
  203. package/resources/tasks/screenshots.d.mts.map +1 -1
  204. package/resources/tasks/screenshots.d.ts +3 -0
  205. package/resources/tasks/screenshots.d.ts.map +1 -1
  206. package/resources/tasks/screenshots.js +3 -0
  207. package/resources/tasks/screenshots.js.map +1 -1
  208. package/resources/tasks/screenshots.mjs +3 -0
  209. package/resources/tasks/screenshots.mjs.map +1 -1
  210. package/resources/tasks/tasks.d.mts +141 -60
  211. package/resources/tasks/tasks.d.mts.map +1 -1
  212. package/resources/tasks/tasks.d.ts +141 -60
  213. package/resources/tasks/tasks.d.ts.map +1 -1
  214. package/resources/tasks/tasks.js +11 -5
  215. package/resources/tasks/tasks.js.map +1 -1
  216. package/resources/tasks/tasks.mjs +11 -5
  217. package/resources/tasks/tasks.mjs.map +1 -1
  218. package/resources/tasks/ui-states.d.mts +3 -0
  219. package/resources/tasks/ui-states.d.mts.map +1 -1
  220. package/resources/tasks/ui-states.d.ts +3 -0
  221. package/resources/tasks/ui-states.d.ts.map +1 -1
  222. package/resources/tasks/ui-states.js +3 -0
  223. package/resources/tasks/ui-states.js.map +1 -1
  224. package/resources/tasks/ui-states.mjs +3 -0
  225. package/resources/tasks/ui-states.mjs.map +1 -1
  226. package/src/client.ts +112 -10
  227. package/src/internal/utils/env.ts +2 -2
  228. package/src/internal/utils/query.ts +7 -0
  229. package/src/internal/utils.ts +1 -0
  230. package/src/resources/agents.ts +45 -0
  231. package/src/resources/apps.ts +11 -19
  232. package/src/resources/carriers.ts +327 -0
  233. package/src/resources/credentials/credentials.ts +4 -19
  234. package/src/resources/devices/actions.ts +84 -0
  235. package/src/resources/devices/apps.ts +5 -0
  236. package/src/resources/devices/devices.ts +171 -50
  237. package/src/resources/devices/esim.ts +201 -0
  238. package/src/resources/devices/files.ts +221 -0
  239. package/src/resources/devices/index.ts +52 -3
  240. package/src/resources/devices/keyboard.ts +12 -2
  241. package/src/resources/devices/location.ts +91 -0
  242. package/src/resources/devices/packages.ts +5 -0
  243. package/src/resources/devices/profile.ts +45 -0
  244. package/src/resources/devices/proxy.ts +173 -0
  245. package/src/resources/devices/state.ts +10 -44
  246. package/src/resources/devices/tasks.ts +2 -15
  247. package/src/resources/devices/time.ts +114 -0
  248. package/src/resources/hooks.ts +5 -36
  249. package/src/resources/index.ts +37 -0
  250. package/src/resources/profiles.ts +133 -0
  251. package/src/resources/proxies.ts +182 -0
  252. package/src/resources/shared.ts +161 -0
  253. package/src/resources/tasks/index.ts +3 -0
  254. package/src/resources/tasks/screenshots.ts +3 -0
  255. package/src/resources/tasks/tasks.ts +191 -68
  256. package/src/resources/tasks/ui-states.ts +3 -0
  257. package/src/version.ts +1 -1
  258. package/version.d.mts +1 -1
  259. package/version.d.ts +1 -1
  260. package/version.js +1 -1
  261. package/version.mjs +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ui-states.mjs","sourceRoot":"","sources":["../../src/resources/tasks/ui-states.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,QAAQ,CACN,KAAa,EACb,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,UAAU,OAAO,cAAc,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,MAAc,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,UAAU,MAAM,YAAY,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;CACF"}
1
+ {"version":3,"file":"ui-states.mjs","sourceRoot":"","sources":["../../src/resources/tasks/ui-states.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,QAAQ,CACN,KAAa,EACb,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,UAAU,OAAO,cAAc,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,MAAc,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,UAAU,MAAM,YAAY,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -11,13 +11,24 @@ import type { APIResponseProps } from './internal/parse';
11
11
  import { getPlatformHeaders } from './internal/detect-platform';
12
12
  import * as Shims from './internal/shims';
13
13
  import * as Opts from './internal/request-options';
14
- import * as qs from './internal/qs';
14
+ import { stringifyQuery } from './internal/utils/query';
15
15
  import { VERSION } from './version';
16
16
  import * as Errors from './core/error';
17
17
  import * as Uploads from './core/uploads';
18
18
  import * as API from './resources/index';
19
19
  import { APIPromise } from './core/api-promise';
20
+ import { AgentListResponse, Agents } from './resources/agents';
20
21
  import { AppListParams, AppListResponse, Apps } from './resources/apps';
22
+ import {
23
+ Carrier,
24
+ CarrierCreateParams,
25
+ CarrierDeleteResponse,
26
+ CarrierListParams,
27
+ CarrierListResponse,
28
+ CarrierLookupParams,
29
+ CarrierUpdateParams,
30
+ Carriers,
31
+ } from './resources/carriers';
21
32
  import {
22
33
  HookGetSampleDataResponse,
23
34
  HookListParams,
@@ -33,6 +44,27 @@ import {
33
44
  Hooks,
34
45
  } from './resources/hooks';
35
46
  import { ModelListResponse, Models } from './resources/models';
47
+ import {
48
+ Profile,
49
+ ProfileCreateParams,
50
+ ProfileDeleteResponse,
51
+ ProfileListParams,
52
+ ProfileListResponse,
53
+ ProfileUpdateParams,
54
+ Profiles,
55
+ } from './resources/profiles';
56
+ import {
57
+ Proxies,
58
+ ProxyConfig,
59
+ ProxyCreateParams,
60
+ ProxyCreateResponse,
61
+ ProxyDeleteResponse,
62
+ ProxyListParams,
63
+ ProxyListResponse,
64
+ ProxyRetrieveResponse,
65
+ ProxyUpdateParams,
66
+ ProxyUpdateResponse,
67
+ } from './resources/proxies';
36
68
  import {
37
69
  CredentialListParams,
38
70
  CredentialListResponse,
@@ -44,6 +76,7 @@ import {
44
76
  DeviceCreateParams,
45
77
  DeviceListParams,
46
78
  DeviceListResponse,
79
+ DeviceSetNameParams,
47
80
  DeviceTerminateParams,
48
81
  Devices,
49
82
  } from './resources/devices/devices';
@@ -58,6 +91,9 @@ import {
58
91
  TaskRunParams,
59
92
  TaskRunResponse,
60
93
  TaskRunStreamedParams,
94
+ TaskRunStreamedResponse,
95
+ TaskSendMessageParams,
96
+ TaskSendMessageResponse,
61
97
  TaskStatus,
62
98
  TaskStopResponse,
63
99
  Tasks,
@@ -262,8 +298,8 @@ export class Mobilerun {
262
298
  return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
263
299
  }
264
300
 
265
- protected stringifyQuery(query: Record<string, unknown>): string {
266
- return qs.stringify(query, { arrayFormat: 'comma' });
301
+ protected stringifyQuery(query: object | Record<string, unknown>): string {
302
+ return stringifyQuery(query);
267
303
  }
268
304
 
269
305
  private getUserAgent(): string {
@@ -295,12 +331,13 @@ export class Mobilerun {
295
331
  : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
296
332
 
297
333
  const defaultQuery = this.defaultQuery();
298
- if (!isEmptyObj(defaultQuery)) {
299
- query = { ...defaultQuery, ...query };
334
+ const pathQuery = Object.fromEntries(url.searchParams);
335
+ if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
336
+ query = { ...pathQuery, ...defaultQuery, ...query };
300
337
  }
301
338
 
302
339
  if (typeof query === 'object' && query && !Array.isArray(query)) {
303
- url.search = this.stringifyQuery(query as Record<string, unknown>);
340
+ url.search = this.stringifyQuery(query);
304
341
  }
305
342
 
306
343
  return url.toString();
@@ -605,9 +642,9 @@ export class Mobilerun {
605
642
  }
606
643
  }
607
644
 
608
- // If the API asks us to wait a certain amount of time (and it's a reasonable amount),
609
- // just do what it says, but otherwise calculate a default
610
- if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
645
+ // If the API asks us to wait a certain amount of time, just do what it
646
+ // says, but otherwise calculate a default
647
+ if (timeoutMillis === undefined) {
611
648
  const maxRetries = options.maxRetries ?? this.maxRetries;
612
649
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
613
650
  }
@@ -739,7 +776,7 @@ export class Mobilerun {
739
776
  ) {
740
777
  return {
741
778
  bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
742
- body: this.stringifyQuery(body as Record<string, unknown>),
779
+ body: this.stringifyQuery(body),
743
780
  };
744
781
  } else {
745
782
  return this.#encoder({ body, headers });
@@ -765,15 +802,32 @@ export class Mobilerun {
765
802
 
766
803
  static toFile = Uploads.toFile;
767
804
 
805
+ /**
806
+ * Tasks API
807
+ */
768
808
  tasks: API.Tasks = new API.Tasks(this);
809
+ /**
810
+ * Agents API
811
+ */
812
+ agents: API.Agents = new API.Agents(this);
813
+ proxies: API.Proxies = new API.Proxies(this);
814
+ carriers: API.Carriers = new API.Carriers(this);
815
+ profiles: API.Profiles = new API.Profiles(this);
769
816
  devices: API.Devices = new API.Devices(this);
770
817
  apps: API.Apps = new API.Apps(this);
771
818
  credentials: API.Credentials = new API.Credentials(this);
819
+ /**
820
+ * Webhooks API
821
+ */
772
822
  hooks: API.Hooks = new API.Hooks(this);
773
823
  models: API.Models = new API.Models(this);
774
824
  }
775
825
 
776
826
  Mobilerun.Tasks = Tasks;
827
+ Mobilerun.Agents = Agents;
828
+ Mobilerun.Proxies = Proxies;
829
+ Mobilerun.Carriers = Carriers;
830
+ Mobilerun.Profiles = Profiles;
777
831
  Mobilerun.Devices = Devices;
778
832
  Mobilerun.Apps = Apps;
779
833
  Mobilerun.Credentials = Credentials;
@@ -794,10 +848,49 @@ export declare namespace Mobilerun {
794
848
  type TaskGetStatusResponse as TaskGetStatusResponse,
795
849
  type TaskGetTrajectoryResponse as TaskGetTrajectoryResponse,
796
850
  type TaskRunResponse as TaskRunResponse,
851
+ type TaskRunStreamedResponse as TaskRunStreamedResponse,
852
+ type TaskSendMessageResponse as TaskSendMessageResponse,
797
853
  type TaskStopResponse as TaskStopResponse,
798
854
  type TaskListParams as TaskListParams,
799
855
  type TaskRunParams as TaskRunParams,
800
856
  type TaskRunStreamedParams as TaskRunStreamedParams,
857
+ type TaskSendMessageParams as TaskSendMessageParams,
858
+ };
859
+
860
+ export { Agents as Agents, type AgentListResponse as AgentListResponse };
861
+
862
+ export {
863
+ Proxies as Proxies,
864
+ type ProxyConfig as ProxyConfig,
865
+ type ProxyCreateResponse as ProxyCreateResponse,
866
+ type ProxyRetrieveResponse as ProxyRetrieveResponse,
867
+ type ProxyUpdateResponse as ProxyUpdateResponse,
868
+ type ProxyListResponse as ProxyListResponse,
869
+ type ProxyDeleteResponse as ProxyDeleteResponse,
870
+ type ProxyCreateParams as ProxyCreateParams,
871
+ type ProxyUpdateParams as ProxyUpdateParams,
872
+ type ProxyListParams as ProxyListParams,
873
+ };
874
+
875
+ export {
876
+ Carriers as Carriers,
877
+ type Carrier as Carrier,
878
+ type CarrierListResponse as CarrierListResponse,
879
+ type CarrierDeleteResponse as CarrierDeleteResponse,
880
+ type CarrierCreateParams as CarrierCreateParams,
881
+ type CarrierUpdateParams as CarrierUpdateParams,
882
+ type CarrierListParams as CarrierListParams,
883
+ type CarrierLookupParams as CarrierLookupParams,
884
+ };
885
+
886
+ export {
887
+ Profiles as Profiles,
888
+ type Profile as Profile,
889
+ type ProfileListResponse as ProfileListResponse,
890
+ type ProfileDeleteResponse as ProfileDeleteResponse,
891
+ type ProfileCreateParams as ProfileCreateParams,
892
+ type ProfileUpdateParams as ProfileUpdateParams,
893
+ type ProfileListParams as ProfileListParams,
801
894
  };
802
895
 
803
896
  export {
@@ -807,6 +900,7 @@ export declare namespace Mobilerun {
807
900
  type DeviceCountResponse as DeviceCountResponse,
808
901
  type DeviceCreateParams as DeviceCreateParams,
809
902
  type DeviceListParams as DeviceListParams,
903
+ type DeviceSetNameParams as DeviceSetNameParams,
810
904
  type DeviceTerminateParams as DeviceTerminateParams,
811
905
  };
812
906
 
@@ -834,4 +928,12 @@ export declare namespace Mobilerun {
834
928
  };
835
929
 
836
930
  export { Models as Models, type ModelListResponse as ModelListResponse };
931
+
932
+ export type DeviceCarrier = API.DeviceCarrier;
933
+ export type DeviceIdentifiers = API.DeviceIdentifiers;
934
+ export type DeviceSpec = API.DeviceSpec;
935
+ export type Meta = API.Meta;
936
+ export type Pagination = API.Pagination;
937
+ export type PaginationMeta = API.PaginationMeta;
938
+ export type PermissionSet = API.PermissionSet;
837
939
  }
@@ -9,10 +9,10 @@
9
9
  */
10
10
  export const readEnv = (env: string): string | undefined => {
11
11
  if (typeof (globalThis as any).process !== 'undefined') {
12
- return (globalThis as any).process.env?.[env]?.trim() ?? undefined;
12
+ return (globalThis as any).process.env?.[env]?.trim() || undefined;
13
13
  }
14
14
  if (typeof (globalThis as any).Deno !== 'undefined') {
15
- return (globalThis as any).Deno.env?.get?.(env)?.trim();
15
+ return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
16
16
  }
17
17
  return undefined;
18
18
  };
@@ -0,0 +1,7 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import * as qs from '../qs/stringify';
4
+
5
+ export function stringifyQuery(query: object | Record<string, unknown>) {
6
+ return qs.stringify(query, { arrayFormat: 'comma' });
7
+ }
@@ -6,3 +6,4 @@ export * from './utils/env';
6
6
  export * from './utils/log';
7
7
  export * from './utils/uuid';
8
8
  export * from './utils/sleep';
9
+ export * from './utils/query';
@@ -0,0 +1,45 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+
7
+ /**
8
+ * Agents API
9
+ */
10
+ export class Agents extends APIResource {
11
+ /**
12
+ * List all available agents with their default configurations.
13
+ */
14
+ list(options?: RequestOptions): APIPromise<AgentListResponse> {
15
+ return this._client.get('/agents', options);
16
+ }
17
+ }
18
+
19
+ export type AgentListResponse = Array<AgentListResponse.AgentListResponseItem>;
20
+
21
+ export namespace AgentListResponse {
22
+ export interface AgentListResponseItem {
23
+ id: number;
24
+
25
+ description: string | null;
26
+
27
+ icon: string;
28
+
29
+ llmModel: string;
30
+
31
+ maxSteps: number;
32
+
33
+ name: string;
34
+
35
+ reasoning: boolean;
36
+
37
+ subagentModel: string | null;
38
+
39
+ vision: boolean;
40
+ }
41
+ }
42
+
43
+ export declare namespace Agents {
44
+ export { type AgentListResponse as AgentListResponse };
45
+ }
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
+ import * as Shared from './shared';
4
5
  import { APIPromise } from '../core/api-promise';
5
6
  import { RequestOptions } from '../internal/request-options';
6
7
 
@@ -18,7 +19,7 @@ export interface AppListResponse {
18
19
 
19
20
  items: Array<AppListResponse.Item>;
20
21
 
21
- pagination: AppListResponse.Pagination;
22
+ pagination: Shared.Pagination;
22
23
  }
23
24
 
24
25
  export namespace AppListResponse {
@@ -291,8 +292,7 @@ export namespace AppListResponse {
291
292
  | 'YE'
292
293
  | 'ZM'
293
294
  | 'ZW'
294
- | 'AX'
295
- | null;
295
+ | 'AX';
296
296
 
297
297
  createdAt: string | null;
298
298
 
@@ -302,7 +302,7 @@ export namespace AppListResponse {
302
302
 
303
303
  displayName: string;
304
304
 
305
- externalIds: Array<string> | null;
305
+ expectedFiles: string | number | boolean | { [key: string]: unknown } | Array<unknown> | null;
306
306
 
307
307
  iconURL: string;
308
308
 
@@ -320,30 +320,22 @@ export namespace AppListResponse {
320
320
 
321
321
  source: 'uploaded' | 'store';
322
322
 
323
+ status: 'queued' | 'available' | 'failed';
324
+
325
+ stealthTier: 'tier1' | 'tier2' | 'tier3' | null;
326
+
323
327
  targetSdk: number | null;
324
328
 
329
+ type: 'android' | 'ios';
330
+
325
331
  updatedAt: string | null;
326
332
 
327
333
  userId: string | null;
328
334
 
329
- versionCode: number | null;
335
+ versionCode: number;
330
336
 
331
337
  versionName: string;
332
338
  }
333
-
334
- export interface Pagination {
335
- hasNext: boolean;
336
-
337
- hasPrev: boolean;
338
-
339
- page: number;
340
-
341
- pages: number;
342
-
343
- pageSize: number;
344
-
345
- total: number;
346
- }
347
339
  }
348
340
 
349
341
  export interface AppListParams {
@@ -0,0 +1,327 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as Shared from './shared';
5
+ import { APIPromise } from '../core/api-promise';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class Carriers extends APIResource {
10
+ /**
11
+ * Create a new carrier
12
+ */
13
+ create(body: CarrierCreateParams, options?: RequestOptions): APIPromise<Carrier> {
14
+ return this._client.post('/carriers', { body, ...options });
15
+ }
16
+
17
+ /**
18
+ * Get carrier by ID
19
+ */
20
+ retrieve(carrierID: number, options?: RequestOptions): APIPromise<Carrier> {
21
+ return this._client.get(path`/carriers/${carrierID}`, options);
22
+ }
23
+
24
+ /**
25
+ * Update a carrier
26
+ */
27
+ update(carrierID: number, body: CarrierUpdateParams, options?: RequestOptions): APIPromise<Carrier> {
28
+ return this._client.patch(path`/carriers/${carrierID}`, { body, ...options });
29
+ }
30
+
31
+ /**
32
+ * List carriers with pagination
33
+ */
34
+ list(
35
+ query: CarrierListParams | null | undefined = {},
36
+ options?: RequestOptions,
37
+ ): APIPromise<CarrierListResponse> {
38
+ return this._client.get('/carriers', { query, ...options });
39
+ }
40
+
41
+ /**
42
+ * Delete a carrier
43
+ */
44
+ delete(carrierID: number, options?: RequestOptions): APIPromise<CarrierDeleteResponse> {
45
+ return this._client.delete(path`/carriers/${carrierID}`, options);
46
+ }
47
+
48
+ /**
49
+ * Get carrier by MCC and MNC
50
+ */
51
+ lookup(query: CarrierLookupParams, options?: RequestOptions): APIPromise<Carrier> {
52
+ return this._client.get('/carriers/lookup', { query, ...options });
53
+ }
54
+ }
55
+
56
+ export interface Carrier {
57
+ id: number;
58
+
59
+ company: string;
60
+
61
+ country: string;
62
+
63
+ country_code: string;
64
+
65
+ country_iso: string;
66
+
67
+ created_at: string;
68
+
69
+ detail_url: string;
70
+
71
+ gsm_bands: string;
72
+
73
+ lte_bands: string;
74
+
75
+ mcc: string;
76
+
77
+ mnc: string;
78
+
79
+ mobile_prefix: string;
80
+
81
+ nsn_size: string;
82
+
83
+ number_format: string;
84
+
85
+ operator: string;
86
+
87
+ protocols: string;
88
+
89
+ umts_bands: string;
90
+
91
+ website: string;
92
+
93
+ /**
94
+ * A URL to the JSON Schema for this object.
95
+ */
96
+ $schema?: string;
97
+ }
98
+
99
+ export interface CarrierListResponse {
100
+ items: Array<Carrier> | null;
101
+
102
+ pagination: Shared.Meta;
103
+
104
+ /**
105
+ * A URL to the JSON Schema for this object.
106
+ */
107
+ $schema?: string;
108
+ }
109
+
110
+ export interface CarrierDeleteResponse {
111
+ message: string;
112
+
113
+ /**
114
+ * A URL to the JSON Schema for this object.
115
+ */
116
+ $schema?: string;
117
+ }
118
+
119
+ export interface CarrierCreateParams {
120
+ /**
121
+ * Country name
122
+ */
123
+ country: string;
124
+
125
+ /**
126
+ * Mobile Country Code
127
+ */
128
+ mcc: string;
129
+
130
+ /**
131
+ * Mobile Network Code
132
+ */
133
+ mnc: string;
134
+
135
+ /**
136
+ * Operator name
137
+ */
138
+ operator: string;
139
+
140
+ /**
141
+ * Company name
142
+ */
143
+ company?: string;
144
+
145
+ /**
146
+ * Country dialing code (e.g., +1)
147
+ */
148
+ country_code?: string;
149
+
150
+ /**
151
+ * ISO country code
152
+ */
153
+ country_iso?: string;
154
+
155
+ /**
156
+ * URL to carrier details page
157
+ */
158
+ detail_url?: string;
159
+
160
+ /**
161
+ * Supported GSM bands
162
+ */
163
+ gsm_bands?: string;
164
+
165
+ /**
166
+ * Supported LTE bands
167
+ */
168
+ lte_bands?: string;
169
+
170
+ /**
171
+ * Mobile number prefix
172
+ */
173
+ mobile_prefix?: string;
174
+
175
+ /**
176
+ * National Significant Number size
177
+ */
178
+ nsn_size?: string;
179
+
180
+ /**
181
+ * Phone number format
182
+ */
183
+ number_format?: string;
184
+
185
+ /**
186
+ * Supported protocols (comma-separated)
187
+ */
188
+ protocols?: string;
189
+
190
+ /**
191
+ * Supported UMTS bands
192
+ */
193
+ umts_bands?: string;
194
+
195
+ /**
196
+ * Company website
197
+ */
198
+ website?: string;
199
+ }
200
+
201
+ export interface CarrierUpdateParams {
202
+ /**
203
+ * Company name
204
+ */
205
+ company?: string;
206
+
207
+ /**
208
+ * Country name
209
+ */
210
+ country?: string;
211
+
212
+ /**
213
+ * Country dialing code
214
+ */
215
+ country_code?: string;
216
+
217
+ /**
218
+ * ISO country code
219
+ */
220
+ country_iso?: string;
221
+
222
+ /**
223
+ * URL to carrier details
224
+ */
225
+ detail_url?: string;
226
+
227
+ /**
228
+ * Supported GSM bands
229
+ */
230
+ gsm_bands?: string;
231
+
232
+ /**
233
+ * Supported LTE bands
234
+ */
235
+ lte_bands?: string;
236
+
237
+ /**
238
+ * Mobile number prefix
239
+ */
240
+ mobile_prefix?: string;
241
+
242
+ /**
243
+ * NSN size
244
+ */
245
+ nsn_size?: string;
246
+
247
+ /**
248
+ * Phone number format
249
+ */
250
+ number_format?: string;
251
+
252
+ /**
253
+ * Operator name
254
+ */
255
+ operator?: string;
256
+
257
+ /**
258
+ * Supported protocols
259
+ */
260
+ protocols?: string;
261
+
262
+ /**
263
+ * Supported UMTS bands
264
+ */
265
+ umts_bands?: string;
266
+
267
+ /**
268
+ * Company website
269
+ */
270
+ website?: string;
271
+ }
272
+
273
+ export interface CarrierListParams {
274
+ /**
275
+ * Filter by country name
276
+ */
277
+ country?: string;
278
+
279
+ /**
280
+ * Filter by country ISO code
281
+ */
282
+ countryISO?: string;
283
+
284
+ /**
285
+ * Field to order by
286
+ */
287
+ orderBy?: 'id' | 'mcc' | 'mnc' | 'operator' | 'country' | 'country_iso';
288
+
289
+ /**
290
+ * Order direction
291
+ */
292
+ orderDir?: 'asc' | 'desc';
293
+
294
+ /**
295
+ * Page number
296
+ */
297
+ page?: number;
298
+
299
+ /**
300
+ * Items per page
301
+ */
302
+ pageSize?: number;
303
+ }
304
+
305
+ export interface CarrierLookupParams {
306
+ /**
307
+ * Mobile Country Code
308
+ */
309
+ mcc: string;
310
+
311
+ /**
312
+ * Mobile Network Code
313
+ */
314
+ mnc: string;
315
+ }
316
+
317
+ export declare namespace Carriers {
318
+ export {
319
+ type Carrier as Carrier,
320
+ type CarrierListResponse as CarrierListResponse,
321
+ type CarrierDeleteResponse as CarrierDeleteResponse,
322
+ type CarrierCreateParams as CarrierCreateParams,
323
+ type CarrierUpdateParams as CarrierUpdateParams,
324
+ type CarrierListParams as CarrierListParams,
325
+ type CarrierLookupParams as CarrierLookupParams,
326
+ };
327
+ }