@zuplo/cli 1.70.0 → 1.72.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 (42) hide show
  1. package/dist/cli.js +8 -3
  2. package/dist/cmds/convert.js +6 -3
  3. package/dist/cmds/delete.js +6 -3
  4. package/dist/cmds/deploy.js +6 -3
  5. package/dist/cmds/dev.js +6 -3
  6. package/dist/cmds/editor.js +6 -3
  7. package/dist/cmds/link.js +6 -3
  8. package/dist/cmds/list.js +6 -3
  9. package/dist/cmds/login.js +6 -3
  10. package/dist/cmds/project/update.js +6 -3
  11. package/dist/cmds/test.js +6 -3
  12. package/dist/cmds/tunnel/create.js +6 -3
  13. package/dist/cmds/tunnel/delete.js +6 -3
  14. package/dist/cmds/tunnel/describe.js +6 -3
  15. package/dist/cmds/tunnel/list.js +6 -3
  16. package/dist/cmds/tunnel/rotate-token.js +6 -3
  17. package/dist/cmds/tunnel/services/describe.js +6 -3
  18. package/dist/cmds/tunnel/services/update.js +6 -3
  19. package/dist/cmds/variable/create.js +6 -3
  20. package/dist/cmds/variable/update.js +6 -3
  21. package/dist/common/analytics/lib.js +57 -0
  22. package/dist/common/constants.js +4 -2
  23. package/dist/common/machine-id/lib.js +68 -0
  24. package/dist/common/middleware/user-identification.js +38 -0
  25. package/dist/common/output.js +10 -2
  26. package/dist/deploy/poll-deployment.js +4 -4
  27. package/dist/dev/handler.js +6 -3
  28. package/dist/editor/handler.js +14 -5
  29. package/dist/editor/server/server.js +4 -3
  30. package/dist/link/handler.js +7 -7
  31. package/dist/list/handler.js +4 -3
  32. package/dist/tunnel/create/handler.js +4 -4
  33. package/dist/tunnel/delete/handler.js +4 -4
  34. package/dist/tunnel/describe/handler.js +4 -4
  35. package/dist/tunnel/list/handler.js +3 -3
  36. package/dist/tunnel/rotate-token/handler.js +4 -4
  37. package/dist/tunnel/services/describe/handler.js +4 -4
  38. package/dist/tunnel/services/update/handler.js +4 -4
  39. package/dist/tunnel/services/update/poll-provisioning-operations.js +8 -4
  40. package/dist/variable/create/handler.js +4 -3
  41. package/dist/variable/update/handler.js +4 -3
  42. package/package.json +5 -4
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1d7bc151-acef-5899-be7e-d270ad4b916d")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7bc41003-f323-5695-b288-5d0acea36dad")}catch(e){}}();
3
3
  import * as dotenv from "dotenv";
4
4
  dotenv.config();
5
5
  import * as Sentry from "@sentry/node";
@@ -20,7 +20,8 @@ import project from "./cmds/project/index.js";
20
20
  import test from "./cmds/test.js";
21
21
  import tunnel from "./cmds/tunnel/index.js";
22
22
  import variable from "./cmds/variable/index.js";
23
- import { SENTRY_DSN } from "./common/constants.js";
23
+ import { shutdownAnalytics } from "./common/analytics/lib.js";
24
+ import { MAX_WAIT_PENDING_TIME_MS, SENTRY_DSN } from "./common/constants.js";
24
25
  import { logger } from "./common/logger.js";
25
26
  import { printCriticalFailureToConsoleAndExit } from "./common/output.js";
26
27
  const MIN_NODE_VERSION = "18.0.0";
@@ -55,6 +56,10 @@ if (gte(process.versions.node, MIN_NODE_VERSION)) {
55
56
  .strictCommands()
56
57
  .version(packageJson?.version)
57
58
  .help().argv;
59
+ await shutdownAnalytics();
60
+ void Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
61
+ process.exit(0);
62
+ });
58
63
  }
59
64
  else {
60
65
  printCriticalFailureToConsoleAndExit(`The zup CLI requires at least node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of node.js.
@@ -62,4 +67,4 @@ else {
62
67
  Consider using a Node.js version manager such as https://github.com/nvm-sh/nvm.`);
63
68
  }
