fix tests

Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
Paul Schultz
2024-12-16 17:27:35 -06:00
parent ba53aa668e
commit 6c813e1b3b
3 changed files with 52 additions and 60 deletions
+44 -58
View File
@@ -7,7 +7,6 @@ import type { AuditorCreateEvent } from '@backstage/backend-plugin-api';
import type { AuditorEventSeverityLevel } from '@backstage/backend-plugin-api';
import { AuditorService } from '@backstage/backend-plugin-api';
import type { AuthService } from '@backstage/backend-plugin-api';
import type { Config } from '@backstage/config';
import type { Format } from 'logform';
import type { HttpAuthService } from '@backstage/backend-plugin-api';
import type { JsonObject } from '@backstage/types';
@@ -16,31 +15,6 @@ import type { Request as Request_2 } from 'express';
import { ServiceFactory } from '@backstage/backend-plugin-api';
import * as winston from 'winston';
// @public
export class Auditor implements AuditorService {
// (undocumented)
addRedactions(redactions: Iterable<string>): void;
// (undocumented)
child(
meta: JsonObject,
deps?: {
auth?: AuthService;
httpAuth?: HttpAuthService;
plugin?: PluginMetadataService;
},
): AuditorService;
static colorFormat(): Format;
static create(options?: AuditorOptions): Auditor;
// (undocumented)
createEvent<TMeta extends JsonObject>(
options: Parameters<AuditorCreateEvent<TMeta>>[0],
): ReturnType<AuditorCreateEvent<TMeta>>;
static redacter(): {
format: Format;
add: (redactions: Iterable<string>) => void;
};
}
// @public
export type AuditorEvent = [
eventId: string,
@@ -93,46 +67,58 @@ export type AuditorEventStatus<TError extends Error = Error> =
}
));
// @public
export interface AuditorFactoryOptions {
// (undocumented)
format: (config?: Config) => winston.Logform.Format;
// (undocumented)
transports: (config?: Config) => winston.transport[];
}
// @public
export const auditorFieldFormat: Format;
// @public (undocumented)
export interface AuditorOptions {
// (undocumented)
auth?: AuthService;
// (undocumented)
format?: Format;
// (undocumented)
httpAuth?: HttpAuthService;
// (undocumented)
meta?: JsonObject;
// (undocumented)
plugin?: PluginMetadataService;
// (undocumented)
transports?: winston.transport[];
}
// @public (undocumented)
export const auditorServiceFactory: ((
options?: AuditorFactoryOptions,
) => ServiceFactory<AuditorService, 'plugin', 'singleton'>) &
ServiceFactory<AuditorService, 'plugin', 'singleton'>;
// @public
export const auditorServiceFactory: ServiceFactory<
AuditorService,
'plugin',
'singleton'
>;
// @public
export const auditorServiceFactoryWithOptions: (
options?: AuditorFactoryOptions,
) => ServiceFactory<AuditorService, 'plugin', 'singleton'>;
export class DefaultAuditorService implements AuditorService {
static create(
impl: DefaultRootAuditorService,
deps: {
auth: AuthService;
httpAuth: HttpAuthService;
plugin: PluginMetadataService;
},
): DefaultAuditorService;
// (undocumented)
createEvent<TMeta extends JsonObject>(
options: Parameters<AuditorCreateEvent<TMeta>>[0],
): ReturnType<AuditorCreateEvent<TMeta>>;
}
// @public (undocumented)
export const defaultProdFormat: Format;
// @public (undocumented)
export class DefaultRootAuditorService {
static colorFormat(): Format;
static create(options?: RootAuditorOptions): DefaultRootAuditorService;
// (undocumented)
forPlugin(deps: {
auth: AuthService;
httpAuth: HttpAuthService;
plugin: PluginMetadataService;
}): AuditorService;
// (undocumented)
log(auditEvent: AuditorEvent): Promise<void>;
}
// @public (undocumented)
export interface RootAuditorOptions {
// (undocumented)
format?: Format;
// (undocumented)
meta?: JsonObject;
// (undocumented)
transports?: winston.transport[];
}
// (No @packageDocumentation comment for this package)
```
@@ -3,8 +3,10 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference types="express" />
/// <reference types="jest" />
/// <reference types="node" />
/// <reference types="qs" />
import { AuditorService } from '@backstage/backend-plugin-api';
import { AuthService } from '@backstage/backend-plugin-api';
@@ -35,7 +35,7 @@ import { LocationAnalyzer } from '@backstage/plugin-catalog-node';
import express from 'express';
import yn from 'yn';
import { z } from 'zod';
import { EntitiesCatalog } from '../catalog/types';
import { Cursor, EntitiesCatalog } from '../catalog/types';
import { CatalogProcessingOrchestrator } from '../processing/types';
import { validateEntityEnvelope } from '../processing/util';
import { createOpenApiRouter } from '../schema/openapi';
@@ -50,7 +50,11 @@ import {
import { parseEntityFacetParams } from './request/parseEntityFacetParams';
import { parseEntityOrderParams } from './request/parseEntityOrderParams';
import { parseEntityPaginationParams } from './request/parseEntityPaginationParams';
import { writeEntitiesResponse, writeSingleEntityResponse } from './response';
import {
createEntityArrayJsonStream,
writeEntitiesResponse,
writeSingleEntityResponse,
} from './response';
import { LocationService, RefreshService } from './types';
import {
disallowReadonlyMode,