appium 2.0.0-beta.46 → 2.0.0-beta.48

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 (141) hide show
  1. package/README.md +145 -44
  2. package/build/lib/appium.d.ts +3 -103
  3. package/build/lib/appium.d.ts.map +1 -1
  4. package/build/lib/appium.js +679 -549
  5. package/build/lib/appium.js.map +1 -1
  6. package/build/lib/cli/args.js +247 -127
  7. package/build/lib/cli/args.js.map +1 -1
  8. package/build/lib/cli/driver-command.d.ts +24 -5
  9. package/build/lib/cli/driver-command.d.ts.map +1 -1
  10. package/build/lib/cli/driver-command.js +78 -88
  11. package/build/lib/cli/driver-command.js.map +1 -1
  12. package/build/lib/cli/extension-command.d.ts +33 -24
  13. package/build/lib/cli/extension-command.d.ts.map +1 -1
  14. package/build/lib/cli/extension-command.js +729 -512
  15. package/build/lib/cli/extension-command.js.map +1 -1
  16. package/build/lib/cli/extension.d.ts +7 -6
  17. package/build/lib/cli/extension.d.ts.map +1 -1
  18. package/build/lib/cli/extension.js +68 -65
  19. package/build/lib/cli/extension.js.map +1 -1
  20. package/build/lib/cli/parser.d.ts +3 -3
  21. package/build/lib/cli/parser.d.ts.map +1 -1
  22. package/build/lib/cli/parser.js +234 -192
  23. package/build/lib/cli/parser.js.map +1 -1
  24. package/build/lib/cli/plugin-command.js +58 -87
  25. package/build/lib/cli/plugin-command.js.map +1 -1
  26. package/build/lib/cli/utils.js +66 -69
  27. package/build/lib/cli/utils.js.map +1 -1
  28. package/build/lib/config-file.d.ts.map +1 -1
  29. package/build/lib/config-file.js +189 -120
  30. package/build/lib/config-file.js.map +1 -1
  31. package/build/lib/config.d.ts.map +1 -1
  32. package/build/lib/config.js +254 -213
  33. package/build/lib/config.js.map +1 -1
  34. package/build/lib/constants.d.ts +6 -5
  35. package/build/lib/constants.d.ts.map +1 -1
  36. package/build/lib/constants.js +65 -59
  37. package/build/lib/constants.js.map +1 -1
  38. package/build/lib/extension/driver-config.js +199 -164
  39. package/build/lib/extension/driver-config.js.map +1 -1
  40. package/build/lib/extension/extension-config.d.ts +33 -26
  41. package/build/lib/extension/extension-config.d.ts.map +1 -1
  42. package/build/lib/extension/extension-config.js +541 -396
  43. package/build/lib/extension/extension-config.js.map +1 -1
  44. package/build/lib/extension/index.js +98 -68
  45. package/build/lib/extension/index.js.map +1 -1
  46. package/build/lib/extension/manifest-migrations.d.ts +27 -0
  47. package/build/lib/extension/manifest-migrations.d.ts.map +1 -0
  48. package/build/lib/extension/manifest-migrations.js +118 -0
  49. package/build/lib/extension/manifest-migrations.js.map +1 -0
  50. package/build/lib/extension/manifest.d.ts +35 -63
  51. package/build/lib/extension/manifest.d.ts.map +1 -1
  52. package/build/lib/extension/manifest.js +500 -240
  53. package/build/lib/extension/manifest.js.map +1 -1
  54. package/build/lib/extension/package-changed.js +57 -61
  55. package/build/lib/extension/package-changed.js.map +1 -1
  56. package/build/lib/extension/plugin-config.d.ts +2 -3
  57. package/build/lib/extension/plugin-config.d.ts.map +1 -1
  58. package/build/lib/extension/plugin-config.js +94 -70
  59. package/build/lib/extension/plugin-config.js.map +1 -1
  60. package/build/lib/grid-register.js +119 -137
  61. package/build/lib/grid-register.js.map +1 -1
  62. package/build/lib/logger.d.ts +1 -1
  63. package/build/lib/logger.d.ts.map +1 -1
  64. package/build/lib/logger.js +5 -15
  65. package/build/lib/logger.js.map +1 -1
  66. package/build/lib/logsink.d.ts.map +1 -1
  67. package/build/lib/logsink.js +189 -183
  68. package/build/lib/logsink.js.map +1 -1
  69. package/build/lib/main.d.ts +19 -12
  70. package/build/lib/main.d.ts.map +1 -1
  71. package/build/lib/main.js +330 -304
  72. package/build/lib/main.js.map +1 -1
  73. package/build/lib/schema/arg-spec.js +153 -108
  74. package/build/lib/schema/arg-spec.js.map +1 -1
  75. package/build/lib/schema/cli-args.js +203 -164
  76. package/build/lib/schema/cli-args.js.map +1 -1
  77. package/build/lib/schema/cli-transformers.js +117 -72
  78. package/build/lib/schema/cli-transformers.js.map +1 -1
  79. package/build/lib/schema/index.js +17 -32
  80. package/build/lib/schema/index.js.map +1 -1
  81. package/build/lib/schema/keywords.js +125 -67
  82. package/build/lib/schema/keywords.js.map +1 -1
  83. package/build/lib/schema/schema.d.ts.map +1 -1
  84. package/build/lib/schema/schema.js +582 -417
  85. package/build/lib/schema/schema.js.map +1 -1
  86. package/build/lib/utils.d.ts +41 -255
  87. package/build/lib/utils.d.ts.map +1 -1
  88. package/build/lib/utils.js +342 -193
  89. package/build/lib/utils.js.map +1 -1
  90. package/build/tsconfig.tsbuildinfo +1 -1
  91. package/build/types/cli.d.ts +45 -34
  92. package/build/types/cli.d.ts.map +1 -1
  93. package/build/types/cli.js +3 -0
  94. package/build/types/cli.js.map +1 -0
  95. package/build/types/index.d.ts +1 -2
  96. package/build/types/index.d.ts.map +1 -1
  97. package/build/types/index.js +19 -0
  98. package/build/types/index.js.map +1 -0
  99. package/build/types/manifest/base.d.ts +135 -0
  100. package/build/types/manifest/base.d.ts.map +1 -0
  101. package/build/types/manifest/base.js +3 -0
  102. package/build/types/manifest/base.js.map +1 -0
  103. package/build/types/manifest/index.d.ts +19 -0
  104. package/build/types/manifest/index.d.ts.map +1 -0
  105. package/build/types/manifest/index.js +40 -0
  106. package/build/types/manifest/index.js.map +1 -0
  107. package/build/types/manifest/v3.d.ts +139 -0
  108. package/build/types/manifest/v3.d.ts.map +1 -0
  109. package/build/types/manifest/v3.js +3 -0
  110. package/build/types/manifest/v3.js.map +1 -0
  111. package/lib/appium.js +1 -1
  112. package/lib/cli/args.js +1 -1
  113. package/lib/cli/driver-command.js +17 -0
  114. package/lib/cli/extension-command.js +119 -65
  115. package/lib/cli/extension.js +9 -8
  116. package/lib/cli/parser.js +2 -2
  117. package/lib/config-file.js +2 -3
  118. package/lib/config.js +3 -2
  119. package/lib/constants.js +7 -5
  120. package/lib/extension/extension-config.js +52 -47
  121. package/lib/extension/manifest-migrations.js +120 -0
  122. package/lib/extension/manifest.js +184 -103
  123. package/lib/extension/plugin-config.js +1 -2
  124. package/lib/logsink.js +26 -5
  125. package/lib/main.js +58 -50
  126. package/lib/schema/schema.js +6 -1
  127. package/lib/utils.js +62 -0
  128. package/package.json +24 -25
  129. package/scripts/autoinstall-extensions.js +78 -26
  130. package/types/cli.ts +81 -42
  131. package/types/index.ts +1 -2
  132. package/types/manifest/README.md +30 -0
  133. package/types/manifest/base.ts +158 -0
  134. package/types/manifest/index.ts +27 -0
  135. package/types/manifest/v3.ts +161 -0
  136. package/build/types/appium-manifest.d.ts +0 -59
  137. package/build/types/appium-manifest.d.ts.map +0 -1
  138. package/build/types/extension-manifest.d.ts +0 -55
  139. package/build/types/extension-manifest.d.ts.map +0 -1
  140. package/types/appium-manifest.ts +0 -73
  141. package/types/extension-manifest.ts +0 -64
