import { Client, Doc, DocumentQuery, Domain, FindOptions, IncOptions, PushOptions } from '@anticrm/core' /** * @public */ export type MigrateUpdate = Partial & Omit, '$move'> & IncOptions & { // For any other mongo stuff [key: string]: any } /** * @public */ export interface MigrationResult { matched: number updated: number } /** * @public * Client to perform model upgrades */ export interface MigrationClient { // Raw collection operations // Raw FIND, allow to find documents inside domain. find: (domain: Domain, query: DocumentQuery, options?: Omit, 'lookup'>) => Promise // Allow to raw update documents inside domain. update: (domain: Domain, query: DocumentQuery, operations: MigrateUpdate) => Promise } /** * @public */ export type MigrationUpgradeClient = Client /** * @public */ export interface MigrateOperation { // Perform low level migration migrate: (client: MigrationClient) => Promise // Perform high level upgrade operations. upgrade: (client: MigrationUpgradeClient) => Promise }