UNPKG

cnpmcore

Version:

Private NPM Registry for Enterprise

17 lines (16 loc) 827 B
import { type ImplDecorator, Logger, HttpClient } from 'egg'; import type { RegistryType } from '../../../common/enum/Registry.ts'; import type { Registry } from '../../../core/entity/Registry.ts'; export declare const CHANGE_STREAM_ATTRIBUTE = "CHANGE_STREAM_ATTRIBUTE"; export interface ChangesStreamChange { seq: string; fullname: string; } export declare abstract class AbstractChangeStream { protected logger: Logger; protected httpClient: HttpClient; abstract getInitialSince(registry: Registry): Promise<string>; abstract fetchChanges(registry: Registry, since: string): AsyncGenerator<ChangesStreamChange>; getChangesStreamUrl(registry: Registry, since: string, limit?: number): string; } export declare const RegistryChangesStream: ImplDecorator<AbstractChangeStream, typeof RegistryType>;