2024-06-14 11:09:53 +00:00
|
|
|
import BadDataException from "Common/Types/Exception/BadDataException";
|
|
|
|
import ObjectID from "Common/Types/ObjectID";
|
|
|
|
import LocalCache from "CommonServer/Infrastructure/LocalCache";
|
2023-06-25 09:23:42 +00:00
|
|
|
|
|
|
|
export default class ProbeUtil {
|
2024-06-14 11:09:53 +00:00
|
|
|
public static getProbeId(): ObjectID {
|
|
|
|
const id: string | undefined =
|
|
|
|
LocalCache.getString("PROBE", "PROBE_ID") || process.env["PROBE_ID"];
|
2023-06-25 09:23:42 +00:00
|
|
|
|
2024-06-14 11:09:53 +00:00
|
|
|
if (!id) {
|
|
|
|
throw new BadDataException("Probe ID not found");
|
2023-06-25 09:23:42 +00:00
|
|
|
}
|
2024-06-14 11:09:53 +00:00
|
|
|
|
|
|
|
return new ObjectID(id);
|
|
|
|
}
|
2023-06-25 09:23:42 +00:00
|
|
|
}
|