-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c95bc9a
commit 7796706
Showing
7 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@flatfile/util-common': minor | ||
--- | ||
|
||
This release adds more common utilities and fixes a bug in processRecords when updating record values. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @flatfile/util-common | ||
|
||
This is a package of common utility functions used across the Flatfile Plugins ecosystem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { Flatfile } from '@flatfile/api' | ||
import api from '@flatfile/api' | ||
|
||
export async function deleteRecords( | ||
sheetId: string, | ||
config: Omit<Flatfile.DeleteRecordsJobConfig, 'sheet'> | ||
): Promise<void> { | ||
try { | ||
const { data: sheet } = await api.sheets.get(sheetId) | ||
await api.jobs.create({ | ||
type: 'workbook', | ||
operation: 'delete-records', | ||
trigger: 'immediate', | ||
source: sheet.workbookId, | ||
config: { | ||
...config, | ||
sheet: sheetId, | ||
}, | ||
}) | ||
} catch (error) { | ||
console.error('Error deleting records:', error) | ||
throw new Error('Error deleting records') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './all.records' | ||
export * from './async.batch' | ||
export * from './delete.records' | ||
export * from './logging.helper' |