UNPKG

@searchmoe/search-api

Version:

SearchMoe API client with generated gRPC bindings for TypeScript.

624 lines (623 loc) 20.8 kB
// @generated by protobuf-ts 2.10.0 with parameter optimize_code_size // @generated from protobuf file "search_svc.proto" (package "search_svc", syntax proto3) // tslint:disable // // Code generated with goa v3.20.1, DO NOT EDIT. // // SearchSvc protocol buffer definition // // Command: // $ goa gen github.com/searchmoe/search-service/api/design -o ../ // import { ServiceType } from "@protobuf-ts/runtime-rpc"; import { MessageType } from "@protobuf-ts/runtime"; /** * @generated from protobuf message search_svc.TextSearchNewRequest */ export interface TextSearchNewRequest { /** * Session metadata. * * @generated from protobuf field: search_svc.SessionMetadata session_metadata = 1; */ sessionMetadata?: SessionMetadata; /** * Text of the search query. * * @generated from protobuf field: string query = 2; */ query: string; } /** * @generated from protobuf message search_svc.SessionMetadata */ export interface SessionMetadata { /** * Search session ID. * * @generated from protobuf field: string session_id = 1; */ sessionId: string; /** * Preferred language ISO 639-1 code. * * @generated from protobuf field: optional string preferred_language = 2; */ preferredLanguage?: string; /** * Suggested language ISO 639-1 code. * * @generated from protobuf field: optional string suggested_language = 3; */ suggestedLanguage?: string; /** * Location country ISO 3166-1 alpha-2 code. * * @generated from protobuf field: optional string location_country = 4; */ locationCountry?: string; /** * Location latitude in degrees. * * @generated from protobuf field: optional double location_lat = 5; */ locationLat?: number; /** * Location longitude in degrees. * * @generated from protobuf field: optional double location_lon = 6; */ locationLon?: number; } /** * @generated from protobuf message search_svc.TextSearchNewResponse */ export interface TextSearchNewResponse { /** * Search session ID. * * @generated from protobuf field: string session_id = 1; */ sessionId: string; /** * Deducted title of the search query. * * @generated from protobuf field: optional string title = 2; */ title?: string; /** * Chunk of the text answer. * * @generated from protobuf field: search_svc.AnswerChunk answer_chunk = 3; */ answerChunk?: AnswerChunk; /** * Citation to be included in the answer and citations. * * @generated from protobuf field: search_svc.AnswerCitation answer_citation = 4; */ answerCitation?: AnswerCitation; /** * Chunk of the post-processed text answer. * * @generated from protobuf field: search_svc.AnswerChunk pp_answer_chunk = 5; */ ppAnswerChunk?: AnswerChunk; /** * Citation to be included in the post-processed answer and citations. * * @generated from protobuf field: search_svc.AnswerCitation pp_answer_citation = 6; */ ppAnswerCitation?: AnswerCitation; /** * Link from search results (separate to answer and citations). * * @generated from protobuf field: search_svc.Link link = 7; */ link?: Link; /** * Image from search results. * * @generated from protobuf field: search_svc.Image image = 8; */ image?: Image; /** * Product from search results. * * @generated from protobuf field: search_svc.Product product = 9; */ product?: Product; /** * Error if occurred during the search. * * @generated from protobuf field: search_svc.Error error = 10; */ error?: Error; } /** * @generated from protobuf message search_svc.AnswerChunk */ export interface AnswerChunk { /** * Text of the answer chunk. * * @generated from protobuf field: string text = 1; */ text: string; /** * Whether this is the last chunk of the answer. * * @generated from protobuf field: optional bool is_last = 2; */ isLast?: boolean; } /** * @generated from protobuf message search_svc.AnswerCitation */ export interface AnswerCitation { /** * ID of the citation. * * @generated from protobuf field: string id = 1; */ id: string; /** * Title of the citation. * * @generated from protobuf field: string title = 2; */ title: string; /** * URL of the citation. * * @generated from protobuf field: string url = 3; */ url: string; /** * Whether this is the last citation. * * @generated from protobuf field: optional bool is_last = 4; */ isLast?: boolean; } /** * @generated from protobuf message search_svc.Link */ export interface Link { /** * URL of the link. * * @generated from protobuf field: string url = 1; */ url: string; /** * Title of the link. * * @generated from protobuf field: string title = 2; */ title: string; /** * Description of the link. * * @generated from protobuf field: optional string description = 3; */ description?: string; /** * Favicon URL of the website the link belongs to. * * @generated from protobuf field: optional string favicon = 4; */ favicon?: string; } /** * @generated from protobuf message search_svc.Image */ export interface Image { /** * ID of the image. * * @generated from protobuf field: string id = 1; */ id: string; /** * Source URL of the image. * * @generated from protobuf field: string src = 2; */ src: string; /** * URL that the image links to. * * @generated from protobuf field: string link_url = 3; */ linkUrl: string; /** * Title of the image. * * @generated from protobuf field: string title = 4; */ title: string; /** * Description of the image. * * @generated from protobuf field: optional string description = 5; */ description?: string; /** * Favicon URL of the website the image belongs to. * * @generated from protobuf field: optional string favicon = 6; */ favicon?: string; } /** * @generated from protobuf message search_svc.Product */ export interface Product { /** * ID of the product. * * @generated from protobuf field: string id = 1; */ id: string; /** * Title of the product. * * @generated from protobuf field: string title = 2; */ title: string; /** * Description of the product. * * @generated from protobuf field: string description = 3; */ description: string; /** * Price of the product. * * @generated from protobuf field: double price = 4; */ price: number; /** * Availability status of the product. * * @generated from protobuf field: string availability = 5; */ availability: string; /** * Currency of the product price. * * @generated from protobuf field: string currency = 6; */ currency: string; /** * Cover image URL of the product. * * @generated from protobuf field: string cover_image = 7; */ coverImage: string; /** * URL link to the product. * * @generated from protobuf field: string link_url = 8; */ linkUrl: string; /** * ID of the marketplace where the product is listed. * * @generated from protobuf field: string marketplace_id = 9; */ marketplaceId: string; /** * Favicon of the marketplace website, can be null. * * @generated from protobuf field: optional string favicon = 10; */ favicon?: string; } /** * @generated from protobuf message search_svc.Error */ export interface Error { /** * Error message. * * @generated from protobuf field: string message_ = 1; */ message: string; /** * Route where the error occurred. * * @generated from protobuf field: string route = 2; */ route: string; } /** * @generated from protobuf message search_svc.AudioSearchNewRequest */ export interface AudioSearchNewRequest { /** * Session metadata. * * @generated from protobuf field: search_svc.SessionMetadata session_metadata = 1; */ sessionMetadata?: SessionMetadata; /** * Text of the search query. * * @generated from protobuf field: optional string query = 2; */ query?: string; /** * URL of the audio file. * * @generated from protobuf field: optional string audio_url = 3; */ audioUrl?: string; /** * Audio data. * * @generated from protobuf field: optional bytes audio_data = 4; */ audioData?: Uint8Array; /** * Type of the audio data. * * @generated from protobuf field: optional string audio_type = 5; */ audioType?: string; } /** * @generated from protobuf message search_svc.AudioSearchNewResponse */ export interface AudioSearchNewResponse { /** * Search session ID. * * @generated from protobuf field: string session_id = 1; */ sessionId: string; /** * Deducted title of the search query. * * @generated from protobuf field: optional string title = 2; */ title?: string; /** * Chunk of the text answer. * * @generated from protobuf field: search_svc.AnswerChunk answer_chunk = 3; */ answerChunk?: AnswerChunk; /** * Citation to be included in the answer and citations. * * @generated from protobuf field: search_svc.AnswerCitation answer_citation = 4; */ answerCitation?: AnswerCitation; /** * Chunk of the post-processed text answer. * * @generated from protobuf field: search_svc.AnswerChunk pp_answer_chunk = 5; */ ppAnswerChunk?: AnswerChunk; /** * Citation to be included in the post-processed answer and citations. * * @generated from protobuf field: search_svc.AnswerCitation pp_answer_citation = 6; */ ppAnswerCitation?: AnswerCitation; /** * Link from search results (separate to answer and citations). * * @generated from protobuf field: search_svc.Link link = 7; */ link?: Link; /** * Image from search results. * * @generated from protobuf field: search_svc.Image image = 8; */ image?: Image; /** * Product from search results. * * @generated from protobuf field: search_svc.Product product = 9; */ product?: Product; /** * Error if occurred during the search. * * @generated from protobuf field: search_svc.Error error = 10; */ error?: Error; } // @generated message type with reflection information, may provide speed optimized methods class TextSearchNewRequest$Type extends MessageType<TextSearchNewRequest> { constructor() { super("search_svc.TextSearchNewRequest", [ { no: 1, name: "session_metadata", kind: "message", T: () => SessionMetadata }, { no: 2, name: "query", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } } /** * @generated MessageType for protobuf message search_svc.TextSearchNewRequest */ export const TextSearchNewRequest = new TextSearchNewRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class SessionMetadata$Type extends MessageType<SessionMetadata> { constructor() { super("search_svc.SessionMetadata", [ { no: 1, name: "session_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "preferred_language", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "suggested_language", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "location_country", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 5, name: "location_lat", kind: "scalar", opt: true, T: 1 /*ScalarType.DOUBLE*/ }, { no: 6, name: "location_lon", kind: "scalar", opt: true, T: 1 /*ScalarType.DOUBLE*/ } ]); } } /** * @generated MessageType for protobuf message search_svc.SessionMetadata */ export const SessionMetadata = new SessionMetadata$Type(); // @generated message type with reflection information, may provide speed optimized methods class TextSearchNewResponse$Type extends MessageType<TextSearchNewResponse> { constructor() { super("search_svc.TextSearchNewResponse", [ { no: 1, name: "session_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "title", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "answer_chunk", kind: "message", T: () => AnswerChunk }, { no: 4, name: "answer_citation", kind: "message", T: () => AnswerCitation }, { no: 5, name: "pp_answer_chunk", kind: "message", T: () => AnswerChunk }, { no: 6, name: "pp_answer_citation", kind: "message", T: () => AnswerCitation }, { no: 7, name: "link", kind: "message", T: () => Link }, { no: 8, name: "image", kind: "message", T: () => Image }, { no: 9, name: "product", kind: "message", T: () => Product }, { no: 10, name: "error", kind: "message", T: () => Error } ]); } } /** * @generated MessageType for protobuf message search_svc.TextSearchNewResponse */ export const TextSearchNewResponse = new TextSearchNewResponse$Type(); // @generated message type with reflection information, may provide speed optimized methods class AnswerChunk$Type extends MessageType<AnswerChunk> { constructor() { super("search_svc.AnswerChunk", [ { no: 1, name: "text", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "is_last", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } ]); } } /** * @generated MessageType for protobuf message search_svc.AnswerChunk */ export const AnswerChunk = new AnswerChunk$Type(); // @generated message type with reflection information, may provide speed optimized methods class AnswerCitation$Type extends MessageType<AnswerCitation> { constructor() { super("search_svc.AnswerCitation", [ { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "is_last", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } ]); } } /** * @generated MessageType for protobuf message search_svc.AnswerCitation */ export const AnswerCitation = new AnswerCitation$Type(); // @generated message type with reflection information, may provide speed optimized methods class Link$Type extends MessageType<Link> { constructor() { super("search_svc.Link", [ { no: 1, name: "url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "favicon", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } ]); } } /** * @generated MessageType for protobuf message search_svc.Link */ export const Link = new Link$Type(); // @generated message type with reflection information, may provide speed optimized methods class Image$Type extends MessageType<Image> { constructor() { super("search_svc.Image", [ { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "src", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "link_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 5, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 6, name: "favicon", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } ]); } } /** * @generated MessageType for protobuf message search_svc.Image */ export const Image = new Image$Type(); // @generated message type with reflection information, may provide speed optimized methods class Product$Type extends MessageType<Product> { constructor() { super("search_svc.Product", [ { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "price", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, { no: 5, name: "availability", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 6, name: "currency", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 7, name: "cover_image", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 8, name: "link_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 9, name: "marketplace_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 10, name: "favicon", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } ]); } } /** * @generated MessageType for protobuf message search_svc.Product */ export const Product = new Product$Type(); // @generated message type with reflection information, may provide speed optimized methods class Error$Type extends MessageType<Error> { constructor() { super("search_svc.Error", [ { no: 1, name: "message_", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "route", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } } /** * @generated MessageType for protobuf message search_svc.Error */ export const Error = new Error$Type(); // @generated message type with reflection information, may provide speed optimized methods class AudioSearchNewRequest$Type extends MessageType<AudioSearchNewRequest> { constructor() { super("search_svc.AudioSearchNewRequest", [ { no: 1, name: "session_metadata", kind: "message", T: () => SessionMetadata }, { no: 2, name: "query", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "audio_url", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "audio_data", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ }, { no: 5, name: "audio_type", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } ]); } } /** * @generated MessageType for protobuf message search_svc.AudioSearchNewRequest */ export const AudioSearchNewRequest = new AudioSearchNewRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class AudioSearchNewResponse$Type extends MessageType<AudioSearchNewResponse> { constructor() { super("search_svc.AudioSearchNewResponse", [ { no: 1, name: "session_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "title", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "answer_chunk", kind: "message", T: () => AnswerChunk }, { no: 4, name: "answer_citation", kind: "message", T: () => AnswerCitation }, { no: 5, name: "pp_answer_chunk", kind: "message", T: () => AnswerChunk }, { no: 6, name: "pp_answer_citation", kind: "message", T: () => AnswerCitation }, { no: 7, name: "link", kind: "message", T: () => Link }, { no: 8, name: "image", kind: "message", T: () => Image }, { no: 9, name: "product", kind: "message", T: () => Product }, { no: 10, name: "error", kind: "message", T: () => Error } ]); } } /** * @generated MessageType for protobuf message search_svc.AudioSearchNewResponse */ export const AudioSearchNewResponse = new AudioSearchNewResponse$Type(); /** * @generated ServiceType for protobuf service search_svc.SearchSvc */ export const SearchSvc = new ServiceType("search_svc.SearchSvc", [ { name: "TextSearchNew", serverStreaming: true, options: {}, I: TextSearchNewRequest, O: TextSearchNewResponse }, { name: "AudioSearchNew", serverStreaming: true, options: {}, I: AudioSearchNewRequest, O: AudioSearchNewResponse } ]);