import { BaseContainerRuntimeFactory } from "@fluidframework/aqueduct" ; import { IContainerRuntime } from "@fluidframework/container-runtime-definitions" ; import { IFluidRouter } from "@fluidframework/core-interfaces" ; import { requestFluidObject , RequestParser } from "@fluidframework/runtime-utils" ; import { ContactCollectionInstantiationFactory } from "./dataObject" ; const contactCollectionId = "contactCollection" ; const collectionRequestHandler = async ( request , runtime ) => { const response = await requestFluidObject < IFluidRouter > ( await runtime . getRootDataStore ( contactCollectionId ) , request ) ; return { status : 200 , mimeType : "fluid/object" , value : response } ; } ; class ContactCollectionContainerRuntimeFactoryType extends BaseContainerRuntimeFactory { constructor ( ) { super ( new Map ( [ ContactCollectionInstantiationFactory . registryEntry ] ) , undefined , [ collectionRequestHandler ] ) ; } protected async containerInitializingFirstTime ( runtime ) { await runtime . createRootDataStore ( ContactCollectionInstantiationFactory . type , contactCollectionId ) ; } } /**
 * The ContactCollectionContainerRuntimeFactory is the container code for our scenario.
 */ export const ContactCollectionContainerRuntimeFactory = new ContactCollectionContainerRuntimeFactoryType ( ) ;