UNPKG

@nullplatform/ingest

Version:

Client SDK for the nullplatform ingest API: push snapshots and delta events from a collector into the catalog and other targets, follow runs, replay and drift checks

1,417 lines • 52.5 kB
//#region src/enums.d.ts
/**
 * The API's closed vocabularies, as runtime enums: write `Engine.JSONATA`,
 * never `'jsonata'`. The values are what the wire carries.
 */
/** What a full run deletes when it finalizes: what it no longer saw, or nothing. */
declare enum DeletePolicy {
  SOFT_DELETE_STALE = "soft_delete_stale",
  NONE = "none"
}
/** Where a run is: open, finalizing, or closed (completed, its guard tripped, or aborted). */
declare enum RunStatus {
  OPEN = "open",
  FINALIZING = "finalizing",
  COMPLETED = "completed",
  GUARD_TRIPPED = "guard_tripped",
  ABORTED = "aborted"
}
/** Where an input is: waiting to be applied, or settled (applied, rejected, dropped, dead). */
declare enum InputStatus {
  PENDING = "pending",
  APPLIED = "applied",
  REJECTED = "rejected",
  DROPPED = "dropped",
  DEAD = "dead"
}
/** What became of an input, or of one entity it named. */
declare enum Outcome {
  CREATED = "created",
  UPDATED = "updated",
  UNCHANGED = "unchanged",
  FILTERED = "filtered",
  DELETED = "deleted",
  SKIPPED = "skipped",
  STALE = "stale",
  REJECTED = "rejected",
  FAILED = "failed",
  /** A parent the source has not written yet (a target that assigns ids): tried again. */
  WAITING = "waiting"
}
/** How a source came to own an entity: created by ingest, or adopted (already in the target). */
declare enum EntityOrigin {
  CREATED = "created",
  ADOPTED = "adopted"
}
/** What an event does to its entity: writes it (`UPSERT`, the default) or deletes it. */
declare enum EventOp {
  UPSERT = "upsert",
  DELETE = "delete"
}
/** The expression language of a mapping. */
declare enum Engine {
  JSONATA = "jsonata",
  JQ = "jq",
  CEL = "cel"
}
/** What a drift check does: reports what differs, or writes back what was last written. */
declare enum DriftPolicy {
  REPORT = "report",
  RESTORE = "restore"
}
/** Where a drift check is: queued, running, or done (completed, failed). */
declare enum DriftCheckStatus {
  QUEUED = "queued",
  RUNNING = "running",
  COMPLETED = "completed",
  FAILED = "failed"
}
/** How a drift check found an entity: changed in the target, or gone from it. */
declare enum DriftType {
  CHANGED = "changed",
  MISSING = "missing"
}
/** Where a replay is: queued, queueing its inputs a page at a time, or done (completed, failed). */
declare enum ReplayStatus {
  QUEUED = "queued",
  RUNNING = "running",
  COMPLETED = "completed",
  FAILED = "failed"
}
/** What a source type revision records. */
declare enum SourceTypeRevisionAction {
  CREATE = "create",
  UPDATE = "update",
  DELETE = "delete"
}
/** What a source revision records. */
declare enum SourceRevisionAction {
  CREATE = "create",
  UPDATE = "update",
  DELETE = "delete"
}
/** What a mapping revision records. */
declare enum MappingRevisionAction {
  CREATE = "create",
  UPDATE = "update",
  DELETE = "delete"
}
/** What a destination revision records. */
declare enum DestinationRevisionAction {
  CREATE = "create",
  UPDATE = "update",
  DELETE = "delete"
}
/**
 * What happens to the entities a destination wrote when it stops applying to a
 * source (deleted, disabled, or moved to another endpoint), in the words of a
 * foreign key: `RESTRICT` refuses while it owns live ones, `CASCADE` leaves
 * them to the next full run (deleted behind its guards), `SET_NULL` releases
 * them (they stay in the target, no longer owned).
 */
declare enum OnDelete {
  RESTRICT = "restrict",
  CASCADE = "cascade",
  SET_NULL = "set_null"
}
/** What an upsert did with one spec (`sources.upsert`, `mappings.upsertForSource`…). */
declare enum UpsertOutcome {
  /** It was missing: created (a deleted one revived). */
  CREATED = "created",
  /** It differed: what differs was written. */
  UPDATED = "updated",
  /** It matched: nothing was sent. */
  UNCHANGED = "unchanged"
}
/** What `runs.open` does when the source already has an open run. */
declare enum OnConflict {
  /** Abort the open run (it deletes nothing) and open a new one. */
  ABORT = "abort",
  /** Throw the 409. */
  FAIL = "fail"
}
/** Who assigns an entity's identity at an endpoint's backend (`identity.assignedBy`). */
declare enum AssignedBy {
  /** The source: the writer's key addresses the entity, and a write is an upsert by key. */
  SOURCE = "source",
  /** The backend, at create: an entity is found again by its natural key. */
  BACKEND = "backend"
}
/** How a list call of an endpoint's backend pages (`calls.paging`). */
declare enum PagingStyle {
  OFFSET = "offset",
  PAGE = "page",
  CURSOR = "cursor",
  LINK = "link"
}
/** The HTTP method of an endpoint's call (`EndpointCall.method`). */
declare enum HttpMethod {
  GET = "GET",
  POST = "POST",
  PATCH = "PATCH",
  PUT = "PUT",
  DELETE = "DELETE"
}
/** An endpoint's calls by name (`calls.<name>`, an error rule's `operation`). */
declare enum OperationName {
  UPSERT = "upsert",
  CREATE = "create",
  UPDATE = "update",
  READ = "read",
  DELETE = "delete",
  FIND = "find",
  LINK = "link",
  UNLINK = "unlink"
}
/** What a call sends when its body names a shape (`EndpointCall.body`) rather than a template or an expression. */
declare enum OperationBody {
  /** The entity's document. */
  DOCUMENT = "document",
  /** A link set as objects (`[{ id }]`). */
  LINK_OBJECTS = "link_objects",
  /** A link set as ids. */
  LINK_IDS = "link_ids"
}
/** What an emptied link set becomes (`calls.link.emptySet`). */
declare enum EmptyLinkSet {
  /** The empty set is sent. */
  REPLACE = "replace",
  /** Each link is removed by an `unlink` call (a backend that refuses an empty set). */
  UNLINK_EACH = "unlink_each"
}
/** What may be written to a field (`fields[f].write`). */
declare enum FieldRule {
  /** Sent on create only. */
  CREATE_ONLY = "create_only",
  /** Never changes once created: a change is refused. */
  IMMUTABLE = "immutable",
  /** Sent on update only. */
  UPDATE_ONLY = "update_only"
}
/** How a drift check compares a field (`fields[f].drift`). */
declare enum FieldComparison {
  EQUAL = "equal",
  /** What was written is contained in what the backend holds. */
  SUBSET = "subset",
  IGNORE = "ignore"
}
/** Whether ingest may delete at an endpoint (`behavior.delete`). */
declare enum TargetDeletePolicy {
  ALLOWED = "allowed",
  /** Finalize and delete events never delete there. */
  FORBIDDEN = "forbidden"
}
/** What a field removed from a document becomes (`behavior.clear`). */
declare enum ClearSemantics {
  /** It is written as `null`. */
  WRITE_NULL = "write_null",
  /** The backend cannot clear it: a removal is refused. */
  UNSUPPORTED = "unsupported"
}
/** What ingest does with an entity it finds already in the backend (`behavior.adopt`). */
declare enum AdoptPolicy {
  /** Leaves it alone. */
  NONE = "none",
  /** Updates it. */
  UPDATE = "update",
  /** Updates it and deletes it when the source stops reporting it. */
  MANAGE = "manage"
}
/** What a backend's refusal means (`errors[].outcome`). */
declare enum TargetErrorOutcome {
  RETRY = "retry",
  REJECT = "reject",
  /** The entity is already there. */
  EXISTS = "exists",
  /** The entity is gone. */
  GONE = "gone",
  /** Not ready yet: tried again later without spending attempts. */
  WAIT = "wait"
}
//#endregion
//#region src/types.d.ts
/** The page a list answered: what was asked for, with the API's defaults applied. */
interface Paging {
  limit: number;
  offset: number;
}
/**
 * The envelope of every list endpoint. There is no total: when `results` is
 * as long as `paging.limit`, ask for the next page (`offset + limit`).
 */
