@appium/support 4.5.0 → 5.0.2
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/README.md +0 -1
- package/build/lib/index.d.ts +0 -1
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/logging.d.ts +7 -44
- package/build/lib/logging.d.ts.map +1 -1
- package/build/lib/logging.js +73 -105
- package/build/lib/logging.js.map +1 -1
- package/build/lib/util.d.ts +0 -9
- package/build/lib/util.d.ts.map +1 -1
- package/build/lib/util.js +1 -13
- package/build/lib/util.js.map +1 -1
- package/lib/index.ts +0 -1
- package/lib/logging.js +72 -112
- package/lib/util.js +0 -13
- package/package.json +5 -5
- package/build/lib/log-internal.d.ts +0 -51
- package/build/lib/log-internal.d.ts.map +0 -1
- package/build/lib/log-internal.js +0 -149
- package/build/lib/log-internal.js.map +0 -1
- package/lib/log-internal.js +0 -155
package/README.md
CHANGED
|
@@ -51,7 +51,6 @@ All utility functions are split into a bunch of different categories. Each categ
|
|
|
51
51
|
|env|Several helpers needed by the server to cope with internal dependencies and manifests|
|
|
52
52
|
|fs|Most of the functions here are just thin wrappers over utility functions available in [Promises API](https://nodejs.org/api/fs.html#promises-api)|
|
|
53
53
|
|image-util|Utilities to work with images. Use [sharp](https://github.com/lovell/sharp) under the hood.<br>:bangbang: Node >=18.17 is required to use these utilities|
|
|
54
|
-
|log-internal|Utilities needed for internal Appium log config assistance|
|
|
55
54
|
|logging|See [the logging section below](#logging)|
|
|
56
55
|
|mjpeg|Helpers needed to implement [MJPEG streaming](https://en.wikipedia.org/wiki/Motion_JPEG#Video_streaming)|
|
|
57
56
|
|net|Helpers needed for network interactions, for example, upload and download of files|
|
package/build/lib/index.d.ts
CHANGED
|
@@ -96,5 +96,4 @@ export type { InstallPackageOpts, ExecOpts, NpmInstallReceipt } from './npm';
|
|
|
96
96
|
export type { Affixes, OpenedAffixes } from './tempdir';
|
|
97
97
|
export type { PluralizeOptions, EncodingOptions, LockFileOptions, NonEmptyString } from './util';
|
|
98
98
|
export type { ExtractAllOptions, ZipEntry, ZipOptions, ZipCompressionOptions, ZipSourceOptions, } from './zip';
|
|
99
|
-
export type { SecureValuePreprocessingRule } from './log-internal';
|
|
100
99
|
//# sourceMappingURL=index.d.ts.map
|
package/build/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAC,EAAE,EAAC,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAO,gBAAgB,8BAAQ,CAAC;AAEhC,OAAO,EACL,OAAO,EACP,MAAM,EACN,IAAI,EACJ,EAAE,EACF,gBAAgB,EAChB,KAAK,EACL,MAAM,EACN,M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AAqB,EACrB,gBAAgB,GACjB,MAAM,OAAO,CAAC"}
|
package/build/lib/logging.d.ts
CHANGED
|
@@ -1,51 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {AppiumLoggerPrefix?} [prefix=null]
|
|
4
|
+
* @returns {AppiumLogger}
|
|
5
|
+
*/
|
|
6
|
+
export function getLogger(prefix?: import("@appium/types").AppiumLoggerPrefix | null | undefined): AppiumLogger;
|
|
1
7
|
/** @type {import('@appium/types').AppiumLoggerLevel[]} */
|
|
2
8
|
export const LEVELS: import('@appium/types').AppiumLoggerLevel[];
|
|
9
|
+
export const log: import("@appium/types").AppiumLogger;
|
|
3
10
|
export default log;
|
|
4
|
-
export type LoadResult = {
|
|
5
|
-
/**
|
|
6
|
-
* The list of rule parsing issues (one item per rule).
|
|
7
|
-
* Rules with issues are skipped. An empty list is returned if no parsing issues exist.
|
|
8
|
-
*/
|
|
9
|
-
issues: string[];
|
|
10
|
-
/**
|
|
11
|
-
* The list of successfully loaded
|
|
12
|
-
* replacement rules. The list could be empty if no rules were loaded.
|
|
13
|
-
*/
|
|
14
|
-
rules: import('./log-internal').SecureValuePreprocessingRule[];
|
|
15
|
-
};
|
|
16
11
|
export type AppiumLoggerPrefix = import('@appium/types').AppiumLoggerPrefix;
|
|
17
12
|
export type AppiumLogger = import('@appium/types').AppiumLogger;
|
|
18
13
|
export type AppiumLoggerLevel = import('@appium/types').AppiumLoggerLevel;
|
|
19
|
-
export const log: import("@appium/types").AppiumLogger;
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param {import('@appium/logger').Logger} logger
|
|
23
|
-
*/
|
|
24
|
-
export function patchLogger(logger: import('@appium/logger').Logger): void;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @param {AppiumLoggerPrefix?} prefix
|
|
28
|
-
* @returns {AppiumLogger}
|
|
29
|
-
*/
|
|
30
|
-
export function getLogger(prefix?: AppiumLoggerPrefix | null): AppiumLogger;
|
|
31
|
-
/**
|
|
32
|
-
* @typedef LoadResult
|
|
33
|
-
* @property {string[]} issues The list of rule parsing issues (one item per rule).
|
|
34
|
-
* Rules with issues are skipped. An empty list is returned if no parsing issues exist.
|
|
35
|
-
* @property {import('./log-internal').SecureValuePreprocessingRule[]} rules The list of successfully loaded
|
|
36
|
-
* replacement rules. The list could be empty if no rules were loaded.
|
|
37
|
-
*/
|
|
38
|
-
/**
|
|
39
|
-
* Loads the JSON file containing secure values replacement rules.
|
|
40
|
-
* This might be necessary to hide sensitive values that may possibly
|
|
41
|
-
* appear in Appium logs.
|
|
42
|
-
* Each call to this method replaces the previously loaded rules if any existed.
|
|
43
|
-
*
|
|
44
|
-
* @param {string|string[]|import('@appium/types').LogFiltersConfig} rulesJsonPath The full path to the JSON file containing
|
|
45
|
-
* the replacement rules. Each rule could either be a string to be replaced
|
|
46
|
-
* or an object with predefined properties.
|
|
47
|
-
* @throws {Error} If the given file cannot be loaded
|
|
48
|
-
* @returns {Promise<LoadResult>}
|
|
49
|
-
*/
|
|
50
|
-
export function loadSecureValuesPreprocessingRules(rulesJsonPath: string | string[] | import('@appium/types').LogFiltersConfig): Promise<LoadResult>;
|
|
51
14
|
//# sourceMappingURL=logging.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../lib/logging.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../lib/logging.js"],"names":[],"mappings":"AAwBA;;;;GAIG;AACH,mGAFa,YAAY,CA0DxB;AAjFD,0DAA0D;AAC1D,qBADW,OAAO,eAAe,EAAE,iBAAiB,EAAE,CAC+B;AAIrF,uDAA+B;;iCAoHlB,OAAO,eAAe,EAAE,kBAAkB;2BAC1C,OAAO,eAAe,EAAE,YAAY;gCACpC,OAAO,eAAe,EAAE,iBAAiB"}
|
package/build/lib/logging.js
CHANGED
|
@@ -1,80 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// @ts-check
|
|
3
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
4
|
};
|
|
6
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
6
|
+
exports.getLogger = exports.log = exports.LEVELS = void 0;
|
|
8
7
|
const logger_1 = __importDefault(require("@appium/logger"));
|
|
9
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
10
|
-
const util_1 = require("./util");
|
|
11
9
|
const moment_1 = __importDefault(require("moment"));
|
|
12
|
-
const log_internal_1 = __importDefault(require("./log-internal"));
|
|
13
10
|
/** @type {import('@appium/types').AppiumLoggerLevel[]} */
|
|
14
11
|
exports.LEVELS = ['silly', 'verbose', 'debug', 'info', 'http', 'warn', 'error'];
|
|
15
12
|
const MAX_LOG_RECORDS_COUNT = 3000;
|
|
16
13
|
const PREFIX_TIMESTAMP_FORMAT = 'HH-mm-ss:SSS';
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @returns {[import('@appium/logger').Logger, boolean]}
|
|
35
|
-
*/
|
|
36
|
-
function _getLogger() {
|
|
37
|
-
// check if the user set the `_TESTING` or `_FORCE_LOGS` flag
|
|
38
|
-
const testingMode = process.env._TESTING === '1';
|
|
39
|
-
const forceLogMode = process.env._FORCE_LOGS === '1';
|
|
40
|
-
// if is possible that there is a logger instance that is already around,
|
|
41
|
-
// in which case we want t o use that
|
|
42
|
-
const usingGlobalLog = !!global._global_npmlog;
|
|
43
|
-
let logger;
|
|
44
|
-
if (testingMode && !forceLogMode) {
|
|
45
|
-
// in testing mode, use a mock logger object that we can query
|
|
46
|
-
logger = mockLog;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// otherwise, either use the global, or a new `npmlog` object
|
|
50
|
-
logger = global._global_npmlog || logger_1.default;
|
|
51
|
-
// The default value is 10000, which causes excessive memory usage
|
|
52
|
-
logger.maxRecordSize = MAX_LOG_RECORDS_COUNT;
|
|
53
|
-
}
|
|
54
|
-
patchLogger(logger);
|
|
55
|
-
return [logger, usingGlobalLog];
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* @param {AppiumLoggerPrefix?} prefix
|
|
59
|
-
* @param {boolean} logTimestamp whether to include timestamps into log prefixes
|
|
60
|
-
* @returns {string}
|
|
61
|
-
*/
|
|
62
|
-
function getActualPrefix(prefix, logTimestamp = false) {
|
|
63
|
-
const result = (lodash_1.default.isFunction(prefix) ? prefix() : prefix) ?? '';
|
|
64
|
-
return logTimestamp ? `[${(0, moment_1.default)().format(PREFIX_TIMESTAMP_FORMAT)}] ${result}` : result;
|
|
65
|
-
}
|
|
14
|
+
// export a default logger with no prefix
|
|
15
|
+
exports.log = getLogger();
|
|
16
|
+
// mock log object is used in testing mode to silence the output
|
|
17
|
+
const MOCK_LOG = {
|
|
18
|
+
unwrap: () => ({
|
|
19
|
+
loadSecureValuesPreprocessingRules: () => ({
|
|
20
|
+
issues: [],
|
|
21
|
+
rules: [],
|
|
22
|
+
}),
|
|
23
|
+
level: 'verbose',
|
|
24
|
+
prefix: '',
|
|
25
|
+
log: lodash_1.default.noop,
|
|
26
|
+
}),
|
|
27
|
+
...(lodash_1.default.fromPairs(exports.LEVELS.map((l) => [l, lodash_1.default.noop]))),
|
|
28
|
+
};
|
|
66
29
|
/**
|
|
67
30
|
*
|
|
68
|
-
* @param {AppiumLoggerPrefix?} prefix
|
|
31
|
+
* @param {AppiumLoggerPrefix?} [prefix=null]
|
|
69
32
|
* @returns {AppiumLogger}
|
|
70
33
|
*/
|
|
71
34
|
function getLogger(prefix = null) {
|
|
72
|
-
|
|
35
|
+
const [logger, usingGlobalLog] = _getLogger();
|
|
73
36
|
// wrap the logger so that we can catch and modify any logging
|
|
74
|
-
|
|
37
|
+
const wrappedLogger = {
|
|
75
38
|
unwrap: () => logger,
|
|
76
39
|
levels: exports.LEVELS,
|
|
77
40
|
prefix,
|
|
41
|
+
/**
|
|
42
|
+
* Logs given arguments at the error level and returns
|
|
43
|
+
* the error object.
|
|
44
|
+
*
|
|
45
|
+
* @param {...any} args
|
|
46
|
+
* @returns {Error}
|
|
47
|
+
*/
|
|
48
|
+
errorWithException(/** @type {any[]} */ ...args) {
|
|
49
|
+
this.error(...args);
|
|
50
|
+
// make sure we have an `Error` object. Wrap if necessary
|
|
51
|
+
return lodash_1.default.isError(args[0]) ? args[0] : new Error(args.join('\n'));
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated Use {@link errorWithException} instead
|
|
55
|
+
* @param {...any} args
|
|
56
|
+
* @throws {Error}
|
|
57
|
+
*/
|
|
58
|
+
errorAndThrow(/** @type {any[]} */ ...args) {
|
|
59
|
+
throw this.errorWithException(args);
|
|
60
|
+
},
|
|
78
61
|
};
|
|
79
62
|
// allow access to the level of the underlying logger
|
|
80
63
|
Object.defineProperty(wrappedLogger, 'level', {
|
|
@@ -87,33 +70,15 @@ function getLogger(prefix = null) {
|
|
|
87
70
|
enumerable: true,
|
|
88
71
|
configurable: true,
|
|
89
72
|
});
|
|
90
|
-
const
|
|
73
|
+
const isDebugTimestampLoggingEnabled = process.env._LOG_TIMESTAMP === '1';
|
|
91
74
|
// add all the levels from `npmlog`, and map to the underlying logger
|
|
92
75
|
for (const level of exports.LEVELS) {
|
|
93
|
-
wrappedLogger[level] = /** @param {
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
for (const line of out.split('\n')) {
|
|
98
|
-
// it is necessary to unleak each line because `split` call
|
|
99
|
-
// creates "views" to the original string as well as the `substring` one
|
|
100
|
-
const unleakedLine = (0, util_1.unleakString)(line);
|
|
101
|
-
logger[level](actualPrefix, log_internal_1.default.preprocess(unleakedLine));
|
|
102
|
-
}
|
|
103
|
-
}
|
|
76
|
+
wrappedLogger[level] = /** @param {any[]} args */ function (...args) {
|
|
77
|
+
const finalPrefix = getFinalPrefix(this.prefix, isDebugTimestampLoggingEnabled);
|
|
78
|
+
// @ts-ignore This is OK
|
|
79
|
+
logger[level](finalPrefix, ...args);
|
|
104
80
|
};
|
|
105
81
|
}
|
|
106
|
-
wrappedLogger.errorWithException = function (/** @type {any[]} */ ...args) {
|
|
107
|
-
this.error(...args);
|
|
108
|
-
// make sure we have an `Error` object. Wrap if necessary
|
|
109
|
-
return lodash_1.default.isError(args[0]) ? args[0] : new Error(args.map(util_1.unleakString).join('\n'));
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* @deprecated Use {@link errorWithException} instead
|
|
113
|
-
*/
|
|
114
|
-
wrappedLogger.errorAndThrow = function (/** @type {any[]} */ ...args) {
|
|
115
|
-
throw this.errorWithException(args);
|
|
116
|
-
};
|
|
117
82
|
if (!usingGlobalLog) {
|
|
118
83
|
// if we're not using a global log specified from some top-level package,
|
|
119
84
|
// set the log level to a default of verbose. Otherwise, let the top-level
|
|
@@ -124,36 +89,39 @@ function getLogger(prefix = null) {
|
|
|
124
89
|
}
|
|
125
90
|
exports.getLogger = getLogger;
|
|
126
91
|
/**
|
|
127
|
-
*
|
|
128
|
-
* @
|
|
129
|
-
* Rules with issues are skipped. An empty list is returned if no parsing issues exist.
|
|
130
|
-
* @property {import('./log-internal').SecureValuePreprocessingRule[]} rules The list of successfully loaded
|
|
131
|
-
* replacement rules. The list could be empty if no rules were loaded.
|
|
92
|
+
*
|
|
93
|
+
* @returns {[import('@appium/logger').Logger, boolean]}
|
|
132
94
|
*/
|
|
95
|
+
function _getLogger() {
|
|
96
|
+
// check if the user set the `_TESTING` or `_FORCE_LOGS` flag
|
|
97
|
+
const testingMode = process.env._TESTING === '1';
|
|
98
|
+
const forceLogMode = process.env._FORCE_LOGS === '1';
|
|
99
|
+
// if is possible that there is a logger instance that is already around,
|
|
100
|
+
// in which case we want t o use that
|
|
101
|
+
const useGlobalLog = !!global._global_npmlog;
|
|
102
|
+
const logger = testingMode && !forceLogMode
|
|
103
|
+
// in testing mode, use a mock logger object that we can query
|
|
104
|
+
? MOCK_LOG
|
|
105
|
+
// otherwise, either use the global, or a new `npmlog` object
|
|
106
|
+
: (global._global_npmlog || logger_1.default);
|
|
107
|
+
// The default value is 10000, which causes excessive memory usage
|
|
108
|
+
logger.maxRecordSize = MAX_LOG_RECORDS_COUNT;
|
|
109
|
+
return [logger, useGlobalLog];
|
|
110
|
+
}
|
|
133
111
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* Each call to this method replaces the previously loaded rules if any existed.
|
|
138
|
-
*
|
|
139
|
-
* @param {string|string[]|import('@appium/types').LogFiltersConfig} rulesJsonPath The full path to the JSON file containing
|
|
140
|
-
* the replacement rules. Each rule could either be a string to be replaced
|
|
141
|
-
* or an object with predefined properties.
|
|
142
|
-
* @throws {Error} If the given file cannot be loaded
|
|
143
|
-
* @returns {Promise<LoadResult>}
|
|
112
|
+
* @param {AppiumLoggerPrefix?} prefix
|
|
113
|
+
* @param {boolean} [shouldLogTimestamp=false] whether to include timestamps into log prefixes
|
|
114
|
+
* @returns {string}
|
|
144
115
|
*/
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
116
|
+
function getFinalPrefix(prefix, shouldLogTimestamp = false) {
|
|
117
|
+
const result = (lodash_1.default.isFunction(prefix) ? prefix() : prefix) ?? '';
|
|
118
|
+
if (!shouldLogTimestamp) {
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
const formattedTimestamp = `[${(0, moment_1.default)().format(PREFIX_TIMESTAMP_FORMAT)}]`;
|
|
122
|
+
return result ? `${formattedTimestamp} ${result}` : formattedTimestamp;
|
|
151
123
|
}
|
|
152
|
-
exports.
|
|
153
|
-
// export a default logger with no prefix
|
|
154
|
-
const log = getLogger();
|
|
155
|
-
exports.log = log;
|
|
156
|
-
exports.default = log;
|
|
124
|
+
exports.default = exports.log;
|
|
157
125
|
/**
|
|
158
126
|
* @typedef {import('@appium/types').AppiumLoggerPrefix} AppiumLoggerPrefix
|
|
159
127
|
* @typedef {import('@appium/types').AppiumLogger} AppiumLogger
|
package/build/lib/logging.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../lib/logging.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../lib/logging.js"],"names":[],"mappings":";;;;;;AAAA,4DAAuC;AACvC,oDAAuB;AACvB,oDAA4B;AAE5B,0DAA0D;AAC7C,QAAA,MAAM,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACrF,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAC/C,yCAAyC;AAC5B,QAAA,GAAG,GAAG,SAAS,EAAE,CAAC;AAC/B,gEAAgE;AAChE,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QACb,kCAAkC,EAAE,GAAG,EAAE,CAAC,CAAC;YACzC,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,EAAE;SACV,CAAC;QACF,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,gBAAC,CAAC,IAAI;KACZ,CAAC;IACF,GAAG,CAAC,gBAAC,CAAC,SAAS,CAAC,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,gBAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACjD,CAA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CAAC;IACD,MAAM,kBAAkB,GAAG,IAAI,IAAA,gBAAM,GAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,GAAG,CAAC;IAC3E,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,kBAAkB,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC;AACzE,CAAC;AAED,kBAAe,WAAG,CAAC;AAEnB;;;;GAIG"}
|
package/build/lib/util.d.ts
CHANGED
|
@@ -137,15 +137,6 @@ export function coerceVersion<Strict extends boolean = true>(ver: string, strict
|
|
|
137
137
|
* @returns {string} - The arguments, quoted
|
|
138
138
|
*/
|
|
139
139
|
export function quote(args: string | string[]): string;
|
|
140
|
-
/**
|
|
141
|
-
* This function is necessary to workaround unexpected memory leaks
|
|
142
|
-
* caused by NodeJS string interning
|
|
143
|
-
* behavior described in https://bugs.chromium.org/p/v8/issues/detail?id=2869
|
|
144
|
-
*
|
|
145
|
-
* @param {any} s - The string to unleak
|
|
146
|
-
* @return {string} Either the unleaked string or the original object converted to string
|
|
147
|
-
*/
|
|
148
|
-
export function unleakString(s: any): string;
|
|
149
140
|
/**
|
|
150
141
|
* Stringifies the object passed in, converting Buffers into Strings for better
|
|
151
142
|
* display. This mimics JSON.stringify (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)
|
package/build/lib/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../lib/util.js"],"names":[],"mappings":"AA4BA;;;;GAIG;AACH,+EAEC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../lib/util.js"],"names":[],"mappings":"AA4BA;;;;GAIG;AACH,+EAEC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAghBY,CAAC,SAAS,EAAE,GAAG,KAAK,GAAG,CAAC;AA9gBrC;;;;;;;GAOG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AN,MAAM;6BAAN,MAAM;oCAVN,aAAa;AA6bpB;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AACH,8CALW,MAAM,SACN,eAAe;yBAcH,GAAG,EAAE;;EA0C3B;cA7gBa,UAAU"}
|
package/build/lib/util.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getLockFileGuard = exports.shellParse = exports.uuidV5 = exports.uuidV4 = exports.uuidV3 = exports.uuidV1 = exports.toInMemoryBase64 = exports.KiB = exports.MiB = exports.GiB = exports.pluralize = exports.jsonStringify = exports.
|
|
6
|
+
exports.getLockFileGuard = exports.shellParse = exports.uuidV5 = exports.uuidV4 = exports.uuidV3 = exports.uuidV1 = exports.toInMemoryBase64 = exports.KiB = exports.MiB = exports.GiB = exports.pluralize = exports.jsonStringify = exports.quote = exports.coerceVersion = exports.compareVersions = exports.isSameDestination = exports.W3C_WEB_ELEMENT_IDENTIFIER = exports.isSubPath = exports.toReadableSizeString = exports.filterObject = exports.unwrapElement = exports.wrapElement = exports.safeJsonParse = exports.multiResolve = exports.cancellableDelay = exports.localIp = exports.escapeSpecialChars = exports.escapeSpace = exports.hasValue = exports.hasContent = void 0;
|
|
7
7
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
9
|
const os_1 = __importDefault(require("os"));
|
|
@@ -350,18 +350,6 @@ function quote(args) {
|
|
|
350
350
|
return (0, shell_quote_1.quote)(lodash_1.default.castArray(args));
|
|
351
351
|
}
|
|
352
352
|
exports.quote = quote;
|
|
353
|
-
/**
|
|
354
|
-
* This function is necessary to workaround unexpected memory leaks
|
|
355
|
-
* caused by NodeJS string interning
|
|
356
|
-
* behavior described in https://bugs.chromium.org/p/v8/issues/detail?id=2869
|
|
357
|
-
*
|
|
358
|
-
* @param {any} s - The string to unleak
|
|
359
|
-
* @return {string} Either the unleaked string or the original object converted to string
|
|
360
|
-
*/
|
|
361
|
-
function unleakString(s) {
|
|
362
|
-
return ` ${s}`.substring(1);
|
|
363
|
-
}
|
|
364
|
-
exports.unleakString = unleakString;
|
|
365
353
|
/**
|
|
366
354
|
* @typedef PluralizeOptions
|
|
367
355
|
* @property {boolean} [inclusive=false] - Whether to prefix with the number (e.g., 3 ducks)
|
package/build/lib/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../lib/util.js"],"names":[],"mappings":";;;;;;AAAA,wDAAyB;AACzB,oDAAuB;AACvB,4CAAoB;AACpB,gDAAwB;AACxB,8CAAsB;AACtB,oDAA4B;AAC5B,6CAIqB;AA8iBnB,2FA/iBS,mBAAU,OA+iBT;AA7iBZ,0DAAqC;AACrC,oDAA4B;AAC5B,iDAA2C;AAC3C,+BAMc;AAgiBZ,uFApiBM,SAAM,OAoiBN;AACN,uFApiBM,SAAM,OAoiBN;AACN,uFApiBM,SAAM,OAoiBN;AACN,uFApiBM,SAAM,OAoiBN;AAliBR,wDAAiC;AAEjC,MAAM,0BAA0B,GAAG,qCAAqC,CAAC;AAihBvE,gEAA0B;AAhhB5B,MAAM,GAAG,GAAG,IAAI,CAAC;AA0hBf,kBAAG;AAzhBL,MAAM,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAwhBrB,kBAAG;AAvhBL,MAAM,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAshBrB,kBAAG;AAphBL;;;;GAIG;AACH,SAAgB,UAAU,CAAC,GAAG;IAC5B,OAAO,gBAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,EAAE,CAAC;AACvC,CAAC;AAFD,gCAEC;AAED;;;;;;;GAOG;AACH,SAAS,QAAQ,CAAC,GAAG;IACnB,4CAA4C;IAC5C,IAAI,gB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YACD,iDAAiD;QACnD,CAAC,QAAQ,IAAI,EAAE;QACf,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,EAAE,CAAC;QAC1B,CAAC;gBAAS,CAAC;YACT,6DAA6D;YAC7D,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;IACH,CAAC,CAAC;IAEF,KAAK,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;IAEhD,OAAO,KAAK,CAAC;AACf,CAAC;AA+BC,4CAAgB;AAGlB;;;;;GAKG"}
|
package/lib/index.ts
CHANGED
package/lib/logging.js
CHANGED
|
@@ -1,84 +1,61 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
1
|
import globalLog from '@appium/logger';
|
|
4
2
|
import _ from 'lodash';
|
|
5
|
-
import {unleakString} from './util';
|
|
6
3
|
import moment from 'moment';
|
|
7
|
-
import SECURE_VALUES_PREPROCESSOR from './log-internal';
|
|
8
4
|
|
|
9
5
|
/** @type {import('@appium/types').AppiumLoggerLevel[]} */
|
|
10
6
|
export const LEVELS = ['silly', 'verbose', 'debug', 'info', 'http', 'warn', 'error'];
|
|
11
7
|
const MAX_LOG_RECORDS_COUNT = 3000;
|
|
12
|
-
|
|
13
8
|
const PREFIX_TIMESTAMP_FORMAT = 'HH-mm-ss:SSS';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @returns {[import('@appium/logger').Logger, boolean]}
|
|
34
|
-
*/
|
|
35
|
-
function _getLogger() {
|
|
36
|
-
// check if the user set the `_TESTING` or `_FORCE_LOGS` flag
|
|
37
|
-
const testingMode = process.env._TESTING === '1';
|
|
38
|
-
const forceLogMode = process.env._FORCE_LOGS === '1';
|
|
39
|
-
|
|
40
|
-
// if is possible that there is a logger instance that is already around,
|
|
41
|
-
// in which case we want t o use that
|
|
42
|
-
const usingGlobalLog = !!global._global_npmlog;
|
|
43
|
-
let logger;
|
|
44
|
-
if (testingMode && !forceLogMode) {
|
|
45
|
-
// in testing mode, use a mock logger object that we can query
|
|
46
|
-
logger = mockLog;
|
|
47
|
-
} else {
|
|
48
|
-
// otherwise, either use the global, or a new `npmlog` object
|
|
49
|
-
logger = global._global_npmlog || globalLog;
|
|
50
|
-
// The default value is 10000, which causes excessive memory usage
|
|
51
|
-
logger.maxRecordSize = MAX_LOG_RECORDS_COUNT;
|
|
52
|
-
}
|
|
53
|
-
patchLogger(logger);
|
|
54
|
-
return [logger, usingGlobalLog];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* @param {AppiumLoggerPrefix?} prefix
|
|
59
|
-
* @param {boolean} logTimestamp whether to include timestamps into log prefixes
|
|
60
|
-
* @returns {string}
|
|
61
|
-
*/
|
|
62
|
-
function getActualPrefix(prefix, logTimestamp = false) {
|
|
63
|
-
const result = (_.isFunction(prefix) ? prefix() : prefix) ?? '';
|
|
64
|
-
return logTimestamp ? `[${moment().format(PREFIX_TIMESTAMP_FORMAT)}] ${result}` : result;
|
|
65
|
-
}
|
|
9
|
+
// export a default logger with no prefix
|
|
10
|
+
export const log = getLogger();
|
|
11
|
+
// mock log object is used in testing mode to silence the output
|
|
12
|
+
const MOCK_LOG = {
|
|
13
|
+
unwrap: () => ({
|
|
14
|
+
loadSecureValuesPreprocessingRules: () => ({
|
|
15
|
+
issues: [],
|
|
16
|
+
rules: [],
|
|
17
|
+
}),
|
|
18
|
+
level: 'verbose',
|
|
19
|
+
prefix: '',
|
|
20
|
+
log: _.noop,
|
|
21
|
+
}),
|
|
22
|
+
...(_.fromPairs(LEVELS.map((l) => [l, _.noop]))),
|
|
23
|
+
};
|
|
66
24
|
|
|
67
25
|
/**
|
|
68
26
|
*
|
|
69
|
-
* @param {AppiumLoggerPrefix?} prefix
|
|
27
|
+
* @param {AppiumLoggerPrefix?} [prefix=null]
|
|
70
28
|
* @returns {AppiumLogger}
|
|
71
29
|
*/
|
|
72
|
-
function getLogger(prefix = null) {
|
|
73
|
-
|
|
30
|
+
export function getLogger(prefix = null) {
|
|
31
|
+
const [logger, usingGlobalLog] = _getLogger();
|
|
74
32
|
|
|
75
33
|
// wrap the logger so that we can catch and modify any logging
|
|
76
|
-
|
|
34
|
+
const wrappedLogger = {
|
|
77
35
|
unwrap: () => logger,
|
|
78
36
|
levels: LEVELS,
|
|
79
37
|
prefix,
|
|
38
|
+
/**
|
|
39
|
+
* Logs given arguments at the error level and returns
|
|
40
|
+
* the error object.
|
|
41
|
+
*
|
|
42
|
+
* @param {...any} args
|
|
43
|
+
* @returns {Error}
|
|
44
|
+
*/
|
|
45
|
+
errorWithException (/** @type {any[]} */ ...args) {
|
|
46
|
+
this.error(...args);
|
|
47
|
+
// make sure we have an `Error` object. Wrap if necessary
|
|
48
|
+
return _.isError(args[0]) ? args[0] : new Error(args.join('\n'));
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Use {@link errorWithException} instead
|
|
52
|
+
* @param {...any} args
|
|
53
|
+
* @throws {Error}
|
|
54
|
+
*/
|
|
55
|
+
errorAndThrow (/** @type {any[]} */ ...args) {
|
|
56
|
+
throw this.errorWithException(args);
|
|
57
|
+
},
|
|
80
58
|
};
|
|
81
|
-
|
|
82
59
|
// allow access to the level of the underlying logger
|
|
83
60
|
Object.defineProperty(wrappedLogger, 'level', {
|
|
84
61
|
get() {
|
|
@@ -90,35 +67,15 @@ function getLogger(prefix = null) {
|
|
|
90
67
|
enumerable: true,
|
|
91
68
|
configurable: true,
|
|
92
69
|
});
|
|
93
|
-
|
|
94
|
-
const logTimestamp = process.env._LOG_TIMESTAMP === '1';
|
|
95
|
-
|
|
70
|
+
const isDebugTimestampLoggingEnabled = process.env._LOG_TIMESTAMP === '1';
|
|
96
71
|
// add all the levels from `npmlog`, and map to the underlying logger
|
|
97
72
|
for (const level of LEVELS) {
|
|
98
|
-
wrappedLogger[level] = /** @param {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
for (const line of out.split('\n')) {
|
|
103
|
-
// it is necessary to unleak each line because `split` call
|
|
104
|
-
// creates "views" to the original string as well as the `substring` one
|
|
105
|
-
const unleakedLine = unleakString(line);
|
|
106
|
-
logger[level](actualPrefix, SECURE_VALUES_PREPROCESSOR.preprocess(unleakedLine));
|
|
107
|
-
}
|
|
108
|
-
}
|
|
73
|
+
wrappedLogger[level] = /** @param {any[]} args */ function (...args) {
|
|
74
|
+
const finalPrefix = getFinalPrefix(this.prefix, isDebugTimestampLoggingEnabled);
|
|
75
|
+
// @ts-ignore This is OK
|
|
76
|
+
logger[level](finalPrefix, ...args);
|
|
109
77
|
};
|
|
110
78
|
}
|
|
111
|
-
wrappedLogger.errorWithException = function (/** @type {any[]} */ ...args) {
|
|
112
|
-
this.error(...args);
|
|
113
|
-
// make sure we have an `Error` object. Wrap if necessary
|
|
114
|
-
return _.isError(args[0]) ? args[0] : new Error(args.map(unleakString).join('\n'));
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* @deprecated Use {@link errorWithException} instead
|
|
118
|
-
*/
|
|
119
|
-
wrappedLogger.errorAndThrow = function (/** @type {any[]} */ ...args) {
|
|
120
|
-
throw this.errorWithException(args);
|
|
121
|
-
};
|
|
122
79
|
if (!usingGlobalLog) {
|
|
123
80
|
// if we're not using a global log specified from some top-level package,
|
|
124
81
|
// set the log level to a default of verbose. Otherwise, let the top-level
|
|
@@ -129,37 +86,40 @@ function getLogger(prefix = null) {
|
|
|
129
86
|
}
|
|
130
87
|
|
|
131
88
|
/**
|
|
132
|
-
*
|
|
133
|
-
* @
|
|
134
|
-
* Rules with issues are skipped. An empty list is returned if no parsing issues exist.
|
|
135
|
-
* @property {import('./log-internal').SecureValuePreprocessingRule[]} rules The list of successfully loaded
|
|
136
|
-
* replacement rules. The list could be empty if no rules were loaded.
|
|
89
|
+
*
|
|
90
|
+
* @returns {[import('@appium/logger').Logger, boolean]}
|
|
137
91
|
*/
|
|
92
|
+
function _getLogger() {
|
|
93
|
+
// check if the user set the `_TESTING` or `_FORCE_LOGS` flag
|
|
94
|
+
const testingMode = process.env._TESTING === '1';
|
|
95
|
+
const forceLogMode = process.env._FORCE_LOGS === '1';
|
|
96
|
+
// if is possible that there is a logger instance that is already around,
|
|
97
|
+
// in which case we want t o use that
|
|
98
|
+
const useGlobalLog = !!global._global_npmlog;
|
|
99
|
+
const logger = testingMode && !forceLogMode
|
|
100
|
+
// in testing mode, use a mock logger object that we can query
|
|
101
|
+
? MOCK_LOG
|
|
102
|
+
// otherwise, either use the global, or a new `npmlog` object
|
|
103
|
+
: (global._global_npmlog || globalLog);
|
|
104
|
+
// The default value is 10000, which causes excessive memory usage
|
|
105
|
+
logger.maxRecordSize = MAX_LOG_RECORDS_COUNT;
|
|
106
|
+
return [logger, useGlobalLog];
|
|
107
|
+
}
|
|
138
108
|
|
|
139
109
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* Each call to this method replaces the previously loaded rules if any existed.
|
|
144
|
-
*
|
|
145
|
-
* @param {string|string[]|import('@appium/types').LogFiltersConfig} rulesJsonPath The full path to the JSON file containing
|
|
146
|
-
* the replacement rules. Each rule could either be a string to be replaced
|
|
147
|
-
* or an object with predefined properties.
|
|
148
|
-
* @throws {Error} If the given file cannot be loaded
|
|
149
|
-
* @returns {Promise<LoadResult>}
|
|
110
|
+
* @param {AppiumLoggerPrefix?} prefix
|
|
111
|
+
* @param {boolean} [shouldLogTimestamp=false] whether to include timestamps into log prefixes
|
|
112
|
+
* @returns {string}
|
|
150
113
|
*/
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
114
|
+
function getFinalPrefix(prefix, shouldLogTimestamp = false) {
|
|
115
|
+
const result = (_.isFunction(prefix) ? prefix() : prefix) ?? '';
|
|
116
|
+
if (!shouldLogTimestamp) {
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
const formattedTimestamp = `[${moment().format(PREFIX_TIMESTAMP_FORMAT)}]`;
|
|
120
|
+
return result ? `${formattedTimestamp} ${result}` : formattedTimestamp;
|
|
157
121
|
}
|
|
158
122
|
|
|
159
|
-
// export a default logger with no prefix
|
|
160
|
-
const log = getLogger();
|
|
161
|
-
|
|
162
|
-
export {log, patchLogger, getLogger, loadSecureValuesPreprocessingRules};
|
|
163
123
|
export default log;
|
|
164
124
|
|
|
165
125
|
/**
|
package/lib/util.js
CHANGED
|
@@ -358,18 +358,6 @@ function quote(args) {
|
|
|
358
358
|
return shellQuote(_.castArray(args));
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
-
/**
|
|
362
|
-
* This function is necessary to workaround unexpected memory leaks
|
|
363
|
-
* caused by NodeJS string interning
|
|
364
|
-
* behavior described in https://bugs.chromium.org/p/v8/issues/detail?id=2869
|
|
365
|
-
*
|
|
366
|
-
* @param {any} s - The string to unleak
|
|
367
|
-
* @return {string} Either the unleaked string or the original object converted to string
|
|
368
|
-
*/
|
|
369
|
-
function unleakString(s) {
|
|
370
|
-
return ` ${s}`.substring(1);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
361
|
/**
|
|
374
362
|
* @typedef PluralizeOptions
|
|
375
363
|
* @property {boolean} [inclusive=false] - Whether to prefix with the number (e.g., 3 ducks)
|
|
@@ -555,7 +543,6 @@ export {
|
|
|
555
543
|
compareVersions,
|
|
556
544
|
coerceVersion,
|
|
557
545
|
quote,
|
|
558
|
-
unleakString,
|
|
559
546
|
jsonStringify,
|
|
560
547
|
pluralize,
|
|
561
548
|
GiB,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appium/support",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "Support libs used across appium packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@appium/logger": "^1.
|
|
44
|
+
"@appium/logger": "^1.4.1",
|
|
45
45
|
"@appium/tsconfig": "^0.3.3",
|
|
46
|
-
"@appium/types": "^0.
|
|
46
|
+
"@appium/types": "^0.20.2",
|
|
47
47
|
"@colors/colors": "1.6.0",
|
|
48
48
|
"@types/archiver": "6.0.2",
|
|
49
49
|
"@types/base64-stream": "1.0.5",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"source-map-support": "0.5.21",
|
|
90
90
|
"supports-color": "8.1.1",
|
|
91
91
|
"teen_process": "2.1.4",
|
|
92
|
-
"type-fest": "4.
|
|
92
|
+
"type-fest": "4.20.0",
|
|
93
93
|
"uuid": "9.0.1",
|
|
94
94
|
"which": "4.0.0",
|
|
95
95
|
"yauzl": "3.1.3"
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
"publishConfig": {
|
|
105
105
|
"access": "public"
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "2b12d5974a23090ec4a167d91628d56c0b482c46"
|
|
108
108
|
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export default SECURE_VALUES_PREPROCESSOR;
|
|
2
|
-
export type SecureValuePreprocessingRule = {
|
|
3
|
-
/**
|
|
4
|
-
* The parsed pattern which is going to be used for replacement
|
|
5
|
-
*/
|
|
6
|
-
pattern: RegExp;
|
|
7
|
-
/**
|
|
8
|
-
* The replacer value to use. By default
|
|
9
|
-
* equals to `DEFAULT_SECURE_REPLACER`
|
|
10
|
-
*/
|
|
11
|
-
replacer?: string | undefined;
|
|
12
|
-
};
|
|
13
|
-
export const SECURE_VALUES_PREPROCESSOR: SecureValuesPreprocessor;
|
|
14
|
-
export class SecureValuesPreprocessor {
|
|
15
|
-
_rules: any[];
|
|
16
|
-
/**
|
|
17
|
-
* @returns {Array<SecureValuePreprocessingRule>} The list of successfully
|
|
18
|
-
* parsed preprocessing rules
|
|
19
|
-
*/
|
|
20
|
-
get rules(): SecureValuePreprocessingRule[];
|
|
21
|
-
/**
|
|
22
|
-
* Parses single rule from the given JSON file
|
|
23
|
-
*
|
|
24
|
-
* @param {string|import('@appium/types').LogFilter} rule The rule might
|
|
25
|
-
* either be represented as a single string or a configuration object
|
|
26
|
-
* @throws {Error} If there was an error while parsing the rule
|
|
27
|
-
* @returns {SecureValuePreprocessingRule} The parsed rule
|
|
28
|
-
*/
|
|
29
|
-
parseRule(rule: string | import('@appium/types').LogFilter): SecureValuePreprocessingRule;
|
|
30
|
-
/**
|
|
31
|
-
* Loads rules from the given JSON file
|
|
32
|
-
*
|
|
33
|
-
* @param {string|string[]|import('@appium/types').LogFiltersConfig} filters
|
|
34
|
-
* One or more log parsing rules
|
|
35
|
-
* @throws {Error} If the format of the source file is invalid or
|
|
36
|
-
* it does not exist
|
|
37
|
-
* @returns {Promise<string[]>} The list of issues found while parsing each rule.
|
|
38
|
-
* An empty list is returned if no rule parsing issues were found
|
|
39
|
-
*/
|
|
40
|
-
loadRules(filters: string | string[] | import('@appium/types').LogFiltersConfig): Promise<string[]>;
|
|
41
|
-
/**
|
|
42
|
-
* Performs secure values replacement inside the given string
|
|
43
|
-
* according to the previously loaded rules. No replacement is made
|
|
44
|
-
* if there are no rules or the given value is not a string
|
|
45
|
-
*
|
|
46
|
-
* @param {string} str The string to make replacements in
|
|
47
|
-
* @returns {string} The string with replacements made
|
|
48
|
-
*/
|
|
49
|
-
preprocess(str: string): string;
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=log-internal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log-internal.d.ts","sourceRoot":"","sources":["../../lib/log-internal.js"],"names":[],"mappings":";;;;;aAuJc,MAAM;;;;;;;AAPpB,kEAAkE;AAnIlE;IAEI,cAAgB;IAGlB;;;OAGG;IACH,4CAEC;IAED;;;;;;;OAOG;IACH,gBALW,MAAM,GAAC,OAAO,eAAe,EAAE,SAAS,GAGtC,4BAA4B,CAsDxC;IAED;;;;;;;;;OASG;IACH,mBAPW,MAAM,GAAC,MAAM,EAAE,GAAC,OAAO,eAAe,EAAE,gBAAgB,GAItD,QAAQ,MAAM,EAAE,CAAC,CA0B7B;IAED;;;;;;;OAOG;IACH,gBAHW,MAAM,GACJ,MAAM,CAYlB;CACF"}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SecureValuesPreprocessor = exports.SECURE_VALUES_PREPROCESSOR = void 0;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const DEFAULT_REPLACER = '**SECURE**';
|
|
9
|
-
/**
|
|
10
|
-
* Type guard for log filter type
|
|
11
|
-
* @param {object} value
|
|
12
|
-
* @returns {value is import('@appium/types').LogFilterRegex}
|
|
13
|
-
*/
|
|
14
|
-
function isLogFilterRegex(value) {
|
|
15
|
-
return 'pattern' in value;
|
|
16
|
-
}
|
|
17
|
-
class SecureValuesPreprocessor {
|
|
18
|
-
constructor() {
|
|
19
|
-
this._rules = [];
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @returns {Array<SecureValuePreprocessingRule>} The list of successfully
|
|
23
|
-
* parsed preprocessing rules
|
|
24
|
-
*/
|
|
25
|
-
get rules() {
|
|
26
|
-
return this._rules;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Parses single rule from the given JSON file
|
|
30
|
-
*
|
|
31
|
-
* @param {string|import('@appium/types').LogFilter} rule The rule might
|
|
32
|
-
* either be represented as a single string or a configuration object
|
|
33
|
-
* @throws {Error} If there was an error while parsing the rule
|
|
34
|
-
* @returns {SecureValuePreprocessingRule} The parsed rule
|
|
35
|
-
*/
|
|
36
|
-
parseRule(rule) {
|
|
37
|
-
let pattern;
|
|
38
|
-
let replacer = DEFAULT_REPLACER;
|
|
39
|
-
let flags = ['g'];
|
|
40
|
-
if (lodash_1.default.isString(rule)) {
|
|
41
|
-
if (rule.length === 0) {
|
|
42
|
-
throw new Error(`${JSON.stringify(rule)} -> The value must not be empty`);
|
|
43
|
-
}
|
|
44
|
-
pattern = `\\b${lodash_1.default.escapeRegExp(rule)}\\b`;
|
|
45
|
-
}
|
|
46
|
-
else if (lodash_1.default.isPlainObject(rule)) {
|
|
47
|
-
if (isLogFilterRegex(rule)) {
|
|
48
|
-
if (!lodash_1.default.isString(rule.pattern) || rule.pattern.length === 0) {
|
|
49
|
-
throw new Error(`${JSON.stringify(rule)} -> The value of 'pattern' must be a valid non-empty string`);
|
|
50
|
-
}
|
|
51
|
-
pattern = rule.pattern;
|
|
52
|
-
}
|
|
53
|
-
else if (lodash_1.default.has(rule, 'text')) {
|
|
54
|
-
if (!lodash_1.default.isString(rule.text) || rule.text.length === 0) {
|
|
55
|
-
throw new Error(`${JSON.stringify(rule)} -> The value of 'text' must be a valid non-empty string`);
|
|
56
|
-
}
|
|
57
|
-
pattern = `\\b${lodash_1.default.escapeRegExp(rule.text)}\\b`;
|
|
58
|
-
}
|
|
59
|
-
if (!pattern) {
|
|
60
|
-
throw new Error(`${JSON.stringify(rule)} -> Must either have a field named 'pattern' or 'text'`);
|
|
61
|
-
}
|
|
62
|
-
if (lodash_1.default.has(rule, 'flags')) {
|
|
63
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Advanced_searching_with_flags_2
|
|
64
|
-
for (const flag of ['i', 'g', 'm', 's', 'u', 'y']) {
|
|
65
|
-
if (lodash_1.default.includes(rule.flags, flag)) {
|
|
66
|
-
flags.push(flag);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
flags = lodash_1.default.uniq(flags);
|
|
70
|
-
}
|
|
71
|
-
if (lodash_1.default.isString(rule.replacer)) {
|
|
72
|
-
replacer = rule.replacer;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
throw new Error(`${JSON.stringify(rule)} -> Must either be a string or an object`);
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
pattern: new RegExp(pattern, flags.join('')),
|
|
80
|
-
replacer,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Loads rules from the given JSON file
|
|
85
|
-
*
|
|
86
|
-
* @param {string|string[]|import('@appium/types').LogFiltersConfig} filters
|
|
87
|
-
* One or more log parsing rules
|
|
88
|
-
* @throws {Error} If the format of the source file is invalid or
|
|
89
|
-
* it does not exist
|
|
90
|
-
* @returns {Promise<string[]>} The list of issues found while parsing each rule.
|
|
91
|
-
* An empty list is returned if no rule parsing issues were found
|
|
92
|
-
*/
|
|
93
|
-
async loadRules(filters) {
|
|
94
|
-
/** @type {string[]} */
|
|
95
|
-
const issues = [];
|
|
96
|
-
/** @type {(import('@appium/types').LogFilter|string)[]} */
|
|
97
|
-
const rawRules = [];
|
|
98
|
-
for (const source of (lodash_1.default.isArray(filters) ? filters : [filters])) {
|
|
99
|
-
if (lodash_1.default.isPlainObject(source)) {
|
|
100
|
-
rawRules.push(/** @type {import('@appium/types').LogFilter} */ (source));
|
|
101
|
-
}
|
|
102
|
-
else if (lodash_1.default.isString(source)) {
|
|
103
|
-
rawRules.push(source);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
issues.push(`'${source}' must be a valid log filtering rule`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
this._rules = [];
|
|
110
|
-
for (const rawRule of rawRules) {
|
|
111
|
-
try {
|
|
112
|
-
this._rules.push(this.parseRule(rawRule));
|
|
113
|
-
}
|
|
114
|
-
catch (e) {
|
|
115
|
-
issues.push(e.message);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return issues;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Performs secure values replacement inside the given string
|
|
122
|
-
* according to the previously loaded rules. No replacement is made
|
|
123
|
-
* if there are no rules or the given value is not a string
|
|
124
|
-
*
|
|
125
|
-
* @param {string} str The string to make replacements in
|
|
126
|
-
* @returns {string} The string with replacements made
|
|
127
|
-
*/
|
|
128
|
-
preprocess(str) {
|
|
129
|
-
if (this._rules.length === 0 || !lodash_1.default.isString(str)) {
|
|
130
|
-
return str;
|
|
131
|
-
}
|
|
132
|
-
let result = str;
|
|
133
|
-
for (const rule of this._rules) {
|
|
134
|
-
result = result.replace(rule.pattern, rule.replacer);
|
|
135
|
-
}
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
exports.SecureValuesPreprocessor = SecureValuesPreprocessor;
|
|
140
|
-
const SECURE_VALUES_PREPROCESSOR = new SecureValuesPreprocessor();
|
|
141
|
-
exports.SECURE_VALUES_PREPROCESSOR = SECURE_VALUES_PREPROCESSOR;
|
|
142
|
-
exports.default = SECURE_VALUES_PREPROCESSOR;
|
|
143
|
-
/**
|
|
144
|
-
* @typedef SecureValuePreprocessingRule
|
|
145
|
-
* @property {RegExp} pattern The parsed pattern which is going to be used for replacement
|
|
146
|
-
* @property {string} [replacer] The replacer value to use. By default
|
|
147
|
-
* equals to `DEFAULT_SECURE_REPLACER`
|
|
148
|
-
*/
|
|
149
|
-
//# sourceMappingURL=log-internal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log-internal.js","sourceRoot":"","sources":["../../lib/log-internal.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAEvB,MAAM,gBAAg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CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACjD,OAAO,GAAG,CAAC;QACb,CAAC;QAED,IAAI,MAAM,GAAG,GAAG,CAAC;QACjB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC/B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAImC,4DAAwB;AAF5D,MAAM,0BAA0B,GAAG,IAAI,wBAAwB,EAAE,CAAC;AAE1D,gEAA0B;AAClC,kBAAe,0BAA0B,CAAC;AAE1C;;;;;GAKG"}
|
package/lib/log-internal.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_REPLACER = '**SECURE**';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Type guard for log filter type
|
|
7
|
-
* @param {object} value
|
|
8
|
-
* @returns {value is import('@appium/types').LogFilterRegex}
|
|
9
|
-
*/
|
|
10
|
-
function isLogFilterRegex(value) {
|
|
11
|
-
return 'pattern' in value;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
class SecureValuesPreprocessor {
|
|
15
|
-
constructor() {
|
|
16
|
-
this._rules = [];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @returns {Array<SecureValuePreprocessingRule>} The list of successfully
|
|
21
|
-
* parsed preprocessing rules
|
|
22
|
-
*/
|
|
23
|
-
get rules() {
|
|
24
|
-
return this._rules;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Parses single rule from the given JSON file
|
|
29
|
-
*
|
|
30
|
-
* @param {string|import('@appium/types').LogFilter} rule The rule might
|
|
31
|
-
* either be represented as a single string or a configuration object
|
|
32
|
-
* @throws {Error} If there was an error while parsing the rule
|
|
33
|
-
* @returns {SecureValuePreprocessingRule} The parsed rule
|
|
34
|
-
*/
|
|
35
|
-
parseRule(rule) {
|
|
36
|
-
let pattern;
|
|
37
|
-
let replacer = DEFAULT_REPLACER;
|
|
38
|
-
let flags = ['g'];
|
|
39
|
-
if (_.isString(rule)) {
|
|
40
|
-
if (rule.length === 0) {
|
|
41
|
-
throw new Error(`${JSON.stringify(rule)} -> The value must not be empty`);
|
|
42
|
-
}
|
|
43
|
-
pattern = `\\b${_.escapeRegExp(rule)}\\b`;
|
|
44
|
-
} else if (_.isPlainObject(rule)) {
|
|
45
|
-
if (isLogFilterRegex(rule)) {
|
|
46
|
-
if (!_.isString(rule.pattern) || rule.pattern.length === 0) {
|
|
47
|
-
throw new Error(
|
|
48
|
-
`${JSON.stringify(rule)} -> The value of 'pattern' must be a valid non-empty string`
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
pattern = rule.pattern;
|
|
52
|
-
} else if (_.has(rule, 'text')) {
|
|
53
|
-
if (!_.isString(rule.text) || rule.text.length === 0) {
|
|
54
|
-
throw new Error(
|
|
55
|
-
`${JSON.stringify(rule)} -> The value of 'text' must be a valid non-empty string`
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
pattern = `\\b${_.escapeRegExp(rule.text)}\\b`;
|
|
59
|
-
}
|
|
60
|
-
if (!pattern) {
|
|
61
|
-
throw new Error(
|
|
62
|
-
`${JSON.stringify(rule)} -> Must either have a field named 'pattern' or 'text'`
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (_.has(rule, 'flags')) {
|
|
67
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Advanced_searching_with_flags_2
|
|
68
|
-
for (const flag of ['i', 'g', 'm', 's', 'u', 'y']) {
|
|
69
|
-
if (_.includes(rule.flags, flag)) {
|
|
70
|
-
flags.push(flag);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
flags = _.uniq(flags);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (_.isString(rule.replacer)) {
|
|
77
|
-
replacer = rule.replacer;
|
|
78
|
-
}
|
|
79
|
-
} else {
|
|
80
|
-
throw new Error(`${JSON.stringify(rule)} -> Must either be a string or an object`);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
pattern: new RegExp(pattern, flags.join('')),
|
|
85
|
-
replacer,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Loads rules from the given JSON file
|
|
91
|
-
*
|
|
92
|
-
* @param {string|string[]|import('@appium/types').LogFiltersConfig} filters
|
|
93
|
-
* One or more log parsing rules
|
|
94
|
-
* @throws {Error} If the format of the source file is invalid or
|
|
95
|
-
* it does not exist
|
|
96
|
-
* @returns {Promise<string[]>} The list of issues found while parsing each rule.
|
|
97
|
-
* An empty list is returned if no rule parsing issues were found
|
|
98
|
-
*/
|
|
99
|
-
async loadRules(filters) {
|
|
100
|
-
/** @type {string[]} */
|
|
101
|
-
const issues = [];
|
|
102
|
-
/** @type {(import('@appium/types').LogFilter|string)[]} */
|
|
103
|
-
const rawRules = [];
|
|
104
|
-
for (const source of (_.isArray(filters) ? filters : [filters])) {
|
|
105
|
-
if (_.isPlainObject(source)) {
|
|
106
|
-
rawRules.push(/** @type {import('@appium/types').LogFilter} */ (source));
|
|
107
|
-
} else if (_.isString(source)) {
|
|
108
|
-
rawRules.push(source);
|
|
109
|
-
} else {
|
|
110
|
-
issues.push(`'${source}' must be a valid log filtering rule`);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
this._rules = [];
|
|
114
|
-
for (const rawRule of rawRules) {
|
|
115
|
-
try {
|
|
116
|
-
this._rules.push(this.parseRule(rawRule));
|
|
117
|
-
} catch (e) {
|
|
118
|
-
issues.push(e.message);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return issues;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Performs secure values replacement inside the given string
|
|
126
|
-
* according to the previously loaded rules. No replacement is made
|
|
127
|
-
* if there are no rules or the given value is not a string
|
|
128
|
-
*
|
|
129
|
-
* @param {string} str The string to make replacements in
|
|
130
|
-
* @returns {string} The string with replacements made
|
|
131
|
-
*/
|
|
132
|
-
preprocess(str) {
|
|
133
|
-
if (this._rules.length === 0 || !_.isString(str)) {
|
|
134
|
-
return str;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
let result = str;
|
|
138
|
-
for (const rule of this._rules) {
|
|
139
|
-
result = result.replace(rule.pattern, rule.replacer);
|
|
140
|
-
}
|
|
141
|
-
return result;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
const SECURE_VALUES_PREPROCESSOR = new SecureValuesPreprocessor();
|
|
146
|
-
|
|
147
|
-
export {SECURE_VALUES_PREPROCESSOR, SecureValuesPreprocessor};
|
|
148
|
-
export default SECURE_VALUES_PREPROCESSOR;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* @typedef SecureValuePreprocessingRule
|
|
152
|
-
* @property {RegExp} pattern The parsed pattern which is going to be used for replacement
|
|
153
|
-
* @property {string} [replacer] The replacer value to use. By default
|
|
154
|
-
* equals to `DEFAULT_SECURE_REPLACER`
|
|
155
|
-
*/
|