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
@@ -0,0 +1,52 @@
## API Report File for "@backstage/plugin-stack-overflow-backend"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference types="node" />
import { Config } from '@backstage/config';
import { DocumentCollatorFactory } from '@backstage/search-common';
import { IndexableDocument } from '@backstage/search-common';
import { Logger as Logger_2 } from 'winston';
import { Readable } from 'stream';
// @public
export interface StackOverflowDocument extends IndexableDocument {
// (undocumented)
answers: number;
// (undocumented)
tags: string[];
}
// @public
export class StackOverflowQuestionsCollatorFactory
implements DocumentCollatorFactory
{
// (undocumented)
execute(): AsyncGenerator<StackOverflowDocument>;
// (undocumented)
static fromConfig(
config: Config,
options: StackOverflowQuestionsCollatorFactoryOptions,
): StackOverflowQuestionsCollatorFactory;
// (undocumented)
getCollator(): Promise<Readable>;
// (undocumented)
protected requestParams: StackOverflowQuestionsRequestParams;
// (undocumented)
readonly type: string;
}
// @public
export type StackOverflowQuestionsCollatorFactoryOptions = {
baseUrl?: string;
requestParams: StackOverflowQuestionsRequestParams;
logger: Logger_2;
};
// @public
export type StackOverflowQuestionsRequestParams = {
[key: string]: string | string[] | number;
};
```
+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';
+46
View File
@@ -0,0 +1,46 @@
## API Report File for "@backstage/plugin-stack-overflow"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference types="react" />
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { ComponentRenderer } from '@backstage/plugin-home/src/extensions';
import { ReactNode } from 'react';
// @public
export const HomePageStackOverflowQuestions: (
props: ComponentRenderer & {
title?: string | undefined;
} & StackOverflowQuestionsContentProps,
) => JSX.Element;
// @public
export const stackOverflowPlugin: BackstagePlugin<{}, {}>;
// @public
export type StackOverflowQuestion = {
title: string;
link: string;
owner: Record<string, string>;
tags: string[];
answer_count: number;
};
// @public
export type StackOverflowQuestionsContentProps = {
requestParams: StackOverflowQuestionsRequestParams;
};
// @public
export type StackOverflowQuestionsRequestParams = {
[key: string]: string | string[] | number;
};
// @public
export const StackOverflowSearchResultListItem: (props: {
result: any;
icon?: ReactNode;
}) => JSX.Element;
```
+10 -1
View File
@@ -13,9 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Stack Overflow frontend plugin
*
* @packageDocumentation
*/
export {
stackOverflowPlugin,
StackOverflowSearchResultListItem,
HomePageStackOverflowQuestions,
} from './plugin';
export type {
StackOverflowQuestion,
StackOverflowQuestionsContentProps,
StackOverflowQuestionsRequestParams,
} from './types';
+6 -1
View File
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
createPlugin,
createComponentExtension,
@@ -20,6 +21,11 @@ import {
import { createCardExtension } from '@backstage/plugin-home';
import { StackOverflowQuestionsContentProps } from './types';
/**
* The Backstage plugin that holds stack overflow specific components
*
* @public
*/
export const stackOverflowPlugin = createPlugin({
id: 'stack-overflow',
});
@@ -29,7 +35,6 @@ export const stackOverflowPlugin = createPlugin({
*
* @public
*/
export const StackOverflowSearchResultListItem = stackOverflowPlugin.provide(
createComponentExtension({
name: 'StackOverflowResultListItem',
+15
View File
@@ -14,6 +14,11 @@
* limitations under the License.
*/
/**
* Type representing a stack overflow question
*
* @public
*/
export type StackOverflowQuestion = {
title: string;
link: string;
@@ -22,10 +27,20 @@ export type StackOverflowQuestion = {
answer_count: number;
};
/**
* Props for HomePageStackOverflowQuestions
*
* @public
*/
export type StackOverflowQuestionsContentProps = {
requestParams: StackOverflowQuestionsRequestParams;
};
/**
* Type representing the request parameters accepted by the HomePageStackOverflowQuestions component
*
* @public
*/
export type StackOverflowQuestionsRequestParams = {
[key: string]: string | string[] | number;
};