64
69
  //# sourceMappingURL=cli.js.map
65
- //# debugId=1d7bc151-acef-5899-be7e-d270ad4b916d
70
+ //# debugId=7bc41003-f323-5695-b288-5d0acea36dad
@@ -1,5 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1ee05eb2-eaf1-539f-99b2-cad44de903dd")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c359d71b-6ce9-5ec9-b31a-8de3cedcb7df")}catch(e){}}();
3
+ import { captureEvent } from "../common/analytics/lib.js";
4
+ import { identify } from "../common/middleware/user-identification.js";
3
5
  import setBlocking from "../common/output.js";
4
6
  import { convert } from "../convert/handler.js";
5
7
  export default {
@@ -14,11 +16,12 @@ export default {
14
16
  normalize: true,
15
17
  hidden: true,
16
18
  })
17
- .middleware([setBlocking]);
19
+ .middleware([setBlocking, identify]);
18
20
  },
19
21
  handler: async (argv) => {
22
+ await captureEvent({ argv, event: "zup convert" });
20
23
  await convert(argv);
21
24
  },
22
25
  };
23
26
  //# sourceMappingURL=convert.js.map
24
- //# debugId=1ee05eb2-eaf1-539f-99b2-cad44de903dd
27
+ //# debugId=c359d71b-6ce9-5ec9-b31a-8de3cedcb7df
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8065ff8d-d135-5d82-9b8c-74abe459c85d")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5b63d768-97c3-599a-ad9b-c0309b574315")}catch(e){}}();
3
+ import { captureEvent } from "../common/analytics/lib.js";
3
4
  import { configure } from "../common/middleware/user-configuration.js";
5
+ import { identify } from "../common/middleware/user-identification.js";
4
6
  import setBlocking from "../common/output.js";
5
7
  import { YargsChecker } from "../common/validators/lib.js";
6
8
  import { ProjectIsSetValidator } from "../common/validators/project-name-validator.js";
@@ -29,14 +31,15 @@ export default {
29
31
  })
30
32
  .boolean("wait")
31
33
  .demandOption(["api-key", "url"])
32
- .middleware([setBlocking, configure])
34
+ .middleware([setBlocking, configure, identify])
33
35
  .check(async (argv) => {
34
36
  return await new YargsChecker(new ProjectIsSetValidator()).check(argv);
35
37
  });
36
38
  },
37
39
  handler: async (argv) => {
40
+ await captureEvent({ argv, event: "zup delete" });
38
41
  await deleteZup(argv);
39
42
  },
40
43
  };
41
44
  //# sourceMappingURL=delete.js.map
42
- //# debugId=8065ff8d-d135-5d82-9b8c-74abe459c85d
45
+ //# debugId=5b63d768-97c3-599a-ad9b-c0309b574315
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cbf9a0b8-c0bc-5bb0-8096-54d8d05d7004")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="27a359ea-7c69-5fa8-af82-099d4fba393a")}catch(e){}}();
3
+ import { captureEvent } from "../common/analytics/lib.js";
3
4
  import { configure } from "../common/middleware/user-configuration.js";
5
+ import { identify } from "../common/middleware/user-identification.js";
4
6
  import setBlocking from "../common/output.js";
5
7
  import { validDeployDirectoryValidator } from "../common/validators/file-system-validator.js";
6
8
  import { YargsChecker } from "../common/validators/lib.js";
@@ -34,14 +36,15 @@ export default {
34
36
  })
35
37
  .demandOption(["api-key"])
36
38
  .boolean("verify-remote")
37
- .middleware([setBlocking, configure])
39
+ .middleware([setBlocking, configure, identify])
38
40
  .check(async (argv) => {
39
41
  return await new YargsChecker(validDeployDirectoryValidator).check(argv);
40
42
  });
41
43
  },
42
44
  handler: async (argv) => {
45
+ await captureEvent({ argv, event: "zup deploy" });
43
46
  await deploy(argv);
44
47
  },
45
48
  };
46
49
  //# sourceMappingURL=deploy.js.map