/** A resource as an upsert answers it: as it is now, and what the upsert did with its spec. */
type Upserted<Resource> = Resource & {
  upserted: UpsertOutcome;
};
interface Page<Item> {
  paging: Paging;
  results: Item[];
}
/** Which page of a list to read. */
interface PageOptions {
  /** Results per page: a positive integer (the API defaults to 100 and caps it at 1000). */
  limit?: number;
  /** Results to skip: a non-negative integer. Default 0. */
  offset?: number;
}
/** A source: one system of record (a cluster, an account), the unit of ownership of what it writes. */
interface Source {
  /** UUIDv7, assigned by the API. */
  id: string;
  /** The caller's name for the source, unique in the organization. */
  slug: string;
  name: string;
  /** Its source type, by slug (`sourceTypes.list()`) and by id; set once. */
  type: string;
  typeId: string;
  /**
   * Where the source lives (`organization=1:account=2`): every action on it,
   * and on what is under it, is authorized at this NRN. Set when it is
   * created, never changed.
   */
  nrn: string;
  description: string | null;
  /** The organization's own data about the source, read by mappings as `$source.attributes`. */
  attributes: Record<string, unknown>;
  /**
   * What applies: its type's run settings, overlaid by the ones it sets. Which
   * it sets itself is a diff with its type's (`sourceTypes.get(typeId)`).
   */
  runs: RunSettings;
  /** Counts its writes: the revision its last change made (`sources.revisions`). */
  revision: number;
  createdAt: string;
  updatedAt: string;
  /** Set once the source is deleted (soft delete); creating its slug again revives it. */
  deletedAt: string | null;
}
/**
 * One write of a resource, as every history answers it (`…revisions`): the
 * write's own fields, and the resource as the write left it under `snapshot`
 * (a delete's: as it was deleted).
 */
interface Revision<Action extends string, Snapshot extends {
  id: string;
}> {
  /** The revision's own id (UUIDv7, the API's); the resource's is `snapshot.id`. */
  id: string;
  /** The resource's count: 1, 2, 3… for each write. */
  revision: number;
  action: Action;
  changedBy: string;
  changedAt: string;
  snapshot: Snapshot;
}
/** A write of a source: who, when, and what it set itself then. */
type SourceRevision = Revision<SourceRevisionAction, {
  id: string;
  name: string;
  description: string | null;
  attributes: Record<string, unknown>;
  /** The run settings the source set itself then: every setting, `null` where its type's applied. */
  runs: OwnRunSettings;
}>;
/**
 * How a source's snapshot runs behave. A source is fed by a backfill run (and
 * an occasional resync run), then by events as changes happen: these settings
 * apply to runs only; a delete event deletes at once.
 */
interface RunSettings {
  /** An open run not finalized within this many seconds is aborted. */
  ttlSeconds: number;
  /** `DeletePolicy.SOFT_DELETE_STALE`: finalize deletes what the run did not report; `DeletePolicy.NONE`: it never deletes. */
  deletePolicy: DeletePolicy;
  /** Finalize refuses to delete when `stale / (stale + seen)` reaches it (`1` never refuses, `0` never deletes). */
  maxDeleteRatio: number;
  /** A run that reported nothing never deletes anything. */
  rejectEmpty: boolean;
  /**
   * Record types left out of the delete guards: their stale entities are
   * deleted but not counted; for types that expire by design, like
   * Kubernetes events.
   */
  unguardedTypes: string[];
}
/**
 * The run settings a source sets itself, as the API answers them and a write
 * takes them: every setting, `null` where its type's applies.
 */
type OwnRunSettings = { [Setting in keyof RunSettings]: RunSettings[Setting] | null; };
/** `GET /sources/{id}/stats`: the source at a glance. */
interface SourceStats {
  /** Inputs waiting to be applied. */
  pending: number;
  /** Age of the oldest waiting input; null when nothing waits. */
  oldestPendingSeconds: number | null;
  /** When the newest input arrived (queued or settled); null when none is kept. */
  lastInputAt: string | null;
  /** The newest run, whatever its status. */
  lastRun: Run | null;
  /** Inputs settled since `since` (24 hours by default), every status and outcome present. */
  settled: {
    since: string;
    total: number;
    byStatus: Record<Exclude<InputStatus, InputStatus.PENDING>, number>;
    byOutcome: Record<Outcome, number>;
  };
}
/**
 * Body of `POST /sources`. Its type is named by slug (`type`, what a collector
 * knows, the same in every organization) or by id (`typeId`): exactly one.
 */
