@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.
- package/CHANGELOG.md +142 -0
- package/LICENSE +1 -1
- package/README.md +9 -0
- package/client.d.mts +13 -9
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -9
- package/client.d.ts.map +1 -1
- package/client.js +23 -17
- package/client.js.map +1 -1
- package/client.mjs +24 -18
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/apps.d.mts +20 -7
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +20 -7
- package/resources/apps.d.ts.map +1 -1
- package/resources/credentials/credentials.d.mts +18 -3
- package/resources/credentials/credentials.d.mts.map +1 -1
- package/resources/credentials/credentials.d.ts +18 -3
- package/resources/credentials/credentials.d.ts.map +1 -1
- package/resources/credentials/credentials.js +2 -2
- package/resources/credentials/credentials.js.map +1 -1
- package/resources/credentials/credentials.mjs +2 -2
- package/resources/credentials/credentials.mjs.map +1 -1
- package/resources/credentials/index.d.mts +1 -1
- package/resources/credentials/index.d.mts.map +1 -1
- package/resources/credentials/index.d.ts +1 -1
- package/resources/credentials/index.d.ts.map +1 -1
- package/resources/credentials/index.js.map +1 -1
- package/resources/credentials/index.mjs.map +1 -1
- package/resources/credentials/packages/credentials/fields.d.mts +6 -6
- package/resources/credentials/packages/credentials/fields.d.ts +6 -6
- 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 +93 -0
- package/resources/devices/apps.d.mts.map +1 -0
- package/resources/devices/apps.d.ts +93 -0
- package/resources/devices/apps.d.ts.map +1 -0
- package/resources/devices/apps.js +105 -0
- package/resources/devices/apps.js.map +1 -0
- package/resources/devices/apps.mjs +101 -0
- package/resources/devices/apps.mjs.map +1 -0
- package/resources/devices/devices.d.mts +154 -0
- package/resources/devices/devices.d.mts.map +1 -0
- package/resources/devices/devices.d.ts +154 -0
- package/resources/devices/devices.d.ts.map +1 -0
- package/resources/devices/devices.js +80 -0
- package/resources/devices/devices.js.map +1 -0
- package/resources/devices/devices.mjs +75 -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 +22 -3
- package/resources/hooks.d.mts.map +1 -1
- package/resources/hooks.d.ts +22 -3
- package/resources/hooks.d.ts.map +1 -1
- package/resources/hooks.js +11 -4
- package/resources/hooks.js.map +1 -1
- package/resources/hooks.mjs +11 -4
- package/resources/hooks.mjs.map +1 -1
- package/resources/index.d.mts +5 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/models.d.mts +28 -0
- package/resources/models.d.mts.map +1 -0
- package/resources/models.d.ts +28 -0
- package/resources/models.d.ts.map +1 -0
- package/resources/models.js +15 -0
- package/resources/models.js.map +1 -0
- package/resources/models.mjs +11 -0
- package/resources/models.mjs.map +1 -0
- package/resources/tasks/index.d.mts +1 -1
- package/resources/tasks/index.d.mts.map +1 -1
- package/resources/tasks/index.d.ts +1 -1
- package/resources/tasks/index.d.ts.map +1 -1
- package/resources/tasks/index.js.map +1 -1
- package/resources/tasks/index.mjs.map +1 -1
- package/resources/tasks/screenshots.d.mts +2 -2
- package/resources/tasks/screenshots.d.ts +2 -2
- package/resources/tasks/screenshots.js +2 -2
- package/resources/tasks/screenshots.mjs +2 -2
- package/resources/tasks/tasks.d.mts +158 -424
- package/resources/tasks/tasks.d.mts.map +1 -1
- package/resources/tasks/tasks.d.ts +158 -424
- package/resources/tasks/tasks.d.ts.map +1 -1
- package/resources/tasks/tasks.js +12 -10
- package/resources/tasks/tasks.js.map +1 -1
- package/resources/tasks/tasks.mjs +12 -10
- package/resources/tasks/tasks.mjs.map +1 -1
- package/resources/tasks/ui-states.d.mts +2 -2
- package/resources/tasks/ui-states.d.ts +2 -2
- package/resources/tasks/ui-states.js +2 -2
- package/resources/tasks/ui-states.mjs +2 -2
- package/src/client.ts +60 -26
- package/src/internal/parse.ts +6 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/resources/apps.ts +31 -9
- package/src/resources/credentials/credentials.ts +34 -4
- package/src/resources/credentials/index.ts +1 -1
- package/src/resources/credentials/packages/credentials/fields.ts +6 -6
- package/src/resources/devices/actions.ts +138 -0
- package/src/resources/devices/apps.ts +204 -0
- package/src/resources/devices/devices.ts +303 -0
- package/src/resources/devices/index.ts +38 -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 +36 -4
- package/src/resources/index.ts +17 -3
- package/src/resources/models.ts +39 -0
- package/src/resources/tasks/index.ts +0 -2
- package/src/resources/tasks/screenshots.ts +2 -2
- package/src/resources/tasks/tasks.ts +176 -554
- package/src/resources/tasks/ui-states.ts +2 -2
- 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,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
|
*
|
|
@@ -23,7 +30,7 @@ export class Hooks extends APIResource {
|
|
|
23
30
|
query: HookListParams | null | undefined = {},
|
|
24
31
|
options?: RequestOptions,
|
|
25
32
|
): APIPromise<HookListResponse> {
|
|
26
|
-
return this._client.get('/hooks
|
|
33
|
+
return this._client.get('/hooks', { query, ...options });
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
/**
|
|
@@ -36,8 +43,9 @@ export class Hooks extends APIResource {
|
|
|
36
43
|
/**
|
|
37
44
|
* Zapier Perform endpoint - processes webhook payloads.
|
|
38
45
|
*/
|
|
39
|
-
perform(options?: RequestOptions): APIPromise<HookPerformResponse> {
|
|
40
|
-
|
|
46
|
+
perform(params: HookPerformParams, options?: RequestOptions): APIPromise<HookPerformResponse> {
|
|
47
|
+
const { body } = params;
|
|
48
|
+
return this._client.post('/hooks/perform', { body: body, ...options });
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
/**
|
|
@@ -50,13 +58,31 @@ export class Hooks extends APIResource {
|
|
|
50
58
|
/**
|
|
51
59
|
* Unsubscribe a previously created subscription by id.
|
|
52
60
|
*
|
|
53
|
-
*
|
|
61
|
+
* Permanently deletes the subscription if it belongs to the user.
|
|
54
62
|
*/
|
|
55
63
|
unsubscribe(hookID: string, options?: RequestOptions): APIPromise<HookUnsubscribeResponse> {
|
|
56
64
|
return this._client.post(path`/hooks/${hookID}/unsubscribe`, options);
|
|
57
65
|
}
|
|
58
66
|
}
|
|
59
67
|
|
|
68
|
+
export interface HookRetrieveResponse {
|
|
69
|
+
service: 'zapier' | 'n8n' | 'make' | 'internal' | 'other';
|
|
70
|
+
|
|
71
|
+
url: string;
|
|
72
|
+
|
|
73
|
+
userId: string;
|
|
74
|
+
|
|
75
|
+
id?: string;
|
|
76
|
+
|
|
77
|
+
createdAt?: string;
|
|
78
|
+
|
|
79
|
+
events?: Array<TasksAPI.TaskStatus>;
|
|
80
|
+
|
|
81
|
+
state?: 'active' | 'disabled' | 'deleted';
|
|
82
|
+
|
|
83
|
+
updatedAt?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
60
86
|
/**
|
|
61
87
|
* Response model after successfully editing a hook.
|
|
62
88
|
*/
|
|
@@ -262,6 +288,10 @@ export interface HookListParams {
|
|
|
262
288
|
pageSize?: number;
|
|
263
289
|
}
|
|
264
290
|
|
|
291
|
+
export interface HookPerformParams {
|
|
292
|
+
body: { [key: string]: unknown };
|
|
293
|
+
}
|
|
294
|
+
|
|
265
295
|
export interface HookSubscribeParams {
|
|
266
296
|
/**
|
|
267
297
|
* The webhook URL to send notifications to
|
|
@@ -282,6 +312,7 @@ export interface HookSubscribeParams {
|
|
|
282
312
|
|
|
283
313
|
export declare namespace Hooks {
|
|
284
314
|
export {
|
|
315
|
+
type HookRetrieveResponse as HookRetrieveResponse,
|
|
285
316
|
type HookUpdateResponse as HookUpdateResponse,
|
|
286
317
|
type HookListResponse as HookListResponse,
|
|
287
318
|
type HookGetSampleDataResponse as HookGetSampleDataResponse,
|
|
@@ -290,6 +321,7 @@ export declare namespace Hooks {
|
|
|
290
321
|
type HookUnsubscribeResponse as HookUnsubscribeResponse,
|
|
291
322
|
type HookUpdateParams as HookUpdateParams,
|
|
292
323
|
type HookListParams as HookListParams,
|
|
324
|
+
type HookPerformParams as HookPerformParams,
|
|
293
325
|
type HookSubscribeParams as HookSubscribeParams,
|
|
294
326
|
};
|
|
295
327
|
}
|
package/src/resources/index.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
export { Apps, type AppListResponse, type AppListParams } from './apps';
|
|
4
|
-
export {
|
|
4
|
+
export {
|
|
5
|
+
Credentials,
|
|
6
|
+
type CredentialListResponse,
|
|
7
|
+
type CredentialListParams,
|
|
8
|
+
} from './credentials/credentials';
|
|
9
|
+
export {
|
|
10
|
+
Devices,
|
|
11
|
+
type Device,
|
|
12
|
+
type DeviceListResponse,
|
|
13
|
+
type DeviceCountResponse,
|
|
14
|
+
type DeviceCreateParams,
|
|
15
|
+
type DeviceListParams,
|
|
16
|
+
type DeviceTerminateParams,
|
|
17
|
+
} from './devices/devices';
|
|
5
18
|
export {
|
|
6
19
|
Hooks,
|
|
20
|
+
type HookRetrieveResponse,
|
|
7
21
|
type HookUpdateResponse,
|
|
8
22
|
type HookListResponse,
|
|
9
23
|
type HookGetSampleDataResponse,
|
|
@@ -12,13 +26,13 @@ export {
|
|
|
12
26
|
type HookUnsubscribeResponse,
|
|
13
27
|
type HookUpdateParams,
|
|
14
28
|
type HookListParams,
|
|
29
|
+
type HookPerformParams,
|
|
15
30
|
type HookSubscribeParams,
|
|
16
31
|
} from './hooks';
|
|
32
|
+
export { Models, type ModelListResponse } from './models';
|
|
17
33
|
export {
|
|
18
34
|
Tasks,
|
|
19
|
-
type LlmModel,
|
|
20
35
|
type Task,
|
|
21
|
-
type TaskCreate,
|
|
22
36
|
type TaskStatus,
|
|
23
37
|
type TaskRetrieveResponse,
|
|
24
38
|
type TaskListResponse,
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
export class Models extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get all LLM models
|
|
10
|
+
*/
|
|
11
|
+
list(options?: RequestOptions): APIPromise<ModelListResponse> {
|
|
12
|
+
return this._client.get('/models', options);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ModelListResponse {
|
|
17
|
+
data?: Array<ModelListResponse.Data>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Always "list" for list responses
|
|
21
|
+
*/
|
|
22
|
+
object?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export namespace ModelListResponse {
|
|
26
|
+
export interface Data {
|
|
27
|
+
id?: string;
|
|
28
|
+
|
|
29
|
+
created?: number;
|
|
30
|
+
|
|
31
|
+
object?: string;
|
|
32
|
+
|
|
33
|
+
owned_by?: string;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare namespace Models {
|
|
38
|
+
export { type ModelListResponse as ModelListResponse };
|
|
39
|
+
}
|
|
@@ -7,7 +7,7 @@ import { path } from '../../internal/utils/path';
|
|
|
7
7
|
|
|
8
8
|
export class Screenshots extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* Get
|
|
10
|
+
* Get a specific screenshot by index.
|
|
11
11
|
*/
|
|
12
12
|
retrieve(
|
|
13
13
|
index: number,
|
|
@@ -19,7 +19,7 @@ export class Screenshots extends APIResource {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* List all screenshot URLs for a task.
|
|
23
23
|
*/
|
|
24
24
|
list(taskID: string, options?: RequestOptions): APIPromise<ScreenshotListResponse> {
|
|
25
25
|
return this._client.get(path`/tasks/${taskID}/screenshots`, options);
|