appium 3.2.2 → 3.3.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 (250) hide show
  1. package/build/lib/appium.d.ts +147 -205
  2. package/build/lib/appium.d.ts.map +1 -1
  3. package/build/lib/appium.js +169 -282
  4. package/build/lib/appium.js.map +1 -1
  5. package/build/lib/bidi-commands.d.ts.map +1 -1
  6. package/build/lib/bidi-commands.js +11 -11
  7. package/build/lib/bidi-commands.js.map +1 -1
  8. package/build/lib/bootstrap/appium-initializer.d.ts +21 -0
  9. package/build/lib/bootstrap/appium-initializer.d.ts.map +1 -0
  10. package/build/lib/bootstrap/appium-initializer.js +146 -0
  11. package/build/lib/bootstrap/appium-initializer.js.map +1 -0
  12. package/build/lib/bootstrap/appium-main-runner.d.ts +22 -0
  13. package/build/lib/bootstrap/appium-main-runner.d.ts.map +1 -0
  14. package/build/lib/bootstrap/appium-main-runner.js +109 -0
  15. package/build/lib/bootstrap/appium-main-runner.js.map +1 -0
  16. package/build/lib/bootstrap/config-file.d.ts +37 -0
  17. package/build/lib/bootstrap/config-file.d.ts.map +1 -0
  18. package/build/lib/{config-file.js → bootstrap/config-file.js} +62 -138
  19. package/build/lib/bootstrap/config-file.js.map +1 -0
  20. package/build/lib/bootstrap/grid-v3-register.d.ts +20 -0
  21. package/build/lib/bootstrap/grid-v3-register.d.ts.map +1 -0
  22. package/build/lib/bootstrap/grid-v3-register.js +185 -0
  23. package/build/lib/bootstrap/grid-v3-register.js.map +1 -0
  24. package/build/lib/bootstrap/init-types.d.ts +16 -0
  25. package/build/lib/bootstrap/init-types.d.ts.map +1 -0
  26. package/build/lib/bootstrap/init-types.js +3 -0
  27. package/build/lib/bootstrap/init-types.js.map +1 -0
  28. package/build/lib/bootstrap/main-helpers.d.ts +55 -0
  29. package/build/lib/bootstrap/main-helpers.d.ts.map +1 -0
  30. package/build/lib/bootstrap/main-helpers.js +187 -0
  31. package/build/lib/bootstrap/main-helpers.js.map +1 -0
  32. package/build/lib/bootstrap/node-helpers.d.ts +32 -0
  33. package/build/lib/bootstrap/node-helpers.d.ts.map +1 -0
  34. package/build/lib/bootstrap/node-helpers.js +201 -0
  35. package/build/lib/bootstrap/node-helpers.js.map +1 -0
  36. package/build/lib/bootstrap/startup-config.d.ts +22 -0
  37. package/build/lib/bootstrap/startup-config.d.ts.map +1 -0
  38. package/build/lib/bootstrap/startup-config.js +111 -0
  39. package/build/lib/bootstrap/startup-config.js.map +1 -0
  40. package/build/lib/cli/args.d.ts +16 -12
  41. package/build/lib/cli/args.d.ts.map +1 -1
  42. package/build/lib/cli/args.js +20 -40
  43. package/build/lib/cli/args.js.map +1 -1
  44. package/build/lib/cli/driver-command.d.ts +51 -93
  45. package/build/lib/cli/driver-command.d.ts.map +1 -1
  46. package/build/lib/cli/driver-command.js +11 -66
  47. package/build/lib/cli/driver-command.js.map +1 -1
  48. package/build/lib/cli/extension-command.d.ts +173 -377
  49. package/build/lib/cli/extension-command.d.ts.map +1 -1
  50. package/build/lib/cli/extension-command.js +387 -656
  51. package/build/lib/cli/extension-command.js.map +1 -1
  52. package/build/lib/cli/extension.d.ts +10 -15
  53. package/build/lib/cli/extension.d.ts.map +1 -1
  54. package/build/lib/cli/extension.js +15 -33
  55. package/build/lib/cli/extension.js.map +1 -1
  56. package/build/lib/cli/parser.d.ts +37 -66
  57. package/build/lib/cli/parser.d.ts.map +1 -1
  58. package/build/lib/cli/parser.js +69 -104
  59. package/build/lib/cli/parser.js.map +1 -1
  60. package/build/lib/cli/plugin-command.d.ts +50 -90
  61. package/build/lib/cli/plugin-command.d.ts.map +1 -1
  62. package/build/lib/cli/plugin-command.js +11 -63
  63. package/build/lib/cli/plugin-command.js.map +1 -1
  64. package/build/lib/cli/setup-command.d.ts +21 -26
  65. package/build/lib/cli/setup-command.d.ts.map +1 -1
  66. package/build/lib/cli/setup-command.js +19 -61
  67. package/build/lib/cli/setup-command.js.map +1 -1
  68. package/build/lib/cli/utils.d.ts +33 -35
  69. package/build/lib/cli/utils.d.ts.map +1 -1
  70. package/build/lib/cli/utils.js +48 -50
  71. package/build/lib/cli/utils.js.map +1 -1
  72. package/build/lib/constants.d.ts +23 -23
  73. package/build/lib/constants.d.ts.map +1 -1
  74. package/build/lib/constants.js +10 -15
  75. package/build/lib/constants.js.map +1 -1
  76. package/build/lib/doctor/doctor.d.ts +40 -57
  77. package/build/lib/doctor/doctor.d.ts.map +1 -1
  78. package/build/lib/doctor/doctor.js +31 -62
  79. package/build/lib/doctor/doctor.js.map +1 -1
  80. package/build/lib/extension/driver-config.d.ts +18 -77
  81. package/build/lib/extension/driver-config.d.ts.map +1 -1
  82. package/build/lib/extension/driver-config.js +37 -125
  83. package/build/lib/extension/driver-config.js.map +1 -1
  84. package/build/lib/extension/extension-config.d.ts +103 -210
  85. package/build/lib/extension/extension-config.d.ts.map +1 -1
  86. package/build/lib/extension/extension-config.js +180 -342
  87. package/build/lib/extension/extension-config.js.map +1 -1
  88. package/build/lib/extension/index.d.ts +12 -29
  89. package/build/lib/extension/index.d.ts.map +1 -1
  90. package/build/lib/extension/index.js +33 -75
  91. package/build/lib/extension/index.js.map +1 -1
  92. package/build/lib/extension/manifest-migrations.d.ts +3 -20
  93. package/build/lib/extension/manifest-migrations.d.ts.map +1 -1
  94. package/build/lib/extension/manifest-migrations.js +20 -101
  95. package/build/lib/extension/manifest-migrations.js.map +1 -1
  96. package/build/lib/extension/manifest.d.ts +61 -107
  97. package/build/lib/extension/manifest.d.ts.map +1 -1
  98. package/build/lib/extension/manifest.js +181 -356
  99. package/build/lib/extension/manifest.js.map +1 -1
  100. package/build/lib/extension/package-changed.d.ts +1 -3
  101. package/build/lib/extension/package-changed.d.ts.map +1 -1
  102. package/build/lib/extension/package-changed.js +8 -15
  103. package/build/lib/extension/package-changed.js.map +1 -1
  104. package/build/lib/extension/plugin-config.d.ts +10 -52
  105. package/build/lib/extension/plugin-config.d.ts.map +1 -1
  106. package/build/lib/extension/plugin-config.js +11 -63
  107. package/build/lib/extension/plugin-config.js.map +1 -1
  108. package/build/lib/helpers/build.d.ts +22 -0
  109. package/build/lib/helpers/build.d.ts.map +1 -0
  110. package/build/lib/helpers/build.js +109 -0
  111. package/build/lib/helpers/build.js.map +1 -0
  112. package/build/lib/helpers/capability.d.ts +38 -0
  113. package/build/lib/helpers/capability.d.ts.map +1 -0
  114. package/build/lib/helpers/capability.js +128 -0
  115. package/build/lib/helpers/capability.js.map +1 -0
  116. package/build/lib/helpers/network.d.ts +14 -0
  117. package/build/lib/helpers/network.d.ts.map +1 -0
  118. package/build/lib/helpers/network.js +35 -0
  119. package/build/lib/helpers/network.js.map +1 -0
  120. package/build/lib/insecure-features.js +6 -6
  121. package/build/lib/insecure-features.js.map +1 -1
  122. package/build/lib/inspector-commands.d.ts +6 -0
  123. package/build/lib/inspector-commands.d.ts.map +1 -1
  124. package/build/lib/inspector-commands.js +6 -0
  125. package/build/lib/inspector-commands.js.map +1 -1
  126. package/build/lib/logger.d.ts +2 -3
  127. package/build/lib/logger.d.ts.map +1 -1
  128. package/build/lib/logger.js +2 -3
  129. package/build/lib/logger.js.map +1 -1
  130. package/build/lib/logsink.d.ts +13 -22
  131. package/build/lib/logsink.d.ts.map +1 -1
  132. package/build/lib/logsink.js +48 -103
  133. package/build/lib/logsink.js.map +1 -1
  134. package/build/lib/main.d.ts +15 -58
  135. package/build/lib/main.d.ts.map +1 -1
  136. package/build/lib/main.js +25 -425
  137. package/build/lib/main.js.map +1 -1
  138. package/build/lib/schema/arg-spec.d.ts +32 -107
  139. package/build/lib/schema/arg-spec.d.ts.map +1 -1
  140. package/build/lib/schema/arg-spec.js +11 -107
  141. package/build/lib/schema/arg-spec.js.map +1 -1
  142. package/build/lib/schema/cli-args-guards.d.ts +34 -0
  143. package/build/lib/schema/cli-args-guards.d.ts.map +1 -0
  144. package/build/lib/schema/cli-args-guards.js +49 -0
  145. package/build/lib/schema/cli-args-guards.js.map +1 -0
  146. package/build/lib/schema/cli-args.d.ts +3 -15
  147. package/build/lib/schema/cli-args.d.ts.map +1 -1
  148. package/build/lib/schema/cli-args.js +17 -107
  149. package/build/lib/schema/cli-args.js.map +1 -1
  150. package/build/lib/schema/cli-transformers.d.ts +15 -12
  151. package/build/lib/schema/cli-transformers.d.ts.map +1 -1
  152. package/build/lib/schema/cli-transformers.js +15 -45
  153. package/build/lib/schema/cli-transformers.js.map +1 -1
  154. package/build/lib/schema/format-errors.d.ts +28 -0
  155. package/build/lib/schema/format-errors.d.ts.map +1 -0
  156. package/build/lib/schema/format-errors.js +29 -0
  157. package/build/lib/schema/format-errors.js.map +1 -0
  158. package/build/lib/schema/index.d.ts +4 -2
  159. package/build/lib/schema/index.d.ts.map +1 -1
  160. package/build/lib/schema/index.js +2 -0
  161. package/build/lib/schema/index.js.map +1 -1
  162. package/build/lib/schema/keywords.d.ts +12 -20
  163. package/build/lib/schema/keywords.d.ts.map +1 -1
  164. package/build/lib/schema/keywords.js +6 -51
  165. package/build/lib/schema/keywords.js.map +1 -1
  166. package/build/lib/schema/schema.d.ts +106 -231
  167. package/build/lib/schema/schema.d.ts.map +1 -1
  168. package/build/lib/schema/schema.js +88 -358
  169. package/build/lib/schema/schema.js.map +1 -1
  170. package/build/lib/utils.d.ts +7 -267
  171. package/build/lib/utils.d.ts.map +1 -1
  172. package/build/lib/utils.js +10 -409
  173. package/build/lib/utils.js.map +1 -1
  174. package/lib/{appium.js → appium.ts} +297 -341
  175. package/lib/bidi-commands.ts +10 -14
  176. package/lib/bootstrap/appium-initializer.ts +212 -0
  177. package/lib/bootstrap/appium-main-runner.ts +172 -0
  178. package/lib/bootstrap/config-file.ts +178 -0
  179. package/lib/bootstrap/grid-v3-register.ts +250 -0
  180. package/lib/bootstrap/init-types.ts +31 -0
  181. package/lib/bootstrap/main-helpers.ts +223 -0
  182. package/lib/bootstrap/node-helpers.ts +180 -0
  183. package/lib/bootstrap/startup-config.ts +143 -0
  184. package/lib/cli/{args.js → args.ts} +45 -56
  185. package/lib/cli/driver-command.ts +122 -0
  186. package/lib/cli/{extension-command.js → extension-command.ts} +827 -906
  187. package/lib/cli/extension.ts +65 -0
  188. package/lib/cli/{parser.js → parser.ts} +93 -116
  189. package/lib/cli/plugin-command.ts +117 -0
  190. package/lib/cli/{setup-command.js → setup-command.ts} +59 -74
  191. package/lib/cli/utils.ts +97 -0
  192. package/lib/{constants.js → constants.ts} +30 -41
  193. package/lib/doctor/{doctor.js → doctor.ts} +82 -92
  194. package/lib/extension/driver-config.ts +165 -0
  195. package/lib/extension/{extension-config.js → extension-config.ts} +291 -405
  196. package/lib/extension/index.ts +143 -0
  197. package/lib/extension/manifest-migrations.ts +57 -0
  198. package/lib/extension/manifest.ts +369 -0
  199. package/lib/extension/{package-changed.js → package-changed.ts} +9 -18
  200. package/lib/extension/plugin-config.ts +62 -0
  201. package/lib/helpers/build.ts +111 -0
  202. package/lib/helpers/capability.ts +171 -0
  203. package/lib/helpers/network.ts +30 -0
  204. package/lib/insecure-features.ts +1 -1
  205. package/lib/inspector-commands.ts +6 -1
  206. package/lib/{logger.js → logger.ts} +1 -2
  207. package/lib/{logsink.js → logsink.ts} +91 -137
  208. package/lib/main.ts +60 -0
  209. package/lib/schema/arg-spec.ts +131 -0
  210. package/lib/schema/cli-args-guards.ts +67 -0
  211. package/lib/schema/cli-args.ts +171 -0
  212. package/lib/schema/cli-transformers.ts +83 -0
  213. package/lib/schema/format-errors.ts +43 -0
  214. package/lib/schema/index.ts +4 -0
  215. package/lib/schema/keywords.ts +96 -0
  216. package/lib/schema/schema.ts +448 -0
  217. package/lib/utils.ts +73 -0
  218. package/package.json +17 -18
  219. package/scripts/autoinstall-extensions.js +3 -0
  220. package/build/lib/config-file.d.ts +0 -100
  221. package/build/lib/config-file.d.ts.map +0 -1
  222. package/build/lib/config-file.js.map +0 -1
  223. package/build/lib/config.d.ts +0 -70
  224. package/build/lib/config.d.ts.map +0 -1
  225. package/build/lib/config.js +0 -390
  226. package/build/lib/config.js.map +0 -1
  227. package/build/lib/grid-register.d.ts +0 -10
  228. package/build/lib/grid-register.d.ts.map +0 -1
  229. package/build/lib/grid-register.js +0 -134
  230. package/build/lib/grid-register.js.map +0 -1
  231. package/lib/cli/driver-command.js +0 -174
  232. package/lib/cli/extension.js +0 -74
  233. package/lib/cli/plugin-command.js +0 -164
  234. package/lib/cli/utils.js +0 -91
  235. package/lib/config-file.js +0 -228
  236. package/lib/config.js +0 -389
  237. package/lib/extension/driver-config.js +0 -245
  238. package/lib/extension/index.js +0 -169
  239. package/lib/extension/manifest-migrations.js +0 -136
  240. package/lib/extension/manifest.js +0 -550
  241. package/lib/extension/plugin-config.js +0 -112
  242. package/lib/grid-register.js +0 -146
  243. package/lib/main.js +0 -545
  244. package/lib/schema/arg-spec.js +0 -229
  245. package/lib/schema/cli-args.js +0 -254
  246. package/lib/schema/cli-transformers.js +0 -113
  247. package/lib/schema/index.js +0 -2
  248. package/lib/schema/keywords.js +0 -136
  249. package/lib/schema/schema.js +0 -725
  250. package/lib/utils.js +0 -512
