@fluidframework/odsp-driver 2.112.0 → 2.113.0-411909

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.
Files changed (38) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +4 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/packageVersion.d.ts +1 -1
  6. package/dist/packageVersion.d.ts.map +1 -1
  7. package/dist/packageVersion.js +1 -1
  8. package/dist/packageVersion.js.map +1 -1
  9. package/dist/pointInTimeDriver/odspPointInTimeDocumentService.d.ts +37 -0
  10. package/dist/pointInTimeDriver/odspPointInTimeDocumentService.d.ts.map +1 -0
  11. package/dist/pointInTimeDriver/odspPointInTimeDocumentService.js +70 -0
  12. package/dist/pointInTimeDriver/odspPointInTimeDocumentService.js.map +1 -0
  13. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts +49 -0
  14. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts.map +1 -0
  15. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js +108 -0
  16. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js.map +1 -0
  17. package/lib/index.d.ts +1 -0
  18. package/lib/index.d.ts.map +1 -1
  19. package/lib/index.js +2 -0
  20. package/lib/index.js.map +1 -1
  21. package/lib/packageVersion.d.ts +1 -1
  22. package/lib/packageVersion.d.ts.map +1 -1
  23. package/lib/packageVersion.js +1 -1
  24. package/lib/packageVersion.js.map +1 -1
  25. package/lib/pointInTimeDriver/odspPointInTimeDocumentService.d.ts +37 -0
  26. package/lib/pointInTimeDriver/odspPointInTimeDocumentService.d.ts.map +1 -0
  27. package/lib/pointInTimeDriver/odspPointInTimeDocumentService.js +66 -0
  28. package/lib/pointInTimeDriver/odspPointInTimeDocumentService.js.map +1 -0
  29. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts +49 -0
  30. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts.map +1 -0
  31. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js +104 -0
  32. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js.map +1 -0
  33. package/package.json +11 -11
  34. package/src/index.ts +2 -0
  35. package/src/odspVersionManager/DEV.md +101 -29
  36. package/src/packageVersion.ts +1 -1
  37. package/src/pointInTimeDriver/odspPointInTimeDocumentService.ts +94 -0
  38. package/src/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.ts +185 -0
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export { getOdspUrlParts, isOdcUrl, isSpoUrl } from "./odspUrlHelper.js";
11
11
  export { prefetchLatestSnapshot } from "./prefetchLatestSnapshot.js";
12
12
  export { createLocalOdspDocumentServiceFactory, OdspDocumentServiceFactory, } from "./odspDocumentServiceFactory.js";