type SourceSpec$1 = SourceFields & NamedBy<'type', 'typeId'>;
/** A source as `sources.upsert` takes it: its slug is the key it is found by. */
type SourceUpsertSpec = SourceSpec$1 & {
  slug: string;
};
/** What a source is created with, besides its type. */
interface SourceFields {
  /** Derived from the name when left out (`Prod EU` → `prod_eu`); never changes after. */
  slug?: string;
  name: string;
  /** An NRN within the caller's organization; the organization's root by default. */
  nrn?: string;
  description?: string | null;
  /** The organization's own data about the source, read by mappings as `$source.attributes`. */
  attributes?: Record<string, unknown>;
  /** The settings it sets itself; the rest are its type's. */
  runs?: Partial<RunSettings>;
}
/**
 * Body of `PATCH /sources/{id}`: at least one field. `attributes` is replaced
 * whole; in `runs`, the settings named are set, and one set to `null` is its
 * type's again. The slug, the type and the NRN cannot change.
 */
interface SourcePatch {
  name?: string;
  description?: string | null;
  attributes?: Record<string, unknown>;
  runs?: { [Setting in keyof RunSettings]?: RunSettings[Setting] | null; };
}
/** Query of `GET /sources`. */
interface SourceFilter extends PageOptions {
  slug?: string;
  /** `slug` (the default), `createdAt` or `updatedAt`. */
  sort?: Sort<'slug' | 'createdAt' | 'updatedAt'>;
  /** The deleted sources instead of the live ones (their history stays readable). */
  deleted?: boolean;
  /** Only the sources at this NRN or beneath it (the organization's root by default, checked there). */
  nrn?: string;
}
/** A kind of system sources are of: nullplatform's (such as `kubernetes`) or the organization's own. */
interface SourceType {
  id: string;
  slug: string;
  name: string;
  description: string | null;
  /** What a source of the type has unless it sets its own: every setting. */
  runs: RunSettings;
  /** Counts its writes: the revision its last change made (`sourceTypes.revisions`). */
  revision: number;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
}
/** A write of a source type: who, when, and what it became. */
type SourceTypeRevision = Revision<SourceTypeRevisionAction, {
  id: string;
  name: string;
  description: string | null;
  runs: RunSettings;
}>;
/** Body of `POST /source_types`: the organization's own type (`global` is nullplatform's). */
interface SourceTypeSpec {
  /** Derived from the name when left out (`GitHub Enterprise` → `github_enterprise`); never changes after. */
  slug?: string;
  name: string;
  description?: string | null;
  /** The settings left out take the configured defaults. */
  runs?: Partial<RunSettings>;
  global?: boolean;
}
/** Body of `PATCH /source_types/{id}`: at least one field; the slug cannot change. */
type SourceTypePatch = Partial<Omit<SourceTypeSpec, 'slug' | 'global'>>;
/** A type as `sourceTypes.upsert` takes it: its slug is the key it is found by. */
type SourceTypeUpsertSpec = Omit<SourceTypeSpec, 'global'> & {
  slug: string;
};
/** Query of `GET /source_types`. */
interface SourceTypeFilter extends PageOptions {
  slug?: string;
}
/**
 * How a record of a type becomes entities: the definition only. Where the
 * entities are written is a destination's (`destinations`). Owned by a source
 * type (nullplatform's when `global`, or the organization's) or by one source.
 */
interface Mapping {
  /** UUIDv7, assigned by the API. */
  id: string;
  /** Its name under its owner; the record type by default. */
  slug: string;
  typeId: string;
  /** Set when the mapping is one source's own. */
  sourceId: string | null;
  recordType: string;
  engine: Engine;
  expression: string;
  /** Counts the mapping's own writes: the revision its last change made, what a destination may pin. */
  revision: number;
  createdAt: string;
  updatedAt: string;
  /** Set once the mapping is deleted (soft delete); creating its slug again revives it. */
  deletedAt: string | null;
}
/** Body of `POST /sources/{id}/mappings` (and of a type's, with `global`). */
interface MappingCreate {
  /** The record type by default. */
  slug?: string;
  recordType: string;
  engine: Engine;
  expression: string;
}
/** Body of `POST /source_types/{id}/mappings`: the organization's, or with `global` nullplatform's. */
type TypeMappingCreate = MappingCreate & {
  global?: boolean;
};
/** Body of `PATCH /mappings/{id}`: the definition. A patch that changes nothing writes nothing. */
interface MappingPatch {
  engine?: Engine;
  expression?: string;
}
/** Query of `GET /sources/{id}/mappings` and `GET /source_types/{id}/mappings`. */
interface MappingFilter extends PageOptions {
  /** One record type, or any of several. */
  recordType?: string | string[];
  /** One slug, or any of several. */
  slug?: string | string[];
  /** `recordType` (the default), `createdAt` or `updatedAt`. */
  sort?: Sort<'recordType' | 'createdAt' | 'updatedAt'>;
}
/** One change to a mapping: its definition then (`create`, `update`, or as it was deleted), who and when. */
type MappingRevision = Revision<MappingRevisionAction, {
  id: string;
  engine: Engine;
  expression: string;
}>;
/** A record a preview evaluates the mapping on: sent as `payload`, or a stored input of the preview's source. */
type MappingSample = {
  payload: unknown;
} | {
  inputId: string;
};
/** How a mapping is written: `dryRun` checks the write as it would be made and makes nothing. */
interface MappingWriteOptions {
  dryRun?: boolean;
}
/**
 * Body of `POST /mapping_previews`: what to evaluate, as which source, on
 * what. A stored mapping (`mappingId`), a definition not written yet
 * (`definition` with its `recordType`, of `typeId` or of the source's type),
 * or a stored mapping changed by `definition`.
 */
type MappingPreviewSpec = {
  definition?: {
    recordType?: string;
    engine: Engine;
    expression: string;
  };
  sample: MappingSample;
} & MaybeNamedBy<'mapping', 'mappingId'> & MaybeNamedBy<'type', 'typeId'> & MaybeNamedBy<'source', 'sourceId'>;
/**
 * What a mapping makes of a sample: what was evaluated, in the format it is
 * asked for (the definition that ran and the sample as sent), then its output
 * and what each endpoint would say.
 */
interface MappingPreview {
  /** The stored mapping evaluated; null for a definition not written yet. */
  mappingId: string | null;
  typeId: string;
  sourceId: string | null;
  /** The definition that ran: the stored mapping's, or the one sent. */
  definition: {
    recordType: string;
    engine: Engine;
    expression: string;
  };
  /** The sample evaluated: its payload always, and the stored input it was read from (or null). */
  sample: {
    payload: unknown;
    inputId: string | null;
  };
  output: unknown;
  entities: {
    id: string;
    data: Record<string, unknown>;
  }[];
  filtered: boolean;
  errors: string[];
  /** Per entity and per endpoint the mapping is bound to for the sample's source. */
  validation: {
    externalId: string;
    target: string;
    targetId: string;
    endpoint: string;
    endpointId: string;
    valid: boolean;
    errors: string[];
  }[];
  warnings: string[];
}
/**
 * Where a mapping is written: an endpoint of a target, for every source of the
 * mapping's type in the organization (`sourceId` null) or for one source. A
 * source applies its own and the organization's; two of the same record type
 * and endpoint collapse to the source's own.
 */
