diff --git a/.changeset/five-carrots-explain.md b/.changeset/five-carrots-explain.md new file mode 100644 index 000000000..4af852794 --- /dev/null +++ b/.changeset/five-carrots-explain.md @@ -0,0 +1,5 @@ +--- +'@flatfile/plugin-record-hook': major +--- + +Mark the event as non optional BulkRecordHook diff --git a/plugins/record-hook/src/RecordHook.ts b/plugins/record-hook/src/RecordHook.ts index 4f9622c03..708f814cf 100644 --- a/plugins/record-hook/src/RecordHook.ts +++ b/plugins/record-hook/src/RecordHook.ts @@ -19,10 +19,7 @@ export interface RecordHookOptions { export const RecordHook = async ( event: FlatfileEvent, - handler: ( - record: FlatfileRecord, - event?: FlatfileEvent - ) => any | Promise, + handler: (record: FlatfileRecord, event: FlatfileEvent) => any | Promise, options: RecordHookOptions = {} ) => { const { concurrency = 10 } = options @@ -58,7 +55,7 @@ export const BulkRecordHook = async ( event: FlatfileEvent, handler: ( records: FlatfileRecord[], - event?: FlatfileEvent + event: FlatfileEvent ) => any | Promise, options: BulkRecordHookOptions = {} ) => { diff --git a/plugins/record-hook/src/record.hook.plugin.ts b/plugins/record-hook/src/record.hook.plugin.ts index 23bd9438f..73718d808 100644 --- a/plugins/record-hook/src/record.hook.plugin.ts +++ b/plugins/record-hook/src/record.hook.plugin.ts @@ -7,7 +7,7 @@ export const recordHookPlugin = ( sheetSlug: string, callback: ( record: FlatfileRecord, - event?: FlatfileEvent + event: FlatfileEvent ) => any | Promise, options: RecordHookOptions = {} ) => { @@ -22,7 +22,7 @@ export const bulkRecordHookPlugin = ( sheetSlug: string, callback: ( records: FlatfileRecord[], - event?: FlatfileEvent + event: FlatfileEvent ) => any | Promise, options: BulkRecordHookOptions = {} ) => {