1
0
Fork 0
mirror of synced 2024-09-08 05:31:47 +12:00

Dispatch event on scim user created

This commit is contained in:
adrinr 2023-03-24 14:20:04 +00:00
parent 344a34ac7c
commit e6ff0a44fb
5 changed files with 29 additions and 0 deletions

View file

@ -22,3 +22,4 @@ export { default as plugin } from "./plugin"
export { default as backup } from "./backup"
export { default as environmentVariable } from "./environmentVariable"
export { default as auditLog } from "./auditLog"
export { default as scim } from "./scim"

View file

@ -0,0 +1,16 @@
import { publishEvent } from "../events"
import { Event, ScimUserCreatedEvent } from "@budibase/types"
async function SCIMUserCreated(props: {
email: string
timestamp?: string | number
}) {
const properties: ScimUserCreatedEvent = {
email: props.email,
}
await publishEvent(Event.SCIM_USER_CREATED, properties, props.timestamp)
}
export default {
SCIMUserCreated,
}

View file

@ -184,6 +184,9 @@ export enum Event {
// AUDIT LOG
AUDIT_LOGS_FILTERED = "audit_log:filtered",
AUDIT_LOGS_DOWNLOADED = "audit_log:downloaded",
// SCIM
SCIM_USER_CREATED = "scim:user:created",
}
// all events that are not audited have been added to this record as undefined, this means
@ -364,6 +367,9 @@ export const AuditedEventFriendlyName: Record<Event, string | undefined> = {
// AUDIT LOG - NOT AUDITED
[Event.AUDIT_LOGS_FILTERED]: undefined,
[Event.AUDIT_LOGS_DOWNLOADED]: undefined,
// SCIM
[Event.SCIM_USER_CREATED]: `SCIM user "{{ email }}" created`,
}
// properties added at the final stage of the event pipeline

View file

@ -23,3 +23,4 @@ export * from "./plugin"
export * from "./backup"
export * from "./environmentVariable"
export * from "./auditLog"
export * from "./scim"

View file

@ -0,0 +1,5 @@
import { BaseEvent } from "./event"
export interface ScimUserCreatedEvent extends BaseEvent {
email: string
}