interface Destination {
  id: string;
  mappingId: string;
  /** The mapping's slug, as it is now. */
  mapping: string;
  /** A revision of the mapping it runs; null: the latest. */
  mappingRevision: number | null;
  sourceId: string | null;
  typeId: string;
  recordType: string;
  target: string;
  targetId: string;
  endpoint: string;
  endpointId: string;
  enabled: boolean;
  onDelete: OnDelete;
  revision: number;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
}
/**
 * One destination as written: the mapping it binds and where it writes. Its
 * owner (a source, or every source of a type) is the route it is created at.
 */
type DestinationSpec = {
  mappingRevision?: number | null;
  enabled?: boolean;
  onDelete?: OnDelete;
} & NamedBy<'mapping', 'mappingId'> & NamedBy<'target', 'targetId'> & NamedBy<'endpoint', 'endpointId'>;
/**
 * A resource a request names by its slug (`Slug`) or by its id (`Id`),
 * exactly one: what the API stores is the id either way.
 */
type NamedBy<Slug extends string, Id extends string, Value = string> = ({ [Key in Slug]: Value; } & { [Key in Id]?: never; }) | ({ [Key in Id]: Value; } & { [Key in Slug]?: never; });
/**
 * Like `NamedBy`, or neither: a name a request may leave out (a filter, a
 * preview's). A filter that takes several (`Value` `string | string[]`)
 * names any of them, still by slug or by id.
 */
type MaybeNamedBy<Slug extends string, Id extends string, Value = string> = NamedBy<Slug, Id, Value> | ({ [Key in Slug]?: never; } & { [Key in Id]?: never; });
/** Body of `PATCH /destinations/{id}`. */
interface DestinationPatch {
  /** The endpoint, within its target: by slug, or by id (`endpointId`), not both. */
  endpoint?: string;
  endpointId?: string;
  mappingRevision?: number | null;
  enabled?: boolean;
  onDelete?: OnDelete;
}
/** Query of a list of destinations: what narrows it, each by slug or by id. */
type DestinationFilter = PageOptions & MaybeNamedBy<'mapping', 'mappingId', string | string[]> & MaybeNamedBy<'target', 'targetId'> & MaybeNamedBy<'endpoint', 'endpointId'> & {
  /** One record type, or any of several. */
  recordType?: string | string[];
};
/** Query of `GET /sources/{sourceId}/destinations`. */
type SourceDestinationFilter = DestinationFilter & {
  /**
   * `true` (the default): what the source applies, its own destinations and
   * its organization's of its type, after shadowing (a source's own shadows the
   * organization's of the same record type, target and endpoint). `false`: the
   * source's own destinations only.
   */
  effective?: boolean;
};
/** One change to a destination: what it was bound to and how, then. */
type DestinationRevision = Revision<DestinationRevisionAction, {
  id: string;
  mappingId: string;
  mappingRevision: number | null;
  targetId: string;
  endpointId: string;
  enabled: boolean;
  onDelete: OnDelete;
}>;
/** What a run's inputs came to so far, by outcome. */
interface RunCounters {
  received: number;
  filtered: number;
  created: number;
  updated: number;
  unchanged: number;
  deleted: number;
  skipped: number;
  dropped: number;
  rejected: number;
  failed: number;
}
/** What a finalize assessed: what the run saw, what was stale, what was deleted, and whether a guard tripped. */
interface RunReconciliation {
  seen: number;
  stale: number;
  deleted: number;
  guardTripped: boolean;
  guardReason: string | null;
  dryRun: boolean;
}
/** What `runs.finalize` sends (`PATCH /runs/{run_id}` with `status: finalizing`): overrides the source's guards for one call. */
interface FinalizeOptions {
  /** Report what would be deleted and keep the run open. */
  dryRun?: boolean;
  /** Reconcile even if some inputs of the run failed. */
  allowFailures?: boolean;
  /**
   * Reconcile even if some inputs were rejected before naming their entities
   * (an unmappable record: its entity could be deleted as unreported).
   */
  allowRejections?: boolean;
  /**
   * Largest share of the source's entities this finalize may delete (0–1):
   * overrides the source's guard, so the caller needs `ingest:source:write`.
   */
  maxDeleteRatio?: number;
}
/** Query of `GET /sources/{id}/runs`. */
interface RunFilter extends PageOptions {
  status?: RunStatus;
  /** `createdAt` (newest first by default). */
  sort?: Sort<'createdAt'>;
}
/** A run: one complete listing of a source (a backfill or a resync), reconciled when it is finalized. */
interface Run {
  id: string;
  sourceId: string;
  status: RunStatus;
  /** Record types the run covers; null means every type the source maps. */
  types: string[] | null;
  counters: RunCounters;
  /** Inputs of the run not yet applied. */
  pending: number;
  /**
   * What finalize found and did. While the run is `finalizing` it shows what
   * was assessed and how many are `deleted` so far (the API deletes a page a
   * turn); final once the run is closed.
   */
  reconciliation: RunReconciliation | null;
  /** The finalize asked for: the options `runs.finalize` sent (the same shape), a dry run or not, and when. */
  finalize: {
    dryRun: boolean;
    allowFailures: boolean;
    allowRejections: boolean;
    maxDeleteRatio: number | null;
    requestedAt: string;
  } | null;
  /** Why the run closed without reconciling (aborted, expired, source gone). */
  closeReason: string | null;
  expiresAt: string;
  createdAt: string;
  finalizedAt: string | null;
}
/** One record or event as `inputs.create` sends it (the request's `data` items). */
interface InputCreate {
  /**
   * UUIDv7, required: the idempotency key of the input (a resent input is a
   * duplicate). Globally unique by construction; the API rejects its reuse
   * within the organization: another source's id is a 409.
   */
  id: string;
  /** The open run of the source this input is a record of; none: an event. */
  runId?: string;
  /** The record type: which of the source's mappings applies. */
  type: string;
  /** `upsert` when left out; `delete` only on an event (a run deletes at finalize what it did not report). */
  op?: EventOp;
  /** When the collector observed this state (ISO 8601). The API defaults it to arrival. */
  observedAt?: string;
  payload: unknown;
}
/**
 * One record or event as a caller hands it to the SDK: `id` (a UUIDv7) is
 * generated when omitted and validated when given; `observedAt` defaults to now.
 */
