@mobilerun/sdk 1.0.0 → 2.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.
- package/CHANGELOG.md +77 -0
- package/LICENSE +1 -1
- package/README.md +9 -0
- package/client.d.mts +5 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -2
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/apps.d.mts +19 -7
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +19 -7
- package/resources/apps.d.ts.map +1 -1
- package/resources/devices/actions.d.mts +71 -0
- package/resources/devices/actions.d.mts.map +1 -0
- package/resources/devices/actions.d.ts +71 -0
- package/resources/devices/actions.d.ts.map +1 -0
- package/resources/devices/actions.js +68 -0
- package/resources/devices/actions.js.map +1 -0
- package/resources/devices/actions.mjs +64 -0
- package/resources/devices/actions.mjs.map +1 -0
- package/resources/devices/apps.d.mts +79 -0
- package/resources/devices/apps.d.mts.map +1 -0
- package/resources/devices/apps.d.ts +79 -0
- package/resources/devices/apps.d.ts.map +1 -0
- package/resources/devices/apps.js +86 -0
- package/resources/devices/apps.js.map +1 -0
- package/resources/devices/apps.mjs +82 -0
- package/resources/devices/apps.mjs.map +1 -0
- package/resources/devices/devices.d.mts +142 -0
- package/resources/devices/devices.d.mts.map +1 -0
- package/resources/devices/devices.d.ts +142 -0
- package/resources/devices/devices.d.ts.map +1 -0
- package/resources/devices/devices.js +73 -0
- package/resources/devices/devices.js.map +1 -0
- package/resources/devices/devices.mjs +68 -0
- package/resources/devices/devices.mjs.map +1 -0
- package/resources/devices/index.d.mts +8 -0
- package/resources/devices/index.d.mts.map +1 -0
- package/resources/devices/index.d.ts +8 -0
- package/resources/devices/index.d.ts.map +1 -0
- package/resources/devices/index.js +19 -0
- package/resources/devices/index.js.map +1 -0
- package/resources/devices/index.mjs +9 -0
- package/resources/devices/index.mjs.map +1 -0
- package/resources/devices/keyboard.d.mts +48 -0
- package/resources/devices/keyboard.d.mts.map +1 -0
- package/resources/devices/keyboard.d.ts +48 -0
- package/resources/devices/keyboard.d.ts.map +1 -0
- package/resources/devices/keyboard.js +67 -0
- package/resources/devices/keyboard.js.map +1 -0
- package/resources/devices/keyboard.mjs +63 -0
- package/resources/devices/keyboard.mjs.map +1 -0
- package/resources/devices/packages.d.mts +24 -0
- package/resources/devices/packages.d.mts.map +1 -0
- package/resources/devices/packages.d.ts +24 -0
- package/resources/devices/packages.d.ts.map +1 -0
- package/resources/devices/packages.js +29 -0
- package/resources/devices/packages.js.map +1 -0
- package/resources/devices/packages.mjs +25 -0
- package/resources/devices/packages.mjs.map +1 -0
- package/resources/devices/state.d.mts +99 -0
- package/resources/devices/state.d.mts.map +1 -0
- package/resources/devices/state.d.ts +99 -0
- package/resources/devices/state.d.ts.map +1 -0
- package/resources/devices/state.js +64 -0
- package/resources/devices/state.js.map +1 -0
- package/resources/devices/state.mjs +60 -0
- package/resources/devices/state.mjs.map +1 -0
- package/resources/devices/tasks.d.mts +42 -0
- package/resources/devices/tasks.d.mts.map +1 -0
- package/resources/devices/tasks.d.ts +42 -0
- package/resources/devices/tasks.d.ts.map +1 -0
- package/resources/devices/tasks.js +16 -0
- package/resources/devices/tasks.js.map +1 -0
- package/resources/devices/tasks.mjs +12 -0
- package/resources/devices/tasks.mjs.map +1 -0
- package/resources/devices.d.mts +2 -0
- package/resources/devices.d.mts.map +1 -0
- package/resources/devices.d.ts +2 -0
- package/resources/devices.d.ts.map +1 -0
- package/resources/devices.js +6 -0
- package/resources/devices.js.map +1 -0
- package/resources/devices.mjs +3 -0
- package/resources/devices.mjs.map +1 -0
- package/resources/hooks.d.mts +16 -2
- package/resources/hooks.d.mts.map +1 -1
- package/resources/hooks.d.ts +16 -2
- package/resources/hooks.d.ts.map +1 -1
- package/resources/hooks.js +7 -1
- package/resources/hooks.js.map +1 -1
- package/resources/hooks.mjs +7 -1
- package/resources/hooks.mjs.map +1 -1
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/tasks/tasks.d.mts +115 -121
- package/resources/tasks/tasks.d.mts.map +1 -1
- package/resources/tasks/tasks.d.ts +115 -121
- package/resources/tasks/tasks.d.ts.map +1 -1
- package/resources/tasks/tasks.js.map +1 -1
- package/resources/tasks/tasks.mjs.map +1 -1
- package/src/client.ts +19 -0
- package/src/resources/apps.ts +29 -9
- package/src/resources/devices/actions.ts +138 -0
- package/src/resources/devices/apps.ts +171 -0
- package/src/resources/devices/devices.ts +277 -0
- package/src/resources/devices/index.ts +35 -0
- package/src/resources/devices/keyboard.ts +113 -0
- package/src/resources/devices/packages.ts +50 -0
- package/src/resources/devices/state.ts +201 -0
- package/src/resources/devices/tasks.ts +68 -0
- package/src/resources/devices.ts +3 -0
- package/src/resources/hooks.ts +27 -1
- package/src/resources/index.ts +8 -0
- package/src/resources/tasks/tasks.ts +133 -132
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/client.ts
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
HookListParams,
|
|
23
23
|
HookListResponse,
|
|
24
24
|
HookPerformResponse,
|
|
25
|
+
HookRetrieveResponse,
|
|
25
26
|
HookSubscribeParams,
|
|
26
27
|
HookSubscribeResponse,
|
|
27
28
|
HookUnsubscribeResponse,
|
|
@@ -30,6 +31,13 @@ import {
|
|
|
30
31
|
Hooks,
|
|
31
32
|
} from './resources/hooks';
|
|
32
33
|
import { CredentialListResponse, Credentials } from './resources/credentials/credentials';
|
|
34
|
+
import {
|
|
35
|
+
Device,
|
|
36
|
+
DeviceCreateParams,
|
|
37
|
+
DeviceListParams,
|
|
38
|
+
DeviceListResponse,
|
|
39
|
+
Devices,
|
|
40
|
+
} from './resources/devices/devices';
|
|
33
41
|
import {
|
|
34
42
|
LlmModel,
|
|
35
43
|
Task,
|
|
@@ -750,12 +758,14 @@ export class Mobilerun {
|
|
|
750
758
|
static toFile = Uploads.toFile;
|
|
751
759
|
|
|
752
760
|
tasks: API.Tasks = new API.Tasks(this);
|
|
761
|
+
devices: API.Devices = new API.Devices(this);
|
|
753
762
|
apps: API.Apps = new API.Apps(this);
|
|
754
763
|
credentials: API.Credentials = new API.Credentials(this);
|
|
755
764
|
hooks: API.Hooks = new API.Hooks(this);
|
|
756
765
|
}
|
|
757
766
|
|
|
758
767
|
Mobilerun.Tasks = Tasks;
|
|
768
|
+
Mobilerun.Devices = Devices;
|
|
759
769
|
Mobilerun.Apps = Apps;
|
|
760
770
|
Mobilerun.Credentials = Credentials;
|
|
761
771
|
Mobilerun.Hooks = Hooks;
|
|
@@ -780,12 +790,21 @@ export declare namespace Mobilerun {
|
|
|
780
790
|
type TaskRunStreamedParams as TaskRunStreamedParams,
|
|
781
791
|
};
|
|
782
792
|
|
|
793
|
+
export {
|
|
794
|
+
Devices as Devices,
|
|
795
|
+
type Device as Device,
|
|
796
|
+
type DeviceListResponse as DeviceListResponse,
|
|
797
|
+
type DeviceCreateParams as DeviceCreateParams,
|
|
798
|
+
type DeviceListParams as DeviceListParams,
|
|
799
|
+
};
|
|
800
|
+
|
|
783
801
|
export { Apps as Apps, type AppListResponse as AppListResponse, type AppListParams as AppListParams };
|
|
784
802
|
|
|
785
803
|
export { Credentials as Credentials, type CredentialListResponse as CredentialListResponse };
|
|
786
804
|
|
|
787
805
|
export {
|
|
788
806
|
Hooks as Hooks,
|
|
807
|
+
type HookRetrieveResponse as HookRetrieveResponse,
|
|
789
808
|
type HookUpdateResponse as HookUpdateResponse,
|
|
790
809
|
type HookListResponse as HookListResponse,
|
|
791
810
|
type HookGetSampleDataResponse as HookGetSampleDataResponse,
|
package/src/resources/apps.ts
CHANGED
|
@@ -14,21 +14,27 @@ export class Apps extends APIResource {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface AppListResponse {
|
|
17
|
-
|
|
17
|
+
count: AppListResponse.Count;
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
items: Array<AppListResponse.Item>;
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
pagination: AppListResponse.Pagination;
|
|
22
|
+
}
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
export namespace AppListResponse {
|
|
25
|
+
export interface Count {
|
|
26
|
+
availableCount: number;
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
queuedCount: number;
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
}
|
|
30
|
+
storeCount: number;
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
totalCount: number;
|
|
33
|
+
|
|
34
|
+
uploadCount: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface Item {
|
|
32
38
|
id: string;
|
|
33
39
|
|
|
34
40
|
categoryName: string | null;
|
|
@@ -322,6 +328,20 @@ export namespace AppListResponse {
|
|
|
322
328
|
|
|
323
329
|
versionName: string;
|
|
324
330
|
}
|
|
331
|
+
|
|
332
|
+
export interface Pagination {
|
|
333
|
+
hasNext: boolean;
|
|
334
|
+
|
|
335
|
+
hasPrev: boolean;
|
|
336
|
+
|
|
337
|
+
page: number;
|
|
338
|
+
|
|
339
|
+
pages: number;
|
|
340
|
+
|
|
341
|
+
pageSize: number;
|
|
342
|
+
|
|
343
|
+
total: number;
|
|
344
|
+
}
|
|
325
345
|
}
|
|
326
346
|
|
|
327
347
|
export interface AppListParams {
|
|
@@ -0,0 +1,138 @@
|
|
|
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 Actions extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Perform a global action
|
|
12
|
+
*/
|
|
13
|
+
global(deviceID: string, params: ActionGlobalParams, options?: RequestOptions): APIPromise<void> {
|
|
14
|
+
const { 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
|
|
15
|
+
return this._client.post(path`/devices/${deviceID}/global`, {
|
|
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
|
+
* Swipe
|
|
32
|
+
*/
|
|
33
|
+
swipe(deviceID: string, params: ActionSwipeParams, options?: RequestOptions): APIPromise<void> {
|
|
34
|
+
const { 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
|
|
35
|
+
return this._client.post(path`/devices/${deviceID}/swipe`, {
|
|
36
|
+
body,
|
|
37
|
+
...options,
|
|
38
|
+
headers: buildHeaders([
|
|
39
|
+
{
|
|
40
|
+
Accept: '*/*',
|
|
41
|
+
...(xDeviceDisplayID?.toString() != null ?
|
|
42
|
+
{ 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
|
|
43
|
+
: undefined),
|
|
44
|
+
},
|
|
45
|
+
options?.headers,
|
|
46
|
+
]),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Tap by coordinates
|
|
52
|
+
*/
|
|
53
|
+
tap(deviceID: string, params: ActionTapParams, options?: RequestOptions): APIPromise<void> {
|
|
54
|
+
const { 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
|
|
55
|
+
return this._client.post(path`/devices/${deviceID}/tap`, {
|
|
56
|
+
body,
|
|
57
|
+
...options,
|
|
58
|
+
headers: buildHeaders([
|
|
59
|
+
{
|
|
60
|
+
Accept: '*/*',
|
|
61
|
+
...(xDeviceDisplayID?.toString() != null ?
|
|
62
|
+
{ 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
|
|
63
|
+
: undefined),
|
|
64
|
+
},
|
|
65
|
+
options?.headers,
|
|
66
|
+
]),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface ActionGlobalParams {
|
|
72
|
+
/**
|
|
73
|
+
* Body param:
|
|
74
|
+
*/
|
|
75
|
+
action: number;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Header param:
|
|
79
|
+
*/
|
|
80
|
+
'X-Device-Display-ID'?: number;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface ActionSwipeParams {
|
|
84
|
+
/**
|
|
85
|
+
* Body param: Swipe duration in milliseconds
|
|
86
|
+
*/
|
|
87
|
+
duration: number;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Body param:
|
|
91
|
+
*/
|
|
92
|
+
endX: number;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Body param:
|
|
96
|
+
*/
|
|
97
|
+
endY: number;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Body param:
|
|
101
|
+
*/
|
|
102
|
+
startX: number;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Body param:
|
|
106
|
+
*/
|
|
107
|
+
startY: number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Header param:
|
|
111
|
+
*/
|
|
112
|
+
'X-Device-Display-ID'?: number;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface ActionTapParams {
|
|
116
|
+
/**
|
|
117
|
+
* Body param:
|
|
118
|
+
*/
|
|
119
|
+
x: number;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Body param:
|
|
123
|
+
*/
|
|
124
|
+
y: number;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Header param:
|
|
128
|
+
*/
|
|
129
|
+
'X-Device-Display-ID'?: number;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export declare namespace Actions {
|
|
133
|
+
export {
|
|
134
|
+
type ActionGlobalParams as ActionGlobalParams,
|
|
135
|
+
type ActionSwipeParams as ActionSwipeParams,
|
|
136
|
+
type ActionTapParams as ActionTapParams,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
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
|
+
* List apps
|
|
12
|
+
*/
|
|
13
|
+
list(
|
|
14
|
+
deviceID: string,
|
|
15
|
+
params: AppListParams | null | undefined = {},
|
|
16
|
+
options?: RequestOptions,
|
|
17
|
+
): APIPromise<AppListResponse | null> {
|
|
18
|
+
const { 'X-Device-Display-ID': xDeviceDisplayID, ...query } = params ?? {};
|
|
19
|
+
return this._client.get(path`/devices/${deviceID}/apps`, {
|
|
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
|
+
* Delete app
|
|
35
|
+
*/
|
|
36
|
+
delete(packageName: string, params: AppDeleteParams, options?: RequestOptions): APIPromise<void> {
|
|
37
|
+
const { deviceId, 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
|
|
38
|
+
return this._client.delete(path`/devices/${deviceId}/apps/${packageName}`, {
|
|
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
|
+
* Install app
|
|
55
|
+
*/
|
|
56
|
+
install(deviceID: string, params: AppInstallParams, options?: RequestOptions): APIPromise<void> {
|
|
57
|
+
const { 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
|
|
58
|
+
return this._client.post(path`/devices/${deviceID}/apps`, {
|
|
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
|
+
* Start app
|
|
75
|
+
*/
|
|
76
|
+
start(packageName: string, params: AppStartParams, options?: RequestOptions): APIPromise<void> {
|
|
77
|
+
const { deviceId, 'X-Device-Display-ID': xDeviceDisplayID, ...body } = params;
|
|
78
|
+
return this._client.put(path`/devices/${deviceId}/apps/${packageName}`, {
|
|
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
|
+
export type AppListResponse = Array<AppListResponse.AppListResponseItem>;
|
|
95
|
+
|
|
96
|
+
export namespace AppListResponse {
|
|
97
|
+
export interface AppListResponseItem {
|
|
98
|
+
isSystemApp: boolean;
|
|
99
|
+
|
|
100
|
+
label: string;
|
|
101
|
+
|
|
102
|
+
packageName: string;
|
|
103
|
+
|
|
104
|
+
versionCode: number;
|
|
105
|
+
|
|
106
|
+
versionName: string;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface AppListParams {
|
|
111
|
+
/**
|
|
112
|
+
* Query param:
|
|
113
|
+
*/
|
|
114
|
+
includeSystemApps?: boolean;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Header param:
|
|
118
|
+
*/
|
|
119
|
+
'X-Device-Display-ID'?: number;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface AppDeleteParams {
|
|
123
|
+
/**
|
|
124
|
+
* Path param:
|
|
125
|
+
*/
|
|
126
|
+
deviceId: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Header param:
|
|
130
|
+
*/
|
|
131
|
+
'X-Device-Display-ID'?: number;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface AppInstallParams {
|
|
135
|
+
/**
|
|
136
|
+
* Body param:
|
|
137
|
+
*/
|
|
138
|
+
packageName: string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Header param:
|
|
142
|
+
*/
|
|
143
|
+
'X-Device-Display-ID'?: number;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface AppStartParams {
|
|
147
|
+
/**
|
|
148
|
+
* Path param:
|
|
149
|
+
*/
|
|
150
|
+
deviceId: string;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Body param:
|
|
154
|
+
*/
|
|
155
|
+
activity?: string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Header param:
|
|
159
|
+
*/
|
|
160
|
+
'X-Device-Display-ID'?: number;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export declare namespace Apps {
|
|
164
|
+
export {
|
|
165
|
+
type AppListResponse as AppListResponse,
|
|
166
|
+
type AppListParams as AppListParams,
|
|
167
|
+
type AppDeleteParams as AppDeleteParams,
|
|
168
|
+
type AppInstallParams as AppInstallParams,
|
|
169
|
+
type AppStartParams as AppStartParams,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
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
|
+
Apps,
|
|
14
|
+
} from './apps';
|
|
15
|
+
import * as KeyboardAPI from './keyboard';
|
|
16
|
+
import { Keyboard, KeyboardClearParams, KeyboardKeyParams, KeyboardWriteParams } from './keyboard';
|
|
17
|
+
import * as PackagesAPI from './packages';
|
|
18
|
+
import { PackageListParams, PackageListResponse, Packages } from './packages';
|
|
19
|
+
import * as StateAPI from './state';
|
|
20
|
+
import {
|
|
21
|
+
State,
|
|
22
|
+
StateScreenshotParams,
|
|
23
|
+
StateScreenshotResponse,
|
|
24
|
+
StateTimeParams,
|
|
25
|
+
StateTimeResponse,
|
|
26
|
+
StateUiParams,
|
|
27
|
+
StateUiResponse,
|
|
28
|
+
} from './state';
|
|
29
|
+
import * as TasksAPI from './tasks';
|
|
30
|
+
import { TaskListParams, TaskListResponse, Tasks } from './tasks';
|
|
31
|
+
import { APIPromise } from '../../core/api-promise';
|
|
32
|
+
import { buildHeaders } from '../../internal/headers';
|
|
33
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
34
|
+
import { path } from '../../internal/utils/path';
|
|
35
|
+
|
|
36
|
+
export class Devices extends APIResource {
|
|
37
|
+
actions: ActionsAPI.Actions = new ActionsAPI.Actions(this._client);
|
|
38
|
+
state: StateAPI.State = new StateAPI.State(this._client);
|
|
39
|
+
apps: AppsAPI.Apps = new AppsAPI.Apps(this._client);
|
|
40
|
+
packages: PackagesAPI.Packages = new PackagesAPI.Packages(this._client);
|
|
41
|
+
keyboard: KeyboardAPI.Keyboard = new KeyboardAPI.Keyboard(this._client);
|
|
42
|
+
tasks: TasksAPI.Tasks = new TasksAPI.Tasks(this._client);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Provision a new device
|
|
46
|
+
*/
|
|
47
|
+
create(params: DeviceCreateParams, options?: RequestOptions): APIPromise<Device> {
|
|
48
|
+
const { deviceType, provider, ...body } = params;
|
|
49
|
+
return this._client.post('/devices', { query: { deviceType, provider }, body, ...options });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get device info
|
|
54
|
+
*/
|
|
55
|
+
retrieve(deviceID: string, options?: RequestOptions): APIPromise<Device> {
|
|
56
|
+
return this._client.get(path`/devices/${deviceID}`, options);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* List devices
|
|
61
|
+
*/
|
|
62
|
+
list(
|
|
63
|
+
query: DeviceListParams | null | undefined = {},
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): APIPromise<DeviceListResponse> {
|
|
66
|
+
return this._client.get('/devices', { query, ...options });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Terminate a device
|
|
71
|
+
*/
|
|
72
|
+
terminate(deviceID: string, options?: RequestOptions): APIPromise<void> {
|
|
73
|
+
return this._client.delete(path`/devices/${deviceID}`, {
|
|
74
|
+
...options,
|
|
75
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Wait for device to be ready
|
|
81
|
+
*/
|
|
82
|
+
waitReady(deviceID: string, options?: RequestOptions): APIPromise<Device> {
|
|
83
|
+
return this._client.get(path`/devices/${deviceID}/wait`, options);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface Device {
|
|
88
|
+
id: string;
|
|
89
|
+
|
|
90
|
+
apps: Array<string> | null;
|
|
91
|
+
|
|
92
|
+
assignedAt: string | null;
|
|
93
|
+
|
|
94
|
+
country: string;
|
|
95
|
+
|
|
96
|
+
createdAt: string;
|
|
97
|
+
|
|
98
|
+
deviceType: string;
|
|
99
|
+
|
|
100
|
+
files: Array<string> | null;
|
|
101
|
+
|
|
102
|
+
name: string;
|
|
103
|
+
|
|
104
|
+
provider: string;
|
|
105
|
+
|
|
106
|
+
state: string;
|
|
107
|
+
|
|
108
|
+
stateMessage: string;
|
|
109
|
+
|
|
110
|
+
streamToken: string;
|
|
111
|
+
|
|
112
|
+
streamUrl: string;
|
|
113
|
+
|
|
114
|
+
taskCount: number;
|
|
115
|
+
|
|
116
|
+
updatedAt: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* A URL to the JSON Schema for this object.
|
|
120
|
+
*/
|
|
121
|
+
$schema?: string;
|
|
122
|
+
|
|
123
|
+
userId?: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface DeviceListResponse {
|
|
127
|
+
items: Array<Device> | null;
|
|
128
|
+
|
|
129
|
+
pagination: DeviceListResponse.Pagination;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* A URL to the JSON Schema for this object.
|
|
133
|
+
*/
|
|
134
|
+
$schema?: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export namespace DeviceListResponse {
|
|
138
|
+
export interface Pagination {
|
|
139
|
+
hasNext: boolean;
|
|
140
|
+
|
|
141
|
+
hasPrev: boolean;
|
|
142
|
+
|
|
143
|
+
page: number;
|
|
144
|
+
|
|
145
|
+
pages: number;
|
|
146
|
+
|
|
147
|
+
pageSize: number;
|
|
148
|
+
|
|
149
|
+
total: number;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface DeviceCreateParams {
|
|
154
|
+
/**
|
|
155
|
+
* Query param:
|
|
156
|
+
*/
|
|
157
|
+
deviceType?: 'device_slot' | 'dedicated_emulated_device' | 'dedicated_physical_device';
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Query param:
|
|
161
|
+
*/
|
|
162
|
+
provider?: 'limrun' | 'remote' | 'roidrun';
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Body param:
|
|
166
|
+
*/
|
|
167
|
+
apps?: Array<string> | null;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Body param:
|
|
171
|
+
*/
|
|
172
|
+
country?: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Body param:
|
|
176
|
+
*/
|
|
177
|
+
files?: Array<string> | null;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Body param:
|
|
181
|
+
*/
|
|
182
|
+
name?: string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Body param:
|
|
186
|
+
*/
|
|
187
|
+
proxy?: DeviceCreateParams.Proxy;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export namespace DeviceCreateParams {
|
|
191
|
+
export interface Proxy {
|
|
192
|
+
host: string;
|
|
193
|
+
|
|
194
|
+
password: string;
|
|
195
|
+
|
|
196
|
+
port: number;
|
|
197
|
+
|
|
198
|
+
user: string;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface DeviceListParams {
|
|
203
|
+
country?: string;
|
|
204
|
+
|
|
205
|
+
name?: string;
|
|
206
|
+
|
|
207
|
+
orderBy?: 'id' | 'createdAt' | 'updatedAt' | 'assignedAt';
|
|
208
|
+
|
|
209
|
+
orderByDirection?: 'asc' | 'desc';
|
|
210
|
+
|
|
211
|
+
page?: number;
|
|
212
|
+
|
|
213
|
+
pageSize?: number;
|
|
214
|
+
|
|
215
|
+
provider?: 'limrun' | 'personal' | 'remote' | 'roidrun';
|
|
216
|
+
|
|
217
|
+
state?: 'creating' | 'assigned' | 'ready' | 'terminated' | 'unknown';
|
|
218
|
+
|
|
219
|
+
type?: 'device_slot' | 'dedicated_emulated_device' | 'dedicated_physical_device';
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
Devices.Actions = Actions;
|
|
223
|
+
Devices.State = State;
|
|
224
|
+
Devices.Apps = Apps;
|
|
225
|
+
Devices.Packages = Packages;
|
|
226
|
+
Devices.Keyboard = Keyboard;
|
|
227
|
+
Devices.Tasks = Tasks;
|
|
228
|
+
|
|
229
|
+
export declare namespace Devices {
|
|
230
|
+
export {
|
|
231
|
+
type Device as Device,
|
|
232
|
+
type DeviceListResponse as DeviceListResponse,
|
|
233
|
+
type DeviceCreateParams as DeviceCreateParams,
|
|
234
|
+
type DeviceListParams as DeviceListParams,
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export {
|
|
238
|
+
Actions as Actions,
|
|
239
|
+
type ActionGlobalParams as ActionGlobalParams,
|
|
240
|
+
type ActionSwipeParams as ActionSwipeParams,
|
|
241
|
+
type ActionTapParams as ActionTapParams,
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export {
|
|
245
|
+
State as State,
|
|
246
|
+
type StateScreenshotResponse as StateScreenshotResponse,
|
|
247
|
+
type StateTimeResponse as StateTimeResponse,
|
|
248
|
+
type StateUiResponse as StateUiResponse,
|
|
249
|
+
type StateScreenshotParams as StateScreenshotParams,
|
|
250
|
+
type StateTimeParams as StateTimeParams,
|
|
251
|
+
type StateUiParams as StateUiParams,
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export {
|
|
255
|
+
Apps as Apps,
|
|
256
|
+
type AppListResponse as AppListResponse,
|
|
257
|
+
type AppListParams as AppListParams,
|
|
258
|
+
type AppDeleteParams as AppDeleteParams,
|
|
259
|
+
type AppInstallParams as AppInstallParams,
|
|
260
|
+
type AppStartParams as AppStartParams,
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export {
|
|
264
|
+
Packages as Packages,
|
|
265
|
+
type PackageListResponse as PackageListResponse,
|
|
266
|
+
type PackageListParams as PackageListParams,
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export {
|
|
270
|
+
Keyboard as Keyboard,
|
|
271
|
+
type KeyboardClearParams as KeyboardClearParams,
|
|
272
|
+
type KeyboardKeyParams as KeyboardKeyParams,
|
|
273
|
+
type KeyboardWriteParams as KeyboardWriteParams,
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
export { Tasks as Tasks, type TaskListResponse as TaskListResponse, type TaskListParams as TaskListParams };
|
|
277
|
+
}
|