1
0
Fork 0
mirror of synced 2024-09-26 06:11:49 +12:00
budibase/packages/backend-core/src/events/events.ts

14 lines
446 B
TypeScript
Raw Normal View History

2022-05-05 19:32:14 +12:00
import { Event } from "@budibase/types"
import { processors } from "./processors"
2022-05-24 09:14:44 +12:00
import * as identification from "./identification"
2022-04-02 09:29:44 +13:00
export const publishEvent = async (
event: Event,
properties: any,
timestamp?: string | number
) => {
2022-05-24 09:14:44 +12:00
// in future this should use async events via a distributed queue.
2022-05-25 07:01:13 +12:00
const identity = await identification.getCurrentIdentity()
await processors.processEvent(event, identity, properties, timestamp)
2022-04-02 09:29:44 +13:00
}