type InputSpec = Omit<InputCreate, 'id'> & {
  id?: string;
};
/** An event as a caller hands it to the SDK: an input of no run. */
type EventSpec = Omit<InputSpec, 'runId'>;
/** What `inputs.create` answers: how many inputs were taken, and which were duplicates (an id sent before). */
interface Accepted {
  accepted: number;
  duplicates: number;
  /** Each input of the batch, in its order: a resend of one already taken is a duplicate. */
  data: {
    id: string;
    duplicate: boolean;
  }[];
}
/** What an input did to one entity it named. */
interface EntityResult {
  /** The target and the endpoint, by slug and by id. */
  target: string;
  targetId: string;
  endpoint: string;
  endpointId: string;
  externalId: string;
  outcome: Outcome;
  /** The backend's own id for the entity, when it answers one. */
  backendId: string | null;
  /** What applied the input to it: the destination, and the mapping at the revision that ran. */
  destinationId: string;
  mappingId: string;
  mappingRevision: number;
  errors?: string[];
}
/** An input as a list answers it: what became of it, without its payload. */
interface InputSummary {
  id: string;
  sourceId: string;
  runId: string | null;
  type: string;
  op: EventOp;
  observedAt: string;
  receivedAt: string;
  status: InputStatus;
  attempts: number;
  nextAttemptAt: string | null;
  result: {
    outcome: Outcome;
    entities: EntityResult[];
    errors?: string[];
  } | null;
  error: string | null;
  appliedAt: string | null;
  /** The replay that queued this input, when it is a replay. */
  replayId: string | null;
}
/** An input read by its id (`inputs.get`): its summary, and the record exactly as it was sent, whatever its outcome. */
interface Input extends InputSummary {
  payload: unknown;
}
/**
 * A list's order, in the catalog's grammar: each field `field` or
 * `field:asc` / `field:desc`, comma-separated (ascending unless said).
 */
type Sort<Field extends string> = Field | `${Field}:asc` | `${Field}:desc` | (string & {});
/** Query of `GET /sources/{id}/inputs`. */
interface InputFilter extends PageOptions {
  runId?: string;
  status?: InputStatus;
  /** Settled inputs with this outcome (`result.outcome`); never matches a pending input. */
  outcome?: Outcome;
  type?: string;
  /** The inputs one replay queued. */
  replayId?: string;
  /** Inputs received at or after this time (ISO 8601). */
  since?: string;
  /** Arrival order: oldest first (`receivedAt`, the default) or newest first (`receivedAt:desc`). */
  sort?: 'receivedAt' | 'receivedAt:asc' | 'receivedAt:desc';
  /**
   * The inputs after this one in the list's order: page by the last input
   * read (`after: page.results.at(-1).id`), at any depth; an offset goes up
   * to 10000. An input that is not the source's is a 400.
   */
  after?: string;
}
/** Body of `POST /sources/{id}/replays`: what to replay (every live entity, unless narrowed). */
interface ReplayRequest {
  types?: string[] | null;
  /** Only the entities last observed in this window (ISO 8601). */
  since?: string;
  until?: string;
}
/**
 * A replay: the last record of every live entity in scope, queued again by
 * the API in the background (a page at a time, behind the backlog quota) so
 * the current mappings apply to it. Every input it queues carries its id
 * (`inputs.list(src, { replayId })`).
 */
interface Replay {
  id: string;
  sourceId: string;
  status: ReplayStatus;
  types: string[] | null;
  since: string | null;
  until: string | null;
  idempotencyKey: string | null;
  /** The entities it covers (counted when it was asked), those gone through, the inputs queued. */
  progress: {
    entities: number;
    scanned: number;
    queued: number;
  };
  /** Why it failed. */
  error: string | null;
  createdAt: string;
  finishedAt: string | null;
}
/** Query of `GET /sources/{id}/replays`. */
interface ReplayFilter extends PageOptions {
  status?: ReplayStatus;
  /** `createdAt` (newest first by default). */
  sort?: Sort<'createdAt'>;
}
/**
 * A backend the platform defined (its operators, through the API); mappings
 * name one by slug. How entities are written to it is its endpoints'
 * (`endpoints.listForTarget()`).
 */
/** A target as a list answers it: what a destination names. */
interface TargetSummary {
  /** UUIDv7, assigned by the API. */
  id: string;
  /** What a mapping's `target` names. */
  slug: string;
  name: string;
  description: string | null;
}
/** Query of `GET /targets`. */
interface TargetFilter extends PageOptions {
  slug?: string;
}
/** An endpoint of a target: what a mapping's `endpoint` names. */
interface EndpointSummary {
  /** UUIDv7, the organization's own: what destinations and entities reference (`endpointId`). */
  id: string;
  targetId: string;
  slug: string;
  name: string;
  /** Declared on the target (written by its operators), or published by its backend (discovered): read only. */
  declared: boolean;
  /** A discovered endpoint's id in its backend (a specification's id): an attribute, never an `endpointId`. Null when declared. */
  backendId: string | null;
}
/** One HTTP call of a target's API, as the engine makes it. */
interface EndpointCall {
  method: HttpMethod;
  path: string;
  query?: Record<string, string>;
  /** A shape the engine builds (`OperationBody`), a template, or an expression. */
  body?: OperationBody | Record<string, unknown> | unknown[];
}
/** How a backend's refusal reads (`Endpoint.errors`): matched by status, call and message, then classified. */
interface EndpointErrorRule {
  status: number | number[];
  operation?: OperationName;
  /** A value of the answer at `path` matching the regular expression `pattern`. */
  match?: {
    path: string;
    pattern: string;
  };
  outcome: TargetErrorOutcome;
}
/** How a deleted entity the backend still serves looks (`behavior.gone`): the value at `path` is one of `in`. */
interface EndpointGone {
  path: string;
  in: (string | number | boolean | null)[];
}
/** How a list call pages (`calls.paging`): its style and the query parameters it names. */
interface EndpointPaging {
  style: PagingStyle;
  params?: {
    size?: string;
    offset?: string;
    page?: string;
    cursor?: string;
  };
  size?: number;
  first?: number;
  next?: string;
  maxPages: number;
}
/**
 * An endpoint another one names (a parent, a relation's): its slug, and its
 * id (`null` for one the backend publishes). In the wire's keys: parents and
 * relations are keyed by the backend's own fields, so they are never renamed.
 */
interface EndpointReference {
  endpoint: string;
  endpoint_id: string | null;
}
/**
 * One endpoint read by its id, as it runs: its six sections laid over the
 * target's catch-all and the engine's defaults, every key present (`null`
 * where nothing applies, `{}` for an empty map) but the calls, which are the
 * ones it has; the same shape whatever its kind. A discovered endpoint brings its `model` from the
 * backend, takes the catch-all's rules, and has `null` for its revision and
 * timestamps (it is not written here). The operators' rules (`calls`,
 * `behavior`, `errors`) are typed loosely: a collector reads them, never
 * writes them.
 */
