Add client runtime and hello handshake
This commit is contained in:
@@ -29,27 +29,27 @@ function isValidWsUrl(value: string): boolean {
|
||||
}
|
||||
|
||||
export function validateYonexusClientConfig(raw: unknown): YonexusClientConfig {
|
||||
const source = raw as Record<string, unknown> | null;
|
||||
const source = (raw && typeof raw === "object" ? raw : {}) as Record<string, unknown>;
|
||||
const issues: string[] = [];
|
||||
|
||||
const mainHost = source?.mainHost;
|
||||
const mainHost = source.mainHost;
|
||||
if (!isNonEmptyString(mainHost)) {
|
||||
issues.push("mainHost is required");
|
||||
} else if (!isValidWsUrl(mainHost.trim())) {
|
||||
issues.push("mainHost must be a valid ws:// or wss:// URL");
|
||||
}
|
||||
|
||||
const identifier = source?.identifier;
|
||||
const identifier = source.identifier;
|
||||
if (!isNonEmptyString(identifier)) {
|
||||
issues.push("identifier is required");
|
||||
}
|
||||
|
||||
const notifyBotToken = source?.notifyBotToken;
|
||||
const notifyBotToken = source.notifyBotToken;
|
||||
if (!isNonEmptyString(notifyBotToken)) {
|
||||
issues.push("notifyBotToken is required");
|
||||
}
|
||||
|
||||
const adminUserId = source?.adminUserId;
|
||||
const adminUserId = source.adminUserId;
|
||||
if (!isNonEmptyString(adminUserId)) {
|
||||
issues.push("adminUserId is required");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user