@mobilerun/sdk 1.0.0 → 2.1.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 (230) hide show
  1. package/CHANGELOG.md +142 -0
  2. package/LICENSE +1 -1
  3. package/README.md +9 -0
  4. package/client.d.mts +13 -9
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +13 -9
  7. package/client.d.ts.map +1 -1
  8. package/client.js +23 -17
  9. package/client.js.map +1 -1
  10. package/client.mjs +24 -18
  11. package/client.mjs.map +1 -1
  12. package/internal/parse.d.mts.map +1 -1
  13. package/internal/parse.d.ts.map +1 -1
  14. package/internal/parse.js +5 -0
  15. package/internal/parse.js.map +1 -1
  16. package/internal/parse.mjs +5 -0
  17. package/internal/parse.mjs.map +1 -1
  18. package/internal/qs/formats.d.mts +7 -0
  19. package/internal/qs/formats.d.mts.map +1 -0
  20. package/internal/qs/formats.d.ts +7 -0
  21. package/internal/qs/formats.d.ts.map +1 -0
  22. package/internal/qs/formats.js +13 -0
  23. package/internal/qs/formats.js.map +1 -0
  24. package/internal/qs/formats.mjs +9 -0
  25. package/internal/qs/formats.mjs.map +1 -0
  26. package/internal/qs/index.d.mts +10 -0
  27. package/internal/qs/index.d.mts.map +1 -0
  28. package/internal/qs/index.d.ts +10 -0
  29. package/internal/qs/index.d.ts.map +1 -0
  30. package/internal/qs/index.js +14 -0
  31. package/internal/qs/index.js.map +1 -0
  32. package/internal/qs/index.mjs +10 -0
  33. package/internal/qs/index.mjs.map +1 -0
  34. package/internal/qs/stringify.d.mts +3 -0
  35. package/internal/qs/stringify.d.mts.map +1 -0
  36. package/internal/qs/stringify.d.ts +3 -0
  37. package/internal/qs/stringify.d.ts.map +1 -0
  38. package/internal/qs/stringify.js +277 -0
  39. package/internal/qs/stringify.js.map +1 -0
  40. package/internal/qs/stringify.mjs +274 -0
  41. package/internal/qs/stringify.mjs.map +1 -0
  42. package/internal/qs/types.d.mts +57 -0
  43. package/internal/qs/types.d.mts.map +1 -0
  44. package/internal/qs/types.d.ts +57 -0
  45. package/internal/qs/types.d.ts.map +1 -0
  46. package/internal/qs/types.js +3 -0
  47. package/internal/qs/types.js.map +1 -0
  48. package/internal/qs/types.mjs +2 -0
  49. package/internal/qs/types.mjs.map +1 -0
  50. package/internal/qs/utils.d.mts +15 -0
  51. package/internal/qs/utils.d.mts.map +1 -0
  52. package/internal/qs/utils.d.ts +15 -0
  53. package/internal/qs/utils.d.ts.map +1 -0
  54. package/internal/qs/utils.js +230 -0
  55. package/internal/qs/utils.js.map +1 -0
  56. package/internal/qs/utils.mjs +217 -0
  57. package/internal/qs/utils.mjs.map +1 -0
  58. package/package.json +1 -1
  59. package/resources/apps.d.mts +20 -7
  60. package/resources/apps.d.mts.map +1 -1
  61. package/resources/apps.d.ts +20 -7
  62. package/resources/apps.d.ts.map +1 -1
  63. package/resources/credentials/credentials.d.mts +18 -3
  64. package/resources/credentials/credentials.d.mts.map +1 -1
  65. package/resources/credentials/credentials.d.ts +18 -3
  66. package/resources/credentials/credentials.d.ts.map +1 -1
  67. package/resources/credentials/credentials.js +2 -2
  68. package/resources/credentials/credentials.js.map +1 -1
  69. package/resources/credentials/credentials.mjs +2 -2
  70. package/resources/credentials/credentials.mjs.map +1 -1
  71. package/resources/credentials/index.d.mts +1 -1
  72. package/resources/credentials/index.d.mts.map +1 -1
  73. package/resources/credentials/index.d.ts +1 -1
  74. package/resources/credentials/index.d.ts.map +1 -1
  75. package/resources/credentials/index.js.map +1 -1
  76. package/resources/credentials/index.mjs.map +1 -1
  77. package/resources/credentials/packages/credentials/fields.d.mts +6 -6
  78. package/resources/credentials/packages/credentials/fields.d.ts +6 -6
  79. package/resources/devices/actions.d.mts +71 -0
  80. package/resources/devices/actions.d.mts.map +1 -0
  81. package/resources/devices/actions.d.ts +71 -0
  82. package/resources/devices/actions.d.ts.map +1 -0
  83. package/resources/devices/actions.js +68 -0
  84. package/resources/devices/actions.js.map +1 -0
  85. package/resources/devices/actions.mjs +64 -0
  86. package/resources/devices/actions.mjs.map +1 -0
  87. package/resources/devices/apps.d.mts +93 -0
  88. package/resources/devices/apps.d.mts.map +1 -0
  89. package/resources/devices/apps.d.ts +93 -0
  90. package/resources/devices/apps.d.ts.map +1 -0
  91. package/resources/devices/apps.js +105 -0
  92. package/resources/devices/apps.js.map +1 -0
  93. package/resources/devices/apps.mjs +101 -0
  94. package/resources/devices/apps.mjs.map +1 -0
  95. package/resources/devices/devices.d.mts +154 -0
  96. package/resources/devices/devices.d.mts.map +1 -0
  97. package/resources/devices/devices.d.ts +154 -0
  98. package/resources/devices/devices.d.ts.map +1 -0
  99. package/resources/devices/devices.js +80 -0
  100. package/resources/devices/devices.js.map +1 -0
  101. package/resources/devices/devices.mjs +75 -0
  102. package/resources/devices/devices.mjs.map +1 -0
  103. package/resources/devices/index.d.mts +8 -0
  104. package/resources/devices/index.d.mts.map +1 -0
  105. package/resources/devices/index.d.ts +8 -0
  106. package/resources/devices/index.d.ts.map +1 -0
  107. package/resources/devices/index.js +19 -0
  108. package/resources/devices/index.js.map +1 -0
  109. package/resources/devices/index.mjs +9 -0
  110. package/resources/devices/index.mjs.map +1 -0
  111. package/resources/devices/keyboard.d.mts +48 -0
  112. package/resources/devices/keyboard.d.mts.map +1 -0
  113. package/resources/devices/keyboard.d.ts +48 -0
  114. package/resources/devices/keyboard.d.ts.map +1 -0
  115. package/resources/devices/keyboard.js +67 -0
  116. package/resources/devices/keyboard.js.map +1 -0
  117. package/resources/devices/keyboard.mjs +63 -0
  118. package/resources/devices/keyboard.mjs.map +1 -0
  119. package/resources/devices/packages.d.mts +24 -0
  120. package/resources/devices/packages.d.mts.map +1 -0
  121. package/resources/devices/packages.d.ts +24 -0
  122. package/resources/devices/packages.d.ts.map +1 -0
  123. package/resources/devices/packages.js +29 -0
  124. package/resources/devices/packages.js.map +1 -0
  125. package/resources/devices/packages.mjs +25 -0
  126. package/resources/devices/packages.mjs.map +1 -0
  127. package/resources/devices/state.d.mts +99 -0
  128. package/resources/devices/state.d.mts.map +1 -0
  129. package/resources/devices/state.d.ts +99 -0
  130. package/resources/devices/state.d.ts.map +1 -0
  131. package/resources/devices/state.js +64 -0
  132. package/resources/devices/state.js.map +1 -0
  133. package/resources/devices/state.mjs +60 -0
  134. package/resources/devices/state.mjs.map +1 -0
  135. package/resources/devices/tasks.d.mts +42 -0
  136. package/resources/devices/tasks.d.mts.map +1 -0
  137. package/resources/devices/tasks.d.ts +42 -0
  138. package/resources/devices/tasks.d.ts.map +1 -0
  139. package/resources/devices/tasks.js +16 -0
  140. package/resources/devices/tasks.js.map +1 -0
  141. package/resources/devices/tasks.mjs +12 -0
  142. package/resources/devices/tasks.mjs.map +1 -0
  143. package/resources/devices.d.mts +2 -0
  144. package/resources/devices.d.mts.map +1 -0
  145. package/resources/devices.d.ts +2 -0
  146. package/resources/devices.d.ts.map +1 -0
  147. package/resources/devices.js +6 -0
  148. package/resources/devices.js.map +1 -0
  149. package/resources/devices.mjs +3 -0
  150. package/resources/devices.mjs.map +1 -0
  151. package/resources/hooks.d.mts +22 -3
  152. package/resources/hooks.d.mts.map +1 -1
  153. package/resources/hooks.d.ts +22 -3
  154. package/resources/hooks.d.ts.map +1 -1
  155. package/resources/hooks.js +11 -4
  156. package/resources/hooks.js.map +1 -1
  157. package/resources/hooks.mjs +11 -4
  158. package/resources/hooks.mjs.map +1 -1
  159. package/resources/index.d.mts +5 -3
  160. package/resources/index.d.mts.map +1 -1
  161. package/resources/index.d.ts +5 -3
  162. package/resources/index.d.ts.map +1 -1
  163. package/resources/index.js +5 -1
  164. package/resources/index.js.map +1 -1
  165. package/resources/index.mjs +3 -1
  166. package/resources/index.mjs.map +1 -1
  167. package/resources/models.d.mts +28 -0
  168. package/resources/models.d.mts.map +1 -0
  169. package/resources/models.d.ts +28 -0
  170. package/resources/models.d.ts.map +1 -0
  171. package/resources/models.js +15 -0
  172. package/resources/models.js.map +1 -0
  173. package/resources/models.mjs +11 -0
  174. package/resources/models.mjs.map +1 -0
  175. package/resources/tasks/index.d.mts +1 -1
  176. package/resources/tasks/index.d.mts.map +1 -1
  177. package/resources/tasks/index.d.ts +1 -1
  178. package/resources/tasks/index.d.ts.map +1 -1
  179. package/resources/tasks/index.js.map +1 -1
  180. package/resources/tasks/index.mjs.map +1 -1
  181. package/resources/tasks/screenshots.d.mts +2 -2
  182. package/resources/tasks/screenshots.d.ts +2 -2
  183. package/resources/tasks/screenshots.js +2 -2
  184. package/resources/tasks/screenshots.mjs +2 -2
  185. package/resources/tasks/tasks.d.mts +158 -424
  186. package/resources/tasks/tasks.d.mts.map +1 -1
  187. package/resources/tasks/tasks.d.ts +158 -424
  188. package/resources/tasks/tasks.d.ts.map +1 -1
  189. package/resources/tasks/tasks.js +12 -10
  190. package/resources/tasks/tasks.js.map +1 -1
  191. package/resources/tasks/tasks.mjs +12 -10
  192. package/resources/tasks/tasks.mjs.map +1 -1
  193. package/resources/tasks/ui-states.d.mts +2 -2
  194. package/resources/tasks/ui-states.d.ts +2 -2
  195. package/resources/tasks/ui-states.js +2 -2
  196. package/resources/tasks/ui-states.mjs +2 -2
  197. package/src/client.ts +60 -26
  198. package/src/internal/parse.ts +6 -0
  199. package/src/internal/qs/LICENSE.md +13 -0
  200. package/src/internal/qs/README.md +3 -0
  201. package/src/internal/qs/formats.ts +10 -0
  202. package/src/internal/qs/index.ts +13 -0
  203. package/src/internal/qs/stringify.ts +385 -0
  204. package/src/internal/qs/types.ts +71 -0
  205. package/src/internal/qs/utils.ts +265 -0
  206. package/src/resources/apps.ts +31 -9
  207. package/src/resources/credentials/credentials.ts +34 -4
  208. package/src/resources/credentials/index.ts +1 -1
  209. package/src/resources/credentials/packages/credentials/fields.ts +6 -6
  210. package/src/resources/devices/actions.ts +138 -0
  211. package/src/resources/devices/apps.ts +204 -0
  212. package/src/resources/devices/devices.ts +303 -0
  213. package/src/resources/devices/index.ts +38 -0
  214. package/src/resources/devices/keyboard.ts +113 -0
  215. package/src/resources/devices/packages.ts +50 -0
  216. package/src/resources/devices/state.ts +201 -0
  217. package/src/resources/devices/tasks.ts +68 -0
  218. package/src/resources/devices.ts +3 -0
  219. package/src/resources/hooks.ts +36 -4
  220. package/src/resources/index.ts +17 -3
  221. package/src/resources/models.ts +39 -0
  222. package/src/resources/tasks/index.ts +0 -2
  223. package/src/resources/tasks/screenshots.ts +2 -2
  224. package/src/resources/tasks/tasks.ts +176 -554
  225. package/src/resources/tasks/ui-states.ts +2 -2
  226. package/src/version.ts +1 -1
  227. package/version.d.mts +1 -1
  228. package/version.d.ts +1 -1
  229. package/version.js +1 -1
  230. package/version.mjs +1 -1
