import { IRequest } from "@fluidframework/core-interfaces" ; import { createTinyliciousCreateNewRequest , InsecureTinyliciousTokenProvider , InsecureTinyliciousUrlResolver , defaultTinyliciousPort , } from "@fluidframework/tinylicious-driver" ; import { ITestDriver } from "@fluidframework/test-driver-definitions" ; import { IDocumentServiceFactory , IResolvedUrl } from "@fluidframework/driver-definitions" ; import { RouterliciousDriverApiType , RouterliciousDriverApi } from "./routerliciousDriverApi" ; export class TinyliciousTestDriver implements ITestDriver { public readonly type = "tinylicious" ; public get version ( ) { return this . api . version ; } constructor ( private readonly api = RouterliciousDriverApi ) { } createDocumentServiceFactory ( ) { return new this . api . RouterliciousDocumentServiceFactory ( new InsecureTinyliciousTokenProvider ( ) ) ; } createUrlResolver ( ) { return new InsecureTinyliciousUrlResolver ( ) ; } createCreateNewRequest ( testId ) { return createTinyliciousCreateNewRequest ( testId ) ; } async createContainerUrl ( testId , containerUrl ? ) { const containerId = containerUrl && "id" in containerUrl ? containerUrl . id : testId ; return `http://localhost:${ defaultTinyliciousPort }/${ containerId }` ; } }