@@ -1,143 +1,68 @@
1
+ import type { ExtensionType } from '@appium/types';
1
2
  /**
2
3
  * The original ID of the Appium config schema.
3
4
  * We use this in the CLI to convert it to `argparse` options.
4
5
  */
5
- export const APPIUM_CONFIG_SCHEMA_ID: "appium.json";
6
+ export declare const APPIUM_CONFIG_SCHEMA_ID = "appium.json";
6
7
  /**
7
8
  * The schema prop containing server-related options. Everything in here
8
9
  * is "native" to Appium.
9
- * Used by {@link flattenSchema} for transforming the schema into CLI args.
10
10
  */
11
- export const SERVER_PROP_NAME: "server";
11
+ export declare const SERVER_PROP_NAME = "server";
12
+ export interface ArgSpecOptions<D = unknown> {
13
+ extName?: string;
14
+ extType?: ExtensionType;
15
+ dest?: string;
16
+ defaultValue?: D;
17
+ }
12
18
  /**
13
19
  * An `ArgSpec` is a class representing metadata about an argument (or config
14
20
  * option) used for cross-referencing.
15
21
  *
16
- * This class has no instance methods, and is basically just a read-only "struct".
17
- * @template D
22
+ * This class has no instance methods beyond stringification and is effectively
23
+ * a read-only struct.
18
24
  */
