appium 2.0.0-beta.46 → 2.0.0-beta.47

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 (138) 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.js +63 -88
  9. package/build/lib/cli/driver-command.js.map +1 -1
  10. package/build/lib/cli/extension-command.d.ts +32 -23
  11. package/build/lib/cli/extension-command.d.ts.map +1 -1
  12. package/build/lib/cli/extension-command.js +730 -512
  13. package/build/lib/cli/extension-command.js.map +1 -1
  14. package/build/lib/cli/extension.d.ts +7 -6
  15. package/build/lib/cli/extension.d.ts.map +1 -1
  16. package/build/lib/cli/extension.js +68 -65
  17. package/build/lib/cli/extension.js.map +1 -1
  18. package/build/lib/cli/parser.d.ts +3 -3
  19. package/build/lib/cli/parser.d.ts.map +1 -1
  20. package/build/lib/cli/parser.js +234 -192
  21. package/build/lib/cli/parser.js.map +1 -1
  22. package/build/lib/cli/plugin-command.js +58 -87
  23. package/build/lib/cli/plugin-command.js.map +1 -1
  24. package/build/lib/cli/utils.js +66 -69
  25. package/build/lib/cli/utils.js.map +1 -1
  26. package/build/lib/config-file.d.ts.map +1 -1
  27. package/build/lib/config-file.js +189 -120
  28. package/build/lib/config-file.js.map +1 -1
  29. package/build/lib/config.d.ts.map +1 -1
  30. package/build/lib/config.js +254 -213
  31. package/build/lib/config.js.map +1 -1
  32. package/build/lib/constants.d.ts +5 -5
  33. package/build/lib/constants.d.ts.map +1 -1
  34. package/build/lib/constants.js +64 -59
  35. package/build/lib/constants.js.map +1 -1
  36. package/build/lib/extension/driver-config.js +199 -164
  37. package/build/lib/extension/driver-config.js.map +1 -1
  38. package/build/lib/extension/extension-config.d.ts +18 -16
  39. package/build/lib/extension/extension-config.d.ts.map +1 -1
  40. package/build/lib/extension/extension-config.js +523 -396
  41. package/build/lib/extension/extension-config.js.map +1 -1
  42. package/build/lib/extension/index.js +98 -68
  43. package/build/lib/extension/index.js.map +1 -1
  44. package/build/lib/extension/manifest-migrations.d.ts +27 -0
  45. package/build/lib/extension/manifest-migrations.d.ts.map +1 -0
  46. package/build/lib/extension/manifest-migrations.js +99 -0
  47. package/build/lib/extension/manifest-migrations.js.map +1 -0
  48. package/build/lib/extension/manifest.d.ts +7 -56
  49. package/build/lib/extension/manifest.d.ts.map +1 -1
  50. package/build/lib/extension/manifest.js +432 -240
  51. package/build/lib/extension/manifest.js.map +1 -1
  52. package/build/lib/extension/package-changed.js +57 -61
  53. package/build/lib/extension/package-changed.js.map +1 -1
  54. package/build/lib/extension/plugin-config.d.ts +2 -3
  55. package/build/lib/extension/plugin-config.d.ts.map +1 -1
  56. package/build/lib/extension/plugin-config.js +94 -70
  57. package/build/lib/extension/plugin-config.js.map +1 -1
  58. package/build/lib/grid-register.js +119 -137
  59. package/build/lib/grid-register.js.map +1 -1
  60. package/build/lib/logger.d.ts +1 -1
  61. package/build/lib/logger.d.ts.map +1 -1
  62. package/build/lib/logger.js +5 -15
  63. package/build/lib/logger.js.map +1 -1
  64. package/build/lib/logsink.d.ts.map +1 -1
  65. package/build/lib/logsink.js +189 -183
  66. package/build/lib/logsink.js.map +1 -1
  67. package/build/lib/main.d.ts +19 -12
  68. package/build/lib/main.d.ts.map +1 -1
  69. package/build/lib/main.js +330 -304
  70. package/build/lib/main.js.map +1 -1
  71. package/build/lib/schema/arg-spec.js +153 -108
  72. package/build/lib/schema/arg-spec.js.map +1 -1
  73. package/build/lib/schema/cli-args.js +203 -164
  74. package/build/lib/schema/cli-args.js.map +1 -1
  75. package/build/lib/schema/cli-transformers.js +117 -72
  76. package/build/lib/schema/cli-transformers.js.map +1 -1
  77. package/build/lib/schema/index.js +17 -32
  78. package/build/lib/schema/index.js.map +1 -1
  79. package/build/lib/schema/keywords.js +125 -67
  80. package/build/lib/schema/keywords.js.map +1 -1
  81. package/build/lib/schema/schema.d.ts.map +1 -1
  82. package/build/lib/schema/schema.js +582 -417
  83. package/build/lib/schema/schema.js.map +1 -1
  84. package/build/lib/utils.d.ts +41 -255
  85. package/build/lib/utils.d.ts.map +1 -1
  86. package/build/lib/utils.js +342 -193
  87. package/build/lib/utils.js.map +1 -1
  88. package/build/tsconfig.tsbuildinfo +1 -1
  89. package/build/types/cli.d.ts +45 -34
  90. package/build/types/cli.d.ts.map +1 -1
  91. package/build/types/cli.js +3 -0
  92. package/build/types/cli.js.map +1 -0
  93. package/build/types/index.d.ts +1 -2
  94. package/build/types/index.d.ts.map +1 -1
  95. package/build/types/index.js +19 -0
  96. package/build/types/index.js.map +1 -0
  97. package/build/types/manifest/base.d.ts +135 -0
  98. package/build/types/manifest/base.d.ts.map +1 -0
  99. package/build/types/manifest/base.js +3 -0
  100. package/build/types/manifest/base.js.map +1 -0
  101. package/build/types/manifest/index.d.ts +19 -0
  102. package/build/types/manifest/index.d.ts.map +1 -0
  103. package/build/types/manifest/index.js +40 -0
  104. package/build/types/manifest/index.js.map +1 -0
  105. package/build/types/manifest/v3.d.ts +139 -0
  106. package/build/types/manifest/v3.d.ts.map +1 -0
  107. package/build/types/manifest/v3.js +3 -0
  108. package/build/types/manifest/v3.js.map +1 -0
  109. package/lib/appium.js +1 -1
  110. package/lib/cli/args.js +1 -1
  111. package/lib/cli/extension-command.js +116 -61
  112. package/lib/cli/extension.js +9 -8
  113. package/lib/cli/parser.js +2 -2
  114. package/lib/config-file.js +2 -3
  115. package/lib/config.js +3 -2
  116. package/lib/constants.js +6 -5
  117. package/lib/extension/extension-config.js +24 -25
  118. package/lib/extension/manifest-migrations.js +99 -0
  119. package/lib/extension/manifest.js +79 -72
  120. package/lib/extension/plugin-config.js +1 -2
  121. package/lib/logsink.js +26 -5
  122. package/lib/main.js +58 -50
  123. package/lib/schema/schema.js +6 -1
  124. package/lib/utils.js +62 -0
  125. package/package.json +23 -24
  126. package/scripts/autoinstall-extensions.js +78 -26
  127. package/types/cli.ts +81 -42
  128. package/types/index.ts +1 -2
  129. package/types/manifest/README.md +30 -0
  130. package/types/manifest/base.ts +158 -0
  131. package/types/manifest/index.ts +27 -0
  132. package/types/manifest/v3.ts +161 -0
  133. package/build/types/appium-manifest.d.ts +0 -59
  134. package/build/types/appium-manifest.d.ts.map +0 -1
  135. package/build/types/extension-manifest.d.ts +0 -55
  136. package/build/types/extension-manifest.d.ts.map +0 -1
  137. package/types/appium-manifest.ts +0 -73
  138. package/types/extension-manifest.ts +0 -64