47
- //# debugId=cbf9a0b8-c0bc-5bb0-8096-54d8d05d7004
50
+ //# debugId=27a359ea-7c69-5fa8-af82-099d4fba393a
package/dist/cmds/dev.js CHANGED
@@ -1,5 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b2529683-8609-5481-9f1f-b61849e749e9")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a6a5ea00-8c94-5c86-98bd-6812b34268da")}catch(e){}}();
3
+ import { captureEvent } from "../common/analytics/lib.js";
4
+ import { identify } from "../common/middleware/user-identification.js";
3
5
  import setBlocking from "../common/output.js";
4
6
  import { ZuploProjectValidator } from "../common/validators/file-system-validator.js";
5
7
  import { YargsChecker } from "../common/validators/lib.js";
@@ -21,14 +23,15 @@ export default {
21
23
  describe: "The port to run the zup on",
22
24
  default: 9000,
23
25
  })
24
- .middleware([setBlocking])
26
+ .middleware([setBlocking, identify])
25
27
  .check(async (argv) => {
26
28
  return await new YargsChecker(new ZuploProjectValidator()).check(argv);
27
29
  });
28
30
  },
29
31
  handler: async (argv) => {
32
+ await captureEvent({ argv, event: "zup dev" });
30
33
  await dev(argv);
31
34
  },
32
35
  };
33
36
  //# sourceMappingURL=dev.js.map
34
- //# debugId=b2529683-8609-5481-9f1f-b61849e749e9
37
+ //# debugId=a6a5ea00-8c94-5c86-98bd-6812b34268da
@@ -1,5 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="94eadd05-6b27-55d1-a68e-610273cab2e8")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9bd67e21-217c-5e52-b853-54ac64d7c6c5")}catch(e){}}();
3
+ import { captureEvent } from "../common/analytics/lib.js";
4
+ import { identify } from "../common/middleware/user-identification.js";
3
5
  import setBlocking from "../common/output.js";
4
6
  import { ZuploProjectValidator } from "../common/validators/file-system-validator.js";
5
7
  import { YargsChecker } from "../common/validators/lib.js";
@@ -16,14 +18,15 @@ export default {
16
18
  normalize: false,
17
19
  hidden: false,
18
20
  })
19
- .middleware([setBlocking])
21
+ .middleware([setBlocking, identify])
20
22
  .check(async (argv) => {
21
23
  return await new YargsChecker(new ZuploProjectValidator()).check(argv);
22
24
  });
23
25
  },
24
26
  handler: async (argv) => {
27
+ await captureEvent({ argv, event: "zup editor" });
25
28
  await editor(argv);
26
29
  },
27
30
  };
28
31
  //# sourceMappingURL=editor.js.map
29
- //# debugId=94eadd05-6b27-55d1-a68e-610273cab2e8
32
+ //# debugId=9bd67e21-217c-5e52-b853-54ac64d7c6c5
package/dist/cmds/link.js CHANGED
@@ -1,5 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1d398742-c6e5-518f-97c1-b82358ee75de")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2173e418-d02e-5c23-8e2a-5d0b7ca7da8d")}catch(e){}}();
3
+ import { captureEvent } from "../common/analytics/lib.js";
4
+ import { identify } from "../common/middleware/user-identification.js";
3
5
  import setBlocking from "../common/output.js";
4
6
  import { validLinkDirectoryValidator } from "../common/validators/file-system-validator.js";
5
7
  import { YargsChecker } from "../common/validators/lib.js";
@@ -16,14 +18,15 @@ export default {
16
18
  normalize: true,
17
19
  hidden: true,
18
20
  })
19
- .middleware([setBlocking])
21
+ .middleware([setBlocking, identify])
20
22
  .check(async (argv) => {
21
23
  return await new YargsChecker(validLinkDirectoryValidator).check(argv);
22
24
  });
23
25
  },
24
26
  handler: async (argv) => {
27
+ await captureEvent({ argv, event: "zup link" });
25
28
  await link(argv);
26
29
  },
27
30
  };
28
31
  //# sourceMappingURL=link.js.map
29
- //# debugId=1d398742-c6e5-518f-97c1-b82358ee75de
32
+ //# debugId=2173e418-d02e-5c23-8e2a-5d0b7ca7da8d
package/dist/cmds/list.js CHANGED
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1e3cc332-74df-57b8-a456-6b2eba10dee2")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a83b0620-2b57-5557-81af-f8a94777304e")}catch(e){}}();
3
+ import { captureEvent } from "../common/analytics/lib.js";
3
4
  import { configure } from "../common/middleware/user-configuration.js";
