chore: bunch of improvements
JS Unit Tests / test (pull_request) Successful in 33s
Build Test / test (pull_request) Successful in 36s
PHP Unit Tests / test (pull_request) Successful in 1m12s

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-04-23 22:00:50 -04:00
parent b617234b40
commit 3362afb7ec
28 changed files with 1717 additions and 1297 deletions
+41
View File
@@ -15,6 +15,7 @@ import type {
*/
export abstract class Location {
abstract toJson(): ServiceLocation;
abstract clone(): Location;
static fromJson(data: ServiceLocation): Location {
switch (data.type) {
@@ -89,6 +90,17 @@ export class LocationUri extends Location {
const path = this.path || '';
return `${this.scheme}://${this.host}:${this.port}${path}`;
}
clone(): LocationUri {
return new LocationUri(
this.scheme,
this.host,
this.port,
this.path,
this.verifyPeer,
this.verifyHost
);
}
}
/**
@@ -138,6 +150,16 @@ export class LocationSocketSole extends Location {
...(this.verifyHost !== undefined && { verifyHost: this.verifyHost })
};
}
clone(): LocationSocketSole {
return new LocationSocketSole(
this.host,
this.port,
this.encryption,
this.verifyPeer,
this.verifyHost
);
}
}
/**
@@ -212,6 +234,21 @@ export class LocationSocketSplit extends Location {
...(this.outboundVerifyHost !== undefined && { outboundVerifyHost: this.outboundVerifyHost })
};
}
clone(): LocationSocketSplit {
return new LocationSocketSplit(
this.inboundHost,
this.inboundPort,
this.inboundEncryption,
this.outboundHost,
this.outboundPort,
this.outboundEncryption,
this.inboundVerifyPeer,
this.inboundVerifyHost,
this.outboundVerifyPeer,
this.outboundVerifyHost
);
}
}
/**
@@ -237,4 +274,8 @@ export class LocationFile extends Location {
path: this.path
};
}
clone(): LocationFile {
return new LocationFile(this.path);
}
}