@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,265 @@
|
|
|
1
|
+
import { RFC1738 } from './formats';
|
|
2
|
+
import type { DefaultEncoder, Format } from './types';
|
|
3
|
+
import { isArray } from '../utils/values';
|
|
4
|
+
|
|
5
|
+
export let has = (obj: object, key: PropertyKey): boolean => (
|
|
6
|
+
(has = (Object as any).hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty)),
|
|
7
|
+
has(obj, key)
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
const hex_table = /* @__PURE__ */ (() => {
|
|
11
|
+
const array = [];
|
|
12
|
+
for (let i = 0; i < 256; ++i) {
|
|
13
|
+
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return array;
|
|
17
|
+
})();
|
|
18
|
+
|
|
19
|
+
function compact_queue<T extends Record<string, any>>(queue: Array<{ obj: T; prop: string }>) {
|
|
20
|
+
while (queue.length > 1) {
|
|
21
|
+
const item = queue.pop();
|
|
22
|
+
if (!item) continue;
|
|
23
|
+
|
|
24
|
+
const obj = item.obj[item.prop];
|
|
25
|
+
|
|
26
|
+
if (isArray(obj)) {
|
|
27
|
+
const compacted: unknown[] = [];
|
|
28
|
+
|
|
29
|
+
for (let j = 0; j < obj.length; ++j) {
|
|
30
|
+
if (typeof obj[j] !== 'undefined') {
|
|
31
|
+
compacted.push(obj[j]);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
item.obj[item.prop] = compacted;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function array_to_object(source: any[], options: { plainObjects: boolean }) {
|
|
42
|
+
const obj = options && options.plainObjects ? Object.create(null) : {};
|
|
43
|
+
for (let i = 0; i < source.length; ++i) {
|
|
44
|
+
if (typeof source[i] !== 'undefined') {
|
|
45
|
+
obj[i] = source[i];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return obj;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function merge(
|
|
53
|
+
target: any,
|
|
54
|
+
source: any,
|
|
55
|
+
options: { plainObjects?: boolean; allowPrototypes?: boolean } = {},
|
|
56
|
+
) {
|
|
57
|
+
if (!source) {
|
|
58
|
+
return target;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (typeof source !== 'object') {
|
|
62
|
+
if (isArray(target)) {
|
|
63
|
+
target.push(source);
|
|
64
|
+
} else if (target && typeof target === 'object') {
|
|
65
|
+
if ((options && (options.plainObjects || options.allowPrototypes)) || !has(Object.prototype, source)) {
|
|
66
|
+
target[source] = true;
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
return [target, source];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return target;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (!target || typeof target !== 'object') {
|
|
76
|
+
return [target].concat(source);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
let mergeTarget = target;
|
|
80
|
+
if (isArray(target) && !isArray(source)) {
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
mergeTarget = array_to_object(target, options);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (isArray(target) && isArray(source)) {
|
|
86
|
+
source.forEach(function (item, i) {
|
|
87
|
+
if (has(target, i)) {
|
|
88
|
+
const targetItem = target[i];
|
|
89
|
+
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
|
90
|
+
target[i] = merge(targetItem, item, options);
|
|
91
|
+
} else {
|
|
92
|
+
target.push(item);
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
target[i] = item;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
return target;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
102
|
+
const value = source[key];
|
|
103
|
+
|
|
104
|
+
if (has(acc, key)) {
|
|
105
|
+
acc[key] = merge(acc[key], value, options);
|
|
106
|
+
} else {
|
|
107
|
+
acc[key] = value;
|
|
108
|
+
}
|
|
109
|
+
return acc;
|
|
110
|
+
}, mergeTarget);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function assign_single_source(target: any, source: any) {
|
|
114
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
115
|
+
acc[key] = source[key];
|
|
116
|
+
return acc;
|
|
117
|
+
}, target);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function decode(str: string, _: any, charset: string) {
|
|
121
|
+
const strWithoutPlus = str.replace(/\+/g, ' ');
|
|
122
|
+
if (charset === 'iso-8859-1') {
|
|
123
|
+
// unescape never throws, no try...catch needed:
|
|
124
|
+
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
125
|
+
}
|
|
126
|
+
// utf-8
|
|
127
|
+
try {
|
|
128
|
+
return decodeURIComponent(strWithoutPlus);
|
|
129
|
+
} catch (e) {
|
|
130
|
+
return strWithoutPlus;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const limit = 1024;
|
|
135
|
+
|
|
136
|
+
export const encode: (
|
|
137
|
+
str: any,
|
|
138
|
+
defaultEncoder: DefaultEncoder,
|
|
139
|
+
charset: string,
|
|
140
|
+
type: 'key' | 'value',
|
|
141
|
+
format: Format,
|
|
142
|
+
) => string = (str, _defaultEncoder, charset, _kind, format: Format) => {
|
|
143
|
+
// This code was originally written by Brian White for the io.js core querystring library.
|
|
144
|
+
// It has been adapted here for stricter adherence to RFC 3986
|
|
145
|
+
if (str.length === 0) {
|
|
146
|
+
return str;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
let string = str;
|
|
150
|
+
if (typeof str === 'symbol') {
|
|
151
|
+
string = Symbol.prototype.toString.call(str);
|
|
152
|
+
} else if (typeof str !== 'string') {
|
|
153
|
+
string = String(str);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (charset === 'iso-8859-1') {
|
|
157
|
+
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
|
158
|
+
return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
let out = '';
|
|
163
|
+
for (let j = 0; j < string.length; j += limit) {
|
|
164
|
+
const segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
165
|
+
const arr = [];
|
|
166
|
+
|
|
167
|
+
for (let i = 0; i < segment.length; ++i) {
|
|
168
|
+
let c = segment.charCodeAt(i);
|
|
169
|
+
if (
|
|
170
|
+
c === 0x2d || // -
|
|
171
|
+
c === 0x2e || // .
|
|
172
|
+
c === 0x5f || // _
|
|
173
|
+
c === 0x7e || // ~
|
|
174
|
+
(c >= 0x30 && c <= 0x39) || // 0-9
|
|
175
|
+
(c >= 0x41 && c <= 0x5a) || // a-z
|
|
176
|
+
(c >= 0x61 && c <= 0x7a) || // A-Z
|
|
177
|
+
(format === RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
178
|
+
) {
|
|
179
|
+
arr[arr.length] = segment.charAt(i);
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (c < 0x80) {
|
|
184
|
+
arr[arr.length] = hex_table[c];
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (c < 0x800) {
|
|
189
|
+
arr[arr.length] = hex_table[0xc0 | (c >> 6)]! + hex_table[0x80 | (c & 0x3f)];
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (c < 0xd800 || c >= 0xe000) {
|
|
194
|
+
arr[arr.length] =
|
|
195
|
+
hex_table[0xe0 | (c >> 12)]! + hex_table[0x80 | ((c >> 6) & 0x3f)] + hex_table[0x80 | (c & 0x3f)];
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
i += 1;
|
|
200
|
+
c = 0x10000 + (((c & 0x3ff) << 10) | (segment.charCodeAt(i) & 0x3ff));
|
|
201
|
+
|
|
202
|
+
arr[arr.length] =
|
|
203
|
+
hex_table[0xf0 | (c >> 18)]! +
|
|
204
|
+
hex_table[0x80 | ((c >> 12) & 0x3f)] +
|
|
205
|
+
hex_table[0x80 | ((c >> 6) & 0x3f)] +
|
|
206
|
+
hex_table[0x80 | (c & 0x3f)];
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
out += arr.join('');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return out;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export function compact(value: any) {
|
|
216
|
+
const queue = [{ obj: { o: value }, prop: 'o' }];
|
|
217
|
+
const refs = [];
|
|
218
|
+
|
|
219
|
+
for (let i = 0; i < queue.length; ++i) {
|
|
220
|
+
const item = queue[i];
|
|
221
|
+
// @ts-ignore
|
|
222
|
+
const obj = item.obj[item.prop];
|
|
223
|
+
|
|
224
|
+
const keys = Object.keys(obj);
|
|
225
|
+
for (let j = 0; j < keys.length; ++j) {
|
|
226
|
+
const key = keys[j]!;
|
|
227
|
+
const val = obj[key];
|
|
228
|
+
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
229
|
+
queue.push({ obj: obj, prop: key });
|
|
230
|
+
refs.push(val);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
compact_queue(queue);
|
|
236
|
+
|
|
237
|
+
return value;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export function is_regexp(obj: any) {
|
|
241
|
+
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export function is_buffer(obj: any) {
|
|
245
|
+
if (!obj || typeof obj !== 'object') {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export function combine(a: any, b: any) {
|
|
253
|
+
return [].concat(a, b);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function maybe_map<T>(val: T[], fn: (v: T) => T) {
|
|
257
|
+
if (isArray(val)) {
|
|
258
|
+
const mapped = [];
|
|
259
|
+
for (let i = 0; i < val.length; i += 1) {
|
|
260
|
+
mapped.push(fn(val[i]!));
|
|
261
|
+
}
|
|
262
|
+
return mapped;
|
|
263
|
+
}
|
|
264
|
+
return fn(val);
|
|
265
|
+
}
|
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;
|
|
@@ -302,6 +308,8 @@ export namespace AppListResponse {
|
|
|
302
308
|
|
|
303
309
|
packageName: string;
|
|
304
310
|
|
|
311
|
+
privacyPolicyUrl: string | null;
|
|
312
|
+
|
|
305
313
|
queuedAt: string | null;
|
|
306
314
|
|
|
307
315
|
ratingCount: number | null;
|
|
@@ -322,6 +330,20 @@ export namespace AppListResponse {
|
|
|
322
330
|
|
|
323
331
|
versionName: string;
|
|
324
332
|
}
|
|
333
|
+
|
|
334
|
+
export interface Pagination {
|
|
335
|
+
hasNext: boolean;
|
|
336
|
+
|
|
337
|
+
hasPrev: boolean;
|
|
338
|
+
|
|
339
|
+
page: number;
|
|
340
|
+
|
|
341
|
+
pages: number;
|
|
342
|
+
|
|
343
|
+
pageSize: number;
|
|
344
|
+
|
|
345
|
+
total: number;
|
|
346
|
+
}
|
|
325
347
|
}
|
|
326
348
|
|
|
327
349
|
export interface AppListParams {
|
|
@@ -18,19 +18,49 @@ export class Credentials extends APIResource {
|
|
|
18
18
|
/**
|
|
19
19
|
* List all credentials for the authenticated user
|
|
20
20
|
*/
|
|
21
|
-
list(
|
|
22
|
-
|
|
21
|
+
list(
|
|
22
|
+
query: CredentialListParams | null | undefined = {},
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): APIPromise<CredentialListResponse> {
|
|
25
|
+
return this._client.get('/credentials', { query, ...options });
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
export interface CredentialListResponse {
|
|
27
|
-
|
|
30
|
+
items: Array<CredentialsCredentialsAPI.Credential>;
|
|
31
|
+
|
|
32
|
+
pagination: CredentialListResponse.Pagination;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export namespace CredentialListResponse {
|
|
36
|
+
export interface Pagination {
|
|
37
|
+
hasNext: boolean;
|
|
38
|
+
|
|
39
|
+
hasPrev: boolean;
|
|
40
|
+
|
|
41
|
+
page: number;
|
|
42
|
+
|
|
43
|
+
pages: number;
|
|
44
|
+
|
|
45
|
+
pageSize: number;
|
|
46
|
+
|
|
47
|
+
total: number;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface CredentialListParams {
|
|
52
|
+
page?: number;
|
|
53
|
+
|
|
54
|
+
pageSize?: number;
|
|
28
55
|
}
|
|
29
56
|
|
|
30
57
|
Credentials.Packages = Packages;
|
|
31
58
|
|
|
32
59
|
export declare namespace Credentials {
|
|
33
|
-
export {
|
|
60
|
+
export {
|
|
61
|
+
type CredentialListResponse as CredentialListResponse,
|
|
62
|
+
type CredentialListParams as CredentialListParams,
|
|
63
|
+
};
|
|
34
64
|
|
|
35
65
|
export {
|
|
36
66
|
Packages as Packages,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export { Credentials, type CredentialListResponse } from './credentials';
|
|
3
|
+
export { Credentials, type CredentialListResponse, type CredentialListParams } from './credentials';
|
|
4
4
|
export {
|
|
5
5
|
Packages,
|
|
6
6
|
type PackageCreateResponse,
|
|
@@ -93,12 +93,12 @@ export interface FieldDeleteResponse {
|
|
|
93
93
|
|
|
94
94
|
export interface FieldCreateParams {
|
|
95
95
|
/**
|
|
96
|
-
* Path param
|
|
96
|
+
* Path param
|
|
97
97
|
*/
|
|
98
98
|
packageName: string;
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
* Body param
|
|
101
|
+
* Body param
|
|
102
102
|
*/
|
|
103
103
|
fieldType:
|
|
104
104
|
| 'email'
|
|
@@ -110,24 +110,24 @@ export interface FieldCreateParams {
|
|
|
110
110
|
| 'backup_codes';
|
|
111
111
|
|
|
112
112
|
/**
|
|
113
|
-
* Body param
|
|
113
|
+
* Body param
|
|
114
114
|
*/
|
|
115
115
|
value: string;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
export interface FieldUpdateParams {
|
|
119
119
|
/**
|
|
120
|
-
* Path param
|
|
120
|
+
* Path param
|
|
121
121
|
*/
|
|
122
122
|
packageName: string;
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
|
-
* Path param
|
|
125
|
+
* Path param
|
|
126
126
|
*/
|
|
127
127
|
credentialName: string;
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
* Body param
|
|
130
|
+
* Body param
|
|
131
131
|
*/
|
|
132
132
|
value: string;
|
|
133
133
|
}
|
|
@@ -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
|
+
}
|