browsermation 0.0.68 → 0.0.69

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.
package/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  This is the PUBLIC NPM package for Browsermation's testing utilities.
4
4
 
5
+ ## Dev
6
+
7
+ ```bash
8
+ npm run build:start -- tunnel -- --port 8080
9
+ ```
10
+
5
11
  ## Installation
6
12
 
7
13
  To install the package, run:
package/dist/bin/cli.js CHANGED
@@ -42258,7 +42258,7 @@ var {
42258
42258
  // package.json
42259
42259
  var package_default = {
42260
42260
  name: "browsermation",
42261
- version: "0.0.68",
42261
+ version: "0.0.69",
42262
42262
  description: "The testing platform for Playwright by Browsermation.",
42263
42263
  main: "./dist/index.js",
42264
42264
  types: "./dist/index.d.ts",
@@ -46633,10 +46633,10 @@ async function upload(zipBuffer, shardNumber, totalShards, playwrightConfig, opt
46633
46633
  // src/tunnel.ts
46634
46634
  var import_node_child_process = require("node:child_process");
46635
46635
  function startTunnel(tunnelProcess, options) {
46636
- if (!process.env.BM_API_KEY) {
46636
+ if (!process.env.BM_API_TOKEN) {
46637
46637
  console.error(
46638
46638
  source_default.red.bold(
46639
- "\u274C Error: BM_API_KEY environment variable is not set. Please set it to your tunnel token."
46639
+ "\u274C Error: BM_API_TOKEN environment variable is not set. Please set it to your tunnel token."
46640
46640
  )
46641
46641
  );
46642
46642
  process.exit(1);
@@ -46644,13 +46644,13 @@ function startTunnel(tunnelProcess, options) {
46644
46644
  if (!options?.port) {
46645
46645
  console.error(
46646
46646
  source_default.red.bold(
46647
- "\u274C Error: Please provide a port to expose via the tunnel using the --tunnel or --port option."
46647
+ "\u274C Error: Please provide a port to expose via the tunnel using the --port option."
46648
46648
  )
46649
46649
  );
46650
46650
  process.exit(1);
46651
46651
  }
46652
46652
  const defaultDomain = "browsermationtunnel.com";
46653
- tunnelProcess = (0, import_node_child_process.spawn)("ssh", [
46653
+ const args = [
46654
46654
  "-o",
46655
46655
  "StrictHostKeyChecking=no",
46656
46656
  "-o",
@@ -46662,8 +46662,12 @@ function startTunnel(tunnelProcess, options) {
46662
46662
  "2200",
46663
46663
  "http",
46664
46664
  "--user",
46665
- process.env.BM_API_KEY || ""
46666
- ]);
46665
+ process.env.BM_API_TOKEN || ""
46666
+ ];
46667
+ if (options.host) {
46668
+ args.push("--host-header-rewrite", options.host);
46669
+ }
46670
+ tunnelProcess = (0, import_node_child_process.spawn)("ssh", args);
46667
46671
  process.on("SIGINT", function() {
46668
46672
  console.log("\nGracefully shutting down from SIGINT (Ctrl+C)");
46669
46673
  if (tunnelProcess) {
@@ -46694,7 +46698,7 @@ function startTunnel(tunnelProcess, options) {
46694
46698
  if (data.toString().includes("closed by remote host.")) {
46695
46699
  console.error(
46696
46700
  source_default.red.bold(
46697
- "\u274C Error: Please check that your BM_API_KEY is correct and has permissions to create tunnels."
46701
+ "\u274C Error: Please check that your BM_API_TOKEN is correct and has permissions to create tunnels."
46698
46702
  )
46699
46703
  );
46700
46704
  process.exit(1);
@@ -46740,7 +46744,7 @@ async function downloadFile(fileUrl, outputLocationPath) {
46740
46744
 
46741
46745
  // src/bin/cli.ts
46742
46746
  var program2 = new Command().name("browsermation").version(package_default.version).description(package_default.description);
46743
- program2.command("tunnel").option("-p, --port <port>").action(async (options) => {
46747
+ program2.command("tunnel").option("-p, --port <port>").option("-h, --host <host>").action(async (options) => {
46744
46748
  console.log(source_default.blue(`\u{1F680} Starting BrowserMation Tunnel...`));
46745
46749
  let tunnelProcess = null;
46746
46750
  await startTunnel(tunnelProcess, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browsermation",
3
- "version": "0.0.68",
3
+ "version": "0.0.69",
4
4
  "description": "The testing platform for Playwright by Browsermation.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",