Files
supabase/apps/studio/components/interfaces/Integrations/Queues/SingleQueue/Queue.utils.tsx
2024-12-02 11:19:57 +08:00

25 lines
675 B
TypeScript

import { capitalize } from 'lodash'
export const QUEUE_MESSAGE_TYPES = ['archived', 'available', 'scheduled'] as const
export type QUEUE_MESSAGE_TYPE = (typeof QUEUE_MESSAGE_TYPES)[number]
export const QUEUE_MESSAGE_OPTIONS = QUEUE_MESSAGE_TYPES.map((type) => ({
id: type,
name: capitalize(type),
}))
export const getQueueFunctionsMapping = (command: string) => {
switch (command) {
case 'select':
return ['send', 'send_batch', 'read', 'pop', 'archive', 'delete']
case 'insert':
return ['send', 'send_batch']
case 'update':
return ['read', 'pop']
case 'delete':
return ['archive', 'delete']
default:
return []
}
}