interface Endpoint extends EndpointSummary {
  /** What an entity is: its JSON Schema (keys as the backend writes them), its parents, its link sets. */
  model: {
    schema: Record<string, unknown> | null;
    /** Each parent's field and the endpoint it points at. */
    parents: Record<string, EndpointReference>;
    /** Its link sets by name: the field carrying the linked keys, and the endpoint they are of. */
    relations: Record<string, {
      field: string;
    } & EndpointReference>;
  };
  /**
   * How an entity is addressed: who assigns its identity, the source (by its
   * key, `key` the field) or the backend (an id at create, found again by
   * `naturalKey`).
   */
  identity: {
    assignedBy: AssignedBy;
    key: string | null;
    naturalKey: string[] | null;
  };
  /** How the API is called: each call it has, where answers hold things, how `find` pages. */
  calls: {
    upsert?: EndpointCall;
    create?: EndpointCall;
    update?: EndpointCall;
    read?: EndpointCall;
    delete?: EndpointCall;
    find?: EndpointCall;
    link?: EndpointCall & {
      emptySet: EmptyLinkSet;
    };
    unlink?: EndpointCall;
    answers: {
      id: string;
      results: string;
    };
    paging: EndpointPaging | null;
  };
  /** The rules of each field named: what may be written, how drift compares it. */
  fields: Record<string, {
    write: FieldRule | null;
    drift: FieldComparison | null;
  }>;
  /** What the engine may do there, and how it reads state back. */
  behavior: {
    delete: TargetDeletePolicy;
    clear: ClearSemantics;
    adopt: AdoptPolicy;
    gone: EndpointGone | null;
  };
  /** How a refusal classifies: the endpoint's own rules, then the catch-all's. */
  errors: EndpointErrorRule[];
  revision: number | null;
  createdAt: string | null;
  updatedAt: string | null;
  deletedAt: string | null;
}
/**
 * An endpoint as it was written (`endpoints.get(…, { effective: false })`):
 * a declared endpoint's own sections and keys only, what a write takes; the
 * endpoints it names by slug (in the backend's own keys).
 */
interface EndpointAsWritten extends EndpointSummary {
  model?: {
    schema?: Record<string, unknown>;
    parents?: Record<string, string>;
    relations?: Record<string, {
      field: string;
      endpoint: string;
    }>;
  };
  identity?: {
    assignedBy?: AssignedBy;
    key?: string;
    naturalKey?: string[];
  };
  /** The calls it gives (`null`: one it does not have), and where answers hold things, how `find` pages. */
  calls?: {
    upsert?: EndpointCall | null;
    create?: EndpointCall | null;
    update?: EndpointCall | null;
    read?: EndpointCall | null;
    delete?: EndpointCall | null;
    find?: EndpointCall | null;
    link?: (EndpointCall & {
      emptySet?: EmptyLinkSet;
    }) | null;
    unlink?: EndpointCall | null;
    answers?: {
      id?: string;
      results?: string;
    };
    paging?: EndpointPaging | null;
  };
  fields?: Record<string, {
    write?: FieldRule;
    drift?: FieldComparison;
  }>;
  behavior?: {
    delete?: TargetDeletePolicy;
    clear?: ClearSemantics;
    adopt?: AdoptPolicy;
    gone?: EndpointGone | null;
  };
  errors?: EndpointErrorRule[];
  revision: number | null;
  createdAt: string | null;
  updatedAt: string | null;
  deletedAt: string | null;
}
/** How `endpoints.get` reads an endpoint: as it runs (the default), or as it was written. */
interface EndpointReadOptions {
  /** `false`: as it was written (a declared endpoint's own sections and keys). */
  effective?: boolean;
}
/** Query of `GET /targets/{target_id}/endpoints`; `limit` is at most 100 here. */
interface EndpointFilter extends PageOptions {
  id?: string;
  slug?: string;
}
/** An entity a source owns, as a list answers it: what was last written to it, without the record behind it. */
interface EntitySummary {
  /** UUIDv7, assigned by the API when the source first wrote the entity: `entities.get()` reads it. */
  id: string;
  sourceId: string;
  /** The target and the endpoint, by id and by slug (as they were when the entity was written). */
  targetId: string;
  endpointId: string;
  target: string;
  endpoint: string;
  externalId: string;
  recordType: string;
  /**
   * The backend's own id for the entity, when it answers one; for a target
   * that assigns ids, what every later call addresses it by.
   */
  backendId: string | null;
  origin: EntityOrigin;
  data: Record<string, unknown>;
  dataHash: string;
  /** many_to_many target external ids in place, by relation key (not part of `data`). */
  links: Record<string, string[]>;
  lastObservedAt: string;
  lastSeenRunId: string | null;
  lastSeenAt: string;
  lastWrittenAt: string | null;
  writeCount: number;
  deletedAt: string | null;
  deletedByRunId: string | null;
  /** The destination it is applied through, and the mapping revision that last wrote it. */
  destinationId: string | null;
  mappingId: string | null;
  mappingRevision: number | null;
  /** Released by its destination's `onDelete: OnDelete.SET_NULL`: still in the target, no longer owned. */
  releasedAt: string | null;
  driftedAt: string | null;
  drift: {
    type: DriftType;
    fields: string[];
    checkId: string;
  } | null;
  createdAt: string;
  updatedAt: string;
}
/**
 * An entity read by its id (`entities.get`, which needs `ingest:input:read`):
 * its summary, and the raw record it was last mapped from as the collector
 * sent it (what a replay maps again, a sample for a mapping preview); null
 * for a deleted entity.
 */
