@nangohq/types
Version:
Types used in Nango applications
54 lines (53 loc) • 1.26 kB
TypeScript
import type { ApiError, Endpoint } from '../api.js';
import type { RunnerOutputError } from '../runner/index.js';
import type { NangoProps } from '../runner/sdk.js';
import type { JsonValue } from 'type-fest';
export type PostHeartbeat = Endpoint<{
Method: 'POST';
Path: '/tasks/:taskId/heartbeat';
Params: {
taskId: string;
};
Body: never;
Error: ApiError<'heartbeat_failed'>;
Success: never;
}>;
export type PutTask = Endpoint<{
Method: 'PUT';
Path: '/tasks/:taskId';
Params: {
taskId: string;
};
Body: {
nangoProps?: NangoProps | undefined;
error?: RunnerOutputError | undefined;
output?: JsonValue | undefined;
};
Error: ApiError<'put_task_failed'>;
Success: never;
}>;
export type PostRegister = Endpoint<{
Method: 'POST';
Path: '/runners/:nodeId/register';
Params: {
nodeId: number;
};
Body: {
url: string;
};
Error: ApiError<'register_failed'>;
Success: {
status: 'ok';
};
}>;
export type PostIdle = Endpoint<{
Method: 'POST';
Path: '/runners/:nodeId/idle';
Params: {
nodeId: number;
};
Error: ApiError<'idle_failed'>;
Success: {
status: 'ok';
};
}>;