@gearbox-protocol/cli-utils 5.35.1 → 5.35.2

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.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Assumes that host is always visible, and the secret part is in path or query
3
+ */
4
+ export declare class CensoredURL {
5
+ #private;
6
+ static transform(value: string): CensoredURL;
7
+ constructor(url: string);
8
+ get value(): string;
9
+ toString(): string;
10
+ toJSON(): string;
11
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Assumes that host is always visible, and the secret part is in path or query
3
+ */
4
+ export class CensoredURL {
5
+ #value;
6
+ #censored;
7
+ static transform(value) {
8
+ return new CensoredURL(value);
9
+ }
10
+ constructor(url) {
11
+ this.#value = url;
12
+ if (url.includes("127.0.0.1") ||
13
+ url.includes("localhost") ||
14
+ url.includes("host.docker.internal")) {
15
+ this.#censored = url;
16
+ }
17
+ else {
18
+ const u = new URL(url);
19
+ u.pathname = "/";
20
+ u.search = "";
21
+ this.#censored = u.href;
22
+ }
23
+ }
24
+ get value() {
25
+ return this.#value;
26
+ }
27
+ toString() {
28
+ return this.#censored;
29
+ }
30
+ toJSON() {
31
+ return this.toString();
32
+ }
33
+ }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./CensoredString.js";
2
+ export * from "./CensoredURL.js";
2
3
  export * from "./resolveYamlFiles.js";
3
4
  export * from "./schema-primitives.js";
4
5
  export * from "./SecretsManager.js";
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./CensoredString.js";
2
+ export * from "./CensoredURL.js";
2
3
  export * from "./resolveYamlFiles.js";
3
4
  export * from "./schema-primitives.js";
4
5
  export * from "./SecretsManager.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/cli-utils",
3
3
  "description": "Utils for creating cli apps",
4
- "version": "5.35.1",
4
+ "version": "5.35.2",
5
5
  "homepage": "https://gearbox.fi",
6
6
  "keywords": [
7
7
  "gearbox"