interface Entity extends EntitySummary {
  payload: unknown;
}
/** Query of `GET /sources/{id}/entities`. */
interface EntityFilter extends PageOptions {
  /** By slug, or by id. */
  target?: string;
  targetId?: string;
  endpoint?: string;
  endpointId?: string;
  externalId?: string;
  backendId?: string;
  recordType?: string;
  /** `externalId`, `lastSeenAt` or `updatedAt`; then by target, endpoint and external id. At most 200 a page. */
  sort?: Sort<'externalId' | 'lastSeenAt' | 'updatedAt'>;
  deleted?: boolean;
  drifted?: boolean;
  released?: boolean;
  destinationId?: string;
  /** Entities a drift check flagged and nothing has written since. */
  checkId?: string;
}
/** Query of `GET /sources/{id}/drift_checks`. */
interface DriftCheckFilter extends PageOptions {
  status?: DriftCheckStatus;
  /** `createdAt` (newest first by default). */
  sort?: Sort<'createdAt'>;
}
/** A drift check: what a source owns compared with what its targets hold. */
interface DriftCheck {
  id: string;
  sourceId: string;
  status: DriftCheckStatus;
  policy: DriftPolicy;
  counters: {
    checked: number;
    matching: number;
    changed: number;
    missing: number;
    restored: number;
  };
  error: string | null;
  createdAt: string;
  finishedAt: string | null;
}
/** The API's error envelope. */
interface ApiError {
  statusCode: number;
  code?: string;
  error?: string;
  message?: string;
}
//#endregion
//#region src/collector/types.d.ts
/**
 * Where a run says what it does, by level: `console` will do, and so will any
 * logger with these four methods. A logger, not a trace: the run's steps and
 * outcomes are the API's runs.
 */
interface Logger {
  debug(message: string): void;
  info(message: string): void;
  warn(message: string): void;
  error(message: string): void;
}
/**
 * How one record type becomes entities (evaluated by catalog-ingest-api), and
 * where they are written: a target (a backend the platform configured) and an
 * endpoint of it.
 */
interface CollectorMapping {
  engine: Engine;
  /** Must yield `{ id, data }`, a list of them, or nothing (record filtered out). */
  expression: string;
  /**
   * The target the entities are written to (`GET /targets`). Default
   * `"catalog"`. It cannot change once the mapping exists: delete the mapping
   * to move it.
   */
  target?: string;
  /**
   * Slug of the target's endpoint the entities are written to (for the
   * catalog, a specification's slug). By slug, because a collector runs in
   * many organizations and each has its own id for the same endpoint.
   */
  endpoint: string;
  /**
   * The switch of the destination that binds this mapping to its endpoint:
   * `false` stops writing it, the mapping kept. Default `true`.
   */
  enabled?: boolean;
}
/** A source's snapshot settings; the ones left out take the API's defaults. */
interface CollectorRunSettings {
  /** Abort a snapshot that is not finished within this many seconds (6 hours). */
  ttlSeconds?: number;
  /** `DeletePolicy.SOFT_DELETE_STALE` (default): a finished snapshot deletes what it no longer saw. */
  deletePolicy?: DeletePolicy;
  /** Refuse a snapshot that would delete this share of the source or more (0.5). */
  maxDeleteRatio?: number;
  /** Refuse a snapshot that reported nothing (true). */
  rejectEmpty?: boolean;
  /**
   * Record types left out of the guards above: a finished snapshot still
   * deletes what it no longer saw of them, uncounted; for types that expire
   * by design, like Kubernetes events (none).
   */
  unguardedTypes?: string[];
}
/** The source a collector feeds. */
interface CollectorSource {
  /** The source type's slug: what kind of system this is (`kubernetes`, `github`, …). */
  type: string;
  /** Display name. */
  name: string;
  description?: string;
  /**
   * The organization's own data about the source (`env`, `region`...), read
   * by mappings as `$source.attributes`.
   */
  attributes?: Record<string, unknown>;
  /**
   * How the source's snapshots behave. Events never go through them: a
   * delete event deletes at once.
   */
  runs?: CollectorRunSettings;
}
/** One raw record (or event payload) as the system of record returned it. */
interface CollectedRecord {
  /** A record type the collector declares (`recordTypes`, or a key of `mappings`). */
  type: string;
  payload: unknown;
  /**
   * When this state was observed. Defaults to the snapshot's start for
   * snapshot records, to now for events. The newest observation of an entity
   * wins, whatever order inputs reach the API in.
   */
  observedAt?: Date | string;
  /** A UUIDv7 that makes a resend idempotent (unique in the organization); generated when omitted. */
  id?: string;
}
/** When an event was observed, and its id. */
type CollectedEventOptions = Pick<CollectedRecord, 'observedAt' | 'id'>;
/** The changes a watch emits. */
interface CollectorEvents {
  upsert(type: string, payload: unknown, options?: CollectedEventOptions): void;
  delete(type: string, payload: unknown, options?: CollectedEventOptions): void;
  /** Send what is buffered now (events are otherwise batched for about a second). */
  flush(): Promise<void>;
}
/**
 * What a snapshot and a watch are given. A collector's configuration is its
 * own code's: the runtime passes none.
 */
interface CollectorContext {
  /** The source it feeds: the id the API assigned it (what its calls take) and its slug. */
  source: UpsertedSource;
  log: Logger;
  /** Aborted when the collector stops or the snapshot is cancelled: stop and return. */
  signal: AbortSignal;
}
interface SnapshotContext extends CollectorContext {
  /** When this snapshot started; the default `observedAt` of its records. */
  observedAt: Date;
}
interface WatchContext extends CollectorContext {
  events: CollectorEvents;
}
/** What a snapshot answers: records as it lists them, or all of them at once. */
type SnapshotRecords = AsyncIterable<CollectedRecord> | Iterable<CollectedRecord> | Promise<Iterable<CollectedRecord>>;
/**
 * A collector: the source it feeds, the record types it produces, how it
 * lists everything (`snapshot`) and, when it can, how it watches changes
 * (`watch`).
 */
interface CollectorDefinition {
  source: CollectorSource;
  /**
   * The record types it produces, mapped by its source type's shared
   * mappings: the organization binds them to its endpoints once, and only the
   * types bound for the source are sent.
   */
  recordTypes?: string[];
  /**
   * Its own mappings, one per record type, for a type nothing shares
   * mappings of: defined for its source and bound to the endpoint each names,
   * before every snapshot. A collector declares `recordTypes`, `mappings`, or
   * both.
   */
  mappings?: Record<string, CollectorMapping>;
  /**
   * Everything the system of record holds right now. Yield as you list;
   * return to finish. Throwing aborts the snapshot: nothing is deleted for a
   * snapshot that did not complete.
   */
  snapshot(ctx: SnapshotContext): SnapshotRecords;
  /**
   * The changes as they happen, until `ctx.signal` aborts. Restarted with a
   * backoff when it throws or returns. Snapshots still reconcile anything it
   * missed.
   */
  watch?(ctx: WatchContext): Promise<void>;
}
/** What a finished snapshot reports: the run as the API closed it. */
interface SnapshotResult {
  runId: string;
  /** `completed`, `guard_tripped` (nothing deleted), or `aborted` (a dry run, closed once assessed). */
  status: `${RunStatus}`;
  /** Records the snapshot sent. */
  records: number;
  counters: RunCounters;
  /** What the finalize assessed and did (`dryRun`: assessed only, nothing deleted). */
  reconciliation: RunReconciliation | null;
}
/** The source to upsert: the definition's, under the deployment's slug. */
interface SourceSpec extends CollectorSource {
  /** Stable name, unique in the organization (lowercase letters, digits, `.`, `_`, `-`). */
  slug: string;
  /** Where the source lives (the organization's root unless given); never changed once it exists. */
  nrn?: string;
}
/**
 * The source a run feeds, as its deployment says it: its slug (one per
 * deployment), its NRN, and a name over the definition's (one collector, many
 * deployments).
 */
