@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
|
@@ -0,0 +1,35 @@
|
|
|
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 AppListParams,
|
|
8
|
+
type AppDeleteParams,
|
|
9
|
+
type AppInstallParams,
|
|
10
|
+
type AppStartParams,
|
|
11
|
+
} from './apps';
|
|
12
|
+
export {
|
|
13
|
+
Devices,
|
|
14
|
+
type Device,
|
|
15
|
+
type DeviceListResponse,
|
|
16
|
+
type DeviceCreateParams,
|
|
17
|
+
type DeviceListParams,
|
|
18
|
+
} from './devices';
|
|
19
|
+
export {
|
|
20
|
+
Keyboard,
|
|
21
|
+
type KeyboardClearParams,
|
|
22
|
+
type KeyboardKeyParams,
|
|
23
|
+
type KeyboardWriteParams,
|
|
24
|
+
} from './keyboard';
|
|
25
|
+
export { Packages, type PackageListResponse, type PackageListParams } from './packages';
|
|
26
|
+
export {
|
|
27
|
+
State,
|
|
28
|
+
type StateScreenshotResponse,
|
|
29
|
+
type StateTimeResponse,
|
|
30
|
+
type StateUiResponse,
|
|
31
|
+
type StateScreenshotParams,
|
|
32
|
+
type StateTimeParams,
|
|
33
|
+
type StateUiParams,
|
|
34
|
+
} from './state';
|
|
35
|
+
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
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
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 State extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Take screenshot
|
|
12
|
+
*/
|
|
13
|
+
screenshot(
|
|
14
|
+
deviceID: string,
|
|
15
|
+
params: StateScreenshotParams | null | undefined = {},
|
|
16
|
+
options?: RequestOptions,
|
|
17
|
+
): APIPromise<string> {
|
|
18
|
+
const { 'X-Device-Display-ID': xDeviceDisplayID, ...query } = params ?? {};
|
|
19
|
+
return this._client.get(path`/devices/${deviceID}/screenshot`, {
|
|
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
|
+
* Device time
|
|
35
|
+
*/
|
|
36
|
+
time(
|
|
37
|
+
deviceID: string,
|
|
38
|
+
params: StateTimeParams | null | undefined = {},
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<string> {
|
|
41
|
+
const { 'X-Device-Display-ID': xDeviceDisplayID } = params ?? {};
|
|
42
|
+
return this._client.get(path`/devices/${deviceID}/time`, {
|
|
43
|
+
...options,
|
|
44
|
+
headers: buildHeaders([
|
|
45
|
+
{
|
|
46
|
+
...(xDeviceDisplayID?.toString() != null ?
|
|
47
|
+
{ 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
|
|
48
|
+
: undefined),
|
|
49
|
+
},
|
|
50
|
+
options?.headers,
|
|
51
|
+
]),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* UI state
|
|
57
|
+
*/
|
|
58
|
+
ui(
|
|
59
|
+
deviceID: string,
|
|
60
|
+
params: StateUiParams | null | undefined = {},
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): APIPromise<StateUiResponse> {
|
|
63
|
+
const { 'X-Device-Display-ID': xDeviceDisplayID, ...query } = params ?? {};
|
|
64
|
+
return this._client.get(path`/devices/${deviceID}/ui-state`, {
|
|
65
|
+
query,
|
|
66
|
+
...options,
|
|
67
|
+
headers: buildHeaders([
|
|
68
|
+
{
|
|
69
|
+
...(xDeviceDisplayID?.toString() != null ?
|
|
70
|
+
{ 'X-Device-Display-ID': xDeviceDisplayID?.toString() }
|
|
71
|
+
: undefined),
|
|
72
|
+
},
|
|
73
|
+
options?.headers,
|
|
74
|
+
]),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type StateScreenshotResponse = string;
|
|
80
|
+
|
|
81
|
+
export type StateTimeResponse = string;
|
|
82
|
+
|
|
83
|
+
export interface StateUiResponse {
|
|
84
|
+
a11y_tree: unknown;
|
|
85
|
+
|
|
86
|
+
device_context: StateUiResponse.DeviceContext;
|
|
87
|
+
|
|
88
|
+
phone_state: StateUiResponse.PhoneState;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* A URL to the JSON Schema for this object.
|
|
92
|
+
*/
|
|
93
|
+
$schema?: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export namespace StateUiResponse {
|
|
97
|
+
export interface DeviceContext {
|
|
98
|
+
display_metrics: DeviceContext.DisplayMetrics;
|
|
99
|
+
|
|
100
|
+
filtering_params: DeviceContext.FilteringParams;
|
|
101
|
+
|
|
102
|
+
screen_bounds: DeviceContext.ScreenBounds;
|
|
103
|
+
|
|
104
|
+
screenSize: DeviceContext.ScreenSize;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export namespace DeviceContext {
|
|
108
|
+
export interface DisplayMetrics {
|
|
109
|
+
density: number;
|
|
110
|
+
|
|
111
|
+
densityDpi: number;
|
|
112
|
+
|
|
113
|
+
heightPixels: number;
|
|
114
|
+
|
|
115
|
+
scaledDensity: number;
|
|
116
|
+
|
|
117
|
+
widthPixels: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface FilteringParams {
|
|
121
|
+
min_element_size: number;
|
|
122
|
+
|
|
123
|
+
overlay_offset: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface ScreenBounds {
|
|
127
|
+
height: number;
|
|
128
|
+
|
|
129
|
+
width: number;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface ScreenSize {
|
|
133
|
+
height: number;
|
|
134
|
+
|
|
135
|
+
width: number;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface PhoneState {
|
|
140
|
+
isEditable: boolean;
|
|
141
|
+
|
|
142
|
+
keyboardVisible: boolean;
|
|
143
|
+
|
|
144
|
+
activityName?: string;
|
|
145
|
+
|
|
146
|
+
currentApp?: string;
|
|
147
|
+
|
|
148
|
+
focusedElement?: PhoneState.FocusedElement;
|
|
149
|
+
|
|
150
|
+
packageName?: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export namespace PhoneState {
|
|
154
|
+
export interface FocusedElement {
|
|
155
|
+
className?: string;
|
|
156
|
+
|
|
157
|
+
resourceId?: string;
|
|
158
|
+
|
|
159
|
+
text?: string;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface StateScreenshotParams {
|
|
165
|
+
/**
|
|
166
|
+
* Query param:
|
|
167
|
+
*/
|
|
168
|
+
hideOverlay?: boolean;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Header param:
|
|
172
|
+
*/
|
|
173
|
+
'X-Device-Display-ID'?: number;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface StateTimeParams {
|
|
177
|
+
'X-Device-Display-ID'?: number;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface StateUiParams {
|
|
181
|
+
/**
|
|
182
|
+
* Query param:
|
|
183
|
+
*/
|
|
184
|
+
filter?: boolean;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Header param:
|
|
188
|
+
*/
|
|
189
|
+
'X-Device-Display-ID'?: number;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export declare namespace State {
|
|
193
|
+
export {
|
|
194
|
+
type StateScreenshotResponse as StateScreenshotResponse,
|
|
195
|
+
type StateTimeResponse as StateTimeResponse,
|
|
196
|
+
type StateUiResponse as StateUiResponse,
|
|
197
|
+
type StateScreenshotParams as StateScreenshotParams,
|
|
198
|
+
type StateTimeParams as StateTimeParams,
|
|
199
|
+
type StateUiParams as StateUiParams,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
import { path } from '../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Tasks extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List tasks for a device
|
|
11
|
+
*/
|
|
12
|
+
list(
|
|
13
|
+
deviceID: string,
|
|
14
|
+
query: TaskListParams | null | undefined = {},
|
|
15
|
+
options?: RequestOptions,
|
|
16
|
+
): APIPromise<TaskListResponse> {
|
|
17
|
+
return this._client.get(path`/devices/${deviceID}/tasks`, { query, ...options });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface TaskListResponse {
|
|
22
|
+
items: Array<TaskListResponse.Item> | null;
|
|
23
|
+
|
|
24
|
+
pagination: TaskListResponse.Pagination;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A URL to the JSON Schema for this object.
|
|
28
|
+
*/
|
|
29
|
+
$schema?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export namespace TaskListResponse {
|
|
33
|
+
export interface Item {
|
|
34
|
+
createdAt: string;
|
|
35
|
+
|
|
36
|
+
taskId: string;
|
|
37
|
+
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface Pagination {
|
|
42
|
+
hasNext: boolean;
|
|
43
|
+
|
|
44
|
+
hasPrev: boolean;
|
|
45
|
+
|
|
46
|
+
page: number;
|
|
47
|
+
|
|
48
|
+
pages: number;
|
|
49
|
+
|
|
50
|
+
pageSize: number;
|
|
51
|
+
|
|
52
|
+
total: number;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface TaskListParams {
|
|
57
|
+
orderBy?: 'id' | 'createdAt' | 'updatedAt' | 'assignedAt';
|
|
58
|
+
|
|
59
|
+
orderByDirection?: 'asc' | 'desc';
|
|
60
|
+
|
|
61
|
+
page?: number;
|
|
62
|
+
|
|
63
|
+
pageSize?: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export declare namespace Tasks {
|
|
67
|
+
export { type TaskListResponse as TaskListResponse, type TaskListParams as TaskListParams };
|
|
68
|
+
}
|
package/src/resources/hooks.ts
CHANGED
|
@@ -7,6 +7,13 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
7
7
|
import { path } from '../internal/utils/path';
|
|
8
8
|
|
|
9
9
|
export class Hooks extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Get a hook subscription by id.
|
|
12
|
+
*/
|
|
13
|
+
retrieve(hookID: string, options?: RequestOptions): APIPromise<HookRetrieveResponse> {
|
|
14
|
+
return this._client.get(path`/hooks/${hookID}`, options);
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
/**
|
|
11
18
|
* Edit a hook subscription (events or state).
|
|
12
19
|
*
|
|
@@ -50,13 +57,31 @@ export class Hooks extends APIResource {
|
|
|
50
57
|
/**
|
|
51
58
|
* Unsubscribe a previously created subscription by id.
|
|
52
59
|
*
|
|
53
|
-
*
|
|
60
|
+
* Permanently deletes the subscription if it belongs to the user.
|
|
54
61
|
*/
|
|
55
62
|
unsubscribe(hookID: string, options?: RequestOptions): APIPromise<HookUnsubscribeResponse> {
|
|
56
63
|
return this._client.post(path`/hooks/${hookID}/unsubscribe`, options);
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
66
|
|
|
67
|
+
export interface HookRetrieveResponse {
|
|
68
|
+
service: 'zapier' | 'n8n' | 'make' | 'internal' | 'other';
|
|
69
|
+
|
|
70
|
+
url: string;
|
|
71
|
+
|
|
72
|
+
userId: string;
|
|
73
|
+
|
|
74
|
+
id?: string;
|
|
75
|
+
|
|
76
|
+
createdAt?: string;
|
|
77
|
+
|
|
78
|
+
events?: Array<TasksAPI.TaskStatus>;
|
|
79
|
+
|
|
80
|
+
state?: 'active' | 'disabled' | 'deleted';
|
|
81
|
+
|
|
82
|
+
updatedAt?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
60
85
|
/**
|
|
61
86
|
* Response model after successfully editing a hook.
|
|
62
87
|
*/
|
|
@@ -282,6 +307,7 @@ export interface HookSubscribeParams {
|
|
|
282
307
|
|
|
283
308
|
export declare namespace Hooks {
|
|
284
309
|
export {
|
|
310
|
+
type HookRetrieveResponse as HookRetrieveResponse,
|
|
285
311
|
type HookUpdateResponse as HookUpdateResponse,
|
|
286
312
|
type HookListResponse as HookListResponse,
|
|
287
313
|
type HookGetSampleDataResponse as HookGetSampleDataResponse,
|
package/src/resources/index.ts
CHANGED
|
@@ -2,8 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
export { Apps, type AppListResponse, type AppListParams } from './apps';
|
|
4
4
|
export { Credentials, type CredentialListResponse } from './credentials/credentials';
|
|
5
|
+
export {
|
|
6
|
+
Devices,
|
|
7
|
+
type Device,
|
|
8
|
+
type DeviceListResponse,
|
|
9
|
+
type DeviceCreateParams,
|
|
10
|
+
type DeviceListParams,
|
|
11
|
+
} from './devices/devices';
|
|
5
12
|
export {
|
|
6
13
|
Hooks,
|
|
14
|
+
type HookRetrieveResponse,
|
|
7
15
|
type HookUpdateResponse,
|
|
8
16
|
type HookListResponse,
|
|
9
17
|
type HookGetSampleDataResponse,
|