Fix test and module
Signed-off-by: Damon Kaswell <damon.kaswell1@hp.com>
This commit is contained in:
@@ -33,8 +33,8 @@ export type EntityIteratorResult<T> =
|
||||
// @public (undocumented)
|
||||
export class IncrementalCatalogBuilder {
|
||||
// (undocumented)
|
||||
addIncrementalEntityProvider<TCursor, TContext>(
|
||||
provider: IncrementalEntityProvider<TCursor, TContext>,
|
||||
addIncrementalEntityProvider<TCursor, TContext, TInput>(
|
||||
provider: IncrementalEntityProvider<TCursor, TContext, TInput>,
|
||||
options: IncrementalEntityProviderOptions,
|
||||
): void;
|
||||
// (undocumented)
|
||||
@@ -48,8 +48,16 @@ export class IncrementalCatalogBuilder {
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface IncrementalEntityProvider<TCursor, TContext> {
|
||||
export interface IncrementalEntityProvider<TCursor, TContext, TInput = null> {
|
||||
around(burst: (context: TContext) => Promise<void>): Promise<void>;
|
||||
deltaMapper?: (payload: TInput) => {
|
||||
delta:
|
||||
| {
|
||||
added: DeferredEntity[];
|
||||
removed: DeferredEntity[];
|
||||
}
|
||||
| undefined;
|
||||
};
|
||||
getProviderName(): string;
|
||||
next(
|
||||
context: TContext,
|
||||
@@ -70,7 +78,7 @@ export interface IncrementalEntityProviderOptions {
|
||||
// @alpha
|
||||
export const incrementalIngestionEntityProviderCatalogModule: (options: {
|
||||
providers: {
|
||||
provider: IncrementalEntityProvider<unknown, unknown>;
|
||||
provider: IncrementalEntityProvider<unknown, unknown, unknown>;
|
||||
options: IncrementalEntityProviderOptions;
|
||||
}[];
|
||||
}) => BackendFeature;
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import { incrementalIngestionEntityProviderCatalogModule } from './incrementalIn
|
||||
|
||||
describe('bitbucketServerEntityProviderCatalogModule', () => {
|
||||
it('should register provider at the catalog extension point', async () => {
|
||||
const provider1: IncrementalEntityProvider<number, {}> = {
|
||||
const provider1: IncrementalEntityProvider<number, {}, unknown> = {
|
||||
getProviderName: () => 'provider1',
|
||||
around: burst => burst(0),
|
||||
next: async (cursor, _context) => {
|
||||
|
||||
@@ -36,7 +36,7 @@ import {
|
||||
incrementalIngestionEntityProviderCatalogModule,
|
||||
} from '.';
|
||||
|
||||
const provider: IncrementalEntityProvider<number, {}> = {
|
||||
const provider: IncrementalEntityProvider<number, {}, unknown> = {
|
||||
getProviderName: () => 'test-provider',
|
||||
around: burst => burst(0),
|
||||
next: async (_context, cursor) => {
|
||||
|
||||
Reference in New Issue
Block a user