appium-xcuitest-driver 10.3.0 → 10.4.1

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.
Files changed (257) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/active-app-info.d.ts +9 -0
  3. package/build/lib/commands/active-app-info.d.ts.map +1 -0
  4. package/build/lib/commands/active-app-info.js +14 -0
  5. package/build/lib/commands/active-app-info.js.map +1 -0
  6. package/build/lib/commands/alert.d.ts +42 -45
  7. package/build/lib/commands/alert.d.ts.map +1 -1
  8. package/build/lib/commands/alert.js +66 -62
  9. package/build/lib/commands/alert.js.map +1 -1
  10. package/build/lib/commands/app-management.d.ts +150 -153
  11. package/build/lib/commands/app-management.d.ts.map +1 -1
  12. package/build/lib/commands/app-management.js +300 -286
  13. package/build/lib/commands/app-management.js.map +1 -1
  14. package/build/lib/commands/app-strings.d.ts +14 -17
  15. package/build/lib/commands/app-strings.d.ts.map +1 -1
  16. package/build/lib/commands/app-strings.js +23 -24
  17. package/build/lib/commands/app-strings.js.map +1 -1
  18. package/build/lib/commands/appearance.d.ts +19 -22
  19. package/build/lib/commands/appearance.d.ts.map +1 -1
  20. package/build/lib/commands/appearance.js +56 -56
  21. package/build/lib/commands/appearance.js.map +1 -1
  22. package/build/lib/commands/audit.d.ts +22 -17
  23. package/build/lib/commands/audit.d.ts.map +1 -1
  24. package/build/lib/commands/audit.js +17 -18
  25. package/build/lib/commands/audit.js.map +1 -1
  26. package/build/lib/commands/battery.d.ts +11 -14
  27. package/build/lib/commands/battery.d.ts.map +1 -1
  28. package/build/lib/commands/battery.js +36 -37
  29. package/build/lib/commands/battery.js.map +1 -1
  30. package/build/lib/commands/biometric.d.ts +30 -33
  31. package/build/lib/commands/biometric.d.ts.map +1 -1
  32. package/build/lib/commands/biometric.js +42 -41
  33. package/build/lib/commands/biometric.js.map +1 -1
  34. package/build/lib/commands/certificate.d.ts +48 -45
  35. package/build/lib/commands/certificate.d.ts.map +1 -1
  36. package/build/lib/commands/certificate.js +218 -205
  37. package/build/lib/commands/certificate.js.map +1 -1
  38. package/build/lib/commands/clipboard.d.ts +19 -22
  39. package/build/lib/commands/clipboard.d.ts.map +1 -1
  40. package/build/lib/commands/clipboard.js +30 -30
  41. package/build/lib/commands/clipboard.js.map +1 -1
  42. package/build/lib/commands/condition.d.ts +49 -26
  43. package/build/lib/commands/condition.d.ts.map +1 -1
  44. package/build/lib/commands/condition.js +87 -86
  45. package/build/lib/commands/condition.js.map +1 -1
  46. package/build/lib/commands/content-size.d.ts +26 -29
  47. package/build/lib/commands/content-size.d.ts.map +1 -1
  48. package/build/lib/commands/content-size.js +36 -36
  49. package/build/lib/commands/content-size.js.map +1 -1
  50. package/build/lib/commands/context.d.ts +161 -108
  51. package/build/lib/commands/context.d.ts.map +1 -1
  52. package/build/lib/commands/context.js +530 -517
  53. package/build/lib/commands/context.js.map +1 -1
  54. package/build/lib/commands/deviceInfo.d.ts +9 -12
  55. package/build/lib/commands/deviceInfo.d.ts.map +1 -1
  56. package/build/lib/commands/deviceInfo.js +17 -18
  57. package/build/lib/commands/deviceInfo.js.map +1 -1
  58. package/build/lib/commands/element.d.ts +102 -105
  59. package/build/lib/commands/element.d.ts.map +1 -1
  60. package/build/lib/commands/element.js +337 -323
  61. package/build/lib/commands/element.js.map +1 -1
  62. package/build/lib/commands/execute.d.ts +24 -19
  63. package/build/lib/commands/execute.d.ts.map +1 -1
  64. package/build/lib/commands/execute.js +63 -62
  65. package/build/lib/commands/execute.js.map +1 -1
  66. package/build/lib/commands/file-movement.d.ts +77 -80
  67. package/build/lib/commands/file-movement.d.ts.map +1 -1
  68. package/build/lib/commands/file-movement.js +130 -124
  69. package/build/lib/commands/file-movement.js.map +1 -1
  70. package/build/lib/commands/find.d.ts +18 -21
  71. package/build/lib/commands/find.d.ts.map +1 -1
  72. package/build/lib/commands/find.js +158 -156
  73. package/build/lib/commands/find.js.map +1 -1
  74. package/build/lib/commands/general.d.ts +124 -116
  75. package/build/lib/commands/general.d.ts.map +1 -1
  76. package/build/lib/commands/general.js +248 -232
  77. package/build/lib/commands/general.js.map +1 -1
  78. package/build/lib/commands/geolocation.d.ts +43 -46
  79. package/build/lib/commands/geolocation.d.ts.map +1 -1
  80. package/build/lib/commands/geolocation.js +10 -11
  81. package/build/lib/commands/geolocation.js.map +1 -1
  82. package/build/lib/commands/gesture.d.ts +273 -276
  83. package/build/lib/commands/gesture.d.ts.map +1 -1
  84. package/build/lib/commands/gesture.js +506 -492
  85. package/build/lib/commands/gesture.js.map +1 -1
  86. package/build/lib/commands/increase-contrast.d.ts +20 -23
  87. package/build/lib/commands/increase-contrast.d.ts.map +1 -1
  88. package/build/lib/commands/increase-contrast.js +30 -30
  89. package/build/lib/commands/increase-contrast.js.map +1 -1
  90. package/build/lib/commands/iohid.d.ts +1370 -1373
  91. package/build/lib/commands/iohid.d.ts.map +1 -1
  92. package/build/lib/commands/iohid.js +30 -31
  93. package/build/lib/commands/iohid.js.map +1 -1
  94. package/build/lib/commands/keyboard.d.ts +29 -32
  95. package/build/lib/commands/keyboard.d.ts.map +1 -1
  96. package/build/lib/commands/keyboard.js +53 -51
  97. package/build/lib/commands/keyboard.js.map +1 -1
  98. package/build/lib/commands/keychains.d.ts +9 -12
  99. package/build/lib/commands/keychains.d.ts.map +1 -1
  100. package/build/lib/commands/keychains.js +13 -14
  101. package/build/lib/commands/keychains.js.map +1 -1
  102. package/build/lib/commands/localization.d.ts +16 -19
  103. package/build/lib/commands/localization.d.ts.map +1 -1
  104. package/build/lib/commands/localization.js +25 -26
  105. package/build/lib/commands/localization.js.map +1 -1
  106. package/build/lib/commands/location.d.ts +36 -39
  107. package/build/lib/commands/location.d.ts.map +1 -1
  108. package/build/lib/commands/location.js +99 -98
  109. package/build/lib/commands/location.js.map +1 -1
  110. package/build/lib/commands/lock.d.ts +21 -24
  111. package/build/lib/commands/lock.d.ts.map +1 -1
  112. package/build/lib/commands/lock.js +39 -38
  113. package/build/lib/commands/lock.js.map +1 -1
  114. package/build/lib/commands/log.d.ts +43 -37
  115. package/build/lib/commands/log.d.ts.map +1 -1
  116. package/build/lib/commands/log.js +174 -171
  117. package/build/lib/commands/log.js.map +1 -1
  118. package/build/lib/commands/memory.d.ts +9 -12
  119. package/build/lib/commands/memory.d.ts.map +1 -1
  120. package/build/lib/commands/memory.js +37 -38
  121. package/build/lib/commands/memory.js.map +1 -1
  122. package/build/lib/commands/navigation.d.ts +30 -33
  123. package/build/lib/commands/navigation.d.ts.map +1 -1
  124. package/build/lib/commands/navigation.js +92 -92
  125. package/build/lib/commands/navigation.js.map +1 -1
  126. package/build/lib/commands/notifications.d.ts +26 -29
  127. package/build/lib/commands/notifications.d.ts.map +1 -1
  128. package/build/lib/commands/notifications.js +53 -53
  129. package/build/lib/commands/notifications.js.map +1 -1
  130. package/build/lib/commands/pasteboard.d.ts +21 -24
  131. package/build/lib/commands/pasteboard.d.ts.map +1 -1
  132. package/build/lib/commands/pasteboard.js +37 -37
  133. package/build/lib/commands/pasteboard.js.map +1 -1
  134. package/build/lib/commands/pcap.d.ts +39 -26
  135. package/build/lib/commands/pcap.d.ts.map +1 -1
  136. package/build/lib/commands/pcap.js +81 -81
  137. package/build/lib/commands/pcap.js.map +1 -1
  138. package/build/lib/commands/performance.d.ts +63 -44
  139. package/build/lib/commands/performance.d.ts.map +1 -1
  140. package/build/lib/commands/performance.js +105 -105
  141. package/build/lib/commands/performance.js.map +1 -1
  142. package/build/lib/commands/permissions.d.ts +33 -36
  143. package/build/lib/commands/permissions.d.ts.map +1 -1
  144. package/build/lib/commands/permissions.js +66 -65
  145. package/build/lib/commands/permissions.js.map +1 -1
  146. package/build/lib/commands/proxy-helper.d.ts +12 -15
  147. package/build/lib/commands/proxy-helper.d.ts.map +1 -1
  148. package/build/lib/commands/proxy-helper.js +53 -54
  149. package/build/lib/commands/proxy-helper.js.map +1 -1
  150. package/build/lib/commands/record-audio.d.ts +49 -29
  151. package/build/lib/commands/record-audio.d.ts.map +1 -1
  152. package/build/lib/commands/record-audio.js +100 -104
  153. package/build/lib/commands/record-audio.js.map +1 -1
  154. package/build/lib/commands/recordscreen.d.ts +54 -18
  155. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  156. package/build/lib/commands/recordscreen.js +127 -129
  157. package/build/lib/commands/recordscreen.js.map +1 -1
  158. package/build/lib/commands/screenshots.d.ts +14 -17
  159. package/build/lib/commands/screenshots.d.ts.map +1 -1
  160. package/build/lib/commands/screenshots.js +108 -107
  161. package/build/lib/commands/screenshots.js.map +1 -1
  162. package/build/lib/commands/simctl.d.ts +11 -14
  163. package/build/lib/commands/simctl.d.ts.map +1 -1
  164. package/build/lib/commands/simctl.js +23 -26
  165. package/build/lib/commands/simctl.js.map +1 -1
  166. package/build/lib/commands/source.d.ts +14 -17
  167. package/build/lib/commands/source.d.ts.map +1 -1
  168. package/build/lib/commands/source.js +40 -43
  169. package/build/lib/commands/source.js.map +1 -1
  170. package/build/lib/commands/timeouts.d.ts +44 -33
  171. package/build/lib/commands/timeouts.d.ts.map +1 -1
  172. package/build/lib/commands/timeouts.js +65 -63
  173. package/build/lib/commands/timeouts.js.map +1 -1
  174. package/build/lib/commands/web.d.ts +275 -197
  175. package/build/lib/commands/web.d.ts.map +1 -1
  176. package/build/lib/commands/web.js +866 -785
  177. package/build/lib/commands/web.js.map +1 -1
  178. package/build/lib/commands/xctest-record-screen.d.ts +63 -66
  179. package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
  180. package/build/lib/commands/xctest-record-screen.js +103 -102
  181. package/build/lib/commands/xctest-record-screen.js.map +1 -1
  182. package/build/lib/commands/xctest.d.ts +55 -51
  183. package/build/lib/commands/xctest.d.ts.map +1 -1
  184. package/build/lib/commands/xctest.js +116 -117
  185. package/build/lib/commands/xctest.js.map +1 -1
  186. package/build/lib/driver.d.ts +277 -1597
  187. package/build/lib/driver.d.ts.map +1 -1
  188. package/build/lib/driver.js +318 -235
  189. package/build/lib/driver.js.map +1 -1
  190. package/build/lib/execute-method-map.d.ts.map +1 -1
  191. package/build/lib/execute-method-map.js +9 -0
  192. package/build/lib/execute-method-map.js.map +1 -1
  193. package/lib/commands/active-app-info.js +12 -0
  194. package/lib/commands/alert.js +68 -65
  195. package/lib/commands/app-management.js +308 -301
  196. package/lib/commands/app-strings.js +24 -26
  197. package/lib/commands/appearance.js +54 -56
  198. package/lib/commands/audit.js +18 -20
  199. package/lib/commands/battery.js +35 -37
  200. package/lib/commands/biometric.js +44 -46
  201. package/lib/commands/certificate.js +226 -215
  202. package/lib/commands/clipboard.js +30 -32
  203. package/lib/commands/condition.js +98 -100
  204. package/lib/commands/content-size.js +36 -38
  205. package/lib/commands/context.js +495 -490
  206. package/lib/commands/deviceInfo.js +19 -20
  207. package/lib/commands/element.js +367 -357
  208. package/lib/commands/execute.js +72 -72
  209. package/lib/commands/file-movement.js +132 -134
  210. package/lib/commands/find.js +160 -159
  211. package/lib/commands/general.js +238 -231
  212. package/lib/commands/geolocation.js +6 -14
  213. package/lib/commands/gesture.js +525 -515
  214. package/lib/commands/increase-contrast.js +30 -32
  215. package/lib/commands/iohid.js +32 -34
  216. package/lib/commands/keyboard.js +49 -51
  217. package/lib/commands/keychains.js +12 -14
  218. package/lib/commands/localization.js +24 -26
  219. package/lib/commands/location.js +102 -104
  220. package/lib/commands/lock.js +38 -38
  221. package/lib/commands/log.js +197 -198
  222. package/lib/commands/memory.js +40 -42
  223. package/lib/commands/navigation.js +96 -100
  224. package/lib/commands/notifications.js +57 -59
  225. package/lib/commands/pasteboard.js +37 -39
  226. package/lib/commands/pcap.js +84 -86
  227. package/lib/commands/performance.js +132 -133
  228. package/lib/commands/permissions.js +67 -69
  229. package/lib/commands/proxy-helper.js +60 -61
  230. package/lib/commands/record-audio.js +115 -120
  231. package/lib/commands/recordscreen.js +145 -149
  232. package/lib/commands/screenshots.js +116 -116
  233. package/lib/commands/simctl.js +25 -29
  234. package/lib/commands/source.js +42 -46
  235. package/lib/commands/timeouts.js +59 -63
  236. package/lib/commands/web.js +932 -859
  237. package/lib/commands/xctest-record-screen.js +103 -105
  238. package/lib/commands/xctest.js +134 -139
  239. package/lib/driver.js +286 -235
  240. package/lib/execute-method-map.ts +9 -0
  241. package/npm-shrinkwrap.json +8 -8
  242. package/package.json +1 -1
  243. package/build/lib/commands/activeAppInfo.d.ts +0 -12
  244. package/build/lib/commands/activeAppInfo.d.ts.map +0 -1
  245. package/build/lib/commands/activeAppInfo.js +0 -15
  246. package/build/lib/commands/activeAppInfo.js.map +0 -1
  247. package/build/lib/commands/index.d.ts +0 -96
  248. package/build/lib/commands/index.d.ts.map +0 -1
  249. package/build/lib/commands/index.js +0 -100
  250. package/build/lib/commands/index.js.map +0 -1
  251. package/build/lib/cookies.d.ts +0 -15
  252. package/build/lib/cookies.d.ts.map +0 -1
  253. package/build/lib/cookies.js +0 -84
  254. package/build/lib/cookies.js.map +0 -1
  255. package/lib/commands/activeAppInfo.js +0 -14
  256. package/lib/commands/index.js +0 -95
  257. package/lib/cookies.js +0 -92
