@fluidframework/odsp-driver 2.117.0 → 3.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.
Files changed (258) hide show
  1. package/CHANGELOG.md +92 -2
  2. package/README.md +53 -50
  3. package/api-extractor/api-extractor-lint-pointInTime.cjs.json +5 -0
  4. package/api-extractor/api-extractor-lint-pointInTime.esm.json +5 -0
  5. package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
  6. package/api-extractor/api-extractor-report.pointInTime.json +9 -0
  7. package/api-report/odsp-driver.legacy.alpha.api.md +28 -3
  8. package/api-report/odsp-driver.legacy.beta.api.md +28 -3
  9. package/api-report/odsp-driver.point-in-time.legacy.beta.api.md +117 -0
  10. package/dist/ReadBufferUtils.js +2 -1
  11. package/dist/ReadBufferUtils.js.map +1 -1
  12. package/dist/WriteBufferUtils.js +4 -6
  13. package/dist/WriteBufferUtils.js.map +1 -1
  14. package/dist/checkUrl.js +1 -2
  15. package/dist/checkUrl.js.map +1 -1
  16. package/dist/compactSnapshotParser.d.ts.map +1 -1
  17. package/dist/compactSnapshotParser.js +5 -4
  18. package/dist/compactSnapshotParser.js.map +1 -1
  19. package/dist/compactSnapshotWriter.js +1 -2
  20. package/dist/compactSnapshotWriter.js.map +1 -1
  21. package/dist/createFile/createFile.js +4 -5
  22. package/dist/createFile/createFile.js.map +1 -1
  23. package/dist/createFile/createNewContainerOnExistingFile.js +1 -2
  24. package/dist/createFile/createNewContainerOnExistingFile.js.map +1 -1
  25. package/dist/createFile/createNewUtils.d.ts.map +1 -1
  26. package/dist/createFile/createNewUtils.js +4 -5
  27. package/dist/createFile/createNewUtils.js.map +1 -1
  28. package/dist/createFile/index.js +1 -2
  29. package/dist/createFile/index.js.map +1 -1
  30. package/dist/createOdspCreateContainerRequest.js +1 -2
  31. package/dist/createOdspCreateContainerRequest.js.map +1 -1
  32. package/dist/createOdspUrl.js +1 -2
  33. package/dist/createOdspUrl.js.map +1 -1
  34. package/dist/epochTracker.d.ts.map +1 -1
  35. package/dist/epochTracker.js +17 -6
  36. package/dist/epochTracker.js.map +1 -1
  37. package/dist/fetchSnapshot.d.ts.map +1 -1
  38. package/dist/fetchSnapshot.js +5 -5
  39. package/dist/fetchSnapshot.js.map +1 -1
  40. package/dist/getFileLink.d.ts.map +1 -1
  41. package/dist/getQueryString.js +1 -2
  42. package/dist/getQueryString.js.map +1 -1
  43. package/dist/getUrlAndHeadersWithAuth.js +1 -2
  44. package/dist/getUrlAndHeadersWithAuth.js.map +1 -1
  45. package/dist/index.d.ts +3 -4
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +3 -5
  48. package/dist/index.js.map +1 -1
  49. package/dist/legacy.d.ts +4 -1
  50. package/dist/legacyAlpha.d.ts +4 -1
  51. package/dist/localOdspDriver/localOdspDeltaStorageService.js +2 -0
  52. package/dist/localOdspDriver/localOdspDeltaStorageService.js.map +1 -1
  53. package/dist/localOdspDriver/localOdspDocumentService.js +5 -1
  54. package/dist/localOdspDriver/localOdspDocumentService.js.map +1 -1
  55. package/dist/localOdspDriver/localOdspDocumentServiceFactory.js +2 -1
  56. package/dist/localOdspDriver/localOdspDocumentServiceFactory.js.map +1 -1
  57. package/dist/localOdspDriver/localOdspDocumentStorageManager.js +4 -1
  58. package/dist/localOdspDriver/localOdspDocumentStorageManager.js.map +1 -1
  59. package/dist/mockify.js +2 -2
  60. package/dist/mockify.js.map +1 -1
  61. package/dist/odspCache.js +7 -8
  62. package/dist/odspCache.js.map +1 -1
  63. package/dist/odspDelayLoadedDeltaStream.d.ts.map +1 -1
  64. package/dist/odspDelayLoadedDeltaStream.js +42 -26
  65. package/dist/odspDelayLoadedDeltaStream.js.map +1 -1
  66. package/dist/odspDeltaStorageService.js +14 -1
  67. package/dist/odspDeltaStorageService.js.map +1 -1
  68. package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
  69. package/dist/odspDocumentDeltaConnection.js +58 -41
  70. package/dist/odspDocumentDeltaConnection.js.map +1 -1
  71. package/dist/odspDocumentService.js +16 -1
  72. package/dist/odspDocumentService.js.map +1 -1
  73. package/dist/odspDocumentServiceFactory.d.ts +30 -1
  74. package/dist/odspDocumentServiceFactory.d.ts.map +1 -1
  75. package/dist/odspDocumentServiceFactory.js +30 -2
  76. package/dist/odspDocumentServiceFactory.js.map +1 -1
  77. package/dist/odspDocumentServiceFactoryCore.d.ts +83 -3
  78. package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
  79. package/dist/odspDocumentServiceFactoryCore.js +38 -12
  80. package/dist/odspDocumentServiceFactoryCore.js.map +1 -1
  81. package/dist/odspDocumentStorageManager.d.ts.map +1 -1
  82. package/dist/odspDocumentStorageManager.js +31 -13
  83. package/dist/odspDocumentStorageManager.js.map +1 -1
  84. package/dist/odspDocumentStorageServiceBase.js +23 -20
  85. package/dist/odspDocumentStorageServiceBase.js.map +1 -1
  86. package/dist/odspDriverUrlResolver.js +2 -2
  87. package/dist/odspDriverUrlResolver.js.map +1 -1
  88. package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
  89. package/dist/odspDriverUrlResolverForShareLink.js +6 -1
  90. package/dist/odspDriverUrlResolverForShareLink.js.map +1 -1
  91. package/dist/odspError.js +1 -2
  92. package/dist/odspError.js.map +1 -1
  93. package/dist/odspFluidFileLink.js +4 -4
  94. package/dist/odspFluidFileLink.js.map +1 -1
  95. package/dist/odspLayerCompatState.d.ts +8 -1
  96. package/dist/odspLayerCompatState.d.ts.map +1 -1
  97. package/dist/odspLayerCompatState.js +20 -1
  98. package/dist/odspLayerCompatState.js.map +1 -1
  99. package/dist/odspLocationRedirection.js +1 -2
  100. package/dist/odspLocationRedirection.js.map +1 -1
  101. package/dist/odspPublicUtils.js +1 -2
  102. package/dist/odspPublicUtils.js.map +1 -1
  103. package/dist/odspSnapshotParser.js +1 -2
  104. package/dist/odspSnapshotParser.js.map +1 -1
  105. package/dist/odspSummaryUploadManager.js +7 -0
  106. package/dist/odspSummaryUploadManager.js.map +1 -1
  107. package/dist/odspUrlHelper.js +6 -7
  108. package/dist/odspUrlHelper.js.map +1 -1
  109. package/dist/odspUtils.d.ts.map +1 -1
  110. package/dist/odspUtils.js +21 -21
  111. package/dist/odspUtils.js.map +1 -1
  112. package/dist/odspVersionManager/odspFileVersionFetcher.js +1 -2
  113. package/dist/odspVersionManager/odspFileVersionFetcher.js.map +1 -1
  114. package/dist/odspVersionManager/odspVersionManager.js +9 -8
  115. package/dist/odspVersionManager/odspVersionManager.js.map +1 -1
  116. package/dist/opsCaching.js +7 -1
  117. package/dist/opsCaching.js.map +1 -1
  118. package/dist/packageVersion.d.ts +1 -1
  119. package/dist/packageVersion.d.ts.map +1 -1
  120. package/dist/packageVersion.js +1 -1
  121. package/dist/packageVersion.js.map +1 -1
  122. package/dist/pointInTime.d.ts +15 -0
  123. package/dist/pointInTime.d.ts.map +1 -0
  124. package/dist/pointInTime.js +16 -0
  125. package/dist/pointInTime.js.map +1 -0
  126. package/dist/pointInTimeDriver/createPointInTimeDocumentService.d.ts +34 -0
  127. package/dist/pointInTimeDriver/createPointInTimeDocumentService.d.ts.map +1 -0
  128. package/dist/pointInTimeDriver/createPointInTimeDocumentService.js +101 -0
  129. package/dist/pointInTimeDriver/createPointInTimeDocumentService.js.map +1 -0
  130. package/dist/pointInTimeDriver/odspPointInTimeDocumentService.js +10 -6
  131. package/dist/pointInTimeDriver/odspPointInTimeDocumentService.js.map +1 -1
  132. package/dist/prefetchLatestSnapshot.js +1 -2
  133. package/dist/prefetchLatestSnapshot.js.map +1 -1
  134. package/dist/retryErrorsStorageAdapter.js +3 -1
  135. package/dist/retryErrorsStorageAdapter.js.map +1 -1
  136. package/dist/retryUtils.js +1 -2
  137. package/dist/retryUtils.js.map +1 -1
  138. package/dist/vroom.d.ts.map +1 -1
  139. package/dist/zipItDataRepresentationUtils.d.ts.map +1 -1
  140. package/dist/zipItDataRepresentationUtils.js +20 -15
  141. package/dist/zipItDataRepresentationUtils.js.map +1 -1
  142. package/lib/ReadBufferUtils.js +2 -1
  143. package/lib/ReadBufferUtils.js.map +1 -1
  144. package/lib/WriteBufferUtils.js +2 -4
  145. package/lib/WriteBufferUtils.js.map +1 -1
  146. package/lib/compactSnapshotParser.d.ts.map +1 -1
  147. package/lib/compactSnapshotParser.js +3 -2
  148. package/lib/compactSnapshotParser.js.map +1 -1
  149. package/lib/createFile/createNewUtils.d.ts.map +1 -1
  150. package/lib/createFile/createNewUtils.js +2 -2
  151. package/lib/createFile/createNewUtils.js.map +1 -1
  152. package/lib/epochTracker.d.ts.map +1 -1
  153. package/lib/epochTracker.js +15 -4
  154. package/lib/epochTracker.js.map +1 -1
  155. package/lib/fetchSnapshot.d.ts.map +1 -1
  156. package/lib/getFileLink.d.ts.map +1 -1
  157. package/lib/index.d.ts +3 -4
  158. package/lib/index.d.ts.map +1 -1
  159. package/lib/index.js +3 -6
  160. package/lib/index.js.map +1 -1
  161. package/lib/legacy.d.ts +5 -2
  162. package/lib/legacyAlpha.d.ts +5 -2
  163. package/lib/localOdspDriver/localOdspDeltaStorageService.js +2 -0
  164. package/lib/localOdspDriver/localOdspDeltaStorageService.js.map +1 -1
  165. package/lib/localOdspDriver/localOdspDocumentService.js +5 -1
  166. package/lib/localOdspDriver/localOdspDocumentService.js.map +1 -1
  167. package/lib/localOdspDriver/localOdspDocumentServiceFactory.js +2 -1
  168. package/lib/localOdspDriver/localOdspDocumentServiceFactory.js.map +1 -1
  169. package/lib/localOdspDriver/localOdspDocumentStorageManager.js +4 -1
  170. package/lib/localOdspDriver/localOdspDocumentStorageManager.js.map +1 -1
  171. package/lib/odspCache.js +7 -8
  172. package/lib/odspCache.js.map +1 -1
  173. package/lib/odspDelayLoadedDeltaStream.d.ts.map +1 -1
  174. package/lib/odspDelayLoadedDeltaStream.js +42 -26
  175. package/lib/odspDelayLoadedDeltaStream.js.map +1 -1
  176. package/lib/odspDeltaStorageService.js +14 -1
  177. package/lib/odspDeltaStorageService.js.map +1 -1
  178. package/lib/odspDocumentDeltaConnection.d.ts.map +1 -1
  179. package/lib/odspDocumentDeltaConnection.js +58 -41
  180. package/lib/odspDocumentDeltaConnection.js.map +1 -1
  181. package/lib/odspDocumentService.js +16 -1
  182. package/lib/odspDocumentService.js.map +1 -1
  183. package/lib/odspDocumentServiceFactory.d.ts +30 -1
  184. package/lib/odspDocumentServiceFactory.d.ts.map +1 -1
  185. package/lib/odspDocumentServiceFactory.js +28 -1
  186. package/lib/odspDocumentServiceFactory.js.map +1 -1
  187. package/lib/odspDocumentServiceFactoryCore.d.ts +83 -3
  188. package/lib/odspDocumentServiceFactoryCore.d.ts.map +1 -1
  189. package/lib/odspDocumentServiceFactoryCore.js +39 -13
  190. package/lib/odspDocumentServiceFactoryCore.js.map +1 -1
  191. package/lib/odspDocumentStorageManager.d.ts.map +1 -1
  192. package/lib/odspDocumentStorageManager.js +32 -14
  193. package/lib/odspDocumentStorageManager.js.map +1 -1
  194. package/lib/odspDocumentStorageServiceBase.js +23 -20
  195. package/lib/odspDocumentStorageServiceBase.js.map +1 -1
  196. package/lib/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
  197. package/lib/odspDriverUrlResolverForShareLink.js +6 -1
  198. package/lib/odspDriverUrlResolverForShareLink.js.map +1 -1
  199. package/lib/odspLayerCompatState.d.ts +8 -1
  200. package/lib/odspLayerCompatState.d.ts.map +1 -1
  201. package/lib/odspLayerCompatState.js +20 -1
  202. package/lib/odspLayerCompatState.js.map +1 -1
  203. package/lib/odspSummaryUploadManager.js +7 -0
  204. package/lib/odspSummaryUploadManager.js.map +1 -1
  205. package/lib/odspUtils.d.ts.map +1 -1
  206. package/lib/odspVersionManager/odspVersionManager.js +7 -6
  207. package/lib/odspVersionManager/odspVersionManager.js.map +1 -1
  208. package/lib/opsCaching.js +7 -1
  209. package/lib/opsCaching.js.map +1 -1
  210. package/lib/packageVersion.d.ts +1 -1
  211. package/lib/packageVersion.d.ts.map +1 -1
  212. package/lib/packageVersion.js +1 -1
  213. package/lib/packageVersion.js.map +1 -1
  214. package/lib/pointInTime.d.ts +15 -0
  215. package/lib/pointInTime.d.ts.map +1 -0
  216. package/lib/pointInTime.js +12 -0
  217. package/lib/pointInTime.js.map +1 -0
  218. package/lib/pointInTimeDriver/createPointInTimeDocumentService.d.ts +34 -0
  219. package/lib/pointInTimeDriver/createPointInTimeDocumentService.d.ts.map +1 -0
  220. package/lib/pointInTimeDriver/createPointInTimeDocumentService.js +99 -0
  221. package/lib/pointInTimeDriver/createPointInTimeDocumentService.js.map +1 -0
  222. package/lib/pointInTimeDriver/odspPointInTimeDocumentService.js +10 -6
  223. package/lib/pointInTimeDriver/odspPointInTimeDocumentService.js.map +1 -1
  224. package/lib/public.d.ts +1 -1
  225. package/lib/retryErrorsStorageAdapter.js +3 -1
  226. package/lib/retryErrorsStorageAdapter.js.map +1 -1
  227. package/lib/vroom.d.ts.map +1 -1
  228. package/lib/zipItDataRepresentationUtils.d.ts.map +1 -1
  229. package/lib/zipItDataRepresentationUtils.js +10 -5
  230. package/lib/zipItDataRepresentationUtils.js.map +1 -1
  231. package/package.json +49 -54
  232. package/src/compactSnapshotParser.ts +6 -2
  233. package/src/createFile/createNewUtils.ts +6 -2
  234. package/src/index.ts +10 -6
  235. package/src/odspDocumentServiceFactory.ts +69 -1
  236. package/src/odspDocumentServiceFactoryCore.ts +105 -4
  237. package/src/odspDocumentStorageManager.ts +2 -2
  238. package/src/odspLayerCompatState.ts +29 -1
  239. package/src/odspVersionManager/DEV.md +9 -8
  240. package/src/packageVersion.ts +1 -1
  241. package/src/pointInTime.ts +30 -0
  242. package/src/pointInTimeDriver/createPointInTimeDocumentService.ts +193 -0
  243. package/src/zipItDataRepresentationUtils.ts +3 -3
  244. package/tsconfig.json +1 -1
  245. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts +0 -41
  246. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts.map +0 -1
  247. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js +0 -132
  248. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js.map +0 -1
  249. package/internal.d.ts +0 -11
  250. package/legacy/alpha.d.ts +0 -11
  251. package/legacy.d.ts +0 -11
  252. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts +0 -41
  253. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts.map +0 -1
  254. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js +0 -128
  255. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js.map +0 -1
  256. package/src/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.ts +0 -260
  257. /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
  258. /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,8 +1,98 @@
