@curatedotfun/masa-source
Version:
Masa source plugin for curatedotfun
15 lines (14 loc) • 1.14 kB
TypeScript
import { IPlatformSearchService, PlatformState, SourceItem, SourcePluginSearchOptions } from "@curatedotfun/types";
import { z } from "zod";
import { MasaClient } from "../masa-client";
export interface PlatformConfig<TPlatformOptionsInput extends Record<string, any> = Record<string, any>, TPlatformOptionsOutput extends Record<string, any> = Record<string, any>> {
optionsSchema: z.ZodSchema<TPlatformOptionsOutput, any, TPlatformOptionsInput>;
preparePlatformArgs: (options: SourcePluginSearchOptions) => TPlatformOptionsInput;
}
export interface ServiceRegistryEntry<TItem extends SourceItem, TPlatformOptionsInput extends Record<string, any> = Record<string, any>, TPlatformOptionsOutput extends Record<string, any> = Record<string, any>, TPlatformState extends PlatformState = PlatformState> {
platformType: string;
factory: (masaClient: MasaClient) => IPlatformSearchService<TItem, TPlatformOptionsOutput, TPlatformState>;
config: PlatformConfig<TPlatformOptionsInput, TPlatformOptionsOutput>;
}
export declare const serviceRegistry: ServiceRegistryEntry<any, any, any, any>[];
export default serviceRegistry;