@ohos-ports/webdriver-manager 0.0.0-stage → 12.1.9-beta.0

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 (123) hide show
  1. package/.circleci/config.yml +24 -0
  2. package/CHANGELOG.md +670 -0
  3. package/CONTRIBUTING.md +61 -0
  4. package/LICENSE +21 -0
  5. package/README.md +75 -2
  6. package/bin/webdriver-manager +56 -0
  7. package/built/config.json +18 -0
  8. package/built/lib/binaries/android_sdk.d.ts +26 -0
  9. package/built/lib/binaries/android_sdk.js +103 -0
  10. package/built/lib/binaries/android_sdk.js.map +1 -0
  11. package/built/lib/binaries/appium.d.ts +18 -0
  12. package/built/lib/binaries/appium.js +42 -0
  13. package/built/lib/binaries/appium.js.map +1 -0
  14. package/built/lib/binaries/binary.d.ts +66 -0
  15. package/built/lib/binaries/binary.js +76 -0
  16. package/built/lib/binaries/binary.js.map +1 -0
  17. package/built/lib/binaries/chrome_driver.d.ts +12 -0
  18. package/built/lib/binaries/chrome_driver.js +38 -0
  19. package/built/lib/binaries/chrome_driver.js.map +1 -0
  20. package/built/lib/binaries/chrome_xml.d.ts +36 -0
  21. package/built/lib/binaries/chrome_xml.js +156 -0
  22. package/built/lib/binaries/chrome_xml.js.map +1 -0
  23. package/built/lib/binaries/config_source.d.ts +38 -0
  24. package/built/lib/binaries/config_source.js +209 -0
  25. package/built/lib/binaries/config_source.js.map +1 -0
  26. package/built/lib/binaries/gecko_driver.d.ts +13 -0
  27. package/built/lib/binaries/gecko_driver.js +50 -0
  28. package/built/lib/binaries/gecko_driver.js.map +1 -0
  29. package/built/lib/binaries/gecko_driver_github.d.ts +14 -0
  30. package/built/lib/binaries/gecko_driver_github.js +93 -0
  31. package/built/lib/binaries/gecko_driver_github.js.map +1 -0
  32. package/built/lib/binaries/iedriver.d.ts +13 -0
  33. package/built/lib/binaries/iedriver.js +38 -0
  34. package/built/lib/binaries/iedriver.js.map +1 -0
  35. package/built/lib/binaries/iedriver_xml.d.ts +9 -0
  36. package/built/lib/binaries/iedriver_xml.js +69 -0
  37. package/built/lib/binaries/iedriver_xml.js.map +1 -0
  38. package/built/lib/binaries/index.d.ts +7 -0
  39. package/built/lib/binaries/index.js +13 -0
  40. package/built/lib/binaries/index.js.map +1 -0
  41. package/built/lib/binaries/standalone.d.ts +13 -0
  42. package/built/lib/binaries/standalone.js +41 -0
  43. package/built/lib/binaries/standalone.js.map +1 -0
  44. package/built/lib/binaries/standalone_xml.d.ts +9 -0
  45. package/built/lib/binaries/standalone_xml.js +89 -0
  46. package/built/lib/binaries/standalone_xml.js.map +1 -0
  47. package/built/lib/cli/cli.d.ts +57 -0
  48. package/built/lib/cli/cli.js +136 -0
  49. package/built/lib/cli/cli.js.map +1 -0
  50. package/built/lib/cli/index.d.ts +4 -0
  51. package/built/lib/cli/index.js +10 -0
  52. package/built/lib/cli/index.js.map +1 -0
  53. package/built/lib/cli/logger.d.ts +95 -0
  54. package/built/lib/cli/logger.js +264 -0
  55. package/built/lib/cli/logger.js.map +1 -0
  56. package/built/lib/cli/options.d.ts +22 -0
  57. package/built/lib/cli/options.js +67 -0
  58. package/built/lib/cli/options.js.map +1 -0
  59. package/built/lib/cli/programs.d.ts +93 -0
  60. package/built/lib/cli/programs.js +226 -0
  61. package/built/lib/cli/programs.js.map +1 -0
  62. package/built/lib/cli_instance.d.ts +2 -0
  63. package/built/lib/cli_instance.js +18 -0
  64. package/built/lib/cli_instance.js.map +1 -0
  65. package/built/lib/cmds/clean.d.ts +2 -0
  66. package/built/lib/cmds/clean.js +39 -0
  67. package/built/lib/cmds/clean.js.map +1 -0
  68. package/built/lib/cmds/index.d.ts +1 -0
  69. package/built/lib/cmds/index.js +7 -0
  70. package/built/lib/cmds/index.js.map +1 -0
  71. package/built/lib/cmds/initialize.d.ts +3 -0
  72. package/built/lib/cmds/initialize.js +244 -0
  73. package/built/lib/cmds/initialize.js.map +1 -0
  74. package/built/lib/cmds/opts.d.ts +38 -0
  75. package/built/lib/cmds/opts.js +91 -0
  76. package/built/lib/cmds/opts.js.map +1 -0
  77. package/built/lib/cmds/shutdown.d.ts +2 -0
  78. package/built/lib/cmds/shutdown.js +46 -0
  79. package/built/lib/cmds/shutdown.js.map +1 -0
  80. package/built/lib/cmds/start.d.ts +2 -0
  81. package/built/lib/cmds/start.js +458 -0
  82. package/built/lib/cmds/start.js.map +1 -0
  83. package/built/lib/cmds/status.d.ts +2 -0
  84. package/built/lib/cmds/status.js +120 -0
  85. package/built/lib/cmds/status.js.map +1 -0
  86. package/built/lib/cmds/update.d.ts +3 -0
  87. package/built/lib/cmds/update.js +300 -0
  88. package/built/lib/cmds/update.js.map +1 -0
  89. package/built/lib/cmds/version.d.ts +2 -0
  90. package/built/lib/cmds/version.js +17 -0
  91. package/built/lib/cmds/version.js.map +1 -0
  92. package/built/lib/config.d.ts +58 -0
  93. package/built/lib/config.js +97 -0
  94. package/built/lib/config.js.map +1 -0
  95. package/built/lib/files/downloaded_binary.d.ts +14 -0
  96. package/built/lib/files/downloaded_binary.js +32 -0
  97. package/built/lib/files/downloaded_binary.js.map +1 -0
  98. package/built/lib/files/downloader.d.ts +20 -0
  99. package/built/lib/files/downloader.js +103 -0
  100. package/built/lib/files/downloader.js.map +1 -0
  101. package/built/lib/files/file_manager.d.ts +72 -0
  102. package/built/lib/files/file_manager.js +239 -0
  103. package/built/lib/files/file_manager.js.map +1 -0
  104. package/built/lib/files/index.d.ts +3 -0
  105. package/built/lib/files/index.js +9 -0
  106. package/built/lib/files/index.js.map +1 -0
  107. package/built/lib/http_utils.d.ts +27 -0
  108. package/built/lib/http_utils.js +118 -0
  109. package/built/lib/http_utils.js.map +1 -0
  110. package/built/lib/utils.d.ts +6 -0
  111. package/built/lib/utils.js +115 -0
  112. package/built/lib/utils.js.map +1 -0
  113. package/built/lib/webdriver.d.ts +0 -0
  114. package/built/lib/webdriver.js +22 -0
  115. package/built/lib/webdriver.js.map +1 -0
  116. package/built/package.json +85 -0
  117. package/config.json +18 -0
  118. package/docs/README.md +6 -0
  119. package/docs/mobile.md +79 -0
  120. package/docs/protractor.md +41 -0
  121. package/docs/versions.md +87 -0
  122. package/gulpfile.js +44 -0
  123. package/package.json +83 -4
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_1 = require("../config");
4
+ const binary_1 = require("./binary");
5
+ const iedriver_xml_1 = require("./iedriver_xml");
6
+ class IEDriver extends binary_1.Binary {
7
+ constructor(opt_alternativeCdn) {
8
+ super(opt_alternativeCdn || config_1.Config.cdnUrls().ie);
9
+ this.configSource = new iedriver_xml_1.IEDriverXml();
10
+ this.name = 'IEDriverServer';
11
+ this.versionDefault = IEDriver.versionDefault;
12
+ this.versionCustom = this.versionDefault;
13
+ }
14
+ id() {
15
+ return IEDriver.id;
16
+ }
17
+ prefix() {
18
+ return 'IEDriverServer';
19
+ }
20
+ suffix() {
21
+ return '.zip';
22
+ }
23
+ getVersionList() {
24
+ if (this.alternativeDownloadUrl != null) {
25
+ return Promise.resolve([]);
26
+ }
27
+ else {
28
+ return this.configSource.getVersionList();
29
+ }
30
+ }
31
+ }
32
+ IEDriver.id = 'ie';
33
+ IEDriver.isDefault32 = false;
34
+ IEDriver.isDefault64 = false;
35
+ IEDriver.os = [binary_1.OS.Windows_NT];
36
+ IEDriver.versionDefault = config_1.Config.binaryVersions().ie;
37
+ exports.IEDriver = IEDriver;
38
+ //# sourceMappingURL=iedriver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iedriver.js","sourceRoot":"","sources":["../../../lib/binaries/iedriver.ts"],"names":[],"mappings":";;AAAA,sCAAiC;AAEjC,qCAA+C;AAC/C,iDAA2C;AAE3C,cAAsB,SAAQ,eAAM;IAOlC,YAAY,kBAA2B;QACrC,KAAK,CAAC,kBAAkB,IAAI,eAAM,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,YAAY,GAAG,IAAI,0BAAW,EAAE,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;QAC9C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;IAC3C,CAAC;IAED,EAAE;QACA,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACrB,CAAC;IAED,MAAM;QACJ,MAAM,CAAC,gBAAgB,CAAC;IAC1B,CAAC;IAED,MAAM;QACJ,MAAM,CAAC,MAAM,CAAC;IAChB,CAAC;IAED,cAAc;QACZ,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,CAAC,CAAC;YACxC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC;QAC5C,CAAC;IACH,CAAC;;AAhCM,WAAE,GAAG,IAAI,CAAC;AACV,oBAAW,GAAG,KAAK,CAAC;AACpB,oBAAW,GAAG,KAAK,CAAC;AACpB,WAAE,GAAG,CAAC,WAAE,CAAC,UAAU,CAAC,CAAC;AACrB,uBAAc,GAAG,eAAM,CAAC,cAAc,EAAE,CAAC,EAAE,CAAC;AALrD,4BAkCC"}
@@ -0,0 +1,9 @@
1
+ import { BinaryUrl } from './binary';
2
+ import { XmlConfigSource } from './config_source';
3
+ export declare class IEDriverXml extends XmlConfigSource {
4
+ constructor();
5
+ getUrl(version: string): Promise<BinaryUrl>;
6
+ getVersionList(): Promise<string[]>;
7
+ private getLatestIEDriverVersion();
8
+ private getSpecificIEDriverVersion(inputVersion);
9
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const semver = require("semver");
4
+ const config_1 = require("../config");
5
+ const config_source_1 = require("./config_source");
6
+ class IEDriverXml extends config_source_1.XmlConfigSource {
7
+ constructor() {
8
+ super('iedriver', config_1.Config.cdnUrls()['ie']);
9
+ }
10
+ getUrl(version) {
11
+ if (version === 'latest') {
12
+ return this.getLatestIEDriverVersion();
13
+ }
14
+ else {
15
+ return this.getSpecificIEDriverVersion(version);
16
+ }
17
+ }
18
+ getVersionList() {
19
+ return this.getXml().then(xml => {
20
+ let versionPaths = [];
21
+ for (let content of xml.ListBucketResult.Contents) {
22
+ let contentKey = content.Key[0];
23
+ // Filter For IEDriverServer win 32. Removing option to download x64
24
+ if (contentKey.includes('IEDriverServer_Win32_')) {
25
+ versionPaths.push(contentKey);
26
+ }
27
+ }
28
+ return versionPaths;
29
+ });
30
+ }
31
+ getLatestIEDriverVersion() {
32
+ return this.getVersionList().then(list => {
33
+ let latestVersion = null;
34
+ let latest = '';
35
+ for (let item of list) {
36
+ // Get a semantic version.
37
+ let version = item.split('IEDriverServer_Win32_')[1].replace('.zip', '');
38
+ if (latestVersion == null) {
39
+ // First time: use the version found.
40
+ latestVersion = version;
41
+ latest = item;
42
+ }
43
+ else if (semver.gt(version, latestVersion)) {
44
+ // Get the latest.
45
+ latestVersion = version;
46
+ latest = item;
47
+ }
48
+ }
49
+ return { url: config_1.Config.cdnUrls().ie + latest, version: latestVersion };
50
+ });
51
+ }
52
+ getSpecificIEDriverVersion(inputVersion) {
53
+ return this.getVersionList().then(list => {
54
+ let itemFound = '';
55
+ for (let item of list) {
56
+ // Get a semantic version.
57
+ let version = item.split('IEDriverServer_Win32_')[1].replace('.zip', '');
58
+ // Check to see if the specified version matches.
59
+ let firstPath = item.split('/')[0];
60
+ if (version === inputVersion) {
61
+ return { url: config_1.Config.cdnUrls().ie + item, version: version };
62
+ }
63
+ }
64
+ return { url: '', version: inputVersion };
65
+ });
66
+ }
67
+ }
68
+ exports.IEDriverXml = IEDriverXml;
69
+ //# sourceMappingURL=iedriver_xml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iedriver_xml.js","sourceRoot":"","sources":["../../../lib/binaries/ied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AAE,OAAO,EAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;YACD,MAAM,CAAC,EAAC,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AApED,kCAoEC"}
@@ -0,0 +1,7 @@
1
+ export * from './android_sdk';
2
+ export * from './appium';
3
+ export * from './binary';
4
+ export * from './chrome_driver';
5
+ export * from './gecko_driver';
6
+ export * from './iedriver';
7
+ export * from './standalone';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ function __export(m) {
3
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
+ }
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ __export(require("./android_sdk"));
7
+ __export(require("./appium"));
8
+ __export(require("./binary"));
9
+ __export(require("./chrome_driver"));
10
+ __export(require("./gecko_driver"));
11
+ __export(require("./iedriver"));
12
+ __export(require("./standalone"));
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/binaries/index.ts"],"names":[],"mappings":";;;;;AAAA,mCAA8B;AAC9B,8BAAyB;AACzB,8BAAyB;AACzB,qCAAgC;AAChC,oCAA+B;AAC/B,gCAA2B;AAC3B,kCAA6B"}
@@ -0,0 +1,13 @@
1
+ import { Binary, OS } from './binary';
2
+ export declare class Standalone extends Binary {
3
+ static id: string;
4
+ static isDefault: boolean;
5
+ static os: OS[];
6
+ static versionDefault: string;
7
+ constructor(opt_alternativeCdn?: string);
8
+ id(): string;
9
+ prefix(): string;
10
+ suffix(): string;
11
+ executableSuffix(): string;
12
+ getVersionList(): Promise<string[]>;
13
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_1 = require("../config");
4
+ const binary_1 = require("./binary");
5
+ const standalone_xml_1 = require("./standalone_xml");
6
+ class Standalone extends binary_1.Binary {
7
+ constructor(opt_alternativeCdn) {
8
+ super(opt_alternativeCdn || config_1.Config.cdnUrls().selenium);
9
+ this.configSource = new standalone_xml_1.StandaloneXml();
10
+ this.name = 'selenium standalone';
11
+ this.versionDefault = Standalone.versionDefault;
12
+ this.versionCustom = this.versionDefault;
13
+ }
14
+ id() {
15
+ return Standalone.id;
16
+ }
17
+ prefix() {
18
+ return 'selenium-server-standalone-';
19
+ }
20
+ suffix() {
21
+ return '.jar';
22
+ }
23
+ executableSuffix() {
24
+ return '.jar';
25
+ }
26
+ getVersionList() {
27
+ // If an alternative cdn is set, return an empty list.
28
+ if (this.alternativeDownloadUrl != null) {
29
+ return Promise.resolve([]);
30
+ }
31
+ else {
32
+ return this.configSource.getVersionList();
33
+ }
34
+ }
35
+ }
36
+ Standalone.id = 'standalone';
37
+ Standalone.isDefault = true;
38
+ Standalone.os = [binary_1.OS.Windows_NT, binary_1.OS.Linux, binary_1.OS.Darwin];
39
+ Standalone.versionDefault = config_1.Config.binaryVersions().selenium;
40
+ exports.Standalone = Standalone;
41
+ //# sourceMappingURL=standalone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standalone.js","sourceRoot":"","sources":["../../../lib/binaries/standalone.ts"],"names":[],"mappings":";;AAAA,sCAAiC;AAEjC,qCAA+C;AAE/C,qDAA+C;AAE/C,gBAAwB,SAAQ,eAAM;IAMpC,YAAY,kBAA2B;QACrC,KAAK,CAAC,kBAAkB,IAAI,eAAM,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC;QACvD,IAAI,CAAC,YAAY,GAAG,IAAI,8BAAa,EAAE,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;IAC3C,CAAC;IAED,EAAE;QACA,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;IACvB,CAAC;IAED,MAAM;QACJ,MAAM,CAAC,6BAA6B,CAAC;IACvC,CAAC;IAED,MAAM;QACJ,MAAM,CAAC,MAAM,CAAC;IAChB,CAAC;IAED,gBAAgB;QACd,MAAM,CAAC,MAAM,CAAC;IAChB,CAAC;IAED,cAAc;QACZ,sDAAsD;QACtD,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,CAAC,CAAC;YACxC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC;QAC5C,CAAC;IACH,CAAC;;AApCM,aAAE,GAAG,YAAY,CAAC;AAClB,oBAAS,GAAG,IAAI,CAAC;AACjB,aAAE,GAAG,CAAC,WAAE,CAAC,UAAU,EAAE,WAAE,CAAC,KAAK,EAAE,WAAE,CAAC,MAAM,CAAC,CAAC;AAC1C,yBAAc,GAAG,eAAM,CAAC,cAAc,EAAE,CAAC,QAAQ,CAAC;AAJ3D,gCAsCC"}
@@ -0,0 +1,9 @@
1
+ import { BinaryUrl } from './binary';
2
+ import { XmlConfigSource } from './config_source';
3
+ export declare class StandaloneXml extends XmlConfigSource {
4
+ constructor();
5
+ getUrl(version: string): Promise<BinaryUrl>;
6
+ getVersionList(): Promise<string[]>;
7
+ private getLatestStandaloneVersion();
8
+ private getSpecificStandaloneVersion(inputVersion);
9
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const semver = require("semver");
4
+ const config_1 = require("../config");
5
+ const config_source_1 = require("./config_source");
6
+ class StandaloneXml extends config_source_1.XmlConfigSource {
7
+ constructor() {
8
+ super('standalone', config_1.Config.cdnUrls()['selenium']);
9
+ }
10
+ getUrl(version) {
11
+ if (version === 'latest') {
12
+ return this.getLatestStandaloneVersion();
13
+ }
14
+ else {
15
+ return this.getSpecificStandaloneVersion(version);
16
+ }
17
+ }
18
+ getVersionList() {
19
+ return this.getXml().then(xml => {
20
+ let versionPaths = [];
21
+ for (let content of xml.ListBucketResult.Contents) {
22
+ let contentKey = content.Key[0];
23
+ // Filter the selenium-server-standalone.
24
+ if (contentKey.includes('selenium-server-standalone')) {
25
+ versionPaths.push(contentKey);
26
+ }
27
+ }
28
+ return versionPaths;
29
+ });
30
+ }
31
+ getLatestStandaloneVersion() {
32
+ return this.getVersionList().then(list => {
33
+ let standaloneVersion = null;
34
+ let latest = '';
35
+ let latestVersion = '';
36
+ // Use jar files that are not beta and not alpha versions.
37
+ const jarList = list.filter((i) => {
38
+ return i.endsWith('.jar') && !i.includes('beta') && !i.includes('alpha');
39
+ });
40
+ for (let item of jarList) {
41
+ // Get a semantic version.
42
+ let version = item.split('selenium-server-standalone-')[1].replace('.jar', '');
43
+ if (standaloneVersion == null) {
44
+ // First time: use the version found.
45
+ standaloneVersion = version;
46
+ latest = item;
47
+ latestVersion = version;
48
+ }
49
+ else if (semver.gt(version, standaloneVersion)) {
50
+ // Get the latest.
51
+ standaloneVersion = version;
52
+ latest = item;
53
+ latestVersion = version;
54
+ }
55
+ }
56
+ return { url: config_1.Config.cdnUrls().selenium + latest, version: latestVersion };
57
+ });
58
+ }
59
+ getSpecificStandaloneVersion(inputVersion) {
60
+ return this.getVersionList().then(list => {
61
+ let itemFound = '';
62
+ let standaloneVersion = null;
63
+ for (let item of list) {
64
+ // Get a semantic version.
65
+ let version = item.split('selenium-server-standalone-')[1].replace('.jar', '');
66
+ // Check to see if the specified version matches.
67
+ let firstPath = item.split('/')[0];
68
+ if (version === inputVersion) {
69
+ // Check if the beta exists that we have the right version
70
+ // Example: We will see that beta3 appears in the file and path
71
+ // 3.0-beta3/selenium-server-standalone-3.0.0-beta3.jar
72
+ // where this should not work:
73
+ // 3.0-beta2/selenium-server-standalone-3.0.0-beta3.jar
74
+ if (inputVersion.includes('beta')) {
75
+ let betaInputVersion = inputVersion.replace('.jar', '').split('beta')[1];
76
+ if (item.split('/')[0].includes('beta' + betaInputVersion)) {
77
+ return { url: config_1.Config.cdnUrls().selenium + item, version: version };
78
+ }
79
+ }
80
+ else {
81
+ return { url: config_1.Config.cdnUrls().selenium + item, version: version };
82
+ }
83
+ }
84
+ }
85
+ });
86
+ }
87
+ }
88
+ exports.StandaloneXml = StandaloneXml;
89
+ //# sourceMappingURL=standalone_xml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standalone_xml.js","sourceRoot":"","sources":["../../../lib/binaries/standalone_xml.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AAEjC,sCAAiC;AAGjC,mDAAgD;AAEhD,mBAA2B,SAAQ,+BAAe;IAChD;QACE,KAAK,CAAC,YAAY,EAAE,eAAM,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,OAAe;QACpB,EAAE,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE,CAAC;QAC3C,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,cAAc;QACZ,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG;YAC3B,IAAI,YAAY,GAAa,EAAE,CAAC;YAEhC,GAAG,CAAC,CAAC,IAAI,OAAO,IAAI,GAAG,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAClD,IAAI,UAAU,GAAW,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAExC,yCAAyC;gBACzC,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC;oBACtD,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAChC,CAAC;YACH,CAAC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AI,CAAC,CAAC;wBACN,MAAM,CAAC,EAAC,GAAG,EAAE,eAAM,CAAC,OAAO,EAAE,CAAC,QAAQ,GAAG,IAAI,EAAE,OAAO,EAAE,OAAO,EAAC,CAAC;oBACnE,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAtFD,sCAsFC"}
@@ -0,0 +1,57 @@
1
+ import { Options } from './options';
2
+ import { Program, Programs } from './programs';
3
+ /**
4
+ * The Cli contains the usage and the collection of programs.
5
+ *
6
+ * Printing help for all the programs in the following order:
7
+ * usage, commands, and options. If the options are used in multiple programs,
8
+ * it will list it once.
9
+ */
10
+ export declare class Cli {
11
+ programs: Programs;
12
+ usageText: string;
13
+ version: string;
14
+ /**
15
+ * Register a program to the command line interface.
16
+ * @returns The cli for method chaining.
17
+ */
18
+ program(prog: Program): Cli;
19
+ /**
20
+ * Add a usage for the command line interface.
21
+ * @returns The cli for method chaining.
22
+ */
23
+ usage(usageText: string): Cli;
24
+ /**
25
+ * Prints help for the programs registered to the cli.
26
+ */
27
+ printHelp(): void;
28
+ /**
29
+ * For commands, gets the position where the description should start so they
30
+ * are aligned.
31
+ * @returns The position where the command description should start.
32
+ */
33
+ posCmdDescription(): number;
34
+ /**
35
+ * For options, gets the position where the description should start so they
36
+ * are aligned.
37
+ * @returns The position where the option description should start.
38
+ */
39
+ posDescription(): number;
40
+ /**
41
+ * For options, get the position where the default values should start so they
42
+ * are aligned.
43
+ * @returns The position where the option default values should start.
44
+ */
45
+ posDefault(): number;
46
+ /**
47
+ * Go through all programs and add options to the collection.
48
+ * @returns The options used in the programs.
49
+ */
50
+ getOptions(): Options;
51
+ /**
52
+ * Get the options used by the programs and create the minimist options
53
+ * to ensure that minimist parses the values properly.
54
+ * @returns The options for minimist.
55
+ */
56
+ getMinimistOptions(): Object;
57
+ }
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * The Cli contains the usage and the collection of programs.
5
+ *
6
+ * Printing help for all the programs in the following order:
7
+ * usage, commands, and options. If the options are used in multiple programs,
8
+ * it will list it once.
9
+ */
10
+ class Cli {
11
+ constructor() {
12
+ this.programs = {};
13
+ }
14
+ /**
15
+ * Register a program to the command line interface.
16
+ * @returns The cli for method chaining.
17
+ */
18
+ program(prog) {
19
+ this.programs[prog.cmd] = prog;
20
+ return this;
21
+ }
22
+ /**
23
+ * Add a usage for the command line interface.
24
+ * @returns The cli for method chaining.
25
+ */
26
+ usage(usageText) {
27
+ this.usageText = usageText;
28
+ return this;
29
+ }
30
+ /**
31
+ * Prints help for the programs registered to the cli.
32
+ */
33
+ printHelp() {
34
+ console.log('Usage: ' + this.usageText);
35
+ console.log('\nCommands:');
36
+ let cmdDescriptionPos = this.posCmdDescription();
37
+ for (let cmd in this.programs) {
38
+ let prog = this.programs[cmd];
39
+ prog.printCmd(cmdDescriptionPos);
40
+ }
41
+ let descriptionPos = this.posDescription();
42
+ let defaultPos = this.posDefault();
43
+ let extOptions = {};
44
+ console.log('\nOptions:');
45
+ // print all options
46
+ for (let cmd in this.programs) {
47
+ let prog = this.programs[cmd];
48
+ prog.printOptions(descriptionPos, defaultPos, extOptions);
49
+ }
50
+ }
51
+ /**
52
+ * For commands, gets the position where the description should start so they
53
+ * are aligned.
54
+ * @returns The position where the command description should start.
55
+ */
56
+ posCmdDescription() {
57
+ let position = -1;
58
+ for (let cmd in this.programs) {
59
+ position = Math.max(position, cmd.length + 6);
60
+ }
61
+ return position;
62
+ }
63
+ /**
64
+ * For options, gets the position where the description should start so they
65
+ * are aligned.
66
+ * @returns The position where the option description should start.
67
+ */
68
+ posDescription() {
69
+ let position = -1;
70
+ for (let cmd in this.programs) {
71
+ let prog = this.programs[cmd];
72
+ position = Math.max(position, prog.posDescription());
73
+ }
74
+ return position;
75
+ }
76
+ /**
77
+ * For options, get the position where the default values should start so they
78
+ * are aligned.
79
+ * @returns The position where the option default values should start.
80
+ */
81
+ posDefault() {
82
+ let position = -1;
83
+ for (let cmd in this.programs) {
84
+ let prog = this.programs[cmd];
85
+ position = Math.max(position, prog.posDefault());
86
+ }
87
+ return position;
88
+ }
89
+ /**
90
+ * Go through all programs and add options to the collection.
91
+ * @returns The options used in the programs.
92
+ */
93
+ getOptions() {
94
+ let allOptions = {};
95
+ for (let cmd in this.programs) {
96
+ let prog = this.programs[cmd];
97
+ allOptions = prog.getOptions_(allOptions);
98
+ }
99
+ return allOptions;
100
+ }
101
+ /**
102
+ * Get the options used by the programs and create the minimist options
103
+ * to ensure that minimist parses the values properly.
104
+ * @returns The options for minimist.
105
+ */
106
+ getMinimistOptions() {
107
+ let allOptions = this.getOptions();
108
+ let minimistOptions = {};
109
+ let minimistBoolean = [];
110
+ let minimistString = [];
111
+ let minimistNumber = [];
112
+ let minimistDefault = {};
113
+ for (let opt in allOptions) {
114
+ let option = allOptions[opt];
115
+ if (option.type === 'boolean') {
116
+ minimistBoolean.push(option.opt);
117
+ }
118
+ else if (option.type === 'string') {
119
+ minimistString.push(option.opt);
120
+ }
121
+ else if (option.type === 'number') {
122
+ minimistNumber.push(option.opt);
123
+ }
124
+ if (typeof option.defaultValue !== 'undefined') {
125
+ minimistDefault[option.opt] = option.defaultValue;
126
+ }
127
+ }
128
+ minimistOptions['boolean'] = minimistBoolean;
129
+ minimistOptions['string'] = minimistString;
130
+ minimistOptions['number'] = minimistNumber;
131
+ minimistOptions['default'] = minimistDefault;
132
+ return minimistOptions;
133
+ }
134
+ }
135
+ exports.Cli = Cli;
136
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../lib/cli/cli.ts"],"names":[],"mappings":";;AAUA;;;;;;GAMG;AACH;IAAA;QACE,aAAQ,GAAa,EAAE,CAAC;IAiI1B,CAAC;IA7HC;;;OAGG;IACH,OAAO,CAAC,IAAa;QACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,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,0 +1,4 @@
1
+ export * from './cli';
2
+ export * from './options';
3
+ export * from './programs';
4
+ export * from './logger';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ function __export(m) {
3
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
+ }
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ __export(require("./cli"));
7
+ __export(require("./options"));
8
+ __export(require("./programs"));
9
+ __export(require("./logger"));
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/cli/index.ts"],"names":[],"mappings":";;;;;AAAA,2BAAsB;AACtB,+BAA0B;AAC1B,gCAA2B;AAC3B,8BAAyB"}
@@ -0,0 +1,95 @@
1
+ export declare enum LogLevel {
2
+ ERROR = 0,
3
+ WARN = 1,
4
+ INFO = 2,
5
+ DEBUG = 3,
6
+ }
7
+ export declare enum WriteTo {
8
+ CONSOLE = 0,
9
+ FILE = 1,
10
+ BOTH = 2,
11
+ NONE = 3,
12
+ }
13
+ /**
14
+ * Logger class adds timestamp output, log levels, and identifiers to help
15
+ * when debugging. Also could write to console, file, both, or none.
16
+ */
17
+ export declare class Logger {
18
+ private id;
19
+ static logLevel: LogLevel;
20
+ static showTimestamp: boolean;
21
+ static showId: boolean;
22
+ static writeTo: WriteTo;
23
+ static fd: any;
24
+ static firstWrite: boolean;
25
+ /**
26
+ * Set up the write location. If writing to a file, get the file descriptor.
27
+ * @param writeTo The enum for where to write the logs.
28
+ * @param opt_logFile An optional parameter to override the log file location.
29
+ */
30
+ static setWrite(writeTo: WriteTo, opt_logFile?: string): void;
31
+ /**
32
+ * Creates a logger instance with an ID for the logger.
33
+ * @constructor
34
+ */
35
+ constructor(id: string);
36
+ /**
37
+ * Log INFO
38
+ * @param ...msgs multiple arguments to be logged.
39
+ */
40
+ info(...msgs: any[]): void;
41
+ /**
42
+ * Log DEBUG
43
+ * @param ...msgs multiple arguments to be logged.
44
+ */
45
+ debug(...msgs: any[]): void;
46
+ /**
47
+ * Log WARN
48
+ * @param ...msgs multiple arguments to be logged.
49
+ */
50
+ warn(...msgs: any[]): void;
51
+ /**
52
+ * Log ERROR
53
+ * @param ...msgs multiple arguments to be logged.
54
+ */
55
+ error(...msgs: any[]): void;
56
+ /**
57
+ * For the log level set, check to see if the messages should be logged.
58
+ * @param logLevel The log level of the message.
59
+ * @param msgs The messages to be logged
60
+ */
61
+ log_(logLevel: LogLevel, msgs: any[]): void;
62
+ /**
63
+ * Format with timestamp, log level, identifier, and message and log to
64
+ * specified medium (console, file, both, none).
65
+ * @param logLevel The log level of the message.
66
+ * @param msgs The messages to be logged.
67
+ */
68
+ print_(logLevel: LogLevel, msgs: any[]): void;
69
+ /**
70
+ * Get a timestamp formatted with [hh:mm:ss]
71
+ * @param writeTo The enum for where to write the logs.
72
+ * @return The string of the formatted timestamp
73
+ */
74
+ static timestamp_(writeTo: WriteTo): string;
75
+ /**
76
+ * Get the identifier of the logger as '/<id>'
77
+ * @param logLevel The log level of the message.
78
+ * @param writeTo The enum for where to write the logs.
79
+ * @return The string of the formatted id
80
+ */
81
+ static id_(logLevel: LogLevel, id: string, writeTo: WriteTo): string;
82
+ /**
83
+ * Get the log level formatted with the first letter. For info, it is I.
84
+ * @param logLevel The log level of the message.
85
+ * @param writeTo The enum for where to write the logs.
86
+ * @return The string of the formatted log level
87
+ */
88
+ static level_(logLevel: LogLevel, id: string, writeTo: WriteTo): string;
89
+ /**
90
+ * Convert the list of messages to a single string message.
91
+ * @param msgs The list of messages.
92
+ * @return The string of the formatted messages
93
+ */
94
+ static msgToFile_(msgs: any[]): string;
95
+ }