@@ -1,73 +0,0 @@
1
- import {CommonExtMetadata, ExtMetadata, ExtSchemaMetadata} from './extension-manifest';
2
- import {ExtensionType, DriverType, PluginType} from '@appium/types';
3
-
4
- export type InstallType = 'npm' | 'git' | 'local' | 'github';
5
-
6
- export interface InternalMetadata {
7
- /**
8
- * Package name of extension
9
- *
10
- * `name` from its `package.json`
11
- */
12
- pkgName: string;
13
- /**
14
- * Version of extension
15
- *
16
- * `version` from its `package.json`
17
- */
18
- version: string;
19
- /**
20
- * The method in which the user installed the extension (the `source` CLI arg)
21
- */
22
- installType: InstallType;
23
- /**
24
- * Whatever the user typed as the extension to install. May be derived from `package.json`
25
- */
26
- installSpec: string;
27
- /**
28
- * Maximum version of Appium that this extension is compatible with.
29
- *
30
- * If `undefined`, we'll try anyway.
31
- */
32
- appiumVersion?: string;
33
- }
34
-
35
- /**
36
- * Combination of external + internal extension data with `driverName`/`pluginName` removed (it becomes a key in an {@linkcode ExtRecord} object).
37
- * Part of `extensions.yaml`.
38
- */
39
- export type ExtManifest<ExtType extends ExtensionType> = Omit<
40
- ExtMetadata<ExtType>,
41
- ExtType extends DriverType ? 'driverName' : ExtType extends PluginType ? 'pluginName' : never
42
- > &
43
- InternalMetadata &
44
- CommonExtMetadata; // XXX: ExtMetadata should be a union with CommonMetadata. why is this needed?
45
-
46
- export type WithSchemaManifest = {
47
- schema: ExtSchemaMetadata;
48
- };
49
-
50
- /**
51
- * This is just a {@linkcode ExtManifest} except it _for sure_ has a `schema` prop.
52
- */
53
- export type ExtManifestWithSchema<ExtType extends ExtensionType> = ExtManifest<ExtType> &
54
- WithSchemaManifest;
55
-
56
- /**
57
- * Generic type for an object keyed by extension name, with values of type {@linkcode ExtData}
58
- */
59
- export type ExtRecord<ExtType extends ExtensionType> = Record<string, ExtManifest<ExtType>>;
60
-
61
- export type DriverRecord = ExtRecord<DriverType>;
62
- export type PluginRecord = ExtRecord<PluginType>;
63
-
64
- export type ExtName<ExtType extends ExtensionType> = keyof ExtRecord<ExtType>;
65
-
66
- /**
67
- * Represents an entire YAML manifest (`extensions.yaml`)
68
- */
69
- export interface ManifestData {
70
- drivers: DriverRecord;
71
- plugins: PluginRecord;
72
- schemaRev?: number;
73
- }
@@ -1,64 +0,0 @@
1
- /**
2
- * These types describe information about external extensions and the contents of their `package.json` files
3
- */
4
-
5
- import type {SchemaObject} from 'ajv';
6
- import type {PackageJson, SetRequired} from 'type-fest';
7
- import {DriverType, ExtensionType, PluginType} from '@appium/types';
8
-
9
- /**
10
- * This is what is allowed in the `appium.schema` prop of an extension's `package.json`.
11
- */
12
- export type ExtSchemaMetadata = string | (SchemaObject & {[key: number]: never});
13
-
14
- /**
15
- * Manifest data shared by all extensions, as contained in `package.json`
16
- */
17
- export interface CommonExtMetadata {
18
- mainClass: string;
19
- scripts?: Record<string, string>;
20
- schema?: ExtSchemaMetadata;
21
- }
22
-
23
- /**
24
- * Driver-specific manifest data as contained in `package.json`
25
- */
26
- export interface DriverMetadata {
27
- automationName: string;
28
- platformNames: string[];
29
- driverName: string;
30
- }
31
-
32
- /**
33
- * Plugin-specific manifest data as stored in `package.json`
34
- */
35
- export interface PluginMetadata {
36
- pluginName: string;
37
- }
38
-
39
- /**
40
- * Generic type to refer to either {@linkcode DriverMetadata} or {@linkcode PluginMetadata}
41
- * Corresponds to the `appium` prop in an extension's `package.json`.
42
- */
43
- export type ExtMetadata<ExtType extends ExtensionType> = (ExtType extends DriverType
44
- ? DriverMetadata
45
- : ExtType extends PluginType
46
- ? PluginMetadata
47
- : never) &
48
- CommonExtMetadata;
49
-
50
- /**
51
- * A `package.json` containing extension metadata.
52
- * Must have the following properties:
53
- * - `name`: the name of the extension
54
- * - `version`: the version of the extension
55
- * - `appium`: the metadata for the extension
56
- * - `peerDependencies.appium`: the maximum compatible version of Appium
57
- */
58
- export type ExtPackageJson<ExtType extends ExtensionType> = SetRequired<
59
- PackageJson,
60
- 'name' | 'version'
61
- > & {
62
- appium: ExtMetadata<ExtType>;
63
- peerDependencies: {appium: string; [key: string]: string};
64
- };