rollbar-backend

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-19 09:56:50 +02:00
parent dbd7365130
commit 17f07f3070
6 changed files with 180 additions and 15 deletions
@@ -30,6 +30,7 @@ const baseUrl = 'https://api.rollbar.com/api/1';
const buildUrl = (url: string) => `${baseUrl}${url}`;
/** @public */
export class RollbarApi {
private projectMap: ProjectMetadataMap | undefined;
@@ -165,6 +166,7 @@ export class RollbarApi {
}
}
/** @public */
export function getRequestHeaders(token: string) {
return {
headers: {
+2 -1
View File
@@ -14,4 +14,5 @@
* limitations under the License.
*/
export { RollbarApi, getRequestHeaders } from './RollbarApi';
export { getRequestHeaders, RollbarApi } from './RollbarApi';
export * from './types';
+12
View File
@@ -16,9 +16,13 @@
// TODO: Make this re-usable with backend
/** @public */
export type RollbarProjectAccessTokenScope = 'read' | 'write';
/** @public */
export type RollbarEnvironment = 'production' | string;
/** @public */
export enum RollbarLevel {
debug = 10,
info = 20,
@@ -27,6 +31,7 @@ export enum RollbarLevel {
critical = 50,
}
/** @public */
export enum RollbarFrameworkId {
'unknown' = 0,
'rails' = 1,
@@ -49,6 +54,7 @@ export enum RollbarFrameworkId {
'rq' = 18,
}
/** @public */
export enum RollbarPlatformId {
'unknown' = 0,
'browser' = 1,
@@ -60,6 +66,7 @@ export enum RollbarPlatformId {
'client' = 7,
}
/** @public */
export type RollbarProject = {
id: number;
name: string;
@@ -67,6 +74,7 @@ export type RollbarProject = {
status: 'enabled' | string;
};
/** @public */
export type RollbarProjectAccessToken = {
projectId: number;
name: string;
@@ -75,6 +83,7 @@ export type RollbarProjectAccessToken = {
status: 'enabled' | string;
};
/** @public */
export type RollbarItem = {
publicItemId: number;
integrationsData: null;
@@ -107,17 +116,20 @@ export type RollbarItem = {
lastResolvedTimestamp: number;
};
/** @public */
export type RollbarItemsResponse = {
items: RollbarItem[];
page: number;
totalCount: number;
};
/** @public */
export type RollbarItemCount = {
timestamp: number;
count: number;
};
/** @public */
export type RollbarTopActiveItem = {
item: {
id: number;
@@ -21,12 +21,14 @@ import { errorHandler } from '@backstage/backend-common';
import { Config } from '@backstage/config';
import { RollbarApi } from '../api';
/** @public */
export interface RouterOptions {
rollbarApi?: RollbarApi;
logger: Logger;
config: Config;
}
/** @public */
export async function createRouter(
options: RouterOptions,
): Promise<express.Router> {