type RunSource = Pick<SourceSpec, 'slug' | 'nrn'> & Partial<Pick<SourceSpec, 'name'>>;
/** A source as the API holds it. */
interface UpsertedSource {
  /** Assigned by the API (a UUID): every later call about the source takes it. */
  id: string;
  slug: string;
}
/**
 * A run of a source as a collector's schedule reads it: which one, and when
 * it started (by the API's clock). Every status counts: a run started then is
 * a snapshot attempted then.
 */
interface LastRun {
  id: string;
  /** When the run was opened (ISO 8601). */
  createdAt: string;
}
/** A collected record with its observation time set. */
type ObservedRecord = CollectedRecord & {
  observedAt: Date | string;
};
/** A snapshot run being fed. */
interface RunPort {
  readonly id: string;
  add(record: ObservedRecord): void;
  /** Send what is buffered and wait until the API accepted it (the backpressure point). */
  flush(): Promise<void>;
  /**
   * Flush, finalize and wait for the reconciliation. A dry run is assessed and
   * stays open (`reconciliation.dryRun`): abort it once reported. Throws when
   * a batch failed: the run cannot be finalized; abort it.
   */
  finalize(options?: FinalizeOptions): Promise<SnapshotResult>;
  /** Close without deleting anything. */
  abort(): Promise<void>;
}
/** A source's event stream. */
interface EventPort extends CollectorEvents {
  close(): Promise<void>;
}
/**
 * How a collector reaches the API: `ClientIngest` (the real one, through an
 * `IngestClient`) or, in a test or a local run, `InMemoryIngest`
 * (`@nullplatform/ingest/testing`: records everything, never networks).
 */
interface IngestPort {
  /**
   * The source of `source.slug`, looked for at `source.nrn`: created when
   * missing (a deleted one is revived), otherwise patched where it differs.
   */
  upsertSource(source: SourceSpec): Promise<UpsertedSource>;
  /**
   * The source's own mappings and where each is written: created when
   * missing, patched where they differ.
   * @returns The record types whose mapping or destination was written (`[]` when nothing was).
   */
  upsertMappings(sourceId: string, mappings: Record<string, CollectorMapping>): Promise<string[]>;
  /** Of `types`, those the source applies: an enabled destination binds a mapping of each. */
  appliedTypes(sourceId: string, types: string[]): Promise<string[]>;
  /**
   * The source's newest run, whatever its status (open, completed, aborted,
   * failed…): when the source last attempted a snapshot.
   * @returns The run, or `null` when the source has none.
   */
  lastRun(sourceId: string): Promise<LastRun | null>;
  /** Open a run covering `types`; an abandoned open run of the source is aborted first. */
  openRun(sourceId: string, types: string[]): Promise<RunPort>;
  events(sourceId: string): EventPort;
}
/** The target a mapping writes to when it names none. */
declare const DEFAULT_MAPPING_TARGET = "catalog";
//#endregion
export { Mapping as $, EntityOrigin as $t, DriftCheck as A, SourceSpec$1 as At, EndpointReference as B, TargetSummary as Bt, Accepted as C, Sort as Ct, DestinationPatch as D, SourceFilter as Dt, DestinationFilter as E, SourceFields as Et, EndpointErrorRule as F, SourceTypeRevision as Ft, EntitySummary as G, ClearSemantics as Gt, Entity as H, Upserted as Ht, EndpointFilter as I, SourceTypeSpec as It, Input as J, DriftCheckStatus as Jt, EventSpec as K, DeletePolicy as Kt, EndpointGone as L, SourceTypeUpsertSpec as Lt, Endpoint as M, SourceType as Mt, EndpointAsWritten as N, SourceTypeFilter as Nt, DestinationRevision as O, SourcePatch as Ot, EndpointCall as P, SourceTypePatch as Pt, InputSummary as Q, Engine as Qt, EndpointPaging as R, SourceUpsertSpec as Rt, WatchContext as S, RunSettings as St, Destination as T, SourceDestinationFilter as Tt, EntityFilter as U, AdoptPolicy as Ut, EndpointSummary as V, TypeMappingCreate as Vt, EntityResult as W, AssignedBy as Wt, InputFilter as X, DriftType as Xt, InputCreate as Y, DriftPolicy as Yt, InputSpec as Z, EmptyLinkSet as Zt, SnapshotContext as _, TargetErrorOutcome as _n, Revision as _t, CollectorEvents as a, MappingRevisionAction as an, MappingRevision as at, SourceSpec as b, RunFilter as bt, CollectorSource as c, OperationBody as cn, MaybeNamedBy as ct, IngestPort as d, PagingStyle as dn, Page as dt, EventOp as en, MappingCreate as et, LastRun as f, ReplayStatus as fn, PageOptions as ft, RunSource as g, TargetDeletePolicy as gn, ReplayRequest as gt, RunPort as h, SourceTypeRevisionAction as hn, ReplayFilter as ht, CollectorDefinition as i, InputStatus as in, MappingPreviewSpec as it, DriftCheckFilter as j, SourceStats as jt, DestinationSpec as k, SourceRevision as kt, DEFAULT_MAPPING_TARGET as l, OperationName as ln, NamedBy as lt, ObservedRecord as m, SourceRevisionAction as mn, Replay as mt, CollectedRecord as n, FieldRule as nn, MappingPatch as nt, CollectorMapping as o, OnConflict as on, MappingSample as ot, Logger as p, RunStatus as pn, Paging as pt, FinalizeOptions as q, DestinationRevisionAction as qt, CollectorContext as r, HttpMethod as rn, MappingPreview as rt, CollectorRunSettings as s, OnDelete as sn, MappingWriteOptions as st, CollectedEventOptions as t, FieldComparison as tn, MappingFilter as tt, EventPort as u, Outcome as un, OwnRunSettings as ut, SnapshotRecords as v, UpsertOutcome as vn, Run as vt, ApiError as w, Source as wt, UpsertedSource as x, RunReconciliation as xt, SnapshotResult as y, RunCounters as yt, EndpointReadOptions as z, TargetFilter as zt };
//# sourceMappingURL=types-B500HM6G.d.ts.map