https://github.com/flowcore-io/data-pump
Data Pump Client
https://github.com/flowcore-io/data-pump
Last synced: 11 months ago
JSON representation
Data Pump Client
- Host: GitHub
- URL: https://github.com/flowcore-io/data-pump
- Owner: flowcore-io
- Created: 2025-02-12T21:50:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-27T12:59:30.000Z (12 months ago)
- Last Synced: 2025-06-27T13:42:47.883Z (12 months ago)
- Language: TypeScript
- Size: 221 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Flowcore Data Pump Client
## Usage example
```ts
import { FlowcoreDataPump } from "@flowcore/data-pump"
import { oidcClient } from "@flowcore/oidc-client"
const oidcClient = oidcClient({
clientId: "",
clientSecret: "",
})
const dataPump = FlowcoreDataPump.create({
auth: {
getBearerToken: () => oidcClient.getToken().then((token) => token.accessToken),
},
dataSource: {
tenant: "tenant",
dataCore: "data-core",
flowType: "data.0",
eventTypes: ["data.created.0", "data.updated.0", "data.deleted.0"],
},
processor: {
concurrency: 1,
handler: async (events) => {
console.log(`Got ${events.length} events`)
await new Promise((resolve) => setTimeout(resolve, 100))
return true
},
},
bufferSize: 10_000,
maxRedeliveryCount: 4,
achknowledgeTimeoutMs: 10_000,
logger: console,
})
await dataPump.start((error?: Error) => {
console.log("Datapump ended with: ", error)
})
```