Dispatch event on scim user created
This commit is contained in:
parent
344a34ac7c
commit
e6ff0a44fb
|
@ -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"
|
||||
|
|
|
@ -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,
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -23,3 +23,4 @@ export * from "./plugin"
|
|||
export * from "./backup"
|
||||
export * from "./environmentVariable"
|
||||
export * from "./auditLog"
|
||||
export * from "./scim"
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
import { BaseEvent } from "./event"
|
||||
|
||||
export interface ScimUserCreatedEvent extends BaseEvent {
|
||||
email: string
|
||||
}
|
Loading…
Reference in New Issue