@@ -0,0 +1,27 @@
1
+ /**
2
+ * See `README.md` for information on how to add a new version of the schema.
3
+ * @module
4
+ */
5
+
6
+ import * as ManifestV2 from './base';
7
+ import * as ManifestV3 from './v3';
8
+
9
+ // add `import * as ManifestV<new-version> from './v<new-version>';` above
10
+
11
+ export * from './v3';
12
+ // replace above line with `export * from './v<new-version>';`
13
+
14
+ export {ManifestV2, ManifestV3};
15
+
16
+ export interface ManifestDataVersions {
17
+ 2: ManifestV2.ManifestData;
18
+ 3: ManifestV3.ManifestData;
19
+ }
20
+ // append to this interface your new version of `ManifestData`
21
+
22
+ /**
23
+ * One of the known versions of the `extensions.yaml` schema.
24
+ *
25
+ * @privateRemarks You probably don't need to edit this.
26
+ */
27
+ export type AnyManifestDataVersion = ManifestDataVersions[keyof ManifestDataVersions];
@@ -0,0 +1,161 @@
1
+ import {DriverType, ExtensionType, PluginType} from '@appium/types';
2
+ import {SchemaObject} from 'ajv';
3
+ import {PackageJson, SetRequired} from 'type-fest';
4
+
5
+ /**
6
+ * One of the possible extension installation stratgies
7
+ */
8
+ export type InstallType = 'npm' | 'git' | 'local' | 'github';
9
+
10
+ export interface InternalMetadata {
11
+ /**
12
+ * Package name of extension
13
+ *
14
+ * `name` from its `package.json`
15
+ */
16
+ pkgName: string;
17
+ /**
18
+ * Version of extension
19
+ *
20
+ * `version` from its `package.json`
21
+ */
22
+ version: string;
23
+ /**
24
+ * The method in which the user installed the extension (the `source` CLI arg)
25
+ */
26
+ installType: InstallType;
27
+ /**
28
+ * Whatever the user typed as the extension to install. May be derived from `package.json`
29
+ */
30
+ installSpec: string;
31
+ /**
32
+ * Maximum version of Appium that this extension is compatible with.
33
+ *
34
+ * If `undefined`, we'll try anyway.
35
+ */
36
+ appiumVersion?: string;
37
+ /**
38
+ * Path to the extension's root directory
39
+ */
40
+ installPath: string;
41
+ }
42
+
43
+ /**
44
+ * Shape of the `appium.schema` property in an extension's `package.json` (if it exists)
45
+ */
46
+ export type ExtSchemaMetadata = string | (SchemaObject & {[key: number]: never});
47
+
48
+ /**
49
+ * Manifest data shared by all extensions, as contained in `package.json`
50
+ */
51
+ export interface CommonExtMetadata {
52
+ /**
53
+ * The main class of the extension.
54
+ *
55
+ * The extension must export this class by name.
56
+ */
57
+ mainClass: string;
58
+
59
+ /**
60
+ * Lookup table of scripts to run via `appium <driver|plugin> run <script>` keyed by name.
61
+ */
62
+ scripts?: Record<string, string>;
63
+
64
+ /**
65
+ * Schema describing configuration options (and CLI args) for the extension.
66
+ *
67
+ * Can also just be a path (relative to the extension root) to an external JSON schema file.
68
+ */
69
+ schema?: ExtSchemaMetadata;
70
+ }
71
+
72
+ /**
73
+ * Driver-specific manifest data as stored in a driver's `package.json`
74
+ */
75
+ export interface DriverMetadata {
76
+ /**
77
+ * Automation name of the driver
78
+ */
79
+ automationName: string;
80
+ /**
81
+ * Platforms the driver supports
82
+ */
83
+ platformNames: string[];
84
+ /**
85
+ * Short name of the driver (displayed in `appium list`, etc.)
86
+ */
87
+ driverName: string;
88
+ }
89
+
90
+ /**
91
+ * Plugin-specific manifest data as stored in a plugin's `package.json`
92
+ */
93
+ export interface PluginMetadata {
94
+ /**
95
+ * Short name of the plugin (displayed in `appium list`, etc.)
96
+ */
97
+ pluginName: string;
98
+ }
99
+
100
+ /**
101
+ * Generic extension metadata as stored in the `appium` prop of an extension's `package.json`.
102
+ */
103
+ export type ExtMetadata<ExtType extends ExtensionType> = (ExtType extends DriverType
104
+ ? DriverMetadata
105
+ : ExtType extends PluginType
106
+ ? PluginMetadata
107
+ : never) &
108
+ CommonExtMetadata;
109
+
110
+ /**
111
+ * Combination of external + internal extension data with `driverName`/`pluginName` removed (it becomes a key in an {@linkcode ExtRecord} object).
112
+ * Part of `extensions.yaml`.
113
+ */
114
+ export type ExtManifest<ExtType extends ExtensionType> = Omit<
115
+ ExtMetadata<ExtType>,
116
+ 'driverName' | 'pluginName'
117
+ > &
118
+ InternalMetadata;
119
+
120
+ /**
121
+ * Lookup of extension name to {@linkcode ExtManifest}.
122
+ * @see {ManifestData}
123
+ */
124
+ export type ExtRecord<ExtType extends ExtensionType> = Record<string, ExtManifest<ExtType>>;
125
+
126
+ /**
127
+ * The shape of the `extensions.yaml` file
128
+ */
129
+ export interface ManifestData {
130
+ drivers: ExtRecord<DriverType>;
131
+ plugins: ExtRecord<PluginType>;
132
+ schemaRev: number;
133
+ }
134
+
135
+ /**
136
+ * The name of an installed extension, as it appears in `extensions.yaml`
137
+ * (as a property name under `drivers` or `plugins`)
138
+ */
139
+ export type ExtName<ExtType extends ExtensionType> = keyof ExtRecord<ExtType>;
140
+
141
+ /**
142
+ * A `package.json` containing extension metadata.
143
+ * Must have the following properties:
144
+ * - `name`: the name of the extension
145
+ * - `version`: the version of the extension
146
+ * - `appium`: the metadata for the extension
147
+ * - `peerDependencies.appium`: the maximum compatible version of Appium
148
+ */
149
+ export type ExtPackageJson<ExtType extends ExtensionType> = SetRequired<
150
+ PackageJson,
151
+ 'name' | 'version'
152
+ > & {
153
+ appium: ExtMetadata<ExtType>;
154
+ peerDependencies: {appium: string; [key: string]: string};
155
+ };
156
+
157
+ /**
158
+ * A transient format between installation and insertion of extension metadata into the manifest.
159
+ */
160
+ export type ExtInstallReceipt<ExtType extends ExtensionType> = ExtMetadata<ExtType> &
161
+ InternalMetadata;
@@ -1,59 +0,0 @@
1
- import { CommonExtMetadata, ExtMetadata, ExtSchemaMetadata } from './extension-manifest';
2
- import { ExtensionType, DriverType, PluginType } from '@appium/types';
3
- export declare type InstallType = 'npm' | 'git' | 'local' | 'github';
4
- export interface InternalMetadata {
5
- /**
6
- * Package name of extension
7
- *
8
- * `name` from its `package.json`
9
- */
10
- pkgName: string;
11
- /**
12
- * Version of extension
13
- *
14
- * `version` from its `package.json`
15
- */
16
- version: string;
17
- /**
18
- * The method in which the user installed the extension (the `source` CLI arg)
19
- */
20
- installType: InstallType;
21
- /**
22
- * Whatever the user typed as the extension to install. May be derived from `package.json`
23
- */
24
- installSpec: string;
25
- /**
26
- * Maximum version of Appium that this extension is compatible with.
27
- *
28
- * If `undefined`, we'll try anyway.
29
- */
30
- appiumVersion?: string;
31
- }
32
- /**
33
- * Combination of external + internal extension data with `driverName`/`pluginName` removed (it becomes a key in an {@linkcode ExtRecord} object).
34
- * Part of `extensions.yaml`.
35
- */
36
- export declare type ExtManifest<ExtType extends ExtensionType> = Omit<ExtMetadata<ExtType>, ExtType extends DriverType ? 'driverName' : ExtType extends PluginType ? 'pluginName' : never> & InternalMetadata & CommonExtMetadata;
37
- export declare type WithSchemaManifest = {
38
- schema: ExtSchemaMetadata;
39
- };
40
- /**
41
- * This is just a {@linkcode ExtManifest} except it _for sure_ has a `schema` prop.
42
- */
43
- export declare type ExtManifestWithSchema<ExtType extends ExtensionType> = ExtManifest<ExtType> & WithSchemaManifest;
44
- /**
45
- * Generic type for an object keyed by extension name, with values of type {@linkcode ExtData}
46
- */
47
- export declare type ExtRecord<ExtType extends ExtensionType> = Record<string, ExtManifest<ExtType>>;
48
- export declare type DriverRecord = ExtRecord<DriverType>;
49
- export declare type PluginRecord = ExtRecord<PluginType>;
50
- export declare type ExtName<ExtType extends ExtensionType> = keyof ExtRecord<ExtType>;
51
- /**
52
- * Represents an entire YAML manifest (`extensions.yaml`)
53
- */
54
- export interface ManifestData {
55
- drivers: DriverRecord;
56
- plugins: PluginRecord;
57
- schemaRev?: number;
58
- }
59
- //# sourceMappingURL=appium-manifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"appium-manifest.d.ts","sourceRoot":"","sources":["../../types/appium-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAC,aAAa,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAEpE,oBAAY,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,oBAAY,WAAW,CAAC,OAAO,SAAS,aAAa,IAAI,IAAI,CAC3D,WAAW,CAAC,OAAO,CAAC,EACpB,OAAO,SAAS,UAAU,GAAG,YAAY,GAAG,OAAO,SAAS,UAAU,GAAG,YAAY,GAAG,KAAK,CAC9F,GACC,gBAAgB,GAChB,iBAAiB,CAAC;AAEpB,oBAAY,kBAAkB,GAAG;IAC/B,MAAM,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,oBAAY,qBAAqB,CAAC,OAAO,SAAS,aAAa,IAAI,WAAW,CAAC,OAAO,CAAC,GACrF,kBAAkB,CAAC;AAErB;;GAEG;AACH,oBAAY,SAAS,CAAC,OAAO,SAAS,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;AAE5F,oBAAY,YAAY,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;AACjD,oBAAY,YAAY,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;AAEjD,oBAAY,OAAO,CAAC,OAAO,SAAS,aAAa,IAAI,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1,55 +0,0 @@
1
- /**
2
- * These types describe information about external extensions and the contents of their `package.json` files
3
- */
4
- import type { SchemaObject } from 'ajv';
5
- import type { PackageJson, SetRequired } from 'type-fest';
6
- import { DriverType, ExtensionType, PluginType } from '@appium/types';
7
- /**
8
- * This is what is allowed in the `appium.schema` prop of an extension's `package.json`.
9
- */
10
- export declare type ExtSchemaMetadata = string | (SchemaObject & {
11
- [key: number]: never;
12
- });
13
- /**
14
- * Manifest data shared by all extensions, as contained in `package.json`
15
- */
16
- export interface CommonExtMetadata {
17
- mainClass: string;
18
- scripts?: Record<string, string>;
19
- schema?: ExtSchemaMetadata;
20
- }
21
- /**
22
- * Driver-specific manifest data as contained in `package.json`
23
- */
24
- export interface DriverMetadata {
25
- automationName: string;
26
- platformNames: string[];
27
- driverName: string;
28
- }
29
- /**
30
- * Plugin-specific manifest data as stored in `package.json`
31
- */
32
- export interface PluginMetadata {
33
- pluginName: string;
34
- }
35
- /**
36
- * Generic type to refer to either {@linkcode DriverMetadata} or {@linkcode PluginMetadata}
37
- * Corresponds to the `appium` prop in an extension's `package.json`.
38
- */
39
- export declare type ExtMetadata<ExtType extends ExtensionType> = (ExtType extends DriverType ? DriverMetadata : ExtType extends PluginType ? PluginMetadata : never) & CommonExtMetadata;
40
- /**
41
- * A `package.json` containing extension metadata.
42
- * Must have the following properties:
43
- * - `name`: the name of the extension
44
- * - `version`: the version of the extension
45
- * - `appium`: the metadata for the extension
46
- * - `peerDependencies.appium`: the maximum compatible version of Appium
47
- */
48
- export declare type ExtPackageJson<ExtType extends ExtensionType> = SetRequired<PackageJson, 'name' | 'version'> & {
49
- appium: ExtMetadata<ExtType>;
50
- peerDependencies: {
51
- appium: string;
52
- [key: string]: string;
53
- };
54
- };
55
- //# sourceMappingURL=extension-manifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension-manifest.d.ts","sourceRoot":"","sources":["../../types/extension-manifest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAC,WAAW,EAAE,WAAW,EAAC,MAAM,WAAW,CAAC;AACxD,OAAO,EAAC,UAAU,EAAE,aAAa,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAEpE;;GAEG;AACH,oBAAY,iBAAiB,GAAG,MAAM,GAAG,CAAC,YAAY,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;CAAC,CAAC,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,oBAAY,WAAW,CAAC,OAAO,SAAS,aAAa,IAAI,CAAC,OAAO,SAAS,UAAU,GAChF,cAAc,GACd,OAAO,SAAS,UAAU,GAC1B,cAAc,GACd,KAAK,CAAC,GACR,iBAAiB,CAAC;AAEpB;;;;;;;GAOG;AACH,oBAAY,cAAc,CAAC,OAAO,SAAS,aAAa,IAAI,WAAW,CACrE,WAAW,EACX,MAAM,GAAG,SAAS,CACnB,GAAG;IACF,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,gBAAgB,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAC;CAC3D,CAAC"}
@@ -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
- };