-
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.
* chore: add rollout plugin and add simplified record helpers to common * release
- Loading branch information
Showing
10 changed files
with
573 additions
and
25 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,6 @@ | ||
--- | ||
'@flatfile/plugin-rollout': patch | ||
'@flatfile/util-common': patch | ||
--- | ||
|
||
Introduces Simplified record helpers for memory efficient processing of large datasets and launches a rollout plugin for helping with schema updating. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,56 @@ | ||
<!-- START_INFOCARD --> | ||
|
||
# @flatfile/plugin-rollout | ||
**Automatically rollout schema changes to already live workbooks.** | ||
|
||
|
||
This plugin listens for new agent deployments and automatically applies schema changes to already live workbooks. The plugin will update the schema of the workbook to match the latest schema of the sheet and trigger a rerun of hooks on all records in all sheets. | ||
|
||
**Events Handled:** | ||
- `commit:created` | ||
- `agent:updated` | ||
- `agent:created` | ||
|
||
|
||
<!-- END_INFOCARD --> | ||
|
||
|
||
## Parameters | ||
|
||
#### `namespace` - `string` | ||
|
||
Optionally only apply this updater to workbooks in certain namespaces. | ||
|
||
#### `dev` - `boolean` | ||
|
||
Also run the updater in local dev mode whenever the agent reloads (this can be problematic if you have many spaces in your dev environment). | ||
|
||
|
||
#### `updater` - `cb: (workbooks: Flatfile.Workbook[]) => Flatfile.Workbook[]` | ||
|
||
A callback to use to update the workbooks you want to migrate. This callback should return the updated workbooks so that data hooks can be run. | ||
|
||
## API Calls | ||
|
||
- `GET /api/v1/spaces` | ||
- `GET /api/v1/secrets` | ||
- `GET /api/v1/spaces/:id` | ||
- `GET /api/v1/workbooks` | ||
- `POST /api/v1/jobs` | ||
|
||
**install** | ||
```bash | ||
npm i @flatfile/plugin-rollout | ||
``` | ||
|
||
**import** | ||
```js | ||
import { rollout } from "@flatfile/plugin-rollout"; | ||
``` | ||
|
||
**listener.js** | ||
```js | ||
listener.use(rollout({ updater: (workbooks) => { | ||
// update workbooks here with new schema | ||
}})); | ||
``` |
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,50 @@ | ||
{ | ||
"name": "@flatfile/plugin-rollout", | ||
"version": "1.0.0", | ||
"url": "https://github.com/FlatFilers/flatfile-plugins/tree/main/plugins/rollout", | ||
"description": "A plugin for automatically rolling out new changes to workbooks in flatfile.", | ||
"registryMetadata": { | ||
"category": "core" | ||
}, | ||
"engines": { | ||
"node": ">= 16" | ||
}, | ||
"files": [ | ||
"dist/**" | ||
], | ||
"source": "src/index.ts", | ||
"main": "dist/main.js", | ||
"module": "dist/module.mjs", | ||
"types": "dist/types.d.ts", | ||
"scripts": { | ||
"build": "parcel build", | ||
"build:watch": "parcel watch", | ||
"build:prod": "NODE_ENV=production parcel build", | ||
"check": "tsc ./**/*.ts --noEmit --esModuleInterop", | ||
"test": "jest ./**/*.spec.ts --config=../../jest.config.js --runInBand" | ||
}, | ||
"keywords": [ | ||
"flatfile-plugins", | ||
"category-core", | ||
"featured" | ||
], | ||
"author": "David Boskovic", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/FlatFilers/flatfile-plugins.git", | ||
"directory": "plugins/rollout" | ||
}, | ||
"license": "ISC", | ||
"dependencies": { | ||
"@flatfile/util-common": "^1.3.2", | ||
"async": "^3.2.5", | ||
"modern-async": "^2.0.0" | ||
}, | ||
"peerDependencies": { | ||
"@flatfile/api": "^1.8.9", | ||
"@flatfile/listener": "^1.0.1" | ||
}, | ||
"devDependencies": { | ||
"@flatfile/rollup-config": "0.1.1" | ||
} | ||
} |
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 @@ | ||
import { buildConfig } from '@flatfile/rollup-config' | ||
|
||
const config = buildConfig({}) | ||
|
||
export default config |
Oops, something went wrong.