1
1
  # @fluidframework/odsp-driver
2
2
 
3
- ## 2.117.0
3
+ ## 3.0.0
4
4
 
5
- Dependency updates only.
5
+ ### Minor Changes
6
+
7
+ - Removal of direct CommonJS support ([#28124](https://github.com/microsoft/FluidFramework/pull/28124)) [0f84e3b8878](https://github.com/microsoft/FluidFramework/commit/0f84e3b8878a5e75b2253976d98fd963bbd9db88)
8
+
9
+ Direct `require()` import is no longer directly supported.
10
+ Package is transpiled as ECMAScript Module.
11
+
12
+ See [Removal of direct CommonJS support in v3.0](https://github.com/microsoft/FluidFramework/issues/27444) for more information.
13
+
14
+ - New ILayerCompatSupportRequirements property on LocalDocumentServiceFactory and OdspDocumentServiceFactoryCore ([#27516](https://github.com/microsoft/FluidFramework/pull/27516)) [f8bcc56859f](https://github.com/microsoft/FluidFramework/commit/f8bcc56859fc51957d45453bcf59ce154a2e0c18)
15
+
16
+ A new optional property, `ILayerCompatSupportRequirements`, has been added to [`LocalDocumentServiceFactory`](https://fluidframework.com/docs/api/local-driver/localdocumentservicefactory-class) and [`OdspDocumentServiceFactoryCore`](https://fluidframework.com/docs/api/odsp-driver/odspdocumentservicefactorycore-class).
17
+
18
+ The Driver layer uses this property to publish the requirements that the Loader layer must meet to be compatible with it. Because the Driver has no reference to the Loader, it cannot validate the Loader directly; instead the Loader reads these requirements and validates itself against them on the Driver's behalf. This enables the Loader / Driver compatibility check to run in both directions.
19
+
20
+ - Make point-in-time support optional and consumer-supplied ([#28055](https://github.com/microsoft/FluidFramework/pull/28055)) [9a55f89f0ac](https://github.com/microsoft/FluidFramework/commit/9a55f89f0acb4afde7b189bab352b6140a668b92)
21
+
22
+ Point-in-time loading is now an optional implementation supplied by the host. Consumers that do
23
+ not enable the feature no longer include its implementation in their dependency graph. Hosts can
24
+ control when the feature is loaded by dynamically importing its dedicated entrypoint:
25
+
26
+ ```typescript
27
+ const factory = createOdspDocumentServiceFactory({
28
+ getStorageToken,
29
+ getWebsocketToken,
30
+ persistedCache,
31
+ hostPolicy,
32
+ pointInTimeDocumentServiceImplementation: async (props) => {
33
+ const { createPointInTimeDocumentService } = await import(
34
+ "@fluidframework/odsp-driver/legacy/point-in-time"
35
+ );
36
+ return createPointInTimeDocumentService(props);
37
+ },
38
+ });
39
+ ```
40
+
41
+ The legacy-beta `getOdspPointInTimeDocumentServiceFactory` helper is removed. Point-in-time
42
+ consumers should use `createOdspDocumentServiceFactory`, which accepts tokens, cache, host policy,
43
+ and optional feature implementations in one options object. Existing `OdspDocumentServiceFactory`
44
+ and `OdspDocumentServiceFactoryCore` constructor signatures remain unchanged.
45
+
46
+ - Require modern TypeScript module resolution ([#27970](https://github.com/microsoft/FluidFramework/pull/27970)) [325e2016ca9](https://github.com/microsoft/FluidFramework/commit/325e2016ca9978d4a1f7552c97ba34feac9df41f)
47
+
48
+ Fluid Framework Client packages no longer include type declaration compatibility entrypoints for TypeScript's legacy Node10 resolution mode (`"moduleResolution": "node"` or `"node10"`).
49
+ Applications upgrading to Fluid Framework 3.0 must use one of the following supported configurations:
50
+ - `"module": "Node16"` with `"moduleResolution": "Node16"`
51
+ - `"module": "NodeNext"` with `"moduleResolution": "NodeNext"`
52
+ - `"module": "ESNext"` with `"moduleResolution": "Bundler"`
53
+
54
+ Existing public package entrypoints exposed through `package.json` exports, including `/alpha`, `/beta`, and `/legacy`, remain available under supported module resolution modes.
55
+
56
+ See [Removal of Node10 resolutions in v3.0](https://github.com/microsoft/FluidFramework/issues/27457) for more information.
57
+
58
+ - Enable point-in-time loading on the standard ODSP document service factory ([#28007](https://github.com/microsoft/FluidFramework/pull/28007)) [1336342a572](https://github.com/microsoft/FluidFramework/commit/1336342a572d620d9390802c82a8f6d06727087b)
59
+
60
+ [`OdspDocumentServiceFactoryCore`](https://fluidframework.com/docs/api/odsp-driver/odspdocumentservicefactorycore-class)
61
+ now exposes the optional `createPointInTimeDocumentService` capability.
62
+ [`OdspDocumentServiceFactory`](https://fluidframework.com/docs/api/odsp-driver/odspdocumentservicefactory-class)
63
+ inherits this capability, so hosts can use the standard factory with
64
+ [`loadContainerToSequenceNumber`](https://fluidframework.com/docs/api/container-loader/loadcontainertosequencenumber-function)
65
+ for sequence-number-based document loading. Factories that do not support point-in-time loading
66
+ leave the capability undefined.
67
+
68
+ ```typescript
69
+ const factory = new OdspDocumentServiceFactory(
70
+ getStorageToken,
71
+ getWebsocketToken,
72
+ );
73
+
74
+ if (factory.createPointInTimeDocumentService !== undefined) {
75
+ const documentService = await factory.createPointInTimeDocumentService(
76
+ resolvedUrl,
77
+ targetSequenceNumber,
78
+ );
79
+ }
80
+ ```
81
+
82
+ - Client packages now target ES2022 ([#27846](https://github.com/microsoft/FluidFramework/pull/27846)) [91c78541bdd](https://github.com/microsoft/FluidFramework/commit/91c78541bddcbca5d6c5f357b023eeaee617d885)
83
+
84
+ The TypeScript compilation `target` and `lib` for the Fluid Framework client packages have been raised from ES2021/ES2020 to **ES2022**.
85
+ The published JavaScript now uses ES2022 language features (with correspondingly less down-leveling), so consuming these packages requires a runtime that supports ES2022.
86
+ All actively supported Node.js versions and evergreen browsers already meet this requirement.
87
+
88
+ Note that Fluid Framework has not officially supported targets older than ES2022 since before 2.0: this is documented in [ClientRequirements.md](https://github.com/microsoft/FluidFramework/blob/main/ClientRequirements.md) as well as the README for every client package.
89
+
90
+ It is possible this change could impact users of less up to date JavaScript runtimes.
91
+ Impacted users can use a tool like [babel](https://babeljs.io/) to transpile out unsupported language features.
92
+
93
+ - Build with TypeScript 6 ([#28052](https://github.com/microsoft/FluidFramework/pull/28052)) [7ab015c49de](https://github.com/microsoft/FluidFramework/commit/7ab015c49deec84833cdfe1fb5e1606b901f6e81)
94
+
95
+ FluidFramework Client SDK is now built using TypeScript 6. Consumers should build with TypeScript v6 or v7 or compatible tooling.
6
96
 
7
97
  ## 2.116.0
8
98
 
package/README.md CHANGED
@@ -33,15 +33,15 @@ In the table I have used the failure ones.
33
33
 
34
34
  ## Using Fluid Framework libraries
35
35
 
36
- When taking a dependency on a Fluid Framework library's public APIs, we recommend using a `^` (caret) version range, such as `^1.3.4`.
37
- While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
38
- library consumers should always prefer `^`.
36
+ For a dependency on a Fluid Framework library's public APIs, we recommend a `^` (caret) version range.
37
+ For example, use `^1.3.4`.
39
38
 
40
- If using any of Fluid Framework's unstable APIs (for example, its `beta` APIs), we recommend using a more constrained version range, such as `~`.
39
+ For a dependency on an unstable API, such as a `beta` API, we recommend a more restrictive version range.
40
+ For example, use a `~` version range.
41
41
 
42
42
  ## Installation
43
43
 
44
- To get started, install the package by running the following command:
44
+ Run this command to install the package:
45
45
 
46
46
  ```bash
47
47
  npm i @fluidframework/odsp-driver
@@ -49,16 +49,16 @@ npm i @fluidframework/odsp-driver
49
49
 
50
50
  ## Importing from this package
51
51
 
52
- This package leverages [package.json exports](https://nodejs.org/api/packages.html#exports) to separate its APIs by support level.
53
- For more information on the related support guarantees, see [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
52
+ This package uses [package.json exports](https://nodejs.org/api/packages.html#exports) to separate APIs by support level.
53
+ For information about the support guarantees, read [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
54
54
 
55
- To access the `public` ([SemVer](https://semver.org/)) APIs, import via `@fluidframework/odsp-driver` like normal.
55
+ Import the `public` APIs from `@fluidframework/odsp-driver`.
56
56
 
57
- To access the `legacy` APIs, import via `@fluidframework/odsp-driver/legacy`.
57
+ Import the `legacy` APIs from `@fluidframework/odsp-driver/legacy`.
58
58
 
59
59
  ## API Documentation
60
60
 
61
- API documentation for **@fluidframework/odsp-driver** is available at <https://fluidframework.com/docs/apis/odsp-driver>.
61
+ Read the **@fluidframework/odsp-driver** API documentation at <https://fluidframework.com/docs/apis/odsp-driver>.
62
62
 
63
63
  <!-- prettier-ignore-end -->
64
64
 
@@ -89,62 +89,69 @@ Documenting some basics about opds-driver specific apis that are relevant for cr
89
89
 
90
90
  ## Minimum Client Requirements
91
91
 
92
- These are the platform requirements for the current version of Fluid Framework Client Packages.
93
- These requirements err on the side of being too strict since within a major version they can be relaxed over time, but not made stricter.
94
- For Long Term Support (LTS) versions this can require supporting these platforms for several years.
92
+ Fluid Framework client libraries support the platforms in this document.
93
+ These requirements are intentionally restrictive.
94
+ Within a major version series, we can relax these requirements, but we cannot make them stricter.
95
+ For a Long Term Support (LTS) version, we might need to support these platforms for several years.
95
96
 
96
- It is likely that other configurations will work, but they are not supported: if they stop working, we do not consider that a bug.
97
- If you would benefit from support for something not listed here, file an issue and the product team will evaluate your request.
98
- When making such a request please include if the configuration already works (and thus the request is just that it becomes officially supported), or if changes are required to get it working.
97
+ Other configurations can work, but Fluid Framework does not support them.
98
+ If an unsupported configuration stops working, we do not classify this as a bug.
99
+ To request support for a configuration that is not listed, file an issue.
100
+ The product team will evaluate your request.
101
+ In the issue, specify the current status of the configuration:
102
+
103
+ - The configuration works but needs official support.
104
+ - The configuration does not work and requires changes.
99
105
 
100
106
  ### Supported Runtimes
101
107
 
102
- - NodeJs ^22.22.2 except that we will drop support for it [when NodeJs 22 loses its upstream support on 2027-04-30](https://github.com/nodejs/release#release-schedule), and will support a newer LTS version of NodeJS at least 1 year before 22 is end-of-life.
103
- - Running Fluid in a Node.js environment with the `--no-experimental-fetch` flag is not supported.
104
- - Modern browsers supporting the es2022 standard library: in response to asks we can add explicit support for using babel to polyfill to target specific standards or runtimes (meaning we can avoid/remove use of things that don't polyfill robustly, but otherwise target modern standards).
108
+ - Fluid Framework supports Node.js versions 22 and 24 while they receive [upstream support](https://nodejs.org/en/about/previous-releases).
109
+ - Fluid Framework will stop support for version 22 [when upstream support ends on 2027-04-30](https://github.com/nodejs/release#release-schedule).
110
+ - Fluid Framework does not support Node.js with the `--no-experimental-fetch` flag.
111
+ - Fluid Framework supports modern browsers that support the ES2022 standard library.
105
112
 
106
113
  ### Supported Tools
107
114
 
108
- - TypeScript 5.4:
109
- - All [`strict`](https://www.typescriptlang.org/tsconfig) options are supported.
110
- - [`strictNullChecks`](https://www.typescriptlang.org/tsconfig) is required.
111
- - [Configuration options deprecated in 5.0](https://github.com/microsoft/TypeScript/issues/51909) are not supported.
112
- - `exactOptionalPropertyTypes` is currently not fully supported.
113
- If used, narrowing members of Fluid Framework types types using `in`, `Reflect.has`, `Object.hasOwn` or `Object.prototype.hasOwnProperty` should be avoided as they may incorrectly exclude `undefined` from the possible values in some cases.
115
+ - [TypeScript 6.0](https://typescriptdocs.com/release-notes/TypeScript%206.0):
116
+ - Fluid Framework supports all [`strict`](https://www.typescriptlang.org/tsconfig) options.
117
+ - Set the build targets (`lib`, `target`) to `ES2022` or later.
118
+ - Enable [`strictNullChecks`](https://www.typescriptlang.org/tsconfig).
119
+ - Fluid Framework does not support [configuration options deprecated in TypeScript 6.0](https://typescriptdocs.com/release-notes/TypeScript%206.0#breaking-changes-and-deprecations-in-typescript-6-0).
120
+ - Fluid Framework does not fully support `exactOptionalPropertyTypes`.
121
+ If you enable this option, do not use `in`, `Reflect.has`, `Object.hasOwn`, or `Object.prototype.hasOwnProperty` to narrow members of Fluid Framework types.
122
+ These methods can incorrectly exclude `undefined` from the possible values.
114
123
  - [webpack](https://webpack.js.org/) 5
115
- - We are not intending to be prescriptive about what bundler to use.
116
- Other bundlers which can handle ES Modules should work, but webpack is the only one we actively test.
124
+ - We do not require a specific bundler.
125
+ Other bundlers that handle ES Modules can work, but we actively test only webpack.
117
126
 
118
127
  ### Module Resolution
119
128
 
120
- [`Node16`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) resolution should be used with TypeScript compilerOptions to follow the [Node.js v12+ ESM Resolution and Loading algorithm](https://nodejs.github.io/nodejs.dev/en/api/v20/esm/#resolution-and-loading-algorithm).
121
- Node10 resolution is not supported as it does not support Fluid Framework's API structuring pattern that is used to distinguish stable APIs from those that are in development.
129
+ In TypeScript `compilerOptions`, use [`Node16`, `Node20`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) module resolution.
130
+ These settings follow the [Node.js v12+ ESM Resolution and Loading algorithm](https://nodejs.github.io/nodejs.dev/en/api/v20/esm/#resolution-and-loading-algorithm).
131
+
132
+ Do not use `Node10` module resolution.
122
133
 
123
134
  ### Module Formats
124
135
 
125
136
  - ES Modules:
126
- ES Modules are the preferred way to consume our client packages (including in NodeJs) and consuming our client packages from ES Modules is fully supported.
127
- - CommonJs:
128
- Consuming our client packages as CommonJs is supported only in NodeJS and only for the cases listed below.
129
- This is done to accommodate some workflows without good ES Module support.
130
- If you have a workflow you would like included in this list, file an issue.
131
- Once this list of workflows motivating CommonJS support is empty, we may drop support for CommonJS one year after notice of the change is posted here.
132
-
133
- - Testing with Jest (which lacks [stable ESM support](https://jestjs.io/docs/ecmascript-modules) due to [unstable APIs in NodeJs](https://github.com/nodejs/node/issues/37648))
137
+ Use ES Modules to consume Fluid Framework client packages, including in Node.js.
138
+ - CommonJS:
139
+ Fluid Framework does not officially support CommonJS in version 3.0 or later.
134
140
 
135
141
  ## Contribution Guidelines
136
142
 
137
- There are many ways to [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid.
143
+ You can [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid Framework in these ways:
138
144
 
139
- - Participate in Q&A in our [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
140
- - [Submit bugs](https://github.com/microsoft/FluidFramework/issues) and help us verify fixes as they are checked in.
141
- - Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
145
+ - Answer questions in [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
146
+ - [Submit bug reports](https://github.com/microsoft/FluidFramework/issues) and help verify fixes.
147
+ - Review [source code changes](https://github.com/microsoft/FluidFramework/pulls).
142
148
  - [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
143
149
 
144
- Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Home.md).
150
+ For detailed instructions, read the [repo documentation](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Home.md).
145
151
 
146
- This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
147
- For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
152
+ This project follows the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
153
+ For more information, read the [Code of Conduct frequently asked questions](https://opensource.microsoft.com/codeofconduct/faq/).
154
+ For questions or comments, contact [opencode@microsoft.com](mailto:opencode@microsoft.com).
148
155
 
149
156
  This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
150
157
  Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
@@ -152,13 +159,9 @@ Use of Microsoft trademarks or logos in modified versions of this project must n
152
159
 
153
160
  ## Help
154
161
 
155
- Not finding what you're looking for in this README?
156
- Check out [fluidframework.com](https://fluidframework.com/docs/).
157
-
158
- Still not finding what you're looking for?
159
- Please [file an issue](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Contributing/Submitting-Bugs-and-Feature-Requests.md).
162
+ Read the [Fluid Framework documentation](https://fluidframework.com/docs/) for information about Fluid Framework concepts and APIs.
160
163
 
161
- Thank you!
164
+ To request information that the documentation does not contain, [create an issue](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Contributing/Submitting-Bugs-and-Feature-Requests.md).
162
165
 
163
166
  ## Trademark
164
167
 
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/dist/pointInTime.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/pointInTime.d.ts"
5
+ }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-model.esm.json"
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-model.esm.json"
4
4
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.legacy.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/pointInTime.d.ts",
5
+ "apiReport": {
6
+ "reportFileName": "<unscopedPackageName>.point-in-time.legacy",
7
+ "reportVariants": ["beta"]
8
+ }
9
+ }
@@ -13,6 +13,9 @@ export function createLocalOdspDocumentServiceFactory(localSnapshot: Uint8Array
13
13
  // @beta @legacy
14
14
  export function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType?: ISharingLinkKind, containerPackageInfo?: IContainerPackageInfo | undefined): IRequest;
15
15
 
16
+ // @beta @legacy
17
+ export function createOdspDocumentServiceFactory(options: IOdspDocumentServiceFactoryOptions): OdspDocumentServiceFactory;
18
+
16
19
  // @beta @legacy
17
20
  export function createOdspUrl(l: OdspFluidDataStoreLocator): string;
18
21
 
@@ -65,9 +68,6 @@ export function getHashedDocumentId(driveId: string, itemId: string): Promise<st
65
68
  // @beta @legacy
66
69
  export function getLocatorFromOdspUrl(url: URL, requireFluidSignature?: boolean): OdspFluidDataStoreLocator | undefined;
67
70
 
68
- // @beta @legacy
69
- export function getOdspPointInTimeDocumentServiceFactory(getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>, getWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined, persistedCache?: IPersistedCache, hostPolicy?: HostStoragePolicy): IPointInTimeDocumentServiceFactory;
70
-
71
71
  // @beta @legacy (undocumented)
72
72
  export interface ICacheAndTracker {
73
73
  // (undocumented)
@@ -91,6 +91,26 @@ export interface IOdspCache extends INonPersistentCache {
91
91
  readonly persistedCache: IPersistedFileCache;
92
92
  }
93
93
 
94
+ // @beta @legacy
95
+ export interface IOdspDocumentServiceFactoryOptions {
96
+ readonly getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>;
97
+ readonly getWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined;
98
+ readonly hostPolicy?: HostStoragePolicy | undefined;
99
+ readonly persistedCache?: IPersistedCache | undefined;
100
+ readonly pointInTimeDocumentServiceImplementation?: OdspPointInTimeDocumentServiceImplementation | undefined;
101
+ }
102
+
103
+ // @beta @legacy
104
+ export interface IOdspPointInTimeDocumentServiceImplementationProps {
105
+ readonly clientIsSummarizer?: boolean;
106
+ readonly createDocumentService: (resolvedUrl: IResolvedUrl, logger: ITelemetryBaseLogger, cacheAndTracker: ICacheAndTracker, clientIsSummarizer?: boolean) => Promise<IDocumentService>;
107
+ readonly getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>;
108
+ readonly logger?: ITelemetryBaseLogger;
109
+ readonly persistedCache: IPersistedCache;
110
+ readonly resolvedUrl: IResolvedUrl;
111
+ readonly targetSequenceNumber: number;
112
+ }
113
+
94
114
  // @beta @legacy (undocumented)
95
115
  export interface IOdspResponse<T> {
96
116
  // (undocumented)
@@ -164,8 +184,10 @@ export class OdspDocumentServiceFactoryCore implements IDocumentServiceFactory,
164
184
  createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
165
185
  // (undocumented)
166
186
  protected createDocumentServiceCore(resolvedUrl: IResolvedUrl, odspLogger: ITelemetryBaseLogger, cacheAndTrackerArg?: ICacheAndTracker, clientIsSummarizer?: boolean): Promise<IDocumentService>;
187
+ readonly createPointInTimeDocumentService?: IPointInTimeDocumentServiceFactory["createPointInTimeDocumentService"];
167
188
  getRelayServiceSessionInfo(resolvedUrl: IResolvedUrl): Promise<ISocketStorageDiscovery | undefined>;
168
189
  readonly ILayerCompatDetails?: unknown;
190
+ readonly ILayerCompatSupportRequirements?: unknown;
169
191
  // (undocumented)
170
192
  get IRelaySessionAwareDriverFactory(): this;
171
193
  // (undocumented)
@@ -205,6 +227,9 @@ export interface OdspFluidDataStoreLocator extends IOdspUrlParts {
205
227
  fileVersion?: string | undefined;
206
228
  }
207
229
 
230
+ // @beta @legacy
231
+ export type OdspPointInTimeDocumentServiceImplementation = (props: IOdspPointInTimeDocumentServiceImplementationProps) => Promise<IDocumentService>;
232
+
208
233
  // @beta @legacy
209
234
  export function prefetchLatestSnapshot(resolvedUrl: IResolvedUrl, getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>, persistedCache: IPersistedCache, _forceAccessTokenViaAuthorizationHeader: boolean, logger: ITelemetryBaseLogger, hostSnapshotFetchOptions: ISnapshotOptions | undefined, enableRedeemFallback?: boolean, _fetchBinarySnapshotFormat?: boolean, _snapshotFormatFetchType?: SnapshotFormatSupportType, odspDocumentServiceFactory?: OdspDocumentServiceFactory): Promise<boolean>;
210
235
 
@@ -13,6 +13,9 @@ export function createLocalOdspDocumentServiceFactory(localSnapshot: Uint8Array
13
13
  // @beta @legacy
14
14
  export function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType?: ISharingLinkKind, containerPackageInfo?: IContainerPackageInfo | undefined): IRequest;
15
15
 
16
+ // @beta @legacy
17
+ export function createOdspDocumentServiceFactory(options: IOdspDocumentServiceFactoryOptions): OdspDocumentServiceFactory;
18
+
16
19
  // @beta @legacy
17
20
  export function createOdspUrl(l: OdspFluidDataStoreLocator): string;
18
21
 
@@ -65,9 +68,6 @@ export function getHashedDocumentId(driveId: string, itemId: string): Promise<st
65
68
  // @beta @legacy
66
69
  export function getLocatorFromOdspUrl(url: URL, requireFluidSignature?: boolean): OdspFluidDataStoreLocator | undefined;
67
70
 
68
- // @beta @legacy
69
- export function getOdspPointInTimeDocumentServiceFactory(getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>, getWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined, persistedCache?: IPersistedCache, hostPolicy?: HostStoragePolicy): IPointInTimeDocumentServiceFactory;
70
-
71
71
  // @beta @legacy (undocumented)
72
72
  export interface ICacheAndTracker {
73
73
  // (undocumented)
@@ -91,6 +91,26 @@ export interface IOdspCache extends INonPersistentCache {
91
91
  readonly persistedCache: IPersistedFileCache;
92
92
  }
93
93
 
94
+ // @beta @legacy
95
+ export interface IOdspDocumentServiceFactoryOptions {
96
+ readonly getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>;
97
+ readonly getWebsocketToken: TokenFetcher<OdspResourceTokenFetchOptions> | undefined;
98
+ readonly hostPolicy?: HostStoragePolicy | undefined;
99
+ readonly persistedCache?: IPersistedCache | undefined;
100
+ readonly pointInTimeDocumentServiceImplementation?: OdspPointInTimeDocumentServiceImplementation | undefined;
101
+ }
102
+
103
+ // @beta @legacy
104
+ export interface IOdspPointInTimeDocumentServiceImplementationProps {
105
+ readonly clientIsSummarizer?: boolean;
106
+ readonly createDocumentService: (resolvedUrl: IResolvedUrl, logger: ITelemetryBaseLogger, cacheAndTracker: ICacheAndTracker, clientIsSummarizer?: boolean) => Promise<IDocumentService>;
107
+ readonly getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>;
108
+ readonly logger?: ITelemetryBaseLogger;
109
+ readonly persistedCache: IPersistedCache;
110
+ readonly resolvedUrl: IResolvedUrl;
111
+ readonly targetSequenceNumber: number;
112
+ }
113
+
94
114
  // @beta @legacy (undocumented)
95
115
  export interface IOdspResponse<T> {
96
116
  // (undocumented)
@@ -164,8 +184,10 @@ export class OdspDocumentServiceFactoryCore implements IDocumentServiceFactory,
164
184
  createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
165
185
  // (undocumented)
166
186
  protected createDocumentServiceCore(resolvedUrl: IResolvedUrl, odspLogger: ITelemetryBaseLogger, cacheAndTrackerArg?: ICacheAndTracker, clientIsSummarizer?: boolean): Promise<IDocumentService>;
187
+ readonly createPointInTimeDocumentService?: IPointInTimeDocumentServiceFactory["createPointInTimeDocumentService"];
167
188
  getRelayServiceSessionInfo(resolvedUrl: IResolvedUrl): Promise<ISocketStorageDiscovery | undefined>;
168
189
  readonly ILayerCompatDetails?: unknown;
190
+ readonly ILayerCompatSupportRequirements?: unknown;
169
191
  // (undocumented)
170
192
  get IRelaySessionAwareDriverFactory(): this;
171
193
  // (undocumented)
@@ -205,6 +227,9 @@ export interface OdspFluidDataStoreLocator extends IOdspUrlParts {
205
227
  fileVersion?: string | undefined;
206
228
  }
207
229
 
230
+ // @beta @legacy
231
+ export type OdspPointInTimeDocumentServiceImplementation = (props: IOdspPointInTimeDocumentServiceImplementationProps) => Promise<IDocumentService>;
232
+
208
233
  // @beta @legacy
209
234
  export function prefetchLatestSnapshot(resolvedUrl: IResolvedUrl, getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>, persistedCache: IPersistedCache, _forceAccessTokenViaAuthorizationHeader: boolean, logger: ITelemetryBaseLogger, hostSnapshotFetchOptions: ISnapshotOptions | undefined, enableRedeemFallback?: boolean, _fetchBinarySnapshotFormat?: boolean, _snapshotFormatFetchType?: SnapshotFormatSupportType, odspDocumentServiceFactory?: OdspDocumentServiceFactory): Promise<boolean>;
210
235
 
@@ -0,0 +1,117 @@
1
+ ## Beta API Report File for "@fluidframework/odsp-driver"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // @beta @legacy
8
+ export function createPointInTimeDocumentService(props: IOdspPointInTimeDocumentServiceImplementationProps): Promise<IDocumentService>;
9
+
10
+ // @beta @legacy
11
+ export class EpochTracker implements IPersistedFileCache {
12
+ constructor(cache: IPersistedCache, fileEntry: IFileEntry, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean | undefined);
13
+ // (undocumented)
14
+ protected readonly cache: IPersistedCache;
15
+ // (undocumented)
16
+ protected readonly clientIsSummarizer?: boolean | undefined;
17
+ fetch(url: string, fetchOptions: RequestInit, fetchType: FetchType, addInBody?: boolean, fetchReason?: string): Promise<IOdspResponse<Response>>;
18
+ fetchAndParseAsJSON<T>(url: string, fetchOptions: RequestInit, fetchType: FetchType, addInBody?: boolean, fetchReason?: string): Promise<IOdspResponse<T>>;
19
+ fetchArray(url: string, fetchOptions: {
20
+ [index: string]: RequestInit;
21
+ }, fetchType: FetchType, addInBody?: boolean, fetchReason?: string): Promise<IOdspResponse<ArrayBuffer>>;
22
+ // (undocumented)
23
+ protected readonly fileEntry: IFileEntry;
24
+ // (undocumented)
25
+ get fluidEpoch(): string | undefined;
26
+ // (undocumented)
27
+ get(entry: IEntry): Promise<any>;
28
+ // (undocumented)
29
+ protected readonly logger: ITelemetryLoggerExt;
30
+ // (undocumented)
31
+ put(entry: IEntry, value: any): Promise<void>;
32
+ // (undocumented)
33
+ readonly rateLimiter: RateLimiter;
34
+ // (undocumented)
35
+ removeEntries(): Promise<void>;
36
+ // (undocumented)
37
+ setEpoch(epoch: string, fromCache: boolean, fetchType: FetchTypeInternal): void;
38
+ // (undocumented)
39
+ validateEpoch(epoch: string | undefined, fetchType: FetchType): Promise<void>;
40
+ // (undocumented)
41
+ protected validateEpochFromResponse(epochFromResponse: string | undefined, fetchType: FetchTypeInternal, fromCache?: boolean): void;
42
+ }
43
+
44
+ // @beta @legacy (undocumented)
45
+ export type FetchType = "blob" | "createBlob" | "createFile" | "joinSession" | "ops" | "test" | "snapshotTree" | "treesLatest" | "uploadSummary" | "push" | "versions" | "renameFile";
46
+
47
+ // @beta @legacy (undocumented)
48
+ export type FetchTypeInternal = FetchType | "cache";
49
+
50
+ // @beta @legacy (undocumented)
51
+ export interface ICacheAndTracker {
52
+ // (undocumented)
53
+ cache: IOdspCache;
54
+ // (undocumented)
55
+ epochTracker: EpochTracker;
56
+ }
57
+
58
+ // @beta @legacy
59
+ export interface INonPersistentCache {
60
+ readonly fileUrlCache: PromiseCache<string, IOdspResolvedUrl>;
61
+ readonly sessionJoinCache: PromiseCache<string, {
62
+ entryTime: number;
63
+ joinSessionResponse: ISocketStorageDiscovery;
64
+ }>;
65
+ readonly snapshotPrefetchResultCache: PromiseCache<string, IPrefetchSnapshotContents>;
66
+ }
67
+
68
+ // @beta @legacy
69
+ export interface IOdspCache extends INonPersistentCache {
70
+ readonly persistedCache: IPersistedFileCache;
71
+ }
72
+
73
+ // @beta @legacy
74
+ export interface IOdspPointInTimeDocumentServiceImplementationProps {
75
+ readonly clientIsSummarizer?: boolean;
76
+ readonly createDocumentService: (resolvedUrl: IResolvedUrl, logger: ITelemetryBaseLogger, cacheAndTracker: ICacheAndTracker, clientIsSummarizer?: boolean) => Promise<IDocumentService>;
77
+ readonly getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>;
78
+ readonly logger?: ITelemetryBaseLogger;
79
+ readonly persistedCache: IPersistedCache;
80
+ readonly resolvedUrl: IResolvedUrl;
81
+ readonly targetSequenceNumber: number;
82
+ }
83
+
84
+ // @beta @legacy (undocumented)
85
+ export interface IOdspResponse<T> {
86
+ // (undocumented)
87
+ content: T;
88
+ // (undocumented)
89
+ duration: number;
90
+ // (undocumented)
91
+ headers: Map<string, string>;
92
+ // (undocumented)
93
+ propsToLog: ITelemetryBaseProperties;
94
+ }
95
+
96
+ // @beta @legacy
97
+ export interface IPersistedFileCache {
98
+ // (undocumented)
99
+ get(entry: IEntry): Promise<any>;
100
+ // (undocumented)
101
+ put(entry: IEntry, value: any): Promise<void>;
102
+ // (undocumented)
103
+ removeEntries(): Promise<void>;
104
+ }
105
+
106
+ // @beta @legacy (undocumented)
107
+ export interface IPrefetchSnapshotContents extends ISnapshot {
108
+ // (undocumented)
109
+ fluidEpoch: string;
110
+ // (undocumented)
111
+ prefetchStartTime: number;
112
+ }
113
+
114
+ // @beta @legacy
115
+ export type OdspPointInTimeDocumentServiceImplementation = (props: IOdspPointInTimeDocumentServiceImplementationProps) => Promise<IDocumentService>;
116
+
117
+ ```
@@ -11,12 +11,13 @@ const internal_1 = require("@fluidframework/core-utils/internal");
11
11
  * Used by tree code to reconstruct a tree from binary representation.
12
12
  */
13
13
  class ReadBuffer {
14
+ data;
15
+ index = 0;
14
16
  get buffer() {
15
17
  return this.data;
16
18
  }
17
19
  constructor(data) {
18
20
  this.data = data;
19
- this.index = 0;
20
21
  // BlobShallowCopy will return to users parts of this array.
21
22
  // We need to ensure that nobody can change it, as it will have
22
23
  // catastrophic result and will be really hard to investigate.
@@ -1 +1 @@
1
- {"version":3,"file":"ReadBufferUtils.js","sourceRoot":"","sources":["../src/ReadBufferUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D;;;GAGG;AACH,MAAa,UAAU;IAGtB,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,YAA+B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;QANrC,UAAK,GAAG,CAAC,CAAC;QAOnB,4DAA4D;QAC5D,+DAA+D;QAC/D,8DAA8D;QAC9D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,IAAW,GAAG;QACb,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACxC,CAAC;IACD,IAAW,GAAG;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IACD,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,KAAa,EAAE,GAAW;QACtC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;IAEM,KAAK;QACX,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAChB,CAAC;IAEM,IAAI,CAAC,SAAS,GAAG,CAAC;QACxB,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,MAAM,GAAG,SAAS,CAAC;QACvB,OAAO,MAAM,GAAG,CAAC,EAAE,CAAC;YACnB,IAAA,iBAAM,EAAC,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;YAC1D,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC;YAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,UAAU,IAAI,GAAG,CAAC;YAClB,MAAM,EAAE,CAAC;QACV,CAAC;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;IAEM,IAAI,CAAC,MAAc;QACzB,IAAA,iBAAM,EAAC,MAAM,IAAI,CAAC,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAClE,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC;QACrB,IAAA,iBAAM,EAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAClF,CAAC;CACD;AAnDD,gCAmDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\n/**\n * Buffer class, used to sequentially read data.\n * Used by tree code to reconstruct a tree from binary representation.\n */\nexport class ReadBuffer {\n\tprotected index = 0;\n\n\tpublic get buffer(): Uint8Array {\n\t\treturn this.data;\n\t}\n\n\tconstructor(protected readonly data: Uint8Array) {\n\t\t// BlobShallowCopy will return to users parts of this array.\n\t\t// We need to ensure that nobody can change it, as it will have\n\t\t// catastrophic result and will be really hard to investigate.\n\t\tObject.freeze(data.buffer);\n\t}\n\n\tpublic get eof(): boolean {\n\t\treturn this.index === this.data.length;\n\t}\n\tpublic get pos(): number {\n\t\treturn this.index;\n\t}\n\tpublic get length(): number {\n\t\treturn this.data.length;\n\t}\n\n\tpublic slice(start: number, end: number): Uint8Array {\n\t\treturn this.data.slice(start, end);\n\t}\n\n\tpublic reset(): void {\n\t\tthis.index = 0;\n\t}\n\n\tpublic read(lengthArg = 1): number {\n\t\tlet res = 0;\n\t\tlet multiplier = 1;\n\t\tlet length = lengthArg;\n\t\twhile (length > 0) {\n\t\t\tassert(!this.eof, 0x223 /* \"unexpected end of buffer\" */);\n\t\t\tres += this.data[this.index] * multiplier;\n\t\t\tthis.index++;\n\t\t\tmultiplier *= 256;\n\t\t\tlength--;\n\t\t}\n\t\treturn res;\n\t}\n\n\tpublic skip(length: number): void {\n\t\tassert(length >= 0, 0x224 /* \"Skip length should be positive\" */);\n\t\tthis.index += length;\n\t\tassert(this.index <= this.data.length, 0x3dc /* skipping past size of buffer */);\n\t}\n}\n"]}
1
+ {"version":3,"file":"ReadBufferUtils.js","sourceRoot":"","sources":["../src/ReadBufferUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D;;;GAGG;AACH,MAAa,UAAU;IAOS;IANrB,KAAK,GAAG,CAAC,CAAC;IAEpB,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,YAA+B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;QAC9C,4DAA4D;QAC5D,+DAA+D;QAC/D,8DAA8D;QAC9D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,IAAW,GAAG;QACb,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACxC,CAAC;IACD,IAAW,GAAG;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IACD,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,KAAa,EAAE,GAAW;QACtC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;IAEM,KAAK;QACX,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAChB,CAAC;IAEM,IAAI,CAAC,SAAS,GAAG,CAAC;QACxB,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,MAAM,GAAG,SAAS,CAAC;QACvB,OAAO,MAAM,GAAG,CAAC,EAAE,CAAC;YACnB,IAAA,iBAAM,EAAC,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;YAC1D,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC;YAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,UAAU,IAAI,GAAG,CAAC;YAClB,MAAM,EAAE,CAAC;QACV,CAAC;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;IAEM,IAAI,CAAC,MAAc;QACzB,IAAA,iBAAM,EAAC,MAAM,IAAI,CAAC,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAClE,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC;QACrB,IAAA,iBAAM,EAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAClF,CAAC;CACD;AAnDD,gCAmDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\n/**\n * Buffer class, used to sequentially read data.\n * Used by tree code to reconstruct a tree from binary representation.\n */\nexport class ReadBuffer {\n\tprotected index = 0;\n\n\tpublic get buffer(): Uint8Array {\n\t\treturn this.data;\n\t}\n\n\tconstructor(protected readonly data: Uint8Array) {\n\t\t// BlobShallowCopy will return to users parts of this array.\n\t\t// We need to ensure that nobody can change it, as it will have\n\t\t// catastrophic result and will be really hard to investigate.\n\t\tObject.freeze(data.buffer);\n\t}\n\n\tpublic get eof(): boolean {\n\t\treturn this.index === this.data.length;\n\t}\n\tpublic get pos(): number {\n\t\treturn this.index;\n\t}\n\tpublic get length(): number {\n\t\treturn this.data.length;\n\t}\n\n\tpublic slice(start: number, end: number): Uint8Array {\n\t\treturn this.data.slice(start, end);\n\t}\n\n\tpublic reset(): void {\n\t\tthis.index = 0;\n\t}\n\n\tpublic read(lengthArg = 1): number {\n\t\tlet res = 0;\n\t\tlet multiplier = 1;\n\t\tlet length = lengthArg;\n\t\twhile (length > 0) {\n\t\t\tassert(!this.eof, 0x223 /* \"unexpected end of buffer\" */);\n\t\t\tres += this.data[this.index] * multiplier;\n\t\t\tthis.index++;\n\t\t\tmultiplier *= 256;\n\t\t\tlength--;\n\t\t}\n\t\treturn res;\n\t}\n\n\tpublic skip(length: number): void {\n\t\tassert(length >= 0, 0x224 /* \"Skip length should be positive\" */);\n\t\tthis.index += length;\n\t\tassert(this.index <= this.data.length, 0x3dc /* skipping past size of buffer */);\n\t}\n}\n"]}
@@ -4,7 +4,8 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.TreeBuilderSerializer = exports.calcLength = exports.WriteBuffer = void 0;
7
+ exports.TreeBuilderSerializer = exports.WriteBuffer = void 0;
8
+ exports.calcLength = calcLength;
8
9
  const client_utils_1 = require("@fluid-internal/client-utils");
9
10
  const internal_1 = require("@fluidframework/core-utils/internal");
10
11
  const zipItDataRepresentationUtils_js_1 = require("./zipItDataRepresentationUtils.js");
@@ -13,10 +14,8 @@ const zipItDataRepresentationUtils_js_1 = require("./zipItDataRepresentationUtil
13
14
  * Used by tree code to serialize tree into binary representation.
14
15
  */
15
16
  class WriteBuffer {
16
- constructor() {
17
- this.data = new Uint8Array(4096);
18
- this.index = 0;
19
- }
17
+ data = new Uint8Array(4096);
18
+ index = 0;
20
19
  push(code) {
21
20
  (0, internal_1.assert)(this.data !== undefined, 0x225 /* "Data should be there" */);
22
21
  const length = this.data.length;
@@ -123,7 +122,6 @@ function calcLength(numArg) {
123
122
  }
124
123
  return res;
125
124
  }
126
- exports.calcLength = calcLength;
127
125
  /**
128
126
  * Implementation of serialization of blobs in buffer with Marker Codes etc.
129
127
  * @param buffer - Buffer to serialize to.