5
+ import { identify } from "../common/middleware/user-identification.js";
4
6
  import setBlocking from "../common/output.js";
5
7
  import { YargsChecker } from "../common/validators/lib.js";
6
8
  import { ProjectIsSetValidator } from "../common/validators/project-name-validator.js";
@@ -20,14 +22,15 @@ export default {
20
22
  describe: "The project name",
21
23
  })
22
24
  .demandOption(["api-key"])
23
- .middleware([setBlocking, configure])
25
+ .middleware([setBlocking, configure, identify])
24
26
  .check(async (argv) => {
25
27
  return await new YargsChecker(new ProjectIsSetValidator()).check(argv);
26
28
  });
27
29
  },
28
30
  handler: async (argv) => {
31
+ await captureEvent({ argv, event: "zup list" });
29
32
  await list(argv);
30
33
  },
31
34
  };
32
35
  //# sourceMappingURL=list.js.map
33
- //# debugId=1e3cc332-74df-57b8-a456-6b2eba10dee2
36
+ //# debugId=a83b0620-2b57-5557-81af-f8a94777304e
@@ -1,5 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8aa027a1-1e73-54e1-8ebf-62989ec9fbe4")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b18d5ccc-e76d-5875-8439-46cd0742f7cc")}catch(e){}}();
3
+ import { captureEvent } from "../common/analytics/lib.js";
4
+ import { identify } from "../common/middleware/user-identification.js";
3
5
  import setBlocking from "../common/output.js";
4
6
  import { login } from "../login/handler.js";
5
7
  export default {
@@ -11,11 +13,12 @@ export default {
11
13
  type: "boolean",
12
14
  describe: "Should the CLI print the token to the console?",
13
15
  })
14
- .middleware([setBlocking]);
16
+ .middleware([setBlocking, identify]);
15
17
  },
16
18
  handler: async (argv) => {
19
+ await captureEvent({ argv, event: "zup login" });
17
20
  await login(argv);
18
21
  },
19
22
  };
20
23
  //# sourceMappingURL=login.js.map
21
- //# debugId=8aa027a1-1e73-54e1-8ebf-62989ec9fbe4
24
+ //# debugId=b18d5ccc-e76d-5875-8439-46cd0742f7cc
@@ -1,5 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d47c4ee2-0526-5442-98e4-4d04edf0bace")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f782c109-2667-5dba-a558-c93d90c9c817")}catch(e){}}();
3
+ import { captureEvent } from "../../common/analytics/lib.js";
4
+ import { identify } from "../../common/middleware/user-identification.js";
3
5
  import setBlocking from "../../common/output.js";
4
6
  import { ZuploProjectValidator } from "../../common/validators/file-system-validator.js";
5
7
  import { YargsChecker } from "../../common/validators/lib.js";
@@ -16,14 +18,15 @@ export default {
16
18
  normalize: true,
17
19
  hidden: true,
18
20
  })
19
- .middleware([setBlocking])
21
+ .middleware([setBlocking, identify])
20
22
  .check(async (argv) => {
21
23
  return await new YargsChecker(new ZuploProjectValidator()).check(argv);
22
24
  });
23
25
  },
24
26
  handler: async (argv) => {
27
+ await captureEvent({ argv, event: "zup update" });
25
28
  await update(argv);
26
29
  },
27
30
  };
28
31
  //# sourceMappingURL=update.js.map
29
- //# debugId=d47c4ee2-0526-5442-98e4-4d04edf0bace
32
+ //# debugId=f782c109-2667-5dba-a558-c93d90c9c817
package/dist/cmds/test.js CHANGED
@@ -1,5 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="87aaeef3-6851-54ac-874f-906116921209")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e7fdd7c3-e308-517a-b778-ec6bbd3e480f")}catch(e){}}();
3
+ import { captureEvent } from "../common/analytics/lib.js";
4
+ import { identify } from "../common/middleware/user-identification.js";
3
5
  import setBlocking from "../common/output.js";
