MCPcopy Create free account
hub / github.com/benwinding/react-admin-import-csv / ImportConfig

Interface ImportConfig

src/config.interface.ts:3–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import { ParseConfig } from "papaparse";
2
3export interface ImportConfig {
4 // Enable logging
5 logging?: boolean;
6 // Disable the attempt to use "createMany", will instead just use "create" calls
7 disableCreateMany?: boolean,
8 // Disable the attempt to use "updateMany", will instead just use "update" calls
9 disableUpdateMany?: boolean,
10 // Disable the attempt to use "getMany", will instead just use "getOne" calls
11 disableGetMany?: boolean,
12 // Disable "import new" button
13 disableImportNew?: boolean;
14 // Disable "import overwrite" button
15 disableImportOverwrite?: boolean;
16 // A function to translate the CSV rows on import
17 preCommitCallback?: PrecommitCallback;
18 // A function to handle row errors after import
19 postCommitCallback?: ErrorCallback;
20 // Transform rows before anything is sent to dataprovider
21 transformRows?: (csvRows: any[]) => Promise<any[]>;
22 // Async function to Validate a row, reject the promise if it's not valid
23 validateRow?: ValidateRowFunction;
24 // Any option from the "papaparse" library, for all options see: https://www.papaparse.com/docs#config
25 parseConfig?: ParseConfig,
26};
27
28export type PrecommitCallback = (action: "create" | "overwrite", values: any[]) => Promise<any[]>;
29export type ValidateRowFunction = (csvRowItem: any, index?: any, allItems?: any[]) => Promise<void>;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected