UNPKG

@event-inc/pipelines

Version:

Event Inc is a fully managed event bus lets you send and receive data across mission-critical cloud apps, databases and warehouses.

26 lines (23 loc) 674 B
import { CreateQueuePayload, Queue } from '@event-inc/types'; import { makeHttpNetworkCall } from '@event-inc/utils'; import { version1 } from '../configs.apis'; export const createQueueApi = async <T extends 'sandbox' | 'production'>( headers: Record<string, string>, url: string, payload: CreateQueuePayload<T> ) => { const { label, workers } = payload; return makeHttpNetworkCall<Queue>({ method: 'POST', url: `${url}/${version1}/queues/create`, headers, data: { label, config: { workers: { replicas: workers ?? 1 } } } }) };