4
6
  import { validTestDirectoryValidator } from "../common/validators/file-system-validator.js";
5
7
  import { YargsChecker } from "../common/validators/lib.js";
@@ -27,11 +29,12 @@ export default {
27
29
  .check(async (argv) => {
28
30
  return await new YargsChecker(validTestDirectoryValidator).check(argv);
29
31
  })
30
- .middleware([setBlocking]);
32
+ .middleware([setBlocking, identify]);
31
33
  },
32
34
  handler: async (argv) => {
35
+ await captureEvent({ argv, event: "zup test" });
33
36
  await test(argv);
34
37
  },
35
38
  };
36
39
  //# sourceMappingURL=test.js.map
37
- //# debugId=87aaeef3-6851-54ac-874f-906116921209
40
+ //# debugId=e7fdd7c3-e308-517a-b778-ec6bbd3e480f
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="373f077b-a94b-5f34-bf80-c25ef50a4575")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ce76db13-1e39-5c4c-aeda-36b1e413154c")}catch(e){}}();
3
+ import { captureEvent } from "../../common/analytics/lib.js";
3
4
  import { configure } from "../../common/middleware/user-configuration.js";
5
+ import { identify } from "../../common/middleware/user-identification.js";
4
6
  import setBlocking from "../../common/output.js";
5
7
  import { create } from "../../tunnel/create/handler.js";
6
8
  export default {
@@ -18,11 +20,12 @@ export default {
18
20
  envVar: "API_KEY",
19
21
  })
20
22
  .demandOption(["api-key", "tunnel-name"])
21
- .middleware([setBlocking, configure]);
23
+ .middleware([setBlocking, configure, identify]);
22
24
  },
23
25
  handler: async (argv) => {
26
+ await captureEvent({ argv, event: "zup tunnel create" });
24
27
  await create(argv);
25
28
  },
26
29
  };
27
30
  //# sourceMappingURL=create.js.map
28
- //# debugId=373f077b-a94b-5f34-bf80-c25ef50a4575
31
+ //# debugId=ce76db13-1e39-5c4c-aeda-36b1e413154c
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5e5ea9b4-5620-51e3-90d7-2e4ea501c852")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2a31b54f-92fa-50c5-91a6-7cec8d53b674")}catch(e){}}();
3
+ import { captureEvent } from "../../common/analytics/lib.js";
3
4
  import { configure } from "../../common/middleware/user-configuration.js";
5
+ import { identify } from "../../common/middleware/user-identification.js";
4
6
  import setBlocking from "../../common/output.js";
5
7
  import { deleteTunnel } from "../../tunnel/delete/handler.js";
6
8
  export default {
@@ -14,11 +16,12 @@ export default {
14
16
  envVar: "API_KEY",
15
17
  })
16
18
  .demandOption(["api-key"])
17
- .middleware([setBlocking, configure]);
19
+ .middleware([setBlocking, configure, identify]);
18
20
  },
19
21
  handler: async (argv) => {
22
+ await captureEvent({ argv, event: "zup tunnel delete" });
20
23
  await deleteTunnel(argv);
21
24
  },
22
25
  };
23
26
  //# sourceMappingURL=delete.js.map
24
- //# debugId=5e5ea9b4-5620-51e3-90d7-2e4ea501c852
27
+ //# debugId=2a31b54f-92fa-50c5-91a6-7cec8d53b674
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="99693bc3-7118-5977-a330-898e660ea589")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="579a2c12-5aba-57ca-a8d1-0b259b813168")}catch(e){}}();
3
+ import { captureEvent } from "../../common/analytics/lib.js";
3
4
  import { configure } from "../../common/middleware/user-configuration.js";
5
+ import { identify } from "../../common/middleware/user-identification.js";
4
6
  import setBlocking from "../../common/output.js";
5
7
  import { describe } from "../../tunnel/describe/handler.js";
6
8
  export default {
@@ -18,11 +20,12 @@ export default {
18
20
  envVar: "API_KEY",
19
21
  })
20
22
  .demandOption(["api-key", "tunnel-id"])
21
- .middleware([setBlocking, configure]);
23
+ .middleware([setBlocking, configure, identify]);
22
24
  },