@@ -4,6 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.parseCommonName = parseCommonName;
7
+ exports.mobileInstallCertificate = mobileInstallCertificate;
8
+ exports.mobileRemoveCertificate = mobileRemoveCertificate;
9
+ exports.mobileListCertificates = mobileListCertificates;
7
10
  const lodash_1 = __importDefault(require("lodash"));
8
11
  const support_1 = require("appium/support");
9
12
  const asyncbox_1 = require("asyncbox");
@@ -60,6 +63,221 @@ const Alert = /** @type {const} */ ({
60
63
  value: "**/XCUIElementTypeAny[`type == 'XCUIElementTypeAlert' OR type == 'XCUIElementTypeSheet'`]/**/XCUIElementTypeButton[`label == 'Install'`]",
61
64
  },
62
65
  });
66
+ const LIBRE_SSL_PATTERN = /\/CN=([^\/]+)/; // eslint-disable-line no-useless-escape
67
+ const OPEN_SSL_PATTERN = /,\sCN\s=\s([^,]+)/;
68
+ /**
69
+ * Parses the common name of the certificate from the given string.
70
+ *
71
+ * @param {string} stringCertificate
72
+ * @returns {string} The common name of the certificate
73
+ */
74
+ function parseCommonName(stringCertificate) {
75
+ const result = [LIBRE_SSL_PATTERN, OPEN_SSL_PATTERN].reduce((acc, r) => {
76
+ if (acc) {
77
+ return acc;
78
+ }
79
+ const match = r.exec(stringCertificate);
80
+ return match?.[1];
81
+ }, null);
82
+ if (!result) {
83
+ throw new Error(`There is no common name value in '${stringCertificate}' output`);
84
+ }
85
+ return result;
86
+ }
87
+ /**
88
+ * Installs a custom certificate onto the device.
89
+ *
90
+ * Since Xcode SDK 11.4, Apple has added a dedicated `simctl` subcommand to quickly handle
91
+ * certificates on Simulator over CLI.
92
+ *
93
+ * On real devices (or simulators before Xcode SDK 11.4), Apple provides no "official" way to do this via the command line. In such a case (and also as a fallback if CLI setup fails), this method tries to wrap the certificate into `.mobileconfig` format, then deploys the wrapped file to the internal HTTP server so that it can be opened via mobile Safari. This command then goes through the profile installation procedure by clicking the necessary buttons using WebDriverAgent.
94
+ * @param {string} content - Base64-encoded content of the public certificate in [PEM](https://knowledge.digicert.com/quovadis/ssl-certificates/ssl-general-topics/what-is-pem-format.html) format
95
+ * @param {string} [commonName] - Common name of the certificate. If this is not set, the command will try to parse it from the provided `content`.
96
+ * @param {boolean} isRoot - Defines where the certificate should be installed; either the Trusted Root Store (`true`) or the Keychain (`false`). On environments other than Xcode 11.4+ Simulator, this option is ignored.
97
+ * @returns {Promise<string|void>} The content of the generated `.mobileconfig` file as
98
+ * a base64-encoded string. This config might be useful for debugging purposes. If the certificate has been successfully set via CLI, then nothing is returned.
99
+ * @this {XCUITestDriver}
100
+ */
101
+ async function mobileInstallCertificate(content, commonName, isRoot = true) {
102
+ if (lodash_1.default.isEmpty(content)) {
103
+ throw new Error('Certificate content should not be empty');
104
+ }
105
+ if (this.isSimulator()) {
106
+ try {
107
+ const methodName = isRoot ? 'addRootCertificate' : 'addCertificate';
108
+ await /** @type {import('../driver').Simulator} */ (this.device).simctl[methodName](Buffer.from(content, 'base64').toString(), {
109
+ raw: true,
110
+ });
111
+ return;
112
+ }
113
+ catch (e) {
114
+ this.log.debug(e);
115
+ this.log.info(`The certificate cannot be installed via CLI. ` + `Falling back to UI-based deployment`);
116
+ }
117
+ }
118
+ else {
119
+ const client = new py_ios_device_client_1.Pyidevice({
120
+ udid: this.opts.udid,
121
+ log: this.log,
122
+ });
123
+ if (await client.assertExists(false)) {
124
+ await client.installProfile({ payload: Buffer.from(content, 'base64') });
125
+ return;
126
+ }
127
+ else {
128
+ this.log.info('pyidevice is not installed on your system. ' +
129
+ 'Falling back to the (slow) UI-based installation');
130
+ }
131
+ }
132
+ const tmpRoot = await support_1.tempDir.openDir();
133
+ const tmpPort = await (0, portscanner_1.findAPortNotInUse)(HOST_PORT_RANGE[0], HOST_PORT_RANGE[1]);
134
+ const configName = `appium.${CONFIG_EXTENSION}`;
135
+ const configPath = path_1.default.resolve(tmpRoot, configName);
136
+ const tmpServer = http_1.default.createServer(async function (_, res) {
137
+ const configFile = await support_1.fs.readFile(configPath);
138
+ res.end(configFile);
139
+ });
140
+ try {
141
+ const certBuffer = Buffer.from(content, 'base64');
142
+ const cn = commonName || (await extractCommonName(certBuffer));
143
+ const mobileConfig = toMobileConfig(certBuffer, cn);
144
+ try {
145
+ await support_1.plist.updatePlistFile(configPath, mobileConfig, false, false);
146
+ }
147
+ catch (err) {
148
+ throw new Error(`Cannot store the generated config as '${configPath}'. ` +
149
+ `Original error: ${err.message}`);
150
+ }
151
+ try {
152
+ const host = os_1.default.hostname();
153
+ const certUrl = `http://${host}:${tmpPort}/${configName}`;
154
+ await tmpServer.listen(tmpPort);
155
+ try {
156
+ await (0, asyncbox_1.waitForCondition)(async () => {
157
+ try {
158
+ return (await (0, portscanner_1.checkPortStatus)(tmpPort, host)) === 'open';
159
+ }
160
+ catch {
161
+ return false;
162
+ }
163
+ }, {
164
+ waitMs: TMPSERVER_STARTUP_TIMEOUT,
165
+ intervalMs: 300,
166
+ });
167
+ this.log.debug(`The temporary web server is running at http://${host}:${tmpPort}`);
168
+ }
169
+ catch {
170
+ throw new Error(`The temporary web server cannot be started at http://${host}:${tmpPort}.`);
171
+ }
172
+ if (this.isRealDevice()) {
173
+ try {
174
+ await this.proxyCommand('/url', 'POST', { url: certUrl });
175
+ }
176
+ catch (err) {
177
+ if (this.isWebContext()) {
178
+ // The command above does not always work on real devices
179
+ await this.setUrl(certUrl);
180
+ }
181
+ else {
182
+ throw err;
183
+ }
184
+ }
185
+ }
186
+ else {
187
+ await /** @type {import('../driver').Simulator} */ (this.device).openUrl(certUrl);
188
+ }
189
+ let isCertAlreadyInstalled = false;
190
+ if (support_1.util.compareVersions(/** @type {string} */ (this.opts.platformVersion), '>=', '12.2')) {
191
+ if (await installPost122Certificate(this, cn)) {
192
+ await clickElement(this, Settings.Profile);
193
+ await trustCertificateInPreferences(this, cn);
194
+ }
195
+ else {
196
+ isCertAlreadyInstalled = true;
197
+ }
198
+ }
199
+ else {
200
+ if (await installPre122Certificate(this)) {
201
+ await clickElement(this, Button.Return_to_Settings);
202
+ await trustCertificateInPreferences(this, cn);
203
+ }
204
+ else {
205
+ isCertAlreadyInstalled = true;
206
+ }
207
+ }
208
+ if (isCertAlreadyInstalled) {
209
+ this.log.info(`It looks like the '${cn}' certificate has been already added to the CA root`);
210
+ }
211
+ }
212
+ finally {
213
+ if (this.opts.bundleId) {
214
+ try {
215
+ await this.activateApp(this.opts.bundleId);
216
+ }
217
+ catch (e) {
218
+ this.log.warn(`Cannot restore the application '${this.opts.bundleId}'. Original error: ${e.message}`);
219
+ }
220
+ }
221
+ }
222
+ return (await support_1.util.toInMemoryBase64(configPath)).toString();
223
+ }
224
+ finally {
225
+ await tmpServer.close();
226
+ await support_1.fs.rimraf(tmpRoot);
227
+ }
228
+ }
229
+ /**
230
+ * Removes installed certificates.
231
+ *
232
+ * This only works _if and only if_ `py-ios-device` is installed on the same machine Appium is running on.
233
+ *
234
+ * @see https://github.com/YueChen-C/py-ios-device
235
+ * @since 4.19.2
236
+ * @param {string} name - Name of the profile
237
+ * @returns {Promise<string>} Returns status acknowledgment status if
238
+ * tht certificate is successfully removed or 'None' (basically just
239
+ * forwards the original pyidevice output)
240
+ * @throws {Error} If attempting to remove certificates for a simulated device or if `py-ios-device` is not installed
241
+ * @group Real Device Only
242
+ */
243
+ async function mobileRemoveCertificate(name) {
244
+ if (!this.isRealDevice()) {
245
+ throw new driver_1.errors.NotImplementedError('This extension is only supported on real devices');
246
+ }
247
+ const client = new py_ios_device_client_1.Pyidevice({
248
+ udid: this.opts.udid,
249
+ log: this.log,
250
+ });
251
+ await client.assertExists(true);
252
+ return await client.removeProfile(name);
253
+ }
254
+ /**
255
+ * Returns map of certificates installed on the real device.
256
+ *
257
+ * This only works _if and only if_ `py-ios-device` is installed on the same machine Appium is running on.
258
+ * @since 4.10.0
259
+ * @see https://github.com/YueChen-C/py-ios-device
260
+ * @returns {Promise<import('./types').CertificateList>} An object describing the certificates installed on the real device.
261
+ * @throws {Error} If attempting to list certificates for a simulated device or if `py-ios-device` is not installed
262
+ * @this {XCUITestDriver}
263
+ */
264
+ async function mobileListCertificates() {
265
+ if (!this.isRealDevice()) {
266
+ throw new driver_1.errors.NotImplementedError('This extension is only supported on real devices');
267
+ }
268
+ const client = new py_ios_device_client_1.Pyidevice({
269
+ udid: this.opts.udid,
270
+ log: this.log,
271
+ });
272
+ await client.assertExists(true);
273
+ return await client.listProfiles();
274
+ }
275
+ /**
276
+ * Extracts the common name of the certificate from the given buffer.
277
+ *
278
+ * @param {Buffer} certBuffer
279
+ * @returns {Promise<string>} The common name of the certificate
280
+ */
63
281
  async function extractCommonName(certBuffer) {
64
282
  const tempCert = await support_1.tempDir.open({
65
283
  prefix: 'cert',
@@ -78,21 +296,6 @@ async function extractCommonName(certBuffer) {
78
296
  await support_1.fs.rimraf(tempCert.path);
79
297
  }
80
298
  }
81
- const LIBRE_SSL_PATTERN = /\/CN=([^\/]+)/; // eslint-disable-line no-useless-escape
82
- const OPEN_SSL_PATTERN = /,\sCN\s=\s([^,]+)/;
83
- function parseCommonName(stringCertificate) {
84
- const result = [LIBRE_SSL_PATTERN, OPEN_SSL_PATTERN].reduce((acc, r) => {
85
- if (acc) {
86
- return acc;
87
- }
88
- const match = r.exec(stringCertificate);
89
- return match?.[1];
90
- }, null);
91
- if (!result) {
92
- throw new Error(`There is no common name value in '${stringCertificate}' output`);
93
- }
94
- return result;
95
- }
96
299
  /**
97
300
  * Generates Apple's over-the-air configuration profile
98
301
  * for certificate deployment based on the given PEM certificate content.
@@ -245,196 +448,6 @@ async function installPost122Certificate(driver, name) {
245
448
  await clickElement(driver, Button.Done);
246
449
  return true;
247
450
  }
248
- exports.default = {
249
- /**
250
- * Installs a custom certificate onto the device.
251
- *
252
- * Since Xcode SDK 11.4, Apple has added a dedicated `simctl` subcommand to quickly handle
253
- * certificates on Simulator over CLI.
254
- *
255
- * On real devices (or simulators before Xcode SDK 11.4), Apple provides no "official" way to do this via the command line. In such a case (and also as a fallback if CLI setup fails), this method tries to wrap the certificate into `.mobileconfig` format, then deploys the wrapped file to the internal HTTP server so that it can be opened via mobile Safari. This command then goes through the profile installation procedure by clicking the necessary buttons using WebDriverAgent.
256
- * @param {string} content - Base64-encoded content of the public certificate in [PEM](https://knowledge.digicert.com/quovadis/ssl-certificates/ssl-general-topics/what-is-pem-format.html) format
257
- * @param {string} [commonName] - Common name of the certificate. If this is not set, the command will try to parse it from the provided `content`.
258
- * @param {boolean} isRoot - Defines where the certificate should be installed; either the Trusted Root Store (`true`) or the Keychain (`false`). On environments other than Xcode 11.4+ Simulator, this option is ignored.
259
- * @returns {Promise<string|void>} The content of the generated `.mobileconfig` file as
260
- * a base64-encoded string. This config might be useful for debugging purposes. If the certificate has been successfully set via CLI, then nothing is returned.
261
- * @this {XCUITestDriver}
262
- */
263
- async mobileInstallCertificate(content, commonName, isRoot = true) {
264
- if (lodash_1.default.isEmpty(content)) {
265
- throw new Error('Certificate content should not be empty');
266
- }
267
- if (this.isSimulator()) {
268
- try {
269
- const methodName = isRoot ? 'addRootCertificate' : 'addCertificate';
270
- await /** @type {import('../driver').Simulator} */ (this.device).simctl[methodName](Buffer.from(content, 'base64').toString(), {
271
- raw: true,
272
- });
273
- return;
274
- }
275
- catch (e) {
276
- this.log.debug(e);
277
- this.log.info(`The certificate cannot be installed via CLI. ` + `Falling back to UI-based deployment`);
278
- }
279
- }
280
- else {
281
- const client = new py_ios_device_client_1.Pyidevice({
282
- udid: this.opts.udid,
283
- log: this.log,
284
- });
285
- if (await client.assertExists(false)) {
286
- await client.installProfile({ payload: Buffer.from(content, 'base64') });
287
- return;
288
- }
289
- else {
290
- this.log.info('pyidevice is not installed on your system. ' +
291
- 'Falling back to the (slow) UI-based installation');
292
- }
293
- }
294
- const tmpRoot = await support_1.tempDir.openDir();
295
- const tmpPort = await (0, portscanner_1.findAPortNotInUse)(HOST_PORT_RANGE[0], HOST_PORT_RANGE[1]);
296
- const configName = `appium.${CONFIG_EXTENSION}`;
297
- const configPath = path_1.default.resolve(tmpRoot, configName);
298
- const tmpServer = http_1.default.createServer(async function (_, res) {
299
- const configFile = await support_1.fs.readFile(configPath);
300
- res.end(configFile);
301
- });
302
- try {
303
- const certBuffer = Buffer.from(content, 'base64');
304
- const cn = commonName || (await extractCommonName(certBuffer));
305
- const mobileConfig = toMobileConfig(certBuffer, cn);
306
- try {
307
- await support_1.plist.updatePlistFile(configPath, mobileConfig, false, false);
308
- }
309
- catch (err) {
310
- throw new Error(`Cannot store the generated config as '${configPath}'. ` +
311
- `Original error: ${err.message}`);
312
- }
313
- try {
314
- const host = os_1.default.hostname();
315
- const certUrl = `http://${host}:${tmpPort}/${configName}`;
316
- await tmpServer.listen(tmpPort);
317
- try {
318
- await (0, asyncbox_1.waitForCondition)(async () => {
319
- try {
320
- return (await (0, portscanner_1.checkPortStatus)(tmpPort, host)) === 'open';
321
- }
322
- catch {
323
- return false;
324
- }
325
- }, {
326
- waitMs: TMPSERVER_STARTUP_TIMEOUT,
327
- intervalMs: 300,
328
- });
329
- this.log.debug(`The temporary web server is running at http://${host}:${tmpPort}`);
330
- }
331
- catch {
332
- throw new Error(`The temporary web server cannot be started at http://${host}:${tmpPort}.`);
333
- }
334
- if (this.isRealDevice()) {
335
- try {
336
- await this.proxyCommand('/url', 'POST', { url: certUrl });
337
- }
338
- catch (err) {
339
- if (this.isWebContext()) {
340
- // The command above does not always work on real devices
341
- await this.setUrl(certUrl);
342
- }
343
- else {
344
- throw err;
345
- }
346
- }
347
- }
348
- else {
349
- await /** @type {import('../driver').Simulator} */ (this.device).openUrl(certUrl);
350
- }
351
- let isCertAlreadyInstalled = false;
352
- if (support_1.util.compareVersions(/** @type {string} */ (this.opts.platformVersion), '>=', '12.2')) {
353
- if (await installPost122Certificate(this, cn)) {
354
- await clickElement(this, Settings.Profile);
355
- await trustCertificateInPreferences(this, cn);
356
- }
357
- else {
358
- isCertAlreadyInstalled = true;
359
- }
360
- }
361
- else {
362
- if (await installPre122Certificate(this)) {
363
- await clickElement(this, Button.Return_to_Settings);
364
- await trustCertificateInPreferences(this, cn);
365
- }
366
- else {
367
- isCertAlreadyInstalled = true;
368
- }
369
- }
370
- if (isCertAlreadyInstalled) {
371
- this.log.info(`It looks like the '${cn}' certificate has been already added to the CA root`);
372
- }
373
- }
374
- finally {
375
- if (this.opts.bundleId) {
376
- try {
377
- await this.activateApp(this.opts.bundleId);
378
- }
379
- catch (e) {
380
- this.log.warn(`Cannot restore the application '${this.opts.bundleId}'. Original error: ${e.message}`);
381
- }
382
- }
383
- }
384
- return (await support_1.util.toInMemoryBase64(configPath)).toString();
385
- }
386
- finally {
387
- await tmpServer.close();
388
- await support_1.fs.rimraf(tmpRoot);
389
- }
390
- },
391
- /**
392
- * Removes installed certificates.
393
- *
394
- * This only works _if and only if_ `py-ios-device` is installed on the same machine Appium is running on.
395
- *
396
- * @see https://github.com/YueChen-C/py-ios-device
397
- * @since 4.19.2
398
- * @param {string} name - Name of the profile
399
- * @returns {Promise<string>} Returns status acknowledgment status if
400
- * tht certificate is successfully removed or 'None' (basically just
401
- * forwards the original pyidevice output)
402
- * @throws {Error} If attempting to remove certificates for a simulated device or if `py-ios-device` is not installed
403
- * @group Real Device Only
404
- */
405
- async mobileRemoveCertificate(name) {
406
- if (!this.isRealDevice()) {
407
- throw new driver_1.errors.NotImplementedError('This extension is only supported on real devices');
408
- }
409
- const client = new py_ios_device_client_1.Pyidevice({
410
- udid: this.opts.udid,
411
- log: this.log,
412
- });
413
- await client.assertExists(true);
414
- return await client.removeProfile(name);
415
- },
416
- /**
417
- * Returns map of certificates installed on the real device.
418
- *
419
- * This only works _if and only if_ `py-ios-device` is installed on the same machine Appium is running on.
420
- * @since 4.10.0
421
- * @see https://github.com/YueChen-C/py-ios-device
422
- * @returns {Promise<import('./types').CertificateList>} An object describing the certificates installed on the real device.
423
- * @throws {Error} If attempting to list certificates for a simulated device or if `py-ios-device` is not installed
424
- * @this {XCUITestDriver}
425
- */
426
- async mobileListCertificates() {
427
- if (!this.isRealDevice()) {
428
- throw new driver_1.errors.NotImplementedError('This extension is only supported on real devices');
429
- }
430
- const client = new py_ios_device_client_1.Pyidevice({
431
- udid: this.opts.udid,
432
- log: this.log,
433
- });
434
- await client.assertExists(true);
435
- return await client.listProfiles();
436
- },
437
- };
438
451
  /**
439
452
  * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
440
453
  */
@@ -1 +1 @@
1
- {"version":3,"file":"certificate.js","sourceRoot":"","sources":["../../../lib/commands/certificate.js"],"names":[],"mappings":";;;;;AAiFA,0CAYC;AA7FD,oDAAuB;AACvB,4CAAwD;AACxD,uCAAgE;AAChE,wDAAyB;AACzB,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AACxB,+CAAkC;AAClC,6CAA+D;AAC/D,sFAAsE;AACtE,0CAAqC;AAErC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AACxC,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACvC,MAAM,yBAAyB,GA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AAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,uBAAuB,CAAC,IAAI;QAChC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,eAAM,CAAC,mBAAmB,CAAC,kDAAkD,CAAC,CAAC;QAC3F,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,gCAAS,CAAC;YAC3B,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YACpB,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC,CAAC;QACH,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,sBAAsB;QAC1B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,eAAM,CAAC,mBAAmB,CAAC,kDAAkD,CAAC,CAAC;QAC3F,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,gCAAS,CAAC;YAC3B,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YACpB,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC,CAAC;QACH,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;CACF,CAAC;AAEF;;GAEG"}
1
+ {"version":3,"file":"certificate.js","sourceRoot":"","sources":["../../../lib/commands/certificate.js"],"names":[],"mappings":";;;;;AAoEA,0CAYC;AAgBD,4DAoIC;AAgBD,0DAUC;AAYD,wDAUC;AApRD,oDAAuB;AACvB,4CAAwD;AACxD,uCAAgE;AAChE,wDAAyB;AACzB,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AACxB,+CAAkC;AAClC,6CAA+D;AAC/D,sFAAsE;AACtE,0CAAqC;AAErC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ChB,MAAM,EACN;YACE,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,sCAAsC,IAAI,MAAM;SACxD,EACD;YACE,OAAO,EAAE,GAAG;YACZ,eAAe,EAAE,IAAI;SACtB,CACF,EACD,CAAC;YACD,WAAW,GAAG,IAAI,CAAC;YACnB,MAAM;QACR,CAAC;QAED,MAAM,MAAM,CAAC,WAAW,CAAC;YACvB,OAAO,EAAE,MAAM,MAAM,CAAC,2BAA2B,CAC/C,YAAY,EACZ,sBAAsB,EACtB,KAAK,CACN;YACD,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;IACL,CAAC;IACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,IAAI,IAAI,4CAA4C,CAAC,CAAC;IACxE,CAAC;IAED,kEAAkE;IAClE,IACE,CAAC,CAAC,MAAM,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE;QAC3C,eAAe,EAAE,IAAI;KACtB,CAAC,CAAC,EACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,kBAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB,iCAAiC;IACjC,MAAM,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3C,eAAe;IACf,MAAM,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C,4BAA4B;IAC5B,MAAM,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAExC,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG"}
@@ -1,24 +1,21 @@
1
- declare namespace _default {
2
- /**
3
- * Sets the primary clipboard's content on the device under test.
4
- *
5
- * @param {string} content - The content to be set as base64 encoded string.
6
- * @param {string} [contentType=plaintext] - The type of the content to set.
7
- * Only `plaintext`, 'image and 'url' are supported.
8
- * @this {XCUITestDriver}
9
- */
10
- function setClipboard(this: import("../driver").XCUITestDriver, content: string, contentType?: string): Promise<void>;
11
- /**
12
- * Gets the content of the primary clipboard on the device under test.
13
- *
14
- * @param {string} [contentType=plaintext] - The type of the content to get.
15
- * Only `plaintext`, 'image and 'url' are supported.
16
- * @returns {Promise<string>} The actual clipboard content encoded into base64 string.
17
- * An empty string is returned if the clipboard contains no data.
18
- * @this {XCUITestDriver}
19
- */
20
- function getClipboard(this: import("../driver").XCUITestDriver, contentType?: string): Promise<string>;
21
- }
22
- export default _default;
1
+ /**
2
+ * Sets the primary clipboard's content on the device under test.
3
+ *
4
+ * @param {string} content - The content to be set as base64 encoded string.
5
+ * @param {string} [contentType=plaintext] - The type of the content to set.
6
+ * Only `plaintext`, 'image and 'url' are supported.
7
+ * @this {XCUITestDriver}
8
+ */
9
+ export function setClipboard(this: import("../driver").XCUITestDriver, content: string, contentType?: string): Promise<void>;
10
+ /**
11
+ * Gets the content of the primary clipboard on the device under test.
12
+ *
13
+ * @param {string} [contentType=plaintext] - The type of the content to get.
14
+ * Only `plaintext`, 'image and 'url' are supported.
15
+ * @returns {Promise<string>} The actual clipboard content encoded into base64 string.
16
+ * An empty string is returned if the clipboard contains no data.
17
+ * @this {XCUITestDriver}
18
+ */
19
+ export function getClipboard(this: import("../driver").XCUITestDriver, contentType?: string): Promise<string>;
23
20
  export type XCUITestDriver = import("../driver").XCUITestDriver;
24
21
  //# sourceMappingURL=clipboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/clipboard.js"],"names":[],"mappings":";IACE;;;;;;;OAOG;IACH,yEALW,MAAM,gBACN,MAAM,iBAShB;IAED;;;;;;;;OAQG;IACH,8EANW,MAAM,GAEJ,OAAO,CAAC,MAAM,CAAC,CAU3B;;;6BAIU,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/clipboard.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,gFALW,MAAM,gBACN,MAAM,iBAShB;AAED;;;;;;;;GAQG;AACH,qFANW,MAAM,GAEJ,OAAO,CAAC,MAAM,CAAC,CAU3B;6BAGY,OAAO,WAAW,EAAE,cAAc"}
@@ -1,35 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- /**
5
- * Sets the primary clipboard's content on the device under test.
6
- *
7
- * @param {string} content - The content to be set as base64 encoded string.
8
- * @param {string} [contentType=plaintext] - The type of the content to set.
9
- * Only `plaintext`, 'image and 'url' are supported.
10
- * @this {XCUITestDriver}
11
- */
12
- async setClipboard(content, contentType) {
13
- await this.proxyCommand('/wda/setPasteboard', 'POST', {
14
- content,
15
- contentType,
16
- });
17
- },
18
- /**
19
- * Gets the content of the primary clipboard on the device under test.
20
- *
21
- * @param {string} [contentType=plaintext] - The type of the content to get.
22
- * Only `plaintext`, 'image and 'url' are supported.
23
- * @returns {Promise<string>} The actual clipboard content encoded into base64 string.
24
- * An empty string is returned if the clipboard contains no data.
25
- * @this {XCUITestDriver}
26
- */
27
- async getClipboard(contentType) {
28
- return /** @type {string} */ (await this.proxyCommand('/wda/getPasteboard', 'POST', {
29
- contentType,
30
- }));
31
- },
32
- };
3
+ exports.setClipboard = setClipboard;
4
+ exports.getClipboard = getClipboard;
5
+ /**
6
+ * Sets the primary clipboard's content on the device under test.
7
+ *
8
+ * @param {string} content - The content to be set as base64 encoded string.
9
+ * @param {string} [contentType=plaintext] - The type of the content to set.
10
+ * Only `plaintext`, 'image and 'url' are supported.
11
+ * @this {XCUITestDriver}
12
+ */
13
+ async function setClipboard(content, contentType) {
14
+ await this.proxyCommand('/wda/setPasteboard', 'POST', {
15
+ content,
16
+ contentType,
17
+ });
18
+ }
19
+ /**
20
+ * Gets the content of the primary clipboard on the device under test.
21
+ *
22
+ * @param {string} [contentType=plaintext] - The type of the content to get.
23
+ * Only `plaintext`, 'image and 'url' are supported.
24
+ * @returns {Promise<string>} The actual clipboard content encoded into base64 string.
25
+ * An empty string is returned if the clipboard contains no data.
26
+ * @this {XCUITestDriver}
27
+ */
28
+ async function getClipboard(contentType) {
29
+ return /** @type {string} */ (await this.proxyCommand('/wda/getPasteboard', 'POST', {
30
+ contentType,
31
+ }));
32
+ }
33
33
  /**
34
34
  * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
35
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../../lib/commands/clipboard.js"],"names":[],"mappings":";;AAAA,kBAAe;IACb;;;;;;;OAOG;IACH,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,WAAW;QACrC,MAAM,IAAI,CAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,EAAE;YACpD,OAAO;YACP,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,YAAY,CAAC,WAAW;QAC5B,OAAO,qBAAqB,CAAC,CAC3B,MAAM,IAAI,CAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,EAAE;YACpD,WAAW;SACZ,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAC;AAEF;;GAEG"}
1
+ {"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../../lib/commands/clipboard.js"],"names":[],"mappings":";;AAQA,oCAKC;AAWD,oCAMC;AA9BD;;;;;;;GAOG;AACI,KAAK,UAAU,YAAY,CAAC,OAAO,EAAE,WAAW;IACrD,MAAM,IAAI,CAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,EAAE;QACpD,OAAO;QACP,WAAW;KACZ,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,YAAY,CAAC,WAAW;IAC5C,OAAO,qBAAqB,CAAC,CAC3B,MAAM,IAAI,CAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,EAAE;QACpD,WAAW;KACZ,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;GAEG"}