Address comments and suggestions
- Added documentation for api-report.md - Reverted the change to ADOPTERS.md Signed-off-by: Karan Shah <karan.shah@simplybusiness.co.uk>
This commit is contained in:
@@ -15,12 +15,27 @@
|
||||
*/
|
||||
import { Config } from '@backstage/config';
|
||||
|
||||
/**
|
||||
* The Airbrake config object
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type AirbrakeConfig = {
|
||||
/**
|
||||
* The API Key
|
||||
*/
|
||||
apiKey: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Extract the Airbrake config from a config object
|
||||
*
|
||||
* @public
|
||||
*
|
||||
* @param config - The config object to extract from
|
||||
*/
|
||||
export function extractAirbrakeConfig(config: Config): AirbrakeConfig {
|
||||
return {
|
||||
apiKey: config.getString('integrations.airbrake.apiKey'),
|
||||
apiKey: config.getString('airbrake.apiKey'),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -14,4 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The Airbrake Backend plugin used by \@backstage/plugin-airbrake
|
||||
*
|
||||
* @packageDocumentation
|
||||
*/
|
||||
|
||||
export * from './service/router';
|
||||
export * from './config';
|
||||
|
||||
@@ -22,11 +22,30 @@ import { createProxyMiddleware } from 'http-proxy-middleware';
|
||||
import { AirbrakeConfig } from '../config';
|
||||
import { Options } from 'http-proxy-middleware/dist/types';
|
||||
|
||||
/**
|
||||
* The router options that are needed when creating a router.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface RouterOptions {
|
||||
/**
|
||||
* A logger object
|
||||
*/
|
||||
logger: Logger;
|
||||
|
||||
/**
|
||||
* The Airbrake config obtained from {@link extractAirbrakeConfig}
|
||||
*/
|
||||
airbrakeConfig: AirbrakeConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mainly used internally to generate the path.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @param options - Router options
|
||||
*/
|
||||
export const generateAirbrakePathRewrite = (
|
||||
options: RouterOptions,
|
||||
): Options['pathRewrite'] => {
|
||||
@@ -43,6 +62,13 @@ export const generateAirbrakePathRewrite = (
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Create the Airbrake Router, used for making API calls to the Airbrake API.
|
||||
*
|
||||
* @public
|
||||
*
|
||||
* @param options - Router options
|
||||
*/
|
||||
export async function createRouter(
|
||||
options: RouterOptions,
|
||||
): Promise<express.Router> {
|
||||
|
||||
Reference in New Issue
Block a user