@appium/base-driver 9.3.2 → 9.3.4
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 +1 -1
- package/build/lib/basedriver/capabilities.d.ts +59 -36
- package/build/lib/basedriver/capabilities.d.ts.map +1 -1
- package/build/lib/basedriver/capabilities.js +57 -45
- package/build/lib/basedriver/capabilities.js.map +1 -1
- package/build/lib/basedriver/commands/event.d.ts +5 -9
- package/build/lib/basedriver/commands/event.d.ts.map +1 -1
- package/build/lib/basedriver/commands/event.js +28 -49
- package/build/lib/basedriver/commands/event.js.map +1 -1
- package/build/lib/basedriver/commands/execute.d.ts +5 -11
- package/build/lib/basedriver/commands/execute.d.ts.map +1 -1
- package/build/lib/basedriver/commands/execute.js +15 -39
- package/build/lib/basedriver/commands/execute.js.map +1 -1
- package/build/lib/basedriver/commands/find.d.ts +5 -12
- package/build/lib/basedriver/commands/find.d.ts.map +1 -1
- package/build/lib/basedriver/commands/find.js +38 -98
- package/build/lib/basedriver/commands/find.js.map +1 -1
- package/build/lib/basedriver/commands/index.d.ts +7 -3
- package/build/lib/basedriver/commands/index.d.ts.map +1 -1
- package/build/lib/basedriver/commands/index.js +7 -28
- package/build/lib/basedriver/commands/index.js.map +1 -1
- package/build/lib/basedriver/commands/log.d.ts +5 -10
- package/build/lib/basedriver/commands/log.d.ts.map +1 -1
- package/build/lib/basedriver/commands/log.js +17 -50
- package/build/lib/basedriver/commands/log.js.map +1 -1
- package/build/lib/basedriver/commands/mixin.d.ts +12 -0
- package/build/lib/basedriver/commands/mixin.d.ts.map +1 -0
- package/build/lib/basedriver/commands/mixin.js +18 -0
- package/build/lib/basedriver/commands/mixin.js.map +1 -0
- package/build/lib/basedriver/commands/session.d.ts +5 -11
- package/build/lib/basedriver/commands/session.d.ts.map +1 -1
- package/build/lib/basedriver/commands/session.js +18 -53
- package/build/lib/basedriver/commands/session.js.map +1 -1
- package/build/lib/basedriver/commands/settings.d.ts +5 -9
- package/build/lib/basedriver/commands/settings.d.ts.map +1 -1
- package/build/lib/basedriver/commands/settings.js +14 -34
- package/build/lib/basedriver/commands/settings.js.map +1 -1
- package/build/lib/basedriver/commands/timeout.d.ts +5 -9
- package/build/lib/basedriver/commands/timeout.d.ts.map +1 -1
- package/build/lib/basedriver/commands/timeout.js +107 -129
- package/build/lib/basedriver/commands/timeout.js.map +1 -1
- package/build/lib/basedriver/core.d.ts +14 -20
- package/build/lib/basedriver/core.d.ts.map +1 -1
- package/build/lib/basedriver/core.js +32 -22
- package/build/lib/basedriver/core.js.map +1 -1
- package/build/lib/basedriver/device-settings.d.ts +11 -11
- package/build/lib/basedriver/device-settings.d.ts.map +1 -1
- package/build/lib/basedriver/device-settings.js +7 -8
- package/build/lib/basedriver/device-settings.js.map +1 -1
- package/build/lib/basedriver/driver.d.ts +23 -108
- package/build/lib/basedriver/driver.d.ts.map +1 -1
- package/build/lib/basedriver/driver.js +38 -135
- package/build/lib/basedriver/driver.js.map +1 -1
- package/build/lib/basedriver/helpers.d.ts +21 -98
- package/build/lib/basedriver/helpers.d.ts.map +1 -1
- package/build/lib/basedriver/helpers.js +178 -182
- package/build/lib/basedriver/helpers.js.map +1 -1
- package/build/lib/express/server.d.ts +3 -15
- package/build/lib/express/server.d.ts.map +1 -1
- package/build/lib/express/server.js +4 -2
- package/build/lib/express/server.js.map +1 -1
- package/build/lib/express/websocket.d.ts +5 -44
- package/build/lib/express/websocket.d.ts.map +1 -1
- package/build/lib/express/websocket.js +10 -39
- package/build/lib/express/websocket.js.map +1 -1
- package/build/lib/helpers/capabilities.d.ts +2 -2
- package/build/lib/helpers/capabilities.d.ts.map +1 -1
- package/build/lib/helpers/capabilities.js +2 -3
- package/build/lib/helpers/capabilities.js.map +1 -1
- package/build/lib/protocol/protocol.d.ts +1 -1
- package/build/lib/protocol/protocol.d.ts.map +1 -1
- package/build/lib/protocol/protocol.js +10 -2
- package/build/lib/protocol/protocol.js.map +1 -1
- package/build/lib/protocol/routes.d.ts +1 -0
- package/build/lib/protocol/routes.d.ts.map +1 -1
- package/build/lib/protocol/routes.js +12 -10
- package/build/lib/protocol/routes.js.map +1 -1
- package/lib/basedriver/capabilities.js +70 -56
- package/lib/basedriver/commands/event.ts +49 -0
- package/lib/basedriver/commands/execute.ts +40 -0
- package/lib/basedriver/commands/find.ts +80 -0
- package/lib/basedriver/commands/index.ts +7 -0
- package/lib/basedriver/commands/log.ts +34 -0
- package/lib/basedriver/commands/mixin.ts +15 -0
- package/lib/basedriver/commands/session.ts +36 -0
- package/lib/basedriver/commands/settings.ts +26 -0
- package/lib/basedriver/commands/timeout.ts +155 -0
- package/lib/basedriver/core.js +11 -28
- package/lib/basedriver/device-settings.js +9 -11
- package/lib/basedriver/{driver.js → driver.ts} +71 -180
- package/lib/basedriver/helpers.js +214 -212
- package/lib/express/server.js +4 -2
- package/lib/express/websocket.js +10 -39
- package/lib/helpers/capabilities.js +2 -3
- package/lib/protocol/protocol.js +11 -2
- package/lib/protocol/routes.js +12 -13
- package/package.json +11 -7
- package/lib/basedriver/commands/event.js +0 -63
- package/lib/basedriver/commands/execute.js +0 -45
- package/lib/basedriver/commands/find.js +0 -108
- package/lib/basedriver/commands/index.js +0 -35
- package/lib/basedriver/commands/log.js +0 -64
- package/lib/basedriver/commands/session.js +0 -57
- package/lib/basedriver/commands/settings.js +0 -38
- package/lib/basedriver/commands/timeout.js +0 -168
|
@@ -2,24 +2,22 @@
|
|
|
2
2
|
* Maximum size (in bytes) of a given driver's settings object (which is internal to {@linkcode DriverSettings}).
|
|
3
3
|
*/
|
|
4
4
|
export const MAX_SETTINGS_SIZE: number;
|
|
5
|
-
export default DeviceSettings;
|
|
6
|
-
export type IDeviceSettings<T> = import('@appium/types').DeviceSettings<T>;
|
|
7
5
|
/**
|
|
8
|
-
* @template T
|
|
6
|
+
* @template {import('@appium/types').StringRecord} T
|
|
9
7
|
* @implements {IDeviceSettings<T>}
|
|
10
8
|
*/
|
|
11
|
-
export class DeviceSettings<T
|
|
9
|
+
export class DeviceSettings<T extends import("@appium/types").StringRecord<any>> implements IDeviceSettings<T> {
|
|
12
10
|
/**
|
|
13
11
|
* Creates a _shallow copy_ of the `defaultSettings` parameter!
|
|
14
|
-
* @param {
|
|
12
|
+
* @param {T} [defaultSettings]
|
|
15
13
|
* @param {import('@appium/types').SettingsUpdateListener<T>} [onSettingsUpdate]
|
|
16
14
|
*/
|
|
17
|
-
constructor(defaultSettings?:
|
|
15
|
+
constructor(defaultSettings?: T | undefined, onSettingsUpdate?: import("@appium/types").SettingsUpdateListener<T> | undefined);
|
|
18
16
|
/**
|
|
19
17
|
* @protected
|
|
20
|
-
* @type {
|
|
18
|
+
* @type {T}
|
|
21
19
|
*/
|
|
22
|
-
protected _settings:
|
|
20
|
+
protected _settings: T;
|
|
23
21
|
/**
|
|
24
22
|
* @protected
|
|
25
23
|
* @type {import('@appium/types').SettingsUpdateListener<T>}
|
|
@@ -27,9 +25,11 @@ export class DeviceSettings<T> implements IDeviceSettings<T> {
|
|
|
27
25
|
protected _onSettingsUpdate: import('@appium/types').SettingsUpdateListener<T>;
|
|
28
26
|
/**
|
|
29
27
|
* calls updateSettings from implementing driver every time a setting is changed.
|
|
30
|
-
* @param {
|
|
28
|
+
* @param {T} newSettings
|
|
31
29
|
*/
|
|
32
|
-
update(newSettings:
|
|
33
|
-
getSettings():
|
|
30
|
+
update(newSettings: T): Promise<void>;
|
|
31
|
+
getSettings(): T;
|
|
34
32
|
}
|
|
33
|
+
export default DeviceSettings;
|
|
34
|
+
export type IDeviceSettings<T extends import("@appium/types").StringRecord<any> = import("@appium/types").StringRecord<any>> = import('@appium/types').IDeviceSettings<T>;
|
|
35
35
|
//# sourceMappingURL=device-settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-settings.d.ts","sourceRoot":"","sources":["../../../lib/basedriver/device-settings.js"],"names":[],"mappings":"AAKA;;GAEG;AACH,uCAAkD
|
|
1
|
+
{"version":3,"file":"device-settings.d.ts","sourceRoot":"","sources":["../../../lib/basedriver/device-settings.js"],"names":[],"mappings":"AAKA;;GAEG;AACH,uCAAkD;AAElD;;;GAGG;AACH,4GAFgC,CAAC;IAe/B;;;;OAIG;IACH,+HAGC;IApBD;;;OAGG;IACH,qBAFU,CAAC,CAED;IAEV;;;OAGG;IACH,6BAFU,OAAO,eAAe,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAEzC;IAYlB;;;OAGG;IACH,oBAFW,CAAC,iBA2BX;IAED,iBAEC;CACF;;+HAMY,OAAO,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -13,22 +13,22 @@ const errors_1 = require("../protocol/errors");
|
|
|
13
13
|
*/
|
|
14
14
|
exports.MAX_SETTINGS_SIZE = 20 * 1024 * 1024; // 20 MB
|
|
15
15
|
/**
|
|
16
|
-
* @template T
|
|
16
|
+
* @template {import('@appium/types').StringRecord} T
|
|
17
17
|
* @implements {IDeviceSettings<T>}
|
|
18
18
|
*/
|
|
19
19
|
class DeviceSettings {
|
|
20
20
|
/**
|
|
21
21
|
* Creates a _shallow copy_ of the `defaultSettings` parameter!
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {T} [defaultSettings]
|
|
23
23
|
* @param {import('@appium/types').SettingsUpdateListener<T>} [onSettingsUpdate]
|
|
24
24
|
*/
|
|
25
|
-
constructor(defaultSettings = {}, onSettingsUpdate = async () => { }) {
|
|
25
|
+
constructor(defaultSettings = /** @type {T} */ ({}), onSettingsUpdate = async () => { }) {
|
|
26
26
|
this._settings = { ...defaultSettings };
|
|
27
27
|
this._onSettingsUpdate = onSettingsUpdate;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* calls updateSettings from implementing driver every time a setting is changed.
|
|
31
|
-
* @param {
|
|
31
|
+
* @param {T} newSettings
|
|
32
32
|
*/
|
|
33
33
|
async update(newSettings) {
|
|
34
34
|
if (!lodash_1.default.isPlainObject(newSettings)) {
|
|
@@ -39,8 +39,7 @@ class DeviceSettings {
|
|
|
39
39
|
throw new errors_1.errors.InvalidArgumentError(`New settings cannot be applied, because the overall ` +
|
|
40
40
|
`object size exceeds the allowed limit of ${support_1.util.toReadableSizeString(exports.MAX_SETTINGS_SIZE)}`);
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
for (const prop of props) {
|
|
42
|
+
for (const prop in newSettings) {
|
|
44
43
|
if (!lodash_1.default.isUndefined(this._settings[prop])) {
|
|
45
44
|
if (this._settings[prop] === newSettings[prop]) {
|
|
46
45
|
logger_1.default.debug(`The value of '${prop}' setting did not change. Skipping the update for it`);
|
|
@@ -58,7 +57,7 @@ class DeviceSettings {
|
|
|
58
57
|
exports.DeviceSettings = DeviceSettings;
|
|
59
58
|
exports.default = DeviceSettings;
|
|
60
59
|
/**
|
|
61
|
-
* @template T
|
|
62
|
-
* @typedef {import('@appium/types').
|
|
60
|
+
* @template {import('@appium/types').StringRecord} [T=import('@appium/types').StringRecord]
|
|
61
|
+
* @typedef {import('@appium/types').IDeviceSettings<T>} IDeviceSettings
|
|
63
62
|
*/
|
|
64
63
|
//# sourceMappingURL=device-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-settings.js","sourceRoot":"","sources":["../../../lib/basedriver/device-settings.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,sDAA2B;AAC3B,6CAA2C;AAC3C,+CAA0C;AAE1C;;GAEG;AACU,QAAA,iBAAiB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,QAAQ;AAE3D;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"device-settings.js","sourceRoot":"","sources":["../../../lib/basedriver/device-settings.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,sDAA2B;AAC3B,6CAA2C;AAC3C,+CAA0C;AAE1C;;GAEG;AACU,QAAA,iBAAiB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,QAAQ;AAE3D;;;GAG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G,WAAW,CAAC,IAAI,CAAC,CAAC;SAC1C;IACH,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AAzDD,wCAyDC;AAED,kBAAe,cAAc,CAAC;AAE9B;;;GAGG"}
|
|
@@ -1,132 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @template {StringRecord} [CArgs=StringRecord]
|
|
5
|
-
* @extends {DriverCore<C>}
|
|
6
|
-
*/
|
|
7
|
-
export class BaseDriverCore<C extends Readonly<Record<string, import("@appium/types").Constraint>>, CArgs extends import("@appium/types").StringRecord = import("@appium/types").StringRecord> extends DriverCore<C> implements SessionHandler<C> {
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param {DriverOpts<C>} opts
|
|
11
|
-
* @param {boolean} shouldValidateCaps
|
|
12
|
-
*/
|
|
13
|
-
constructor(opts?: DriverOpts<C>, shouldValidateCaps?: boolean);
|
|
14
|
-
/**
|
|
15
|
-
* @type {CArgs & ServerArgs}
|
|
16
|
-
*/
|
|
1
|
+
import { DriverCore } from './core';
|
|
2
|
+
import { AppiumServer, BaseDriverCapConstraints, Capabilities, Constraints, DefaultCreateSessionResult, Driver, DriverCaps, DriverData, DriverOpts, ServerArgs, StringRecord, W3CDriverCaps } from '@appium/types';
|
|
3
|
+
export declare class BaseDriver<C extends Constraints, CArgs extends StringRecord = StringRecord, Settings extends StringRecord = StringRecord> extends DriverCore<C, Settings> implements Driver<C, CArgs> {
|
|
17
4
|
cliArgs: CArgs & ServerArgs;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
caps: Capabilities<C>;
|
|
22
|
-
/**
|
|
23
|
-
* @type {W3CCapabilities<C>}
|
|
24
|
-
*/
|
|
25
|
-
originalCaps: W3CCapabilities<C>;
|
|
26
|
-
/**
|
|
27
|
-
* @type {C}
|
|
28
|
-
*/
|
|
5
|
+
caps: DriverCaps<C>;
|
|
6
|
+
originalCaps: W3CDriverCaps<C>;
|
|
29
7
|
desiredCapConstraints: C;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
8
|
+
opts: DriverOpts<C>;
|
|
9
|
+
server?: AppiumServer;
|
|
10
|
+
serverHost?: string;
|
|
11
|
+
serverPort?: number;
|
|
12
|
+
serverPath?: string;
|
|
13
|
+
constructor(opts: DriverOpts<C>, shouldValidateCaps?: boolean);
|
|
34
14
|
/**
|
|
35
15
|
* Contains the base constraints plus whatever the subclass wants to add.
|
|
36
16
|
*
|
|
37
17
|
* Subclasses _shouldn't_ need to use this. If you need to use this, please create
|
|
38
18
|
* an issue:
|
|
39
19
|
* @see https://github.com/appium/appium/issues/new
|
|
40
|
-
* @type {Readonly<BaseDriverCapConstraints & C>}
|
|
41
|
-
* @protected
|
|
42
20
|
*/
|
|
43
|
-
protected get _desiredCapConstraints(): Readonly<
|
|
21
|
+
protected get _desiredCapConstraints(): Readonly<BaseDriverCapConstraints & C>;
|
|
44
22
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
23
|
+
* This is the main command handler for the driver. It wraps command
|
|
24
|
+
* execution with timeout logic, checking that we have a valid session,
|
|
25
|
+
* and ensuring that we execute commands one at a time. This method is called
|
|
26
|
+
* by MJSONWP's express router.
|
|
48
27
|
*/
|
|
49
|
-
executeCommand(cmd: string, ...args: any[]): Promise<
|
|
50
|
-
|
|
51
|
-
*
|
|
52
|
-
* @param {Error|import('../protocol/errors').NoSuchDriverError} err
|
|
53
|
-
*/
|
|
54
|
-
startUnexpectedShutdown(err?: Error | import('../protocol/errors').NoSuchDriverError): Promise<void>;
|
|
28
|
+
executeCommand<T = unknown>(cmd: string, ...args: any[]): Promise<T>;
|
|
29
|
+
startUnexpectedShutdown(err?: Error): Promise<void>;
|
|
55
30
|
startNewCommandTimeout(): Promise<void>;
|
|
56
|
-
|
|
57
|
-
*
|
|
58
|
-
* @param {import('@appium/types').AppiumServer} server
|
|
59
|
-
* @param {string} host
|
|
60
|
-
* @param {number} port
|
|
61
|
-
* @param {string} path
|
|
62
|
-
*/
|
|
63
|
-
assignServer(server: import('@appium/types').AppiumServer, host: string, port: number, path: string): void;
|
|
64
|
-
server: import("@appium/types").AppiumServer | undefined;
|
|
65
|
-
serverHost: string | undefined;
|
|
66
|
-
serverPort: number | undefined;
|
|
67
|
-
serverPath: string | undefined;
|
|
31
|
+
assignServer(server: AppiumServer, host: string, port: number, path: string): void;
|
|
68
32
|
reset(): Promise<void>;
|
|
69
|
-
resetOnUnexpectedShutdown: (() => void) | undefined;
|
|
70
33
|
/**
|
|
71
34
|
*
|
|
72
35
|
* Historically the first two arguments were reserved for JSONWP capabilities.
|
|
73
36
|
* Appium 2 has dropped the support of these, so now we only accept capability
|
|
74
37
|
* objects in W3C format and thus allow any of the three arguments to represent
|
|
75
38
|
* the latter.
|
|
76
|
-
* @param {W3CCapabilities<C>} w3cCapabilities1
|
|
77
|
-
* @param {W3CCapabilities<C>} [w3cCapabilities2]
|
|
78
|
-
* @param {W3CCapabilities<C>} [w3cCapabilities]
|
|
79
|
-
* @param {DriverData[]} [driverData]
|
|
80
|
-
* @returns {Promise<[string,Capabilities<C>]>}
|
|
81
|
-
*/
|
|
82
|
-
createSession(w3cCapabilities1: W3CCapabilities<C>, w3cCapabilities2?: W3CCapabilities<C, void> | undefined, w3cCapabilities?: W3CCapabilities<C, void> | undefined, driverData?: import("@appium/types").DriverData[] | undefined): Promise<[string, Capabilities<C>]>;
|
|
83
|
-
/**
|
|
84
|
-
*
|
|
85
|
-
* @param {string} [sessionId]
|
|
86
|
-
* @param {DriverData[]} [driverData]
|
|
87
|
-
* @returns {Promise<void>}
|
|
88
|
-
*/
|
|
89
|
-
deleteSession(sessionId?: string | undefined, driverData?: import("@appium/types").DriverData[] | undefined): Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
92
|
-
* @param {Capabilities<C>} caps
|
|
93
39
|
*/
|
|
40
|
+
createSession(w3cCapabilities1: W3CDriverCaps<C>, w3cCapabilities2?: W3CDriverCaps<C>, w3cCapabilities?: W3CDriverCaps<C>, driverData?: DriverData[]): Promise<DefaultCreateSessionResult<C>>;
|
|
41
|
+
deleteSession(sessionId?: string | null): Promise<void>;
|
|
94
42
|
logExtraCaps(caps: Capabilities<C>): void;
|
|
95
|
-
|
|
96
|
-
*
|
|
97
|
-
* @param {Capabilities<C>} caps
|
|
98
|
-
* @returns {boolean}
|
|
99
|
-
*/
|
|
100
|
-
validateDesiredCaps(caps: Capabilities<C>): boolean;
|
|
101
|
-
}
|
|
102
|
-
declare const BaseDriver_base: import("./commands/execute").ExecuteBase<any>;
|
|
103
|
-
/**
|
|
104
|
-
* This ensures that all of the mixins correctly implement the interface described in {@linkcode Driver}.
|
|
105
|
-
* @template {Constraints} [C={}]
|
|
106
|
-
* @implements {Driver<C>}
|
|
107
|
-
*/
|
|
108
|
-
export class BaseDriver<C extends Readonly<Record<string, import("@appium/types").Constraint>> = {}> extends BaseDriver_base implements Driver<C> {
|
|
109
|
-
constructor(...arguments_: any[]);
|
|
43
|
+
validateDesiredCaps(caps: any): caps is DriverCaps<C>;
|
|
110
44
|
}
|
|
45
|
+
export * from './commands';
|
|
111
46
|
export default BaseDriver;
|
|
112
|
-
export type HTTPMethod = import('@appium/types').HTTPMethod;
|
|
113
|
-
export type DriverData = import('@appium/types').DriverData;
|
|
114
|
-
export type Constraints = import('@appium/types').Constraints;
|
|
115
|
-
export type Constraint = import('@appium/types').Constraint;
|
|
116
|
-
export type StringRecord = import('@appium/types').StringRecord;
|
|
117
|
-
export type BaseDriverCapConstraints = import('@appium/types').BaseDriverCapConstraints;
|
|
118
|
-
export type ServerArgs = import('@appium/types').ServerArgs;
|
|
119
|
-
export type UpdateServerCallback = (app: import('express').Express, httpServer: import('@appium/types').AppiumServer) => import('type-fest').Promisable<void>;
|
|
120
|
-
/**
|
|
121
|
-
* This is used to extend {@linkcode BaseDriverCore } by the mixins and also external drivers.
|
|
122
|
-
*/
|
|
123
|
-
export type BaseDriverBase<C extends Readonly<Record<string, import("@appium/types").Constraint>>, Proto = {}, Static = {}> = import('@appium/types').Class<BaseDriverCore<C> & Proto, import("@appium/types").DriverStatic<any> & Static>;
|
|
124
|
-
export type SessionHandler<C extends Readonly<Record<string, import("@appium/types").Constraint>> = typeof BASE_DESIRED_CAP_CONSTRAINTS> = import('@appium/types').SessionHandler<[string, object], void, C>;
|
|
125
|
-
export type Capabilities<C extends Readonly<Record<string, import("@appium/types").Constraint>> = typeof BASE_DESIRED_CAP_CONSTRAINTS, Extra extends void | import("@appium/types").StringRecord = void> = import('@appium/types').Capabilities<C, Extra>;
|
|
126
|
-
export type W3CCapabilities<C extends Readonly<Record<string, import("@appium/types").Constraint>> = typeof BASE_DESIRED_CAP_CONSTRAINTS, Extra extends void | import("@appium/types").StringRecord = void> = import('@appium/types').W3CCapabilities<C, Extra>;
|
|
127
|
-
export type Driver<C extends Readonly<Record<string, import("@appium/types").Constraint>> = typeof BASE_DESIRED_CAP_CONSTRAINTS, CArgs extends import("@appium/types").StringRecord = import("@appium/types").StringRecord> = import('@appium/types').Driver<C, CArgs>;
|
|
128
|
-
export type ExternalDriver<C extends Readonly<Record<string, import("@appium/types").Constraint>>> = import('@appium/types').ExternalDriver<C>;
|
|
129
|
-
export type DriverOpts<C extends Readonly<Record<string, import("@appium/types").Constraint>>> = import('@appium/types').DriverOpts<C>;
|
|
130
|
-
import { DriverCore } from "./core";
|
|
131
|
-
import { BASE_DESIRED_CAP_CONSTRAINTS } from "@appium/types";
|
|
132
47
|
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../lib/basedriver/driver.
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../lib/basedriver/driver.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC;AAOlC,O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K;IA8BX;;;;;;OAMG;IACG,aAAa,CACjB,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC,EAClC,gBAAgB,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EACnC,eAAe,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAElC,UAAU,CAAC,EAAE,UAAU,EAAE,GACxB,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;IAiFnC,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAc7C,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IAYlC,mBAAmB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC;CAoBtD;AAED,cAAc,YAAY,CAAC;AAE3B,eAAe,UAAU,CAAC"}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
4
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
18
|
};
|
|
7
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.BaseDriver =
|
|
20
|
+
exports.BaseDriver = void 0;
|
|
9
21
|
const capabilities_1 = require("./capabilities");
|
|
10
22
|
const core_1 = require("./core");
|
|
11
23
|
const support_1 = require("@appium/support");
|
|
@@ -13,7 +25,6 @@ const bluebird_1 = __importDefault(require("bluebird"));
|
|
|
13
25
|
const lodash_1 = __importDefault(require("lodash"));
|
|
14
26
|
const capabilities_2 = require("../helpers/capabilities");
|
|
15
27
|
const protocol_1 = require("../protocol");
|
|
16
|
-
const commands_1 = require("./commands");
|
|
17
28
|
const helpers_1 = __importDefault(require("./helpers"));
|
|
18
29
|
const types_1 = require("@appium/types");
|
|
19
30
|
const EVENT_SESSION_INIT = 'newSessionRequested';
|
|
@@ -21,27 +32,11 @@ const EVENT_SESSION_START = 'newSessionStarted';
|
|
|
21
32
|
const EVENT_SESSION_QUIT_START = 'quitSessionRequested';
|
|
22
33
|
const EVENT_SESSION_QUIT_DONE = 'quitSessionFinished';
|
|
23
34
|
const ON_UNEXPECTED_SHUTDOWN_EVENT = 'onUnexpectedShutdown';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* @template {Constraints} C
|
|
27
|
-
* @template {StringRecord} [CArgs=StringRecord]
|
|
28
|
-
* @extends {DriverCore<C>}
|
|
29
|
-
*/
|
|
30
|
-
class BaseDriverCore extends core_1.DriverCore {
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @param {DriverOpts<C>} opts
|
|
34
|
-
* @param {boolean} shouldValidateCaps
|
|
35
|
-
*/
|
|
36
|
-
constructor(opts = /** @type {DriverOpts<C>} */ ({}), shouldValidateCaps = true) {
|
|
35
|
+
class BaseDriver extends core_1.DriverCore {
|
|
36
|
+
constructor(opts, shouldValidateCaps = true) {
|
|
37
37
|
super(opts, shouldValidateCaps);
|
|
38
|
-
/**
|
|
39
|
-
* This must be assigned here because the declaration of {@linkcode BaseDriverCore.opts} above
|
|
40
|
-
* blows away {@linkcode DriverCore.opts}.
|
|
41
|
-
*/
|
|
42
|
-
this.opts = opts;
|
|
43
38
|
this.caps = {};
|
|
44
|
-
this.cliArgs =
|
|
39
|
+
this.cliArgs = {};
|
|
45
40
|
}
|
|
46
41
|
/**
|
|
47
42
|
* Contains the base constraints plus whatever the subclass wants to add.
|
|
@@ -49,24 +44,19 @@ class BaseDriverCore extends core_1.DriverCore {
|
|
|
49
44
|
* Subclasses _shouldn't_ need to use this. If you need to use this, please create
|
|
50
45
|
* an issue:
|
|
51
46
|
* @see https://github.com/appium/appium/issues/new
|
|
52
|
-
* @type {Readonly<BaseDriverCapConstraints & C>}
|
|
53
|
-
* @protected
|
|
54
47
|
*/
|
|
55
48
|
get _desiredCapConstraints() {
|
|
56
49
|
return Object.freeze(lodash_1.default.merge({}, types_1.BASE_DESIRED_CAP_CONSTRAINTS, this.desiredCapConstraints));
|
|
57
50
|
}
|
|
58
|
-
// This is the main command handler for the driver. It wraps command
|
|
59
|
-
// execution with timeout logic, checking that we have a valid session,
|
|
60
|
-
// and ensuring that we execute commands one at a time. This method is called
|
|
61
|
-
// by MJSONWP's express router.
|
|
62
51
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
52
|
+
* This is the main command handler for the driver. It wraps command
|
|
53
|
+
* execution with timeout logic, checking that we have a valid session,
|
|
54
|
+
* and ensuring that we execute commands one at a time. This method is called
|
|
55
|
+
* by MJSONWP's express router.
|
|
66
56
|
*/
|
|
67
57
|
async executeCommand(cmd, ...args) {
|
|
68
58
|
// get start time for this command, and log in special cases
|
|
69
|
-
|
|
59
|
+
const startTime = Date.now();
|
|
70
60
|
if (cmd === 'createSession') {
|
|
71
61
|
// If creating a session determine if W3C or MJSONWP protocol was requested and remember the choice
|
|
72
62
|
this.protocol = (0, protocol_1.determineProtocol)(args);
|
|
@@ -123,10 +113,6 @@ class BaseDriverCore extends core_1.DriverCore {
|
|
|
123
113
|
}
|
|
124
114
|
return res;
|
|
125
115
|
}
|
|
126
|
-
/**
|
|
127
|
-
*
|
|
128
|
-
* @param {Error|import('../protocol/errors').NoSuchDriverError} err
|
|
129
|
-
*/
|
|
130
116
|
async startUnexpectedShutdown(err = new protocol_1.errors.NoSuchDriverError('The driver was unexpectedly shut down!')) {
|
|
131
117
|
this.eventEmitter.emit(ON_UNEXPECTED_SHUTDOWN_EVENT, err); // allow others to listen for this
|
|
132
118
|
this.shutdownUnexpectedly = true;
|
|
@@ -155,13 +141,6 @@ class BaseDriverCore extends core_1.DriverCore {
|
|
|
155
141
|
await this.startUnexpectedShutdown(new Error(errorMessage));
|
|
156
142
|
}, this.newCommandTimeoutMs);
|
|
157
143
|
}
|
|
158
|
-
/**
|
|
159
|
-
*
|
|
160
|
-
* @param {import('@appium/types').AppiumServer} server
|
|
161
|
-
* @param {string} host
|
|
162
|
-
* @param {number} port
|
|
163
|
-
* @param {string} path
|
|
164
|
-
*/
|
|
165
144
|
assignServer(server, host, port, path) {
|
|
166
145
|
this.server = server;
|
|
167
146
|
this.serverHost = host;
|
|
@@ -176,8 +155,8 @@ class BaseDriverCore extends core_1.DriverCore {
|
|
|
176
155
|
this.log.debug('Resetting app mid-session');
|
|
177
156
|
this.log.debug('Running generic full reset');
|
|
178
157
|
// preserving state
|
|
179
|
-
|
|
180
|
-
for (
|
|
158
|
+
const currentConfig = {};
|
|
159
|
+
for (const property of [
|
|
181
160
|
'implicitWaitMs',
|
|
182
161
|
'newCommandTimeoutMs',
|
|
183
162
|
'sessionId',
|
|
@@ -185,8 +164,6 @@ class BaseDriverCore extends core_1.DriverCore {
|
|
|
185
164
|
]) {
|
|
186
165
|
currentConfig[property] = this[property];
|
|
187
166
|
}
|
|
188
|
-
// We also need to preserve the unexpected shutdown, and make sure it is not cancelled during reset.
|
|
189
|
-
this.resetOnUnexpectedShutdown = () => { };
|
|
190
167
|
try {
|
|
191
168
|
if (this.sessionId !== null) {
|
|
192
169
|
await this.deleteSession(this.sessionId);
|
|
@@ -196,7 +173,7 @@ class BaseDriverCore extends core_1.DriverCore {
|
|
|
196
173
|
}
|
|
197
174
|
finally {
|
|
198
175
|
// always restore state.
|
|
199
|
-
for (
|
|
176
|
+
for (const [key, value] of lodash_1.default.toPairs(currentConfig)) {
|
|
200
177
|
this[key] = value;
|
|
201
178
|
}
|
|
202
179
|
}
|
|
@@ -208,13 +185,10 @@ class BaseDriverCore extends core_1.DriverCore {
|
|
|
208
185
|
* Appium 2 has dropped the support of these, so now we only accept capability
|
|
209
186
|
* objects in W3C format and thus allow any of the three arguments to represent
|
|
210
187
|
* the latter.
|
|
211
|
-
* @param {W3CCapabilities<C>} w3cCapabilities1
|
|
212
|
-
* @param {W3CCapabilities<C>} [w3cCapabilities2]
|
|
213
|
-
* @param {W3CCapabilities<C>} [w3cCapabilities]
|
|
214
|
-
* @param {DriverData[]} [driverData]
|
|
215
|
-
* @returns {Promise<[string,Capabilities<C>]>}
|
|
216
188
|
*/
|
|
217
|
-
async createSession(w3cCapabilities1, w3cCapabilities2, w3cCapabilities,
|
|
189
|
+
async createSession(w3cCapabilities1, w3cCapabilities2, w3cCapabilities,
|
|
190
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
191
|
+
driverData) {
|
|
218
192
|
if (this.sessionId !== null) {
|
|
219
193
|
throw new protocol_1.errors.SessionNotCreatedError('Cannot create a new session while one is in progress');
|
|
220
194
|
}
|
|
@@ -227,7 +201,6 @@ class BaseDriverCore extends core_1.DriverCore {
|
|
|
227
201
|
this.setProtocolW3C();
|
|
228
202
|
this.originalCaps = originalCaps;
|
|
229
203
|
this.log.debug(`Creating session with W3C capabilities: ${JSON.stringify(originalCaps, null, 2)}`);
|
|
230
|
-
/** @type {Capabilities<C>} */
|
|
231
204
|
let caps;
|
|
232
205
|
try {
|
|
233
206
|
caps = (0, capabilities_1.processCapabilities)(originalCaps, this._desiredCapConstraints, this.shouldValidateCaps);
|
|
@@ -262,37 +235,28 @@ class BaseDriverCore extends core_1.DriverCore {
|
|
|
262
235
|
delete this.opts.app;
|
|
263
236
|
}
|
|
264
237
|
if (!lodash_1.default.isUndefined(this.caps.newCommandTimeout)) {
|
|
265
|
-
this.newCommandTimeoutMs =
|
|
238
|
+
this.newCommandTimeoutMs = this.caps.newCommandTimeout * 1000;
|
|
266
239
|
}
|
|
267
240
|
this._log.prefix = helpers_1.default.generateDriverLogPrefix(this, this.sessionId);
|
|
268
241
|
this.log.info(`Session created with session id: ${this.sessionId}`);
|
|
269
242
|
return [this.sessionId, caps];
|
|
270
243
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
* @param {string} [sessionId]
|
|
274
|
-
* @param {DriverData[]} [driverData]
|
|
275
|
-
* @returns {Promise<void>}
|
|
276
|
-
*/
|
|
277
|
-
async deleteSession(sessionId, driverData) {
|
|
244
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
245
|
+
async deleteSession(sessionId) {
|
|
278
246
|
await this.clearNewCommandTimeout();
|
|
279
247
|
if (this.isCommandsQueueEnabled && this.commandsQueueGuard.isBusy()) {
|
|
280
248
|
// simple hack to release pending commands if they exist
|
|
281
|
-
// @ts-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
249
|
+
// @ts-expect-error private API
|
|
250
|
+
const queues = this.commandsQueueGuard.queues;
|
|
251
|
+
for (const key of lodash_1.default.keys(queues)) {
|
|
252
|
+
queues[key] = [];
|
|
285
253
|
}
|
|
286
254
|
}
|
|
287
255
|
this.sessionId = null;
|
|
288
256
|
this._log.prefix = helpers_1.default.generateDriverLogPrefix(this);
|
|
289
257
|
}
|
|
290
|
-
/**
|
|
291
|
-
*
|
|
292
|
-
* @param {Capabilities<C>} caps
|
|
293
|
-
*/
|
|
294
258
|
logExtraCaps(caps) {
|
|
295
|
-
|
|
259
|
+
const extraCaps = lodash_1.default.difference(lodash_1.default.keys(caps), lodash_1.default.keys(this._desiredCapConstraints));
|
|
296
260
|
if (extraCaps.length) {
|
|
297
261
|
this.log.warn(`The following capabilities were provided, but are not ` + `recognized by Appium:`);
|
|
298
262
|
for (const cap of extraCaps) {
|
|
@@ -300,11 +264,6 @@ class BaseDriverCore extends core_1.DriverCore {
|
|
|
300
264
|
}
|
|
301
265
|
}
|
|
302
266
|
}
|
|
303
|
-
/**
|
|
304
|
-
*
|
|
305
|
-
* @param {Capabilities<C>} caps
|
|
306
|
-
* @returns {boolean}
|
|
307
|
-
*/
|
|
308
267
|
validateDesiredCaps(caps) {
|
|
309
268
|
if (!this.shouldValidateCaps) {
|
|
310
269
|
return true;
|
|
@@ -320,63 +279,7 @@ class BaseDriverCore extends core_1.DriverCore {
|
|
|
320
279
|
return true;
|
|
321
280
|
}
|
|
322
281
|
}
|
|
323
|
-
exports.BaseDriverCore = BaseDriverCore;
|
|
324
|
-
/**
|
|
325
|
-
* This ensures that all of the mixins correctly implement the interface described in {@linkcode Driver}.
|
|
326
|
-
* @template {Constraints} [C={}]
|
|
327
|
-
* @implements {Driver<C>}
|
|
328
|
-
*/
|
|
329
|
-
class BaseDriver extends (0, commands_1.createBaseDriverClass)(BaseDriverCore) {
|
|
330
|
-
}
|
|
331
282
|
exports.BaseDriver = BaseDriver;
|
|
283
|
+
__exportStar(require("./commands"), exports);
|
|
332
284
|
exports.default = BaseDriver;
|
|
333
|
-
/**
|
|
334
|
-
* @typedef {import('@appium/types').HTTPMethod} HTTPMethod
|
|
335
|
-
* @typedef {import('@appium/types').DriverData} DriverData
|
|
336
|
-
* @typedef {import('@appium/types').Constraints} Constraints
|
|
337
|
-
* @typedef {import('@appium/types').Constraint} Constraint
|
|
338
|
-
* @typedef {import('@appium/types').StringRecord} StringRecord
|
|
339
|
-
* @typedef {import('@appium/types').BaseDriverCapConstraints} BaseDriverCapConstraints
|
|
340
|
-
* @typedef {import('@appium/types').ServerArgs} ServerArgs
|
|
341
|
-
*/
|
|
342
|
-
/**
|
|
343
|
-
* @callback UpdateServerCallback
|
|
344
|
-
* @param {import('express').Express} app - Express app
|
|
345
|
-
* @param {import('@appium/types').AppiumServer} httpServer - HTTP server
|
|
346
|
-
* @returns {import('type-fest').Promisable<void>}
|
|
347
|
-
*/
|
|
348
|
-
/**
|
|
349
|
-
* This is used to extend {@linkcode BaseDriverCore} by the mixins and also external drivers.
|
|
350
|
-
* @template {Constraints} C
|
|
351
|
-
* @template [Proto={}]
|
|
352
|
-
* @template [Static={}]
|
|
353
|
-
* @typedef {import('@appium/types').Class<BaseDriverCore<C> & Proto,import('@appium/types').DriverStatic & Static>} BaseDriverBase
|
|
354
|
-
*/
|
|
355
|
-
/**
|
|
356
|
-
* @template {Constraints} [C=BaseDriverCapConstraints]
|
|
357
|
-
* @typedef {import('@appium/types').SessionHandler<[string, object],void, C>} SessionHandler
|
|
358
|
-
*/
|
|
359
|
-
/**
|
|
360
|
-
* @template {Constraints} [C=BaseDriverCapConstraints]
|
|
361
|
-
* @template {StringRecord|void} [Extra=void]
|
|
362
|
-
* @typedef {import('@appium/types').Capabilities<C, Extra>} Capabilities
|
|
363
|
-
*/
|
|
364
|
-
/**
|
|
365
|
-
* @template {Constraints} [C=BaseDriverCapConstraints]
|
|
366
|
-
* @template {StringRecord|void} [Extra=void]
|
|
367
|
-
* @typedef {import('@appium/types').W3CCapabilities<C, Extra>} W3CCapabilities
|
|
368
|
-
*/
|
|
369
|
-
/**
|
|
370
|
-
* @template {Constraints} [C=BaseDriverCapConstraints]
|
|
371
|
-
* @template {StringRecord} [CArgs=StringRecord]
|
|
372
|
-
* @typedef {import('@appium/types').Driver<C, CArgs>} Driver
|
|
373
|
-
*/
|
|
374
|
-
/**
|
|
375
|
-
* @template {Constraints} C
|
|
376
|
-
* @typedef {import('@appium/types').ExternalDriver<C>} ExternalDriver
|
|
377
|
-
*/
|
|
378
|
-
/**
|
|
379
|
-
* @template {Constraints} C
|
|
380
|
-
* @typedef {import('@appium/types').DriverOpts<C>} DriverOpts
|
|
381
|
-
*/
|
|
382
285
|
//# sourceMappingURL=driver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.js","sourceRoot":"","sources":["../../../lib/basedriver/driver.
|
|
1
|
+
{"version":3,"file":"driver.js","sourceRoot":"","sources":["../../../lib/basedriver/driver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,iDAAiE;AACjE,iCAAkC;AAClC,6CAAqC;AACrC,wDAAyB;AACzB,oDAAuB;AACvB,0DAA2D;AAC3D,0CAA8E;AAC9E,wDAAgC;AAChC,yCAcuB;AAEvB,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AACjD,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAChD,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AACxD,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AACtD,MAAM,4BAA4B,GAAG,sBAAsB,CAAC;AAE5D,MAAa,UAKX,SAAQ,iBAAuB;IAc/B,YAAY,IAAmB,EAAE,kBAAkB,GAAG,IAAI;QACxD,KAAK,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAEhC,IAAI,CAAC,IAAI,GAAG,EAAmB,CAAC;QAEhC,IAAI,CAAC,OAAO,GAAG,EAAwB,CAAC;IAC1C,CAAC;IAED;;;;;;OAMG;IACH,IAAc,sBAAsB;QAClC,OAAO,MAAM,CAAC,MAAM,CAAC,gBAAC,CAAC,KAAK,CAAC,EAAE,EAAE,oCAA4B,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAAc,GAAW,EAAE,GAAG,IAAW;QAC3D,4DAA4D;QAC5D,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,IAAI,GAAG,KAAK,eAAe,EAAE;YAC3B,mGAAmG;YACnG,IAAI,CAAC,QAAQ,GAAG,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAC;YACxC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;SACnC;aAAM,IAAI,GAAG,KAAK,iC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