@becomes/cms-cloud-client
Version:
SDK for accessing BCMS Cloud API
17 lines (16 loc) • 1.07 kB
TypeScript
import type { FSDBRepository } from '@becomes/purple-cheetah-mod-fsdb/types';
import type { MongoDBRepository } from '@becomes/purple-cheetah-mod-mongodb/types';
import type { Module } from '@becomes/purple-cheetah/types';
import { Instance, InstanceLicenseType } from '../models';
export interface InstanceRepoMethods {
findAllByUserId(userId: string): Promise<Instance[]>;
findAllByType(type: InstanceLicenseType): Promise<Instance[]>;
findByCheckoutHash(hash: string): Promise<Instance | null>;
findByOrgIdAndNameEncoded(orgId: string, nameEncoded: string): Promise<Instance | null>;
findByIdAndOrgId(id: string, orgId: string): Promise<Instance | null>;
updateViaShim(instance: Instance): Promise<void>;
findAllByOrgIdAndLicenseType(orgId: string, licenseType: InstanceLicenseType): Promise<Instance[]>;
findAllByOrgId(orgId: string): Promise<Instance[]>;
}
export type InstanceRepo = MongoDBRepository<Instance, InstanceRepoMethods> | FSDBRepository<Instance, InstanceRepoMethods>;
export declare function createInstanceRepo(): Module;