v1.18.0
What's Changed
- Emit report and processed files if loading event by @radovanjorgic in #165
- Make
EventContextandMockServerpublic by @gasperzgonec in #168 - Add support for selective object extraction by @radovanjorgic in #166
- Update express dependency to prevent a CVE by @gasperzgonec in #173
- Stop processing attachments and emit progress in case of soft timeout by @radovanjorgic in #171
- Fix
EventContextandMockServerexports by @gasperzgonec in #172 - Rewrite mock server with native node:http module by @radovanjorgic in #174
- Add support for Control Protocol V2 by @gasperzgonec in #144
- Don't resolve timeValue if field is undefined by @radovanjorgic in #175
Full Changelog: v1.17.0...v1.18.0
Migration guide — Automatic reports and processed_files in loading events (v1.18.0)
The SDK now automatically includes reports and processed_files in the event payload when emitting loading events. Previously, connector developers had to manually pass these fields in the data parameter of adapter.emit() — this was error-prone and inconsistent with how extraction events already handled artifacts automatically.
Passing reports and processed_files manually still works but is no longer necessary. The SDK tracks loading reports and processed files internally and attaches them to the event payload automatically.
Before
import { LoaderEventType, processTask } from '@devrev/adaas-sdk';
processTask({
task: async ({ adapter }) => {
const { reports, processed_files } = await adapter.loadItemTypes({
itemTypesToLoad: [
/* ... */
],
});
await adapter.emit(LoaderEventType.DataLoadingDone, {
reports,
processed_files,
});
},
onTimeout: async ({ adapter }) => {
const reports = adapter.reports;
const processed_files = adapter.processedFiles;
await adapter.emit(LoaderEventType.DataLoadingError, {
reports,
processed_files,
error: { message: 'Failed to load data. Lambda timeout.' },
});
},
});After
import { LoaderEventType, processTask } from '@devrev/adaas-sdk';
processTask({
task: async ({ adapter }) => {
await adapter.loadItemTypes({
itemTypesToLoad: [
/* ... */
],
});
await adapter.emit(LoaderEventType.DataLoadingDone);
},
onTimeout: async ({ adapter }) => {
await adapter.emit(LoaderEventType.DataLoadingError, {
error: { message: 'Failed to load data. Lambda timeout.' },
});
},
});What changed
| Aspect | Before | After |
|---|---|---|
reports in emit |
Manually passed in event data | Automatically included by the SDK |
processed_files in emit |
Manually passed in event data | Automatically included by the SDK |
loadItemTypes return value |
Had to capture and forward reports and processed_files |
Return value can be ignored (SDK tracks internally) |
| Timeout / error handlers | Had to read adapter.reports and adapter.processedFiles and pass them manually |
SDK attaches them automatically |
Key points
- No action required — existing connectors that pass
reportsandprocessed_filesmanually will continue to work. The SDK merges any manually provided values with its internal state. - Applies to all loading events —
DataLoadingDone,DataLoadingProgress,DataLoadingError,AttachmentLoadingDone, etc. all automatically includereportsandprocessed_files. - Extraction events are unaffected — extraction events continue to automatically include
artifactsas before.