23
25
  handler: async (argv) => {
26
+ await captureEvent({ argv, event: "zup tunnel describe" });
24
27
  await describe(argv);
25
28
  },
26
29
  };
27
30
  //# sourceMappingURL=describe.js.map
28
- //# debugId=99693bc3-7118-5977-a330-898e660ea589
31
+ //# debugId=579a2c12-5aba-57ca-a8d1-0b259b813168
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ad5fb9f1-9b28-5680-8f3e-a66939187584")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c44f64a5-21a8-584d-9028-7f537d5269c7")}catch(e){}}();
3
+ import { captureEvent } from "../../common/analytics/lib.js";
3
4
  import { configure } from "../../common/middleware/user-configuration.js";
5
+ import { identify } from "../../common/middleware/user-identification.js";
4
6
  import setBlocking from "../../common/output.js";
5
7
  import { list } from "../../tunnel/list/handler.js";
6
8
  export default {
@@ -14,11 +16,12 @@ export default {
14
16
  envVar: "API_KEY",
15
17
  })
16
18
  .demandOption(["api-key"])
17
- .middleware([setBlocking, configure]);
19
+ .middleware([setBlocking, configure, identify]);
18
20
  },
19
21
  handler: async (argv) => {
22
+ await captureEvent({ argv, event: "zup tunnel list" });
20
23
  await list(argv);
21
24
  },
22
25
  };
23
26
  //# sourceMappingURL=list.js.map
24
- //# debugId=ad5fb9f1-9b28-5680-8f3e-a66939187584
27
+ //# debugId=c44f64a5-21a8-584d-9028-7f537d5269c7
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d7d622df-d317-5fe0-a63e-45833a7165a6")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b165e372-4971-5548-8411-68fdffa6e477")}catch(e){}}();
3
+ import { captureEvent } from "../../common/analytics/lib.js";
3
4
  import { configure } from "../../common/middleware/user-configuration.js";
5
+ import { identify } from "../../common/middleware/user-identification.js";
4
6
  import setBlocking from "../../common/output.js";
5
7
  import { rotateToken } from "../../tunnel/rotate-token/handler.js";
6
8
  export default {
@@ -18,11 +20,12 @@ export default {
18
20
  envVar: "API_KEY",
19
21
  })
20
22
  .demandOption(["api-key", "tunnel-id"])
21
- .middleware([setBlocking, configure]);
23
+ .middleware([setBlocking, configure, identify]);
22
24
  },
23
25
  handler: async (argv) => {
26
+ await captureEvent({ argv, event: "zup tunnel rotate-token" });
24
27
  await rotateToken(argv);
25
28
  },
26
29
  };
27
30
  //# sourceMappingURL=rotate-token.js.map
28
- //# debugId=d7d622df-d317-5fe0-a63e-45833a7165a6
31
+ //# debugId=b165e372-4971-5548-8411-68fdffa6e477
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5d5b4dd7-966e-59c6-a0d3-51da1445b6e3")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="05fbb3b9-8612-5776-b8d2-8d1bfef979f0")}catch(e){}}();
3
+ import { captureEvent } from "../../../common/analytics/lib.js";
3
4
  import { configure } from "../../../common/middleware/user-configuration.js";
5
+ import { identify } from "../../../common/middleware/user-identification.js";
4
6
  import setBlocking from "../../../common/output.js";
5
7
  import { describe, } from "../../../tunnel/services/describe/handler.js";
6
8
  export default {
@@ -18,11 +20,12 @@ export default {
18
20
  envVar: "API_KEY",
19
21
  })
20
22
  .demandOption(["api-key", "tunnel-id"])
21
- .middleware([setBlocking, configure]);
23
+ .middleware([setBlocking, configure, identify]);
22
24
  },
23
25
  handler: async (argv) => {
26
+ await captureEvent({ argv, event: "zup tunnel services describe" });
24
27
  await describe(argv);
25
28
  },
26
29
  };
27
30
  //# sourceMappingURL=describe.js.map
28
- //# debugId=5d5b4dd7-966e-59c6-a0d3-51da1445b6e3
31
+ //# debugId=05fbb3b9-8612-5776-b8d2-8d1bfef979f0
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="dfb251e8-4218-591e-a0ce-fc987b2251e3")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8ad7bbf5-1581-51ae-b1b1-bc1b6ba575ef")}catch(e){}}();
3
+ import { captureEvent } from "../../../common/analytics/lib.js";
3
4
  import { configure } from "../../../common/middleware/user-configuration.js";
