@appium/support 7.0.5 → 7.0.6
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/LICENSE +201 -0
- package/build/lib/console.d.ts +42 -88
- package/build/lib/console.d.ts.map +1 -1
- package/build/lib/console.js +20 -80
- package/build/lib/console.js.map +1 -1
- package/build/lib/doctor.d.ts +6 -18
- package/build/lib/doctor.d.ts.map +1 -1
- package/build/lib/doctor.js +0 -15
- package/build/lib/doctor.js.map +1 -1
- package/build/lib/env.d.ts +14 -20
- package/build/lib/env.d.ts.map +1 -1
- package/build/lib/env.js +13 -50
- package/build/lib/env.js.map +1 -1
- package/build/lib/fs.d.ts +109 -148
- package/build/lib/fs.d.ts.map +1 -1
- package/build/lib/fs.js +88 -188
- package/build/lib/fs.js.map +1 -1
- package/build/lib/image-util.d.ts +7 -6
- package/build/lib/image-util.d.ts.map +1 -1
- package/build/lib/image-util.js +9 -6
- package/build/lib/image-util.js.map +1 -1
- package/build/lib/index.d.ts +19 -17
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/logger.d.ts +1 -1
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js +1 -1
- package/build/lib/logger.js.map +1 -1
- package/build/lib/logging.d.ts +7 -15
- package/build/lib/logging.d.ts.map +1 -1
- package/build/lib/logging.js +36 -62
- package/build/lib/logging.js.map +1 -1
- package/build/lib/mjpeg.d.ts +19 -56
- package/build/lib/mjpeg.d.ts.map +1 -1
- package/build/lib/mjpeg.js +53 -76
- package/build/lib/mjpeg.js.map +1 -1
- package/build/lib/mkdirp.d.ts +4 -1
- package/build/lib/mkdirp.d.ts.map +1 -1
- package/build/lib/mkdirp.js +1 -2
- package/build/lib/mkdirp.js.map +1 -1
- package/build/lib/net.d.ts +52 -90
- package/build/lib/net.d.ts.map +1 -1
- package/build/lib/net.js +104 -193
- package/build/lib/net.js.map +1 -1
- package/build/lib/node.d.ts +16 -17
- package/build/lib/node.d.ts.map +1 -1
- package/build/lib/node.js +106 -111
- package/build/lib/node.js.map +1 -1
- package/build/lib/npm.d.ts +65 -86
- package/build/lib/npm.d.ts.map +1 -1
- package/build/lib/npm.js +59 -117
- package/build/lib/npm.js.map +1 -1
- package/build/lib/plist.d.ts +36 -29
- package/build/lib/plist.d.ts.map +1 -1
- package/build/lib/plist.js +62 -59
- package/build/lib/plist.js.map +1 -1
- package/build/lib/process.d.ts +19 -2
- package/build/lib/process.d.ts.map +1 -1
- package/build/lib/process.js +24 -7
- package/build/lib/process.js.map +1 -1
- package/build/lib/system.d.ts +41 -6
- package/build/lib/system.d.ts.map +1 -1
- package/build/lib/system.js +46 -11
- package/build/lib/system.js.map +1 -1
- package/build/lib/tempdir.d.ts +26 -49
- package/build/lib/tempdir.d.ts.map +1 -1
- package/build/lib/tempdir.js +41 -73
- package/build/lib/tempdir.js.map +1 -1
- package/build/lib/timing.d.ts +28 -22
- package/build/lib/timing.d.ts.map +1 -1
- package/build/lib/timing.js +16 -17
- package/build/lib/timing.js.map +1 -1
- package/build/lib/util.d.ts +164 -181
- package/build/lib/util.d.ts.map +1 -1
- package/build/lib/util.js +193 -247
- package/build/lib/util.js.map +1 -1
- package/build/lib/zip.d.ts +81 -139
- package/build/lib/zip.d.ts.map +1 -1
- package/build/lib/zip.js +210 -258
- package/build/lib/zip.js.map +1 -1
- package/lib/console.ts +139 -0
- package/lib/{doctor.js → doctor.ts} +6 -20
- package/lib/{env.js → env.ts} +31 -59
- package/lib/fs.ts +453 -0
- package/lib/image-util.ts +40 -0
- package/lib/index.ts +1 -0
- package/lib/{logger.js → logger.ts} +1 -1
- package/lib/logging.ts +157 -0
- package/lib/mjpeg.ts +186 -0
- package/lib/{mkdirp.js → mkdirp.ts} +2 -2
- package/lib/net.ts +305 -0
- package/lib/{node.js → node.ts} +134 -133
- package/lib/npm.ts +291 -0
- package/lib/plist.ts +187 -0
- package/lib/process.ts +62 -0
- package/lib/system.ts +95 -0
- package/lib/tempdir.ts +115 -0
- package/lib/{timing.js → timing.ts} +28 -33
- package/lib/util.ts +561 -0
- package/lib/{zip.js → zip.ts} +341 -296
- package/package.json +20 -22
- package/tsconfig.json +3 -5
- package/index.js +0 -1
- package/lib/console.js +0 -173
- package/lib/fs.js +0 -496
- package/lib/image-util.js +0 -32
- package/lib/logging.js +0 -145
- package/lib/mjpeg.js +0 -207
- package/lib/net.js +0 -336
- package/lib/npm.js +0 -310
- package/lib/plist.js +0 -182
- package/lib/process.js +0 -46
- package/lib/system.js +0 -48
- package/lib/tempdir.js +0 -131
- package/lib/util.js +0 -584
package/build/lib/net.js
CHANGED
|
@@ -7,7 +7,6 @@ exports.uploadFile = uploadFile;
|
|
|
7
7
|
exports.downloadFile = downloadFile;
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
9
|
const fs_1 = require("./fs");
|
|
10
|
-
const bluebird_1 = __importDefault(require("bluebird"));
|
|
11
10
|
const util_1 = require("./util");
|
|
12
11
|
const logger_1 = __importDefault(require("./logger"));
|
|
13
12
|
const jsftp_1 = __importDefault(require("jsftp"));
|
|
@@ -16,37 +15,107 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
16
15
|
const form_data_1 = __importDefault(require("form-data"));
|
|
17
16
|
const DEFAULT_TIMEOUT_MS = 4 * 60 * 1000;
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @param {any} value
|
|
21
|
-
* @returns {value is AuthCredentials | import('axios').AxiosBasicCredentials}
|
|
18
|
+
* Uploads the given file to a remote location. HTTP(S) and FTP protocols are supported.
|
|
22
19
|
*/
|
|
23
|
-
function
|
|
24
|
-
|
|
20
|
+
async function uploadFile(localPath, remoteUri, uploadOptions = {}) {
|
|
21
|
+
if (!(await fs_1.fs.exists(localPath))) {
|
|
22
|
+
throw new Error(`'${localPath}' does not exist or is not accessible`);
|
|
23
|
+
}
|
|
24
|
+
const { isMetered = true } = uploadOptions;
|
|
25
|
+
const url = new URL(remoteUri);
|
|
26
|
+
const { size } = await fs_1.fs.stat(localPath);
|
|
27
|
+
if (isMetered) {
|
|
28
|
+
logger_1.default.info(`Uploading '${localPath}' of ${(0, util_1.toReadableSizeString)(size)} size to '${remoteUri}'`);
|
|
29
|
+
}
|
|
30
|
+
const timer = new timing_1.Timer().start();
|
|
31
|
+
if (isHttpUploadOptions(uploadOptions, url)) {
|
|
32
|
+
if (!uploadOptions.fileFieldName) {
|
|
33
|
+
uploadOptions.headers = {
|
|
34
|
+
...(lodash_1.default.isPlainObject(uploadOptions.headers) ? uploadOptions.headers : {}),
|
|
35
|
+
'Content-Length': size,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
await uploadFileToHttp(fs_1.fs.createReadStream(localPath), url, uploadOptions);
|
|
39
|
+
}
|
|
40
|
+
else if (isFtpUploadOptions(uploadOptions, url)) {
|
|
41
|
+
await uploadFileToFtp(fs_1.fs.createReadStream(localPath), url, uploadOptions);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
throw new Error(`Cannot upload the file at '${localPath}' to '${remoteUri}'. ` +
|
|
45
|
+
`Unsupported remote protocol '${url.protocol}'. ` +
|
|
46
|
+
`Only http/https and ftp/ftps protocols are supported.`);
|
|
47
|
+
}
|
|
48
|
+
if (isMetered) {
|
|
49
|
+
logger_1.default.info(`Uploaded '${localPath}' of ${(0, util_1.toReadableSizeString)(size)} size in ` +
|
|
50
|
+
`${timer.getDuration().asSeconds.toFixed(3)}s`);
|
|
51
|
+
}
|
|
25
52
|
}
|
|
26
53
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @
|
|
54
|
+
* Downloads the given file via HTTP(S).
|
|
55
|
+
*
|
|
56
|
+
* @throws {Error} If download operation fails
|
|
30
57
|
*/
|
|
58
|
+
async function downloadFile(remoteUrl, dstPath, downloadOptions = {}) {
|
|
59
|
+
const { isMetered = true, auth, timeout = DEFAULT_TIMEOUT_MS, headers } = downloadOptions;
|
|
60
|
+
const requestOpts = {
|
|
61
|
+
url: remoteUrl,
|
|
62
|
+
responseType: 'stream',
|
|
63
|
+
timeout,
|
|
64
|
+
};
|
|
65
|
+
const axiosAuth = toAxiosAuth(auth);
|
|
66
|
+
if (axiosAuth) {
|
|
67
|
+
requestOpts.auth = axiosAuth;
|
|
68
|
+
}
|
|
69
|
+
if (lodash_1.default.isPlainObject(headers)) {
|
|
70
|
+
requestOpts.headers = headers;
|
|
71
|
+
}
|
|
72
|
+
const timer = new timing_1.Timer().start();
|
|
73
|
+
let responseLength;
|
|
74
|
+
try {
|
|
75
|
+
const writer = fs_1.fs.createWriteStream(dstPath);
|
|
76
|
+
const { data: responseStream, headers: responseHeaders } = await (0, axios_1.default)(requestOpts);
|
|
77
|
+
responseLength = parseInt(String(responseHeaders['content-length'] ?? '0'), 10);
|
|
78
|
+
responseStream.pipe(writer);
|
|
79
|
+
await new Promise((resolve, reject) => {
|
|
80
|
+
responseStream.once('error', reject);
|
|
81
|
+
writer.once('finish', () => resolve());
|
|
82
|
+
writer.once('error', (e) => {
|
|
83
|
+
responseStream.unpipe(writer);
|
|
84
|
+
reject(e);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
90
|
+
throw new Error(`Cannot download the file from ${remoteUrl}: ${message}`);
|
|
91
|
+
}
|
|
92
|
+
const { size } = await fs_1.fs.stat(dstPath);
|
|
93
|
+
if (responseLength && size !== responseLength) {
|
|
94
|
+
await fs_1.fs.rimraf(dstPath);
|
|
95
|
+
throw new Error(`The size of the file downloaded from ${remoteUrl} (${size} bytes) ` +
|
|
96
|
+
`differs from the one in Content-Length response header (${responseLength} bytes)`);
|
|
97
|
+
}
|
|
98
|
+
if (isMetered) {
|
|
99
|
+
const secondsElapsed = timer.getDuration().asSeconds;
|
|
100
|
+
logger_1.default.debug(`${remoteUrl} (${(0, util_1.toReadableSizeString)(size)}) ` +
|
|
101
|
+
`has been downloaded to '${dstPath}' in ${secondsElapsed.toFixed(3)}s`);
|
|
102
|
+
if (secondsElapsed >= 2) {
|
|
103
|
+
const bytesPerSec = Math.floor(size / secondsElapsed);
|
|
104
|
+
logger_1.default.debug(`Approximate download speed: ${(0, util_1.toReadableSizeString)(bytesPerSec)}/s`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
31
108
|
function toAxiosAuth(auth) {
|
|
32
|
-
if (!
|
|
109
|
+
if (!auth || !lodash_1.default.isPlainObject(auth)) {
|
|
33
110
|
return null;
|
|
34
111
|
}
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
return axiosAuth.username && axiosAuth.password ? axiosAuth : null;
|
|
112
|
+
const username = 'username' in auth ? auth.username : auth.user;
|
|
113
|
+
const password = 'password' in auth ? auth.password : auth.pass;
|
|
114
|
+
return username && password ? { username, password } : null;
|
|
40
115
|
}
|
|
41
|
-
|
|
42
|
-
* @param {NodeJS.ReadableStream} localFileStream
|
|
43
|
-
* @param {URL} parsedUri
|
|
44
|
-
* @param {HttpUploadOptions & NetOptions} [uploadOptions]
|
|
45
|
-
*/
|
|
46
|
-
async function uploadFileToHttp(localFileStream, parsedUri, uploadOptions = /** @type {HttpUploadOptions & NetOptions} */ ({})) {
|
|
116
|
+
async function uploadFileToHttp(localFileStream, parsedUri, uploadOptions = {}) {
|
|
47
117
|
const { method = 'POST', timeout = DEFAULT_TIMEOUT_MS, headers, auth, fileFieldName = 'file', formFields, } = uploadOptions;
|
|
48
118
|
const { href } = parsedUri;
|
|
49
|
-
/** @type {import('axios').RawAxiosRequestConfig} */
|
|
50
119
|
const requestOpts = {
|
|
51
120
|
url: href,
|
|
52
121
|
method,
|
|
@@ -74,7 +143,8 @@ async function uploadFileToHttp(localFileStream, parsedUri, uploadOptions = /**
|
|
|
74
143
|
}
|
|
75
144
|
}
|
|
76
145
|
}
|
|
77
|
-
|
|
146
|
+
// AWS S3 POST upload requires this to be the last field; do not move before formFields.
|
|
147
|
+
form.append(fileFieldName, localFileStream);
|
|
78
148
|
requestOpts.headers = {
|
|
79
149
|
...(lodash_1.default.isPlainObject(headers) ? headers : {}),
|
|
80
150
|
...form.getHeaders(),
|
|
@@ -92,24 +162,19 @@ async function uploadFileToHttp(localFileStream, parsedUri, uploadOptions = /**
|
|
|
92
162
|
const { status, statusText } = await (0, axios_1.default)(requestOpts);
|
|
93
163
|
logger_1.default.info(`Server response: ${status} ${statusText}`);
|
|
94
164
|
}
|
|
95
|
-
|
|
96
|
-
* @param {string | Buffer | NodeJS.ReadableStream} localFileStream
|
|
97
|
-
* @param {URL} parsedUri
|
|
98
|
-
* @param {NotHttpUploadOptions & NetOptions} [uploadOptions]
|
|
99
|
-
*/
|
|
100
|
-
async function uploadFileToFtp(localFileStream, parsedUri, uploadOptions = /** @type {NotHttpUploadOptions & NetOptions} */ ({})) {
|
|
165
|
+
async function uploadFileToFtp(localFileStream, parsedUri, uploadOptions = {}) {
|
|
101
166
|
const { auth } = uploadOptions;
|
|
102
|
-
const { hostname, port,
|
|
167
|
+
const { protocol, hostname, port, pathname } = parsedUri;
|
|
103
168
|
const ftpOpts = {
|
|
104
|
-
host: hostname,
|
|
105
|
-
port:
|
|
169
|
+
host: hostname ?? '',
|
|
170
|
+
port: port !== undefined && port !== '' ? lodash_1.default.parseInt(port, 10) : 21,
|
|
106
171
|
};
|
|
107
172
|
if (auth?.user && auth?.pass) {
|
|
108
173
|
ftpOpts.user = auth.user;
|
|
109
174
|
ftpOpts.pass = auth.pass;
|
|
110
175
|
}
|
|
111
|
-
logger_1.default.debug(`${protocol} upload options: ${JSON.stringify(ftpOpts)}`);
|
|
112
|
-
return await new
|
|
176
|
+
logger_1.default.debug(`${protocol.slice(0, -1)} upload options: ${JSON.stringify(ftpOpts)}`);
|
|
177
|
+
return await new Promise((resolve, reject) => {
|
|
113
178
|
new jsftp_1.default(ftpOpts).put(localFileStream, pathname, (err) => {
|
|
114
179
|
if (err) {
|
|
115
180
|
reject(err);
|
|
@@ -120,176 +185,22 @@ async function uploadFileToFtp(localFileStream, parsedUri, uploadOptions = /** @
|
|
|
120
185
|
});
|
|
121
186
|
});
|
|
122
187
|
}
|
|
123
|
-
/**
|
|
124
|
-
* Returns `true` if params are valid for {@linkcode uploadFileToHttp}.
|
|
125
|
-
* @param {any} opts
|
|
126
|
-
* @param {URL} url
|
|
127
|
-
* @returns {opts is HttpUploadOptions & NetOptions}
|
|
128
|
-
*/
|
|
129
188
|
function isHttpUploadOptions(opts, url) {
|
|
130
189
|
try {
|
|
131
|
-
|
|
132
|
-
return protocol === 'http:' || protocol === 'https:';
|
|
190
|
+
return url.protocol === 'http:' || url.protocol === 'https:';
|
|
133
191
|
}
|
|
134
192
|
catch {
|
|
135
193
|
return false;
|
|
136
194
|
}
|
|
137
195
|
}
|
|
138
|
-
/**
|
|
139
|
-
|
|
140
|
-
* @param {any} opts
|
|
141
|
-
* @param {URL} url
|
|
142
|
-
* @returns {opts is NotHttpUploadOptions & NetOptions}
|
|
143
|
-
*/
|
|
144
|
-
function isNotHttpUploadOptions(opts, url) {
|
|
196
|
+
/** Returns true if the URL is FTP, i.e. the options are for FTP upload. */
|
|
197
|
+
function isFtpUploadOptions(opts, url) {
|
|
145
198
|
try {
|
|
146
|
-
|
|
147
|
-
return protocol === 'ftp:';
|
|
199
|
+
return url.protocol === 'ftp:';
|
|
148
200
|
}
|
|
149
201
|
catch {
|
|
150
202
|
return false;
|
|
151
203
|
}
|
|
152
204
|
}
|
|
153
|
-
|
|
154
|
-
* Uploads the given file to a remote location. HTTP(S) and FTP
|
|
155
|
-
* protocols are supported.
|
|
156
|
-
*
|
|
157
|
-
* @param {string} localPath - The path to a file on the local storage.
|
|
158
|
-
* @param {string} remoteUri - The remote URI to upload the file to.
|
|
159
|
-
* @param {(HttpUploadOptions|NotHttpUploadOptions) & NetOptions} [uploadOptions]
|
|
160
|
-
* @returns {Promise<void>}
|
|
161
|
-
*/
|
|
162
|
-
async function uploadFile(localPath, remoteUri, uploadOptions = /** @type {(HttpUploadOptions|NotHttpUploadOptions) & NetOptions} */ ({})) {
|
|
163
|
-
if (!(await fs_1.fs.exists(localPath))) {
|
|
164
|
-
throw new Error(`'${localPath}' does not exists or is not accessible`);
|
|
165
|
-
}
|
|
166
|
-
const { isMetered = true } = uploadOptions;
|
|
167
|
-
const url = new URL(remoteUri);
|
|
168
|
-
const { size } = await fs_1.fs.stat(localPath);
|
|
169
|
-
if (isMetered) {
|
|
170
|
-
logger_1.default.info(`Uploading '${localPath}' of ${(0, util_1.toReadableSizeString)(size)} size to '${remoteUri}'`);
|
|
171
|
-
}
|
|
172
|
-
const timer = new timing_1.Timer().start();
|
|
173
|
-
if (isHttpUploadOptions(uploadOptions, url)) {
|
|
174
|
-
if (!uploadOptions.fileFieldName) {
|
|
175
|
-
uploadOptions.headers = {
|
|
176
|
-
...(lodash_1.default.isPlainObject(uploadOptions.headers) ? uploadOptions.headers : {}),
|
|
177
|
-
'Content-Length': size,
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
await uploadFileToHttp(fs_1.fs.createReadStream(localPath), url, uploadOptions);
|
|
181
|
-
}
|
|
182
|
-
else if (isNotHttpUploadOptions(uploadOptions, url)) {
|
|
183
|
-
await uploadFileToFtp(fs_1.fs.createReadStream(localPath), url, uploadOptions);
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
throw new Error(`Cannot upload the file at '${localPath}' to '${remoteUri}'. ` +
|
|
187
|
-
`Unsupported remote protocol '${url.protocol}'. ` +
|
|
188
|
-
`Only http/https and ftp/ftps protocols are supported.`);
|
|
189
|
-
}
|
|
190
|
-
if (isMetered) {
|
|
191
|
-
logger_1.default.info(`Uploaded '${localPath}' of ${(0, util_1.toReadableSizeString)(size)} size in ` +
|
|
192
|
-
`${timer.getDuration().asSeconds.toFixed(3)}s`);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Downloads the given file via HTTP(S)
|
|
197
|
-
*
|
|
198
|
-
* @param {string} remoteUrl - The remote url
|
|
199
|
-
* @param {string} dstPath - The local path to download the file to
|
|
200
|
-
* @param {DownloadOptions & NetOptions} [downloadOptions]
|
|
201
|
-
* @throws {Error} If download operation fails
|
|
202
|
-
*/
|
|
203
|
-
async function downloadFile(remoteUrl, dstPath, downloadOptions = /** @type {DownloadOptions & NetOptions} */ ({})) {
|
|
204
|
-
const { isMetered = true, auth, timeout = DEFAULT_TIMEOUT_MS, headers } = downloadOptions;
|
|
205
|
-
/**
|
|
206
|
-
* @type {import('axios').RawAxiosRequestConfig}
|
|
207
|
-
*/
|
|
208
|
-
const requestOpts = {
|
|
209
|
-
url: remoteUrl,
|
|
210
|
-
responseType: 'stream',
|
|
211
|
-
timeout,
|
|
212
|
-
};
|
|
213
|
-
const axiosAuth = toAxiosAuth(auth);
|
|
214
|
-
if (axiosAuth) {
|
|
215
|
-
requestOpts.auth = axiosAuth;
|
|
216
|
-
}
|
|
217
|
-
if (lodash_1.default.isPlainObject(headers)) {
|
|
218
|
-
requestOpts.headers = headers;
|
|
219
|
-
}
|
|
220
|
-
const timer = new timing_1.Timer().start();
|
|
221
|
-
let responseLength;
|
|
222
|
-
try {
|
|
223
|
-
const writer = fs_1.fs.createWriteStream(dstPath);
|
|
224
|
-
const { data: responseStream, headers: responseHeaders } = await (0, axios_1.default)(requestOpts);
|
|
225
|
-
responseLength = parseInt(responseHeaders['content-length'] || '0', 10);
|
|
226
|
-
responseStream.pipe(writer);
|
|
227
|
-
await new bluebird_1.default((resolve, reject) => {
|
|
228
|
-
responseStream.once('error', reject);
|
|
229
|
-
writer.once('finish', resolve);
|
|
230
|
-
writer.once('error', (e) => {
|
|
231
|
-
responseStream.unpipe(writer);
|
|
232
|
-
reject(e);
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
catch (err) {
|
|
237
|
-
throw new Error(`Cannot download the file from ${remoteUrl}: ${err.message}`);
|
|
238
|
-
}
|
|
239
|
-
const { size } = await fs_1.fs.stat(dstPath);
|
|
240
|
-
if (responseLength && size !== responseLength) {
|
|
241
|
-
await fs_1.fs.rimraf(dstPath);
|
|
242
|
-
throw new Error(`The size of the file downloaded from ${remoteUrl} (${size} bytes) ` +
|
|
243
|
-
`differs from the one in Content-Length response header (${responseLength} bytes)`);
|
|
244
|
-
}
|
|
245
|
-
if (isMetered) {
|
|
246
|
-
const secondsElapsed = timer.getDuration().asSeconds;
|
|
247
|
-
logger_1.default.debug(`${remoteUrl} (${(0, util_1.toReadableSizeString)(size)}) ` +
|
|
248
|
-
`has been downloaded to '${dstPath}' in ${secondsElapsed.toFixed(3)}s`);
|
|
249
|
-
if (secondsElapsed >= 2) {
|
|
250
|
-
const bytesPerSec = Math.floor(size / secondsElapsed);
|
|
251
|
-
logger_1.default.debug(`Approximate download speed: ${(0, util_1.toReadableSizeString)(bytesPerSec)}/s`);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Common options for {@linkcode uploadFile} and {@linkcode downloadFile}.
|
|
257
|
-
* @typedef NetOptions
|
|
258
|
-
* @property {boolean} [isMetered=true] - Whether to log the actual download performance
|
|
259
|
-
* (e.g. timings and speed)
|
|
260
|
-
* @property {AuthCredentials} [auth] - Authentication credentials
|
|
261
|
-
*/
|
|
262
|
-
/**
|
|
263
|
-
* Specific options for {@linkcode downloadFile}.
|
|
264
|
-
* @typedef DownloadOptions
|
|
265
|
-
* @property {number} [timeout] - The actual request timeout in milliseconds; defaults to {@linkcode DEFAULT_TIMEOUT_MS}
|
|
266
|
-
* @property {Record<string,any>} [headers] - Request headers mapping
|
|
267
|
-
*/
|
|
268
|
-
/**
|
|
269
|
-
* Basic auth credentials; used by {@linkcode NetOptions}.
|
|
270
|
-
* @typedef AuthCredentials
|
|
271
|
-
* @property {string} user - Non-empty user name
|
|
272
|
-
* @property {string} pass - Non-empty password
|
|
273
|
-
*/
|
|
274
|
-
/**
|
|
275
|
-
* This type is used in {@linkcode uploadFile} if the remote location uses the `ftp` protocol, and distinguishes the type from {@linkcode HttpUploadOptions}.
|
|
276
|
-
* @typedef NotHttpUploadOptions
|
|
277
|
-
* @property {never} headers
|
|
278
|
-
* @property {never} method
|
|
279
|
-
* @property {never} timeout
|
|
280
|
-
* @property {never} fileFieldName
|
|
281
|
-
* @property {never} formFields
|
|
282
|
-
*/
|
|
283
|
-
/**
|
|
284
|
-
* Specific options for {@linkcode uploadFile} if the remote location uses the `http(s)` protocol
|
|
285
|
-
* @typedef HttpUploadOptions
|
|
286
|
-
* @property {import('@appium/types').HTTPHeaders} [headers] - Additional request headers mapping
|
|
287
|
-
* @property {import('axios').Method} [method='POST'] - The HTTP method used for file upload
|
|
288
|
-
* @property {number} [timeout] - The actual request timeout in milliseconds; defaults to {@linkcode DEFAULT_TIMEOUT_MS}
|
|
289
|
-
* @property {string} [fileFieldName='file'] - The name of the form field containing the file
|
|
290
|
-
* content to be uploaded. Any falsy value make the request to use non-multipart upload
|
|
291
|
-
* @property {Record<string, any> | [string, any][]} [formFields] - The additional form fields
|
|
292
|
-
* to be included into the upload request. This property is only considered if
|
|
293
|
-
* `fileFieldName` is set
|
|
294
|
-
*/
|
|
205
|
+
// #endregion
|
|
295
206
|
//# sourceMappingURL=net.js.map
|
package/build/lib/net.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"net.js","sourceRoot":"","sources":["../../lib/net.
|
|
1
|
+
{"version":3,"file":"net.js","sourceRoot":"","sources":["../../lib/net.ts"],"names":[],"mappings":";;;;;AAoEA,gCAuCC;AAOD,oCA4DC;AA9KD,oDAAuB;AACvB,6BAAwB;AACxB,iCAA4C;AAC5C,sDAA2B;AAC3B,kDAAwB;AACxB,qCAA+B;AAC/B,kDAAiG;AACjG,0DAAiC;AAGjC,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAuDzC;;GAEG;AACI,KAAK,UAAU,UAAU,CAC9B,SAAiB,EACjB,SAAiB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AI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjF,OAAO,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACjD,IAAI,eAAG,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE;YACtD,IAAI,GAAG,EAAE,CAAC;gBACR,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,mBAAmB,CAC1B,IAA0C,EAC1C,GAAQ;IAER,IAAI,CAAC;QACH,OAAO,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC;IAC/D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,2EAA2E;AAC3E,SAAS,kBAAkB,CACzB,IAA0C,EAC1C,GAAQ;IAER,IAAI,CAAC;QACH,OAAO,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,aAAa"}
|
package/build/lib/node.d.ts
CHANGED
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
* modules that are installed globally. If the package cannot be required,
|
|
4
4
|
* this will attempt to link the package and then re-require it
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
7
|
-
* @returns
|
|
6
|
+
* @param packageName - the name of the package to be required
|
|
7
|
+
* @returns The package object
|
|
8
8
|
* @throws {Error} If the package is not found locally or globally
|
|
9
9
|
*/
|
|
10
|
-
export function requirePackage(packageName: string): Promise<unknown>;
|
|
10
|
+
export declare function requirePackage(packageName: string): Promise<unknown>;
|
|
11
11
|
/**
|
|
12
12
|
* Calculate the in-depth size in memory of the provided object.
|
|
13
13
|
* The original implementation is borrowed from https://github.com/miktam/sizeof.
|
|
14
14
|
*
|
|
15
|
-
* @param
|
|
16
|
-
* @returns
|
|
15
|
+
* @param obj - An object whose size should be calculated
|
|
16
|
+
* @returns Object size in bytes.
|
|
17
17
|
*/
|
|
18
|
-
export function getObjectSize(obj:
|
|
18
|
+
export declare function getObjectSize(obj: unknown): number;
|
|
19
19
|
/**
|
|
20
20
|
* Calculates a unique object identifier
|
|
21
21
|
*
|
|
22
|
-
* @param
|
|
23
|
-
* @returns
|
|
22
|
+
* @param object - Any valid ECMA object
|
|
23
|
+
* @returns A uuidV4 string that uniquely identifies given object
|
|
24
24
|
*/
|
|
25
|
-
export function getObjectId(object: object): string;
|
|
25
|
+
export declare function getObjectId(object: object): string;
|
|
26
26
|
/**
|
|
27
27
|
* Perform deep freeze of the given object (e. g.
|
|
28
28
|
* all nested objects also become immutable).
|
|
@@ -32,19 +32,18 @@ export function getObjectId(object: object): string;
|
|
|
32
32
|
* ! This function changes the given object,
|
|
33
33
|
* so it becomes immutable.
|
|
34
34
|
*
|
|
35
|
-
* @param
|
|
36
|
-
* @returns
|
|
37
|
-
* function after it was made immutable.
|
|
35
|
+
* @param object - Any valid ECMA object
|
|
36
|
+
* @returns The same object that was passed after it was made immutable.
|
|
38
37
|
*/
|
|
39
|
-
export function deepFreeze(object:
|
|
38
|
+
export declare function deepFreeze<T>(object: T): T;
|
|
40
39
|
/**
|
|
41
40
|
* Tries to synchronously detect the absolute path to the folder
|
|
42
41
|
* where the given `moduleName` is located.
|
|
43
42
|
*
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
43
|
+
* @param moduleName - The name of the module as it is written in package.json
|
|
44
|
+
* @param filePath - Full path to any of files that `moduleName` contains. Use
|
|
46
45
|
* `__filename` to find the root of the module where this helper is called.
|
|
47
|
-
* @returns
|
|
46
|
+
* @returns Full path to the module root, or null if not found
|
|
48
47
|
*/
|
|
49
|
-
export function getModuleRootSync(moduleName: string, filePath: string): string | null;
|
|
48
|
+
export declare function getModuleRootSync(moduleName: string, filePath: string): string | null;
|
|
50
49
|
//# sourceMappingURL=node.d.ts.map
|
package/build/lib/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../lib/node.
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../lib/node.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA8B1E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQlD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAc1C;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmBrF"}
|