@fluidframework/replay-driver 2.74.0-370705 → 2.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @fluidframework/replay-driver
2
2
 
3
+ ## 2.80.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.74.0
8
+
9
+ Dependency updates only.
10
+
3
11
  ## 2.73.0
4
12
 
5
13
  Dependency updates only.
@@ -5,7 +5,7 @@
5
5
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
6
6
  import { IDisposable } from "@fluidframework/core-interfaces";
7
7
  import { ConnectionMode } from "@fluidframework/driver-definitions";
8
- import { IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IDocumentDeltaStorageService, IDocumentService, IClientConfiguration, IConnected, IDocumentMessage, ISignalClient, ITokenClaims, IVersion, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/driver-definitions/internal";
8
+ import { IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IDocumentDeltaStorageService, IDocumentService, IClientConfiguration, IConnected, IDocumentMessage, ISignalClient, ITokenClaims, IVersion, ISequencedDocumentMessage, ISignalMessage, type ISnapshotTree } from "@fluidframework/driver-definitions/internal";
9
9
  import { ReplayController } from "./replayController.js";
10
10
  export declare class ReplayControllerStatic extends ReplayController {
11
11
  readonly replayFrom: number;
@@ -25,7 +25,7 @@ export declare class ReplayControllerStatic extends ReplayController {
25
25
  constructor(replayFrom: number, replayTo: number, unitIsTime?: boolean | undefined);
26
26
  initStorage(documentService: IDocumentService): Promise<boolean>;
27
27
  getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
28
- getSnapshotTree(version?: IVersion): Promise<null>;
28
+ getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
29
29
  readBlob(blobId: string): Promise<ArrayBufferLike>;
30
30
  getStartingOpSequence(): Promise<number>;
31
31
  fetchTo(currentOp: number): number | undefined;
@@ -55,7 +55,7 @@ export declare class ReplayDocumentDeltaConnection extends TypedEventEmitter<IDo
55
55
  readonly maxMessageSize: number;
56
56
  constructor(details: IConnected);
57
57
  submit(documentMessage: IDocumentMessage[]): void;
58
- submitSignal(message: any): Promise<void>;
58
+ submitSignal(message: unknown): Promise<void>;
59
59
  private _disposed;
60
60
  get disposed(): boolean;
61
61
  dispose(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"replayDocumentDeltaConnection.d.ts","sourceRoot":"","sources":["../src/replayDocumentDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EACN,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,QAAQ,EAER,yBAAyB,EACzB,cAAc,EACd,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIzD,qBAAa,sBAAuB,SAAQ,gBAAgB;aAgB1C,UAAU,EAAE,MAAM;aAClB,QAAQ,EAAE,MAAM;aAChB,UAAU,CAAC;IAjB5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAM;IAC3C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAM;IAE9C,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,aAAa,CAAK;IAG1B;;;;;;OAMG;gBAEc,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,qBAAS;IASxB,WAAW,CAAC,eAAe,EAAE,gBAAgB;IAI7C,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,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,EAAE,EAAE;IACZ,IAAI,EAAE;QACL,EAAE,EAAE,EAAE;KACN;IACD,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC5C,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,oBAAoB;IAC5E,GAAG,EAAE,KAAK;CACV,AAV6B,CAU5B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IDisposable } from \"@fluidframework/core-interfaces\";\nimport { delay } from \"@fluidframework/core-utils/internal\";\nimport { ConnectionMode } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIClientConfiguration,\n\tIConnected,\n\tIDocumentMessage,\n\tISignalClient,\n\tITokenClaims,\n\tIVersion,\n\tScopeType,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { ReplayController } from \"./replayController.js\";\n\nconst ReplayDocumentId = \"documentId\";\n\nexport class ReplayControllerStatic extends ReplayController {\n\tprivate static readonly DelayInterval = 50;\n\tprivate static readonly ReplayResolution = 15;\n\n\tprivate firstTimeStamp: number | undefined;\n\tprivate replayCurrent = 0;\n\t// Simulated delay interval for emitting the ops\n\n\t/**\n\t * Helper class\n\t *\n\t * @param replayFrom - First op to be played on socket.\n\t * @param replayTo - Last op number to be played on socket.\n\t * @param unitIsTime - True is user want to play ops that are within a replay resolution window.\n\t */\n\tpublic constructor(\n\t\tpublic readonly replayFrom: number,\n\t\tpublic readonly replayTo: number,\n\t\tpublic readonly unitIsTime?: boolean,\n\t) {\n\t\tsuper();\n\t\tif (unitIsTime !== true) {\n\t\t\t// There is no code in here to start with snapshot, thus we have to start with op #0.\n\t\t\tthis.replayTo = 0;\n\t\t}\n\t}\n\n\tpublic async initStorage(documentService: IDocumentService) {\n\t\treturn true;\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\treturn [];\n\t}\n\n\tpublic async getSnapshotTree(version?: IVersion) {\n\t\treturn version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async getStartingOpSequence(): Promise<number> {\n\t\treturn 0;\n\t}\n\n\tpublic fetchTo(currentOp: number) {\n\t\tif (!(this.unitIsTime !== true && this.replayTo >= 0)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.replayTo;\n\t}\n\n\tpublic isDoneFetch(currentOp: number, lastTimeStamp?: number) {\n\t\tif (this.replayTo >= 0) {\n\t\t\tif (this.unitIsTime === true) {\n\t\t\t\treturn (\n\t\t\t\t\tlastTimeStamp !== undefined &&\n\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\tlastTimeStamp - this.firstTimeStamp >= this.replayTo\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn currentOp >= this.replayTo;\n\t\t}\n\t\treturn lastTimeStamp === undefined; // No more ops\n\t}\n\n\tpublic skipToIndex(fetchedOps: ISequencedDocumentMessage[]) {\n\t\tif (this.replayFrom <= 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (this.unitIsTime === true) {\n\t\t\tfor (const [i, { timestamp }] of fetchedOps.entries()) {\n\t\t\t\tif (timestamp !== undefined) {\n\t\t\t\t\tif (this.firstTimeStamp === undefined) {\n\t\t\t\t\t\tthis.firstTimeStamp = timestamp;\n\t\t\t\t\t}\n\t\t\t\t\tif (timestamp - this.firstTimeStamp >= this.replayFrom) {\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (this.replayFrom > this.replayCurrent) {\n\t\t\treturn this.replayFrom - this.replayCurrent;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic async replay(\n\t\temitter: (op: ISequencedDocumentMessage[]) => void,\n\t\tfetchedOps: ISequencedDocumentMessage[],\n\t): Promise<void> {\n\t\tlet current = this.skipToIndex(fetchedOps);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tconst replayNextOps = () => {\n\t\t\t\t// Emit the ops from replay to the end every \"deltainterval\" milliseconds\n\t\t\t\t// to simulate the socket stream\n\t\t\t\tconst currentOp = fetchedOps[current];\n\t\t\t\tconst playbackOps = [currentOp];\n\t\t\t\tlet nextInterval = ReplayControllerStatic.DelayInterval;\n\t\t\t\tcurrent += 1;\n\n\t\t\t\tif (this.unitIsTime === true) {\n\t\t\t\t\tconst currentTimeStamp = currentOp.timestamp;\n\t\t\t\t\tif (currentTimeStamp !== undefined) {\n\t\t\t\t\t\t// Emit more ops that is in the ReplayResolution window\n\n\t\t\t\t\t\twhile (current < fetchedOps.length) {\n\t\t\t\t\t\t\tconst op = fetchedOps[current];\n\t\t\t\t\t\t\tif (op.timestamp === undefined) {\n\t\t\t\t\t\t\t\t// Missing timestamp, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst timeDiff = op.timestamp - currentTimeStamp;\n\t\t\t\t\t\t\tif (timeDiff >= ReplayControllerStatic.ReplayResolution) {\n\t\t\t\t\t\t\t\t// Time exceeded the resolution window, break out the loop\n\t\t\t\t\t\t\t\t// and delay for the time difference.\n\t\t\t\t\t\t\t\tnextInterval = timeDiff;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (timeDiff < 0) {\n\t\t\t\t\t\t\t\t// Time have regressed, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// The op is within the ReplayResolution emit it now\n\t\t\t\t\t\t\tplaybackOps.push(op);\n\t\t\t\t\t\t\tcurrent += 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\t\t\tthis.replayTo >= 0 &&\n\t\t\t\t\t\t\tcurrentTimeStamp + nextInterval - this.firstTimeStamp > this.replayTo\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tnextInterval = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tscheduleNext(nextInterval);\n\t\t\t\temitter(playbackOps);\n\t\t\t};\n\t\t\tconst scheduleNext = (nextInterval: number) => {\n\t\t\t\tif (nextInterval >= 0 && current < fetchedOps.length) {\n\t\t\t\t\tsetTimeout(replayNextOps, nextInterval);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replayCurrent += current;\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t};\n\t\t\tscheduleNext(ReplayControllerStatic.DelayInterval);\n\t\t});\n\t}\n}\n\nexport class ReplayDocumentDeltaConnection\n\textends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n\timplements IDocumentDeltaConnection, IDisposable\n{\n\t/**\n\t * Creates a new delta connection and mimics the delta connection to replay ops on it.\n\t * @param documentService - The document service to be used to get underlying endpoints.\n\t */\n\tpublic static create(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): IDocumentDeltaConnection {\n\t\tconst connection: IConnected = {\n\t\t\tclaims: ReplayDocumentDeltaConnection.claims,\n\t\t\tclientId: \"PseudoClientId\",\n\t\t\texisting: true,\n\t\t\tinitialMessages: [],\n\t\t\tinitialSignals: [],\n\t\t\tinitialClients: [],\n\t\t\tmaxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\tmode: \"read\",\n\t\t\tserviceConfiguration: {\n\t\t\t\tblockSize: 64436,\n\t\t\t\tmaxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\t},\n\t\t\tsupportedVersions: [ReplayDocumentDeltaConnection.replayProtocolVersion],\n\t\t\tversion: ReplayDocumentDeltaConnection.replayProtocolVersion,\n\t\t};\n\t\tconst deltaConnection = new ReplayDocumentDeltaConnection(connection);\n\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\tdeltaConnection.fetchAndEmitOps(documentStorageService, controller);\n\n\t\treturn deltaConnection;\n\t}\n\n\tprivate static readonly replayProtocolVersion = \"^0.1.0\";\n\t// Since the replay service never actually sends messages the size below is arbitrary\n\tprivate static readonly ReplayMaxMessageSize = 16 * 1024;\n\n\tprivate static readonly claims: ITokenClaims = {\n\t\tdocumentId: ReplayDocumentId,\n\t\tscopes: [ScopeType.DocRead],\n\t\ttenantId: \"\",\n\t\tuser: {\n\t\t\tid: \"\",\n\t\t},\n\t\tiat: Math.round(new Date().getTime() / 1000),\n\t\texp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n\t\tver: \"1.0\",\n\t};\n\n\tpublic get clientId(): string {\n\t\treturn this.details.clientId;\n\t}\n\n\tpublic get mode(): ConnectionMode {\n\t\treturn this.details.mode;\n\t}\n\n\tpublic get claims(): ITokenClaims {\n\t\treturn this.details.claims;\n\t}\n\n\tpublic get existing(): boolean {\n\t\treturn this.details.existing;\n\t}\n\n\tpublic get version(): string {\n\t\treturn this.details.version;\n\t}\n\n\tpublic get initialMessages(): ISequencedDocumentMessage[] {\n\t\treturn this.details.initialMessages;\n\t}\n\n\tpublic get initialSignals(): ISignalMessage[] {\n\t\treturn this.details.initialSignals;\n\t}\n\n\tpublic get initialClients(): ISignalClient[] {\n\t\treturn this.details.initialClients;\n\t}\n\n\tpublic get serviceConfiguration(): IClientConfiguration {\n\t\treturn this.details.serviceConfiguration;\n\t}\n\n\tpublic readonly maxMessageSize = ReplayDocumentDeltaConnection.ReplayMaxMessageSize;\n\n\tconstructor(public details: IConnected) {\n\t\tsuper();\n\t}\n\n\tpublic submit(documentMessage: IDocumentMessage[]): void {\n\t\t// ReplayDocumentDeltaConnection.submit() can't be called - client never sees its own join on,\n\t\t// and thus can never move to sending ops.\n\t\tthrow new Error(\"ReplayDocumentDeltaConnection.submit() can't be called\");\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-misused-promises\n\tpublic async submitSignal(message: any) {}\n\n\tprivate _disposed = false;\n\tpublic get disposed() {\n\t\treturn this._disposed;\n\t}\n\tpublic dispose() {\n\t\tthis._disposed = true;\n\t}\n\n\t/**\n\t * This gets the specified ops from the delta storage endpoint and replays them in the replayer.\n\t */\n\tprivate async fetchAndEmitOps(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): Promise<void> {\n\t\tlet done;\n\t\tlet replayPromiseChain = Promise.resolve();\n\n\t\tlet currentOp = await controller.getStartingOpSequence();\n\n\t\tdo {\n\t\t\tconst fetchTo = controller.fetchTo(currentOp);\n\n\t\t\tconst abortController = new AbortController();\n\t\t\tconst stream = documentStorageService.fetchMessages(\n\t\t\t\tcurrentOp + 1,\n\t\t\t\tfetchTo,\n\t\t\t\tabortController.signal,\n\t\t\t);\n\t\t\tdo {\n\t\t\t\tconst result = await stream.read();\n\n\t\t\t\tif (result.done) {\n\t\t\t\t\t// No more ops. But, they can show up later, either because document was just created,\n\t\t\t\t\t// or because another client keeps submitting new ops.\n\t\t\t\t\tdone = controller.isDoneFetch(currentOp, undefined);\n\t\t\t\t\tif (!done) {\n\t\t\t\t\t\tawait delay(2000);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treplayPromiseChain = replayPromiseChain.then(async () =>\n\t\t\t\t\tcontroller.replay((ops) => this.emit(\"op\", ReplayDocumentId, ops), messages),\n\t\t\t\t);\n\n\t\t\t\tconst messages = result.value;\n\t\t\t\tcurrentOp += messages.length;\n\t\t\t\tdone = controller.isDoneFetch(currentOp, messages[messages.length - 1].timestamp);\n\t\t\t} while (!done);\n\n\t\t\tabortController.abort();\n\t\t} while (!done);\n\t\treturn replayPromiseChain;\n\t}\n}\n"]}
1
+ {"version":3,"file":"replayDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/replayDocumentDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAEjE,kEAA4D;AAE5D,0EAeqD;AAErD,+DAAyD;AAEzD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,MAAa,sBAAuB,SAAQ,sCAAgB;IAM3D,gDAAgD;IAEhD;;;;;;OAMG;IACH,YACiB,UAAkB,EAClB,QAAgB,EAChB,UAAoB;QAEpC,KAAK,EAAE,CAAC;QAJQ,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAU;QAb7B,kBAAa,GAAG,CAAC,CAAC;QAgBzB,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YACzB,qFAAqF;YACrF,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QACnB,CAAC;IACF,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,eAAiC;QACzD,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,SAAwB,EAAE,KAAa;QAC/D,OAAO,EAAE,CAAC;IACX,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,OAAkB;QAC9C,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,MAAc;QACnC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,qBAAqB;QACjC,OAAO,CAAC,CAAC;IACV,CAAC;IAEM,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ved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IDisposable } from \"@fluidframework/core-interfaces\";\nimport { delay } from \"@fluidframework/core-utils/internal\";\nimport { ConnectionMode } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIClientConfiguration,\n\tIConnected,\n\tIDocumentMessage,\n\tISignalClient,\n\tITokenClaims,\n\tIVersion,\n\tScopeType,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n\ttype ISnapshotTree,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { ReplayController } from \"./replayController.js\";\n\nconst ReplayDocumentId = \"documentId\";\n\nexport class ReplayControllerStatic extends ReplayController {\n\tprivate static readonly DelayInterval = 50;\n\tprivate static readonly ReplayResolution = 15;\n\n\tprivate firstTimeStamp: number | undefined;\n\tprivate replayCurrent = 0;\n\t// Simulated delay interval for emitting the ops\n\n\t/**\n\t * Helper class\n\t *\n\t * @param replayFrom - First op to be played on socket.\n\t * @param replayTo - Last op number to be played on socket.\n\t * @param unitIsTime - True is user want to play ops that are within a replay resolution window.\n\t */\n\tpublic constructor(\n\t\tpublic readonly replayFrom: number,\n\t\tpublic readonly replayTo: number,\n\t\tpublic readonly unitIsTime?: boolean,\n\t) {\n\t\tsuper();\n\t\tif (unitIsTime !== true) {\n\t\t\t// There is no code in here to start with snapshot, thus we have to start with op #0.\n\t\t\tthis.replayTo = 0;\n\t\t}\n\t}\n\n\tpublic async initStorage(documentService: IDocumentService): Promise<boolean> {\n\t\treturn true;\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\treturn [];\n\t}\n\n\tpublic async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n\t\treturn version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async getStartingOpSequence(): Promise<number> {\n\t\treturn 0;\n\t}\n\n\tpublic fetchTo(currentOp: number): number | undefined {\n\t\tif (!(this.unitIsTime !== true && this.replayTo >= 0)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.replayTo;\n\t}\n\n\tpublic isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean {\n\t\tif (this.replayTo >= 0) {\n\t\t\tif (this.unitIsTime === true) {\n\t\t\t\treturn (\n\t\t\t\t\tlastTimeStamp !== undefined &&\n\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\tlastTimeStamp - this.firstTimeStamp >= this.replayTo\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn currentOp >= this.replayTo;\n\t\t}\n\t\treturn lastTimeStamp === undefined; // No more ops\n\t}\n\n\tpublic skipToIndex(fetchedOps: ISequencedDocumentMessage[]): number {\n\t\tif (this.replayFrom <= 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (this.unitIsTime === true) {\n\t\t\tfor (const [i, { timestamp }] of fetchedOps.entries()) {\n\t\t\t\tif (timestamp !== undefined) {\n\t\t\t\t\tif (this.firstTimeStamp === undefined) {\n\t\t\t\t\t\tthis.firstTimeStamp = timestamp;\n\t\t\t\t\t}\n\t\t\t\t\tif (timestamp - this.firstTimeStamp >= this.replayFrom) {\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (this.replayFrom > this.replayCurrent) {\n\t\t\treturn this.replayFrom - this.replayCurrent;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic async replay(\n\t\temitter: (op: ISequencedDocumentMessage[]) => void,\n\t\tfetchedOps: ISequencedDocumentMessage[],\n\t): Promise<void> {\n\t\tlet current = this.skipToIndex(fetchedOps);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tconst replayNextOps = (): void => {\n\t\t\t\t// Emit the ops from replay to the end every \"deltainterval\" milliseconds\n\t\t\t\t// to simulate the socket stream\n\t\t\t\tconst currentOp = fetchedOps[current];\n\t\t\t\tconst playbackOps = [currentOp];\n\t\t\t\tlet nextInterval = ReplayControllerStatic.DelayInterval;\n\t\t\t\tcurrent += 1;\n\n\t\t\t\tif (this.unitIsTime === true) {\n\t\t\t\t\tconst currentTimeStamp = currentOp.timestamp;\n\t\t\t\t\tif (currentTimeStamp !== undefined) {\n\t\t\t\t\t\t// Emit more ops that is in the ReplayResolution window\n\n\t\t\t\t\t\twhile (current < fetchedOps.length) {\n\t\t\t\t\t\t\tconst op = fetchedOps[current];\n\t\t\t\t\t\t\tif (op.timestamp === undefined) {\n\t\t\t\t\t\t\t\t// Missing timestamp, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst timeDiff = op.timestamp - currentTimeStamp;\n\t\t\t\t\t\t\tif (timeDiff >= ReplayControllerStatic.ReplayResolution) {\n\t\t\t\t\t\t\t\t// Time exceeded the resolution window, break out the loop\n\t\t\t\t\t\t\t\t// and delay for the time difference.\n\t\t\t\t\t\t\t\tnextInterval = timeDiff;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (timeDiff < 0) {\n\t\t\t\t\t\t\t\t// Time have regressed, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// The op is within the ReplayResolution emit it now\n\t\t\t\t\t\t\tplaybackOps.push(op);\n\t\t\t\t\t\t\tcurrent += 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\t\t\tthis.replayTo >= 0 &&\n\t\t\t\t\t\t\tcurrentTimeStamp + nextInterval - this.firstTimeStamp > this.replayTo\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tnextInterval = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tscheduleNext(nextInterval);\n\t\t\t\temitter(playbackOps);\n\t\t\t};\n\t\t\tconst scheduleNext = (nextInterval: number): void => {\n\t\t\t\tif (nextInterval >= 0 && current < fetchedOps.length) {\n\t\t\t\t\tsetTimeout(replayNextOps, nextInterval);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replayCurrent += current;\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t};\n\t\t\tscheduleNext(ReplayControllerStatic.DelayInterval);\n\t\t});\n\t}\n}\n\nexport class ReplayDocumentDeltaConnection\n\textends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n\timplements IDocumentDeltaConnection, IDisposable\n{\n\t/**\n\t * Creates a new delta connection and mimics the delta connection to replay ops on it.\n\t * @param documentService - The document service to be used to get underlying endpoints.\n\t */\n\tpublic static create(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): IDocumentDeltaConnection {\n\t\tconst connection: IConnected = {\n\t\t\tclaims: ReplayDocumentDeltaConnection.claims,\n\t\t\tclientId: \"PseudoClientId\",\n\t\t\texisting: true,\n\t\t\tinitialMessages: [],\n\t\t\tinitialSignals: [],\n\t\t\tinitialClients: [],\n\t\t\tmaxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\tmode: \"read\",\n\t\t\tserviceConfiguration: {\n\t\t\t\tblockSize: 64436,\n\t\t\t\tmaxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\t},\n\t\t\tsupportedVersions: [ReplayDocumentDeltaConnection.replayProtocolVersion],\n\t\t\tversion: ReplayDocumentDeltaConnection.replayProtocolVersion,\n\t\t};\n\t\tconst deltaConnection = new ReplayDocumentDeltaConnection(connection);\n\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\tdeltaConnection.fetchAndEmitOps(documentStorageService, controller);\n\n\t\treturn deltaConnection;\n\t}\n\n\tprivate static readonly replayProtocolVersion = \"^0.1.0\";\n\t// Since the replay service never actually sends messages the size below is arbitrary\n\tprivate static readonly ReplayMaxMessageSize = 16 * 1024;\n\n\tprivate static readonly claims: ITokenClaims = {\n\t\tdocumentId: ReplayDocumentId,\n\t\tscopes: [ScopeType.DocRead],\n\t\ttenantId: \"\",\n\t\tuser: {\n\t\t\tid: \"\",\n\t\t},\n\t\tiat: Math.round(new Date().getTime() / 1000),\n\t\texp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n\t\tver: \"1.0\",\n\t};\n\n\tpublic get clientId(): string {\n\t\treturn this.details.clientId;\n\t}\n\n\tpublic get mode(): ConnectionMode {\n\t\treturn this.details.mode;\n\t}\n\n\tpublic get claims(): ITokenClaims {\n\t\treturn this.details.claims;\n\t}\n\n\tpublic get existing(): boolean {\n\t\treturn this.details.existing;\n\t}\n\n\tpublic get version(): string {\n\t\treturn this.details.version;\n\t}\n\n\tpublic get initialMessages(): ISequencedDocumentMessage[] {\n\t\treturn this.details.initialMessages;\n\t}\n\n\tpublic get initialSignals(): ISignalMessage[] {\n\t\treturn this.details.initialSignals;\n\t}\n\n\tpublic get initialClients(): ISignalClient[] {\n\t\treturn this.details.initialClients;\n\t}\n\n\tpublic get serviceConfiguration(): IClientConfiguration {\n\t\treturn this.details.serviceConfiguration;\n\t}\n\n\tpublic readonly maxMessageSize = ReplayDocumentDeltaConnection.ReplayMaxMessageSize;\n\n\tconstructor(public details: IConnected) {\n\t\tsuper();\n\t}\n\n\tpublic submit(documentMessage: IDocumentMessage[]): void {\n\t\t// ReplayDocumentDeltaConnection.submit() can't be called - client never sees its own join on,\n\t\t// and thus can never move to sending ops.\n\t\tthrow new Error(\"ReplayDocumentDeltaConnection.submit() can't be called\");\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-misused-promises\n\tpublic async submitSignal(message: unknown): Promise<void> {}\n\n\tprivate _disposed = false;\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\tpublic dispose(): void {\n\t\tthis._disposed = true;\n\t}\n\n\t/**\n\t * This gets the specified ops from the delta storage endpoint and replays them in the replayer.\n\t */\n\tprivate async fetchAndEmitOps(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): Promise<void> {\n\t\tlet done;\n\t\tlet replayPromiseChain = Promise.resolve();\n\n\t\tlet currentOp = await controller.getStartingOpSequence();\n\n\t\tdo {\n\t\t\tconst fetchTo = controller.fetchTo(currentOp);\n\n\t\t\tconst abortController = new AbortController();\n\t\t\tconst stream = documentStorageService.fetchMessages(\n\t\t\t\tcurrentOp + 1,\n\t\t\t\tfetchTo,\n\t\t\t\tabortController.signal,\n\t\t\t);\n\t\t\tdo {\n\t\t\t\tconst result = await stream.read();\n\n\t\t\t\tif (result.done) {\n\t\t\t\t\t// No more ops. But, they can show up later, either because document was just created,\n\t\t\t\t\t// or because another client keeps submitting new ops.\n\t\t\t\t\tdone = controller.isDoneFetch(currentOp, undefined);\n\t\t\t\t\tif (!done) {\n\t\t\t\t\t\tawait delay(2000);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treplayPromiseChain = replayPromiseChain.then(async () =>\n\t\t\t\t\tcontroller.replay((ops) => this.emit(\"op\", ReplayDocumentId, ops), messages),\n\t\t\t\t);\n\n\t\t\t\tconst messages = result.value;\n\t\t\t\tcurrentOp += messages.length;\n\t\t\t\tdone = controller.isDoneFetch(currentOp, messages[messages.length - 1].timestamp);\n\t\t\t} while (!done);\n\n\t\t\tabortController.abort();\n\t\t} while (!done);\n\t\treturn replayPromiseChain;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"replayDocumentService.d.ts","sourceRoot":"","sources":["../src/replayDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,OA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Y,GAAZ,YAAY,CAA0B;IAGxD,CAAC;IAEM,OAAO,KAAI,CAAC;IAEnB,8EAA8E;IAC9E,IAAW,WAAW;QACrB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,sDAAwB,EAAE,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;CACD;AA3DD,sDA2DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IClient } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentServiceEvents,\n\tIDocumentService,\n\tIDocumentStorageService,\n\tIDocumentDeltaConnection,\n\tIResolvedUrl,\n\tIDocumentDeltaStorageService,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService.js\";\nimport { ReplayController } from \"./replayController.js\";\nimport { ReplayDocumentDeltaConnection } from \"./replayDocumentDeltaConnection.js\";\n\n/**\n * The Replay document service dummies out the snapshot and the delta storage.\n * Delta connection simulates the socket by fetching the ops from delta storage\n * and emitting them with a pre determined delay\n * @internal\n */\nexport class ReplayDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tpublic static async create(\n\t\tdocumentService: IDocumentService,\n\t\tcontroller: ReplayController,\n\t): Promise<IDocumentService> {\n\t\tconst useController = await controller.initStorage(documentService);\n\t\tif (!useController) {\n\t\t\treturn documentService;\n\t\t}\n\n\t\tconst deltaConnection = ReplayDocumentDeltaConnection.create(\n\t\t\tawait documentService.connectToDeltaStorage(),\n\t\t\tcontroller,\n\t\t);\n\t\treturn new ReplayDocumentService(controller, deltaConnection);\n\t}\n\n\tconstructor(\n\t\tprivate readonly controller: IDocumentStorageService,\n\t\tprivate readonly deltaStorage: IDocumentDeltaConnection,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose() {}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic get resolvedUrl(): IResolvedUrl {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\t/**\n\t * Connects to a storage endpoint for snapshot service and blobs.\n\t * @returns returns the dummy document storage service for replay driver.\n\t */\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this.controller;\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint for getting ops between a range.\n\t * @returns returns the dummy document delta storage service for replay driver.\n\t */\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint of provided documentService to get ops and then replaying\n\t * them so as to mimic a delta stream endpoint.\n\t * @param client - Client that connects to socket.\n\t * @returns returns the delta stream service which replay ops from --from to --to arguments.\n\t */\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\treturn this.deltaStorage;\n\t}\n}\n"]}
1
+ {"version":3,"file":"replayDocumentService.js","sourceRoot":"","sources":["../src/replayDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAWjE,+EAAyE;AAEzE,yFAAmF;AAEnF;;;;;GAKG;AACH,MAAa,qBACZ,SAAQ,gCAAyC;IAG1C,MAAM,CAAC,KAAK,CAAC,MAAM,CACzB,eAAiC,EACjC,UAA4B;QAE5B,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QACpE,IAAI,CAAC,aAAa,EAAE,CAAC;YACpB,OAAO,eAAe,CAAC;QACxB,CAAC;QAED,MAAM,eAAe,GAAG,gEAA6B,CAAC,MAAM,CAC3D,MAAM,eAAe,CAAC,qBAAqB,EAAE,EAC7C,UAAU,CACV,CAAC;QACF,OAAO,IAAI,qBAAqB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC/D,CAAC;IAED,YACkB,UAAmC,EACnC,YAAsC;QAEvD,KAAK,EAAE,CAAC;QAHS,eAAU,GAAV,UAAU,CAAyB;QACnC,iBAAY,GAAZ,YAAY,CAA0B;IAGxD,CAAC;IAEM,OAAO,KAAU,CAAC;IAEzB,8EAA8E;IAC9E,IAAW,WAAW;QACrB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,sDAAwB,EAAE,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;CACD;AA3DD,sDA2DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IClient } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentServiceEvents,\n\tIDocumentService,\n\tIDocumentStorageService,\n\tIDocumentDeltaConnection,\n\tIResolvedUrl,\n\tIDocumentDeltaStorageService,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService.js\";\nimport { ReplayController } from \"./replayController.js\";\nimport { ReplayDocumentDeltaConnection } from \"./replayDocumentDeltaConnection.js\";\n\n/**\n * The Replay document service dummies out the snapshot and the delta storage.\n * Delta connection simulates the socket by fetching the ops from delta storage\n * and emitting them with a pre determined delay\n * @internal\n */\nexport class ReplayDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tpublic static async create(\n\t\tdocumentService: IDocumentService,\n\t\tcontroller: ReplayController,\n\t): Promise<IDocumentService> {\n\t\tconst useController = await controller.initStorage(documentService);\n\t\tif (!useController) {\n\t\t\treturn documentService;\n\t\t}\n\n\t\tconst deltaConnection = ReplayDocumentDeltaConnection.create(\n\t\t\tawait documentService.connectToDeltaStorage(),\n\t\t\tcontroller,\n\t\t);\n\t\treturn new ReplayDocumentService(controller, deltaConnection);\n\t}\n\n\tconstructor(\n\t\tprivate readonly controller: IDocumentStorageService,\n\t\tprivate readonly deltaStorage: IDocumentDeltaConnection,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose(): void {}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic get resolvedUrl(): IResolvedUrl {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\t/**\n\t * Connects to a storage endpoint for snapshot service and blobs.\n\t * @returns returns the dummy document storage service for replay driver.\n\t */\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this.controller;\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint for getting ops between a range.\n\t * @returns returns the dummy document delta storage service for replay driver.\n\t */\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint of provided documentService to get ops and then replaying\n\t * them so as to mimic a delta stream endpoint.\n\t * @param client - Client that connects to socket.\n\t * @returns returns the delta stream service which replay ops from --from to --to arguments.\n\t */\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\treturn this.deltaStorage;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"replayDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/replayDocumentServiceFactory.ts"],"names":[],"mappings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OAGG;IACH,IAAW,mBAAmB;QAC7B,OAAQ,IAAI,CAAC,sBAA2D;aACtE,mBAAmB,CAAC;IACvB,CAAC;IAED,YACkB,sBAA+C,EAC/C,UAA4B;QAD5B,2BAAsB,GAAtB,sBAAsB,CAAyB;QAC/C,eAAU,GAAV,UAAU,CAAkB;IAC3C,CAAC;IAEJ;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,iEAAiE;QACjE,wGAAwG;QACxG,MAAM,YAAY,GAAG,IAAA,4BAAiB,EAAC;YACtC,MAAM;YACN,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;SACvC,CAAC,CAAC;QAEH,OAAO,gDAAqB,CAAC,MAAM,CAClC,MAAM,IAAI,CAAC,sBAAsB,CAAC,qBAAqB,CACtD,WAAW,EACX,YAAY,EACZ,kBAAkB,CAClB,EACD,IAAI,CAAC,UAAU,CACf,CAAC;IACH,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AA/DD,oEA+DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ILayerCompatDetails } from \"@fluid-internal/client-utils\";\nimport { ITelemetryBaseLogger, type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { ReplayController } from \"./replayController.js\";\nimport { ReplayControllerStatic } from \"./replayDocumentDeltaConnection.js\";\nimport { ReplayDocumentService } from \"./replayDocumentService.js\";\n\n/**\n * @internal\n */\nexport class ReplayDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic static create(\n\t\tfrom: number,\n\t\tto: number,\n\t\tdocumentServiceFactory: IDocumentServiceFactory,\n\t) {\n\t\treturn new ReplayDocumentServiceFactory(\n\t\t\tdocumentServiceFactory,\n\t\t\tnew ReplayControllerStatic(from, to),\n\t\t);\n\t}\n\n\t/**\n\t * The compatibility details of the base Driver layer that is exposed to the Loader layer\n\t * for validating Loader-Driver compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails | undefined {\n\t\treturn (this.documentServiceFactory as FluidObject<ILayerCompatDetails>)\n\t\t\t.ILayerCompatDetails;\n\t}\n\n\tpublic constructor(\n\t\tprivate readonly documentServiceFactory: IDocumentServiceFactory,\n\t\tprivate readonly controller: ReplayController,\n\t) {}\n\n\t/**\n\t * Creates a replay document service which uses the document service of provided\n\t * documentServiceFactory for connecting to delta stream endpoint.\n\t * @param resolvedUrl - URL to be used for connecting to endpoints.\n\t * @returns returns the requested document service\n\t */\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\t// Always include isReplay: true on events for the Replay Driver.\n\t\t// It's used in testing/debugging scenarios, so we want to be able to filter these events out sometimes.\n\t\tconst replayLogger = createChildLogger({\n\t\t\tlogger,\n\t\t\tproperties: { all: { isReplay: true } },\n\t\t});\n\n\t\treturn ReplayDocumentService.create(\n\t\t\tawait this.documentServiceFactory.createDocumentService(\n\t\t\t\tresolvedUrl,\n\t\t\t\treplayLogger,\n\t\t\t\tclientIsSummarizer,\n\t\t\t),\n\t\t\tthis.controller,\n\t\t);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"replayDocumentServiceFactory.js","sourceRoot":"","sources":["../src/replayDocumentServiceFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH,uEAA6E;AAG7E,yFAA4E;AAC5E,yEAAmE;AAEnE;;GAEG;AACH,MAAa,4BAA4B;IACjC,MAAM,CAAC,MAAM,CACnB,IAAY,EACZ,EAAU,EACV,sBAA+C;QAE/C,OAAO,IAAI,4BAA4B,CACtC,sBAAsB,EACtB,IAAI,yDAAsB,CAAC,IAAI,EAAE,EAAE,CAAC,CACpC,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,IAAW,mBAAmB;QAC7B,OAAQ,IAAI,CAAC,sBAA2D;aACtE,mBAAmB,CAAC;IACvB,CAAC;IAED,YACkB,sBAA+C,EAC/C,UAA4B;QAD5B,2BAAsB,GAAtB,sBAAsB,CAAyB;QAC/C,eAAU,GAAV,UAAU,CAAkB;IAC3C,CAAC;IAEJ;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,iEAAiE;QACjE,wGAAwG;QACxG,MAAM,YAAY,GAAG,IAAA,4BAAiB,EAAC;YACtC,MAAM;YACN,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;SACvC,CAAC,CAAC;QAEH,OAAO,gDAAqB,CAAC,MAAM,CAClC,MAAM,IAAI,CAAC,sBAAsB,CAAC,qBAAqB,CACtD,WAAW,EACX,YAAY,EACZ,kBAAkB,CAClB,EACD,IAAI,CAAC,UAAU,CACf,CAAC;IACH,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AA/DD,oEA+DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ILayerCompatDetails } from \"@fluid-internal/client-utils\";\nimport { ITelemetryBaseLogger, type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { ReplayController } from \"./replayController.js\";\nimport { ReplayControllerStatic } from \"./replayDocumentDeltaConnection.js\";\nimport { ReplayDocumentService } from \"./replayDocumentService.js\";\n\n/**\n * @internal\n */\nexport class ReplayDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic static create(\n\t\tfrom: number,\n\t\tto: number,\n\t\tdocumentServiceFactory: IDocumentServiceFactory,\n\t): ReplayDocumentServiceFactory {\n\t\treturn new ReplayDocumentServiceFactory(\n\t\t\tdocumentServiceFactory,\n\t\t\tnew ReplayControllerStatic(from, to),\n\t\t);\n\t}\n\n\t/**\n\t * The compatibility details of the base Driver layer that is exposed to the Loader layer\n\t * for validating Loader-Driver compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails | undefined {\n\t\treturn (this.documentServiceFactory as FluidObject<ILayerCompatDetails>)\n\t\t\t.ILayerCompatDetails;\n\t}\n\n\tpublic constructor(\n\t\tprivate readonly documentServiceFactory: IDocumentServiceFactory,\n\t\tprivate readonly controller: ReplayController,\n\t) {}\n\n\t/**\n\t * Creates a replay document service which uses the document service of provided\n\t * documentServiceFactory for connecting to delta stream endpoint.\n\t * @param resolvedUrl - URL to be used for connecting to endpoints.\n\t * @returns returns the requested document service\n\t */\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\t// Always include isReplay: true on events for the Replay Driver.\n\t\t// It's used in testing/debugging scenarios, so we want to be able to filter these events out sometimes.\n\t\tconst replayLogger = createChildLogger({\n\t\t\tlogger,\n\t\t\tproperties: { all: { isReplay: true } },\n\t\t});\n\n\t\treturn ReplayDocumentService.create(\n\t\t\tawait this.documentServiceFactory.createDocumentService(\n\t\t\t\tresolvedUrl,\n\t\t\t\treplayLogger,\n\t\t\t\tclientIsSummarizer,\n\t\t\t),\n\t\t\tthis.controller,\n\t\t);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"storageImplementations.d.ts","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,KAAK,EACL,QAAQ,EACR,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAG/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,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AAO,GAAP,OAAO,CAAyB;IAGlD,CAAC;IAEM,OAAO,KAAI,CAAC;IAEZ,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,sDAAwB,EAAE,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,4DAA4D;QAC5D,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;CACD;AAzBD,oEAyBC;AAED;;GAEG;AACH,MAAa,mCAAmC;IAC/C,YAAsC,OAAgC;QAAhC,YAAO,GAAP,OAAO,CAAyB;IAAG,CAAC;IAEnE,KAAK,CAAC,qBAAqB,CACjC,OAAqB,EACrB,MAA4B,EAC5B,kBAA4B;QAE5B,OAAO,IAAI,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA2B,EAC3B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AApBD,kFAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { IClient, ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServiceFactory,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n\tISnapshotTree,\n\tITree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { buildSnapshotTree } from \"@fluidframework/driver-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService.js\";\nimport { ReadDocumentStorageServiceBase } from \"./replayController.js\";\n\n/**\n * Structure of snapshot on disk, when we store snapshot as single file\n * @internal\n */\nexport interface IFileSnapshot {\n\ttree: ITree;\n\tcommits: { [key: string]: ITree };\n}\n\n/**\n * @internal\n */\nexport class FileSnapshotReader\n\textends ReadDocumentStorageServiceBase\n\timplements IDocumentStorageService\n{\n\t// IVersion.treeId used to communicate between getVersions() & getSnapshotTree() calls to indicate IVersion is ours.\n\tprotected static readonly FileStorageVersionTreeId = \"FileStorageTreeId\";\n\n\tprotected docId?: string;\n\tprotected docTree: ISnapshotTree;\n\tprotected blobs: Map<string, ArrayBufferLike>;\n\tprotected readonly commits: { [key: string]: ITree } = {};\n\tprotected readonly trees: { [key: string]: ISnapshotTree } = {};\n\n\tpublic constructor(json: IFileSnapshot) {\n\t\tsuper();\n\t\tthis.commits = json.commits;\n\n\t\tthis.blobs = new Map<string, ArrayBufferLike>();\n\t\tthis.docTree = buildSnapshotTree(json.tree.entries, this.blobs);\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (this.docId === undefined || this.docId === versionId || versionId === null) {\n\t\t\tif (versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\t\t\treturn [{ id: \"latest\", treeId: \"\" }];\n\t\t}\n\n\t\tif (this.commits[versionId] !== undefined) {\n\t\t\treturn [{ id: versionId, treeId: FileSnapshotReader.FileStorageVersionTreeId }];\n\t\t}\n\t\tthrow new Error(`Unknown version ID: ${versionId}`);\n\t}\n\n\tpublic async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {\n\t\tif (!versionRequested || versionRequested.id === \"latest\") {\n\t\t\treturn this.docTree;\n\t\t}\n\t\tif (versionRequested.treeId !== FileSnapshotReader.FileStorageVersionTreeId) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\tthrow new Error(`Unknown version id: ${versionRequested}`);\n\t\t}\n\n\t\tlet snapshotTree = this.trees[versionRequested.id];\n\t\tif (snapshotTree === undefined) {\n\t\t\tconst tree = this.commits[versionRequested.id];\n\t\t\tif (tree === undefined) {\n\t\t\t\tthrow new Error(`Can't find version ${versionRequested.id}`);\n\t\t\t}\n\n\t\t\tthis.trees[versionRequested.id] = snapshotTree = buildSnapshotTree(\n\t\t\t\ttree.entries,\n\t\t\t\tthis.blobs,\n\t\t\t);\n\t\t}\n\t\treturn snapshotTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tconst blob = this.blobs.get(blobId);\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\t\tthrow new Error(`Unknown blob ID: ${blobId}`);\n\t}\n}\n\n/**\n * @internal\n */\nexport class SnapshotStorage extends ReadDocumentStorageServiceBase {\n\tprotected docId?: string;\n\n\tconstructor(\n\t\tprotected readonly storage: IDocumentStorageService,\n\t\tprotected readonly docTree: ISnapshotTree | null,\n\t) {\n\t\tsuper();\n\t\tassert(!!this.docTree, 0x0b0 /* \"Missing document snapshot tree!\" */);\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (this.docId === undefined || this.docId === versionId || versionId === null) {\n\t\t\tif (versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\t\t\treturn [{ id: \"latest\", treeId: \"\" }];\n\t\t}\n\t\treturn this.storage.getVersions(versionId, count);\n\t}\n\n\tpublic async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {\n\t\tif (versionRequested && versionRequested.id !== \"latest\") {\n\t\t\treturn this.storage.getSnapshotTree(versionRequested);\n\t\t}\n\n\t\treturn this.docTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.storage.readBlob(blobId);\n\t}\n}\n\nexport class StaticStorageDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tconstructor(\n\t\tpublic readonly resolvedUrl: IResolvedUrl,\n\t\tprivate readonly storage: IDocumentStorageService,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose() {}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this.storage;\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\t// We have no delta stream, so make it not return forever...\n\t\treturn new Promise(() => {});\n\t}\n}\n\n/**\n * @internal\n */\nexport class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic constructor(protected readonly storage: IDocumentStorageService) {}\n\n\tpublic async createDocumentService(\n\t\tfileURL: IResolvedUrl,\n\t\tlogger?: ITelemetryLoggerExt,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn new StaticStorageDocumentService(fileURL, this.storage);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger: ITelemetryLoggerExt,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"storageImplementations.js","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AACjE,kEAA6D;AAc7D,oEAA0E;AAG1E,+EAAyE;AACzE,+DAAuE;AAWvE;;GAEG;AACH,MAAa,kBACZ,SAAQ,oDAA8B;IAYtC,YAAmB,IAAmB;QACrC,KAAK,EAAE,CAAC;QAJU,YAAO,GAA6B,EAAE,CAAC;QACvC,UAAK,GAAq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,MAAa,mCAAmC;IAC/C,YAAsC,OAAgC;QAAhC,YAAO,GAAP,OAAO,CAAyB;IAAG,CAAC;IAEnE,KAAK,CAAC,qBAAqB,CACjC,OAAqB,EACrB,MAA4B,EAC5B,kBAA4B;QAE5B,OAAO,IAAI,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA2B,EAC3B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AApBD,kFAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { IClient, ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServiceFactory,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n\tISnapshotTree,\n\tITree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { buildSnapshotTree } from \"@fluidframework/driver-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService.js\";\nimport { ReadDocumentStorageServiceBase } from \"./replayController.js\";\n\n/**\n * Structure of snapshot on disk, when we store snapshot as single file\n * @internal\n */\nexport interface IFileSnapshot {\n\ttree: ITree;\n\tcommits: { [key: string]: ITree };\n}\n\n/**\n * @internal\n */\nexport class FileSnapshotReader\n\textends ReadDocumentStorageServiceBase\n\timplements IDocumentStorageService\n{\n\t// IVersion.treeId used to communicate between getVersions() & getSnapshotTree() calls to indicate IVersion is ours.\n\tprotected static readonly FileStorageVersionTreeId = \"FileStorageTreeId\";\n\n\tprotected docId?: string;\n\tprotected docTree: ISnapshotTree;\n\tprotected blobs: Map<string, ArrayBufferLike>;\n\tprotected readonly commits: { [key: string]: ITree } = {};\n\tprotected readonly trees: { [key: string]: ISnapshotTree } = {};\n\n\tpublic constructor(json: IFileSnapshot) {\n\t\tsuper();\n\t\tthis.commits = json.commits;\n\n\t\tthis.blobs = new Map<string, ArrayBufferLike>();\n\t\tthis.docTree = buildSnapshotTree(json.tree.entries, this.blobs);\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (this.docId === undefined || this.docId === versionId || versionId === null) {\n\t\t\tif (versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\t\t\treturn [{ id: \"latest\", treeId: \"\" }];\n\t\t}\n\n\t\tif (this.commits[versionId] !== undefined) {\n\t\t\treturn [{ id: versionId, treeId: FileSnapshotReader.FileStorageVersionTreeId }];\n\t\t}\n\t\tthrow new Error(`Unknown version ID: ${versionId}`);\n\t}\n\n\tpublic async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {\n\t\tif (!versionRequested || versionRequested.id === \"latest\") {\n\t\t\treturn this.docTree;\n\t\t}\n\t\tif (versionRequested.treeId !== FileSnapshotReader.FileStorageVersionTreeId) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\tthrow new Error(`Unknown version id: ${versionRequested}`);\n\t\t}\n\n\t\tlet snapshotTree = this.trees[versionRequested.id];\n\t\tif (snapshotTree === undefined) {\n\t\t\tconst tree = this.commits[versionRequested.id];\n\t\t\tif (tree === undefined) {\n\t\t\t\tthrow new Error(`Can't find version ${versionRequested.id}`);\n\t\t\t}\n\n\t\t\tthis.trees[versionRequested.id] = snapshotTree = buildSnapshotTree(\n\t\t\t\ttree.entries,\n\t\t\t\tthis.blobs,\n\t\t\t);\n\t\t}\n\t\treturn snapshotTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tconst blob = this.blobs.get(blobId);\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\t\tthrow new Error(`Unknown blob ID: ${blobId}`);\n\t}\n}\n\n/**\n * @internal\n */\nexport class SnapshotStorage extends ReadDocumentStorageServiceBase {\n\tprotected docId?: string;\n\n\tconstructor(\n\t\tprotected readonly storage: IDocumentStorageService,\n\t\tprotected readonly docTree: ISnapshotTree | null,\n\t) {\n\t\tsuper();\n\t\tassert(!!this.docTree, 0x0b0 /* \"Missing document snapshot tree!\" */);\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (this.docId === undefined || this.docId === versionId || versionId === null) {\n\t\t\tif (versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\t\t\treturn [{ id: \"latest\", treeId: \"\" }];\n\t\t}\n\t\treturn this.storage.getVersions(versionId, count);\n\t}\n\n\tpublic async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {\n\t\tif (versionRequested && versionRequested.id !== \"latest\") {\n\t\t\treturn this.storage.getSnapshotTree(versionRequested);\n\t\t}\n\n\t\treturn this.docTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.storage.readBlob(blobId);\n\t}\n}\n\nexport class StaticStorageDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tconstructor(\n\t\tpublic readonly resolvedUrl: IResolvedUrl,\n\t\tprivate readonly storage: IDocumentStorageService,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose(): void {}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this.storage;\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\t// We have no delta stream, so make it not return forever...\n\t\treturn new Promise(() => {});\n\t}\n}\n\n/**\n * @internal\n */\nexport class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic constructor(protected readonly storage: IDocumentStorageService) {}\n\n\tpublic async createDocumentService(\n\t\tfileURL: IResolvedUrl,\n\t\tlogger?: ITelemetryLoggerExt,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn new StaticStorageDocumentService(fileURL, this.storage);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger: ITelemetryLoggerExt,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
@@ -0,0 +1,19 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * GENERATED FILE - DO NOT EDIT DIRECTLY.
4
+ * To regenerate: pnpm tsx scripts/generate-flat-eslint-configs.ts --typescript
5
+ */
6
+ import type { Linter } from "eslint";
7
+ import { minimalDeprecated } from "../../../common/build/eslint-config-fluid/flat.mts";
8
+
9
+ const config: Linter.Config[] = [
10
+ ...minimalDeprecated,
11
+ {
12
+ rules: {
13
+ "@typescript-eslint/strict-boolean-expressions": "off",
14
+ "@fluid-internal/fluid/no-unchecked-record-access": "warn",
15
+ },
16
+ },
17
+ ];
18
+
19
+ export default config;
@@ -5,7 +5,7 @@
5
5
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
6
6
  import { IDisposable } from "@fluidframework/core-interfaces";
7
7
  import { ConnectionMode } from "@fluidframework/driver-definitions";
8
- import { IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IDocumentDeltaStorageService, IDocumentService, IClientConfiguration, IConnected, IDocumentMessage, ISignalClient, ITokenClaims, IVersion, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/driver-definitions/internal";
8
+ import { IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IDocumentDeltaStorageService, IDocumentService, IClientConfiguration, IConnected, IDocumentMessage, ISignalClient, ITokenClaims, IVersion, ISequencedDocumentMessage, ISignalMessage, type ISnapshotTree } from "@fluidframework/driver-definitions/internal";
9
9
  import { ReplayController } from "./replayController.js";
10
10
  export declare class ReplayControllerStatic extends ReplayController {
11
11
  readonly replayFrom: number;
@@ -25,7 +25,7 @@ export declare class ReplayControllerStatic extends ReplayController {
25
25
  constructor(replayFrom: number, replayTo: number, unitIsTime?: boolean | undefined);
26
26
  initStorage(documentService: IDocumentService): Promise<boolean>;
27
27
  getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
28
- getSnapshotTree(version?: IVersion): Promise<null>;
28
+ getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
29
29
  readBlob(blobId: string): Promise<ArrayBufferLike>;
30
30
  getStartingOpSequence(): Promise<number>;
31
31
  fetchTo(currentOp: number): number | undefined;
@@ -55,7 +55,7 @@ export declare class ReplayDocumentDeltaConnection extends TypedEventEmitter<IDo
55
55
  readonly maxMessageSize: number;
56
56
  constructor(details: IConnected);
57
57
  submit(documentMessage: IDocumentMessage[]): void;
58
- submitSignal(message: any): Promise<void>;
58
+ submitSignal(message: unknown): Promise<void>;
59
59
  private _disposed;
60
60
  get disposed(): boolean;
61
61
  dispose(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"replayDocumentDeltaConnection.d.ts","sourceRoot":"","sources":["../src/replayDocumentDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EACN,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,gBAAgB,EAChB,oBAAoB,EACpB,UAAU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MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,CAC5E,CAAC;gBAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC;gBAC9B,SAAS,IAAI,QAAQ,CAAC,MAAM,CAAC;gBAC7B,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACnF,CAAC,QAAQ,CAAC,IAAI,EAAE;YAEhB,eAAe,CAAC,KAAK,EAAE,CAAC;QACzB,CAAC,QAAQ,CAAC,IAAI,EAAE;QAChB,OAAO,kBAAkB,CAAC;IAC3B,CAAC;;AAxHuB,mDAAqB,GAAG,QAAQ,AAAX,CAAY;AACzD,qFAAqF;AAC7D,kDAAoB,GAAG,EAAE,GAAG,IAAI,AAAZ,CAAa;AAEjC,oCAAM,GAAiB;IAC9C,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;IAC3B,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACL,EAAE,EAAE,EAAE;KACN;IACD,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC5C,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,oBAAoB;IAC5E,GAAG,EAAE,KAAK;CACV,AAV6B,CAU5B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IDisposable } from \"@fluidframework/core-interfaces\";\nimport { delay } from \"@fluidframework/core-utils/internal\";\nimport { ConnectionMode } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIClientConfiguration,\n\tIConnected,\n\tIDocumentMessage,\n\tISignalClient,\n\tITokenClaims,\n\tIVersion,\n\tScopeType,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { ReplayController } from \"./replayController.js\";\n\nconst ReplayDocumentId = \"documentId\";\n\nexport class ReplayControllerStatic extends ReplayController {\n\tprivate static readonly DelayInterval = 50;\n\tprivate static readonly ReplayResolution = 15;\n\n\tprivate firstTimeStamp: number | undefined;\n\tprivate replayCurrent = 0;\n\t// Simulated delay interval for emitting the ops\n\n\t/**\n\t * Helper class\n\t *\n\t * @param replayFrom - First op to be played on socket.\n\t * @param replayTo - Last op number to be played on socket.\n\t * @param unitIsTime - True is user want to play ops that are within a replay resolution window.\n\t */\n\tpublic constructor(\n\t\tpublic readonly replayFrom: number,\n\t\tpublic readonly replayTo: number,\n\t\tpublic readonly unitIsTime?: boolean,\n\t) {\n\t\tsuper();\n\t\tif (unitIsTime !== true) {\n\t\t\t// There is no code in here to start with snapshot, thus we have to start with op #0.\n\t\t\tthis.replayTo = 0;\n\t\t}\n\t}\n\n\tpublic async initStorage(documentService: IDocumentService) {\n\t\treturn true;\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\treturn [];\n\t}\n\n\tpublic async getSnapshotTree(version?: IVersion) {\n\t\treturn version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async getStartingOpSequence(): Promise<number> {\n\t\treturn 0;\n\t}\n\n\tpublic fetchTo(currentOp: number) {\n\t\tif (!(this.unitIsTime !== true && this.replayTo >= 0)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.replayTo;\n\t}\n\n\tpublic isDoneFetch(currentOp: number, lastTimeStamp?: number) {\n\t\tif (this.replayTo >= 0) {\n\t\t\tif (this.unitIsTime === true) {\n\t\t\t\treturn (\n\t\t\t\t\tlastTimeStamp !== undefined &&\n\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\tlastTimeStamp - this.firstTimeStamp >= this.replayTo\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn currentOp >= this.replayTo;\n\t\t}\n\t\treturn lastTimeStamp === undefined; // No more ops\n\t}\n\n\tpublic skipToIndex(fetchedOps: ISequencedDocumentMessage[]) {\n\t\tif (this.replayFrom <= 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (this.unitIsTime === true) {\n\t\t\tfor (const [i, { timestamp }] of fetchedOps.entries()) {\n\t\t\t\tif (timestamp !== undefined) {\n\t\t\t\t\tif (this.firstTimeStamp === undefined) {\n\t\t\t\t\t\tthis.firstTimeStamp = timestamp;\n\t\t\t\t\t}\n\t\t\t\t\tif (timestamp - this.firstTimeStamp >= this.replayFrom) {\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (this.replayFrom > this.replayCurrent) {\n\t\t\treturn this.replayFrom - this.replayCurrent;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic async replay(\n\t\temitter: (op: ISequencedDocumentMessage[]) => void,\n\t\tfetchedOps: ISequencedDocumentMessage[],\n\t): Promise<void> {\n\t\tlet current = this.skipToIndex(fetchedOps);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tconst replayNextOps = () => {\n\t\t\t\t// Emit the ops from replay to the end every \"deltainterval\" milliseconds\n\t\t\t\t// to simulate the socket stream\n\t\t\t\tconst currentOp = fetchedOps[current];\n\t\t\t\tconst playbackOps = [currentOp];\n\t\t\t\tlet nextInterval = ReplayControllerStatic.DelayInterval;\n\t\t\t\tcurrent += 1;\n\n\t\t\t\tif (this.unitIsTime === true) {\n\t\t\t\t\tconst currentTimeStamp = currentOp.timestamp;\n\t\t\t\t\tif (currentTimeStamp !== undefined) {\n\t\t\t\t\t\t// Emit more ops that is in the ReplayResolution window\n\n\t\t\t\t\t\twhile (current < fetchedOps.length) {\n\t\t\t\t\t\t\tconst op = fetchedOps[current];\n\t\t\t\t\t\t\tif (op.timestamp === undefined) {\n\t\t\t\t\t\t\t\t// Missing timestamp, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst timeDiff = op.timestamp - currentTimeStamp;\n\t\t\t\t\t\t\tif (timeDiff >= ReplayControllerStatic.ReplayResolution) {\n\t\t\t\t\t\t\t\t// Time exceeded the resolution window, break out the loop\n\t\t\t\t\t\t\t\t// and delay for the time difference.\n\t\t\t\t\t\t\t\tnextInterval = timeDiff;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (timeDiff < 0) {\n\t\t\t\t\t\t\t\t// Time have regressed, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// The op is within the ReplayResolution emit it now\n\t\t\t\t\t\t\tplaybackOps.push(op);\n\t\t\t\t\t\t\tcurrent += 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\t\t\tthis.replayTo >= 0 &&\n\t\t\t\t\t\t\tcurrentTimeStamp + nextInterval - this.firstTimeStamp > this.replayTo\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tnextInterval = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tscheduleNext(nextInterval);\n\t\t\t\temitter(playbackOps);\n\t\t\t};\n\t\t\tconst scheduleNext = (nextInterval: number) => {\n\t\t\t\tif (nextInterval >= 0 && current < fetchedOps.length) {\n\t\t\t\t\tsetTimeout(replayNextOps, nextInterval);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replayCurrent += current;\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t};\n\t\t\tscheduleNext(ReplayControllerStatic.DelayInterval);\n\t\t});\n\t}\n}\n\nexport class ReplayDocumentDeltaConnection\n\textends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n\timplements IDocumentDeltaConnection, IDisposable\n{\n\t/**\n\t * Creates a new delta connection and mimics the delta connection to replay ops on it.\n\t * @param documentService - The document service to be used to get underlying endpoints.\n\t */\n\tpublic static create(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): IDocumentDeltaConnection {\n\t\tconst connection: IConnected = {\n\t\t\tclaims: ReplayDocumentDeltaConnection.claims,\n\t\t\tclientId: \"PseudoClientId\",\n\t\t\texisting: true,\n\t\t\tinitialMessages: [],\n\t\t\tinitialSignals: [],\n\t\t\tinitialClients: [],\n\t\t\tmaxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\tmode: \"read\",\n\t\t\tserviceConfiguration: {\n\t\t\t\tblockSize: 64436,\n\t\t\t\tmaxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\t},\n\t\t\tsupportedVersions: [ReplayDocumentDeltaConnection.replayProtocolVersion],\n\t\t\tversion: ReplayDocumentDeltaConnection.replayProtocolVersion,\n\t\t};\n\t\tconst deltaConnection = new ReplayDocumentDeltaConnection(connection);\n\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\tdeltaConnection.fetchAndEmitOps(documentStorageService, controller);\n\n\t\treturn deltaConnection;\n\t}\n\n\tprivate static readonly replayProtocolVersion = \"^0.1.0\";\n\t// Since the replay service never actually sends messages the size below is arbitrary\n\tprivate static readonly ReplayMaxMessageSize = 16 * 1024;\n\n\tprivate static readonly claims: ITokenClaims = {\n\t\tdocumentId: ReplayDocumentId,\n\t\tscopes: [ScopeType.DocRead],\n\t\ttenantId: \"\",\n\t\tuser: {\n\t\t\tid: \"\",\n\t\t},\n\t\tiat: Math.round(new Date().getTime() / 1000),\n\t\texp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n\t\tver: \"1.0\",\n\t};\n\n\tpublic get clientId(): string {\n\t\treturn this.details.clientId;\n\t}\n\n\tpublic get mode(): ConnectionMode {\n\t\treturn this.details.mode;\n\t}\n\n\tpublic get claims(): ITokenClaims {\n\t\treturn this.details.claims;\n\t}\n\n\tpublic get existing(): boolean {\n\t\treturn this.details.existing;\n\t}\n\n\tpublic get version(): string {\n\t\treturn this.details.version;\n\t}\n\n\tpublic get initialMessages(): ISequencedDocumentMessage[] {\n\t\treturn this.details.initialMessages;\n\t}\n\n\tpublic get initialSignals(): ISignalMessage[] {\n\t\treturn this.details.initialSignals;\n\t}\n\n\tpublic get initialClients(): ISignalClient[] {\n\t\treturn this.details.initialClients;\n\t}\n\n\tpublic get serviceConfiguration(): IClientConfiguration {\n\t\treturn this.details.serviceConfiguration;\n\t}\n\n\tpublic readonly maxMessageSize = ReplayDocumentDeltaConnection.ReplayMaxMessageSize;\n\n\tconstructor(public details: IConnected) {\n\t\tsuper();\n\t}\n\n\tpublic submit(documentMessage: IDocumentMessage[]): void {\n\t\t// ReplayDocumentDeltaConnection.submit() can't be called - client never sees its own join on,\n\t\t// and thus can never move to sending ops.\n\t\tthrow new Error(\"ReplayDocumentDeltaConnection.submit() can't be called\");\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-misused-promises\n\tpublic async submitSignal(message: any) {}\n\n\tprivate _disposed = false;\n\tpublic get disposed() {\n\t\treturn this._disposed;\n\t}\n\tpublic dispose() {\n\t\tthis._disposed = true;\n\t}\n\n\t/**\n\t * This gets the specified ops from the delta storage endpoint and replays them in the replayer.\n\t */\n\tprivate async fetchAndEmitOps(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): Promise<void> {\n\t\tlet done;\n\t\tlet replayPromiseChain = Promise.resolve();\n\n\t\tlet currentOp = await controller.getStartingOpSequence();\n\n\t\tdo {\n\t\t\tconst fetchTo = controller.fetchTo(currentOp);\n\n\t\t\tconst abortController = new AbortController();\n\t\t\tconst stream = documentStorageService.fetchMessages(\n\t\t\t\tcurrentOp + 1,\n\t\t\t\tfetchTo,\n\t\t\t\tabortController.signal,\n\t\t\t);\n\t\t\tdo {\n\t\t\t\tconst result = await stream.read();\n\n\t\t\t\tif (result.done) {\n\t\t\t\t\t// No more ops. But, they can show up later, either because document was just created,\n\t\t\t\t\t// or because another client keeps submitting new ops.\n\t\t\t\t\tdone = controller.isDoneFetch(currentOp, undefined);\n\t\t\t\t\tif (!done) {\n\t\t\t\t\t\tawait delay(2000);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treplayPromiseChain = replayPromiseChain.then(async () =>\n\t\t\t\t\tcontroller.replay((ops) => this.emit(\"op\", ReplayDocumentId, ops), messages),\n\t\t\t\t);\n\n\t\t\t\tconst messages = result.value;\n\t\t\t\tcurrentOp += messages.length;\n\t\t\t\tdone = controller.isDoneFetch(currentOp, messages[messages.length - 1].timestamp);\n\t\t\t} while (!done);\n\n\t\t\tabortController.abort();\n\t\t} while (!done);\n\t\treturn replayPromiseChain;\n\t}\n}\n"]}
1
+ {"version":3,"file":"replayDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/replayDocumentDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAE5D,OAAO,EAWN,SAAS,GAIT,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,MAAM,O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C,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACnF,CAAC,QAAQ,CAAC,IAAI,EAAE;YAEhB,eAAe,CAAC,KAAK,EAAE,CAAC;QACzB,CAAC,QAAQ,CAAC,IAAI,EAAE;QAChB,OAAO,kBAAkB,CAAC;IAC3B,CAAC;;AAxHuB,mDAAqB,GAAG,QAAQ,AAAX,CAAY;AACzD,qFAAqF;AAC7D,kDAAoB,GAAG,EAAE,GAAG,IAAI,AAAZ,CAAa;AAEjC,oCAAM,GAAiB;IAC9C,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;IAC3B,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACL,EAAE,EAAE,EAAE;KACN;IACD,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC5C,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,oBAAoB;IAC5E,GAAG,EAAE,KAAK;CACV,AAV6B,CAU5B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IDisposable } from \"@fluidframework/core-interfaces\";\nimport { delay } from \"@fluidframework/core-utils/internal\";\nimport { ConnectionMode } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIClientConfiguration,\n\tIConnected,\n\tIDocumentMessage,\n\tISignalClient,\n\tITokenClaims,\n\tIVersion,\n\tScopeType,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n\ttype ISnapshotTree,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { ReplayController } from \"./replayController.js\";\n\nconst ReplayDocumentId = \"documentId\";\n\nexport class ReplayControllerStatic extends ReplayController {\n\tprivate static readonly DelayInterval = 50;\n\tprivate static readonly ReplayResolution = 15;\n\n\tprivate firstTimeStamp: number | undefined;\n\tprivate replayCurrent = 0;\n\t// Simulated delay interval for emitting the ops\n\n\t/**\n\t * Helper class\n\t *\n\t * @param replayFrom - First op to be played on socket.\n\t * @param replayTo - Last op number to be played on socket.\n\t * @param unitIsTime - True is user want to play ops that are within a replay resolution window.\n\t */\n\tpublic constructor(\n\t\tpublic readonly replayFrom: number,\n\t\tpublic readonly replayTo: number,\n\t\tpublic readonly unitIsTime?: boolean,\n\t) {\n\t\tsuper();\n\t\tif (unitIsTime !== true) {\n\t\t\t// There is no code in here to start with snapshot, thus we have to start with op #0.\n\t\t\tthis.replayTo = 0;\n\t\t}\n\t}\n\n\tpublic async initStorage(documentService: IDocumentService): Promise<boolean> {\n\t\treturn true;\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\treturn [];\n\t}\n\n\tpublic async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n\t\treturn version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async getStartingOpSequence(): Promise<number> {\n\t\treturn 0;\n\t}\n\n\tpublic fetchTo(currentOp: number): number | undefined {\n\t\tif (!(this.unitIsTime !== true && this.replayTo >= 0)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.replayTo;\n\t}\n\n\tpublic isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean {\n\t\tif (this.replayTo >= 0) {\n\t\t\tif (this.unitIsTime === true) {\n\t\t\t\treturn (\n\t\t\t\t\tlastTimeStamp !== undefined &&\n\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\tlastTimeStamp - this.firstTimeStamp >= this.replayTo\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn currentOp >= this.replayTo;\n\t\t}\n\t\treturn lastTimeStamp === undefined; // No more ops\n\t}\n\n\tpublic skipToIndex(fetchedOps: ISequencedDocumentMessage[]): number {\n\t\tif (this.replayFrom <= 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (this.unitIsTime === true) {\n\t\t\tfor (const [i, { timestamp }] of fetchedOps.entries()) {\n\t\t\t\tif (timestamp !== undefined) {\n\t\t\t\t\tif (this.firstTimeStamp === undefined) {\n\t\t\t\t\t\tthis.firstTimeStamp = timestamp;\n\t\t\t\t\t}\n\t\t\t\t\tif (timestamp - this.firstTimeStamp >= this.replayFrom) {\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (this.replayFrom > this.replayCurrent) {\n\t\t\treturn this.replayFrom - this.replayCurrent;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tpublic async replay(\n\t\temitter: (op: ISequencedDocumentMessage[]) => void,\n\t\tfetchedOps: ISequencedDocumentMessage[],\n\t): Promise<void> {\n\t\tlet current = this.skipToIndex(fetchedOps);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tconst replayNextOps = (): void => {\n\t\t\t\t// Emit the ops from replay to the end every \"deltainterval\" milliseconds\n\t\t\t\t// to simulate the socket stream\n\t\t\t\tconst currentOp = fetchedOps[current];\n\t\t\t\tconst playbackOps = [currentOp];\n\t\t\t\tlet nextInterval = ReplayControllerStatic.DelayInterval;\n\t\t\t\tcurrent += 1;\n\n\t\t\t\tif (this.unitIsTime === true) {\n\t\t\t\t\tconst currentTimeStamp = currentOp.timestamp;\n\t\t\t\t\tif (currentTimeStamp !== undefined) {\n\t\t\t\t\t\t// Emit more ops that is in the ReplayResolution window\n\n\t\t\t\t\t\twhile (current < fetchedOps.length) {\n\t\t\t\t\t\t\tconst op = fetchedOps[current];\n\t\t\t\t\t\t\tif (op.timestamp === undefined) {\n\t\t\t\t\t\t\t\t// Missing timestamp, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst timeDiff = op.timestamp - currentTimeStamp;\n\t\t\t\t\t\t\tif (timeDiff >= ReplayControllerStatic.ReplayResolution) {\n\t\t\t\t\t\t\t\t// Time exceeded the resolution window, break out the loop\n\t\t\t\t\t\t\t\t// and delay for the time difference.\n\t\t\t\t\t\t\t\tnextInterval = timeDiff;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (timeDiff < 0) {\n\t\t\t\t\t\t\t\t// Time have regressed, just delay the standard amount of time\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// The op is within the ReplayResolution emit it now\n\t\t\t\t\t\t\tplaybackOps.push(op);\n\t\t\t\t\t\t\tcurrent += 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tthis.firstTimeStamp !== undefined &&\n\t\t\t\t\t\t\tthis.replayTo >= 0 &&\n\t\t\t\t\t\t\tcurrentTimeStamp + nextInterval - this.firstTimeStamp > this.replayTo\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tnextInterval = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tscheduleNext(nextInterval);\n\t\t\t\temitter(playbackOps);\n\t\t\t};\n\t\t\tconst scheduleNext = (nextInterval: number): void => {\n\t\t\t\tif (nextInterval >= 0 && current < fetchedOps.length) {\n\t\t\t\t\tsetTimeout(replayNextOps, nextInterval);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replayCurrent += current;\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t};\n\t\t\tscheduleNext(ReplayControllerStatic.DelayInterval);\n\t\t});\n\t}\n}\n\nexport class ReplayDocumentDeltaConnection\n\textends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n\timplements IDocumentDeltaConnection, IDisposable\n{\n\t/**\n\t * Creates a new delta connection and mimics the delta connection to replay ops on it.\n\t * @param documentService - The document service to be used to get underlying endpoints.\n\t */\n\tpublic static create(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): IDocumentDeltaConnection {\n\t\tconst connection: IConnected = {\n\t\t\tclaims: ReplayDocumentDeltaConnection.claims,\n\t\t\tclientId: \"PseudoClientId\",\n\t\t\texisting: true,\n\t\t\tinitialMessages: [],\n\t\t\tinitialSignals: [],\n\t\t\tinitialClients: [],\n\t\t\tmaxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\tmode: \"read\",\n\t\t\tserviceConfiguration: {\n\t\t\t\tblockSize: 64436,\n\t\t\t\tmaxMessageSize: ReplayDocumentDeltaConnection.ReplayMaxMessageSize,\n\t\t\t},\n\t\t\tsupportedVersions: [ReplayDocumentDeltaConnection.replayProtocolVersion],\n\t\t\tversion: ReplayDocumentDeltaConnection.replayProtocolVersion,\n\t\t};\n\t\tconst deltaConnection = new ReplayDocumentDeltaConnection(connection);\n\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\tdeltaConnection.fetchAndEmitOps(documentStorageService, controller);\n\n\t\treturn deltaConnection;\n\t}\n\n\tprivate static readonly replayProtocolVersion = \"^0.1.0\";\n\t// Since the replay service never actually sends messages the size below is arbitrary\n\tprivate static readonly ReplayMaxMessageSize = 16 * 1024;\n\n\tprivate static readonly claims: ITokenClaims = {\n\t\tdocumentId: ReplayDocumentId,\n\t\tscopes: [ScopeType.DocRead],\n\t\ttenantId: \"\",\n\t\tuser: {\n\t\t\tid: \"\",\n\t\t},\n\t\tiat: Math.round(new Date().getTime() / 1000),\n\t\texp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n\t\tver: \"1.0\",\n\t};\n\n\tpublic get clientId(): string {\n\t\treturn this.details.clientId;\n\t}\n\n\tpublic get mode(): ConnectionMode {\n\t\treturn this.details.mode;\n\t}\n\n\tpublic get claims(): ITokenClaims {\n\t\treturn this.details.claims;\n\t}\n\n\tpublic get existing(): boolean {\n\t\treturn this.details.existing;\n\t}\n\n\tpublic get version(): string {\n\t\treturn this.details.version;\n\t}\n\n\tpublic get initialMessages(): ISequencedDocumentMessage[] {\n\t\treturn this.details.initialMessages;\n\t}\n\n\tpublic get initialSignals(): ISignalMessage[] {\n\t\treturn this.details.initialSignals;\n\t}\n\n\tpublic get initialClients(): ISignalClient[] {\n\t\treturn this.details.initialClients;\n\t}\n\n\tpublic get serviceConfiguration(): IClientConfiguration {\n\t\treturn this.details.serviceConfiguration;\n\t}\n\n\tpublic readonly maxMessageSize = ReplayDocumentDeltaConnection.ReplayMaxMessageSize;\n\n\tconstructor(public details: IConnected) {\n\t\tsuper();\n\t}\n\n\tpublic submit(documentMessage: IDocumentMessage[]): void {\n\t\t// ReplayDocumentDeltaConnection.submit() can't be called - client never sees its own join on,\n\t\t// and thus can never move to sending ops.\n\t\tthrow new Error(\"ReplayDocumentDeltaConnection.submit() can't be called\");\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-misused-promises\n\tpublic async submitSignal(message: unknown): Promise<void> {}\n\n\tprivate _disposed = false;\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\tpublic dispose(): void {\n\t\tthis._disposed = true;\n\t}\n\n\t/**\n\t * This gets the specified ops from the delta storage endpoint and replays them in the replayer.\n\t */\n\tprivate async fetchAndEmitOps(\n\t\tdocumentStorageService: IDocumentDeltaStorageService,\n\t\tcontroller: ReplayController,\n\t): Promise<void> {\n\t\tlet done;\n\t\tlet replayPromiseChain = Promise.resolve();\n\n\t\tlet currentOp = await controller.getStartingOpSequence();\n\n\t\tdo {\n\t\t\tconst fetchTo = controller.fetchTo(currentOp);\n\n\t\t\tconst abortController = new AbortController();\n\t\t\tconst stream = documentStorageService.fetchMessages(\n\t\t\t\tcurrentOp + 1,\n\t\t\t\tfetchTo,\n\t\t\t\tabortController.signal,\n\t\t\t);\n\t\t\tdo {\n\t\t\t\tconst result = await stream.read();\n\n\t\t\t\tif (result.done) {\n\t\t\t\t\t// No more ops. But, they can show up later, either because document was just created,\n\t\t\t\t\t// or because another client keeps submitting new ops.\n\t\t\t\t\tdone = controller.isDoneFetch(currentOp, undefined);\n\t\t\t\t\tif (!done) {\n\t\t\t\t\t\tawait delay(2000);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treplayPromiseChain = replayPromiseChain.then(async () =>\n\t\t\t\t\tcontroller.replay((ops) => this.emit(\"op\", ReplayDocumentId, ops), messages),\n\t\t\t\t);\n\n\t\t\t\tconst messages = result.value;\n\t\t\t\tcurrentOp += messages.length;\n\t\t\t\tdone = controller.isDoneFetch(currentOp, messages[messages.length - 1].timestamp);\n\t\t\t} while (!done);\n\n\t\t\tabortController.abort();\n\t\t} while (!done);\n\t\treturn replayPromiseChain;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"replayDocumentService.d.ts","sourceRoot":"","sources":["../src/replayDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EACN,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,YAAY,EACZ,4BAA4B,EAC5B,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD;;;;;GAKG;AACH,qBAAa,qBACZ,SAAQ,iBAAiB,CAAC,sBAAsB,CAChD,YAAW,gBAAgB;IAmB1B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,YAAY;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GG;IACI,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,wBAAwB,EAAE,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IClient } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentServiceEvents,\n\tIDocumentService,\n\tIDocumentStorageService,\n\tIDocumentDeltaConnection,\n\tIResolvedUrl,\n\tIDocumentDeltaStorageService,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService.js\";\nimport { ReplayController } from \"./replayController.js\";\nimport { ReplayDocumentDeltaConnection } from \"./replayDocumentDeltaConnection.js\";\n\n/**\n * The Replay document service dummies out the snapshot and the delta storage.\n * Delta connection simulates the socket by fetching the ops from delta storage\n * and emitting them with a pre determined delay\n * @internal\n */\nexport class ReplayDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tpublic static async create(\n\t\tdocumentService: IDocumentService,\n\t\tcontroller: ReplayController,\n\t): Promise<IDocumentService> {\n\t\tconst useController = await controller.initStorage(documentService);\n\t\tif (!useController) {\n\t\t\treturn documentService;\n\t\t}\n\n\t\tconst deltaConnection = ReplayDocumentDeltaConnection.create(\n\t\t\tawait documentService.connectToDeltaStorage(),\n\t\t\tcontroller,\n\t\t);\n\t\treturn new ReplayDocumentService(controller, deltaConnection);\n\t}\n\n\tconstructor(\n\t\tprivate readonly controller: IDocumentStorageService,\n\t\tprivate readonly deltaStorage: IDocumentDeltaConnection,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose() {}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic get resolvedUrl(): IResolvedUrl {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\t/**\n\t * Connects to a storage endpoint for snapshot service and blobs.\n\t * @returns returns the dummy document storage service for replay driver.\n\t */\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this.controller;\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint for getting ops between a range.\n\t * @returns returns the dummy document delta storage service for replay driver.\n\t */\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint of provided documentService to get ops and then replaying\n\t * them so as to mimic a delta stream endpoint.\n\t * @param client - Client that connects to socket.\n\t * @returns returns the delta stream service which replay ops from --from to --to arguments.\n\t */\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\treturn this.deltaStorage;\n\t}\n}\n"]}
1
+ {"version":3,"file":"replayDocumentService.js","sourceRoot":"","sources":["../src/replayDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAWjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,OAAO,qBACZ,SAAQ,iBAAyC;IAG1C,MAAM,CAAC,KAAK,CAAC,MAAM,CACzB,eAAiC,EACjC,UAA4B;QAE5B,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QACpE,IAAI,CAAC,aAAa,EAAE,CAAC;YACpB,OAAO,eAAe,CAAC;QACxB,CAAC;QAED,MAAM,eAAe,GAAG,6BAA6B,CAAC,MAAM,CAC3D,MAAM,eAAe,CAAC,qBAAqB,EAAE,EAC7C,UAAU,CACV,CAAC;QACF,OAAO,IAAI,qBAAqB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC/D,CAAC;IAED,YACkB,UAAmC,EACnC,YAAsC;QAEvD,KAAK,EAAE,CAAC;QAHS,eAAU,GAAV,UAAU,CAAyB;QACnC,iBAAY,GAAZ,YAAY,CAA0B;IAGxD,CAAC;IAEM,OAAO,KAAU,CAAC;IAEzB,8EAA8E;IAC9E,IAAW,WAAW;QACrB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,wBAAwB,EAAE,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IClient } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentServiceEvents,\n\tIDocumentService,\n\tIDocumentStorageService,\n\tIDocumentDeltaConnection,\n\tIResolvedUrl,\n\tIDocumentDeltaStorageService,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService.js\";\nimport { ReplayController } from \"./replayController.js\";\nimport { ReplayDocumentDeltaConnection } from \"./replayDocumentDeltaConnection.js\";\n\n/**\n * The Replay document service dummies out the snapshot and the delta storage.\n * Delta connection simulates the socket by fetching the ops from delta storage\n * and emitting them with a pre determined delay\n * @internal\n */\nexport class ReplayDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tpublic static async create(\n\t\tdocumentService: IDocumentService,\n\t\tcontroller: ReplayController,\n\t): Promise<IDocumentService> {\n\t\tconst useController = await controller.initStorage(documentService);\n\t\tif (!useController) {\n\t\t\treturn documentService;\n\t\t}\n\n\t\tconst deltaConnection = ReplayDocumentDeltaConnection.create(\n\t\t\tawait documentService.connectToDeltaStorage(),\n\t\t\tcontroller,\n\t\t);\n\t\treturn new ReplayDocumentService(controller, deltaConnection);\n\t}\n\n\tconstructor(\n\t\tprivate readonly controller: IDocumentStorageService,\n\t\tprivate readonly deltaStorage: IDocumentDeltaConnection,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose(): void {}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic get resolvedUrl(): IResolvedUrl {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\t/**\n\t * Connects to a storage endpoint for snapshot service and blobs.\n\t * @returns returns the dummy document storage service for replay driver.\n\t */\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this.controller;\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint for getting ops between a range.\n\t * @returns returns the dummy document delta storage service for replay driver.\n\t */\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\t/**\n\t * Connects to a delta storage endpoint of provided documentService to get ops and then replaying\n\t * them so as to mimic a delta stream endpoint.\n\t * @param client - Client that connects to socket.\n\t * @returns returns the delta stream service which replay ops from --from to --to arguments.\n\t */\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\treturn this.deltaStorage;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"replayDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/replayDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAoB,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,o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AC,sBAA2D;aACtE,mBAAmB,CAAC;IACvB,CAAC;IAED,YACkB,sBAA+C,EAC/C,UAA4B;QAD5B,2BAAsB,GAAtB,sBAAsB,CAAyB;QAC/C,eAAU,GAAV,UAAU,CAAkB;IAC3C,CAAC;IAEJ;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,iEAAiE;QACjE,wGAAwG;QACxG,MAAM,YAAY,GAAG,iBAAiB,CAAC;YACtC,MAAM;YACN,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;SACvC,CAAC,CAAC;QAEH,OAAO,qBAAqB,CAAC,MAAM,CAClC,MAAM,IAAI,CAAC,sBAAsB,CAAC,qBAAqB,CACtD,WAAW,EACX,YAAY,EACZ,kBAAkB,CAClB,EACD,IAAI,CAAC,UAAU,CACf,CAAC;IACH,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ILayerCompatDetails } from \"@fluid-internal/client-utils\";\nimport { ITelemetryBaseLogger, type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { ReplayController } from \"./replayController.js\";\nimport { ReplayControllerStatic } from \"./replayDocumentDeltaConnection.js\";\nimport { ReplayDocumentService } from \"./replayDocumentService.js\";\n\n/**\n * @internal\n */\nexport class ReplayDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic static create(\n\t\tfrom: number,\n\t\tto: number,\n\t\tdocumentServiceFactory: IDocumentServiceFactory,\n\t) {\n\t\treturn new ReplayDocumentServiceFactory(\n\t\t\tdocumentServiceFactory,\n\t\t\tnew ReplayControllerStatic(from, to),\n\t\t);\n\t}\n\n\t/**\n\t * The compatibility details of the base Driver layer that is exposed to the Loader layer\n\t * for validating Loader-Driver compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails | undefined {\n\t\treturn (this.documentServiceFactory as FluidObject<ILayerCompatDetails>)\n\t\t\t.ILayerCompatDetails;\n\t}\n\n\tpublic constructor(\n\t\tprivate readonly documentServiceFactory: IDocumentServiceFactory,\n\t\tprivate readonly controller: ReplayController,\n\t) {}\n\n\t/**\n\t * Creates a replay document service which uses the document service of provided\n\t * documentServiceFactory for connecting to delta stream endpoint.\n\t * @param resolvedUrl - URL to be used for connecting to endpoints.\n\t * @returns returns the requested document service\n\t */\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\t// Always include isReplay: true on events for the Replay Driver.\n\t\t// It's used in testing/debugging scenarios, so we want to be able to filter these events out sometimes.\n\t\tconst replayLogger = createChildLogger({\n\t\t\tlogger,\n\t\t\tproperties: { all: { isReplay: true } },\n\t\t});\n\n\t\treturn ReplayDocumentService.create(\n\t\t\tawait this.documentServiceFactory.createDocumentService(\n\t\t\t\tresolvedUrl,\n\t\t\t\treplayLogger,\n\t\t\t\tclientIsSummarizer,\n\t\t\t),\n\t\t\tthis.controller,\n\t\t);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"replayDocumentServiceFactory.js","sourceRoot":"","sources":["../src/replayDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAG7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;GAEG;AACH,MAAM,OAAO,4BAA4B;IACjC,MAAM,CAAC,MAAM,CACnB,IAAY,EACZ,EAAU,EACV,sBAA+C;QAE/C,OAAO,IAAI,4BAA4B,CACtC,sBAAsB,EACtB,IAAI,sBAAsB,CAAC,IAAI,EAAE,EAAE,CAAC,CACpC,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,IAAW,mBAAmB;QAC7B,OAAQ,IAAI,CAAC,sBAA2D;aACtE,mBAAmB,CAAC;IACvB,CAAC;IAED,YACkB,sBAA+C,EAC/C,UAA4B;QAD5B,2BAAsB,GAAtB,sBAAsB,CAAyB;QAC/C,eAAU,GAAV,UAAU,CAAkB;IAC3C,CAAC;IAEJ;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,iEAAiE;QACjE,wGAAwG;QACxG,MAAM,YAAY,GAAG,iBAAiB,CAAC;YACtC,MAAM;YACN,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;SACvC,CAAC,CAAC;QAEH,OAAO,qBAAqB,CAAC,MAAM,CAClC,MAAM,IAAI,CAAC,sBAAsB,CAAC,qBAAqB,CACtD,WAAW,EACX,YAAY,EACZ,kBAAkB,CAClB,EACD,IAAI,CAAC,UAAU,CACf,CAAC;IACH,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ILayerCompatDetails } from \"@fluid-internal/client-utils\";\nimport { ITelemetryBaseLogger, type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { ReplayController } from \"./replayController.js\";\nimport { ReplayControllerStatic } from \"./replayDocumentDeltaConnection.js\";\nimport { ReplayDocumentService } from \"./replayDocumentService.js\";\n\n/**\n * @internal\n */\nexport class ReplayDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic static create(\n\t\tfrom: number,\n\t\tto: number,\n\t\tdocumentServiceFactory: IDocumentServiceFactory,\n\t): ReplayDocumentServiceFactory {\n\t\treturn new ReplayDocumentServiceFactory(\n\t\t\tdocumentServiceFactory,\n\t\t\tnew ReplayControllerStatic(from, to),\n\t\t);\n\t}\n\n\t/**\n\t * The compatibility details of the base Driver layer that is exposed to the Loader layer\n\t * for validating Loader-Driver compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails | undefined {\n\t\treturn (this.documentServiceFactory as FluidObject<ILayerCompatDetails>)\n\t\t\t.ILayerCompatDetails;\n\t}\n\n\tpublic constructor(\n\t\tprivate readonly documentServiceFactory: IDocumentServiceFactory,\n\t\tprivate readonly controller: ReplayController,\n\t) {}\n\n\t/**\n\t * Creates a replay document service which uses the document service of provided\n\t * documentServiceFactory for connecting to delta stream endpoint.\n\t * @param resolvedUrl - URL to be used for connecting to endpoints.\n\t * @returns returns the requested document service\n\t */\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\t// Always include isReplay: true on events for the Replay Driver.\n\t\t// It's used in testing/debugging scenarios, so we want to be able to filter these events out sometimes.\n\t\tconst replayLogger = createChildLogger({\n\t\t\tlogger,\n\t\t\tproperties: { all: { isReplay: true } },\n\t\t});\n\n\t\treturn ReplayDocumentService.create(\n\t\t\tawait this.documentServiceFactory.createDocumentService(\n\t\t\t\tresolvedUrl,\n\t\t\t\treplayLogger,\n\t\t\t\tclientIsSummarizer,\n\t\t\t),\n\t\t\tthis.controller,\n\t\t);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"storageImplementations.d.ts","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,KAAK,EACL,QAAQ,EACR,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAG/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE;QA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Q,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;CACD;AAED,MAAM,OAAO,4BACZ,SAAQ,iBAAyC;IAGjD,YACiB,WAAyB,EACxB,OAAgC;QAEjD,KAAK,EAAE,CAAC;QAHQ,gBAAW,GAAX,WAAW,CAAc;QACxB,YAAO,GAAP,OAAO,CAAyB;IAGlD,CAAC;IAEM,OAAO,KAAI,CAAC;IAEZ,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,wBAAwB,EAAE,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,4DAA4D;QAC5D,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;CACD;AAED;;GAEG;AACH,MAAM,OAAO,mCAAmC;IAC/C,YAAsC,OAAgC;QAAhC,YAAO,GAAP,OAAO,CAAyB;IAAG,CAAC;IAEnE,KAAK,CAAC,qBAAqB,CACjC,OAAqB,EACrB,MAA4B,EAC5B,kBAA4B;QAE5B,OAAO,IAAI,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA2B,EAC3B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { IClient, ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServiceFactory,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n\tISnapshotTree,\n\tITree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { buildSnapshotTree } from \"@fluidframework/driver-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService.js\";\nimport { ReadDocumentStorageServiceBase } from \"./replayController.js\";\n\n/**\n * Structure of snapshot on disk, when we store snapshot as single file\n * @internal\n */\nexport interface IFileSnapshot {\n\ttree: ITree;\n\tcommits: { [key: string]: ITree };\n}\n\n/**\n * @internal\n */\nexport class FileSnapshotReader\n\textends ReadDocumentStorageServiceBase\n\timplements IDocumentStorageService\n{\n\t// IVersion.treeId used to communicate between getVersions() & getSnapshotTree() calls to indicate IVersion is ours.\n\tprotected static readonly FileStorageVersionTreeId = \"FileStorageTreeId\";\n\n\tprotected docId?: string;\n\tprotected docTree: ISnapshotTree;\n\tprotected blobs: Map<string, ArrayBufferLike>;\n\tprotected readonly commits: { [key: string]: ITree } = {};\n\tprotected readonly trees: { [key: string]: ISnapshotTree } = {};\n\n\tpublic constructor(json: IFileSnapshot) {\n\t\tsuper();\n\t\tthis.commits = json.commits;\n\n\t\tthis.blobs = new Map<string, ArrayBufferLike>();\n\t\tthis.docTree = buildSnapshotTree(json.tree.entries, this.blobs);\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (this.docId === undefined || this.docId === versionId || versionId === null) {\n\t\t\tif (versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\t\t\treturn [{ id: \"latest\", treeId: \"\" }];\n\t\t}\n\n\t\tif (this.commits[versionId] !== undefined) {\n\t\t\treturn [{ id: versionId, treeId: FileSnapshotReader.FileStorageVersionTreeId }];\n\t\t}\n\t\tthrow new Error(`Unknown version ID: ${versionId}`);\n\t}\n\n\tpublic async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {\n\t\tif (!versionRequested || versionRequested.id === \"latest\") {\n\t\t\treturn this.docTree;\n\t\t}\n\t\tif (versionRequested.treeId !== FileSnapshotReader.FileStorageVersionTreeId) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\tthrow new Error(`Unknown version id: ${versionRequested}`);\n\t\t}\n\n\t\tlet snapshotTree = this.trees[versionRequested.id];\n\t\tif (snapshotTree === undefined) {\n\t\t\tconst tree = this.commits[versionRequested.id];\n\t\t\tif (tree === undefined) {\n\t\t\t\tthrow new Error(`Can't find version ${versionRequested.id}`);\n\t\t\t}\n\n\t\t\tthis.trees[versionRequested.id] = snapshotTree = buildSnapshotTree(\n\t\t\t\ttree.entries,\n\t\t\t\tthis.blobs,\n\t\t\t);\n\t\t}\n\t\treturn snapshotTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tconst blob = this.blobs.get(blobId);\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\t\tthrow new Error(`Unknown blob ID: ${blobId}`);\n\t}\n}\n\n/**\n * @internal\n */\nexport class SnapshotStorage extends ReadDocumentStorageServiceBase {\n\tprotected docId?: string;\n\n\tconstructor(\n\t\tprotected readonly storage: IDocumentStorageService,\n\t\tprotected readonly docTree: ISnapshotTree | null,\n\t) {\n\t\tsuper();\n\t\tassert(!!this.docTree, 0x0b0 /* \"Missing document snapshot tree!\" */);\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (this.docId === undefined || this.docId === versionId || versionId === null) {\n\t\t\tif (versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\t\t\treturn [{ id: \"latest\", treeId: \"\" }];\n\t\t}\n\t\treturn this.storage.getVersions(versionId, count);\n\t}\n\n\tpublic async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {\n\t\tif (versionRequested && versionRequested.id !== \"latest\") {\n\t\t\treturn this.storage.getSnapshotTree(versionRequested);\n\t\t}\n\n\t\treturn this.docTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.storage.readBlob(blobId);\n\t}\n}\n\nexport class StaticStorageDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tconstructor(\n\t\tpublic readonly resolvedUrl: IResolvedUrl,\n\t\tprivate readonly storage: IDocumentStorageService,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose() {}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this.storage;\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\t// We have no delta stream, so make it not return forever...\n\t\treturn new Promise(() => {});\n\t}\n}\n\n/**\n * @internal\n */\nexport class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic constructor(protected readonly storage: IDocumentStorageService) {}\n\n\tpublic async createDocumentService(\n\t\tfileURL: IResolvedUrl,\n\t\tlogger?: ITelemetryLoggerExt,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn new StaticStorageDocumentService(fileURL, this.storage);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger: ITelemetryLoggerExt,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"storageImplementations.js","sourceRoot":"","sources":["../src/storageImplementations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,O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AK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,wBAAwB,EAAE,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,4DAA4D;QAC5D,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;CACD;AAED;;GAEG;AACH,MAAM,OAAO,mCAAmC;IAC/C,YAAsC,OAAgC;QAAhC,YAAO,GAAP,OAAO,CAAyB;IAAG,CAAC;IAEnE,KAAK,CAAC,qBAAqB,CACjC,OAAqB,EACrB,MAA4B,EAC5B,kBAA4B;QAE5B,OAAO,IAAI,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC;IAED,8EAA8E;IACvE,KAAK,CAAC,eAAe,CAC3B,gBAA8B,EAC9B,WAAyB,EACzB,MAA2B,EAC3B,kBAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { IClient, ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServiceFactory,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n\tISnapshotTree,\n\tITree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { buildSnapshotTree } from \"@fluidframework/driver-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { EmptyDeltaStorageService } from \"./emptyDeltaStorageService.js\";\nimport { ReadDocumentStorageServiceBase } from \"./replayController.js\";\n\n/**\n * Structure of snapshot on disk, when we store snapshot as single file\n * @internal\n */\nexport interface IFileSnapshot {\n\ttree: ITree;\n\tcommits: { [key: string]: ITree };\n}\n\n/**\n * @internal\n */\nexport class FileSnapshotReader\n\textends ReadDocumentStorageServiceBase\n\timplements IDocumentStorageService\n{\n\t// IVersion.treeId used to communicate between getVersions() & getSnapshotTree() calls to indicate IVersion is ours.\n\tprotected static readonly FileStorageVersionTreeId = \"FileStorageTreeId\";\n\n\tprotected docId?: string;\n\tprotected docTree: ISnapshotTree;\n\tprotected blobs: Map<string, ArrayBufferLike>;\n\tprotected readonly commits: { [key: string]: ITree } = {};\n\tprotected readonly trees: { [key: string]: ISnapshotTree } = {};\n\n\tpublic constructor(json: IFileSnapshot) {\n\t\tsuper();\n\t\tthis.commits = json.commits;\n\n\t\tthis.blobs = new Map<string, ArrayBufferLike>();\n\t\tthis.docTree = buildSnapshotTree(json.tree.entries, this.blobs);\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (this.docId === undefined || this.docId === versionId || versionId === null) {\n\t\t\tif (versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\t\t\treturn [{ id: \"latest\", treeId: \"\" }];\n\t\t}\n\n\t\tif (this.commits[versionId] !== undefined) {\n\t\t\treturn [{ id: versionId, treeId: FileSnapshotReader.FileStorageVersionTreeId }];\n\t\t}\n\t\tthrow new Error(`Unknown version ID: ${versionId}`);\n\t}\n\n\tpublic async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {\n\t\tif (!versionRequested || versionRequested.id === \"latest\") {\n\t\t\treturn this.docTree;\n\t\t}\n\t\tif (versionRequested.treeId !== FileSnapshotReader.FileStorageVersionTreeId) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\tthrow new Error(`Unknown version id: ${versionRequested}`);\n\t\t}\n\n\t\tlet snapshotTree = this.trees[versionRequested.id];\n\t\tif (snapshotTree === undefined) {\n\t\t\tconst tree = this.commits[versionRequested.id];\n\t\t\tif (tree === undefined) {\n\t\t\t\tthrow new Error(`Can't find version ${versionRequested.id}`);\n\t\t\t}\n\n\t\t\tthis.trees[versionRequested.id] = snapshotTree = buildSnapshotTree(\n\t\t\t\ttree.entries,\n\t\t\t\tthis.blobs,\n\t\t\t);\n\t\t}\n\t\treturn snapshotTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tconst blob = this.blobs.get(blobId);\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\t\tthrow new Error(`Unknown blob ID: ${blobId}`);\n\t}\n}\n\n/**\n * @internal\n */\nexport class SnapshotStorage extends ReadDocumentStorageServiceBase {\n\tprotected docId?: string;\n\n\tconstructor(\n\t\tprotected readonly storage: IDocumentStorageService,\n\t\tprotected readonly docTree: ISnapshotTree | null,\n\t) {\n\t\tsuper();\n\t\tassert(!!this.docTree, 0x0b0 /* \"Missing document snapshot tree!\" */);\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (this.docId === undefined || this.docId === versionId || versionId === null) {\n\t\t\tif (versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\t\t\treturn [{ id: \"latest\", treeId: \"\" }];\n\t\t}\n\t\treturn this.storage.getVersions(versionId, count);\n\t}\n\n\tpublic async getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null> {\n\t\tif (versionRequested && versionRequested.id !== \"latest\") {\n\t\t\treturn this.storage.getSnapshotTree(versionRequested);\n\t\t}\n\n\t\treturn this.docTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.storage.readBlob(blobId);\n\t}\n}\n\nexport class StaticStorageDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tconstructor(\n\t\tpublic readonly resolvedUrl: IResolvedUrl,\n\t\tprivate readonly storage: IDocumentStorageService,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose(): void {}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this.storage;\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn new EmptyDeltaStorageService();\n\t}\n\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\t// We have no delta stream, so make it not return forever...\n\t\treturn new Promise(() => {});\n\t}\n}\n\n/**\n * @internal\n */\nexport class StaticStorageDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic constructor(protected readonly storage: IDocumentStorageService) {}\n\n\tpublic async createDocumentService(\n\t\tfileURL: IResolvedUrl,\n\t\tlogger?: ITelemetryLoggerExt,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn new StaticStorageDocumentService(fileURL, this.storage);\n\t}\n\n\t// TODO: Issue-2109 Implement detach container api or put appropriate comment.\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger: ITelemetryLoggerExt,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/replay-driver",
3
- "version": "2.74.0-370705",
3
+ "version": "2.80.0",
4
4
  "description": "Document replay version of Socket.IO implementation",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -37,29 +37,30 @@
37
37
  "main": "lib/index.js",
38
38
  "types": "lib/public.d.ts",
39
39
  "dependencies": {
40
- "@fluid-internal/client-utils": "2.74.0-370705",
41
- "@fluidframework/core-interfaces": "2.74.0-370705",
42
- "@fluidframework/core-utils": "2.74.0-370705",
43
- "@fluidframework/driver-definitions": "2.74.0-370705",
44
- "@fluidframework/driver-utils": "2.74.0-370705",
45
- "@fluidframework/telemetry-utils": "2.74.0-370705"
40
+ "@fluid-internal/client-utils": "~2.80.0",
41
+ "@fluidframework/core-interfaces": "~2.80.0",
42
+ "@fluidframework/core-utils": "~2.80.0",
43
+ "@fluidframework/driver-definitions": "~2.80.0",
44
+ "@fluidframework/driver-utils": "~2.80.0",
45
+ "@fluidframework/telemetry-utils": "~2.80.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@arethetypeswrong/cli": "^0.17.1",
48
+ "@arethetypeswrong/cli": "^0.18.2",
49
49
  "@biomejs/biome": "~1.9.3",
50
- "@fluid-tools/build-cli": "^0.60.0",
50
+ "@fluid-tools/build-cli": "^0.62.0",
51
51
  "@fluidframework/build-common": "^2.0.3",
52
- "@fluidframework/build-tools": "^0.60.0",
53
- "@fluidframework/eslint-config-fluid": "2.74.0-370705",
54
- "@fluidframework/replay-driver-previous": "npm:@fluidframework/replay-driver@2.73.0",
52
+ "@fluidframework/build-tools": "^0.62.0",
53
+ "@fluidframework/eslint-config-fluid": "~2.80.0",
54
+ "@fluidframework/replay-driver-previous": "npm:@fluidframework/replay-driver@2.74.0",
55
55
  "@microsoft/api-extractor": "7.52.11",
56
56
  "@types/nock": "^9.3.0",
57
57
  "@types/node": "^18.19.0",
58
- "concurrently": "^8.2.1",
58
+ "concurrently": "^9.2.1",
59
59
  "copyfiles": "^2.4.1",
60
- "eslint": "~8.57.1",
60
+ "eslint": "~9.39.1",
61
+ "jiti": "^2.6.1",
61
62
  "nock": "^13.3.3",
62
- "rimraf": "^4.4.0",
63
+ "rimraf": "^6.1.2",
63
64
  "typescript": "~5.4.5"
64
65
  },
65
66
  "fluidBuild": {
@@ -21,6 +21,7 @@ import {
21
21
  ScopeType,
22
22
  ISequencedDocumentMessage,
23
23
  ISignalMessage,
24
+ type ISnapshotTree,
24
25
  } from "@fluidframework/driver-definitions/internal";
25
26
 
26
27
  import { ReplayController } from "./replayController.js";
@@ -54,7 +55,7 @@ export class ReplayControllerStatic extends ReplayController {
54
55
  }
55
56
  }
56
57
 
57
- public async initStorage(documentService: IDocumentService) {
58
+ public async initStorage(documentService: IDocumentService): Promise<boolean> {
58
59
  return true;
59
60
  }
60
61
 
@@ -62,7 +63,7 @@ export class ReplayControllerStatic extends ReplayController {
62
63
  return [];
63
64
  }
64
65
 
65
- public async getSnapshotTree(version?: IVersion) {
66
+ public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {
66
67
  return version ? Promise.reject(new Error("Invalid operation")) : null;
67
68
  }
68
69
 
@@ -74,14 +75,14 @@ export class ReplayControllerStatic extends ReplayController {
74
75
  return 0;
75
76
  }
76
77
 
77
- public fetchTo(currentOp: number) {
78
+ public fetchTo(currentOp: number): number | undefined {
78
79
  if (!(this.unitIsTime !== true && this.replayTo >= 0)) {
79
80
  return undefined;
80
81
  }
81
82
  return this.replayTo;
82
83
  }
83
84
 
84
- public isDoneFetch(currentOp: number, lastTimeStamp?: number) {
85
+ public isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean {
85
86
  if (this.replayTo >= 0) {
86
87
  if (this.unitIsTime === true) {
87
88
  return (
@@ -95,7 +96,7 @@ export class ReplayControllerStatic extends ReplayController {
95
96
  return lastTimeStamp === undefined; // No more ops
96
97
  }
97
98
 
98
- public skipToIndex(fetchedOps: ISequencedDocumentMessage[]) {
99
+ public skipToIndex(fetchedOps: ISequencedDocumentMessage[]): number {
99
100
  if (this.replayFrom <= 0) {
100
101
  return 0;
101
102
  }
@@ -123,7 +124,7 @@ export class ReplayControllerStatic extends ReplayController {
123
124
  let current = this.skipToIndex(fetchedOps);
124
125
 
125
126
  return new Promise((resolve) => {
126
- const replayNextOps = () => {
127
+ const replayNextOps = (): void => {
127
128
  // Emit the ops from replay to the end every "deltainterval" milliseconds
128
129
  // to simulate the socket stream
129
130
  const currentOp = fetchedOps[current];
@@ -171,7 +172,7 @@ export class ReplayControllerStatic extends ReplayController {
171
172
  scheduleNext(nextInterval);
172
173
  emitter(playbackOps);
173
174
  };
174
- const scheduleNext = (nextInterval: number) => {
175
+ const scheduleNext = (nextInterval: number): void => {
175
176
  if (nextInterval >= 0 && current < fetchedOps.length) {
176
177
  setTimeout(replayNextOps, nextInterval);
177
178
  } else {
@@ -284,13 +285,13 @@ export class ReplayDocumentDeltaConnection
284
285
  }
285
286
 
286
287
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
287
- public async submitSignal(message: any) {}
288
+ public async submitSignal(message: unknown): Promise<void> {}
288
289
 
289
290
  private _disposed = false;
290
- public get disposed() {
291
+ public get disposed(): boolean {
291
292
  return this._disposed;
292
293
  }
293
- public dispose() {
294
+ public dispose(): void {
294
295
  this._disposed = true;
295
296
  }
296
297
 
@@ -51,7 +51,7 @@ export class ReplayDocumentService
51
51
  super();
52
52
  }
53
53
 
54
- public dispose() {}
54
+ public dispose(): void {}
55
55
 
56
56
  // TODO: Issue-2109 Implement detach container api or put appropriate comment.
57
57
  public get resolvedUrl(): IResolvedUrl {
@@ -25,7 +25,7 @@ export class ReplayDocumentServiceFactory implements IDocumentServiceFactory {
25
25
  from: number,
26
26
  to: number,
27
27
  documentServiceFactory: IDocumentServiceFactory,
28
- ) {
28
+ ): ReplayDocumentServiceFactory {
29
29
  return new ReplayDocumentServiceFactory(
30
30
  documentServiceFactory,
31
31
  new ReplayControllerStatic(from, to),
@@ -152,7 +152,7 @@ export class StaticStorageDocumentService
152
152
  super();
153
153
  }
154
154
 
155
- public dispose() {}
155
+ public dispose(): void {}
156
156
 
157
157
  public async connectToStorage(): Promise<IDocumentStorageService> {
158
158
  return this.storage;