ga4-export-fixer 0.1.5-dev.1 → 0.1.5-dev.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.
- package/package.json +1 -1
- package/utils.js +11 -1
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -475,7 +475,6 @@ const validateConfig = (config) => {
|
|
|
475
475
|
throw new Error(`config.includedExportTypes must be an object. Received: ${JSON.stringify(config.includedExportTypes)}`);
|
|
476
476
|
}
|
|
477
477
|
for (const key of ['daily', 'intraday']) {
|
|
478
|
-
// fresh not requred at the moment
|
|
479
478
|
if (!(key in config.includedExportTypes)) {
|
|
480
479
|
throw new Error(`config.includedExportTypes.${key} is required.`);
|
|
481
480
|
}
|
|
@@ -483,6 +482,9 @@ const validateConfig = (config) => {
|
|
|
483
482
|
throw new Error(`config.includedExportTypes.${key} must be a boolean. Received: ${JSON.stringify(config.includedExportTypes[key])}`);
|
|
484
483
|
}
|
|
485
484
|
}
|
|
485
|
+
if (!config.includedExportTypes.daily && !config.includedExportTypes.intraday) {
|
|
486
|
+
throw new Error("At least one of config.includedExportTypes.daily or config.includedExportTypes.intraday must be true.");
|
|
487
|
+
}
|
|
486
488
|
|
|
487
489
|
// timezone - required
|
|
488
490
|
if (typeof config.timezone === 'undefined') {
|
|
@@ -524,6 +526,14 @@ const validateConfig = (config) => {
|
|
|
524
526
|
) {
|
|
525
527
|
throw new Error(`config.dataIsFinal.dayThreshold must be a non-negative integer. Received: ${JSON.stringify(config.dataIsFinal.dayThreshold)}`);
|
|
526
528
|
}
|
|
529
|
+
// EXPORT_TYPE detection relies on daily export metadata; intraday-only requires DAY_THRESHOLD instead.
|
|
530
|
+
if (
|
|
531
|
+
config.includedExportTypes.intraday &&
|
|
532
|
+
!config.includedExportTypes.daily &&
|
|
533
|
+
config.dataIsFinal.detectionMethod !== 'DAY_THRESHOLD'
|
|
534
|
+
) {
|
|
535
|
+
throw new Error(`config.dataIsFinal.detectionMethod must be 'DAY_THRESHOLD' when only intraday export is enabled (config.includedExportTypes.daily is false). A dayThreshold of 1 is recommended for intraday-only configurations. Received: ${JSON.stringify(config.dataIsFinal.detectionMethod)}`);
|
|
536
|
+
}
|
|
527
537
|
|
|
528
538
|
// test - optional; when defined, must be a boolean
|
|
529
539
|
if (typeof config.test !== 'undefined' && typeof config.test !== 'boolean') {
|