5
+ import { identify } from "../../../common/middleware/user-identification.js";
4
6
  import setBlocking from "../../../common/output.js";
5
7
  import { updateServices, } from "../../../tunnel/services/update/handler.js";
6
8
  export default {
@@ -22,11 +24,12 @@ export default {
22
24
  envVar: "API_KEY",
23
25
  })
24
26
  .demandOption(["api-key", "configuration-file", "tunnel-id"])
25
- .middleware([setBlocking, configure]);
27
+ .middleware([setBlocking, configure, identify]);
26
28
  },
27
29
  handler: async (argv) => {
30
+ await captureEvent({ argv, event: "zup tunnel services update" });
28
31
  await updateServices(argv);
29
32
  },
30
33
  };
31
34
  //# sourceMappingURL=update.js.map
32
- //# debugId=dfb251e8-4218-591e-a0ce-fc987b2251e3
35
+ //# debugId=8ad7bbf5-1581-51ae-b1b1-bc1b6ba575ef
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d70f0e5c-a934-50d8-be94-a68a917fc92f")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7ae73b32-818d-511d-a118-4f75093b18c5")}catch(e){}}();
3
+ import { captureEvent } from "../../common/analytics/lib.js";
3
4
  import { configure } from "../../common/middleware/user-configuration.js";
5
+ import { identify } from "../../common/middleware/user-identification.js";
4
6
  import setBlocking from "../../common/output.js";
5
7
  import { YargsChecker } from "../../common/validators/lib.js";
6
8
  import { ProjectIsSetValidator } from "../../common/validators/project-name-validator.js";
@@ -36,14 +38,15 @@ export default {
36
38
  describe: "The project name",
37
39
  })
38
40
  .demandOption(["api-key", "name", "value", "is-secret", "branch"])
39
- .middleware([setBlocking, configure])
41
+ .middleware([setBlocking, configure, identify])
40
42
  .check(async (argv) => {
41
43
  return await new YargsChecker(new ProjectIsSetValidator()).check(argv);
42
44
  });
43
45
  },
44
46
  handler: async (argv) => {
47
+ await captureEvent({ argv, event: "zup variable create" });
45
48
  await create(argv);
46
49
  },
47
50
  };
48
51
  //# sourceMappingURL=create.js.map
49
- //# debugId=d70f0e5c-a934-50d8-be94-a68a917fc92f
52
+ //# debugId=7ae73b32-818d-511d-a118-4f75093b18c5
@@ -1,6 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c2225edb-acb6-569a-b12b-54aa0f3f442c")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e78dcf46-0920-5254-ae6d-5e627c61bc40")}catch(e){}}();
3
+ import { captureEvent } from "../../common/analytics/lib.js";
3
4
  import { configure } from "../../common/middleware/user-configuration.js";
5
+ import { identify } from "../../common/middleware/user-identification.js";
4
6
  import setBlocking from "../../common/output.js";
5
7
  import { YargsChecker } from "../../common/validators/lib.js";
6
8
  import { ProjectIsSetValidator } from "../../common/validators/project-name-validator.js";
@@ -27,14 +29,15 @@ export default {
27
29
  describe: "The project name",
28
30
  })
29
31
  .demandOption(["api-key", "name", "value", "branch"])
30
- .middleware([setBlocking, configure])
32
+ .middleware([setBlocking, configure, identify])
31
33
  .check(async (argv) => {
32
34
  return await new YargsChecker(new ProjectIsSetValidator()).check(argv);
33
35
  });
34
36
  },
35
37
  handler: async (argv) => {
38
+ await captureEvent({ argv, event: "zup variable update" });
36
39
  await update(argv);
37
40
  },
38
41
  };
39
42
  //# sourceMappingURL=update.js.map
