Skip to content

v1.18.0

Choose a tag to compare

@svc-devrev svc-devrev released this 31 Mar 08:24
· 30 commits to main since this release

What's Changed

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 reports and processed_files manually will continue to work. The SDK merges any manually provided values with its internal state.
  • Applies to all loading eventsDataLoadingDone, DataLoadingProgress, DataLoadingError, AttachmentLoadingDone, etc. all automatically include reports and processed_files.
  • Extraction events are unaffected — extraction events continue to automatically include artifacts as before.