@fluidframework/file-driver 2.0.0-dev.1.4.5.105745 → 2.0.0-dev.2.2.0.111723
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/.eslintrc.js +2 -1
- package/dist/fileDocumentDeltaConnection.d.ts.map +1 -1
- package/dist/fileDocumentDeltaConnection.js +0 -6
- package/dist/fileDocumentDeltaConnection.js.map +1 -1
- package/dist/fileDocumentService.d.ts.map +1 -1
- package/dist/fileDocumentService.js +1 -0
- package/dist/fileDocumentService.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/package.json +20 -15
- package/prettier.config.cjs +8 -0
- package/src/fileDocumentDeltaConnection.ts +0 -6
- package/src/fileDocumentService.ts +1 -0
- package/src/index.ts +12 -5
- package/src/packageVersion.ts +1 -1
package/.eslintrc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileDocumentDeltaConnection.d.ts","sourceRoot":"","sources":["../src/fileDocumentDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAC9G,OAAO,EACH,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,YAAY,EAEf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAuBpE;;GAEG;AACH,qBAAa,QAAQ;IAIb,OAAO,CAAC,QAAQ,CAAC,e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AAE,EAAE,MAAM,EAEtC;IAED,IAAW,GAAG,IAAI,SAAS,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAE/D;IAED;;;OAGG;IACI,MAAM,CAAC,QAAQ,EAAE,MAAM;IAqB9B,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,IAAI;CAOf;AAED,qBAAa,yBACT,SAAQ,iBAAiB,CAAC,8BAA8B,CACxD,YAAW,wBAAwB,EAAE,WAAW;IAkCtB,OAAO,EAAE,UAAU;IAjC7C;;;;;OAKG;WACiB,MAAM,CACtB,2BAA2B,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAuB7F,SAAgB,cAAc,SAAwB;IACtD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;gBAEV,OAAO,EAAE,UAAU,EAAE,2BAA2B,EAAE,uBAAuB;IAO5F,WAAW;IAIlB,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,IAAI,IAAI,cAAc,CAEhC;IAED,IAAW,MAAM,IAAI,YAAY,CAEhC;IAED,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,IAAW,eAAe,IAAI,yBAAyB,EAAE,CAExD;IAED,IAAW,cAAc,IAAI,cAAc,EAAE,CAE5C;IAED,IAAW,cAAc,IAAI,aAAa,EAAE,CAE3C;IAED,IAAW,oBAAoB,IAAI,oBAAoB,CAEtD;IAEM,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,IAAI;IAM5C,YAAY,CAAC,OAAO,EAAE,GAAG;IAGtC,OAAO,CAAC,SAAS,CAAS;IAC1B,IAAW,QAAQ,YAA6B;IACzC,OAAO;CACjB"}
|
|
@@ -107,12 +107,6 @@ class ReplayFileDeltaConnection extends common_utils_1.TypedEventEmitter {
|
|
|
107
107
|
serviceConfiguration: {
|
|
108
108
|
blockSize: 64436,
|
|
109
109
|
maxMessageSize: ReplayMaxMessageSize,
|
|
110
|
-
summary: {
|
|
111
|
-
idleTime: 5000,
|
|
112
|
-
maxOps: 1000,
|
|
113
|
-
maxTime: 5000 * 12,
|
|
114
|
-
maxAckWaitTime: 600000,
|
|
115
|
-
},
|
|
116
110
|
},
|
|
117
111
|
supportedVersions: [fileProtocolVersion],
|
|
118
112
|
user: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/fileDocumentDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,+EAU8C;AAC9C,+DAAiE;AAGjE,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,qFAAqF;AACrF,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvC,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAErC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,MAAM,GAAiB;IACzB,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,CAAC,gCAAS,CAAC,OAAO,CAAC;IAC3B,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACF,EAAE,EAAE,EAAE;KACT;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;IACtD,GAAG,EAAE,KAAK;CACb,CAAC;AAEF;;GAEG;AACH,MAAa,QAAQ;IAGjB,YACqB,eAA0C,EAC1C,sBAA+C;QAD/C,oBAAe,GAAf,eAAe,CAA2B;QAC1C,2BAAsB,GAAtB,sBAAsB,CAAyB;QAJ5D,oBAAe,GAAG,CAAC,CAAC;IAK5B,CAAC;IAED,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;I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OAAO,CAAC,IAAI,CAAC;IAC7B,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IAC/B,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACjC,CAAC;IAED,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;IACxC,CAAC;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;IACvC,CAAC;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;IACvC,CAAC;IAED,IAAW,oBAAoB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC7C,CAAC;IAEM,MAAM,CAAC,gBAAoC;QAC9C,0FAA0F;QAC1F,0CAA0C;QAC1C,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IAC1E,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,OAAY;IACtC,CAAC;IAGD,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACzC,OAAO,KAAK,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC;CAC9C;AArGD,8DAqGC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable } from \"@fluidframework/common-definitions\";\nimport { IDocumentDeltaConnection, IDocumentDeltaConnectionEvents } from \"@fluidframework/driver-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IConnected,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n ScopeType,\n} from \"@fluidframework/protocol-definitions\";\nimport { TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\n\nconst MaxBatchDeltas = 2000;\n\n// Since the replay service never actually sends messages the size below is arbitrary\nconst ReplayMaxMessageSize = 16 * 1024;\n\nconst fileProtocolVersion = \"^0.1.0\";\n\nconst replayDocumentId = \"replayDocId\";\n\nconst Claims: ITokenClaims = {\n documentId: replayDocumentId,\n scopes: [ScopeType.DocRead],\n tenantId: \"\",\n user: {\n id: \"\",\n },\n iat: Math.round(new Date().getTime() / 1000),\n exp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n ver: \"1.0\",\n};\n\n/**\n * Replay service used to play ops using the delta connection.\n */\nexport class Replayer {\n private currentReplayOp = 0;\n\n constructor(\n private readonly deltaConnection: ReplayFileDeltaConnection,\n private readonly documentStorageService: FileDeltaStorageService) {\n }\n\n public get currentReplayedOp() {\n return this.currentReplayOp;\n }\n\n public set currentReplayedOp(op: number) {\n this.currentReplayOp = op;\n }\n\n public get ops(): readonly Readonly<ISequencedDocumentMessage>[] {\n return this.documentStorageService.ops;\n }\n\n /**\n * Replay the ops upto a certain number.\n * @param replayTo - The last op number to be replayed.\n */\n public replay(replayTo: number) {\n let totalReplayedOps = 0;\n let done: boolean;\n do {\n const fetchToBatch = this.currentReplayOp + MaxBatchDeltas;\n const fetchTo = Math.min(fetchToBatch, replayTo);\n\n const fetchedOps = this.documentStorageService.getFromWebSocket(this.currentReplayOp, fetchTo);\n\n if (fetchedOps.length <= 0) {\n break;\n } else {\n this.emit(fetchedOps);\n totalReplayedOps += fetchedOps.length;\n this.currentReplayOp += fetchedOps.length;\n done = this.isDoneFetch(replayTo);\n }\n } while (!done);\n return totalReplayedOps;\n }\n\n private isDoneFetch(replayTo: number) {\n if (replayTo >= 0) {\n return this.currentReplayOp >= replayTo;\n }\n return false;\n }\n\n private emit(ops: ISequencedDocumentMessage[]) {\n // Note: do not clone messages here!\n // If Replay Tool fails due to one container patching message in-place,\n // then same thing can happen in shipping product due to\n // socket reuse in ODSP between main and summarizer containers.\n this.deltaConnection.emit(\"op\", replayDocumentId, ops);\n }\n}\n\nexport class ReplayFileDeltaConnection\n extends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n implements IDocumentDeltaConnection, IDisposable {\n /**\n * Mimic the delta connection to replay ops on it.\n *\n * @param documentDeltaStorageService - The delta storage service to get ops from.\n * @returns Document delta connection.\n */\n public static async create(\n documentDeltaStorageService: FileDeltaStorageService): Promise<ReplayFileDeltaConnection> {\n const mode: ConnectionMode = \"read\";\n const connection = {\n claims: Claims,\n clientId: \"PseudoClientId\",\n existing: true,\n initialMessages: [],\n initialSignals: [],\n initialClients: [],\n maxMessageSize: ReplayMaxMessageSize,\n mode,\n serviceConfiguration: {\n blockSize: 64436,\n maxMessageSize: ReplayMaxMessageSize,\n summary: {\n idleTime: 5000,\n maxOps: 1000,\n maxTime: 5000 * 12,\n maxAckWaitTime: 600000,\n },\n },\n supportedVersions: [fileProtocolVersion],\n user: null,\n version: fileProtocolVersion,\n };\n const deltaConnection = new ReplayFileDeltaConnection(connection, documentDeltaStorageService);\n return deltaConnection;\n }\n\n public readonly maxMessageSize = ReplayMaxMessageSize;\n private readonly replayer: Replayer;\n\n public constructor(public details: IConnected, documentDeltaStorageService: FileDeltaStorageService) {\n super();\n this.replayer = new Replayer(\n this,\n documentDeltaStorageService);\n }\n\n public getReplayer() {\n return this.replayer;\n }\n\n public get clientId(): string {\n return this.details.clientId;\n }\n\n public get mode(): ConnectionMode {\n return this.details.mode;\n }\n\n public get claims(): ITokenClaims {\n return this.details.claims;\n }\n\n public get existing(): boolean {\n return this.details.existing;\n }\n\n public get version(): string {\n return this.details.version;\n }\n\n public get initialMessages(): ISequencedDocumentMessage[] {\n return this.details.initialMessages;\n }\n\n public get initialSignals(): ISignalMessage[] {\n return this.details.initialSignals;\n }\n\n public get initialClients(): ISignalClient[] {\n return this.details.initialClients;\n }\n\n public get serviceConfiguration(): IClientConfiguration {\n return this.details.serviceConfiguration;\n }\n\n public submit(documentMessages: IDocumentMessage[]): void {\n // ReplayFileDeltaConnection.submit() can't be called - client never sees its own join on,\n // and thus can never move to sending ops.\n throw new Error(\"ReplayFileDeltaConnection.submit() can't be called\");\n }\n\n public async submitSignal(message: any) {\n }\n\n private _disposed = false;\n public get disposed() { return this._disposed; }\n public dispose() { this._disposed = true; }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"fileDocumentDeltaConnection.js","sourceRoot":"","sources":["../src/fileDocumentDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,+EAU8C;AAC9C,+DAAiE;AAGjE,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,qFAAqF;AACrF,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvC,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAErC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,MAAM,GAAiB;IACzB,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,CAAC,gCAAS,CAAC,OAAO,CAAC;IAC3B,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACF,EAAE,EAAE,EAAE;KACT;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;IACtD,GAAG,EAAE,KAAK;CACb,CAAC;AAEF;;GAEG;AACH,MAAa,QAAQ;IAGjB,YACqB,eAA0C,EAC1C,sBAA+C;QAD/C,oBAAe,GAAf,eAAe,CAA2B;QAC1C,2BAAsB,GAAtB,sBAAsB,CAAyB;QAJ5D,oBAAe,GAAG,CAAC,CAAC;IAK5B,CAAC;IAED,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,eAAe,CA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AW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACjC,CAAC;IAED,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;IACxC,CAAC;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;IACvC,CAAC;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;IACvC,CAAC;IAED,IAAW,oBAAoB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC7C,CAAC;IAEM,MAAM,CAAC,gBAAoC;QAC9C,0FAA0F;QAC1F,0CAA0C;QAC1C,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IAC1E,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,OAAY;IACtC,CAAC;IAGD,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACzC,OAAO,KAAK,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC;CAC9C;AA/FD,8DA+FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable } from \"@fluidframework/common-definitions\";\nimport { IDocumentDeltaConnection, IDocumentDeltaConnectionEvents } from \"@fluidframework/driver-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IConnected,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n ScopeType,\n} from \"@fluidframework/protocol-definitions\";\nimport { TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\n\nconst MaxBatchDeltas = 2000;\n\n// Since the replay service never actually sends messages the size below is arbitrary\nconst ReplayMaxMessageSize = 16 * 1024;\n\nconst fileProtocolVersion = \"^0.1.0\";\n\nconst replayDocumentId = \"replayDocId\";\n\nconst Claims: ITokenClaims = {\n documentId: replayDocumentId,\n scopes: [ScopeType.DocRead],\n tenantId: \"\",\n user: {\n id: \"\",\n },\n iat: Math.round(new Date().getTime() / 1000),\n exp: Math.round(new Date().getTime() / 1000) + 60 * 60, // 1 hour expiration\n ver: \"1.0\",\n};\n\n/**\n * Replay service used to play ops using the delta connection.\n */\nexport class Replayer {\n private currentReplayOp = 0;\n\n constructor(\n private readonly deltaConnection: ReplayFileDeltaConnection,\n private readonly documentStorageService: FileDeltaStorageService) {\n }\n\n public get currentReplayedOp() {\n return this.currentReplayOp;\n }\n\n public set currentReplayedOp(op: number) {\n this.currentReplayOp = op;\n }\n\n public get ops(): readonly Readonly<ISequencedDocumentMessage>[] {\n return this.documentStorageService.ops;\n }\n\n /**\n * Replay the ops upto a certain number.\n * @param replayTo - The last op number to be replayed.\n */\n public replay(replayTo: number) {\n let totalReplayedOps = 0;\n let done: boolean;\n do {\n const fetchToBatch = this.currentReplayOp + MaxBatchDeltas;\n const fetchTo = Math.min(fetchToBatch, replayTo);\n\n const fetchedOps = this.documentStorageService.getFromWebSocket(this.currentReplayOp, fetchTo);\n\n if (fetchedOps.length <= 0) {\n break;\n } else {\n this.emit(fetchedOps);\n totalReplayedOps += fetchedOps.length;\n this.currentReplayOp += fetchedOps.length;\n done = this.isDoneFetch(replayTo);\n }\n } while (!done);\n return totalReplayedOps;\n }\n\n private isDoneFetch(replayTo: number) {\n if (replayTo >= 0) {\n return this.currentReplayOp >= replayTo;\n }\n return false;\n }\n\n private emit(ops: ISequencedDocumentMessage[]) {\n // Note: do not clone messages here!\n // If Replay Tool fails due to one container patching message in-place,\n // then same thing can happen in shipping product due to\n // socket reuse in ODSP between main and summarizer containers.\n this.deltaConnection.emit(\"op\", replayDocumentId, ops);\n }\n}\n\nexport class ReplayFileDeltaConnection\n extends TypedEventEmitter<IDocumentDeltaConnectionEvents>\n implements IDocumentDeltaConnection, IDisposable {\n /**\n * Mimic the delta connection to replay ops on it.\n *\n * @param documentDeltaStorageService - The delta storage service to get ops from.\n * @returns Document delta connection.\n */\n public static async create(\n documentDeltaStorageService: FileDeltaStorageService): Promise<ReplayFileDeltaConnection> {\n const mode: ConnectionMode = \"read\";\n const connection = {\n claims: Claims,\n clientId: \"PseudoClientId\",\n existing: true,\n initialMessages: [],\n initialSignals: [],\n initialClients: [],\n maxMessageSize: ReplayMaxMessageSize,\n mode,\n serviceConfiguration: {\n blockSize: 64436,\n maxMessageSize: ReplayMaxMessageSize,\n },\n supportedVersions: [fileProtocolVersion],\n user: null,\n version: fileProtocolVersion,\n };\n const deltaConnection = new ReplayFileDeltaConnection(connection, documentDeltaStorageService);\n return deltaConnection;\n }\n\n public readonly maxMessageSize = ReplayMaxMessageSize;\n private readonly replayer: Replayer;\n\n public constructor(public details: IConnected, documentDeltaStorageService: FileDeltaStorageService) {\n super();\n this.replayer = new Replayer(\n this,\n documentDeltaStorageService);\n }\n\n public getReplayer() {\n return this.replayer;\n }\n\n public get clientId(): string {\n return this.details.clientId;\n }\n\n public get mode(): ConnectionMode {\n return this.details.mode;\n }\n\n public get claims(): ITokenClaims {\n return this.details.claims;\n }\n\n public get existing(): boolean {\n return this.details.existing;\n }\n\n public get version(): string {\n return this.details.version;\n }\n\n public get initialMessages(): ISequencedDocumentMessage[] {\n return this.details.initialMessages;\n }\n\n public get initialSignals(): ISignalMessage[] {\n return this.details.initialSignals;\n }\n\n public get initialClients(): ISignalClient[] {\n return this.details.initialClients;\n }\n\n public get serviceConfiguration(): IClientConfiguration {\n return this.details.serviceConfiguration;\n }\n\n public submit(documentMessages: IDocumentMessage[]): void {\n // ReplayFileDeltaConnection.submit() can't be called - client never sees its own join on,\n // and thus can never move to sending ops.\n throw new Error(\"ReplayFileDeltaConnection.submit() can't be called\");\n }\n\n public async submitSignal(message: any) {\n }\n\n private _disposed = false;\n public get disposed() { return this._disposed; }\n public dispose() { this._disposed = true; }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileDocumentService.d.ts","sourceRoot":"","sources":["../src/fileDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;GAGG;
|
|
1
|
+
{"version":3,"file":"fileDocumentService.d.ts","sourceRoot":"","sources":["../src/fileDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,GAAG,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;GAGG;AAEH,qBAAa,mBAAoB,YAAW,GAAG,CAAC,gBAAgB;IAExD,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAFf,OAAO,EAAE,GAAG,CAAC,uBAAuB,EACpC,YAAY,EAAE,uBAAuB,EACrC,eAAe,EAAE,GAAG,CAAC,wBAAwB;IAG3D,OAAO;IAGd,IAAW,WAAW,IAAI,GAAG,CAAC,YAAY,CAEzC;IAEY,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IAIxD,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;IAI/E;;;;;;OAMG;IACU,oBAAoB,CAC7B,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;CAG9D"}
|
|
@@ -9,6 +9,7 @@ exports.FileDocumentService = void 0;
|
|
|
9
9
|
* The DocumentService manages the different endpoints for connecting to
|
|
10
10
|
* underlying storage for file document service.
|
|
11
11
|
*/
|
|
12
|
+
// eslint-disable-next-line import/namespace
|
|
12
13
|
class FileDocumentService {
|
|
13
14
|
constructor(storage, deltaStorage, deltaConnection) {
|
|
14
15
|
this.storage = storage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileDocumentService.js","sourceRoot":"","sources":["../src/fileDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH;;;GAGG;AACH,MAAa,mBAAmB;IAC5B,YACqB,OAAoC,EACpC,YAAqC,EACrC,eAA6C;QAF7C,YAAO,GAAP,OAAO,CAA6B;QACpC,iBAAY,GAAZ,YAAY,CAAyB;QACrC,oBAAe,GAAf,eAAe,CAA8B;IAClE,CAAC;IAEM,OAAO,KAAI,CAAC;IAEnB,8EAA8E;IAC9E,IAAW,WAAW;QAClB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,gBAAgB;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,qBAAqB;QAC9B,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,oBAAoB,CAC7B,MAAe;QACf,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;CACJ;AAjCD,kDAiCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as api from \"@fluidframework/driver-definitions\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\nimport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\n\n/**\n * The DocumentService manages the different endpoints for connecting to\n * underlying storage for file document service.\n */\nexport class FileDocumentService implements api.IDocumentService {\n constructor(\n private readonly storage: api.IDocumentStorageService,\n private readonly deltaStorage: FileDeltaStorageService,\n private readonly deltaConnection: api.IDocumentDeltaConnection) {\n }\n\n public dispose() {}\n\n // TODO: Issue-2109 Implement detach container api or put appropriate comment.\n public get resolvedUrl(): api.IResolvedUrl {\n throw new Error(\"Not implemented\");\n }\n\n public async connectToStorage(): Promise<api.IDocumentStorageService> {\n return this.storage;\n }\n\n public async connectToDeltaStorage(): Promise<api.IDocumentDeltaStorageService> {\n return this.deltaStorage;\n }\n\n /**\n * Connects to a delta storage endpoint of provided documentService to get ops and then replaying\n * them so as to mimic a delta stream endpoint.\n *\n * @param client - Client that connects to socket.\n * @returns returns the delta stream service.\n */\n public async connectToDeltaStream(\n client: IClient): Promise<api.IDocumentDeltaConnection> {\n return this.deltaConnection;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"fileDocumentService.js","sourceRoot":"","sources":["../src/fileDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH;;;GAGG;AACH,4CAA4C;AAC5C,MAAa,mBAAmB;IAC5B,YACqB,OAAoC,EACpC,YAAqC,EACrC,eAA6C;QAF7C,YAAO,GAAP,OAAO,CAA6B;QACpC,iBAAY,GAAZ,YAAY,CAAyB;QACrC,oBAAe,GAAf,eAAe,CAA8B;IAClE,CAAC;IAEM,OAAO,KAAI,CAAC;IAEnB,8EAA8E;IAC9E,IAAW,WAAW;QAClB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,gBAAgB;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,qBAAqB;QAC9B,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,oBAAoB,CAC7B,MAAe;QACf,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;CACJ;AAjCD,kDAiCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as api from \"@fluidframework/driver-definitions\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\nimport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\n\n/**\n * The DocumentService manages the different endpoints for connecting to\n * underlying storage for file document service.\n */\n// eslint-disable-next-line import/namespace\nexport class FileDocumentService implements api.IDocumentService {\n constructor(\n private readonly storage: api.IDocumentStorageService,\n private readonly deltaStorage: FileDeltaStorageService,\n private readonly deltaConnection: api.IDocumentDeltaConnection) {\n }\n\n public dispose() {}\n\n // TODO: Issue-2109 Implement detach container api or put appropriate comment.\n public get resolvedUrl(): api.IResolvedUrl {\n throw new Error(\"Not implemented\");\n }\n\n public async connectToStorage(): Promise<api.IDocumentStorageService> {\n return this.storage;\n }\n\n public async connectToDeltaStorage(): Promise<api.IDocumentDeltaStorageService> {\n return this.deltaStorage;\n }\n\n /**\n * Connects to a delta storage endpoint of provided documentService to get ops and then replaying\n * them so as to mimic a delta stream endpoint.\n *\n * @param client - Client that connects to socket.\n * @returns returns the delta stream service.\n */\n public async connectToDeltaStream(\n client: IClient): Promise<api.IDocumentDeltaConnection> {\n return this.deltaConnection;\n }\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
5
|
+
export { FileDeltaStorageService } from "./fileDeltaStorageService";
|
|
6
|
+
export { FileDocumentService } from "./fileDocumentService";
|
|
7
|
+
export { FileDocumentServiceFactory } from "./fileDocumentServiceFactory";
|
|
8
|
+
export { Replayer, ReplayFileDeltaConnection } from "./fileDocumentDeltaConnection";
|
|
9
|
+
export { FileSnapshotWriterClassFactory, FileStorageDocumentName, FluidFetchReader, FluidFetchReaderFileSnapshotWriter, ISnapshotWriterStorage, ReaderConstructor, } from "./fileDocumentStorageService";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EACN,8BAA8B,EAC9B,uBAAuB,EACvB,gBAAgB,EAChB,kCAAkC,EAClC,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
exports.FluidFetchReaderFileSnapshotWriter = exports.FluidFetchReader = exports.FileStorageDocumentName = exports.FileSnapshotWriterClassFactory = exports.ReplayFileDeltaConnection = exports.Replayer = exports.FileDocumentServiceFactory = exports.FileDocumentService = exports.FileDeltaStorageService = void 0;
|
|
8
|
+
var fileDeltaStorageService_1 = require("./fileDeltaStorageService");
|
|
9
|
+
Object.defineProperty(exports, "FileDeltaStorageService", { enumerable: true, get: function () { return fileDeltaStorageService_1.FileDeltaStorageService; } });
|
|
10
|
+
var fileDocumentService_1 = require("./fileDocumentService");
|
|
11
|
+
Object.defineProperty(exports, "FileDocumentService", { enumerable: true, get: function () { return fileDocumentService_1.FileDocumentService; } });
|
|
12
|
+
var fileDocumentServiceFactory_1 = require("./fileDocumentServiceFactory");
|
|
13
|
+
Object.defineProperty(exports, "FileDocumentServiceFactory", { enumerable: true, get: function () { return fileDocumentServiceFactory_1.FileDocumentServiceFactory; } });
|
|
14
|
+
var fileDocumentDeltaConnection_1 = require("./fileDocumentDeltaConnection");
|
|
15
|
+
Object.defineProperty(exports, "Replayer", { enumerable: true, get: function () { return fileDocumentDeltaConnection_1.Replayer; } });
|
|
16
|
+
Object.defineProperty(exports, "ReplayFileDeltaConnection", { enumerable: true, get: function () { return fileDocumentDeltaConnection_1.ReplayFileDeltaConnection; } });
|
|
17
|
+
var fileDocumentStorageService_1 = require("./fileDocumentStorageService");
|
|
18
|
+
Object.defineProperty(exports, "FileSnapshotWriterClassFactory", { enumerable: true, get: function () { return fileDocumentStorageService_1.FileSnapshotWriterClassFactory; } });
|
|
19
|
+
Object.defineProperty(exports, "FileStorageDocumentName", { enumerable: true, get: function () { return fileDocumentStorageService_1.FileStorageDocumentName; } });
|
|
20
|
+
Object.defineProperty(exports, "FluidFetchReader", { enumerable: true, get: function () { return fileDocumentStorageService_1.FluidFetchReader; } });
|
|
21
|
+
Object.defineProperty(exports, "FluidFetchReaderFileSnapshotWriter", { enumerable: true, get: function () { return fileDocumentStorageService_1.FluidFetchReaderFileSnapshotWriter; } });
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,2EAA0E;AAAjE,wIAAA,0BAA0B,OAAA;AACnC,6EAAoF;AAA3E,uHAAA,QAAQ,OAAA;AAAE,wIAAA,yBAAyB,OAAA;AAC5C,2EAOsC;AANrC,4IAAA,8BAA8B,OAAA;AAC9B,qIAAA,uBAAuB,OAAA;AACvB,8HAAA,gBAAgB,OAAA;AAChB,gJAAA,kCAAkC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { FileDeltaStorageService } from \"./fileDeltaStorageService\";\nexport { FileDocumentService } from \"./fileDocumentService\";\nexport { FileDocumentServiceFactory } from \"./fileDocumentServiceFactory\";\nexport { Replayer, ReplayFileDeltaConnection } from \"./fileDocumentDeltaConnection\";\nexport {\n\tFileSnapshotWriterClassFactory,\n\tFileStorageDocumentName,\n\tFluidFetchReader,\n\tFluidFetchReaderFileSnapshotWriter,\n\tISnapshotWriterStorage,\n\tReaderConstructor,\n} from \"./fileDocumentStorageService\";\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/file-driver";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-dev.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev.2.2.0.111723";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/file-driver";
|
|
11
|
-
exports.pkgVersion = "2.0.0-dev.
|
|
11
|
+
exports.pkgVersion = "2.0.0-dev.2.2.0.111723";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,6BAA6B,CAAC;AACxC,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/file-driver\";\nexport const pkgVersion = \"2.0.0-dev.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,6BAA6B,CAAC;AACxC,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/file-driver\";\nexport const pkgVersion = \"2.0.0-dev.2.2.0.111723\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/file-driver",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.2.2.0.111723",
|
|
4
4
|
"description": "A driver that reads/write from/to local file storage.",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,38 +25,43 @@
|
|
|
25
25
|
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
26
26
|
"eslint": "eslint --format stylish src",
|
|
27
27
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
28
|
+
"format": "npm run prettier:fix",
|
|
28
29
|
"lint": "npm run eslint",
|
|
29
30
|
"lint:fix": "npm run eslint:fix",
|
|
31
|
+
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
32
|
+
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
30
33
|
"tsc": "tsc",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"typetests:gen": "fluid-type-validator -g -d ."
|
|
34
|
+
"typetests:gen": "flub generate typetests --generate --dir .",
|
|
35
|
+
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
38
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
37
39
|
"@fluidframework/common-utils": "^1.0.0",
|
|
38
|
-
"@fluidframework/driver-definitions": "2.0.0-dev.
|
|
39
|
-
"@fluidframework/driver-utils": "2.0.0-dev.
|
|
40
|
-
"@fluidframework/protocol-definitions": "^1.
|
|
41
|
-
"@fluidframework/replay-driver": "2.0.0-dev.
|
|
40
|
+
"@fluidframework/driver-definitions": ">=2.0.0-dev.2.2.0.111723 <2.0.0-dev.3.0.0",
|
|
41
|
+
"@fluidframework/driver-utils": ">=2.0.0-dev.2.2.0.111723 <2.0.0-dev.3.0.0",
|
|
42
|
+
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
43
|
+
"@fluidframework/replay-driver": ">=2.0.0-dev.2.2.0.111723 <2.0.0-dev.3.0.0"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@fluidframework/build-
|
|
46
|
-
"@fluidframework/
|
|
47
|
-
"@fluidframework/
|
|
46
|
+
"@fluid-tools/build-cli": "^0.6.0-109663",
|
|
47
|
+
"@fluidframework/build-common": "^1.1.0",
|
|
48
|
+
"@fluidframework/build-tools": "^0.6.0-109663",
|
|
49
|
+
"@fluidframework/eslint-config-fluid": "^1.2.0",
|
|
50
|
+
"@fluidframework/file-driver-previous": "npm:@fluidframework/file-driver@2.0.0-internal.2.1.0",
|
|
48
51
|
"@microsoft/api-extractor": "^7.22.2",
|
|
49
52
|
"@rushstack/eslint-config": "^2.5.1",
|
|
50
53
|
"@types/node": "^14.18.0",
|
|
51
54
|
"concurrently": "^6.2.0",
|
|
52
55
|
"copyfiles": "^2.4.1",
|
|
53
56
|
"eslint": "~8.6.0",
|
|
57
|
+
"prettier": "~2.6.2",
|
|
54
58
|
"rimraf": "^2.6.2",
|
|
55
|
-
"typescript": "~4.5.5"
|
|
56
|
-
"typescript-formatter": "7.1.0"
|
|
59
|
+
"typescript": "~4.5.5"
|
|
57
60
|
},
|
|
58
61
|
"typeValidation": {
|
|
59
|
-
"version": "2.0.0",
|
|
62
|
+
"version": "2.0.0-internal.2.2.0",
|
|
63
|
+
"baselineRange": ">=2.0.0-internal.2.1.0 <2.0.0-internal.2.2.0",
|
|
64
|
+
"baselineVersion": "2.0.0-internal.2.1.0",
|
|
60
65
|
"broken": {}
|
|
61
66
|
}
|
|
62
67
|
}
|
|
@@ -128,12 +128,6 @@ export class ReplayFileDeltaConnection
|
|
|
128
128
|
serviceConfiguration: {
|
|
129
129
|
blockSize: 64436,
|
|
130
130
|
maxMessageSize: ReplayMaxMessageSize,
|
|
131
|
-
summary: {
|
|
132
|
-
idleTime: 5000,
|
|
133
|
-
maxOps: 1000,
|
|
134
|
-
maxTime: 5000 * 12,
|
|
135
|
-
maxAckWaitTime: 600000,
|
|
136
|
-
},
|
|
137
131
|
},
|
|
138
132
|
supportedVersions: [fileProtocolVersion],
|
|
139
133
|
user: null,
|
|
@@ -11,6 +11,7 @@ import { FileDeltaStorageService } from "./fileDeltaStorageService";
|
|
|
11
11
|
* The DocumentService manages the different endpoints for connecting to
|
|
12
12
|
* underlying storage for file document service.
|
|
13
13
|
*/
|
|
14
|
+
// eslint-disable-next-line import/namespace
|
|
14
15
|
export class FileDocumentService implements api.IDocumentService {
|
|
15
16
|
constructor(
|
|
16
17
|
private readonly storage: api.IDocumentStorageService,
|
package/src/index.ts
CHANGED
|
@@ -3,8 +3,15 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
6
|
+
export { FileDeltaStorageService } from "./fileDeltaStorageService";
|
|
7
|
+
export { FileDocumentService } from "./fileDocumentService";
|
|
8
|
+
export { FileDocumentServiceFactory } from "./fileDocumentServiceFactory";
|
|
9
|
+
export { Replayer, ReplayFileDeltaConnection } from "./fileDocumentDeltaConnection";
|
|
10
|
+
export {
|
|
11
|
+
FileSnapshotWriterClassFactory,
|
|
12
|
+
FileStorageDocumentName,
|
|
13
|
+
FluidFetchReader,
|
|
14
|
+
FluidFetchReaderFileSnapshotWriter,
|
|
15
|
+
ISnapshotWriterStorage,
|
|
16
|
+
ReaderConstructor,
|
|
17
|
+
} from "./fileDocumentStorageService";
|
package/src/packageVersion.ts
CHANGED