add api reports

Signed-off-by: Emma Indal <emma.indahl@gmail.com>
This commit is contained in:
Emma Indal
2022-03-04 14:29:58 +01:00
parent 7c13bcbc30
commit 140cf15341
8 changed files with 160 additions and 7 deletions
+7 -1
View File
@@ -14,4 +14,10 @@
* limitations under the License.
*/
export { StackOverflowQuestionsCollatorFactory } from './search';
/**
* Stack Overflow backend plugin
*
* @packageDocumentation
*/
export * from './search';
@@ -24,21 +24,41 @@ import fetch from 'cross-fetch';
import qs from 'qs';
import { Logger } from 'winston';
interface StackOverflowDocument extends IndexableDocument {
/**
* Extended IndexableDocument with stack overflow specific properties
*
* @public
*/
export interface StackOverflowDocument extends IndexableDocument {
answers: number;
tags: string[];
}
type StackOverflowQuestionsRequestParams = {
/**
* Type representing the request parameters accepted by the {@link StackOverflowQuestionsCollatorFactory}
*
* @public
*/
export type StackOverflowQuestionsRequestParams = {
[key: string]: string | string[] | number;
};
type StackOverflowQuestionsCollatorFactoryOptions = {
/**
* Options for {@link StackOverflowQuestionsCollatorFactory}
*
* @public
*/
export type StackOverflowQuestionsCollatorFactoryOptions = {
baseUrl?: string;
requestParams: StackOverflowQuestionsRequestParams;
logger: Logger;
};
/**
* Search collator responsible for collecting stack overflow questions to index.
*
* @public
*/
export class StackOverflowQuestionsCollatorFactory
implements DocumentCollatorFactory
{
@@ -14,4 +14,4 @@
* limitations under the License.
*/
export { StackOverflowQuestionsCollatorFactory } from './StackOverflowQuestionsCollatorFactory';
export * from './StackOverflowQuestionsCollatorFactory';