ofsc-utility 1.0.25 → 1.0.26
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/dist/events/index.js +12 -2
- package/package.json +1 -1
package/dist/events/index.js
CHANGED
|
@@ -213,8 +213,18 @@ async function downloadAllEventsOfDayCSV(clientId, clientSecret, instanceUrl, su
|
|
|
213
213
|
const filename = `events-${sinceDate}_${ts}.csv`;
|
|
214
214
|
const fullPath = path_1.default.resolve(filename);
|
|
215
215
|
if (!onlyData) {
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
try {
|
|
217
|
+
if (events.length === 0) {
|
|
218
|
+
console.warn(`⚠️ No events to save for ${sinceDate}. Skipping CSV export.`);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
(0, utilities_1.saveCsv)(events, fullPath);
|
|
222
|
+
console.log(`✅ Saved ${events.length} events to: ${fullPath}`);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
console.error(`Failed to save events CSV to ${fullPath}:`, error);
|
|
227
|
+
}
|
|
218
228
|
}
|
|
219
229
|
return events;
|
|
220
230
|
}
|