40
- //# debugId=c2225edb-acb6-569a-b12b-54aa0f3f442c
43
+ //# debugId=e78dcf46-0920-5254-ae6d-5e627c61bc40
@@ -0,0 +1,57 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2a37c996-c6cc-57a5-aab4-dcacb9c95a34")}catch(e){}}();
3
+ import { defaultIntegrations } from "@sentry/node";
4
+ import { PostHog } from "posthog-node";
5
+ import { POST_HOG_CAPTURE_KEY, ZUPLO_USER_ID_ARGV_KEY } from "../constants.js";
6
+ import { machineId } from "../machine-id/lib.js";
7
+ let _postHog;
8
+ let _context;
9
+ function init() {
10
+ if (process.env.ZUPLO_DO_NOT_TRACK) {
11
+ return undefined;
12
+ }
13
+ _postHog = new PostHog(POST_HOG_CAPTURE_KEY, {
14
+ host: "https://app.posthog.com",
15
+ flushAt: 1,
16
+ flushInterval: 1,
17
+ });
18
+ _context = defaultIntegrations.filter((integration) => integration.name == "Context")[0];
19
+ return _postHog;
20
+ }
21
+ export async function captureEvent({ argv, event, properties, groups, sendFeatureFlags, timestamp, disableGeoip, }) {
22
+ if (_postHog === undefined) {
23
+ init();
24
+ }
25
+ if (_postHog) {
26
+ properties = properties ?? {};
27
+ properties.$set_once = properties.$set_once ?? {};
28
+ if (argv[ZUPLO_USER_ID_ARGV_KEY] &&
29
+ typeof argv[ZUPLO_USER_ID_ARGV_KEY] === "string") {
30
+ properties.$set_once["user-id"] = argv[ZUPLO_USER_ID_ARGV_KEY];
31
+ }
32
+ if (argv.account && typeof argv.account === "string") {
33
+ properties.$set_once["account"] = argv["account"];
34
+ }
35
+ if (argv.project && typeof argv.project === "string") {
36
+ properties.$set_once["project"] = argv["project"];
37
+ }
38
+ if (process.env.CI) {
39
+ properties["ci"] = process.env.CI;
40
+ }
41
+ await _context?.addContext(properties);
42
+ _postHog?.capture({
43
+ distinctId: argv[ZUPLO_USER_ID_ARGV_KEY] || machineId(),
44
+ event,
45
+ properties,
46
+ groups,
47
+ sendFeatureFlags,
48
+ timestamp,
49
+ disableGeoip,
50
+ });
51
+ }
52
+ }
53
+ export async function shutdownAnalytics() {
54
+ return _postHog?.shutdownAsync();
55
+ }
56
+ //# sourceMappingURL=lib.js.map
57
+ //# debugId=2a37c996-c6cc-57a5-aab4-dcacb9c95a34
@@ -1,14 +1,16 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="df5828ae-5daa-5d76-b21c-787c45925e74")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b0d9163b-dfda-504b-b57d-1db0759acf53")}catch(e){}}();
3
3
  export const ZUPLO_PREFERRED_JSON_FILE = "zuplo.jsonc";
4
4
  export const ZUPLO_FALLBACK_JSON_FILE = "zuplo.json";
5
5
  export const ZUPLO_CLI_XDG_FOLDER_NAME = "zup";
6
6
  export const ZUPLO_AUTH_FILE_NAME = "auth.json";
7
7
  export const ZUPLO_SYSTEM_ENV_VAR = ".env.zuplo";
8
8
  export const DEPLOYER_METADATA_FILE = "deployer.json";
9
+ export const ZUPLO_USER_ID_ARGV_KEY = "zuplo-user-id";
9
10
  export const TEST_IN_FOLDER = "tests";
10
11
  export const TEST_OUT_FOLDER = ".zuplo/__tests__";
11
12
  export const SENTRY_DSN = "https://28220fd3185a1281daff09ade2114dca@o1036703.ingest.sentry.io/4505880249040896";
12
13
  export const MAX_WAIT_PENDING_TIME_MS = 1000;
14
+ export const POST_HOG_CAPTURE_KEY = "phc_LDSwSTOvIjiDDZql2g54Q7xEXoQ0EN9RMYb3STbdz1V";
13
15
  //# sourceMappingURL=constants.js.map
14
- //# debugId=df5828ae-5daa-5d76-b21c-787c45925e74
16
+ //# debugId=b0d9163b-dfda-504b-b57d-1db0759acf53