From 95bd1db8a62723f5e1711a7751efe9c9e7e54d3b Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Wed, 4 Oct 2023 12:31:19 -0500 Subject: [PATCH 1/3] feat: add Merge connection example --- javascript/connect/index.js | 5 +++++ typescript/connect/index.ts | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 javascript/connect/index.js create mode 100644 typescript/connect/index.ts diff --git a/javascript/connect/index.js b/javascript/connect/index.js new file mode 100644 index 0000000..60d93bc --- /dev/null +++ b/javascript/connect/index.js @@ -0,0 +1,5 @@ +import mergePlugin from "@flatfile/plugin-connect-via-merge"; + +export default function flatfileEventListener(listener) { + listener.use(mergePlugin()); +} diff --git a/typescript/connect/index.ts b/typescript/connect/index.ts new file mode 100644 index 0000000..bbc73b9 --- /dev/null +++ b/typescript/connect/index.ts @@ -0,0 +1,6 @@ +import type { FlatfileListener } from "@flatfile/listener"; +import mergePlugin from "@flatfile/plugin-connect-via-merge"; + +export default function flatfileEventListener(listener: FlatfileListener) { + listener.use(mergePlugin()); +} From 0419f3e19b4a6037a8e0ea8ae5932ff50e06d188 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Wed, 4 Oct 2023 12:32:46 -0500 Subject: [PATCH 2/3] feat: install package --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 5cb6df1..5eb39f1 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@flatfile/plugin-xml-extractor": "^0.5.0", "@flatfile/plugin-zip-extractor": "^0.3.6", "@flatfile/util-response-rejection": "^0.1.0", + "@flatfile/plugin-connect-via-merge": "^0.1.0", "axios": "^1.5.0", "flatfile": "^3.5.9", "form-data": "^4.0.0", From 719e2222e147c3e6ab4b4d958ffcf4b85886e678 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Thu, 5 Oct 2023 12:01:40 -0500 Subject: [PATCH 3/3] feat: add readme & rename dir --- javascript/connect-alpha/README.md | 46 +++++++++++++++++++ .../{connect => connect-alpha}/index.js | 2 +- typescript/connect-alpha/README.md | 46 +++++++++++++++++++ .../{connect => connect-alpha}/index.ts | 2 +- 4 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 javascript/connect-alpha/README.md rename javascript/{connect => connect-alpha}/index.js (58%) create mode 100644 typescript/connect-alpha/README.md rename typescript/{connect => connect-alpha}/index.ts (72%) diff --git a/javascript/connect-alpha/README.md b/javascript/connect-alpha/README.md new file mode 100644 index 0000000..de311fd --- /dev/null +++ b/javascript/connect-alpha/README.md @@ -0,0 +1,46 @@ +# @flatfile/plugin-connect-via-merge + +This is an **alpha release** connect plugin for Merge.dev. Using this plugin will enable you to sync data from hundreds of integrations (connected through Merge.dev) with Flatfile. + +## Before you begin... + +1. Email support@flatfile.com to request that the `connections` flag be enabled for your account. +2. Create a [Merge.dev](https://www.merge.dev) account. +4. Create and configure a [Flatfile Space](https://platform.flatfile.com). +3. Create a new secret named `MERGE_ACCESS_KEY` in your space containing your [Merge.dev API key](https://app.merge.dev/keys). + +## Getting started + +First, install the plugin: +```bash +npm i @flatfile/plugin-connect-via-merge +``` + +Now you can create your Flatfile listener: + +Javascript: +```js +import mergePlugin from "@flatfile/plugin-connect-via-merge"; + +export default function (listener) { + listener.use(mergePlugin()); +} +``` + +Typescript: +```ts +import type { FlatfileListener } from "@flatfile/listener"; +import mergePlugin from "@flatfile/plugin-connect-via-merge"; + +export default function (listener: FlatfileListener) { + listener.use(mergePlugin()); +} +``` + +And finally, deploy it to Flatfile: + +```bash +npx flatfile@latest deploy +``` + +With the `connections` feature flag enabled, you will see a new item in your space's sidebar labeled "Add Connection". Clicking this will open a modal where you can select the Merge.dev integration you want to connect to Flatfile. After you've made your selection, Merge.dev will since your selected integration with their system and your Flatfile listener will create a Workbook with Sheets to match Merge.dev's schema. Once the Merge.dev sync is complete, your Flatfile listener will complete the process by syncing with Merge.dev. \ No newline at end of file diff --git a/javascript/connect/index.js b/javascript/connect-alpha/index.js similarity index 58% rename from javascript/connect/index.js rename to javascript/connect-alpha/index.js index 60d93bc..dfa3427 100644 --- a/javascript/connect/index.js +++ b/javascript/connect-alpha/index.js @@ -1,4 +1,4 @@ -import mergePlugin from "@flatfile/plugin-connect-via-merge"; +import { mergePlugin } from "@flatfile/plugin-connect-via-merge"; export default function flatfileEventListener(listener) { listener.use(mergePlugin()); diff --git a/typescript/connect-alpha/README.md b/typescript/connect-alpha/README.md new file mode 100644 index 0000000..de311fd --- /dev/null +++ b/typescript/connect-alpha/README.md @@ -0,0 +1,46 @@ +# @flatfile/plugin-connect-via-merge + +This is an **alpha release** connect plugin for Merge.dev. Using this plugin will enable you to sync data from hundreds of integrations (connected through Merge.dev) with Flatfile. + +## Before you begin... + +1. Email support@flatfile.com to request that the `connections` flag be enabled for your account. +2. Create a [Merge.dev](https://www.merge.dev) account. +4. Create and configure a [Flatfile Space](https://platform.flatfile.com). +3. Create a new secret named `MERGE_ACCESS_KEY` in your space containing your [Merge.dev API key](https://app.merge.dev/keys). + +## Getting started + +First, install the plugin: +```bash +npm i @flatfile/plugin-connect-via-merge +``` + +Now you can create your Flatfile listener: + +Javascript: +```js +import mergePlugin from "@flatfile/plugin-connect-via-merge"; + +export default function (listener) { + listener.use(mergePlugin()); +} +``` + +Typescript: +```ts +import type { FlatfileListener } from "@flatfile/listener"; +import mergePlugin from "@flatfile/plugin-connect-via-merge"; + +export default function (listener: FlatfileListener) { + listener.use(mergePlugin()); +} +``` + +And finally, deploy it to Flatfile: + +```bash +npx flatfile@latest deploy +``` + +With the `connections` feature flag enabled, you will see a new item in your space's sidebar labeled "Add Connection". Clicking this will open a modal where you can select the Merge.dev integration you want to connect to Flatfile. After you've made your selection, Merge.dev will since your selected integration with their system and your Flatfile listener will create a Workbook with Sheets to match Merge.dev's schema. Once the Merge.dev sync is complete, your Flatfile listener will complete the process by syncing with Merge.dev. \ No newline at end of file diff --git a/typescript/connect/index.ts b/typescript/connect-alpha/index.ts similarity index 72% rename from typescript/connect/index.ts rename to typescript/connect-alpha/index.ts index bbc73b9..4ed42bf 100644 --- a/typescript/connect/index.ts +++ b/typescript/connect-alpha/index.ts @@ -1,5 +1,5 @@ import type { FlatfileListener } from "@flatfile/listener"; -import mergePlugin from "@flatfile/plugin-connect-via-merge"; +import { mergePlugin } from "@flatfile/plugin-connect-via-merge"; export default function flatfileEventListener(listener: FlatfileListener) { listener.use(mergePlugin());