@fluidframework/file-driver 2.0.0-internal.1.4.1 → 2.0.0-internal.2.0.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.
@@ -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,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IAJ3C,OAAO,CAAC,eAAe,CAAK;gBAGP,eAAe,EAAE,yBAAyB,EAC1C,sBAAsB,EAAE,uBAAuB;IAGpE,IAAW,iBAAiB,IAIK,MAAM,CAFtC;IAED,IAAW,iBAAiB,CAAC,EAAE,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;IAwCtB,OAAO,EAAE,UAAU;IAvC7C;;;;;OAKG;WACiB,MAAM,CACt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C,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,sBAA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B,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACjC,CAAC;IAED,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,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,GA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AO,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;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"]}
@@ -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-internal.1.4.1";
8
+ export declare const pkgVersion = "2.0.0-internal.2.0.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -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-internal.1.4.1";
11
+ exports.pkgVersion = "2.0.0-internal.2.0.0";
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,sBAAsB,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-internal.1.4.1\";\n"]}
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,sBAAsB,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-internal.2.0.0\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/file-driver",
3
- "version": "2.0.0-internal.1.4.1",
3
+ "version": "2.0.0-internal.2.0.0",
4
4
  "description": "A driver that reads/write from/to local file storage.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,16 +35,16 @@
35
35
  "dependencies": {
36
36
  "@fluidframework/common-definitions": "^0.20.1",
37
37
  "@fluidframework/common-utils": "^1.0.0",
38
- "@fluidframework/driver-definitions": "^2.0.0-internal.1.4.1",
39
- "@fluidframework/driver-utils": "^2.0.0-internal.1.4.1",
40
- "@fluidframework/protocol-definitions": "^1.0.0",
41
- "@fluidframework/replay-driver": "^2.0.0-internal.1.4.1"
38
+ "@fluidframework/driver-definitions": "^2.0.0-internal.2.0.0",
39
+ "@fluidframework/driver-utils": "^2.0.0-internal.2.0.0",
40
+ "@fluidframework/protocol-definitions": "^1.1.0",
41
+ "@fluidframework/replay-driver": "^2.0.0-internal.2.0.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@fluidframework/build-common": "^1.0.0",
45
- "@fluidframework/build-tools": "^0.4.4000",
45
+ "@fluidframework/build-tools": "^0.4.6000",
46
46
  "@fluidframework/eslint-config-fluid": "^1.0.0",
47
- "@fluidframework/file-driver-previous": "npm:@fluidframework/file-driver@^1.1.0",
47
+ "@fluidframework/file-driver-previous": "npm:@fluidframework/file-driver@>=2.0.0-internal.1.4.0 <2.0.0-internal.2.0.0",
48
48
  "@microsoft/api-extractor": "^7.22.2",
49
49
  "@rushstack/eslint-config": "^2.5.1",
50
50
  "@types/node": "^14.18.0",
@@ -57,6 +57,10 @@
57
57
  },
58
58
  "typeValidation": {
59
59
  "version": "2.0.0",
60
- "broken": {}
60
+ "broken": {
61
+ "InterfaceDeclaration_ISnapshotWriterStorage": {
62
+ "forwardCompat": false
63
+ }
64
+ }
61
65
  }
62
66
  }
@@ -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,
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/file-driver";
9
- export const pkgVersion = "2.0.0-internal.1.4.1";
9
+ export const pkgVersion = "2.0.0-internal.2.0.0";