UNPKG

trpc-cloud-tasks-fetch

Version:

Small utility library for tRPC HTTP link to create GCP Cloud Task

23 lines (22 loc) 820 B
/// <reference types="node" /> import { CloudTasksClient } from '@google-cloud/tasks'; export interface CloudTaskFetcherOptions { client: CloudTasksClient; queueName: string; serviceAccountEmail?: string; } export declare function createCloudTaskFetcher(options: CloudTaskFetcherOptions | (() => CloudTaskFetcherOptions | Promise<CloudTaskFetcherOptions>)): (url: string, { method, body, headers, }: { method?: 'GET' | 'POST' | null | undefined; body: WithImplicitCoercion<Uint8Array | ReadonlyArray<number> | string>; headers?: Record<string, string> | undefined; }) => Promise<{ json: () => Promise<{ result: { type: string; data: { success: boolean; taskName: string | null | undefined; }; }; }>; }>;