@@ -0,0 +1,204 @@
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 { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ export class Apps extends APIResource {
10
+ /**
11
+ * Stop app
12
+ */
13
+ update(packageName: string, params: AppUpdateParams, options?: RequestOptions): APIPromise<void> {
14
+ const { deviceId, 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
15
+ return this._client.patch(path`/devices/${deviceId}/apps/${packageName}`, {
16
+ body,
17
+ ...options,
18
+ headers: buildHeaders([
19
+ {
20
+ Accept: '*/*',
21
+ ...(xDeviceDisplayID?.toString() != null ?
22
+ { 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
23
+ : undefined),
24
+ },
25
+ options?.headers,
26
+ ]),
27
+ });
28
+ }
29
+
30
+ /**
31
+ * List apps
32
+ */
33
+ list(
34
+ deviceID: string,
35
+ params: AppListParams | null | undefined = {},
36
+ options?: RequestOptions,
37
+ ): APIPromise<AppListResponse | null> {
38
+ const { 'X-Device-Display-ID': xDeviceDisplayID, ...query } = params ?? {};
39
+ return this._client.get(path`/devices/${deviceID}/apps`, {
40
+ query,
41
+ ...options,
42
+ headers: buildHeaders([
43
+ {
44
+ ...(xDeviceDisplayID?.toString() != null ?
45
+ { 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
46
+ : undefined),
47
+ },
48
+ options?.headers,
49
+ ]),
50
+ });
51
+ }
52
+
53
+ /**
54
+ * Delete app
55
+ */
56
+ delete(packageName: string, params: AppDeleteParams, options?: RequestOptions): APIPromise<void> {
57
+ const { deviceId, 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
58
+ return this._client.delete(path`/devices/${deviceId}/apps/${packageName}`, {
59
+ body,
60
+ ...options,
61
+ headers: buildHeaders([
62
+ {
63
+ Accept: '*/*',
64
+ ...(xDeviceDisplayID?.toString() != null ?
65
+ { 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
66
+ : undefined),
67
+ },
68
+ options?.headers,
69
+ ]),
70
+ });
71
+ }
72
+
73
+ /**
74
+ * Install app
75
+ */
76
+ install(deviceID: string, params: AppInstallParams, options?: RequestOptions): APIPromise<void> {
77
+ const { 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
78
+ return this._client.post(path`/devices/${deviceID}/apps`, {
79
+ body,
80
+ ...options,
81
+ headers: buildHeaders([
82
+ {
83
+ Accept: '*/*',
84
+ ...(xDeviceDisplayID?.toString() != null ?
85
+ { 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
86
+ : undefined),
87
+ },
88
+ options?.headers,
89
+ ]),
90
+ });
91
+ }
92
+
93
+ /**
94
+ * Start app
95
+ */
96
+ start(packageName: string, params: AppStartParams, options?: RequestOptions): APIPromise<void> {
97
+ const { deviceId, 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
98
+ return this._client.put(path`/devices/${deviceId}/apps/${packageName}`, {
99
+ body,
100
+ ...options,
101
+ headers: buildHeaders([
102
+ {
103
+ Accept: '*/*',
104
+ ...(xDeviceDisplayID?.toString() != null ?
105
+ { 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
106
+ : undefined),
107
+ },
108
+ options?.headers,
109
+ ]),
110
+ });
111
+ }
112
+ }
113
+
114
+ export type AppListResponse = Array<AppListResponse.AppListResponseItem>;
115
+
116
+ export namespace AppListResponse {
117
+ export interface AppListResponseItem {
118
+ isSystemApp: boolean;
119
+
120
+ label: string;
121
+
122
+ packageName: string;
123
+
124
+ versionCode: number;
125
+
126
+ versionName: string;
127
+ }
128
+ }
129
+
130
+ export interface AppUpdateParams {
131
+ /**
132
+ * Path param
133
+ */
134
+ deviceId: string;
135
+
136
+ /**
137
+ * Header param
138
+ */
139
+ 'X-Device-Display-ID'?: number;
140
+ }
141
+
142
+ export interface AppListParams {
143
+ /**
144
+ * Query param
145
+ */
146
+ includeSystemApps?: boolean;
147
+
148
+ /**
149
+ * Header param
150
+ */
151
+ 'X-Device-Display-ID'?: number;
152
+ }
153
+
154
+ export interface AppDeleteParams {
155
+ /**
156
+ * Path param
157
+ */
158
+ deviceId: string;
159
+
160
+ /**
161
+ * Header param
162
+ */
163
+ 'X-Device-Display-ID'?: number;
164
+ }
165
+
166
+ export interface AppInstallParams {
167
+ /**
168
+ * Body param
169
+ */
170
+ packageName: string;
171
+
172
+ /**
173
+ * Header param
174
+ */
175
+ 'X-Device-Display-ID'?: number;
176
+ }
177
+
178
+ export interface AppStartParams {
179
+ /**
180
+ * Path param
181
+ */
182
+ deviceId: string;
183
+
184
+ /**
185
+ * Body param
186
+ */
187
+ activity?: string;
188
+
189
+ /**
190
+ * Header param
191
+ */
192
+ 'X-Device-Display-ID'?: number;
193
+ }
194
+
195
+ export declare namespace Apps {
196
+ export {
197
+ type AppListResponse as AppListResponse,
198
+ type AppUpdateParams as AppUpdateParams,
199
+ type AppListParams as AppListParams,
200
+ type AppDeleteParams as AppDeleteParams,
201
+ type AppInstallParams as AppInstallParams,
202
+ type AppStartParams as AppStartParams,
203
+ };
204
+ }
@@ -0,0 +1,303 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as ActionsAPI from './actions';
5
+ import { ActionGlobalParams, ActionSwipeParams, ActionTapParams, Actions } from './actions';
6
+ import * as AppsAPI from './apps';
7
+ import {
8
+ AppDeleteParams,
9
+ AppInstallParams,
10
+ AppListParams,
11
+ AppListResponse,
12
+ AppStartParams,
13
+ AppUpdateParams,
14
+ Apps,
15
+ } from './apps';
16
+ import * as KeyboardAPI from './keyboard';
17
+ import { Keyboard, KeyboardClearParams, KeyboardKeyParams, KeyboardWriteParams } from './keyboard';
18
+ import * as PackagesAPI from './packages';
19
+ import { PackageListParams, PackageListResponse, Packages } from './packages';
20
+ import * as StateAPI from './state';
21
+ import {
22
+ State,
23
+ StateScreenshotParams,
24
+ StateScreenshotResponse,
25
+ StateTimeParams,
26
+ StateTimeResponse,
27
+ StateUiParams,
28
+ StateUiResponse,
29
+ } from './state';
30
+ import * as TasksAPI from './tasks';
31
+ import { TaskListParams, TaskListResponse, Tasks } from './tasks';
32
+ import { APIPromise } from '../../core/api-promise';
33
+ import { buildHeaders } from '../../internal/headers';
34
+ import { RequestOptions } from '../../internal/request-options';
35
+ import { path } from '../../internal/utils/path';
36
+
37
+ export class Devices extends APIResource {
38
+ actions: ActionsAPI.Actions = new ActionsAPI.Actions(this._client);
39
+ state: StateAPI.State = new StateAPI.State(this._client);
40
+ apps: AppsAPI.Apps = new AppsAPI.Apps(this._client);
41
+ packages: PackagesAPI.Packages = new PackagesAPI.Packages(this._client);
42
+ keyboard: KeyboardAPI.Keyboard = new KeyboardAPI.Keyboard(this._client);
43
+ tasks: TasksAPI.Tasks = new TasksAPI.Tasks(this._client);
44
+
45
+ /**
46
+ * Provision a new device
47
+ */
48
+ create(params: DeviceCreateParams, options?: RequestOptions): APIPromise<Device> {
49
+ const { deviceType, provider, ...body } = params;
50
+ return this._client.post('/devices', { query: { deviceType, provider }, body, ...options });
51
+ }
52
+
53
+ /**
54
+ * Get device info
55
+ */
56
+ retrieve(deviceID: string, options?: RequestOptions): APIPromise<Device> {
57
+ return this._client.get(path`/devices/${deviceID}`, options);
58
+ }
59
+
60
+ /**
61
+ * List devices
62
+ */
63
+ list(
64
+ query: DeviceListParams | null | undefined = {},
65
+ options?: RequestOptions,
66
+ ): APIPromise<DeviceListResponse> {
67
+ return this._client.get('/devices', { query, ...options });
68
+ }
69
+
70
+ /**
71
+ * Count claimed devices
72
+ */
73
+ count(options?: RequestOptions): APIPromise<DeviceCountResponse> {
74
+ return this._client.get('/devices/count', options);
75
+ }
76
+
77
+ /**
78
+ * Terminate a device
79
+ */
80
+ terminate(deviceID: string, body: DeviceTerminateParams, options?: RequestOptions): APIPromise<void> {
81
+ return this._client.delete(path`/devices/${deviceID}`, {
82
+ body,
83
+ ...options,
84
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
85
+ });
86
+ }
87
+
88
+ /**
89
+ * Wait for device to be ready
90
+ */
91
+ waitReady(deviceID: string, options?: RequestOptions): APIPromise<Device> {
92
+ return this._client.get(path`/devices/${deviceID}/wait`, options);
93
+ }
94
+ }
95
+
96
+ export interface Device {
97
+ id: string;
98
+
99
+ apps: Array<string> | null;
100
+
101
+ assignedAt: string | null;
102
+
103
+ country: string;
104
+
105
+ createdAt: string;
106
+
107
+ deviceType: string;
108
+
109
+ files: Array<string> | null;
110
+
111
+ name: string;
112
+
113
+ provider: string;
114
+
115
+ state: string;
116
+
117
+ stateMessage: string;
118
+
119
+ streamToken: string;
120
+
121
+ streamUrl: string;
122
+
123
+ taskCount: number;
124
+
125
+ terminatesAt: string | null;
126
+
127
+ updatedAt: string;
128
+
129
+ /**
130
+ * A URL to the JSON Schema for this object.
131
+ */
132
+ $schema?: string;
133
+
134
+ userId?: string;
135
+ }
136
+
137
+ export interface DeviceListResponse {
138
+ items: Array<Device> | null;
139
+
140
+ pagination: DeviceListResponse.Pagination;
141
+
142
+ /**
143
+ * A URL to the JSON Schema for this object.
144
+ */
145
+ $schema?: string;
146
+ }
147
+
148
+ export namespace DeviceListResponse {
149
+ export interface Pagination {
150
+ hasNext: boolean;
151
+
152
+ hasPrev: boolean;
153
+
154
+ page: number;
155
+
156
+ pages: number;
157
+
158
+ pageSize: number;
159
+
160
+ total: number;
161
+ }
162
+ }
163
+
164
+ export type DeviceCountResponse = { [key: string]: number };
165
+
166
+ export interface DeviceCreateParams {
167
+ /**
168
+ * Query param
169
+ */
170
+ deviceType?:
171
+ | 'device_slot'
172
+ | 'dedicated_emulated_device'
173
+ | 'dedicated_physical_device'
174
+ | 'dedicated_premium_device';
175
+
176
+ /**
177
+ * Query param
178
+ */
179
+ provider?: 'limrun' | 'physical' | 'premium' | 'roidrun';
180
+
181
+ /**
182
+ * Body param
183
+ */
184
+ apps?: Array<string> | null;
185
+
186
+ /**
187
+ * Body param
188
+ */
189
+ country?: string;
190
+
191
+ /**
192
+ * Body param
193
+ */
194
+ files?: Array<string> | null;
195
+
196
+ /**
197
+ * Body param
198
+ */
199
+ name?: string;
200
+
201
+ /**
202
+ * Body param
203
+ */
204
+ proxy?: DeviceCreateParams.Proxy;
205
+ }
206
+
207
+ export namespace DeviceCreateParams {
208
+ export interface Proxy {
209
+ host: string;
210
+
211
+ password: string;
212
+
213
+ port: number;
214
+
215
+ user: string;
216
+ }
217
+ }
218
+
219
+ export interface DeviceListParams {
220
+ country?: string;
221
+
222
+ name?: string;
223
+
224
+ orderBy?: 'id' | 'createdAt' | 'updatedAt' | 'assignedAt';
225
+
226
+ orderByDirection?: 'asc' | 'desc';
227
+
228
+ page?: number;
229
+
230
+ pageSize?: number;
231
+
232
+ provider?: 'limrun' | 'personal' | 'remote' | 'roidrun';
233
+
234
+ state?: Array<'creating' | 'assigned' | 'ready' | 'disconnected' | 'terminated' | 'unknown'> | null;
235
+
236
+ type?: 'device_slot' | 'dedicated_emulated_device' | 'dedicated_physical_device';
237
+ }
238
+
239
+ export interface DeviceTerminateParams {
240
+ previousDeviceId?: string;
241
+
242
+ terminateAt?: string;
243
+ }
244
+
245
+ Devices.Actions = Actions;
246
+ Devices.State = State;
247
+ Devices.Apps = Apps;
248
+ Devices.Packages = Packages;
249
+ Devices.Keyboard = Keyboard;
250
+ Devices.Tasks = Tasks;
251
+
252
+ export declare namespace Devices {
253
+ export {
254
+ type Device as Device,
255
+ type DeviceListResponse as DeviceListResponse,
256
+ type DeviceCountResponse as DeviceCountResponse,
257
+ type DeviceCreateParams as DeviceCreateParams,
258
+ type DeviceListParams as DeviceListParams,
259
+ type DeviceTerminateParams as DeviceTerminateParams,
260
+ };
261
+
262
+ export {
263
+ Actions as Actions,
264
+ type ActionGlobalParams as ActionGlobalParams,
265
+ type ActionSwipeParams as ActionSwipeParams,
266
+ type ActionTapParams as ActionTapParams,
267
+ };
268
+
269
+ export {
270
+ State as State,
271
+ type StateScreenshotResponse as StateScreenshotResponse,
272
+ type StateTimeResponse as StateTimeResponse,
273
+ type StateUiResponse as StateUiResponse,
274
+ type StateScreenshotParams as StateScreenshotParams,
275
+ type StateTimeParams as StateTimeParams,
276
+ type StateUiParams as StateUiParams,
277
+ };
278
+
279
+ export {
280
+ Apps as Apps,
281
+ type AppListResponse as AppListResponse,
282
+ type AppUpdateParams as AppUpdateParams,
283
+ type AppListParams as AppListParams,
284
+ type AppDeleteParams as AppDeleteParams,
285
+ type AppInstallParams as AppInstallParams,
286
+ type AppStartParams as AppStartParams,
287
+ };
288
+
289
+ export {
290
+ Packages as Packages,
291
+ type PackageListResponse as PackageListResponse,
292
+ type PackageListParams as PackageListParams,
293
+ };
294
+
295
+ export {
296
+ Keyboard as Keyboard,
297
+ type KeyboardClearParams as KeyboardClearParams,
298
+ type KeyboardKeyParams as KeyboardKeyParams,
299
+ type KeyboardWriteParams as KeyboardWriteParams,
300
+ };
301
+
302
+ export { Tasks as Tasks, type TaskListResponse as TaskListResponse, type TaskListParams as TaskListParams };
303
+ }
@@ -0,0 +1,38 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Actions, type ActionGlobalParams, type ActionSwipeParams, type ActionTapParams } from './actions';
4
+ export {
5
+ Apps,
6
+ type AppListResponse,
7
+ type AppUpdateParams,
8
+ type AppListParams,
9
+ type AppDeleteParams,
10
+ type AppInstallParams,
11
+ type AppStartParams,
12
+ } from './apps';
13
+ export {
14
+ Devices,
15
+ type Device,
16
+ type DeviceListResponse,
17
+ type DeviceCountResponse,
18
+ type DeviceCreateParams,
19
+ type DeviceListParams,
20
+ type DeviceTerminateParams,
21
+ } from './devices';
22
+ export {
23
+ Keyboard,
24
+ type KeyboardClearParams,
25
+ type KeyboardKeyParams,
26
+ type KeyboardWriteParams,
27
+ } from './keyboard';
28
+ export { Packages, type PackageListResponse, type PackageListParams } from './packages';
29
+ export {
30
+ State,
31
+ type StateScreenshotResponse,
32
+ type StateTimeResponse,
33
+ type StateUiResponse,
34
+ type StateScreenshotParams,
35
+ type StateTimeParams,
36
+ type StateUiParams,
37
+ } from './state';
38
+ export { Tasks, type TaskListResponse, type TaskListParams } from './tasks';
@@ -0,0 +1,113 @@
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 { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ export class Keyboard extends APIResource {
10
+ /**
11
+ * Clear input
12
+ */
13
+ clear(
14
+ deviceID: string,
15
+ params: KeyboardClearParams | null | undefined = {},
16
+ options?: RequestOptions,
17
+ ): APIPromise<void> {
18
+ const { 'X-Device-Display-ID': xDeviceDisplayID } = params ?? {};
19
+ return this._client.delete(path`/devices/${deviceID}/keyboard`, {
20
+ ...options,
21
+ headers: buildHeaders([
22
+ {
23
+ Accept: '*/*',
24
+ ...(xDeviceDisplayID?.toString() != null ?
25
+ { 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
26
+ : undefined),
27
+ },
28
+ options?.headers,
29
+ ]),
30
+ });
31
+ }
32
+
33
+ /**
34
+ * Input key
35
+ */
36
+ key(deviceID: string, params: KeyboardKeyParams, options?: RequestOptions): APIPromise<void> {
37
+ const { 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
38
+ return this._client.put(path`/devices/${deviceID}/keyboard`, {
39
+ body,
40
+ ...options,
41
+ headers: buildHeaders([
42
+ {
43
+ Accept: '*/*',
44
+ ...(xDeviceDisplayID?.toString() != null ?
45
+ { 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
46
+ : undefined),
47
+ },
48
+ options?.headers,
49
+ ]),
50
+ });
51
+ }
52
+
53
+ /**
54
+ * Input text
55
+ */
56
+ write(deviceID: string, params: KeyboardWriteParams, options?: RequestOptions): APIPromise<void> {
57
+ const { 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
58
+ return this._client.post(path`/devices/${deviceID}/keyboard`, {
59
+ body,
60
+ ...options,
61
+ headers: buildHeaders([
62
+ {
63
+ Accept: '*/*',
64
+ ...(xDeviceDisplayID?.toString() != null ?
65
+ { 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
66
+ : undefined),
67
+ },
68
+ options?.headers,
69
+ ]),
70
+ });
71
+ }
72
+ }
73
+
74
+ export interface KeyboardClearParams {
75
+ 'X-Device-Display-ID'?: number;
76
+ }
77
+
78
+ export interface KeyboardKeyParams {
79
+ /**
80
+ * Body param
81
+ */
82
+ key: number;
83
+
84
+ /**
85
+ * Header param
86
+ */
87
+ 'X-Device-Display-ID'?: number;
88
+ }
89
+
90
+ export interface KeyboardWriteParams {
91
+ /**
92
+ * Body param
93
+ */
94
+ clear: boolean;
95
+
96
+ /**
97
+ * Body param
98
+ */
99
+ text: string;
100
+
101
+ /**
102
+ * Header param
103
+ */
104
+ 'X-Device-Display-ID'?: number;
105
+ }
106
+
107
+ export declare namespace Keyboard {
108
+ export {
109
+ type KeyboardClearParams as KeyboardClearParams,
110
+ type KeyboardKeyParams as KeyboardKeyParams,
111
+ type KeyboardWriteParams as KeyboardWriteParams,
112
+ };
113
+ }
@@ -0,0 +1,50 @@
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 { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ export class Packages extends APIResource {
10
+ /**
11
+ * List packages
12
+ */
13
+ list(
14
+ deviceID: string,
15
+ params: PackageListParams | null | undefined = {},
16
+ options?: RequestOptions,
17
+ ): APIPromise<PackageListResponse | null> {
18
+ const { 'X-Device-Display-ID': xDeviceDisplayID, ...query } = params ?? {};
19
+ return this._client.get(path`/devices/${deviceID}/packages`, {
20
+ query,
21
+ ...options,
22
+ headers: buildHeaders([
23
+ {
24
+ ...(xDeviceDisplayID?.toString() != null ?
25
+ { 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
26
+ : undefined),
27
+ },
28
+ options?.headers,
29
+ ]),
30
+ });
31
+ }
32
+ }
33
+
34
+ export type PackageListResponse = Array<string>;
35
+
36
+ export interface PackageListParams {
37
+ /**
38
+ * Query param
39
+ */
40
+ includeSystemPackages?: boolean;
41
+
42
+ /**
43
+ * Header param
44
+ */
45
+ 'X-Device-Display-ID'?: number;
46
+ }
47
+
48
+ export declare namespace Packages {
49
+ export { type PackageListResponse as PackageListResponse, type PackageListParams as PackageListParams };
50
+ }