这个 @flatfile/plugin-automap 插件会听取文件提取任务并作出反应,然后创建一个用于自动化的映射任务. 目前,就业执行计划中的每个领域都必须达到《就业计划》中规定的最低信任水平 accuracy 配置道具 .
嵌入Flatfile时,该插件应被部署在服务器侧听器中. 学多点
参数
accuracy - 说吧 'confident' | 'exact' - (必须)
这个 accuracy 参数匹配列或“ 自信”( > 90%匹配) 或“ 准确”( 100%匹配) .
debug - 说吧 boolean
这个 debug 参数允许您为开发目的切换或关闭帮助调试消息.
defaultTargetSheet - 说吧 'string' | '(fileName: string) => string | Promise'
这个 defaultTargetSheet 参数将精确的表 sattle 或调用函数解决到精确表 sattle 以导入数据.
matchFilename - 说吧 RegExp
这个 matchFilename 参数需要一个正则表达式来匹配特定文件来进行自动映射.
onFailure - 说吧 (event: FlatfileEvent) => void | Promise<void>
这个 onFailure 参数需要调用功能, 当插件保释时执行 。 回调可以是同步的,也可以是同步的.
targetWorkbook - 说吧 string
这个 targetWorkbook 参数指定了目的 Workbook id或名称.
API 调用
api.files.getapi.files.updateapi.jobs.createapi.jobs.executeapi.jobs.getExecutionPlanapi.workbooks.listapi.workbooks.get
使用量
对于自动化工作流程,请使用 files 终点 测试时,您通过UI中的文件区域导入并使用 debug 配置属性.
安装
npm i @flatfile/plugin-automap
导入
import { automap } from "@flatfile/plugin-automap";
监听器
listener.use(
automap({
accuracy: "confident",
defaultTargetSheet: "Contact",
matchFilename: /test.csv$/g,
onFailure: async (event: FlatfileEvent) => {
// send an SMS, an email, post to an endpoint, etc.
console.error(
`Please visit https://spaces.flatfile.com/space/${event.context.spaceId}/files?mode=import to manually import file.`
);
},
})
);