Skip to content

feat: ISS-147898 Add package.json version to adapter emit messagehttps://app.devrev.ai/devrev/works/ISS-147898 #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/common/control-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '../types/extraction';
import { LoaderEventType } from '../types/loading';
import { serializeAxiosError } from '../logger/logger';
import { version } from '../../package.json';

export interface EmitInterface {
event: AirdropEvent;
Expand All @@ -26,6 +27,9 @@ export const emit = async ({
event_data: {
...data,
},
worker_metadata: {
adaas_library_version: version
}
};

return new Promise<void>(async (resolve, reject) => {
Expand Down
9 changes: 9 additions & 0 deletions src/types/extraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ export interface EventData {
stats_file?: string;
}

/**
* WorkerMetadata is an interface that defines the structure of the worker metadata that is sent from the external extractor to ADaaS.
*/
export interface WorkerMetadata {
adaas_library_version: string;
}

/**
* DomainObject is an interface that defines the structure of a domain object that can be extracted.
* It must contain a name, a next chunk ID, the pages, the last modified date, whether it is done, and the count.
Expand Down Expand Up @@ -238,6 +245,7 @@ export interface ExtractorEvent {
event_type: string;
event_context: EventContext;
event_data?: EventData;
worker_metadata?: WorkerMetadata;
}

/**
Expand All @@ -247,6 +255,7 @@ export interface LoaderEvent {
event_type: string;
event_context: EventContext;
event_data?: EventData;
worker_metadata?: WorkerMetadata;
}

export type ExternalSystemAttachmentStreamingFunction = ({
Expand Down