19
- export class ArgSpec<D> {
25
+ export declare class ArgSpec<D = unknown> {
26
+ readonly name: string;
27
+ readonly extType?: ExtensionType;
28
+ readonly extName?: string;
29
+ readonly ref: string;
30
+ readonly arg: string;
31
+ readonly dest: string;
32
+ readonly rawDest: string;
33
+ readonly defaultValue?: D;
34
+ /**
35
+ * Builds computed fields and assigns them to the instance.
36
+ * Use {@link ArgSpec.create} instead of `new ArgSpec()`.
37
+ */
38
+ constructor(name: string, { extType, extName, dest, defaultValue }?: ArgSpecOptions<D>);
20
39
  /**
21
- * Return the schema ID (`$id`) for the **argument** given the parameters.
22
- *
23
- * If you need the "root" or "base" schema ID, use {@link ArgSpec.toSchemaBaseRef} instead.
24
- * @param {string} name - Argument name
25
- * @param {ExtensionType} [extType] - Extension type
26
- * @param {string} [extName] - Extension name
27
- * @returns {string} Schema ID
40
+ * Return the schema ID (`$id`) for the argument given the parameters.
28
41
  */
29
42
  static toSchemaRef(name: string, extType?: ExtensionType, extName?: string): string;
30
43
  /**
31
- * Return the schema ID for an extension or the base schema ID.
32
- * @param {ExtensionType} [extType] - Extension type
33
- * @param {string} [extName] - Extension name
44
+ * Return the root schema ID for an extension or Appium base schema.
34
45
  */
35
46
  static toSchemaBaseRef(extType?: ExtensionType, extName?: string): string;
36
47
  /**
37
- * Return the unique ID for the argument given the parameters.
38
- * @param {string} name - Argument name
39
- * @param {ExtensionType} [extType] - Extension type
40
- * @param {string} [extName] - Extension name
41
- * @returns {string} Unique ID
48
+ * Return the unique CLI argument key for the argument.
42
49
  */
43
50
  static toArg(name: string, extType?: ExtensionType, extName?: string): string;
44
51
  /**
45
- * Normalizes a raw extension name (not including the type).
46
- * @param {string} extName - Extension name
47
- * @returns {string} Normalized extension name
52
+ * Normalizes a raw extension name (not including type).
48
53
  */
49
54
  static toNormalizedExtName(extName: string): string;
50
55
  /**
51
- * When given the root ID of a schema for an extension (`<extType>-<normalizedExtName>.json`) Returns an object containing the extension type and the _normalized_ extension name.
52
- * @param {string} schemaId - Root schema ID
53
- * @returns { {extType?: ExtensionType, normalizedExtName?: string} }
56
+ * Parse root schema ID (`<extType>-<normalizedExtName>.json`) to extension info.
54
57
  */
55
58
  static extensionInfoFromRootSchemaId(schemaId: string): {
56
59
  extType?: ExtensionType;
57
60
  normalizedExtName?: string;
58
61
  };
59
62
  /**
60
- * Creates an `ArgSpec`
61
- *
62
- * @param {string} name - The canonical name of the argument. Corresponds to a key in a schema's
63
- * `properties` property.
64
- * @template D
65
- * @param {ArgSpecOptions<D>} [opts] - Options
66
- * @returns {Readonly<ArgSpec>}
67
- */
68
- static create<D_1>(name: string, opts?: ArgSpecOptions<D_1>): Readonly<ArgSpec<any>>;
69
- /**
70
- * Builds some computed fields and assigns them to the instance.
71
- *
72
- * Undefined properties are not assigned.
73
- *
74
- * The _constructor_ is private. Use {@link ArgSpec.create} instead.
75
- * @private
76
- * @param {string} name
77
- * @param {ArgSpecOptions<D>} opts
78
- */
79
- private constructor();
80
- /**
81
- * The canonical name of the argument. Corresponds to key in schema's `properties` prop.
82
- * @type {string}
83
- */
84
- name: string;
85
- /**
86
- * The `ExtensionType` of the argument. This will be set if the arg came from an extension;
87
- * otherwise it will be `undefined`.
88
- * @type {ExtensionType|undefined}
89
- */
90
- extType: ExtensionType | undefined;
91
- /**
92
- * The name of the extension, if this argument came from an extension.
93
- *
94
- * Otherwise `undefined`.
95
- * @type {string|undefined}
96
- */
97
- extName: string | undefined;
98
- /**
99
- * The schema ID (`$id`) for the argument. This is automatically determined, and any user-provided `$id`s will be overwritten.
100
- *
101
- * @type {string}
102
- */
103
- ref: string;
104
- /**
105
- * The CLI argument, sans leading dashes.
106
- * @type {string}
107
- */
108
- arg: string;
109
- /**
110
- * The desired keypath for the argument after arguments have been parsed.
111
- *
112
- * Typically this is camelCased. If the arg came from an extension, it will be prefixed with
113
- * `<extType>.<extName>.`
114
- * @type {string}
115
- */
116
- dest: string;
117
- /**
118
- * The same as {@link ArgSpec.dest} but without the leading `<extType>.<extName>.` prefix.
119
- */
120
- rawDest: string;
121
- /**
122
- * Whatever the default value of this argument is, as specified by the
123
- * `default` property of the schema.
124
- * @type {D|undefined}
125
- */
126
- defaultValue: D | undefined;
127
- /**
128
- * String representation, useful for debugging
129
- * @returns {string}
63
+ * Creates a frozen `ArgSpec`.
130
64
  */
65
+ static create<D = unknown>(name: string, opts?: ArgSpecOptions<D>): Readonly<ArgSpec<D>>;
131
66
  toString(): string;
132
67
  }
133
- /**
134
- * Options for {@link ArgSpec.create}
135
- */
136
- export type ArgSpecOptions<D> = {
137
- extName?: string | undefined;
138
- extType?: import("@appium/types").ExtensionType | undefined;
139
- dest?: string | undefined;
140
- defaultValue?: D | undefined;
141
- };
142
- export type ExtensionType = import("@appium/types").ExtensionType;
143
68
  //# sourceMappingURL=arg-spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"arg-spec.d.ts","sourceRoot":"","sources":["../../../lib/schema/arg-spec.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,sCAAuC,aAAa,CAAC;AAErD;;;;GAIG;AACH,+BAAgC,QAAQ,CAAC;AAYzC;;;;;;GAMG;AACH,qBAFa,CAAC;IA2FZ;;;;;;;;OAQG;IACH,yBALW,MAAM,YACN,aAAa,YACb,MAAM,GACJ,MAAM,CAQlB;IAED;;;;OAIG;IACH,iCAHW,aAAa,YACb,MAAM,UAOhB;IAED;;;;;;OAMG;IACH,mBALW,MAAM,YACN,aAAa,YACb,MAAM,GACJ,MAAM,CAQlB;IAED;;;;OAIG;IACH,oCAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,+CAHW,MAAM,GACH;QAAC,OAAO,CAAC,EAAE,aAAa,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAC,CAUlE;IAED;;;;;;;;OAQG;IACH,yBANW,MAAM,SAGN,cAAc,CAAC,GAAC,CAAC,GACf,QAAQ,cAAS,CAI7B;IAhHD;;;;;;;;;OASG;IACH,s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AC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAE1B;;;OAGG;gBACS,IAAI,EAAE,MAAM,EAAE,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAC,GAAE,cAAc,CAAC,CAAC,CAAM;IAgBxF;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAQnF;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAOzE;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IAQ7E;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAInD;;OAEG;IACH,MAAM,CAAC,6BAA6B,CAClC,QAAQ,EAAE,MAAM,GACf;QAAC,OAAO,CAAC,EAAE,aAAa,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAC;IAYxD;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAIxF,QAAQ,IAAI,MAAM;CAOnB"}
@@ -13,89 +13,33 @@ exports.APPIUM_CONFIG_SCHEMA_ID = 'appium.json';
13
13
  /**
14
14
  * The schema prop containing server-related options. Everything in here
15
15
  * is "native" to Appium.
16
- * Used by {@link flattenSchema} for transforming the schema into CLI args.
17
16
  */
18
17
  exports.SERVER_PROP_NAME = 'server';
19
- /**
20
- * Used to parse extension info from a schema ID.
21
- */
22
18
  const SCHEMA_ID_REGEXP = /^(?<extType>.+?)-(?<normalizedExtName>.+)\.json$/;
23
- /**
24
- * Avoid typos by using constants!
25
- */
26
19
  const PROPERTIES = 'properties';
27
20
  /**
28
21
  * An `ArgSpec` is a class representing metadata about an argument (or config
29
22
  * option) used for cross-referencing.
30
23
  *
31
- * This class has no instance methods, and is basically just a read-only "struct".
32
- * @template D
24
+ * This class has no instance methods beyond stringification and is effectively
25
+ * a read-only struct.
33
26
  */
34
27
  class ArgSpec {
35
- /**
36
- * The canonical name of the argument. Corresponds to key in schema's `properties` prop.
37
- * @type {string}
38
- */
39
28
  name;
40
- /**
41
- * The `ExtensionType` of the argument. This will be set if the arg came from an extension;
42
- * otherwise it will be `undefined`.
43
- * @type {ExtensionType|undefined}
44
- */
45
29
  extType;
46
- /**
47
- * The name of the extension, if this argument came from an extension.
48
- *
49
- * Otherwise `undefined`.
50
- * @type {string|undefined}
51
- */
52
30
  extName;
53
- /**
54
- * The schema ID (`$id`) for the argument. This is automatically determined, and any user-provided `$id`s will be overwritten.
55
- *
56
- * @type {string}
57
- */
58
31
  ref;
59
- /**
60
- * The CLI argument, sans leading dashes.
61
- * @type {string}
62
- */
63
32
  arg;
64
- /**
65
- * The desired keypath for the argument after arguments have been parsed.
66
- *
67
- * Typically this is camelCased. If the arg came from an extension, it will be prefixed with
68
- * `<extType>.<extName>.`
69
- * @type {string}
70
- */
71
33
  dest;
72
- /**
73
- * The same as {@link ArgSpec.dest} but without the leading `<extType>.<extName>.` prefix.
74
- */
75
34
  rawDest;
76
- /**
77
- * Whatever the default value of this argument is, as specified by the
78
- * `default` property of the schema.
79
- * @type {D|undefined}
80
- */
81
35
  defaultValue;
82
36
  /**
83
- * Builds some computed fields and assigns them to the instance.
84
- *
85
- * Undefined properties are not assigned.
86
- *
87
- * The _constructor_ is private. Use {@link ArgSpec.create} instead.
88
- * @private
89
- * @param {string} name
90
- * @param {ArgSpecOptions<D>} opts
37
+ * Builds computed fields and assigns them to the instance.
38
+ * Use {@link ArgSpec.create} instead of `new ArgSpec()`.
91
39
  */
92
40
  constructor(name, { extType, extName, dest, defaultValue } = {}) {
93
- // we must normalize the extension name to fit into our convention for CLI
94
- // args.
95
41
  const arg = ArgSpec.toArg(name, extType, extName);
96
42
  const ref = ArgSpec.toSchemaRef(name, extType, extName);
97
- // if no explicit `dest` provided, just camelCase the name to avoid needing
98
- // to use bracket syntax when accessing props on the parsed args object.
99
43
  const rawDest = lodash_1.default.camelCase(dest ?? name);
100
44
  const destKeypath = extType && extName ? [extType, extName, rawDest].join('.') : rawDest;
101
45
  this.defaultValue = defaultValue;
@@ -108,13 +52,7 @@ class ArgSpec {
108
52
  this.rawDest = rawDest;
109
53
  }
110
54
  /**
111
- * Return the schema ID (`$id`) for the **argument** given the parameters.
112
- *
113
- * If you need the "root" or "base" schema ID, use {@link ArgSpec.toSchemaBaseRef} instead.
114
- * @param {string} name - Argument name
115
- * @param {ExtensionType} [extType] - Extension type
116
- * @param {string} [extName] - Extension name
117
- * @returns {string} Schema ID
55
+ * Return the schema ID (`$id`) for the argument given the parameters.
118
56
  */
119
57
  static toSchemaRef(name, extType, extName) {
120
58
  const baseRef = ArgSpec.toSchemaBaseRef(extType, extName);
@@ -124,9 +62,7 @@ class ArgSpec {
124
62
  return [`${baseRef}#`, PROPERTIES, exports.SERVER_PROP_NAME, PROPERTIES, name].join('/');
125
63
  }
126
64
  /**
127
- * Return the schema ID for an extension or the base schema ID.
128
- * @param {ExtensionType} [extType] - Extension type
129
- * @param {string} [extName] - Extension name
65
+ * Return the root schema ID for an extension or Appium base schema.
130
66
  */
131
67
  static toSchemaBaseRef(extType, extName) {
132
68
  if (extType && extName) {
@@ -135,11 +71,7 @@ class ArgSpec {
135
71
  return exports.APPIUM_CONFIG_SCHEMA_ID;
136
72
  }
137
73
  /**
138
- * Return the unique ID for the argument given the parameters.
139
- * @param {string} name - Argument name
140
- * @param {ExtensionType} [extType] - Extension type
141
- * @param {string} [extName] - Extension name
142
- * @returns {string} Unique ID
74
+ * Return the unique CLI argument key for the argument.
143
75
  */
144
76
  static toArg(name, extType, extName) {
145
77
  const properName = lodash_1.default.kebabCase(name.replace(/^--?/, ''));
@@ -149,44 +81,28 @@ class ArgSpec {
149
81
  return properName;
150
82
  }
151
83
  /**
152
- * Normalizes a raw extension name (not including the type).
153
- * @param {string} extName - Extension name
154
- * @returns {string} Normalized extension name
84
+ * Normalizes a raw extension name (not including type).
155
85
  */
156
86
  static toNormalizedExtName(extName) {
157
87
  return lodash_1.default.kebabCase(extName);
158
88
  }
159
89
  /**
160
- * When given the root ID of a schema for an extension (`<extType>-<normalizedExtName>.json`) Returns an object containing the extension type and the _normalized_ extension name.
161
- * @param {string} schemaId - Root schema ID
162
- * @returns { {extType?: ExtensionType, normalizedExtName?: string} }
90
+ * Parse root schema ID (`<extType>-<normalizedExtName>.json`) to extension info.
163
91
  */
164
92
  static extensionInfoFromRootSchemaId(schemaId) {
165
93
  const matches = schemaId.match(SCHEMA_ID_REGEXP);
166
94
  if (matches?.groups) {
167
- const { extType, normalizedExtName } =
168
- /** @type { {extType: ExtensionType, normalizedExtName: string} } */ (matches.groups);
95
+ const { extType, normalizedExtName } = matches.groups;
169
96
  return { extType, normalizedExtName };
170
97
  }
171
98
  return {};
172
99
  }
173
100
  /**
174
- * Creates an `ArgSpec`
175
- *
176
- * @param {string} name - The canonical name of the argument. Corresponds to a key in a schema's
177
- * `properties` property.
178
- * @template D
179
- * @param {ArgSpecOptions<D>} [opts] - Options
180
- * @returns {Readonly<ArgSpec>}
101
+ * Creates a frozen `ArgSpec`.
181
102
  */
182
103
  static create(name, opts) {
183
104
  return Object.freeze(new ArgSpec(name, opts));
184
105
  }
185
- /**
186
- * String representation, useful for debugging
187
- * @returns {string}
188
- */
189
- /* istanbul ignore next */
190
106
  toString() {
191
107
  let str = `[ArgSpec] ${this.name} (${this.ref})`;
192
108
  if (this.extType && this.extName) {
@@ -196,16 +112,4 @@ class ArgSpec {
196
112
  }
197
113
  }
198
114
  exports.ArgSpec = ArgSpec;
199
- /**
200
- * Options for {@link ArgSpec.create}
201
- * @template D
202
- * @typedef ArgSpecOptions
203
- * @property {string} [extName]
204
- * @property {ExtensionType} [extType]
205
- * @property {string} [dest]
206
- * @property {D} [defaultValue]
207
- */
208
- /**
209
- * @typedef {import('@appium/types').ExtensionType} ExtensionType
210
- */
211
115
  //# sourceMappingURL=arg-spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"arg-spec.js","sourceRoot":"","sources":["../../../lib/schema/arg-spec.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAEvB;;;GAGG;AACU,QAAA,uBAAuB,GAAG,aAAa,CAAC;AAErD;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,QAAQ,CAAC;AAEzC;;GAEG;AACH,MAAM,gBAAgB,GAAG,kDAAkD,CAAC;AAE5E;;GAEG;AACH,MAAM,UAAU,GAAG,YAAY,CAAC;AAEhC;;;;;;GAMG;AACH,MAAa,OAAO;IAClB;;;OAGG;IACH,IAAI,CAAC;IAEL;;;;OAIG;IACH,OAAO,CAAC;IAER;;;;;OAKG;IACH,OAAO,CAAC;IAER;;;;OAIG;IACH,GAAG,CAAC;IAEJ;;;OAGG;IACH,GAAG,CAAC;IAEJ;;;;;;OAMG;IACH,IAAI,CAAC;IAEL;;OAEG;IACH,OAAO,CAAC;IAER;;;;OAIG;IACH,YAAY,CAAC;IAEb;;;;;;;;;OASG;IACH,YAAY,IAAI,EAAE,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAC,GAAG,EAAE;QAC3D,0EAA0E;QAC1E,QAAQ;QACR,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAElD,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAExD,2EAA2E;QA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AI,OAAO,EAAE,CAAC;YACvB,OAAO,CAAC,OAAO,EAAE,gBAAC,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,OAAe;QACxC,OAAO,gBAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,6BAA6B,CAClC,QAAgB;QAEhB,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACjD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,MAAM,EAAC,OAAO,EAAE,iBAAiB,EAAC,GAAG,OAAO,CAAC,MAG5C,CAAC;YACF,OAAO,EAAC,OAAO,EAAE,iBAAiB,EAAC,CAAC;QACtC,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,CAAc,IAAY,EAAE,IAAwB;QAC/D,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,QAAQ;QACN,IAAI,GAAG,GAAG,aAAa,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC;QACjD,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjC,GAAG,IAAI,UAAU,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC;QACnD,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AApGD,0BAoGC"}
@@ -0,0 +1,34 @@
1
+ import type { Args, CliCommand, CliCommandDriver, CliCommandPlugin, CliCommandServer, CliCommandSetup, CliExtensionCommand, CliExtensionSubcommand, CliCommandSetupSubcommand } from 'appium/types';
2
+ type AnyArgs = Args<CliCommand, CliExtensionSubcommand | CliCommandSetupSubcommand | void>;
3
+ /**
4
+ * Type guard: args are for the server command.
5
+ *
6
+ * @param args - Parsed args before full subcommand-specific narrowing
7
+ */
8
+ export declare function isServerCommandArgs(args: AnyArgs): args is Args<CliCommandServer, void>;
9
+ /**
10
+ * Type guard: args are for the setup command.
11
+ *
12
+ * @param args - Parsed args before full subcommand-specific narrowing
13
+ */
14
+ export declare function isSetupCommandArgs(args: AnyArgs): args is Args<CliCommandSetup, CliCommandSetupSubcommand>;
15
+ /**
16
+ * Type guard: args are for an extension command (driver or plugin).
17
+ *
18
+ * @param args - Parsed args before full subcommand-specific narrowing
19
+ */
20
+ export declare function isExtensionCommandArgs(args: AnyArgs): args is Args<CliExtensionCommand, CliExtensionSubcommand>;
21
+ /**
22
+ * Type guard: args are for a driver extension command.
23
+ *
24
+ * @param args - Parsed args before full subcommand-specific narrowing
25
+ */
26
+ export declare function isDriverCommandArgs(args: AnyArgs): args is Args<CliCommandDriver, CliExtensionSubcommand>;
27
+ /**
28
+ * Type guard: args are for a plugin extension command.
29
+ *
30
+ * @param args - Parsed args before full subcommand-specific narrowing
31
+ */
32
+ export declare function isPluginCommandArgs(args: AnyArgs): args is Args<CliCommandPlugin, CliExtensionSubcommand>;
33
+ export {};
34
+ //# sourceMappingURL=cli-args-guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-args-guards.d.ts","sourceRoot":"","sources":["../../../lib/schema/cli-args-guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAGtB,KAAK,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,sBAAsB,GAAG,yBAAyB,GAAG,IAAI,CAAC,CAAC;AAE3F;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAEvF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,IAAI,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAE1D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,IAAI,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,CAExD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,CAExD"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isServerCommandArgs = isServerCommandArgs;
4
+ exports.isSetupCommandArgs = isSetupCommandArgs;
5
+ exports.isExtensionCommandArgs = isExtensionCommandArgs;
6
+ exports.isDriverCommandArgs = isDriverCommandArgs;
7
+ exports.isPluginCommandArgs = isPluginCommandArgs;
8
+ const constants_1 = require("../constants");
9
+ /**
10
+ * Type guard: args are for the server command.
11
+ *
12
+ * @param args - Parsed args before full subcommand-specific narrowing
13
+ */
14
+ function isServerCommandArgs(args) {
15
+ return args.subcommand === constants_1.SERVER_SUBCOMMAND;
16
+ }
17
+ /**
18
+ * Type guard: args are for the setup command.
19
+ *
20
+ * @param args - Parsed args before full subcommand-specific narrowing
21
+ */
22
+ function isSetupCommandArgs(args) {
23
+ return args.subcommand === constants_1.SETUP_SUBCOMMAND;
24
+ }
25
+ /**
26
+ * Type guard: args are for an extension command (driver or plugin).
27
+ *
28
+ * @param args - Parsed args before full subcommand-specific narrowing
29
+ */
30
+ function isExtensionCommandArgs(args) {
31
+ return args.subcommand === constants_1.DRIVER_TYPE || args.subcommand === constants_1.PLUGIN_TYPE;
32
+ }
33
+ /**
34
+ * Type guard: args are for a driver extension command.
35
+ *
36
+ * @param args - Parsed args before full subcommand-specific narrowing
37
+ */
38
+ function isDriverCommandArgs(args) {
39
+ return args.subcommand === constants_1.DRIVER_TYPE;
40
+ }
41
+ /**
42
+ * Type guard: args are for a plugin extension command.
43
+ *
44
+ * @param args - Parsed args before full subcommand-specific narrowing
45
+ */
46
+ function isPluginCommandArgs(args) {
47
+ return args.subcommand === constants_1.PLUGIN_TYPE;
48
+ }
49
+ //# sourceMappingURL=cli-args-guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-args-guards.js","sourceRoot":"","sources":["../../../lib/schema/cli-args-guards.ts"],"names":[],"mappings":";;AAoBA,kDAEC;AAOD,gDAIC;AAOD,wDAIC;AAOD,kDAIC;AAOD,kDAIC;AAvDD,4CAA2F;AAI3F;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,IAAa;IAC/C,OAAO,IAAI,CAAC,UAAU,KAAK,6BAAiB,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAChC,IAAa;IAEb,OAAO,IAAI,CAAC,UAAU,KAAK,4BAAgB,CAAC;AAC9C,CAAC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CACpC,IAAa;IAEb,OAAO,IAAI,CAAC,UAAU,KAAK,uBAAW,IAAI,IAAI,CAAC,UAAU,KAAK,uBAAW,CAAC;AAC5E,CAAC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CACjC,IAAa;IAEb,OAAO,IAAI,CAAC,UAAU,KAAK,uBAAW,CAAC;AACzC,CAAC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CACjC,IAAa;IAEb,OAAO,IAAI,CAAC,UAAU,KAAK,uBAAW,CAAC;AACzC,CAAC"}
@@ -1,19 +1,7 @@
1
+ import type { ArgumentDefinitions } from '../cli/args';
1
2
  /**
2
3
  * Converts the finalized, flattened schema representation into
3
- * ArgumentDefinitions for handoff to `argparse`.
4
- *
5
- * @throws If schema has not been added to ajv (via `finalizeSchema()`)
6
- * @returns {import('../cli/args').ArgumentDefinitions} A map of arrays of
7
- * aliases to `argparse` arguments; empty if no schema found
4
+ * `ArgumentDefinitions` for handoff to `argparse`.
8
5
  */
9
- export function toParserArgs(): import("../cli/args").ArgumentDefinitions;
10
- /**
11
- * <T>
12
- */
13
- export type FormatValidator<T extends string | number> = import("ajv/dist/types").FormatValidator<T>;
14
- /**
15
- * A JSON 7 schema with our custom keywords.
16
- */
17
- export type AppiumJSONSchema = import("./keywords").AppiumJSONSchemaKeywords & import("json-schema").JSONSchema7;
18
- export type ArgSpec = import("./arg-spec").ArgSpec<any>;
6
+ export declare function toParserArgs(): ArgumentDefinitions;
19
7
  //# sourceMappingURL=cli-args.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../../../lib/schema/cli-args.js"],"names":[],"mappings":"AAoOA;;;;;;;GAOG;AACH,gCAHa,OAAO,aAAa,EAAE,mBAAmB,CAMrD;;;;4BAG4B,CAAC,SAAhB,MAAM,GAAC,MAAO,IACf,OAAO,gBAAgB,EAAE,eAAe,CAAC,CAAC,CAAC;;;;+BAK3C,OAAO,YAAY,EAAE,wBAAwB,GAAG,OAAO,aAAa,EAAE,WAAW"}
1
+ {"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../../../lib/schema/cli-args.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAiBrD;;;GAGG;AACH,wBAAgB,YAAY,IAAI,mBAAmB,CAKlD"}