@camunda8/sdk
Version:
[](https://www.npmjs.com/package/@camunda8/sdk)
27 lines (26 loc) • 1.15 kB
TypeScript
import { Job } from './interfaces-1.0';
import { ActivatedJob } from './interfaces-grpc-1.0';
export declare function parseVariables<T extends {
variables: string;
}, V = JSONDoc>(input: T): Omit<T, 'variables'> & {
variables: V;
};
/**
* Parse an incoming job and convert its variables and custom headers to JSON.
*/
export declare function parseVariablesAndCustomHeadersToJSON<Variables, CustomHeaders>(response: ActivatedJob, inputVariableDto: new (...args: any[]) => Readonly<Variables>, customHeadersDto: new (...args: any[]) => Readonly<CustomHeaders>): Job<Variables, CustomHeaders>;
/**
* Turn the `variables` field of a request from a JS object to a JSON string
* This should be a key:value object where the keys will be variable names in Zeebe and the values are the corresponding values.
* This function is used when sending a job back to Zeebe.
*/
export declare function stringifyVariables<K, T extends {
variables: K extends JSONDoc ? K : K;
}, V extends T & {
variables: string;
}>(request: T): V;
type JSON = string | number | boolean | JSON[] | JSONDoc[];
interface JSONDoc {
[key: string]: JSON;
}
export {};