13
13
  export { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.js";
14
+ export { OdspPointInTimeDocumentServiceFactory } from "./pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js";
14
15
  export { createOdspCreateContainerRequest } from "./createOdspCreateContainerRequest.js";
15
16
  export { OdspDriverUrlResolver } from "./odspDriverUrlResolver.js";
16
17
  export { OdspDriverUrlResolverForShareLink, type ShareLinkFetcherProps, } from "./odspDriverUrlResolverForShareLink.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EACN,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,iBAAiB,GACjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EA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B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.odspDriverCompatDetailsForLoader = exports.parseCompactSnapshotResponse = exports.SnapshotFormatSupportType = exports.isOdspResolvedUrl = exports.storeLocatorInOdspUrl = exports.locatorQueryParamName = exports.getLocatorFromOdspUrl = exports.encodeOdspFluidDataStoreLocator = exports.OdspDriverUrlResolverForShareLink = exports.OdspDriverUrlResolver = exports.createOdspCreateContainerRequest = exports.OdspDocumentServiceFactoryCore = exports.OdspDocumentServiceFactory = exports.createLocalOdspDocumentServiceFactory = exports.prefetchLatestSnapshot = exports.isSpoUrl = exports.isOdcUrl = exports.getOdspUrlParts = exports.getHashedDocumentId = exports.createOdspUrl = exports.checkUrl = exports.SharingLinkHeader = exports.ClpCompliantAppHeader = exports.OdcFileSiteOrigin = exports.OdcApiSiteOrigin = void 0;
7
+ exports.odspDriverCompatDetailsForLoader = exports.parseCompactSnapshotResponse = exports.SnapshotFormatSupportType = exports.isOdspResolvedUrl = exports.storeLocatorInOdspUrl = exports.locatorQueryParamName = exports.getLocatorFromOdspUrl = exports.encodeOdspFluidDataStoreLocator = exports.OdspDriverUrlResolverForShareLink = exports.OdspDriverUrlResolver = exports.createOdspCreateContainerRequest = exports.OdspPointInTimeDocumentServiceFactory = exports.OdspDocumentServiceFactoryCore = exports.OdspDocumentServiceFactory = exports.createLocalOdspDocumentServiceFactory = exports.prefetchLatestSnapshot = exports.isSpoUrl = exports.isOdcUrl = exports.getOdspUrlParts = exports.getHashedDocumentId = exports.createOdspUrl = exports.checkUrl = exports.SharingLinkHeader = exports.ClpCompliantAppHeader = exports.OdcFileSiteOrigin = exports.OdcApiSiteOrigin = void 0;
8
8
  // Constants
9
9
  var constants_js_1 = require("./constants.js");
10
10
  Object.defineProperty(exports, "OdcApiSiteOrigin", { enumerable: true, get: function () { return constants_js_1.OdcApiSiteOrigin; } });
@@ -32,6 +32,9 @@ Object.defineProperty(exports, "createLocalOdspDocumentServiceFactory", { enumer
32
32
  Object.defineProperty(exports, "OdspDocumentServiceFactory", { enumerable: true, get: function () { return odspDocumentServiceFactory_js_1.OdspDocumentServiceFactory; } });
33
33
  var odspDocumentServiceFactoryCore_js_1 = require("./odspDocumentServiceFactoryCore.js");
34
34
  Object.defineProperty(exports, "OdspDocumentServiceFactoryCore", { enumerable: true, get: function () { return odspDocumentServiceFactoryCore_js_1.OdspDocumentServiceFactoryCore; } });
35
+ // eslint-disable-next-line import-x/no-internal-modules
36
+ var odspPointInTimeDocumentServiceFactory_js_1 = require("./pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js");
37
+ Object.defineProperty(exports, "OdspPointInTimeDocumentServiceFactory", { enumerable: true, get: function () { return odspPointInTimeDocumentServiceFactory_js_1.OdspPointInTimeDocumentServiceFactory; } });
35
38
  // File creation
36
39
  var createOdspCreateContainerRequest_js_1 = require("./createOdspCreateContainerRequest.js");
37
40
  Object.defineProperty(exports, "createOdspCreateContainerRequest", { enumerable: true, get: function () { return createOdspCreateContainerRequest_js_1.createOdspCreateContainerRequest; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,YAAY;AACZ,+CAAqE;AAA5D,gHAAA,gBAAgB,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AAE5C,2DAM8B;AAL7B,2HAAA,qBAAqB,OAAA;AAIrB,uHAAA,iBAAiB,OAAA;AAGlB,eAAe;AACf,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,2DAAmF;AAA1E,yHAAA,mBAAmB,OAAA;AAC5B,uDAAyE;AAAhE,mHAAA,eAAe,OAAA;AAAE,4GAAA,QAAQ,OAAA;AAAE,4GAAA,QAAQ,OAAA;AAE5C,iDAAiD;AACjD,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAE/B,UAAU;AACV,iFAGyC;AAFxC,sJAAA,qCAAqC,OAAA;AACrC,2IAAA,0BAA0B,OAAA;AAE3B,yFAAqF;AAA5E,mJAAA,8BAA8B,OAAA;AAEvC,gBAAgB;AAChB,6FAAyF;AAAhF,uJAAA,gCAAgC,OAAA;AAEzC,6CAA6C;AAC7C,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,+FAGgD;AAF/C,yJAAA,iCAAiC,OAAA;AAIlC,oEAAoE;AACpE,+DAKgC;AAJ/B,uIAAA,+BAA+B,OAAA;AAC/B,6HAAA,qBAAqB,OAAA;AACrB,6HAAA,qBAAqB,OAAA;AACrB,6HAAA,qBAAqB,OAAA;AAetB,+CAAuE;AAA1C,iHAAA,iBAAiB,OAAA;AAC9C,uDAA+D;AAAtD,6HAAA,yBAAyB,OAAA;AAClC,uEAGoC;AADnC,wIAAA,4BAA4B,OAAA;AAG7B,uBAAuB;AACvB,qEAA6E;AAApE,2IAAA,gCAAgC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Constants\nexport { OdcApiSiteOrigin, OdcFileSiteOrigin } from \"./constants.js\";\n\nexport {\n\tClpCompliantAppHeader,\n\ttype IClpCompliantAppHeader,\n\ttype ISharingLinkHeader,\n\ttype OdspFluidDataStoreLocator,\n\tSharingLinkHeader,\n} from \"./contractsPublic.js\";\n\n// public utils\nexport { checkUrl } from \"./checkUrl.js\";\nexport { createOdspUrl } from \"./createOdspUrl.js\";\nexport { getHashedDocumentId, type ISnapshotContents } from \"./odspPublicUtils.js\";\nexport { getOdspUrlParts, isOdcUrl, isSpoUrl } from \"./odspUrlHelper.js\";\n\n// prefetch latest snapshot before container load\nexport { prefetchLatestSnapshot } from \"./prefetchLatestSnapshot.js\";\n\n// Factory\nexport {\n\tcreateLocalOdspDocumentServiceFactory,\n\tOdspDocumentServiceFactory,\n} from \"./odspDocumentServiceFactory.js\";\nexport { OdspDocumentServiceFactoryCore } from \"./odspDocumentServiceFactoryCore.js\";\n\n// File creation\nexport { createOdspCreateContainerRequest } from \"./createOdspCreateContainerRequest.js\";\n\n// URI Resolver functionality, URI management\nexport { OdspDriverUrlResolver } from \"./odspDriverUrlResolver.js\";\nexport {\n\tOdspDriverUrlResolverForShareLink,\n\ttype ShareLinkFetcherProps,\n} from \"./odspDriverUrlResolverForShareLink.js\";\n\n// It's used by URL resolve code, but also has some public functions\nexport {\n\tencodeOdspFluidDataStoreLocator,\n\tgetLocatorFromOdspUrl,\n\tlocatorQueryParamName,\n\tstoreLocatorInOdspUrl,\n} from \"./odspFluidFileLink.js\";\n\nexport type {\n\tIOdspCache,\n\tIPersistedFileCache,\n\tINonPersistentCache,\n\tIPrefetchSnapshotContents,\n} from \"./odspCache.js\";\nexport type {\n\tICacheAndTracker,\n\tEpochTracker,\n\tFetchType,\n\tFetchTypeInternal,\n} from \"./epochTracker.js\";\nexport { type IOdspResponse, isOdspResolvedUrl } from \"./odspUtils.js\";\nexport { SnapshotFormatSupportType } from \"./fetchSnapshot.js\";\nexport {\n\ttype ISnapshotContentsWithProps,\n\tparseCompactSnapshotResponse,\n} from \"./compactSnapshotParser.js\";\n\n// Layer Compat details\nexport { odspDriverCompatDetailsForLoader } from \"./odspLayerCompatState.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,YAAY;AACZ,+CAAqE;AAA5D,gHAAA,gBAAgB,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AAE5C,2DAM8B;AAL7B,2HAAA,qBAAqB,OAAA;AAIrB,uHAAA,iBAAiB,OAAA;AAGlB,eAAe;AACf,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,2DAAmF;AAA1E,yHAAA,mBAAmB,OAAA;AAC5B,uDAAyE;AAAhE,mHAAA,eAAe,OAAA;AAAE,4GAAA,QAAQ,OAAA;AAAE,4GAAA,QAAQ,OAAA;AAE5C,iDAAiD;AACjD,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAE/B,UAAU;AACV,iFAGyC;AAFxC,sJAAA,qCAAqC,OAAA;AACrC,2IAAA,0BAA0B,OAAA;AAE3B,yFAAqF;AAA5E,mJAAA,8BAA8B,OAAA;AACvC,wDAAwD;AACxD,yHAAqH;AAA5G,iKAAA,qCAAqC,OAAA;AAE9C,gBAAgB;AAChB,6FAAyF;AAAhF,uJAAA,gCAAgC,OAAA;AAEzC,6CAA6C;AAC7C,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,+FAGgD;AAF/C,yJAAA,iCAAiC,OAAA;AAIlC,oEAAoE;AACpE,+DAKgC;AAJ/B,uIAAA,+BAA+B,OAAA;AAC/B,6HAAA,qBAAqB,OAAA;AACrB,6HAAA,qBAAqB,OAAA;AACrB,6HAAA,qBAAqB,OAAA;AAetB,+CAAuE;AAA1C,iHAAA,iBAAiB,OAAA;AAC9C,uDAA+D;AAAtD,6HAAA,yBAAyB,OAAA;AAClC,uEAGoC;AADnC,wIAAA,4BAA4B,OAAA;AAG7B,uBAAuB;AACvB,qEAA6E;AAApE,2IAAA,gCAAgC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Constants\nexport { OdcApiSiteOrigin, OdcFileSiteOrigin } from \"./constants.js\";\n\nexport {\n\tClpCompliantAppHeader,\n\ttype IClpCompliantAppHeader,\n\ttype ISharingLinkHeader,\n\ttype OdspFluidDataStoreLocator,\n\tSharingLinkHeader,\n} from \"./contractsPublic.js\";\n\n// public utils\nexport { checkUrl } from \"./checkUrl.js\";\nexport { createOdspUrl } from \"./createOdspUrl.js\";\nexport { getHashedDocumentId, type ISnapshotContents } from \"./odspPublicUtils.js\";\nexport { getOdspUrlParts, isOdcUrl, isSpoUrl } from \"./odspUrlHelper.js\";\n\n// prefetch latest snapshot before container load\nexport { prefetchLatestSnapshot } from \"./prefetchLatestSnapshot.js\";\n\n// Factory\nexport {\n\tcreateLocalOdspDocumentServiceFactory,\n\tOdspDocumentServiceFactory,\n} from \"./odspDocumentServiceFactory.js\";\nexport { OdspDocumentServiceFactoryCore } from \"./odspDocumentServiceFactoryCore.js\";\n// eslint-disable-next-line import-x/no-internal-modules\nexport { OdspPointInTimeDocumentServiceFactory } from \"./pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js\";\n\n// File creation\nexport { createOdspCreateContainerRequest } from \"./createOdspCreateContainerRequest.js\";\n\n// URI Resolver functionality, URI management\nexport { OdspDriverUrlResolver } from \"./odspDriverUrlResolver.js\";\nexport {\n\tOdspDriverUrlResolverForShareLink,\n\ttype ShareLinkFetcherProps,\n} from \"./odspDriverUrlResolverForShareLink.js\";\n\n// It's used by URL resolve code, but also has some public functions\nexport {\n\tencodeOdspFluidDataStoreLocator,\n\tgetLocatorFromOdspUrl,\n\tlocatorQueryParamName,\n\tstoreLocatorInOdspUrl,\n} from \"./odspFluidFileLink.js\";\n\nexport type {\n\tIOdspCache,\n\tIPersistedFileCache,\n\tINonPersistentCache,\n\tIPrefetchSnapshotContents,\n} from \"./odspCache.js\";\nexport type {\n\tICacheAndTracker,\n\tEpochTracker,\n\tFetchType,\n\tFetchTypeInternal,\n} from \"./epochTracker.js\";\nexport { type IOdspResponse, isOdspResolvedUrl } from \"./odspUtils.js\";\nexport { SnapshotFormatSupportType } from \"./fetchSnapshot.js\";\nexport {\n\ttype ISnapshotContentsWithProps,\n\tparseCompactSnapshotResponse,\n} from \"./compactSnapshotParser.js\";\n\n// Layer Compat details\nexport { odspDriverCompatDetailsForLoader } from \"./odspLayerCompatState.js\";\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/odsp-driver";
8
- export declare const pkgVersion = "2.112.0";
8
+ export declare const pkgVersion = "2.113.0-411909";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,gCAAgC,CAAC;AACrD,eAAO,MAAM,UAAU,YAAY,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,gCAAgC,CAAC;AACrD,eAAO,MAAM,UAAU,mBAAmB,CAAC"}
@@ -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/odsp-driver";
11
- exports.pkgVersion = "2.112.0";
11
+ exports.pkgVersion = "2.113.0-411909";
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,SAAS,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/odsp-driver\";\nexport const pkgVersion = \"2.112.0\";\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,gBAAgB,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/odsp-driver\";\nexport const pkgVersion = \"2.113.0-411909\";\n"]}
@@ -0,0 +1,37 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
6
+ import type { IClient, IDocumentDeltaConnection, IDocumentDeltaStorageService, IDocumentService, IDocumentServiceEvents, IDocumentServicePolicies, IDocumentStorageService, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
7
+ /**
8
+ * A read-only document service that materializes a document at a target sequence number by combining
9
+ * a recoverable snapshot with a bounded replay of live ops.
10
+ *
11
+ * @remarks
12
+ * Storage (the snapshot) is served from the closest file version at or before the target sequence
13
+ * number. The ops needed to advance from that snapshot to the target are read from the live
14
+ * document's delta storage, bounded so that no op past the target is ever fetched.
15
+ *
16
+ * The service advertises the {@link IDocumentServicePolicies.storageOnly} policy. This reuses the
17
+ * loader's "frozen" load mechanism: the connection manager synthesizes a read-only frozen delta
18
+ * stream instead of opening a live socket, and forces the container read-only. The delta manager
19
+ * still catches up from the snapshot's sequence number through delta storage, which is exactly the
20
+ * bounded replay we want. As a result no live delta-stream connection is ever established.
21
+ *
22
+ * @internal
23
+ */
24
+ export declare class OdspPointInTimeDocumentService extends TypedEventEmitter<IDocumentServiceEvents> implements IDocumentService {
25
+ readonly resolvedUrl: IResolvedUrl;
26
+ private readonly recoverableDocumentService;
27
+ private readonly liveDocumentService;
28
+ private readonly targetSequenceNumber;
29
+ constructor(resolvedUrl: IResolvedUrl, recoverableDocumentService: IDocumentService, liveDocumentService: IDocumentService, targetSequenceNumber: number);
30
+ readonly policies: IDocumentServicePolicies;
31
+ dispose(): void;
32
+ connectToStorage(): Promise<IDocumentStorageService>;
33
+ connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
34
+ connectToDeltaStream(_client: IClient): Promise<IDocumentDeltaConnection>;
35
+ private readonly metadataUpdateHandler;
36
+ }
37
+ //# sourceMappingURL=odspPointInTimeDocumentService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odspPointInTimeDocumentService.d.ts","sourceRoot":"","sources":["../../src/pointInTimeDriver/odspPointInTimeDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EACX,OAAO,EACP,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,8BACZ,SAAQ,iBAAiB,CAAC,sBAAsB,CAChD,YAAW,gBAAgB;aAGV,WAAW,EAAE,YAAY;IAGzC,OAAO,CAAC,QAAQ,CAAC,0BAA0B;IAC3C,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBALrB,WAAW,EAAE,YAAY,EAGxB,0BAA0B,EAAE,gBAAgB,EAC5C,mBAAmB,EAAE,gBAAgB,EACrC,oBAAoB,EAAE,MAAM;IAQ9C,SAAgB,QAAQ,EAAE,wBAAwB,CAAyB;IAEpE,OAAO,IAAI,IAAI;IAMT,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAIpD,qBAAqB,IAAI,OAAO,CAAC,4BAA4B,CAAC;IAiB9D,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAStF,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAEpC;CACF"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.OdspPointInTimeDocumentService = void 0;
8
+ const client_utils_1 = require("@fluid-internal/client-utils");
9
+ /**
10
+ * A read-only document service that materializes a document at a target sequence number by combining
11
+ * a recoverable snapshot with a bounded replay of live ops.
12
+ *
13
+ * @remarks
14
+ * Storage (the snapshot) is served from the closest file version at or before the target sequence
15
+ * number. The ops needed to advance from that snapshot to the target are read from the live
16
+ * document's delta storage, bounded so that no op past the target is ever fetched.
17
+ *
18
+ * The service advertises the {@link IDocumentServicePolicies.storageOnly} policy. This reuses the
19
+ * loader's "frozen" load mechanism: the connection manager synthesizes a read-only frozen delta
20
+ * stream instead of opening a live socket, and forces the container read-only. The delta manager
21
+ * still catches up from the snapshot's sequence number through delta storage, which is exactly the
22
+ * bounded replay we want. As a result no live delta-stream connection is ever established.
23
+ *
24
+ * @internal
25
+ */
26
+ class OdspPointInTimeDocumentService extends client_utils_1.TypedEventEmitter {
27
+ constructor(resolvedUrl,
28
+ // Serves the snapshot: a read-only document service bound to the closest file version at or
29
+ // before the target sequence number. Its storage is the base we replay ops on top of.
30
+ recoverableDocumentService, liveDocumentService, targetSequenceNumber) {
31
+ super();
32
+ this.resolvedUrl = resolvedUrl;
33
+ this.recoverableDocumentService = recoverableDocumentService;
34
+ this.liveDocumentService = liveDocumentService;
35
+ this.targetSequenceNumber = targetSequenceNumber;
36
+ // storageOnly makes the connection manager synthesize a read-only frozen delta stream (no live
37
+ // socket) and force the container read-only - see the class remarks.
38
+ this.policies = { storageOnly: true };
39
+ this.metadataUpdateHandler = (metadata) => {
40
+ this.emit("metadataUpdate", metadata);
41
+ };
42
+ this.liveDocumentService.on("metadataUpdate", this.metadataUpdateHandler);
43
+ }
44
+ dispose() {
45
+ this.liveDocumentService.off("metadataUpdate", this.metadataUpdateHandler);
46
+ this.recoverableDocumentService.dispose();
47
+ this.liveDocumentService.dispose();
48
+ }
49
+ async connectToStorage() {
50
+ return this.recoverableDocumentService.connectToStorage();
51
+ }
52
+ async connectToDeltaStorage() {
53
+ const liveDeltaStorage = await this.liveDocumentService.connectToDeltaStorage();
54
+ // The exclusive upper bound needed to include the target op itself.
55
+ const boundedTo = this.targetSequenceNumber + 1;
56
+ return {
57
+ fetchMessages: (from, to, abortSignal, cachedOnly, fetchReason) => {
58
+ return liveDeltaStorage.fetchMessages(from, to === undefined ? boundedTo : Math.min(to, boundedTo), abortSignal, cachedOnly, fetchReason);
59
+ },
60
+ };
61
+ }
62
+ async connectToDeltaStream(_client) {
63
+ // Unreachable under normal flow: the connection manager short-circuits on the storageOnly
64
+ // policy and synthesizes a frozen delta stream before ever calling connectToDeltaStream.
65
+ // Reaching here indicates a regression of that short-circuit.
66
+ throw new Error("OdspPointInTimeDocumentService is storage-only; connectToDeltaStream should not be called");
67
+ }
68
+ }
69
+ exports.OdspPointInTimeDocumentService = OdspPointInTimeDocumentService;
70
+ //# sourceMappingURL=odspPointInTimeDocumentService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odspPointInTimeDocumentService.js","sourceRoot":"","sources":["../../src/pointInTimeDriver/odspPointInTimeDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAYjE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,8BACZ,SAAQ,gCAAyC;IAGjD,YACiB,WAAyB;IACzC,4FAA4F;IAC5F,sFAAsF;IACrE,0BAA4C,EAC5C,mBAAqC,EACrC,oBAA4B;QAE7C,KAAK,EAAE,CAAC;QAPQ,gBAAW,GAAX,WAAW,CAAc;QAGxB,+BAA0B,GAA1B,0BAA0B,CAAkB;QAC5C,wBAAmB,GAAnB,mBAAmB,CAAkB;QACrC,yBAAoB,GAApB,oBAAoB,CAAQ;QAM9C,+FAA+F;QAC/F,qEAAqE;QACrD,aAAQ,GAA6B,EAAE,WA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,CAAC;IACH,CAAC;CAKD;AA3DD,wEA2DC","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 type {\n\tIClient,\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * A read-only document service that materializes a document at a target sequence number by combining\n * a recoverable snapshot with a bounded replay of live ops.\n *\n * @remarks\n * Storage (the snapshot) is served from the closest file version at or before the target sequence\n * number. The ops needed to advance from that snapshot to the target are read from the live\n * document's delta storage, bounded so that no op past the target is ever fetched.\n *\n * The service advertises the {@link IDocumentServicePolicies.storageOnly} policy. This reuses the\n * loader's \"frozen\" load mechanism: the connection manager synthesizes a read-only frozen delta\n * stream instead of opening a live socket, and forces the container read-only. The delta manager\n * still catches up from the snapshot's sequence number through delta storage, which is exactly the\n * bounded replay we want. As a result no live delta-stream connection is ever established.\n *\n * @internal\n */\nexport class OdspPointInTimeDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tpublic constructor(\n\t\tpublic readonly resolvedUrl: IResolvedUrl,\n\t\t// Serves the snapshot: a read-only document service bound to the closest file version at or\n\t\t// before the target sequence number. Its storage is the base we replay ops on top of.\n\t\tprivate readonly recoverableDocumentService: IDocumentService,\n\t\tprivate readonly liveDocumentService: IDocumentService,\n\t\tprivate readonly targetSequenceNumber: number,\n\t) {\n\t\tsuper();\n\t\tthis.liveDocumentService.on(\"metadataUpdate\", this.metadataUpdateHandler);\n\t}\n\n\t// storageOnly makes the connection manager synthesize a read-only frozen delta stream (no live\n\t// socket) and force the container read-only - see the class remarks.\n\tpublic readonly policies: IDocumentServicePolicies = { storageOnly: true };\n\n\tpublic dispose(): void {\n\t\tthis.liveDocumentService.off(\"metadataUpdate\", this.metadataUpdateHandler);\n\t\tthis.recoverableDocumentService.dispose();\n\t\tthis.liveDocumentService.dispose();\n\t}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this.recoverableDocumentService.connectToStorage();\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\tconst liveDeltaStorage = await this.liveDocumentService.connectToDeltaStorage();\n\t\t// The exclusive upper bound needed to include the target op itself.\n\t\tconst boundedTo = this.targetSequenceNumber + 1;\n\t\treturn {\n\t\t\tfetchMessages: (from, to, abortSignal, cachedOnly, fetchReason) => {\n\t\t\t\treturn liveDeltaStorage.fetchMessages(\n\t\t\t\t\tfrom,\n\t\t\t\t\tto === undefined ? boundedTo : Math.min(to, boundedTo),\n\t\t\t\t\tabortSignal,\n\t\t\t\t\tcachedOnly,\n\t\t\t\t\tfetchReason,\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic async connectToDeltaStream(_client: IClient): Promise<IDocumentDeltaConnection> {\n\t\t// Unreachable under normal flow: the connection manager short-circuits on the storageOnly\n\t\t// policy and synthesizes a frozen delta stream before ever calling connectToDeltaStream.\n\t\t// Reaching here indicates a regression of that short-circuit.\n\t\tthrow new Error(\n\t\t\t\"OdspPointInTimeDocumentService is storage-only; connectToDeltaStream should not be called\",\n\t\t);\n\t}\n\n\tprivate readonly metadataUpdateHandler = (metadata: Record<string, string>): void => {\n\t\tthis.emit(\"metadataUpdate\", metadata);\n\t};\n}\n"]}
@@ -0,0 +1,49 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
+ import type { IDocumentService, IPersistedCache, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
7
+ import type { HostStoragePolicy, OdspResourceTokenFetchOptions, TokenFetcher } from "@fluidframework/odsp-driver-definitions/internal";
8
+ import { OdspDocumentServiceFactoryCore } from "../odspDocumentServiceFactoryCore.js";
9
+ /**
10
+ * ODSP document service factory that additionally supports point-in-time (sequence-number-based)
11
+ * loading.
12
+ *
13
+ * @remarks
14
+ * This extends {@link OdspDocumentServiceFactoryCore} with the ability to materialize a read-only
15
+ * document service at a requested Fluid sequence number. The loader detects this capability via the
16
+ * presence of {@link OdspPointInTimeDocumentServiceFactory.createPointInTimeDocumentService}, so
17
+ * hosts that want to load a container to a target sequence number must construct this factory
18
+ * (rather than the legacy `OdspDocumentServiceFactory`) and pass it to the loader.
19
+ *
20
+ * @internal
21
+ */
22
+ export declare class OdspPointInTimeDocumentServiceFactory extends OdspDocumentServiceFactoryCore {
23
+ /**
24
+ * The storage token fetcher, captured here because the base class keeps it private.
25
+ */
26
+ private readonly getStorageTokenForVersions;
27
+ constructor(getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>, getWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined, persistedCache?: IPersistedCache, hostPolicy?: HostStoragePolicy);
28
+ /**
29
+ * Creates a document service that reads its snapshot from the closest file version at or before
30
+ * the target and its deltas from the live document, materializing a requested sequence number
31
+ * through replay.
32
+ */
33
+ createPointInTimeDocumentService(resolvedUrl: IResolvedUrl, targetSequenceNumber: number, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
34
+ /**
35
+ * Builds an IOdspVersionManager for the given file, which enumerates the file's stored
36
+ * versions and resolves the closest version at or before a target sequence number.
37
+ *
38
+ * @remarks
39
+ * This wires up the plumbing the version manager needs to talk to ODSP: it resolves the URL to
40
+ * its ODSP parts (site/drive/item), creates a scoped child logger, an epoch tracker (from a fresh
41
+ * NonPersistentCache, since only the tracker is needed for consistency checks), and an
42
+ * instrumented storage-token/auth-header fetcher. The resulting manager is used by
43
+ * {@link OdspPointInTimeDocumentServiceFactory.createPointInTimeDocumentService} to pick the base
44
+ * snapshot for point-in-time loading.
45
+ */
46
+ private createVersionManager;
47
+ private resolveFileVersion;
48
+ }
49
+ //# sourceMappingURL=odspPointInTimeDocumentServiceFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odspPointInTimeDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../../src/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,KAAK,EACX,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EACX,iBAAiB,EAEjB,6BAA6B,EAC7B,YAAY,EACZ,MAAM,kDAAkD,CAAC;AAK1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AActF;;;;;;;;;;;;GAYG;AACH,qBAAa,qCAAsC,SAAQ,8BAA8B;IACxF;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAA8C;gBAGxF,eAAe,EAAE,YAAY,CAAC,6BAA6B,CAAC,EAC5D,iBAAiB,EAAE,YAAY,CAAC,6BAA6B,CAAC,GAAG,SAAS,EAC1E,cAAc,CAAC,EAAE,eAAe,EAChC,UAAU,CAAC,EAAE,iBAAiB;IAM/B;;;;OAIG;IACU,gCAAgC,CAC5C,WAAW,EAAE,YAAY,EACzB,oBAAoB,EAAE,MAAM,EAC5B,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAuC5B;;;;;;;;;;;OAWG;YACW,oBAAoB;YAuCpB,kBAAkB;CAoBhC"}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.OdspPointInTimeDocumentServiceFactory = void 0;
8
+ const internal_1 = require("@fluidframework/telemetry-utils/internal");
9
+ const epochTracker_js_1 = require("../epochTracker.js");
10
+ const odspCache_js_1 = require("../odspCache.js");
11
+ const odspDocumentServiceFactoryCore_js_1 = require("../odspDocumentServiceFactoryCore.js");
12
+ const odspDriverUrlResolver_js_1 = require("../odspDriverUrlResolver.js");
13
+ const odspUtils_js_1 = require("../odspUtils.js");
14
+ const index_js_1 = require("../odspVersionManager/index.js");
15
+ const odspPointInTimeDocumentService_js_1 = require("./odspPointInTimeDocumentService.js");
16
+ /**
17
+ * ODSP document service factory that additionally supports point-in-time (sequence-number-based)
18
+ * loading.
19
+ *
20
+ * @remarks
21
+ * This extends {@link OdspDocumentServiceFactoryCore} with the ability to materialize a read-only
22
+ * document service at a requested Fluid sequence number. The loader detects this capability via the
23
+ * presence of {@link OdspPointInTimeDocumentServiceFactory.createPointInTimeDocumentService}, so
24
+ * hosts that want to load a container to a target sequence number must construct this factory
25
+ * (rather than the legacy `OdspDocumentServiceFactory`) and pass it to the loader.
26
+ *
27
+ * @internal
28
+ */
29
+ class OdspPointInTimeDocumentServiceFactory extends odspDocumentServiceFactoryCore_js_1.OdspDocumentServiceFactoryCore {
30
+ constructor(getStorageToken, getWebsocketToken, persistedCache, hostPolicy) {
31
+ super(getStorageToken, getWebsocketToken, persistedCache, hostPolicy);
32
+ this.getStorageTokenForVersions = getStorageToken;
33
+ }
34
+ /**
35
+ * Creates a document service that reads its snapshot from the closest file version at or before
36
+ * the target and its deltas from the live document, materializing a requested sequence number
37
+ * through replay.
38
+ */
39
+ async createPointInTimeDocumentService(resolvedUrl, targetSequenceNumber, logger, clientIsSummarizer) {
40
+ const versionManager = await this.createVersionManager(resolvedUrl, logger, clientIsSummarizer);
41
+ const baseResult = await versionManager.findBaseForSeq(targetSequenceNumber);
42
+ if (baseResult.kind === "noBaseVersion") {
43
+ const oldestResolvedSequenceDetail = baseResult.oldestResolvedSeq === undefined
44
+ ? ""
45
+ : ` The oldest resolved file version is at sequence number ${baseResult.oldestResolvedSeq}.`;
46
+ throw new internal_1.UsageError(`No ODSP file version is available at or before sequence number ${targetSequenceNumber}.${oldestResolvedSequenceDetail}`);
47
+ }
48
+ const recoverableResolvedUrl = await this.resolveFileVersion(resolvedUrl, baseResult.base.versionId);
49
+ const recoverableDocumentService = await this.createDocumentService(recoverableResolvedUrl, logger, clientIsSummarizer);
50
+ const liveDocumentService = await this.createDocumentService(resolvedUrl, logger, clientIsSummarizer);
51
+ return new odspPointInTimeDocumentService_js_1.OdspPointInTimeDocumentService(recoverableResolvedUrl, recoverableDocumentService, liveDocumentService, targetSequenceNumber);
52
+ }
53
+ /**
54
+ * Builds an IOdspVersionManager for the given file, which enumerates the file's stored
55
+ * versions and resolves the closest version at or before a target sequence number.
56
+ *
57
+ * @remarks
58
+ * This wires up the plumbing the version manager needs to talk to ODSP: it resolves the URL to
59
+ * its ODSP parts (site/drive/item), creates a scoped child logger, an epoch tracker (from a fresh
60
+ * NonPersistentCache, since only the tracker is needed for consistency checks), and an
61
+ * instrumented storage-token/auth-header fetcher. The resulting manager is used by
62
+ * {@link OdspPointInTimeDocumentServiceFactory.createPointInTimeDocumentService} to pick the base
63
+ * snapshot for point-in-time loading.
64
+ */
65
+ async createVersionManager(resolvedUrl, logger, clientIsSummarizer) {
66
+ const odspLogger = (0, odspUtils_js_1.createOdspLogger)(logger);
67
+ const extLogger = (0, internal_1.createChildLogger)({ logger: odspLogger });
68
+ const odspResolvedUrl = (0, odspUtils_js_1.getOdspResolvedUrl)(resolvedUrl);
69
+ const urlParts = {
70
+ siteUrl: odspResolvedUrl.siteUrl,
71
+ driveId: odspResolvedUrl.driveId,
72
+ itemId: odspResolvedUrl.itemId,
73
+ };
74
+ // Only the epochTracker from the returned cacheAndTracker is used below, so a fresh
75
+ // NonPersistentCache is sufficient here.
76
+ const cacheAndTracker = (0, epochTracker_js_1.createOdspCacheAndTracker)(this.persistedCache, new odspCache_js_1.NonPersistentCache(), {
77
+ resolvedUrl: odspResolvedUrl,
78
+ docId: odspResolvedUrl.hashedDocumentId,
79
+ fileVersion: odspResolvedUrl.fileVersion,
80
+ }, extLogger, clientIsSummarizer);
81
+ const getAuthHeader = (0, odspUtils_js_1.toInstrumentedOdspStorageTokenFetcher)(extLogger, urlParts, this.getStorageTokenForVersions);
82
+ return (0, index_js_1.createOdspVersionManager)({
83
+ urlParts,
84
+ getAuthHeader,
85
+ epochTracker: cacheAndTracker.epochTracker,
86
+ logger: extLogger,
87
+ });
88
+ }
89
+ async resolveFileVersion(resolvedUrl, fileVersion) {
90
+ const odspResolvedUrl = (0, odspUtils_js_1.getOdspResolvedUrl)(resolvedUrl);
91
+ const query = new URLSearchParams({
92
+ driveId: odspResolvedUrl.driveId,
93
+ itemId: odspResolvedUrl.itemId,
94
+ fileVersion,
95
+ });
96
+ if (odspResolvedUrl.dataStorePath !== undefined) {
97
+ query.set("path", odspResolvedUrl.dataStorePath);
98
+ }
99
+ if (odspResolvedUrl.codeHint?.containerPackageName !== undefined) {
100
+ query.set("containerPackageName", odspResolvedUrl.codeHint.containerPackageName);
101
+ }
102
+ return new odspDriverUrlResolver_js_1.OdspDriverUrlResolver().resolve({
103
+ url: `${odspResolvedUrl.siteUrl}?${query.toString()}`,
104
+ });
105
+ }
106
+ }
107
+ exports.OdspPointInTimeDocumentServiceFactory = OdspPointInTimeDocumentServiceFactory;
108
+ //# sourceMappingURL=odspPointInTimeDocumentServiceFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odspPointInTimeDocumentServiceFactory.js","sourceRoot":"","sources":["../../src/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH,uEAAyF;AAEzF,wDAA+D;AAC/D,kDAAqD;AACrD,4FAAsF;AACtF,0EAAoE;AACpE,kDAIyB;AACzB,6DAGwC;AAExC,2FAAqF;AAErF;;;;;;;;;;;;GAYG;AACH,MAAa,qCAAsC,SAAQ,kEAA8B;IAMxF,YACC,eA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AC,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,eAAe,CAAC,QAAQ,EAAE,oBAAoB,KAAK,SAAS,EAAE,CAAC;YAClE,KAAK,CAAC,GAAG,CAAC,sBAAsB,EAAE,eAAe,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;QAClF,CAAC;QACD,OAAO,IAAI,gDAAqB,EAAE,CAAC,OAAO,CAAC;YAC1C,GAAG,EAAE,GAAG,eAAe,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE;SACrD,CAAC,CAAC;IACJ,CAAC;CACD;AAxID,sFAwIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIDocumentService,\n\tIPersistedCache,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type {\n\tHostStoragePolicy,\n\tIOdspUrlParts,\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n} from \"@fluidframework/odsp-driver-definitions/internal\";\nimport { UsageError, createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { createOdspCacheAndTracker } from \"../epochTracker.js\";\nimport { NonPersistentCache } from \"../odspCache.js\";\nimport { OdspDocumentServiceFactoryCore } from \"../odspDocumentServiceFactoryCore.js\";\nimport { OdspDriverUrlResolver } from \"../odspDriverUrlResolver.js\";\nimport {\n\tcreateOdspLogger,\n\tgetOdspResolvedUrl,\n\ttoInstrumentedOdspStorageTokenFetcher,\n} from \"../odspUtils.js\";\nimport {\n\tcreateOdspVersionManager,\n\ttype IOdspVersionManager,\n} from \"../odspVersionManager/index.js\";\n\nimport { OdspPointInTimeDocumentService } from \"./odspPointInTimeDocumentService.js\";\n\n/**\n * ODSP document service factory that additionally supports point-in-time (sequence-number-based)\n * loading.\n *\n * @remarks\n * This extends {@link OdspDocumentServiceFactoryCore} with the ability to materialize a read-only\n * document service at a requested Fluid sequence number. The loader detects this capability via the\n * presence of {@link OdspPointInTimeDocumentServiceFactory.createPointInTimeDocumentService}, so\n * hosts that want to load a container to a target sequence number must construct this factory\n * (rather than the legacy `OdspDocumentServiceFactory`) and pass it to the loader.\n *\n * @internal\n */\nexport class OdspPointInTimeDocumentServiceFactory extends OdspDocumentServiceFactoryCore {\n\t/**\n\t * The storage token fetcher, captured here because the base class keeps it private.\n\t */\n\tprivate readonly getStorageTokenForVersions: TokenFetcher<OdspResourceTokenFetchOptions>;\n\n\tconstructor(\n\t\tgetStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>,\n\t\tgetWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined,\n\t\tpersistedCache?: IPersistedCache,\n\t\thostPolicy?: HostStoragePolicy,\n\t) {\n\t\tsuper(getStorageToken, getWebsocketToken, persistedCache, hostPolicy);\n\t\tthis.getStorageTokenForVersions = getStorageToken;\n\t}\n\n\t/**\n\t * Creates a document service that reads its snapshot from the closest file version at or before\n\t * the target and its deltas from the live document, materializing a requested sequence number\n\t * through replay.\n\t */\n\tpublic async createPointInTimeDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\ttargetSequenceNumber: number,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tconst versionManager = await this.createVersionManager(\n\t\t\tresolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t\tconst baseResult = await versionManager.findBaseForSeq(targetSequenceNumber);\n\t\tif (baseResult.kind === \"noBaseVersion\") {\n\t\t\tconst oldestResolvedSequenceDetail =\n\t\t\t\tbaseResult.oldestResolvedSeq === undefined\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: ` The oldest resolved file version is at sequence number ${baseResult.oldestResolvedSeq}.`;\n\t\t\tthrow new UsageError(\n\t\t\t\t`No ODSP file version is available at or before sequence number ${targetSequenceNumber}.${oldestResolvedSequenceDetail}`,\n\t\t\t);\n\t\t}\n\n\t\tconst recoverableResolvedUrl = await this.resolveFileVersion(\n\t\t\tresolvedUrl,\n\t\t\tbaseResult.base.versionId,\n\t\t);\n\t\tconst recoverableDocumentService = await this.createDocumentService(\n\t\t\trecoverableResolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t\tconst liveDocumentService = await this.createDocumentService(\n\t\t\tresolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t\treturn new OdspPointInTimeDocumentService(\n\t\t\trecoverableResolvedUrl,\n\t\t\trecoverableDocumentService,\n\t\t\tliveDocumentService,\n\t\t\ttargetSequenceNumber,\n\t\t);\n\t}\n\n\t/**\n\t * Builds an IOdspVersionManager for the given file, which enumerates the file's stored\n\t * versions and resolves the closest version at or before a target sequence number.\n\t *\n\t * @remarks\n\t * This wires up the plumbing the version manager needs to talk to ODSP: it resolves the URL to\n\t * its ODSP parts (site/drive/item), creates a scoped child logger, an epoch tracker (from a fresh\n\t * NonPersistentCache, since only the tracker is needed for consistency checks), and an\n\t * instrumented storage-token/auth-header fetcher. The resulting manager is used by\n\t * {@link OdspPointInTimeDocumentServiceFactory.createPointInTimeDocumentService} to pick the base\n\t * snapshot for point-in-time loading.\n\t */\n\tprivate async createVersionManager(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IOdspVersionManager> {\n\t\tconst odspLogger = createOdspLogger(logger);\n\t\tconst extLogger = createChildLogger({ logger: odspLogger });\n\t\tconst odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);\n\t\tconst urlParts: IOdspUrlParts = {\n\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\titemId: odspResolvedUrl.itemId,\n\t\t};\n\t\t// Only the epochTracker from the returned cacheAndTracker is used below, so a fresh\n\t\t// NonPersistentCache is sufficient here.\n\t\tconst cacheAndTracker = createOdspCacheAndTracker(\n\t\t\tthis.persistedCache,\n\t\t\tnew NonPersistentCache(),\n\t\t\t{\n\t\t\t\tresolvedUrl: odspResolvedUrl,\n\t\t\t\tdocId: odspResolvedUrl.hashedDocumentId,\n\t\t\t\tfileVersion: odspResolvedUrl.fileVersion,\n\t\t\t},\n\t\t\textLogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t\tconst getAuthHeader = toInstrumentedOdspStorageTokenFetcher(\n\t\t\textLogger,\n\t\t\turlParts,\n\t\t\tthis.getStorageTokenForVersions,\n\t\t);\n\t\treturn createOdspVersionManager({\n\t\t\turlParts,\n\t\t\tgetAuthHeader,\n\t\t\tepochTracker: cacheAndTracker.epochTracker,\n\t\t\tlogger: extLogger,\n\t\t});\n\t}\n\n\tprivate async resolveFileVersion(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tfileVersion: string,\n\t): Promise<IResolvedUrl> {\n\t\tconst odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);\n\t\tconst query = new URLSearchParams({\n\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\titemId: odspResolvedUrl.itemId,\n\t\t\tfileVersion,\n\t\t});\n\t\tif (odspResolvedUrl.dataStorePath !== undefined) {\n\t\t\tquery.set(\"path\", odspResolvedUrl.dataStorePath);\n\t\t}\n\t\tif (odspResolvedUrl.codeHint?.containerPackageName !== undefined) {\n\t\t\tquery.set(\"containerPackageName\", odspResolvedUrl.codeHint.containerPackageName);\n\t\t}\n\t\treturn new OdspDriverUrlResolver().resolve({\n\t\t\turl: `${odspResolvedUrl.siteUrl}?${query.toString()}`,\n\t\t});\n\t}\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export { getOdspUrlParts, isOdcUrl, isSpoUrl } from "./odspUrlHelper.js";
11
11
  export { prefetchLatestSnapshot } from "./prefetchLatestSnapshot.js";
12
12
  export { createLocalOdspDocumentServiceFactory, OdspDocumentServiceFactory, } from "./odspDocumentServiceFactory.js";
13
13
  export { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.js";
14
+ export { OdspPointInTimeDocumentServiceFactory } from "./pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js";
14
15
  export { createOdspCreateContainerRequest } from "./createOdspCreateContainerRequest.js";
15
16
  export { OdspDriverUrlResolver } from "./odspDriverUrlResolver.js";
16
17
  export { OdspDriverUrlResolverForShareLink, type ShareLinkFetcherProps, } from "./odspDriverUrlResolverForShareLink.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EACN,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,iBAAiB,GACjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EACN,qCAAqC,EACrC,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAGrF,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAGzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACN,iCAAiC,EACjC,KAAK,q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O,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,EAAE,qCAAqC,EAAE,MAAM,8DAA8D,CAAC;AAGrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAGzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACN,iCAAiC,EACjC,KAAK,qBAAqB,GAC1B,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EACN,+BAA+B,EAC/B,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACrB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACX,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,GACzB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACX,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,iBAAiB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACN,KAAK,0BAA0B,EAC/B,4BAA4B,GAC5B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC"}
package/lib/index.js CHANGED
@@ -15,6 +15,8 @@ export { prefetchLatestSnapshot } from "./prefetchLatestSnapshot.js";
15
15
  // Factory
16
16
  export { createLocalOdspDocumentServiceFactory, OdspDocumentServiceFactory, } from "./odspDocumentServiceFactory.js";
17
17
  export { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.js";
18
+ // eslint-disable-next-line import-x/no-internal-modules
19
+ export { OdspPointInTimeDocumentServiceFactory } from "./pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js";
18
20
  // File creation
19
21
  export { createOdspCreateContainerRequest } from "./createOdspCreateContainerRequest.js";
20
22
  // URI Resolver functionality, URI management
package/lib/index.js.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!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Constants\nexport { OdcApiSiteOrigin, OdcFileSiteOrigin } from \"./constants.js\";\n\nexport {\n\tClpCompliantAppHeader,\n\ttype IClpCompliantAppHeader,\n\ttype ISharingLinkHeader,\n\ttype OdspFluidDataStoreLocator,\n\tSharingLinkHeader,\n} from \"./contractsPublic.js\";\n\n// public utils\nexport { checkUrl } from \"./checkUrl.js\";\nexport { createOdspUrl } from \"./createOdspUrl.js\";\nexport { getHashedDocumentId, type ISnapshotContents } from \"./odspPublicUtils.js\";\nexport { getOdspUrlParts, isOdcUrl, isSpoUrl } from \"./odspUrlHelper.js\";\n\n// prefetch latest snapshot before container load\nexport { prefetchLatestSnapshot } from \"./prefetchLatestSnapshot.js\";\n\n// Factory\nexport {\n\tcreateLocalOdspDocumentServiceFactory,\n\tOdspDocumentServiceFactory,\n} from \"./odspDocumentServiceFactory.js\";\nexport { OdspDocumentServiceFactoryCore } from \"./odspDocumentServiceFactoryCore.js\";\n\n// File creation\nexport { createOdspCreateContainerRequest } from \"./createOdspCreateContainerRequest.js\";\n\n// URI Resolver functionality, URI management\nexport { OdspDriverUrlResolver } from \"./odspDriverUrlResolver.js\";\nexport {\n\tOdspDriverUrlResolverForShareLink,\n\ttype ShareLinkFetcherProps,\n} from \"./odspDriverUrlResolverForShareLink.js\";\n\n// It's used by URL resolve code, but also has some public functions\nexport {\n\tencodeOdspFluidDataStoreLocator,\n\tgetLocatorFromOdspUrl,\n\tlocatorQueryParamName,\n\tstoreLocatorInOdspUrl,\n} from \"./odspFluidFileLink.js\";\n\nexport type {\n\tIOdspCache,\n\tIPersistedFileCache,\n\tINonPersistentCache,\n\tIPrefetchSnapshotContents,\n} from \"./odspCache.js\";\nexport type {\n\tICacheAndTracker,\n\tEpochTracker,\n\tFetchType,\n\tFetchTypeInternal,\n} from \"./epochTracker.js\";\nexport { type IOdspResponse, isOdspResolvedUrl } from \"./odspUtils.js\";\nexport { SnapshotFormatSupportType } from \"./fetchSnapshot.js\";\nexport {\n\ttype ISnapshotContentsWithProps,\n\tparseCompactSnapshotResponse,\n} from \"./compactSnapshotParser.js\";\n\n// Layer Compat details\nexport { odspDriverCompatDetailsForLoader } from \"./odspLayerCompatState.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EACN,qBAAqB,EAIrB,iBAAiB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,eAAe;AACf,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAA0B,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEzE,iDAAiD;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,UAAU;AACV,OAAO,EACN,qCAAqC,EACrC,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,wDAAwD;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,8DAA8D,CAAC;AAErH,gBAAgB;AAChB,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAEzF,6CAA6C;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACN,iCAAiC,GAEjC,MAAM,wCAAwC,CAAC;AAEhD,oEAAoE;AACpE,OAAO,EACN,+BAA+B,EAC/B,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACrB,MAAM,wBAAwB,CAAC;AAchC,OAAO,EAAsB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAEN,4BAA4B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,uBAAuB;AACvB,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Constants\nexport { OdcApiSiteOrigin, OdcFileSiteOrigin } from \"./constants.js\";\n\nexport {\n\tClpCompliantAppHeader,\n\ttype IClpCompliantAppHeader,\n\ttype ISharingLinkHeader,\n\ttype OdspFluidDataStoreLocator,\n\tSharingLinkHeader,\n} from \"./contractsPublic.js\";\n\n// public utils\nexport { checkUrl } from \"./checkUrl.js\";\nexport { createOdspUrl } from \"./createOdspUrl.js\";\nexport { getHashedDocumentId, type ISnapshotContents } from \"./odspPublicUtils.js\";\nexport { getOdspUrlParts, isOdcUrl, isSpoUrl } from \"./odspUrlHelper.js\";\n\n// prefetch latest snapshot before container load\nexport { prefetchLatestSnapshot } from \"./prefetchLatestSnapshot.js\";\n\n// Factory\nexport {\n\tcreateLocalOdspDocumentServiceFactory,\n\tOdspDocumentServiceFactory,\n} from \"./odspDocumentServiceFactory.js\";\nexport { OdspDocumentServiceFactoryCore } from \"./odspDocumentServiceFactoryCore.js\";\n// eslint-disable-next-line import-x/no-internal-modules\nexport { OdspPointInTimeDocumentServiceFactory } from \"./pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js\";\n\n// File creation\nexport { createOdspCreateContainerRequest } from \"./createOdspCreateContainerRequest.js\";\n\n// URI Resolver functionality, URI management\nexport { OdspDriverUrlResolver } from \"./odspDriverUrlResolver.js\";\nexport {\n\tOdspDriverUrlResolverForShareLink,\n\ttype ShareLinkFetcherProps,\n} from \"./odspDriverUrlResolverForShareLink.js\";\n\n// It's used by URL resolve code, but also has some public functions\nexport {\n\tencodeOdspFluidDataStoreLocator,\n\tgetLocatorFromOdspUrl,\n\tlocatorQueryParamName,\n\tstoreLocatorInOdspUrl,\n} from \"./odspFluidFileLink.js\";\n\nexport type {\n\tIOdspCache,\n\tIPersistedFileCache,\n\tINonPersistentCache,\n\tIPrefetchSnapshotContents,\n} from \"./odspCache.js\";\nexport type {\n\tICacheAndTracker,\n\tEpochTracker,\n\tFetchType,\n\tFetchTypeInternal,\n} from \"./epochTracker.js\";\nexport { type IOdspResponse, isOdspResolvedUrl } from \"./odspUtils.js\";\nexport { SnapshotFormatSupportType } from \"./fetchSnapshot.js\";\nexport {\n\ttype ISnapshotContentsWithProps,\n\tparseCompactSnapshotResponse,\n} from \"./compactSnapshotParser.js\";\n\n// Layer Compat details\nexport { odspDriverCompatDetailsForLoader } from \"./odspLayerCompatState.js\";\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/odsp-driver";
8
- export declare const pkgVersion = "2.112.0";
8
+ export declare const pkgVersion = "2.113.0-411909";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,gCAAgC,CAAC;AACrD,eAAO,MAAM,UAAU,YAAY,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,gCAAgC,CAAC;AACrD,eAAO,MAAM,UAAU,mBAAmB,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/odsp-driver";
8
- export const pkgVersion = "2.112.0";
8
+ export const pkgVersion = "2.113.0-411909";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,6BAA6B,CAAC;AACrD,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,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/odsp-driver\";\nexport const pkgVersion = \"2.112.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,6BAA6B,CAAC;AACrD,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,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/odsp-driver\";\nexport const pkgVersion = \"2.113.0-411909\";\n"]}
@@ -0,0 +1,37 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
6
+ import type { IClient, IDocumentDeltaConnection, IDocumentDeltaStorageService, IDocumentService, IDocumentServiceEvents, IDocumentServicePolicies, IDocumentStorageService, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
7
+ /**
8
+ * A read-only document service that materializes a document at a target sequence number by combining
9
+ * a recoverable snapshot with a bounded replay of live ops.
10
+ *
11
+ * @remarks
12
+ * Storage (the snapshot) is served from the closest file version at or before the target sequence
13
+ * number. The ops needed to advance from that snapshot to the target are read from the live
14
+ * document's delta storage, bounded so that no op past the target is ever fetched.
15
+ *
16
+ * The service advertises the {@link IDocumentServicePolicies.storageOnly} policy. This reuses the
17
+ * loader's "frozen" load mechanism: the connection manager synthesizes a read-only frozen delta
18
+ * stream instead of opening a live socket, and forces the container read-only. The delta manager
19
+ * still catches up from the snapshot's sequence number through delta storage, which is exactly the
20
+ * bounded replay we want. As a result no live delta-stream connection is ever established.
21
+ *
22
+ * @internal
23
+ */
24
+ export declare class OdspPointInTimeDocumentService extends TypedEventEmitter<IDocumentServiceEvents> implements IDocumentService {
25
+ readonly resolvedUrl: IResolvedUrl;
26
+ private readonly recoverableDocumentService;
27
+ private readonly liveDocumentService;
28
+ private readonly targetSequenceNumber;
29
+ constructor(resolvedUrl: IResolvedUrl, recoverableDocumentService: IDocumentService, liveDocumentService: IDocumentService, targetSequenceNumber: number);
30
+ readonly policies: IDocumentServicePolicies;
31
+ dispose(): void;
32
+ connectToStorage(): Promise<IDocumentStorageService>;
33
+ connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
34
+ connectToDeltaStream(_client: IClient): Promise<IDocumentDeltaConnection>;
35
+ private readonly metadataUpdateHandler;
36
+ }
37
+ //# sourceMappingURL=odspPointInTimeDocumentService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odspPointInTimeDocumentService.d.ts","sourceRoot":"","sources":["../../src/pointInTimeDriver/odspPointInTimeDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EACX,OAAO,EACP,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,8BACZ,SAAQ,iBAAiB,CAAC,sBAAsB,CAChD,YAAW,gBAAgB;aAGV,WAAW,EAAE,YAAY;IAGzC,OAAO,CAAC,QAAQ,CAAC,0BAA0B;IAC3C,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBALrB,WAAW,EAAE,YAAY,EAGxB,0BAA0B,EAAE,gBAAgB,EAC5C,mBAAmB,EAAE,gBAAgB,EACrC,oBAAoB,EAAE,MAAM;IAQ9C,SAAgB,QAAQ,EAAE,wBAAwB,CAAyB;IAEpE,OAAO,IAAI,IAAI;IAMT,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAIpD,qBAAqB,IAAI,OAAO,CAAC,4BAA4B,CAAC;IAiB9D,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAStF,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAEpC;CACF"}
@@ -0,0 +1,66 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
6
+ /**
7
+ * A read-only document service that materializes a document at a target sequence number by combining
8
+ * a recoverable snapshot with a bounded replay of live ops.
9
+ *
10
+ * @remarks
11
+ * Storage (the snapshot) is served from the closest file version at or before the target sequence
12
+ * number. The ops needed to advance from that snapshot to the target are read from the live
13
+ * document's delta storage, bounded so that no op past the target is ever fetched.
14
+ *
15
+ * The service advertises the {@link IDocumentServicePolicies.storageOnly} policy. This reuses the
16
+ * loader's "frozen" load mechanism: the connection manager synthesizes a read-only frozen delta
17
+ * stream instead of opening a live socket, and forces the container read-only. The delta manager
18
+ * still catches up from the snapshot's sequence number through delta storage, which is exactly the
19
+ * bounded replay we want. As a result no live delta-stream connection is ever established.
20
+ *
21
+ * @internal
22
+ */
23
+ export class OdspPointInTimeDocumentService extends TypedEventEmitter {
24
+ constructor(resolvedUrl,
25
+ // Serves the snapshot: a read-only document service bound to the closest file version at or
26
+ // before the target sequence number. Its storage is the base we replay ops on top of.
27
+ recoverableDocumentService, liveDocumentService, targetSequenceNumber) {
28
+ super();
29
+ this.resolvedUrl = resolvedUrl;
30
+ this.recoverableDocumentService = recoverableDocumentService;
31
+ this.liveDocumentService = liveDocumentService;
32
+ this.targetSequenceNumber = targetSequenceNumber;
33
+ // storageOnly makes the connection manager synthesize a read-only frozen delta stream (no live
34
+ // socket) and force the container read-only - see the class remarks.
35
+ this.policies = { storageOnly: true };
36
+ this.metadataUpdateHandler = (metadata) => {
37
+ this.emit("metadataUpdate", metadata);
38
+ };
39
+ this.liveDocumentService.on("metadataUpdate", this.metadataUpdateHandler);
40
+ }
41
+ dispose() {
42
+ this.liveDocumentService.off("metadataUpdate", this.metadataUpdateHandler);
43
+ this.recoverableDocumentService.dispose();
44
+ this.liveDocumentService.dispose();
45
+ }
46
+ async connectToStorage() {
47
+ return this.recoverableDocumentService.connectToStorage();
48
+ }
49
+ async connectToDeltaStorage() {
50
+ const liveDeltaStorage = await this.liveDocumentService.connectToDeltaStorage();
51
+ // The exclusive upper bound needed to include the target op itself.
52
+ const boundedTo = this.targetSequenceNumber + 1;
53
+ return {
54
+ fetchMessages: (from, to, abortSignal, cachedOnly, fetchReason) => {
55
+ return liveDeltaStorage.fetchMessages(from, to === undefined ? boundedTo : Math.min(to, boundedTo), abortSignal, cachedOnly, fetchReason);
56
+ },
57
+ };
58
+ }
59
+ async connectToDeltaStream(_client) {
60
+ // Unreachable under normal flow: the connection manager short-circuits on the storageOnly
61
+ // policy and synthesizes a frozen delta stream before ever calling connectToDeltaStream.
62
+ // Reaching here indicates a regression of that short-circuit.
63
+ throw new Error("OdspPointInTimeDocumentService is storage-only; connectToDeltaStream should not be called");
64
+ }
65
+ }
66
+ //# sourceMappingURL=odspPointInTimeDocumentService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odspPointInTimeDocumentService.js","sourceRoot":"","sources":["../../src/pointInTimeDriver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I,CAAC,oBAAoB,GAAG,CAAC,CAAC;QAChD,OAAO;YACN,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE;gBACjE,OAAO,gBAAgB,CAAC,aAAa,CACpC,IAAI,EACJ,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,EACtD,WAAW,EACX,UAAU,EACV,WAAW,CACX,CAAC;YACH,CAAC;SACD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,OAAgB;QACjD,0FAA0F;QAC1F,yFAAyF;QACzF,8DAA8D;QAC9D,MAAM,IAAI,KAAK,CACd,2FAA2F,CAC3F,CAAC;IACH,CAAC;CAKD","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 type {\n\tIClient,\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * A read-only document service that materializes a document at a target sequence number by combining\n * a recoverable snapshot with a bounded replay of live ops.\n *\n * @remarks\n * Storage (the snapshot) is served from the closest file version at or before the target sequence\n * number. The ops needed to advance from that snapshot to the target are read from the live\n * document's delta storage, bounded so that no op past the target is ever fetched.\n *\n * The service advertises the {@link IDocumentServicePolicies.storageOnly} policy. This reuses the\n * loader's \"frozen\" load mechanism: the connection manager synthesizes a read-only frozen delta\n * stream instead of opening a live socket, and forces the container read-only. The delta manager\n * still catches up from the snapshot's sequence number through delta storage, which is exactly the\n * bounded replay we want. As a result no live delta-stream connection is ever established.\n *\n * @internal\n */\nexport class OdspPointInTimeDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tpublic constructor(\n\t\tpublic readonly resolvedUrl: IResolvedUrl,\n\t\t// Serves the snapshot: a read-only document service bound to the closest file version at or\n\t\t// before the target sequence number. Its storage is the base we replay ops on top of.\n\t\tprivate readonly recoverableDocumentService: IDocumentService,\n\t\tprivate readonly liveDocumentService: IDocumentService,\n\t\tprivate readonly targetSequenceNumber: number,\n\t) {\n\t\tsuper();\n\t\tthis.liveDocumentService.on(\"metadataUpdate\", this.metadataUpdateHandler);\n\t}\n\n\t// storageOnly makes the connection manager synthesize a read-only frozen delta stream (no live\n\t// socket) and force the container read-only - see the class remarks.\n\tpublic readonly policies: IDocumentServicePolicies = { storageOnly: true };\n\n\tpublic dispose(): void {\n\t\tthis.liveDocumentService.off(\"metadataUpdate\", this.metadataUpdateHandler);\n\t\tthis.recoverableDocumentService.dispose();\n\t\tthis.liveDocumentService.dispose();\n\t}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this.recoverableDocumentService.connectToStorage();\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\tconst liveDeltaStorage = await this.liveDocumentService.connectToDeltaStorage();\n\t\t// The exclusive upper bound needed to include the target op itself.\n\t\tconst boundedTo = this.targetSequenceNumber + 1;\n\t\treturn {\n\t\t\tfetchMessages: (from, to, abortSignal, cachedOnly, fetchReason) => {\n\t\t\t\treturn liveDeltaStorage.fetchMessages(\n\t\t\t\t\tfrom,\n\t\t\t\t\tto === undefined ? boundedTo : Math.min(to, boundedTo),\n\t\t\t\t\tabortSignal,\n\t\t\t\t\tcachedOnly,\n\t\t\t\t\tfetchReason,\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic async connectToDeltaStream(_client: IClient): Promise<IDocumentDeltaConnection> {\n\t\t// Unreachable under normal flow: the connection manager short-circuits on the storageOnly\n\t\t// policy and synthesizes a frozen delta stream before ever calling connectToDeltaStream.\n\t\t// Reaching here indicates a regression of that short-circuit.\n\t\tthrow new Error(\n\t\t\t\"OdspPointInTimeDocumentService is storage-only; connectToDeltaStream should not be called\",\n\t\t);\n\t}\n\n\tprivate readonly metadataUpdateHandler = (metadata: Record<string, string>): void => {\n\t\tthis.emit(\"metadataUpdate\", metadata);\n\t};\n}\n"]}