@energyweb/node-red-contrib-green-proof-worker
Version:
## Peer dependencies
110 lines (109 loc) • 3.55 kB
TypeScript
import * as z from 'zod';
import type { Api } from '../api';
declare const InputMessage: z.ZodUnion<[z.ZodObject<{
topic: z.ZodLiteral<"finished-processing">;
payload: z.ZodObject<{
httpApiMessageId: z.ZodString;
}, "strip", z.ZodTypeAny, {
httpApiMessageId: string;
}, {
httpApiMessageId: string;
}>;
}, "strip", z.ZodTypeAny, {
topic: "finished-processing";
payload: {
httpApiMessageId: string;
};
}, {
topic: "finished-processing";
payload: {
httpApiMessageId: string;
};
}>, z.ZodObject<{
topic: z.ZodLiteral<"force-reset">;
}, "strip", z.ZodTypeAny, {
topic: "force-reset";
}, {
topic: "force-reset";
}>]>;
declare const Config: z.ZodObject<{
namespace: z.ZodString;
host: z.ZodString;
workerId: z.ZodString;
}, "strip", z.ZodTypeAny, {
namespace: string;
host: string;
workerId: string;
}, {
namespace: string;
host: string;
workerId: string;
}>;
export declare const SourceHttpApiHttpAck: (api: Api) => {
new (config: any): {
/** Used to orchestrate consumer retry */
isDestroying: boolean;
nextMessageWaitTime: number;
pendingProcessing: {
messageId: string;
resolve: VoidFunction;
reject: (err: Error) => void;
} | null;
config: Promise<z.infer<typeof Config>>;
getMessageLoop(): Promise<void>;
setStatus(status: 'waiting' | 'pending' | 'error'): void;
/**
* Input is responsible for resolving promise that http api is waiting for
*/
onInput(message: z.infer<typeof InputMessage>): void;
getMessage(): Promise<unknown | null>;
buildGetMessageUrl(): Promise<URL>;
ackMessage(messageId: string): Promise<void>;
onDestroy(): void;
api: Api;
nodeConfig: unknown;
messageZod: z.ZodUnion<[z.ZodObject<{
topic: z.ZodLiteral<"finished-processing">;
payload: z.ZodObject<{
httpApiMessageId: z.ZodString;
}, "strip", z.ZodTypeAny, {
httpApiMessageId: string;
}, {
httpApiMessageId: string;
}>;
}, "strip", z.ZodTypeAny, {
topic: "finished-processing";
payload: {
httpApiMessageId: string;
};
}, {
topic: "finished-processing";
payload: {
httpApiMessageId: string;
};
}>, z.ZodObject<{
topic: z.ZodLiteral<"force-reset">;
}, "strip", z.ZodTypeAny, {
topic: "force-reset";
}, {
topic: "force-reset";
}>]>;
getBaseUrls(): Promise<{
kafka_url?: string | string[] | undefined;
kafka_proxy_url?: string | undefined;
indexer_url?: string | undefined;
rpc_url?: string | undefined;
}>;
getNodeEnvConfig(): {
BASE_URL_CDN?: string | undefined;
EWX_SOLUTION_ID?: string | undefined;
EWX_SOLUTION_GROUP_ID?: string | undefined;
EWX_WORKLOGIC_ID?: string | undefined;
EWX_SQLITE_PATH?: string | undefined;
EWX_WORKER_ADDRESS?: string | undefined;
};
sendBuilder(inputMessage: import("../types").NodeMessage<any>): import("../node").SendBuilder;
handleMaybePromise<T>(maybePromiseCb: () => T | Promise<T>, done: (err?: Error | undefined) => void): void;
};
};
export {};