mirror of
https://github.com/supabase/supabase.git
synced 2026-06-13 01:39:53 +08:00
25 lines
675 B
TypeScript
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 []
|
|
}
|
|
}
|