io.appium.settings 7.1.10 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/apks/settings_apk-debug.apk +0 -0
- package/build/lib/client.d.ts +11 -11
- package/build/lib/client.d.ts.map +1 -1
- package/build/lib/client.js +47 -51
- package/build/lib/client.js.map +1 -1
- package/build/lib/commands/animation.d.ts +1 -1
- package/build/lib/commands/animation.d.ts.map +1 -1
- package/build/lib/commands/animation.js +1 -4
- package/build/lib/commands/animation.js.map +1 -1
- package/build/lib/commands/bluetooth.d.ts +1 -1
- package/build/lib/commands/bluetooth.d.ts.map +1 -1
- package/build/lib/commands/bluetooth.js +6 -10
- package/build/lib/commands/bluetooth.js.map +1 -1
- package/build/lib/commands/clipboard.d.ts +1 -1
- package/build/lib/commands/clipboard.d.ts.map +1 -1
- package/build/lib/commands/clipboard.js +6 -9
- package/build/lib/commands/clipboard.js.map +1 -1
- package/build/lib/commands/geolocation.d.ts +2 -2
- package/build/lib/commands/geolocation.d.ts.map +1 -1
- package/build/lib/commands/geolocation.js +14 -19
- package/build/lib/commands/geolocation.js.map +1 -1
- package/build/lib/commands/locale.d.ts +2 -2
- package/build/lib/commands/locale.d.ts.map +1 -1
- package/build/lib/commands/locale.js +8 -12
- package/build/lib/commands/locale.js.map +1 -1
- package/build/lib/commands/media-projection.d.ts +2 -2
- package/build/lib/commands/media-projection.d.ts.map +1 -1
- package/build/lib/commands/media-projection.js +19 -28
- package/build/lib/commands/media-projection.js.map +1 -1
- package/build/lib/commands/media.d.ts +1 -1
- package/build/lib/commands/media.d.ts.map +1 -1
- package/build/lib/commands/media.js +5 -8
- package/build/lib/commands/media.js.map +1 -1
- package/build/lib/commands/network.d.ts +1 -1
- package/build/lib/commands/network.d.ts.map +1 -1
- package/build/lib/commands/network.js +5 -9
- package/build/lib/commands/network.js.map +1 -1
- package/build/lib/commands/notifications.d.ts +1 -1
- package/build/lib/commands/notifications.d.ts.map +1 -1
- package/build/lib/commands/notifications.js +7 -11
- package/build/lib/commands/notifications.js.map +1 -1
- package/build/lib/commands/sms.d.ts +2 -2
- package/build/lib/commands/sms.d.ts.map +1 -1
- package/build/lib/commands/sms.js +5 -8
- package/build/lib/commands/sms.js.map +1 -1
- package/build/lib/commands/types.js +1 -2
- package/build/lib/commands/typing.d.ts +1 -1
- package/build/lib/commands/typing.d.ts.map +1 -1
- package/build/lib/commands/typing.js +9 -13
- package/build/lib/commands/typing.js.map +1 -1
- package/build/lib/commands/utf7.js +4 -10
- package/build/lib/commands/utf7.js.map +1 -1
- package/build/lib/constants.js +33 -36
- package/build/lib/constants.js.map +1 -1
- package/build/lib/index.d.ts +2 -2
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +4 -22
- package/build/lib/index.js.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 +3 -9
- package/build/lib/logger.js.map +1 -1
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +11 -16
- package/build/lib/utils.js.map +1 -1
- package/lib/client.ts +13 -13
- package/lib/commands/animation.ts +1 -1
- package/lib/commands/bluetooth.ts +2 -2
- package/lib/commands/clipboard.ts +3 -3
- package/lib/commands/geolocation.ts +4 -4
- package/lib/commands/locale.ts +4 -4
- package/lib/commands/media-projection.ts +3 -3
- package/lib/commands/media.ts +3 -3
- package/lib/commands/network.ts +2 -2
- package/lib/commands/notifications.ts +6 -3
- package/lib/commands/sms.ts +4 -4
- package/lib/commands/typing.ts +4 -4
- package/lib/index.ts +3 -3
- package/lib/logger.ts +1 -1
- package/lib/utils.ts +2 -1
- package/package.json +12 -4
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.setDeviceLocale = setDeviceLocale;
|
|
4
|
-
exports.listSupportedLocales = listSupportedLocales;
|
|
5
|
-
const logger_1 = require("../logger");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
1
|
+
import { LOG_PREFIX } from '../logger.js';
|
|
2
|
+
import { LOCALE_SETTING_ACTION, LOCALE_SETTING_RECEIVER, LOCALES_LIST_SETTING_ACTION, LOCALES_LIST_SETTING_RECEIVER, } from '../constants.js';
|
|
7
3
|
/**
|
|
8
4
|
* Set the locale name of the device under test.
|
|
9
5
|
* Don't need to reboot the device after changing the locale.
|
|
@@ -19,7 +15,7 @@ const constants_1 = require("../constants");
|
|
|
19
15
|
* format: [a-zA-Z]{4}. e.g. Hans in zh-Hans-CN : https://developer.android.com/reference/java/util/Locale.html
|
|
20
16
|
* @throws {Error} If language or country name is not provided
|
|
21
17
|
*/
|
|
22
|
-
async function setDeviceLocale(language, country, script = null) {
|
|
18
|
+
export async function setDeviceLocale(language, country, script = null) {
|
|
23
19
|
if (!language || language.trim().length === 0) {
|
|
24
20
|
throw new Error('Language name must be provided');
|
|
25
21
|
}
|
|
@@ -31,7 +27,7 @@ async function setDeviceLocale(language, country, script = null) {
|
|
|
31
27
|
const curLocale = await this.adb.getDeviceLocale();
|
|
32
28
|
// zh-Hans-CN : zh-CN
|
|
33
29
|
const localeCode = script ? `${lcLanguage}-${script}-${ucCountry}` : `${lcLanguage}-${ucCountry}`;
|
|
34
|
-
this.log.debug(
|
|
30
|
+
this.log.debug(LOG_PREFIX, `Current locale: '${curLocale}'; requested locale: '${localeCode}'`);
|
|
35
31
|
if (localeCode.toLowerCase() !== curLocale.toLowerCase()) {
|
|
36
32
|
await setDeviceLocaleInternal.bind(this)(lcLanguage, ucCountry, script);
|
|
37
33
|
}
|
|
@@ -42,8 +38,8 @@ async function setDeviceLocale(language, country, script = null) {
|
|
|
42
38
|
* @returns List of supported locales
|
|
43
39
|
* @throws {Error} If the list cannot be retrieved
|
|
44
40
|
*/
|
|
45
|
-
async function listSupportedLocales() {
|
|
46
|
-
const params = ['-a',
|
|
41
|
+
export async function listSupportedLocales() {
|
|
42
|
+
const params = ['-a', LOCALES_LIST_SETTING_ACTION, '-n', LOCALES_LIST_SETTING_RECEIVER];
|
|
47
43
|
const output = await this.checkBroadcast(params, 'list supported locales');
|
|
48
44
|
const match = /result=-1, data="([^"]+)/.exec(output);
|
|
49
45
|
if (!match) {
|
|
@@ -64,9 +60,9 @@ async function listSupportedLocales() {
|
|
|
64
60
|
async function setDeviceLocaleInternal(language, country, script = null) {
|
|
65
61
|
const params = [
|
|
66
62
|
'-a',
|
|
67
|
-
|
|
63
|
+
LOCALE_SETTING_ACTION,
|
|
68
64
|
'-n',
|
|
69
|
-
|
|
65
|
+
LOCALE_SETTING_RECEIVER,
|
|
70
66
|
'--es',
|
|
71
67
|
'lang',
|
|
72
68
|
language.toLowerCase(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../../lib/commands/locale.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../../lib/commands/locale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AAIzB;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAEnC,QAAgB,EAChB,OAAe,EACf,SAAwB,IAAI;IAE5B,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC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B,MAAM,MAAM,GAAa;QACvB,IAAI;QACJ,qBAAqB;QACrB,IAAI;QACJ,uBAAuB;QACvB,MAAM;QACN,MAAM;QACN,QAAQ,CAAC,WAAW,EAAE;QACtB,MAAM;QACN,SAAS;QACT,OAAO,CAAC,WAAW,EAAE;KACtB,CAAC;IACF,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACvC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;QACzD,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IACE,KAAK,KAAK,CAAC;gBACX,OAAO,GAAG,EAAE,MAAM,KAAK,QAAQ;gBAC/B,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAC5C,CAAC;gBACD,sFAAsF;gBACtF,kDAAkD;gBAClD,MAAM,IAAI,CAAC,cAAc,CAAC;oBACxB,uBAAuB,EAAE,IAAI;oBAC7B,YAAY,EAAE,IAAI;iBACnB,CAAC,CAAC;gBACH,SAAS;YACX,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ADB } from 'appium-adb';
|
|
2
|
-
import type { SettingsApp } from '../client';
|
|
3
|
-
import type { StartMediaProjectionRecordingOpts } from './types';
|
|
2
|
+
import type { SettingsApp } from '../client.js';
|
|
3
|
+
import type { StartMediaProjectionRecordingOpts } from './types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Creates a new instance of the MediaProjection-based recorder.
|
|
6
6
|
* The recorder only works since Android API 29+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-projection.d.ts","sourceRoot":"","sources":["../../../lib/commands/media-projection.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"media-projection.d.ts","sourceRoot":"","sources":["../../../lib/commands/media-projection.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAC,iCAAiC,EAAC,MAAM,YAAY,CAAC;AAElE;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,WAAW,GAAG,uBAAuB,CAEtF;AAED;;;;;GAKG;AACH,wBAAsB,uCAAuC,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAMjG;AAMD;;;;GAIG;AACH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAE1B;;;;OAIG;gBACS,GAAG,EAAE,GAAG;IAIpB;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAUnC;;;;;;;OAOG;IACG,KAAK,CAAC,IAAI,GAAE,iCAAsC,GAAG,OAAO,CAAC,OAAO,CAAC;IA0C3E;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAe1C;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;CA0B/B"}
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MediaProjectionRecorder = void 0;
|
|
7
|
-
exports.makeMediaProjectionRecorder = makeMediaProjectionRecorder;
|
|
8
|
-
exports.adjustMediaProjectionServicePermissions = adjustMediaProjectionServicePermissions;
|
|
9
|
-
const asyncbox_1 = require("asyncbox");
|
|
10
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
11
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
12
|
-
const constants_1 = require("../constants");
|
|
1
|
+
import { waitForCondition } from 'asyncbox';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { SETTINGS_HELPER_ID, RECORDING_ACTION_START, RECORDING_ACTION_STOP, RECORDING_ACTIVITY_NAME, RECORDING_SERVICE_NAME, } from '../constants.js';
|
|
13
5
|
/**
|
|
14
6
|
* Creates a new instance of the MediaProjection-based recorder.
|
|
15
7
|
* The recorder only works since Android API 29+
|
|
16
8
|
*
|
|
17
9
|
* @returns The recorder instance
|
|
18
10
|
*/
|
|
19
|
-
function makeMediaProjectionRecorder() {
|
|
11
|
+
export function makeMediaProjectionRecorder() {
|
|
20
12
|
return new MediaProjectionRecorder(this.adb);
|
|
21
13
|
}
|
|
22
14
|
/**
|
|
@@ -25,22 +17,22 @@ function makeMediaProjectionRecorder() {
|
|
|
25
17
|
*
|
|
26
18
|
* @returns True if permissions were adjusted, false if device API level is below 29
|
|
27
19
|
*/
|
|
28
|
-
async function adjustMediaProjectionServicePermissions() {
|
|
20
|
+
export async function adjustMediaProjectionServicePermissions() {
|
|
29
21
|
if ((await this.adb.getApiLevel()) >= 29) {
|
|
30
|
-
await this.adb.shell(['appops', 'set',
|
|
22
|
+
await this.adb.shell(['appops', 'set', SETTINGS_HELPER_ID, 'PROJECT_MEDIA', 'allow']);
|
|
31
23
|
return true;
|
|
32
24
|
}
|
|
33
25
|
return false;
|
|
34
26
|
}
|
|
35
27
|
const RECORDING_STARTUP_TIMEOUT_MS = 3 * 1000;
|
|
36
28
|
const RECORDING_STOP_TIMEOUT_MS = 3 * 1000;
|
|
37
|
-
const RECORDINGS_ROOT = `/storage/emulated/0/Android/data/${
|
|
29
|
+
const RECORDINGS_ROOT = `/storage/emulated/0/Android/data/${SETTINGS_HELPER_ID}/files`;
|
|
38
30
|
/**
|
|
39
31
|
* Media projection recorder for capturing device screen recordings.
|
|
40
32
|
* This class provides methods to start, stop, and manage screen recordings
|
|
41
33
|
* using Android's MediaProjection API (API 29+).
|
|
42
34
|
*/
|
|
43
|
-
class MediaProjectionRecorder {
|
|
35
|
+
export class MediaProjectionRecorder {
|
|
44
36
|
adb;
|
|
45
37
|
/**
|
|
46
38
|
* Creates a new MediaProjectionRecorder instance.
|
|
@@ -58,9 +50,9 @@ class MediaProjectionRecorder {
|
|
|
58
50
|
'dumpsys',
|
|
59
51
|
'activity',
|
|
60
52
|
'services',
|
|
61
|
-
|
|
53
|
+
RECORDING_SERVICE_NAME,
|
|
62
54
|
]);
|
|
63
|
-
return stdout.includes(
|
|
55
|
+
return stdout.includes(RECORDING_SERVICE_NAME);
|
|
64
56
|
}
|
|
65
57
|
/**
|
|
66
58
|
* Starts the media projection recording.
|
|
@@ -80,9 +72,9 @@ class MediaProjectionRecorder {
|
|
|
80
72
|
'am',
|
|
81
73
|
'start',
|
|
82
74
|
'-n',
|
|
83
|
-
|
|
75
|
+
RECORDING_ACTIVITY_NAME,
|
|
84
76
|
'-a',
|
|
85
|
-
|
|
77
|
+
RECORDING_ACTION_START,
|
|
86
78
|
];
|
|
87
79
|
if (filename) {
|
|
88
80
|
args.push('--es', 'filename', filename);
|
|
@@ -98,7 +90,7 @@ class MediaProjectionRecorder {
|
|
|
98
90
|
}
|
|
99
91
|
await this.adb.shell(args);
|
|
100
92
|
try {
|
|
101
|
-
await
|
|
93
|
+
await waitForCondition(async () => await this.isRunning(), {
|
|
102
94
|
waitMs: RECORDING_STARTUP_TIMEOUT_MS,
|
|
103
95
|
intervalMs: 500,
|
|
104
96
|
});
|
|
@@ -125,8 +117,8 @@ class MediaProjectionRecorder {
|
|
|
125
117
|
if (recordings.length === 0) {
|
|
126
118
|
return null;
|
|
127
119
|
}
|
|
128
|
-
const tmpRoot = await
|
|
129
|
-
const dstPath =
|
|
120
|
+
const tmpRoot = await fs.mkdtemp('recording');
|
|
121
|
+
const dstPath = path.join(tmpRoot, recordings[0]);
|
|
130
122
|
// increase timeout to 5 minutes because it might take a while to pull a large video file
|
|
131
123
|
await this.adb.pull(`${RECORDINGS_ROOT}/${recordings[0]}`, dstPath, {
|
|
132
124
|
timeout: 300000,
|
|
@@ -147,12 +139,12 @@ class MediaProjectionRecorder {
|
|
|
147
139
|
'am',
|
|
148
140
|
'start',
|
|
149
141
|
'-n',
|
|
150
|
-
|
|
142
|
+
RECORDING_ACTIVITY_NAME,
|
|
151
143
|
'-a',
|
|
152
|
-
|
|
144
|
+
RECORDING_ACTION_STOP,
|
|
153
145
|
]);
|
|
154
146
|
try {
|
|
155
|
-
await
|
|
147
|
+
await waitForCondition(async () => !(await this.isRunning()), {
|
|
156
148
|
waitMs: RECORDING_STOP_TIMEOUT_MS,
|
|
157
149
|
intervalMs: 500,
|
|
158
150
|
});
|
|
@@ -164,5 +156,4 @@ class MediaProjectionRecorder {
|
|
|
164
156
|
return true;
|
|
165
157
|
}
|
|
166
158
|
}
|
|
167
|
-
exports.MediaProjectionRecorder = MediaProjectionRecorder;
|
|
168
159
|
//# sourceMappingURL=media-projection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-projection.js","sourceRoot":"","sources":["../../../lib/commands/media-projection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media-projection.js","sourceRoot":"","sources":["../../../lib/commands/media-projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,sBA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
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../lib/commands/media.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../lib/commands/media.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAE9C;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrF"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.scanMedia = scanMedia;
|
|
4
|
-
const logger_1 = require("../logger");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
1
|
+
import { LOG_PREFIX } from '../logger.js';
|
|
2
|
+
import { MEDIA_SCAN_ACTION, MEDIA_SCAN_RECEIVER } from '../constants.js';
|
|
6
3
|
/**
|
|
7
4
|
* Performs recursive media scan at the given destination.
|
|
8
5
|
* All successfully scanned items are being added to the device's
|
|
@@ -11,8 +8,8 @@ const constants_1 = require("../constants");
|
|
|
11
8
|
* @param destination File/folder path on the remote device
|
|
12
9
|
* @throws {Error} If there was an unexpected error by scanning
|
|
13
10
|
*/
|
|
14
|
-
async function scanMedia(destination) {
|
|
15
|
-
this.log.debug(
|
|
16
|
-
await this.checkBroadcast(['-n',
|
|
11
|
+
export async function scanMedia(destination) {
|
|
12
|
+
this.log.debug(LOG_PREFIX, `Scanning '${destination}' for media files`);
|
|
13
|
+
await this.checkBroadcast(['-n', MEDIA_SCAN_RECEIVER, '-a', MEDIA_SCAN_ACTION, '--es', 'path', destination], 'scan media');
|
|
17
14
|
}
|
|
18
15
|
//# sourceMappingURL=media.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../lib/commands/media.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../lib/commands/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,iBAAiB,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAGvE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAoB,WAAmB;IACpE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,aAAa,WAAW,mBAAmB,CAAC,CAAC;IACxE,MAAM,IAAI,CAAC,cAAc,CACvB,CAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EACjF,YAAY,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../lib/commands/network.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../lib/commands/network.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAE9C;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,WAAW,EACjB,EAAE,EAAE,OAAO,EACX,UAAU,UAAQ,GACjB,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,WAAW,EACjB,EAAE,EAAE,OAAO,EACX,UAAU,UAAQ,GACjB,OAAO,CAAC,IAAI,CAAC,CAWf"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setWifiState = setWifiState;
|
|
4
|
-
exports.setDataState = setDataState;
|
|
5
|
-
const constants_1 = require("../constants");
|
|
1
|
+
import { WIFI_CONNECTION_SETTING_ACTION, WIFI_CONNECTION_SETTING_RECEIVER } from '../constants.js';
|
|
6
2
|
/**
|
|
7
3
|
* Change the state of WiFi on the device under test.
|
|
8
4
|
*
|
|
9
5
|
* @param on - True to enable and false to disable it
|
|
10
6
|
* @param isEmulator - Set it to true if the device under test is an emulator rather than a real device
|
|
11
7
|
*/
|
|
12
|
-
async function setWifiState(on, isEmulator = false) {
|
|
8
|
+
export async function setWifiState(on, isEmulator = false) {
|
|
13
9
|
if (isEmulator) {
|
|
14
10
|
// The svc command does not require to be root since API 26
|
|
15
11
|
await this.adb.shell(['svc', 'wifi', on ? 'enable' : 'disable']);
|
|
@@ -21,9 +17,9 @@ async function setWifiState(on, isEmulator = false) {
|
|
|
21
17
|
// as a workaround
|
|
22
18
|
await this.checkBroadcast([
|
|
23
19
|
'-a',
|
|
24
|
-
|
|
20
|
+
WIFI_CONNECTION_SETTING_ACTION,
|
|
25
21
|
'-n',
|
|
26
|
-
|
|
22
|
+
WIFI_CONNECTION_SETTING_RECEIVER,
|
|
27
23
|
'--es',
|
|
28
24
|
'setstatus',
|
|
29
25
|
on ? 'enable' : 'disable',
|
|
@@ -39,7 +35,7 @@ async function setWifiState(on, isEmulator = false) {
|
|
|
39
35
|
* @param isEmulator - Set it to true if the device under test is an emulator rather than a real device
|
|
40
36
|
* @throws {Error} If the data state cannot be changed
|
|
41
37
|
*/
|
|
42
|
-
async function setDataState(on, isEmulator = false) {
|
|
38
|
+
export async function setDataState(on, isEmulator = false) {
|
|
43
39
|
if (isEmulator) {
|
|
44
40
|
// The svc command does not require to be root since API 26
|
|
45
41
|
await this.adb.shell(['svc', 'data', on ? 'enable' : 'disable']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../../lib/commands/network.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../../lib/commands/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CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACnE,CAAC;SAAM,CAAC;QACN,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QAC5E,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5F,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../lib/commands/notifications.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../lib/commands/notifications.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAOtF;AAED;;;;;GAKG;AACH,wBAAsB,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAWxF"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getNotifications = getNotifications;
|
|
4
|
-
exports.adjustNotificationsPermissions = adjustNotificationsPermissions;
|
|
5
|
-
const logger_1 = require("../logger");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
1
|
+
import { LOG_PREFIX } from '../logger.js';
|
|
2
|
+
import { NOTIFICATIONS_RETRIEVAL_ACTION, SETTING_NOTIFICATIONS_LISTENER_SERVICE, } from '../constants.js';
|
|
7
3
|
/**
|
|
8
4
|
* Retrieves Android notifications via Appium Settings helper.
|
|
9
5
|
* Appium Settings app itself must be *manually* granted to access notifications
|
|
@@ -53,9 +49,9 @@ const constants_1 = require("../constants");
|
|
|
53
49
|
* @returns The notifications result
|
|
54
50
|
* @throws {Error} If there was an error while getting the notifications list
|
|
55
51
|
*/
|
|
56
|
-
async function getNotifications() {
|
|
57
|
-
this.log.debug(
|
|
58
|
-
const output = await this.checkBroadcast(['-a',
|
|
52
|
+
export async function getNotifications() {
|
|
53
|
+
this.log.debug(LOG_PREFIX, 'Retrieving notifications');
|
|
54
|
+
const output = await this.checkBroadcast(['-a', NOTIFICATIONS_RETRIEVAL_ACTION], 'retrieve notifications');
|
|
59
55
|
return this._parseJsonData(output, 'notifications');
|
|
60
56
|
}
|
|
61
57
|
/**
|
|
@@ -64,13 +60,13 @@ async function getNotifications() {
|
|
|
64
60
|
*
|
|
65
61
|
* @returns If permissions adjustment has been actually made
|
|
66
62
|
*/
|
|
67
|
-
async function adjustNotificationsPermissions() {
|
|
63
|
+
export async function adjustNotificationsPermissions() {
|
|
68
64
|
if ((await this.adb.getApiLevel()) >= 29) {
|
|
69
65
|
await this.adb.shell([
|
|
70
66
|
'cmd',
|
|
71
67
|
'notification',
|
|
72
68
|
'allow_listener',
|
|
73
|
-
|
|
69
|
+
SETTING_NOTIFICATIONS_LISTENER_SERVICE,
|
|
74
70
|
]);
|
|
75
71
|
return true;
|
|
76
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../lib/commands/notifications.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../lib/commands/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EACL,8BAA8B,EAC9B,sCAAsC,GACvC,MAAM,iBAAiB,CAAC;AAGzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,0BAA0B,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CACtC,CAAC,IAAI,EAAE,8BAA8B,CAAC,EACtC,wBAAwB,CACzB,CAAC;IACF,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AACtD,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B;IAClD,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;QACzC,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YACnB,KAAK;YACL,cAAc;YACd,gBAAgB;YAChB,sCAAsC;SACvC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SettingsApp } from '../client';
|
|
2
|
-
import type { SmsListOptions, SmsListResult } from './types';
|
|
1
|
+
import type { SettingsApp } from '../client.js';
|
|
2
|
+
import type { SmsListOptions, SmsListResult } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Retrieves the list of the most recent SMS
|
|
5
5
|
* properties list via Appium Settings helper.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sms.d.ts","sourceRoot":"","sources":["../../../lib/commands/sms.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"sms.d.ts","sourceRoot":"","sources":["../../../lib/commands/sms.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,WAAW,EACjB,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,aAAa,CAAC,CAQxB"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getSmsList = getSmsList;
|
|
4
|
-
const logger_1 = require("../logger");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
1
|
+
import { LOG_PREFIX } from '../logger.js';
|
|
2
|
+
import { SMS_LIST_RECEIVER, SMS_LIST_RETRIEVAL_ACTION } from '../constants.js';
|
|
6
3
|
/**
|
|
7
4
|
* Retrieves the list of the most recent SMS
|
|
8
5
|
* properties list via Appium Settings helper.
|
|
@@ -45,9 +42,9 @@ const constants_1 = require("../constants");
|
|
|
45
42
|
* @returns The SMS list result
|
|
46
43
|
* @throws {Error} If there was an error while getting the SMS list
|
|
47
44
|
*/
|
|
48
|
-
async function getSmsList(opts = {}) {
|
|
49
|
-
this.log.debug(
|
|
50
|
-
const args = ['-n',
|
|
45
|
+
export async function getSmsList(opts = {}) {
|
|
46
|
+
this.log.debug(LOG_PREFIX, 'Retrieving the recent SMS messages');
|
|
47
|
+
const args = ['-n', SMS_LIST_RECEIVER, '-a', SMS_LIST_RETRIEVAL_ACTION];
|
|
51
48
|
if (opts.max) {
|
|
52
49
|
args.push('--es', 'max', `${opts.max}`);
|
|
53
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sms.js","sourceRoot":"","sources":["../../../lib/commands/sms.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sms.js","sourceRoot":"","sources":["../../../lib/commands/sms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,iBAAiB,EAAE,yBAAyB,EAAC,MAAM,iBAAiB,CAAC;AAI7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAE9B,OAAuB,EAAE;IAEzB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,oCAAoC,CAAC,CAAC;IACjE,MAAM,IAAI,GAAa,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,yBAAyB,CAAC,CAAC;IAClF,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1C,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typing.d.ts","sourceRoot":"","sources":["../../../lib/commands/typing.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"typing.d.ts","sourceRoot":"","sources":["../../../lib/commands/typing.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAE9C;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,MAAM,GAAG,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC9B,OAAO,CAAC,OAAO,CAAC,CAkBlB"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.typeUnicode = typeUnicode;
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
const utf7_1 = require("./utf7");
|
|
7
|
-
const logger_1 = require("../logger");
|
|
1
|
+
import { APPIUM_IME, UNICODE_IME } from '../constants.js';
|
|
2
|
+
import { imap } from './utf7.js';
|
|
3
|
+
import { LOG_PREFIX } from '../logger.js';
|
|
8
4
|
/**
|
|
9
5
|
* Performs the given editor action on the focused input field.
|
|
10
6
|
* This method requires Appium Settings helper to be installed on the device.
|
|
@@ -14,9 +10,9 @@ const logger_1 = require("../logger");
|
|
|
14
10
|
* @param action - Either action code or name. The following action names are supported:
|
|
15
11
|
* `normal, unspecified, none, go, search, send, next, done, previous`
|
|
16
12
|
*/
|
|
17
|
-
async function performEditorAction(action) {
|
|
18
|
-
this.log.debug(
|
|
19
|
-
await this.adb.runInImeContext(
|
|
13
|
+
export async function performEditorAction(action) {
|
|
14
|
+
this.log.debug(LOG_PREFIX, `Performing editor action: ${action}`);
|
|
15
|
+
await this.adb.runInImeContext(APPIUM_IME, async () => await this.adb.shell(['input', 'text', `/${action}/`]));
|
|
20
16
|
}
|
|
21
17
|
/**
|
|
22
18
|
* Types the given Unicode string.
|
|
@@ -26,16 +22,16 @@ async function performEditorAction(action) {
|
|
|
26
22
|
* @param text The string to type
|
|
27
23
|
* @returns `true` if the input text has been successfully sent to adb
|
|
28
24
|
*/
|
|
29
|
-
async function typeUnicode(text) {
|
|
25
|
+
export async function typeUnicode(text) {
|
|
30
26
|
if (text === null || text === undefined) {
|
|
31
27
|
return false;
|
|
32
28
|
}
|
|
33
29
|
const textStr = `${text}`;
|
|
34
|
-
this.log.debug(
|
|
30
|
+
this.log.debug(LOG_PREFIX, `Typing ${textStr.length} character${textStr.length === 1 ? '' : 's'}`);
|
|
35
31
|
if (!textStr) {
|
|
36
32
|
return false;
|
|
37
33
|
}
|
|
38
|
-
await this.adb.runInImeContext(
|
|
34
|
+
await this.adb.runInImeContext(UNICODE_IME, async () => await this.adb.inputText(imap.encode(textStr)));
|
|
39
35
|
return true;
|
|
40
36
|
}
|
|
41
37
|
//# sourceMappingURL=typing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typing.js","sourceRoot":"","sources":["../../../lib/commands/typing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typing.js","sourceRoot":"","sources":["../../../lib/commands/typing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAGxC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAEvC,MAAuB;IAEvB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,6BAA6B,MAAM,EAAE,CAAC,CAAC;IAClE,MAAM,IAAI,CAAC,GAAG,CAAC,eAAe,CAC5B,UAAU,EACV,KAAK,IAAI,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,MAAM,GAAG,CAAC,CAAC,CACnE,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAE/B,IAA+B;IAE/B,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,IAAI,EAAE,CAAC;IAC1B,IAAI,CAAC,GAAG,CAAC,KAAK,CACZ,UAAU,EACV,UAAU,OAAO,CAAC,MAAM,aAAa,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CACvE,CAAC;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,CAAC,GAAG,CAAC,eAAe,CAC5B,WAAW,EACX,KAAK,IAAI,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAC3D,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* The code below has been adopted from https://www.npmjs.com/package/utf7
|
|
4
3
|
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.imap = exports.decode = exports.encode = void 0;
|
|
7
|
-
exports.encodeAll = encodeAll;
|
|
8
4
|
// Character classes defined by RFC 2152.
|
|
9
5
|
const setD = 'A-Za-z0-9' + escape(`'(),-./:?`);
|
|
10
6
|
const setO = escape(`!"#$%&*;<=>@[]^_'{|}`);
|
|
@@ -17,7 +13,7 @@ const regexAll = new RegExp(`[^${setW}${setD}${setO}]+`, 'g');
|
|
|
17
13
|
*
|
|
18
14
|
* @param mask Optional mask characters to exclude from encoding
|
|
19
15
|
*/
|
|
20
|
-
const encode = function encode(str, mask = null) {
|
|
16
|
+
export const encode = function encode(str, mask = null) {
|
|
21
17
|
// Generate a RegExp object from the string of mask characters.
|
|
22
18
|
if (!mask) {
|
|
23
19
|
mask = '';
|
|
@@ -30,13 +26,12 @@ const encode = function encode(str, mask = null) {
|
|
|
30
26
|
// + is represented by an empty sequence +-, otherwise call encode().
|
|
31
27
|
`+${chunk === '+' ? '' : _encode(chunk)}-`);
|
|
32
28
|
};
|
|
33
|
-
exports.encode = encode;
|
|
34
29
|
/**
|
|
35
30
|
* RFC 2152 UTF-7 encoding with all optionals.
|
|
36
31
|
* Encodes all non-ASCII characters, including those that would normally
|
|
37
32
|
* be represented directly in standard UTF-7 encoding.
|
|
38
33
|
*/
|
|
39
|
-
function encodeAll(str) {
|
|
34
|
+
export function encodeAll(str) {
|
|
40
35
|
// We replace subsequent disallowed chars with their escape sequence.
|
|
41
36
|
return str.replace(regexAll, (chunk) =>
|
|
42
37
|
// + is represented by an empty sequence +-, otherwise call encode().
|
|
@@ -45,13 +40,12 @@ function encodeAll(str) {
|
|
|
45
40
|
/**
|
|
46
41
|
* RFC 2152 UTF-7 decoding.
|
|
47
42
|
*/
|
|
48
|
-
const decode = function decode(str) {
|
|
43
|
+
export const decode = function decode(str) {
|
|
49
44
|
return str.replace(/\+([A-Za-z0-9/]*)-?/gi, (_, chunk) =>
|
|
50
45
|
// &- represents &.
|
|
51
46
|
chunk === '' ? '+' : _decode(chunk));
|
|
52
47
|
};
|
|
53
|
-
|
|
54
|
-
exports.imap = {
|
|
48
|
+
export const imap = {
|
|
55
49
|
/**
|
|
56
50
|
* RFC 3501, section 5.1.3 UTF-7 encoding.
|
|
57
51
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utf7.js","sourceRoot":"","sources":["../../../lib/commands/utf7.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utf7.js","sourceRoot":"","sources":["../../../lib/commands/utf7.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,yCAAyC;AACzC,MAAM,IAAI,GAAG,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAC/C,MAAM,IAAI,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAE/B,2DAA2D;AAC3D,MAAM,OAAO,GAA2B,EAAE,CAAC;AAC3C,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC;AAE9D;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