Updated config check.

This commit is contained in:
2026-07-05 21:07:57 +01:00
parent 50fc6f9cb5
commit d22f0aa316
+2 -3
View File
@@ -32,15 +32,14 @@ function validateConfig(config) {
const hasApiKeys = Array.isArray(config.apiKeys) && config.apiKeys.length > 0;
const hasSvcAccounts = Array.isArray(config.serviceAccounts) && config.serviceAccounts.length > 0;
const hasCredPath = !!config.credentialsPath;
// Do not allow both API keys and service accounts to be present simultaneously
if (hasApiKeys && hasSvcAccounts) {
throw new Error('Configuration must not include both `apiKeys` and `serviceAccounts`; choose one authentication method');
}
if (!hasApiKeys && !hasSvcAccounts && !hasCredPath) {
throw new Error('Configuration must include at least one of: `apiKeys`, `serviceAccounts`, or `credentialsPath`');
if (!hasApiKeys && !hasSvcAccounts) {
throw new Error('Configuration must include at least one `apiKeys` or `serviceAccounts`');
}
// Basic validation of documents/sheets structure