@fluidframework/odsp-driver 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-dev-rc.2.0.0.245554

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 (623) hide show
  1. package/.eslintrc.cjs +33 -0
  2. package/{.mocharc.js → .mocharc.cjs} +1 -1
  3. package/CHANGELOG.md +44 -0
  4. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  5. package/api-extractor-lint.json +1 -1
  6. package/api-extractor.json +1 -1
  7. package/api-report/odsp-driver.api.md +16 -17
  8. package/dist/ReadBufferUtils.d.ts.map +1 -1
  9. package/dist/ReadBufferUtils.js.map +1 -1
  10. package/dist/WriteBufferUtils.d.ts +1 -1
  11. package/dist/WriteBufferUtils.d.ts.map +1 -1
  12. package/dist/WriteBufferUtils.js +12 -12
  13. package/dist/WriteBufferUtils.js.map +1 -1
  14. package/dist/checkUrl.d.ts.map +1 -1
  15. package/dist/checkUrl.js +5 -3
  16. package/dist/checkUrl.js.map +1 -1
  17. package/dist/compactSnapshotParser.d.ts +2 -2
  18. package/dist/compactSnapshotParser.d.ts.map +1 -1
  19. package/dist/compactSnapshotParser.js +94 -75
  20. package/dist/compactSnapshotParser.js.map +1 -1
  21. package/dist/compactSnapshotWriter.d.ts +2 -2
  22. package/dist/compactSnapshotWriter.d.ts.map +1 -1
  23. package/dist/compactSnapshotWriter.js +26 -20
  24. package/dist/compactSnapshotWriter.js.map +1 -1
  25. package/dist/contracts.d.ts +24 -4
  26. package/dist/contracts.d.ts.map +1 -1
  27. package/dist/contracts.js +5 -1
  28. package/dist/contracts.js.map +1 -1
  29. package/dist/createFile.d.ts +4 -4
  30. package/dist/createFile.d.ts.map +1 -1
  31. package/dist/createFile.js +36 -52
  32. package/dist/createFile.js.map +1 -1
  33. package/dist/createNewContainerOnExistingFile.d.ts +2 -2
  34. package/dist/createNewContainerOnExistingFile.d.ts.map +1 -1
  35. package/dist/createNewContainerOnExistingFile.js +14 -14
  36. package/dist/createNewContainerOnExistingFile.js.map +1 -1
  37. package/dist/createNewModule.d.ts +2 -2
  38. package/dist/createNewModule.d.ts.map +1 -1
  39. package/dist/createNewModule.js +4 -4
  40. package/dist/createNewModule.js.map +1 -1
  41. package/dist/createNewUtils.d.ts +4 -4
  42. package/dist/createNewUtils.d.ts.map +1 -1
  43. package/dist/createNewUtils.js +16 -11
  44. package/dist/createNewUtils.js.map +1 -1
  45. package/dist/createOdspCreateContainerRequest.d.ts +2 -2
  46. package/dist/createOdspCreateContainerRequest.d.ts.map +1 -1
  47. package/dist/createOdspCreateContainerRequest.js +2 -2
  48. package/dist/createOdspCreateContainerRequest.js.map +1 -1
  49. package/dist/createOdspUrl.d.ts +1 -1
  50. package/dist/createOdspUrl.d.ts.map +1 -1
  51. package/dist/createOdspUrl.js.map +1 -1
  52. package/dist/epochTracker.d.ts +10 -9
  53. package/dist/epochTracker.d.ts.map +1 -1
  54. package/dist/epochTracker.js +67 -45
  55. package/dist/epochTracker.js.map +1 -1
  56. package/dist/fetchSnapshot.d.ts +14 -11
  57. package/dist/fetchSnapshot.d.ts.map +1 -1
  58. package/dist/fetchSnapshot.js +91 -71
  59. package/dist/fetchSnapshot.js.map +1 -1
  60. package/dist/getFileLink.d.ts.map +1 -1
  61. package/dist/getFileLink.js +25 -18
  62. package/dist/getFileLink.js.map +1 -1
  63. package/dist/getQueryString.d.ts.map +1 -1
  64. package/dist/getQueryString.js +2 -0
  65. package/dist/getQueryString.js.map +1 -1
  66. package/dist/index.d.ts +19 -19
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +44 -44
  69. package/dist/index.js.map +1 -1
  70. package/dist/localOdspDriver/localOdspDocumentService.d.ts +4 -3
  71. package/dist/localOdspDriver/localOdspDocumentService.d.ts.map +1 -1
  72. package/dist/localOdspDriver/localOdspDocumentService.js +8 -6
  73. package/dist/localOdspDriver/localOdspDocumentService.js.map +1 -1
  74. package/dist/localOdspDriver/localOdspDocumentServiceFactory.d.ts +8 -6
  75. package/dist/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +1 -1
  76. package/dist/localOdspDriver/localOdspDocumentServiceFactory.js +10 -9
  77. package/dist/localOdspDriver/localOdspDocumentServiceFactory.js.map +1 -1
  78. package/dist/localOdspDriver/localOdspDocumentStorageManager.d.ts +3 -2
  79. package/dist/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +1 -1
  80. package/dist/localOdspDriver/localOdspDocumentStorageManager.js +9 -6
  81. package/dist/localOdspDriver/localOdspDocumentStorageManager.js.map +1 -1
  82. package/dist/odsp-driver-alpha.d.ts +31 -15
  83. package/dist/odsp-driver-beta.d.ts +4 -5
  84. package/dist/odsp-driver-public.d.ts +4 -5
  85. package/dist/odsp-driver-untrimmed.d.ts +34 -16
  86. package/dist/odspCache.d.ts +5 -5
  87. package/dist/odspCache.d.ts.map +1 -1
  88. package/dist/odspCache.js +1 -2
  89. package/dist/odspCache.js.map +1 -1
  90. package/dist/odspDelayLoadedDeltaStream.d.ts +12 -6
  91. package/dist/odspDelayLoadedDeltaStream.d.ts.map +1 -1
  92. package/dist/odspDelayLoadedDeltaStream.js +89 -25
  93. package/dist/odspDelayLoadedDeltaStream.js.map +1 -1
  94. package/dist/odspDeltaStorageService.d.ts +7 -7
  95. package/dist/odspDeltaStorageService.d.ts.map +1 -1
  96. package/dist/odspDeltaStorageService.js +5 -5
  97. package/dist/odspDeltaStorageService.js.map +1 -1
  98. package/dist/odspDocumentDeltaConnection.d.ts +1 -1
  99. package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
  100. package/dist/odspDocumentDeltaConnection.js +41 -23
  101. package/dist/odspDocumentDeltaConnection.js.map +1 -1
  102. package/dist/odspDocumentService.d.ts +9 -6
  103. package/dist/odspDocumentService.d.ts.map +1 -1
  104. package/dist/odspDocumentService.js +25 -19
  105. package/dist/odspDocumentService.js.map +1 -1
  106. package/dist/odspDocumentServiceFactory.d.ts +6 -1
  107. package/dist/odspDocumentServiceFactory.d.ts.map +1 -1
  108. package/dist/odspDocumentServiceFactory.js +9 -4
  109. package/dist/odspDocumentServiceFactory.js.map +1 -1
  110. package/dist/odspDocumentServiceFactoryCore.d.ts +4 -4
  111. package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
  112. package/dist/odspDocumentServiceFactoryCore.js +27 -30
  113. package/dist/odspDocumentServiceFactoryCore.js.map +1 -1
  114. package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts +1 -1
  115. package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -1
  116. package/dist/odspDocumentServiceFactoryWithCodeSplit.js +2 -2
  117. package/dist/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -1
  118. package/dist/odspDocumentStorageManager.d.ts +17 -10
  119. package/dist/odspDocumentStorageManager.d.ts.map +1 -1
  120. package/dist/odspDocumentStorageManager.js +226 -169
  121. package/dist/odspDocumentStorageManager.js.map +1 -1
  122. package/dist/odspDocumentStorageServiceBase.d.ts +4 -6
  123. package/dist/odspDocumentStorageServiceBase.d.ts.map +1 -1
  124. package/dist/odspDocumentStorageServiceBase.js +34 -31
  125. package/dist/odspDocumentStorageServiceBase.js.map +1 -1
  126. package/dist/odspDriverUrlResolver.d.ts +1 -1
  127. package/dist/odspDriverUrlResolver.d.ts.map +1 -1
  128. package/dist/odspDriverUrlResolver.js +26 -32
  129. package/dist/odspDriverUrlResolver.js.map +1 -1
  130. package/dist/odspDriverUrlResolverForShareLink.d.ts +13 -6
  131. package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
  132. package/dist/odspDriverUrlResolverForShareLink.js +47 -37
  133. package/dist/odspDriverUrlResolverForShareLink.js.map +1 -1
  134. package/dist/odspError.d.ts +1 -1
  135. package/dist/odspError.d.ts.map +1 -1
  136. package/dist/odspError.js +6 -6
  137. package/dist/odspError.js.map +1 -1
  138. package/dist/odspFluidFileLink.d.ts +1 -1
  139. package/dist/odspFluidFileLink.d.ts.map +1 -1
  140. package/dist/odspFluidFileLink.js +2 -2
  141. package/dist/odspFluidFileLink.js.map +1 -1
  142. package/dist/odspLocationRedirection.js +2 -2
  143. package/dist/odspLocationRedirection.js.map +1 -1
  144. package/dist/odspPublicUtils.d.ts +4 -0
  145. package/dist/odspPublicUtils.d.ts.map +1 -1
  146. package/dist/odspPublicUtils.js +3 -0
  147. package/dist/odspPublicUtils.js.map +1 -1
  148. package/dist/odspSnapshotParser.d.ts +3 -3
  149. package/dist/odspSnapshotParser.d.ts.map +1 -1
  150. package/dist/odspSnapshotParser.js +5 -3
  151. package/dist/odspSnapshotParser.js.map +1 -1
  152. package/dist/odspSummaryUploadManager.d.ts +1 -1
  153. package/dist/odspSummaryUploadManager.d.ts.map +1 -1
  154. package/dist/odspSummaryUploadManager.js +9 -6
  155. package/dist/odspSummaryUploadManager.js.map +1 -1
  156. package/dist/odspUrlHelper.d.ts.map +1 -1
  157. package/dist/odspUrlHelper.js +1 -2
  158. package/dist/odspUrlHelper.js.map +1 -1
  159. package/dist/odspUtils.d.ts +29 -13
  160. package/dist/odspUtils.d.ts.map +1 -1
  161. package/dist/odspUtils.js +75 -41
  162. package/dist/odspUtils.js.map +1 -1
  163. package/dist/opsCaching.d.ts +1 -1
  164. package/dist/opsCaching.d.ts.map +1 -1
  165. package/dist/opsCaching.js +2 -1
  166. package/dist/opsCaching.js.map +1 -1
  167. package/dist/package.json +3 -0
  168. package/dist/packageVersion.d.ts +1 -1
  169. package/dist/packageVersion.js +1 -1
  170. package/dist/packageVersion.js.map +1 -1
  171. package/dist/prefetchLatestSnapshot.d.ts +2 -2
  172. package/dist/prefetchLatestSnapshot.d.ts.map +1 -1
  173. package/dist/prefetchLatestSnapshot.js +17 -12
  174. package/dist/prefetchLatestSnapshot.js.map +1 -1
  175. package/dist/retryErrorsStorageAdapter.d.ts +2 -2
  176. package/dist/retryErrorsStorageAdapter.d.ts.map +1 -1
  177. package/dist/retryErrorsStorageAdapter.js +10 -5
  178. package/dist/retryErrorsStorageAdapter.js.map +1 -1
  179. package/dist/retryUtils.d.ts.map +1 -1
  180. package/dist/retryUtils.js +7 -3
  181. package/dist/retryUtils.js.map +1 -1
  182. package/dist/socketModule.d.ts.map +1 -1
  183. package/dist/socketModule.js +2 -0
  184. package/dist/socketModule.js.map +1 -1
  185. package/dist/tsdoc-metadata.json +1 -1
  186. package/dist/vroom.d.ts +2 -2
  187. package/dist/vroom.d.ts.map +1 -1
  188. package/dist/vroom.js +5 -5
  189. package/dist/vroom.js.map +1 -1
  190. package/dist/zipItDataRepresentationUtils.d.ts +1 -1
  191. package/dist/zipItDataRepresentationUtils.d.ts.map +1 -1
  192. package/dist/zipItDataRepresentationUtils.js +17 -13
  193. package/dist/zipItDataRepresentationUtils.js.map +1 -1
  194. package/lib/{ReadBufferUtils.d.mts → ReadBufferUtils.d.ts} +1 -1
  195. package/lib/ReadBufferUtils.d.ts.map +1 -0
  196. package/lib/{ReadBufferUtils.mjs → ReadBufferUtils.js} +1 -1
  197. package/lib/ReadBufferUtils.js.map +1 -0
  198. package/lib/{WriteBufferUtils.d.mts → WriteBufferUtils.d.ts} +2 -2
  199. package/lib/WriteBufferUtils.d.ts.map +1 -0
  200. package/lib/{WriteBufferUtils.mjs → WriteBufferUtils.js} +2 -2
  201. package/lib/WriteBufferUtils.js.map +1 -0
  202. package/lib/{checkUrl.d.mts → checkUrl.d.ts} +1 -1
  203. package/lib/checkUrl.d.ts.map +1 -0
  204. package/lib/{checkUrl.mjs → checkUrl.js} +5 -3
  205. package/lib/checkUrl.js.map +1 -0
  206. package/lib/{compactSnapshotParser.d.mts → compactSnapshotParser.d.ts} +3 -3
  207. package/lib/compactSnapshotParser.d.ts.map +1 -0
  208. package/lib/{compactSnapshotParser.mjs → compactSnapshotParser.js} +69 -50
  209. package/lib/compactSnapshotParser.js.map +1 -0
  210. package/lib/{compactSnapshotWriter.d.mts → compactSnapshotWriter.d.ts} +3 -3
  211. package/lib/compactSnapshotWriter.d.ts.map +1 -0
  212. package/lib/{compactSnapshotWriter.mjs → compactSnapshotWriter.js} +14 -8
  213. package/lib/compactSnapshotWriter.js.map +1 -0
  214. package/lib/{constants.d.mts → constants.d.ts} +1 -1
  215. package/lib/constants.d.ts.map +1 -0
  216. package/lib/{constants.mjs → constants.js} +1 -1
  217. package/lib/constants.js.map +1 -0
  218. package/lib/{contracts.d.mts → contracts.d.ts} +25 -5
  219. package/lib/contracts.d.ts.map +1 -0
  220. package/lib/contracts.js +10 -0
  221. package/lib/contracts.js.map +1 -0
  222. package/lib/{contractsPublic.d.mts → contractsPublic.d.ts} +1 -1
  223. package/lib/contractsPublic.d.ts.map +1 -0
  224. package/lib/{contractsPublic.mjs → contractsPublic.js} +1 -1
  225. package/lib/contractsPublic.js.map +1 -0
  226. package/lib/{createFile.d.mts → createFile.d.ts} +5 -5
  227. package/lib/createFile.d.ts.map +1 -0
  228. package/lib/{createFile.mjs → createFile.js} +25 -41
  229. package/lib/createFile.js.map +1 -0
  230. package/lib/{createNewContainerOnExistingFile.d.mts → createNewContainerOnExistingFile.d.ts} +3 -3
  231. package/lib/createNewContainerOnExistingFile.d.ts.map +1 -0
  232. package/lib/{createNewContainerOnExistingFile.mjs → createNewContainerOnExistingFile.js} +7 -7
  233. package/lib/createNewContainerOnExistingFile.js.map +1 -0
  234. package/lib/{createNewModule.mjs → createNewModule.d.ts} +3 -3
  235. package/lib/createNewModule.d.ts.map +1 -0
  236. package/lib/{createNewModule.d.mts → createNewModule.js} +3 -3
  237. package/lib/createNewModule.js.map +1 -0
  238. package/lib/{createNewUtils.d.mts → createNewUtils.d.ts} +5 -5
  239. package/lib/createNewUtils.d.ts.map +1 -0
  240. package/lib/{createNewUtils.mjs → createNewUtils.js} +13 -8
  241. package/lib/createNewUtils.js.map +1 -0
  242. package/lib/{createOdspCreateContainerRequest.d.mts → createOdspCreateContainerRequest.d.ts} +7 -3
  243. package/lib/createOdspCreateContainerRequest.d.ts.map +1 -0
  244. package/lib/{createOdspCreateContainerRequest.mjs → createOdspCreateContainerRequest.js} +2 -2
  245. package/lib/createOdspCreateContainerRequest.js.map +1 -0
  246. package/lib/{createOdspUrl.d.mts → createOdspUrl.d.ts} +2 -2
  247. package/lib/createOdspUrl.d.ts.map +1 -0
  248. package/lib/{createOdspUrl.mjs → createOdspUrl.js} +1 -1
  249. package/lib/createOdspUrl.js.map +1 -0
  250. package/lib/{epochTracker.d.mts → epochTracker.d.ts} +11 -10
  251. package/lib/epochTracker.d.ts.map +1 -0
  252. package/lib/{epochTracker.mjs → epochTracker.js} +58 -36
  253. package/lib/epochTracker.js.map +1 -0
  254. package/lib/{fetch.d.mts → fetch.d.ts} +1 -1
  255. package/lib/fetch.d.ts.map +1 -0
  256. package/lib/{fetch.mjs → fetch.js} +1 -1
  257. package/lib/fetch.js.map +1 -0
  258. package/lib/{fetchSnapshot.d.mts → fetchSnapshot.d.ts} +15 -12
  259. package/lib/fetchSnapshot.d.ts.map +1 -0
  260. package/lib/{fetchSnapshot.mjs → fetchSnapshot.js} +74 -54
  261. package/lib/fetchSnapshot.js.map +1 -0
  262. package/lib/{getFileLink.d.mts → getFileLink.d.ts} +1 -1
  263. package/lib/getFileLink.d.ts.map +1 -0
  264. package/lib/{getFileLink.mjs → getFileLink.js} +17 -10
  265. package/lib/getFileLink.js.map +1 -0
  266. package/lib/{getQueryString.d.mts → getQueryString.d.ts} +5 -1
  267. package/lib/getQueryString.d.ts.map +1 -0
  268. package/lib/{getQueryString.mjs → getQueryString.js} +3 -1
  269. package/lib/getQueryString.js.map +1 -0
  270. package/lib/{getUrlAndHeadersWithAuth.d.mts → getUrlAndHeadersWithAuth.d.ts} +1 -1
  271. package/lib/getUrlAndHeadersWithAuth.d.ts.map +1 -0
  272. package/lib/{getUrlAndHeadersWithAuth.mjs → getUrlAndHeadersWithAuth.js} +1 -1
  273. package/lib/getUrlAndHeadersWithAuth.js.map +1 -0
  274. package/lib/{index.d.mts → index.d.ts} +20 -20
  275. package/lib/index.d.ts.map +1 -0
  276. package/lib/index.js +29 -0
  277. package/lib/index.js.map +1 -0
  278. package/lib/localOdspDriver/{localOdspDeltaStorageService.d.mts → localOdspDeltaStorageService.d.ts} +1 -1
  279. package/lib/localOdspDriver/localOdspDeltaStorageService.d.ts.map +1 -0
  280. package/lib/localOdspDriver/{localOdspDeltaStorageService.mjs → localOdspDeltaStorageService.js} +1 -1
  281. package/lib/localOdspDriver/localOdspDeltaStorageService.js.map +1 -0
  282. package/lib/localOdspDriver/{localOdspDocumentService.d.mts → localOdspDocumentService.d.ts} +5 -4
  283. package/lib/localOdspDriver/localOdspDocumentService.d.ts.map +1 -0
  284. package/lib/localOdspDriver/{localOdspDocumentService.mjs → localOdspDocumentService.js} +7 -5
  285. package/lib/localOdspDriver/localOdspDocumentService.js.map +1 -0
  286. package/lib/localOdspDriver/{localOdspDocumentServiceFactory.d.mts → localOdspDocumentServiceFactory.d.ts} +9 -7
  287. package/lib/localOdspDriver/localOdspDocumentServiceFactory.d.ts.map +1 -0
  288. package/lib/localOdspDriver/{localOdspDocumentServiceFactory.mjs → localOdspDocumentServiceFactory.js} +9 -8
  289. package/lib/localOdspDriver/localOdspDocumentServiceFactory.js.map +1 -0
  290. package/lib/localOdspDriver/{localOdspDocumentStorageManager.d.mts → localOdspDocumentStorageManager.d.ts} +4 -3
  291. package/lib/localOdspDriver/localOdspDocumentStorageManager.d.ts.map +1 -0
  292. package/lib/localOdspDriver/{localOdspDocumentStorageManager.mjs → localOdspDocumentStorageManager.js} +7 -4
  293. package/lib/localOdspDriver/localOdspDocumentStorageManager.js.map +1 -0
  294. package/lib/{odsp-driver-alpha.d.mts → odsp-driver-alpha.d.ts} +31 -15
  295. package/lib/{odsp-driver-beta.d.mts → odsp-driver-beta.d.ts} +4 -5
  296. package/lib/{odsp-driver-public.d.mts → odsp-driver-public.d.ts} +4 -5
  297. package/lib/{odsp-driver-untrimmed.d.mts → odsp-driver-untrimmed.d.ts} +34 -16
  298. package/lib/{odspCache.d.mts → odspCache.d.ts} +10 -6
  299. package/lib/odspCache.d.ts.map +1 -0
  300. package/lib/{odspCache.mjs → odspCache.js} +6 -3
  301. package/lib/odspCache.js.map +1 -0
  302. package/lib/{odspDelayLoadedDeltaStream.d.mts → odspDelayLoadedDeltaStream.d.ts} +13 -7
  303. package/lib/odspDelayLoadedDeltaStream.d.ts.map +1 -0
  304. package/lib/{odspDelayLoadedDeltaStream.mjs → odspDelayLoadedDeltaStream.js} +84 -20
  305. package/lib/odspDelayLoadedDeltaStream.js.map +1 -0
  306. package/lib/{odspDeltaStorageService.d.mts → odspDeltaStorageService.d.ts} +8 -8
  307. package/lib/odspDeltaStorageService.d.ts.map +1 -0
  308. package/lib/{odspDeltaStorageService.mjs → odspDeltaStorageService.js} +5 -5
  309. package/lib/odspDeltaStorageService.js.map +1 -0
  310. package/lib/{odspDocumentDeltaConnection.d.mts → odspDocumentDeltaConnection.d.ts} +2 -2
  311. package/lib/odspDocumentDeltaConnection.d.ts.map +1 -0
  312. package/lib/{odspDocumentDeltaConnection.mjs → odspDocumentDeltaConnection.js} +34 -16
  313. package/lib/odspDocumentDeltaConnection.js.map +1 -0
  314. package/lib/{odspDocumentService.d.mts → odspDocumentService.d.ts} +10 -7
  315. package/lib/odspDocumentService.d.ts.map +1 -0
  316. package/lib/{odspDocumentService.mjs → odspDocumentService.js} +22 -14
  317. package/lib/odspDocumentService.js.map +1 -0
  318. package/lib/{odspDocumentServiceFactory.d.mts → odspDocumentServiceFactory.d.ts} +7 -2
  319. package/lib/odspDocumentServiceFactory.d.ts.map +1 -0
  320. package/lib/{odspDocumentServiceFactory.mjs → odspDocumentServiceFactory.js} +9 -3
  321. package/lib/odspDocumentServiceFactory.js.map +1 -0
  322. package/lib/{odspDocumentServiceFactoryCore.d.mts → odspDocumentServiceFactoryCore.d.ts} +5 -5
  323. package/lib/odspDocumentServiceFactoryCore.d.ts.map +1 -0
  324. package/lib/{odspDocumentServiceFactoryCore.mjs → odspDocumentServiceFactoryCore.js} +25 -26
  325. package/lib/odspDocumentServiceFactoryCore.js.map +1 -0
  326. package/lib/{odspDocumentServiceFactoryWithCodeSplit.d.mts → odspDocumentServiceFactoryWithCodeSplit.d.ts} +2 -2
  327. package/lib/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -0
  328. package/lib/{odspDocumentServiceFactoryWithCodeSplit.mjs → odspDocumentServiceFactoryWithCodeSplit.js} +2 -2
  329. package/lib/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -0
  330. package/lib/{odspDocumentStorageManager.d.mts → odspDocumentStorageManager.d.ts} +18 -11
  331. package/lib/odspDocumentStorageManager.d.ts.map +1 -0
  332. package/lib/{odspDocumentStorageManager.mjs → odspDocumentStorageManager.js} +221 -162
  333. package/lib/odspDocumentStorageManager.js.map +1 -0
  334. package/lib/{odspDocumentStorageServiceBase.d.mts → odspDocumentStorageServiceBase.d.ts} +5 -7
  335. package/lib/odspDocumentStorageServiceBase.d.ts.map +1 -0
  336. package/lib/{odspDocumentStorageServiceBase.mjs → odspDocumentStorageServiceBase.js} +34 -31
  337. package/lib/odspDocumentStorageServiceBase.js.map +1 -0
  338. package/lib/{odspDriverUrlResolver.d.mts → odspDriverUrlResolver.d.ts} +2 -2
  339. package/lib/odspDriverUrlResolver.d.ts.map +1 -0
  340. package/lib/{odspDriverUrlResolver.mjs → odspDriverUrlResolver.js} +27 -29
  341. package/lib/odspDriverUrlResolver.js.map +1 -0
  342. package/lib/{odspDriverUrlResolverForShareLink.d.mts → odspDriverUrlResolverForShareLink.d.ts} +14 -7
  343. package/lib/odspDriverUrlResolverForShareLink.d.ts.map +1 -0
  344. package/lib/{odspDriverUrlResolverForShareLink.mjs → odspDriverUrlResolverForShareLink.js} +41 -27
  345. package/lib/odspDriverUrlResolverForShareLink.js.map +1 -0
  346. package/lib/{odspError.d.mts → odspError.d.ts} +2 -2
  347. package/lib/odspError.d.ts.map +1 -0
  348. package/lib/{odspError.mjs → odspError.js} +6 -6
  349. package/lib/odspError.js.map +1 -0
  350. package/lib/{odspFluidFileLink.d.mts → odspFluidFileLink.d.ts} +2 -2
  351. package/lib/odspFluidFileLink.d.ts.map +1 -0
  352. package/lib/{odspFluidFileLink.mjs → odspFluidFileLink.js} +2 -2
  353. package/lib/odspFluidFileLink.js.map +1 -0
  354. package/lib/{odspLocationRedirection.d.mts → odspLocationRedirection.d.ts} +1 -1
  355. package/lib/odspLocationRedirection.d.ts.map +1 -0
  356. package/lib/{odspLocationRedirection.mjs → odspLocationRedirection.js} +2 -2
  357. package/lib/odspLocationRedirection.js.map +1 -0
  358. package/lib/{odspPublicUtils.d.mts → odspPublicUtils.d.ts} +5 -1
  359. package/lib/odspPublicUtils.d.ts.map +1 -0
  360. package/lib/{odspPublicUtils.mjs → odspPublicUtils.js} +4 -1
  361. package/lib/odspPublicUtils.js.map +1 -0
  362. package/lib/{odspSnapshotParser.d.mts → odspSnapshotParser.d.ts} +4 -4
  363. package/lib/odspSnapshotParser.d.ts.map +1 -0
  364. package/lib/{odspSnapshotParser.mjs → odspSnapshotParser.js} +6 -4
  365. package/lib/odspSnapshotParser.js.map +1 -0
  366. package/lib/{odspSummaryUploadManager.d.mts → odspSummaryUploadManager.d.ts} +2 -2
  367. package/lib/odspSummaryUploadManager.d.ts.map +1 -0
  368. package/lib/{odspSummaryUploadManager.mjs → odspSummaryUploadManager.js} +8 -5
  369. package/lib/odspSummaryUploadManager.js.map +1 -0
  370. package/lib/{odspUrlHelper.d.mts → odspUrlHelper.d.ts} +1 -1
  371. package/lib/odspUrlHelper.d.ts.map +1 -0
  372. package/lib/{odspUrlHelper.mjs → odspUrlHelper.js} +2 -3
  373. package/lib/odspUrlHelper.js.map +1 -0
  374. package/lib/{odspUtils.d.mts → odspUtils.d.ts} +30 -14
  375. package/lib/odspUtils.d.ts.map +1 -0
  376. package/lib/{odspUtils.mjs → odspUtils.js} +61 -30
  377. package/lib/odspUtils.js.map +1 -0
  378. package/lib/{opsCaching.d.mts → opsCaching.d.ts} +2 -2
  379. package/lib/opsCaching.d.ts.map +1 -0
  380. package/lib/{opsCaching.mjs → opsCaching.js} +3 -2
  381. package/lib/opsCaching.js.map +1 -0
  382. package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
  383. package/lib/packageVersion.d.ts.map +1 -0
  384. package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
  385. package/lib/packageVersion.js.map +1 -0
  386. package/lib/{prefetchLatestSnapshot.d.mts → prefetchLatestSnapshot.d.ts} +3 -3
  387. package/lib/prefetchLatestSnapshot.d.ts.map +1 -0
  388. package/lib/{prefetchLatestSnapshot.mjs → prefetchLatestSnapshot.js} +16 -11
  389. package/lib/prefetchLatestSnapshot.js.map +1 -0
  390. package/lib/{retryErrorsStorageAdapter.d.mts → retryErrorsStorageAdapter.d.ts} +3 -3
  391. package/lib/retryErrorsStorageAdapter.d.ts.map +1 -0
  392. package/lib/{retryErrorsStorageAdapter.mjs → retryErrorsStorageAdapter.js} +11 -6
  393. package/lib/retryErrorsStorageAdapter.js.map +1 -0
  394. package/lib/{retryUtils.d.mts → retryUtils.d.ts} +1 -1
  395. package/lib/retryUtils.d.ts.map +1 -0
  396. package/lib/{retryUtils.mjs → retryUtils.js} +8 -4
  397. package/lib/retryUtils.js.map +1 -0
  398. package/lib/{socketModule.d.mts → socketModule.d.ts} +1 -1
  399. package/lib/socketModule.d.ts.map +1 -0
  400. package/lib/{socketModule.mjs → socketModule.js} +3 -1
  401. package/lib/socketModule.js.map +1 -0
  402. package/lib/test/buildOdspShareLinkReqParams.spec.js +25 -0
  403. package/lib/test/buildOdspShareLinkReqParams.spec.js.map +1 -0
  404. package/lib/test/createNewUtilsTests.spec.js +221 -0
  405. package/lib/test/createNewUtilsTests.spec.js.map +1 -0
  406. package/lib/test/deltaStorageService.spec.js +176 -0
  407. package/lib/test/deltaStorageService.spec.js.map +1 -0
  408. package/lib/test/epochTests.spec.js +340 -0
  409. package/lib/test/epochTests.spec.js.map +1 -0
  410. package/lib/test/epochTestsWithRedemption.spec.js +119 -0
  411. package/lib/test/epochTestsWithRedemption.spec.js.map +1 -0
  412. package/lib/test/fetchSnapshot.spec.js +412 -0
  413. package/lib/test/fetchSnapshot.spec.js.map +1 -0
  414. package/lib/test/getFileLink.spec.js +62 -0
  415. package/lib/test/getFileLink.spec.js.map +1 -0
  416. package/lib/test/getUrlAndHeadersWithAuth.spec.js +66 -0
  417. package/lib/test/getUrlAndHeadersWithAuth.spec.js.map +1 -0
  418. package/lib/test/getVersions.spec.js +284 -0
  419. package/lib/test/getVersions.spec.js.map +1 -0
  420. package/lib/test/joinSessionCacheTests.spec.js +53 -0
  421. package/lib/test/joinSessionCacheTests.spec.js.map +1 -0
  422. package/lib/test/joinSessionPeriodicCall.spec.js +158 -0
  423. package/lib/test/joinSessionPeriodicCall.spec.js.map +1 -0
  424. package/lib/test/jsonSnapshotFormatTests.spec.js +107 -0
  425. package/lib/test/jsonSnapshotFormatTests.spec.js.map +1 -0
  426. package/lib/test/localOdspDriver.spec.js +177 -0
  427. package/lib/test/localOdspDriver.spec.js.map +1 -0
  428. package/lib/test/mockFetch.js +61 -0
  429. package/lib/test/mockFetch.js.map +1 -0
  430. package/lib/test/odspCreateContainer.spec.js +116 -0
  431. package/lib/test/odspCreateContainer.spec.js.map +1 -0
  432. package/lib/test/odspDriverResolverTest.spec.js +289 -0
  433. package/lib/test/odspDriverResolverTest.spec.js.map +1 -0
  434. package/lib/test/odspDriverUrlResolverForShareLink.spec.js +287 -0
  435. package/lib/test/odspDriverUrlResolverForShareLink.spec.js.map +1 -0
  436. package/lib/test/odspError.spec.js +299 -0
  437. package/lib/test/odspError.spec.js.map +1 -0
  438. package/lib/test/opsCaching.spec.js +357 -0
  439. package/lib/test/opsCaching.spec.js.map +1 -0
  440. package/lib/test/prefetchSnapshotTests.spec.js +420 -0
  441. package/lib/test/prefetchSnapshotTests.spec.js.map +1 -0
  442. package/lib/test/snapshotFormatTests.spec.js +218 -0
  443. package/lib/test/snapshotFormatTests.spec.js.map +1 -0
  444. package/lib/test/socketTests/deltaConnectionUpdateTests.spec.js +152 -0
  445. package/lib/test/socketTests/deltaConnectionUpdateTests.spec.js.map +1 -0
  446. package/lib/test/socketTests/socketMock.js +109 -0
  447. package/lib/test/socketTests/socketMock.js.map +1 -0
  448. package/lib/test/socketTests/socketTests.spec.js +256 -0
  449. package/lib/test/socketTests/socketTests.spec.js.map +1 -0
  450. package/lib/test/tokenFetch.spec.js +39 -0
  451. package/lib/test/tokenFetch.spec.js.map +1 -0
  452. package/lib/test/types/validateOdspDriverPrevious.generated.js +96 -0
  453. package/lib/test/types/validateOdspDriverPrevious.generated.js.map +1 -0
  454. package/lib/test/zipItDataRepresentationTests.spec.js +207 -0
  455. package/lib/test/zipItDataRepresentationTests.spec.js.map +1 -0
  456. package/lib/{vroom.d.mts → vroom.d.ts} +3 -3
  457. package/lib/vroom.d.ts.map +1 -0
  458. package/lib/{vroom.mjs → vroom.js} +4 -4
  459. package/lib/vroom.js.map +1 -0
  460. package/lib/{zipItDataRepresentationUtils.d.mts → zipItDataRepresentationUtils.d.ts} +2 -2
  461. package/lib/zipItDataRepresentationUtils.d.ts.map +1 -0
  462. package/lib/{zipItDataRepresentationUtils.mjs → zipItDataRepresentationUtils.js} +19 -11
  463. package/lib/zipItDataRepresentationUtils.js.map +1 -0
  464. package/package.json +100 -32
  465. package/src/ReadBufferUtils.ts +7 -7
  466. package/src/WriteBufferUtils.ts +13 -9
  467. package/src/checkUrl.ts +4 -2
  468. package/src/compactSnapshotParser.ts +97 -61
  469. package/src/compactSnapshotWriter.ts +22 -15
  470. package/src/contracts.ts +33 -4
  471. package/src/createFile.ts +26 -51
  472. package/src/createNewContainerOnExistingFile.ts +10 -10
  473. package/src/createNewModule.ts +2 -2
  474. package/src/createNewUtils.ts +26 -15
  475. package/src/createOdspCreateContainerRequest.ts +3 -3
  476. package/src/createOdspUrl.ts +1 -1
  477. package/src/epochTracker.ts +93 -58
  478. package/src/fetchSnapshot.ts +122 -66
  479. package/src/getFileLink.ts +24 -16
  480. package/src/getQueryString.ts +2 -0
  481. package/src/index.ts +27 -19
  482. package/src/localOdspDriver/localOdspDocumentService.ts +12 -5
  483. package/src/localOdspDriver/localOdspDocumentServiceFactory.ts +12 -11
  484. package/src/localOdspDriver/localOdspDocumentStorageManager.ts +15 -8
  485. package/src/odspCache.ts +14 -11
  486. package/src/odspDelayLoadedDeltaStream.ts +113 -31
  487. package/src/odspDeltaStorageService.ts +17 -16
  488. package/src/odspDocumentDeltaConnection.ts +52 -34
  489. package/src/odspDocumentService.ts +33 -22
  490. package/src/odspDocumentServiceFactory.ts +7 -2
  491. package/src/odspDocumentServiceFactoryCore.ts +28 -29
  492. package/src/odspDocumentServiceFactoryWithCodeSplit.ts +1 -1
  493. package/src/odspDocumentStorageManager.ts +303 -210
  494. package/src/odspDocumentStorageServiceBase.ts +52 -47
  495. package/src/odspDriverUrlResolver.ts +41 -41
  496. package/src/odspDriverUrlResolverForShareLink.ts +50 -31
  497. package/src/odspError.ts +6 -7
  498. package/src/odspFluidFileLink.ts +3 -3
  499. package/src/odspLocationRedirection.ts +1 -1
  500. package/src/odspPublicUtils.ts +4 -0
  501. package/src/odspSnapshotParser.ts +9 -9
  502. package/src/odspSummaryUploadManager.ts +21 -9
  503. package/src/odspUrlHelper.ts +2 -3
  504. package/src/odspUtils.ts +102 -53
  505. package/src/opsCaching.ts +13 -12
  506. package/src/packageVersion.ts +1 -1
  507. package/src/prefetchLatestSnapshot.ts +24 -15
  508. package/src/retryErrorsStorageAdapter.ts +16 -9
  509. package/src/retryUtils.ts +8 -4
  510. package/src/socketModule.ts +2 -0
  511. package/src/vroom.ts +6 -6
  512. package/src/zipItDataRepresentationUtils.ts +65 -37
  513. package/tsconfig.cjs.json +7 -0
  514. package/tsconfig.json +2 -5
  515. package/.eslintrc.js +0 -18
  516. package/lib/ReadBufferUtils.d.mts.map +0 -1
  517. package/lib/ReadBufferUtils.mjs.map +0 -1
  518. package/lib/WriteBufferUtils.d.mts.map +0 -1
  519. package/lib/WriteBufferUtils.mjs.map +0 -1
  520. package/lib/checkUrl.d.mts.map +0 -1
  521. package/lib/checkUrl.mjs.map +0 -1
  522. package/lib/compactSnapshotParser.d.mts.map +0 -1
  523. package/lib/compactSnapshotParser.mjs.map +0 -1
  524. package/lib/compactSnapshotWriter.d.mts.map +0 -1
  525. package/lib/compactSnapshotWriter.mjs.map +0 -1
  526. package/lib/constants.d.mts.map +0 -1
  527. package/lib/constants.mjs.map +0 -1
  528. package/lib/contracts.d.mts.map +0 -1
  529. package/lib/contracts.mjs +0 -6
  530. package/lib/contracts.mjs.map +0 -1
  531. package/lib/contractsPublic.d.mts.map +0 -1
  532. package/lib/contractsPublic.mjs.map +0 -1
  533. package/lib/createFile.d.mts.map +0 -1
  534. package/lib/createFile.mjs.map +0 -1
  535. package/lib/createNewContainerOnExistingFile.d.mts.map +0 -1
  536. package/lib/createNewContainerOnExistingFile.mjs.map +0 -1
  537. package/lib/createNewModule.d.mts.map +0 -1
  538. package/lib/createNewModule.mjs.map +0 -1
  539. package/lib/createNewUtils.d.mts.map +0 -1
  540. package/lib/createNewUtils.mjs.map +0 -1
  541. package/lib/createOdspCreateContainerRequest.d.mts.map +0 -1
  542. package/lib/createOdspCreateContainerRequest.mjs.map +0 -1
  543. package/lib/createOdspUrl.d.mts.map +0 -1
  544. package/lib/createOdspUrl.mjs.map +0 -1
  545. package/lib/epochTracker.d.mts.map +0 -1
  546. package/lib/epochTracker.mjs.map +0 -1
  547. package/lib/fetch.d.mts.map +0 -1
  548. package/lib/fetch.mjs.map +0 -1
  549. package/lib/fetchSnapshot.d.mts.map +0 -1
  550. package/lib/fetchSnapshot.mjs.map +0 -1
  551. package/lib/getFileLink.d.mts.map +0 -1
  552. package/lib/getFileLink.mjs.map +0 -1
  553. package/lib/getQueryString.d.mts.map +0 -1
  554. package/lib/getQueryString.mjs.map +0 -1
  555. package/lib/getUrlAndHeadersWithAuth.d.mts.map +0 -1
  556. package/lib/getUrlAndHeadersWithAuth.mjs.map +0 -1
  557. package/lib/index.d.mts.map +0 -1
  558. package/lib/index.mjs +0 -22
  559. package/lib/index.mjs.map +0 -1
  560. package/lib/localOdspDriver/localOdspDeltaStorageService.d.mts.map +0 -1
  561. package/lib/localOdspDriver/localOdspDeltaStorageService.mjs.map +0 -1
  562. package/lib/localOdspDriver/localOdspDocumentService.d.mts.map +0 -1
  563. package/lib/localOdspDriver/localOdspDocumentService.mjs.map +0 -1
  564. package/lib/localOdspDriver/localOdspDocumentServiceFactory.d.mts.map +0 -1
  565. package/lib/localOdspDriver/localOdspDocumentServiceFactory.mjs.map +0 -1
  566. package/lib/localOdspDriver/localOdspDocumentStorageManager.d.mts.map +0 -1
  567. package/lib/localOdspDriver/localOdspDocumentStorageManager.mjs.map +0 -1
  568. package/lib/odspCache.d.mts.map +0 -1
  569. package/lib/odspCache.mjs.map +0 -1
  570. package/lib/odspDelayLoadedDeltaStream.d.mts.map +0 -1
  571. package/lib/odspDelayLoadedDeltaStream.mjs.map +0 -1
  572. package/lib/odspDeltaStorageService.d.mts.map +0 -1
  573. package/lib/odspDeltaStorageService.mjs.map +0 -1
  574. package/lib/odspDocumentDeltaConnection.d.mts.map +0 -1
  575. package/lib/odspDocumentDeltaConnection.mjs.map +0 -1
  576. package/lib/odspDocumentService.d.mts.map +0 -1
  577. package/lib/odspDocumentService.mjs.map +0 -1
  578. package/lib/odspDocumentServiceFactory.d.mts.map +0 -1
  579. package/lib/odspDocumentServiceFactory.mjs.map +0 -1
  580. package/lib/odspDocumentServiceFactoryCore.d.mts.map +0 -1
  581. package/lib/odspDocumentServiceFactoryCore.mjs.map +0 -1
  582. package/lib/odspDocumentServiceFactoryWithCodeSplit.d.mts.map +0 -1
  583. package/lib/odspDocumentServiceFactoryWithCodeSplit.mjs.map +0 -1
  584. package/lib/odspDocumentStorageManager.d.mts.map +0 -1
  585. package/lib/odspDocumentStorageManager.mjs.map +0 -1
  586. package/lib/odspDocumentStorageServiceBase.d.mts.map +0 -1
  587. package/lib/odspDocumentStorageServiceBase.mjs.map +0 -1
  588. package/lib/odspDriverUrlResolver.d.mts.map +0 -1
  589. package/lib/odspDriverUrlResolver.mjs.map +0 -1
  590. package/lib/odspDriverUrlResolverForShareLink.d.mts.map +0 -1
  591. package/lib/odspDriverUrlResolverForShareLink.mjs.map +0 -1
  592. package/lib/odspError.d.mts.map +0 -1
  593. package/lib/odspError.mjs.map +0 -1
  594. package/lib/odspFluidFileLink.d.mts.map +0 -1
  595. package/lib/odspFluidFileLink.mjs.map +0 -1
  596. package/lib/odspLocationRedirection.d.mts.map +0 -1
  597. package/lib/odspLocationRedirection.mjs.map +0 -1
  598. package/lib/odspPublicUtils.d.mts.map +0 -1
  599. package/lib/odspPublicUtils.mjs.map +0 -1
  600. package/lib/odspSnapshotParser.d.mts.map +0 -1
  601. package/lib/odspSnapshotParser.mjs.map +0 -1
  602. package/lib/odspSummaryUploadManager.d.mts.map +0 -1
  603. package/lib/odspSummaryUploadManager.mjs.map +0 -1
  604. package/lib/odspUrlHelper.d.mts.map +0 -1
  605. package/lib/odspUrlHelper.mjs.map +0 -1
  606. package/lib/odspUtils.d.mts.map +0 -1
  607. package/lib/odspUtils.mjs.map +0 -1
  608. package/lib/opsCaching.d.mts.map +0 -1
  609. package/lib/opsCaching.mjs.map +0 -1
  610. package/lib/packageVersion.d.mts.map +0 -1
  611. package/lib/packageVersion.mjs.map +0 -1
  612. package/lib/prefetchLatestSnapshot.d.mts.map +0 -1
  613. package/lib/prefetchLatestSnapshot.mjs.map +0 -1
  614. package/lib/retryErrorsStorageAdapter.d.mts.map +0 -1
  615. package/lib/retryErrorsStorageAdapter.mjs.map +0 -1
  616. package/lib/retryUtils.d.mts.map +0 -1
  617. package/lib/retryUtils.mjs.map +0 -1
  618. package/lib/socketModule.d.mts.map +0 -1
  619. package/lib/socketModule.mjs.map +0 -1
  620. package/lib/vroom.d.mts.map +0 -1
  621. package/lib/vroom.mjs.map +0 -1
  622. package/lib/zipItDataRepresentationUtils.d.mts.map +0 -1
  623. package/lib/zipItDataRepresentationUtils.mjs.map +0 -1
@@ -12,9 +12,9 @@ const client_utils_1 = require("@fluid-internal/client-utils");
12
12
  const core_utils_1 = require("@fluidframework/core-utils");
13
13
  const protocol_base_1 = require("@fluidframework/protocol-base");
14
14
  const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
15
- const odspUtils_1 = require("./odspUtils");
16
- const getUrlAndHeadersWithAuth_1 = require("./getUrlAndHeadersWithAuth");
17
- const retryUtils_1 = require("./retryUtils");
15
+ const odspUtils_js_1 = require("./odspUtils.js");
16
+ const getUrlAndHeadersWithAuth_js_1 = require("./getUrlAndHeadersWithAuth.js");
17
+ const retryUtils_js_1 = require("./retryUtils.js");
18
18
  /**
19
19
  * Converts a summary(ISummaryTree) taken in detached container to snapshot tree and blobs
20
20
  */
@@ -22,15 +22,16 @@ function convertCreateNewSummaryTreeToTreeAndBlobs(summary, treeId) {
22
22
  const protocolSummary = summary.tree[".protocol"];
23
23
  const documentAttributes = (0, driver_utils_1.getDocAttributesFromProtocolSummary)(protocolSummary);
24
24
  const sequenceNumber = documentAttributes.sequenceNumber;
25
- const blobs = new Map();
26
- const snapshotTree = convertCreateNewSummaryTreeToTreeAndBlobsCore(summary, blobs);
25
+ const blobContents = new Map();
26
+ const snapshotTree = convertCreateNewSummaryTreeToTreeAndBlobsCore(summary, blobContents);
27
27
  snapshotTree.id = treeId;
28
28
  const snapshotTreeValue = {
29
29
  snapshotTree,
30
- blobs,
30
+ blobContents,
31
31
  ops: [],
32
32
  sequenceNumber,
33
33
  latestSequenceNumber: sequenceNumber,
34
+ snapshotFormatV: 1,
34
35
  };
35
36
  return snapshotTreeValue;
36
37
  }
@@ -40,6 +41,7 @@ function convertCreateNewSummaryTreeToTreeAndBlobsCore(summary, blobs) {
40
41
  blobs: {},
41
42
  trees: {},
42
43
  unreferenced: summary.unreferenced,
44
+ groupId: summary.groupId,
43
45
  };
44
46
  const keys = Object.keys(summary.tree);
45
47
  for (const key of keys) {
@@ -114,10 +116,12 @@ function convertSummaryToSnapshotTreeForCreateNew(summary) {
114
116
  // property is not present, the tree entry is considered referenced. If the property is present and is true,
115
117
  // the tree entry is considered unreferenced.
116
118
  let unreferenced;
119
+ let groupId;
117
120
  switch (summaryObject.type) {
118
121
  case protocol_definitions_1.SummaryType.Tree: {
119
122
  value = convertSummaryToSnapshotTreeForCreateNew(summaryObject);
120
123
  unreferenced = summaryObject.unreferenced;
124
+ groupId = summaryObject.groupId;
121
125
  break;
122
126
  }
123
127
  case protocol_definitions_1.SummaryType.Blob: {
@@ -144,6 +148,7 @@ function convertSummaryToSnapshotTreeForCreateNew(summary) {
144
148
  type: (0, protocol_base_1.getGitType)(summaryObject),
145
149
  value,
146
150
  unreferenced,
151
+ groupId,
147
152
  };
148
153
  snapshotTree.entries?.push(entry);
149
154
  }
@@ -151,7 +156,7 @@ function convertSummaryToSnapshotTreeForCreateNew(summary) {
151
156
  }
152
157
  async function createNewFluidContainerCore(args) {
153
158
  const { containerSnapshot, getStorageToken, logger, initialUrl, forceAccessTokenViaAuthorizationHeader, epochTracker, telemetryName, fetchType, validateResponseCallback, } = args;
154
- return (0, odspUtils_1.getWithRetryForTokenRefresh)(async (options) => {
159
+ return (0, odspUtils_js_1.getWithRetryForTokenRefresh)(async (options) => {
155
160
  const storageToken = await getStorageToken(options, telemetryName);
156
161
  return telemetry_utils_1.PerformanceEvent.timedExecAsync(logger, { eventName: telemetryName }, async (event) => {
157
162
  const snapshotBody = JSON.stringify(containerSnapshot);
@@ -166,7 +171,7 @@ async function createNewFluidContainerCore(args) {
166
171
  postBody += `_post: 1\r\n`;
167
172
  postBody += `\r\n${snapshotBody}\r\n`;
168
173
  postBody += `\r\n--${formBoundary}--`;
169
- if (postBody.length <= odspUtils_1.maxUmpPostBodySize) {
174
+ if (postBody.length <= odspUtils_js_1.maxUmpPostBodySize) {
170
175
  const urlObj = new URL(initialUrl);
171
176
  urlObj.searchParams.set("ump", "1");
172
177
  url = urlObj.href;
@@ -176,7 +181,7 @@ async function createNewFluidContainerCore(args) {
176
181
  addInBody = true;
177
182
  }
178
183
  else {
179
- const parts = (0, getUrlAndHeadersWithAuth_1.getUrlAndHeadersWithAuth)(initialUrl, storageToken, forceAccessTokenViaAuthorizationHeader);
184
+ const parts = (0, getUrlAndHeadersWithAuth_js_1.getUrlAndHeadersWithAuth)(initialUrl, storageToken, forceAccessTokenViaAuthorizationHeader);
180
185
  url = parts.url;
181
186
  headers = {
182
187
  ...parts.headers,
@@ -184,14 +189,14 @@ async function createNewFluidContainerCore(args) {
184
189
  };
185
190
  postBody = snapshotBody;
186
191
  }
187
- const fetchResponse = await (0, retryUtils_1.runWithRetry)(async () => epochTracker.fetchAndParseAsJSON(url, {
192
+ const fetchResponse = await (0, retryUtils_js_1.runWithRetry)(async () => epochTracker.fetchAndParseAsJSON(url, {
188
193
  body: postBody,
189
194
  headers,
190
195
  method: "POST",
191
196
  }, fetchType, addInBody), telemetryName, logger);
192
197
  validateResponseCallback?.(fetchResponse.content);
193
198
  event.end({
194
- headers: Object.keys(headers).length !== 0 ? true : undefined,
199
+ headers: Object.keys(headers).length > 0 ? true : undefined,
195
200
  attempts: options.refresh ? 2 : 1,
196
201
  ...fetchResponse.propsToLog,
197
202
  });
@@ -1 +1 @@
1
- {"version":3,"file":"createNewUtils.js","sourceRoot":"","sources":["../src/createNewUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAAkC;AAClC,+EAK8C;AAC9C,+DAGsC;AACtC,+DAAkF;AAClF,2DAA6D;AAC7D,iEAA2D;AAC3D,qEAAwF;AAQxF,2CAA8E;AAG9E,yEAAsE;AACtE,6CAA4C;AAE5C;;GAEG;AACH,SAAgB,yCAAyC,CACxD,OAAqB,EACrB,MAAc;IAEd,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAiB,CAAC;IAClE,MAAM,kBAAkB,GAAG,IAAA,kDAAmC,EAAC,eAAe,CAAC,CAAC;IAChF,MAAM,cAAc,GAAG,kBAAkB,CAAC,cAAc,CAAC;IACzD,MAAM,KAAK,G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jC,GAAG,aAAa,CAAC,UAAU;aAC3B,CAAC,CAAC;YAEH,OAAO,aAAa,CAAC,OAAO,CAAC;QAC9B,CAAC,CACD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC;AA7FD,kEA6FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from \"uuid\";\nimport {\n\tISummaryBlob,\n\tISummaryTree,\n\tSummaryType,\n\tISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n\tgetDocAttributesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"@fluidframework/driver-utils\";\nimport { stringToBuffer, Uint8ArrayToString } from \"@fluid-internal/client-utils\";\nimport { unreachableCase } from \"@fluidframework/core-utils\";\nimport { getGitType } from \"@fluidframework/protocol-base\";\nimport { ITelemetryLoggerExt, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { InstrumentedStorageTokenFetcher } from \"@fluidframework/odsp-driver-definitions\";\nimport {\n\tIOdspSummaryPayload,\n\tIOdspSummaryTree,\n\tOdspSummaryTreeEntry,\n\tOdspSummaryTreeValue,\n} from \"./contracts\";\nimport { getWithRetryForTokenRefresh, maxUmpPostBodySize } from \"./odspUtils\";\nimport { ISnapshotContents } from \"./odspPublicUtils\";\nimport { EpochTracker, FetchType } from \"./epochTracker\";\nimport { getUrlAndHeadersWithAuth } from \"./getUrlAndHeadersWithAuth\";\nimport { runWithRetry } from \"./retryUtils\";\n\n/**\n * Converts a summary(ISummaryTree) taken in detached container to snapshot tree and blobs\n */\nexport function convertCreateNewSummaryTreeToTreeAndBlobs(\n\tsummary: ISummaryTree,\n\ttreeId: string,\n): ISnapshotContents {\n\tconst protocolSummary = summary.tree[\".protocol\"] as ISummaryTree;\n\tconst documentAttributes = getDocAttributesFromProtocolSummary(protocolSummary);\n\tconst sequenceNumber = documentAttributes.sequenceNumber;\n\tconst blobs = new Map<string, ArrayBuffer>();\n\tconst snapshotTree = convertCreateNewSummaryTreeToTreeAndBlobsCore(summary, blobs);\n\tsnapshotTree.id = treeId;\n\tconst snapshotTreeValue: ISnapshotContents = {\n\t\tsnapshotTree,\n\t\tblobs,\n\t\tops: [],\n\t\tsequenceNumber,\n\t\tlatestSequenceNumber: sequenceNumber,\n\t};\n\n\treturn snapshotTreeValue;\n}\n\nfunction convertCreateNewSummaryTreeToTreeAndBlobsCore(\n\tsummary: ISummaryTree,\n\tblobs: Map<string, ArrayBuffer>,\n) {\n\tconst treeNode: ISnapshotTree = {\n\t\tblobs: {},\n\t\ttrees: {},\n\t\tunreferenced: summary.unreferenced,\n\t};\n\tconst keys = Object.keys(summary.tree);\n\tfor (const key of keys) {\n\t\tconst summaryObject = summary.tree[key];\n\n\t\tswitch (summaryObject.type) {\n\t\t\tcase SummaryType.Tree: {\n\t\t\t\ttreeNode.trees[key] = convertCreateNewSummaryTreeToTreeAndBlobsCore(\n\t\t\t\t\tsummaryObject,\n\t\t\t\t\tblobs,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Blob: {\n\t\t\t\tconst contentBuffer =\n\t\t\t\t\ttypeof summaryObject.content === \"string\"\n\t\t\t\t\t\t? stringToBuffer(summaryObject.content, \"utf8\")\n\t\t\t\t\t\t: summaryObject.content;\n\t\t\t\tconst blobId = uuid();\n\t\t\t\ttreeNode.blobs[key] = blobId;\n\t\t\t\tblobs.set(blobId, contentBuffer);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Handle:\n\t\t\tcase SummaryType.Attachment: {\n\t\t\t\tthrow new Error(`No ${summaryObject.type} should be present for detached summary!`);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(summaryObject, `Unknown tree type ${(summaryObject as any).type}`);\n\t\t\t}\n\t\t}\n\t}\n\treturn treeNode;\n}\n\nexport function convertSummaryIntoContainerSnapshot(createNewSummary: ISummaryTree) {\n\tif (!isCombinedAppAndProtocolSummary(createNewSummary)) {\n\t\tthrow new Error(\"App and protocol summary required for create new path!!\");\n\t}\n\tconst appSummary = createNewSummary.tree[\".app\"];\n\tconst protocolSummary = createNewSummary.tree[\".protocol\"];\n\tconst documentAttributes = getDocAttributesFromProtocolSummary(protocolSummary);\n\tconst attributesSummaryBlob: ISummaryBlob = {\n\t\ttype: SummaryType.Blob,\n\t\tcontent: JSON.stringify(documentAttributes),\n\t};\n\tprotocolSummary.tree.attributes = attributesSummaryBlob;\n\tconst convertedCreateNewSummary: ISummaryTree = {\n\t\ttype: SummaryType.Tree,\n\t\ttree: {\n\t\t\t\".protocol\": protocolSummary,\n\t\t\t\".app\": appSummary,\n\t\t},\n\t};\n\tconst snapshotTree = convertSummaryToSnapshotTreeForCreateNew(convertedCreateNewSummary);\n\tconst snapshot: IOdspSummaryPayload = {\n\t\tentries: snapshotTree.entries ?? [],\n\t\tmessage: \"app\",\n\t\tsequenceNumber: documentAttributes.sequenceNumber,\n\t\ttype: \"container\",\n\t};\n\treturn snapshot;\n}\n\n/**\n * Converts a summary tree to ODSP tree\n */\nfunction convertSummaryToSnapshotTreeForCreateNew(summary: ISummaryTree): IOdspSummaryTree {\n\tconst snapshotTree: IOdspSummaryTree = {\n\t\ttype: \"tree\",\n\t\tentries: [],\n\t};\n\n\tconst keys = Object.keys(summary.tree);\n\tfor (const key of keys) {\n\t\tconst summaryObject = summary.tree[key];\n\n\t\tlet value: OdspSummaryTreeValue;\n\t\t// Tracks if an entry is unreferenced. Currently, only tree entries can be marked as unreferenced. If the\n\t\t// property is not present, the tree entry is considered referenced. If the property is present and is true,\n\t\t// the tree entry is considered unreferenced.\n\t\tlet unreferenced: true | undefined;\n\n\t\tswitch (summaryObject.type) {\n\t\t\tcase SummaryType.Tree: {\n\t\t\t\tvalue = convertSummaryToSnapshotTreeForCreateNew(summaryObject);\n\t\t\t\tunreferenced = summaryObject.unreferenced;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Blob: {\n\t\t\t\tconst content =\n\t\t\t\t\ttypeof summaryObject.content === \"string\"\n\t\t\t\t\t\t? summaryObject.content\n\t\t\t\t\t\t: Uint8ArrayToString(summaryObject.content, \"base64\");\n\t\t\t\tconst encoding = typeof summaryObject.content === \"string\" ? \"utf-8\" : \"base64\";\n\n\t\t\t\tvalue = {\n\t\t\t\t\ttype: \"blob\",\n\t\t\t\t\tcontent,\n\t\t\t\t\tencoding,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Handle: {\n\t\t\t\tthrow new Error(\"No handle should be present for first summary!!\");\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Unknown tree type ${summaryObject.type}`);\n\t\t\t}\n\t\t}\n\n\t\tconst entry: OdspSummaryTreeEntry = {\n\t\t\tpath: encodeURIComponent(key),\n\t\t\ttype: getGitType(summaryObject),\n\t\t\tvalue,\n\t\t\tunreferenced,\n\t\t};\n\t\tsnapshotTree.entries?.push(entry);\n\t}\n\n\treturn snapshotTree;\n}\n\nexport async function createNewFluidContainerCore<T>(args: {\n\tcontainerSnapshot: IOdspSummaryPayload;\n\tgetStorageToken: InstrumentedStorageTokenFetcher;\n\tlogger: ITelemetryLoggerExt;\n\tinitialUrl: string;\n\tforceAccessTokenViaAuthorizationHeader: boolean;\n\tepochTracker: EpochTracker;\n\ttelemetryName: string;\n\tfetchType: FetchType;\n\tvalidateResponseCallback?: (content: T) => void;\n}): Promise<T> {\n\tconst {\n\t\tcontainerSnapshot,\n\t\tgetStorageToken,\n\t\tlogger,\n\t\tinitialUrl,\n\t\tforceAccessTokenViaAuthorizationHeader,\n\t\tepochTracker,\n\t\ttelemetryName,\n\t\tfetchType,\n\t\tvalidateResponseCallback,\n\t} = args;\n\n\treturn getWithRetryForTokenRefresh(async (options) => {\n\t\tconst storageToken = await getStorageToken(options, telemetryName);\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tlogger,\n\t\t\t{ eventName: telemetryName },\n\t\t\tasync (event) => {\n\t\t\t\tconst snapshotBody = JSON.stringify(containerSnapshot);\n\t\t\t\tlet url: string;\n\t\t\t\tlet headers: { [index: string]: string };\n\t\t\t\tlet addInBody = false;\n\t\t\t\tconst formBoundary = uuid();\n\t\t\t\tlet postBody = `--${formBoundary}\\r\\n`;\n\t\t\t\tpostBody += `Authorization: Bearer ${storageToken}\\r\\n`;\n\t\t\t\tpostBody += `X-HTTP-Method-Override: POST\\r\\n`;\n\t\t\t\tpostBody += `Content-Type: application/json\\r\\n`;\n\t\t\t\tpostBody += `_post: 1\\r\\n`;\n\t\t\t\tpostBody += `\\r\\n${snapshotBody}\\r\\n`;\n\t\t\t\tpostBody += `\\r\\n--${formBoundary}--`;\n\n\t\t\t\tif (postBody.length <= maxUmpPostBodySize) {\n\t\t\t\t\tconst urlObj = new URL(initialUrl);\n\t\t\t\t\turlObj.searchParams.set(\"ump\", \"1\");\n\t\t\t\t\turl = urlObj.href;\n\t\t\t\t\theaders = {\n\t\t\t\t\t\t\"Content-Type\": `multipart/form-data;boundary=${formBoundary}`,\n\t\t\t\t\t};\n\t\t\t\t\taddInBody = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst parts = getUrlAndHeadersWithAuth(\n\t\t\t\t\t\tinitialUrl,\n\t\t\t\t\t\tstorageToken,\n\t\t\t\t\t\tforceAccessTokenViaAuthorizationHeader,\n\t\t\t\t\t);\n\t\t\t\t\turl = parts.url;\n\t\t\t\t\theaders = {\n\t\t\t\t\t\t...parts.headers,\n\t\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\t};\n\t\t\t\t\tpostBody = snapshotBody;\n\t\t\t\t}\n\n\t\t\t\tconst fetchResponse = await runWithRetry(\n\t\t\t\t\tasync () =>\n\t\t\t\t\t\tepochTracker.fetchAndParseAsJSON<T>(\n\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbody: postBody,\n\t\t\t\t\t\t\t\theaders,\n\t\t\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfetchType,\n\t\t\t\t\t\t\taddInBody,\n\t\t\t\t\t\t),\n\t\t\t\t\ttelemetryName,\n\t\t\t\t\tlogger,\n\t\t\t\t);\n\n\t\t\t\tvalidateResponseCallback?.(fetchResponse.content);\n\n\t\t\t\tevent.end({\n\t\t\t\t\theaders: Object.keys(headers).length !== 0 ? true : undefined,\n\t\t\t\t\tattempts: options.refresh ? 2 : 1,\n\t\t\t\t\t...fetchResponse.propsToLog,\n\t\t\t\t});\n\n\t\t\t\treturn fetchResponse.content;\n\t\t\t},\n\t\t);\n\t});\n}\n"]}
1
+ {"version":3,"file":"createNewUtils.js","sourceRoot":"","sources":["../src/createNewUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAAkC;AAClC,+EAM8C;AAC9C,+DAGsC;AACtC,+DAAkF;AAClF,2DAA6D;AAC7D,iEAA2D;AAC3D,qEAAwF;AASxF,iDAAiF;AAEjF,+EAAyE;AACzE,mDAA+C;AAE/C;;GAEG;AACH,SAAgB,yCAAyC,CACxD,OAAqB,EACrB,MAAc;IAEd,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAiB,CAAC;IAClE,MAAM,kBAAkB,GAAG,IAAA,kDAAmC,EAAC,eAAe,CAAC,CAAC;IAChF,MAAM,cAAc,GAAG,kBAAkB,CAAC,cAAc,CAAC;IACzD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAuB,CAAC;IACpD,MAAM,YAAY,GAAG,6CAA6C,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC1F,YAAY,CAAC,EAAE,GAAG,MAAM,CAAC;IACzB,MAAM,iBAAiB,GAAc;QACpC,YAAY;QACZ,YAAY;QACZ,GAAG,EAAE,EAAE;QACP,cAAc;QACd,oBAAoB,EAAE,cAAc;QACpC,eAAe,EAAE,CAAC;KAClB,CAAC;IAEF,OAAO,iBAA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!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from \"uuid\";\nimport {\n\tISummaryBlob,\n\tISummaryTree,\n\tSummaryType,\n\tISnapshotTree,\n\ttype SummaryObject,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n\tgetDocAttributesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"@fluidframework/driver-utils\";\nimport { stringToBuffer, Uint8ArrayToString } from \"@fluid-internal/client-utils\";\nimport { unreachableCase } from \"@fluidframework/core-utils\";\nimport { getGitType } from \"@fluidframework/protocol-base\";\nimport { ITelemetryLoggerExt, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { InstrumentedStorageTokenFetcher } from \"@fluidframework/odsp-driver-definitions\";\nimport { ISnapshot } from \"@fluidframework/driver-definitions\";\nimport {\n\tIOdspSummaryPayload,\n\tIOdspSummaryTree,\n\tOdspSummaryTreeEntry,\n\tOdspSummaryTreeValue,\n} from \"./contracts.js\";\nimport { getWithRetryForTokenRefresh, maxUmpPostBodySize } from \"./odspUtils.js\";\nimport { EpochTracker, FetchType } from \"./epochTracker.js\";\nimport { getUrlAndHeadersWithAuth } from \"./getUrlAndHeadersWithAuth.js\";\nimport { runWithRetry } from \"./retryUtils.js\";\n\n/**\n * Converts a summary(ISummaryTree) taken in detached container to snapshot tree and blobs\n */\nexport function convertCreateNewSummaryTreeToTreeAndBlobs(\n\tsummary: ISummaryTree,\n\ttreeId: string,\n): ISnapshot {\n\tconst protocolSummary = summary.tree[\".protocol\"] as ISummaryTree;\n\tconst documentAttributes = getDocAttributesFromProtocolSummary(protocolSummary);\n\tconst sequenceNumber = documentAttributes.sequenceNumber;\n\tconst blobContents = new Map<string, ArrayBuffer>();\n\tconst snapshotTree = convertCreateNewSummaryTreeToTreeAndBlobsCore(summary, blobContents);\n\tsnapshotTree.id = treeId;\n\tconst snapshotTreeValue: ISnapshot = {\n\t\tsnapshotTree,\n\t\tblobContents,\n\t\tops: [],\n\t\tsequenceNumber,\n\t\tlatestSequenceNumber: sequenceNumber,\n\t\tsnapshotFormatV: 1,\n\t};\n\n\treturn snapshotTreeValue;\n}\n\nfunction convertCreateNewSummaryTreeToTreeAndBlobsCore(\n\tsummary: ISummaryTree,\n\tblobs: Map<string, ArrayBuffer>,\n): ISnapshotTree {\n\tconst treeNode: ISnapshotTree = {\n\t\tblobs: {},\n\t\ttrees: {},\n\t\tunreferenced: summary.unreferenced,\n\t\tgroupId: summary.groupId,\n\t};\n\tconst keys = Object.keys(summary.tree);\n\tfor (const key of keys) {\n\t\tconst summaryObject = summary.tree[key];\n\n\t\tswitch (summaryObject.type) {\n\t\t\tcase SummaryType.Tree: {\n\t\t\t\ttreeNode.trees[key] = convertCreateNewSummaryTreeToTreeAndBlobsCore(\n\t\t\t\t\tsummaryObject,\n\t\t\t\t\tblobs,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Blob: {\n\t\t\t\tconst contentBuffer =\n\t\t\t\t\ttypeof summaryObject.content === \"string\"\n\t\t\t\t\t\t? stringToBuffer(summaryObject.content, \"utf8\")\n\t\t\t\t\t\t: summaryObject.content;\n\t\t\t\tconst blobId = uuid();\n\t\t\t\ttreeNode.blobs[key] = blobId;\n\t\t\t\tblobs.set(blobId, contentBuffer);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Handle:\n\t\t\tcase SummaryType.Attachment: {\n\t\t\t\tthrow new Error(`No ${summaryObject.type} should be present for detached summary!`);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(\n\t\t\t\t\tsummaryObject,\n\t\t\t\t\t`Unknown tree type ${(summaryObject as SummaryObject).type}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn treeNode;\n}\n\nexport function convertSummaryIntoContainerSnapshot(\n\tcreateNewSummary: ISummaryTree,\n): IOdspSummaryPayload {\n\tif (!isCombinedAppAndProtocolSummary(createNewSummary)) {\n\t\tthrow new Error(\"App and protocol summary required for create new path!!\");\n\t}\n\tconst appSummary = createNewSummary.tree[\".app\"];\n\tconst protocolSummary = createNewSummary.tree[\".protocol\"];\n\tconst documentAttributes = getDocAttributesFromProtocolSummary(protocolSummary);\n\tconst attributesSummaryBlob: ISummaryBlob = {\n\t\ttype: SummaryType.Blob,\n\t\tcontent: JSON.stringify(documentAttributes),\n\t};\n\tprotocolSummary.tree.attributes = attributesSummaryBlob;\n\tconst convertedCreateNewSummary: ISummaryTree = {\n\t\ttype: SummaryType.Tree,\n\t\ttree: {\n\t\t\t\".protocol\": protocolSummary,\n\t\t\t\".app\": appSummary,\n\t\t},\n\t};\n\tconst snapshotTree = convertSummaryToSnapshotTreeForCreateNew(convertedCreateNewSummary);\n\tconst snapshot: IOdspSummaryPayload = {\n\t\tentries: snapshotTree.entries ?? [],\n\t\tmessage: \"app\",\n\t\tsequenceNumber: documentAttributes.sequenceNumber,\n\t\ttype: \"container\",\n\t};\n\treturn snapshot;\n}\n\n/**\n * Converts a summary tree to ODSP tree\n */\nfunction convertSummaryToSnapshotTreeForCreateNew(summary: ISummaryTree): IOdspSummaryTree {\n\tconst snapshotTree: IOdspSummaryTree = {\n\t\ttype: \"tree\",\n\t\tentries: [],\n\t};\n\n\tconst keys = Object.keys(summary.tree);\n\tfor (const key of keys) {\n\t\tconst summaryObject = summary.tree[key];\n\n\t\tlet value: OdspSummaryTreeValue;\n\t\t// Tracks if an entry is unreferenced. Currently, only tree entries can be marked as unreferenced. If the\n\t\t// property is not present, the tree entry is considered referenced. If the property is present and is true,\n\t\t// the tree entry is considered unreferenced.\n\t\tlet unreferenced: true | undefined;\n\t\tlet groupId: string | undefined;\n\n\t\tswitch (summaryObject.type) {\n\t\t\tcase SummaryType.Tree: {\n\t\t\t\tvalue = convertSummaryToSnapshotTreeForCreateNew(summaryObject);\n\t\t\t\tunreferenced = summaryObject.unreferenced;\n\t\t\t\tgroupId = summaryObject.groupId;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Blob: {\n\t\t\t\tconst content =\n\t\t\t\t\ttypeof summaryObject.content === \"string\"\n\t\t\t\t\t\t? summaryObject.content\n\t\t\t\t\t\t: Uint8ArrayToString(summaryObject.content, \"base64\");\n\t\t\t\tconst encoding = typeof summaryObject.content === \"string\" ? \"utf-8\" : \"base64\";\n\n\t\t\t\tvalue = {\n\t\t\t\t\ttype: \"blob\",\n\t\t\t\t\tcontent,\n\t\t\t\t\tencoding,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Handle: {\n\t\t\t\tthrow new Error(\"No handle should be present for first summary!!\");\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Unknown tree type ${summaryObject.type}`);\n\t\t\t}\n\t\t}\n\n\t\tconst entry: OdspSummaryTreeEntry = {\n\t\t\tpath: encodeURIComponent(key),\n\t\t\ttype: getGitType(summaryObject),\n\t\t\tvalue,\n\t\t\tunreferenced,\n\t\t\tgroupId,\n\t\t};\n\t\tsnapshotTree.entries?.push(entry);\n\t}\n\n\treturn snapshotTree;\n}\n\nexport async function createNewFluidContainerCore<T>(args: {\n\tcontainerSnapshot: IOdspSummaryPayload;\n\tgetStorageToken: InstrumentedStorageTokenFetcher;\n\tlogger: ITelemetryLoggerExt;\n\tinitialUrl: string;\n\tforceAccessTokenViaAuthorizationHeader: boolean;\n\tepochTracker: EpochTracker;\n\ttelemetryName: string;\n\tfetchType: FetchType;\n\tvalidateResponseCallback?: (content: T) => void;\n}): Promise<T> {\n\tconst {\n\t\tcontainerSnapshot,\n\t\tgetStorageToken,\n\t\tlogger,\n\t\tinitialUrl,\n\t\tforceAccessTokenViaAuthorizationHeader,\n\t\tepochTracker,\n\t\ttelemetryName,\n\t\tfetchType,\n\t\tvalidateResponseCallback,\n\t} = args;\n\n\treturn getWithRetryForTokenRefresh(async (options) => {\n\t\tconst storageToken = await getStorageToken(options, telemetryName);\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tlogger,\n\t\t\t{ eventName: telemetryName },\n\t\t\tasync (event) => {\n\t\t\t\tconst snapshotBody = JSON.stringify(containerSnapshot);\n\t\t\t\tlet url: string;\n\t\t\t\tlet headers: { [index: string]: string };\n\t\t\t\tlet addInBody = false;\n\t\t\t\tconst formBoundary = uuid();\n\t\t\t\tlet postBody = `--${formBoundary}\\r\\n`;\n\t\t\t\tpostBody += `Authorization: Bearer ${storageToken}\\r\\n`;\n\t\t\t\tpostBody += `X-HTTP-Method-Override: POST\\r\\n`;\n\t\t\t\tpostBody += `Content-Type: application/json\\r\\n`;\n\t\t\t\tpostBody += `_post: 1\\r\\n`;\n\t\t\t\tpostBody += `\\r\\n${snapshotBody}\\r\\n`;\n\t\t\t\tpostBody += `\\r\\n--${formBoundary}--`;\n\n\t\t\t\tif (postBody.length <= maxUmpPostBodySize) {\n\t\t\t\t\tconst urlObj = new URL(initialUrl);\n\t\t\t\t\turlObj.searchParams.set(\"ump\", \"1\");\n\t\t\t\t\turl = urlObj.href;\n\t\t\t\t\theaders = {\n\t\t\t\t\t\t\"Content-Type\": `multipart/form-data;boundary=${formBoundary}`,\n\t\t\t\t\t};\n\t\t\t\t\taddInBody = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst parts = getUrlAndHeadersWithAuth(\n\t\t\t\t\t\tinitialUrl,\n\t\t\t\t\t\tstorageToken,\n\t\t\t\t\t\tforceAccessTokenViaAuthorizationHeader,\n\t\t\t\t\t);\n\t\t\t\t\turl = parts.url;\n\t\t\t\t\theaders = {\n\t\t\t\t\t\t...parts.headers,\n\t\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\t};\n\t\t\t\t\tpostBody = snapshotBody;\n\t\t\t\t}\n\n\t\t\t\tconst fetchResponse = await runWithRetry(\n\t\t\t\t\tasync () =>\n\t\t\t\t\t\tepochTracker.fetchAndParseAsJSON<T>(\n\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbody: postBody,\n\t\t\t\t\t\t\t\theaders,\n\t\t\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfetchType,\n\t\t\t\t\t\t\taddInBody,\n\t\t\t\t\t\t),\n\t\t\t\t\ttelemetryName,\n\t\t\t\t\tlogger,\n\t\t\t\t);\n\n\t\t\t\tvalidateResponseCallback?.(fetchResponse.content);\n\n\t\t\t\tevent.end({\n\t\t\t\t\theaders: Object.keys(headers).length > 0 ? true : undefined,\n\t\t\t\t\tattempts: options.refresh ? 2 : 1,\n\t\t\t\t\t...fetchResponse.propsToLog,\n\t\t\t\t});\n\n\t\t\t\treturn fetchResponse.content;\n\t\t\t},\n\t\t);\n\t});\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { IRequest } from "@fluidframework/core-interfaces";
6
- import { ShareLinkTypes, ISharingLinkKind } from "@fluidframework/odsp-driver-definitions";
6
+ import { ISharingLinkKind } from "@fluidframework/odsp-driver-definitions";
7
7
  /**
8
8
  * Create the request object with url and headers for creating a new file on OneDrive Sharepoint
9
9
  * @param siteUrl - Base url for OneDrive
@@ -14,5 +14,5 @@ import { ShareLinkTypes, ISharingLinkKind } from "@fluidframework/odsp-driver-de
14
14
  * will be deprecated soon, so for any new implementation please provide createShareLinkType of type ShareLink
15
15
  * @alpha
16
16
  */
17
- export declare function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType?: ShareLinkTypes | ISharingLinkKind): IRequest;
17
+ export declare function createOdspCreateContainerRequest(siteUrl: string, driveId: string, filePath: string, fileName: string, createShareLinkType?: ISharingLinkKind): IRequest;
18
18
  //# sourceMappingURL=createOdspCreateContainerRequest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createOdspCreateContainerRequest.d.ts","sourceRoot":"","sources":["../src/createOdspCreateContainerRequest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3F;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAC/C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,mBAAmB,CAAC,EAAE,cAAc,GAAG,gBAAgB,GACrD,QAAQ,CAaV"}
1
+ {"version":3,"file":"createOdspCreateContainerRequest.d.ts","sourceRoot":"","sources":["../src/createOdspCreateContainerRequest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3E;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAC/C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,mBAAmB,CAAC,EAAE,gBAAgB,GACpC,QAAQ,CAaV"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createOdspCreateContainerRequest = void 0;
4
4
  const driver_definitions_1 = require("@fluidframework/driver-definitions");
5
- const odspUtils_1 = require("./odspUtils");
5
+ const odspUtils_js_1 = require("./odspUtils.js");
6
6
  /**
7
7
  * Create the request object with url and headers for creating a new file on OneDrive Sharepoint
8
8
  * @param siteUrl - Base url for OneDrive
@@ -14,7 +14,7 @@ const odspUtils_1 = require("./odspUtils");
14
14
  * @alpha
15
15
  */
16
16
  function createOdspCreateContainerRequest(siteUrl, driveId, filePath, fileName, createShareLinkType) {
17
- const shareLinkRequestParams = (0, odspUtils_1.buildOdspShareLinkReqParams)(createShareLinkType);
17
+ const shareLinkRequestParams = (0, odspUtils_js_1.buildOdspShareLinkReqParams)(createShareLinkType);
18
18
  const createNewRequest = {
19
19
  url: `${siteUrl}?driveId=${encodeURIComponent(driveId)}&path=${encodeURIComponent(filePath)}${shareLinkRequestParams ? `&${shareLinkRequestParams}` : ""}`,
20
20
  headers: {
@@ -1 +1 @@
1
- {"version":3,"file":"createOdspCreateContainerRequest.js","sourceRoot":"","sources":["../src/createOdspCreateContainerRequest.ts"],"names":[],"mappings":";;;AAKA,2EAAkE;AAElE,2CAA0D;AAE1D;;;;;;;;;GASG;AACH,SAAgB,gCAAgC,CAC/C,OAAe,EACf,OAAe,EACf,QAAgB,EAChB,QAAgB,EAChB,mBAAuD;IAEvD,MAAM,sBAAsB,GAAG,IAAA,uCAA2B,EAAC,mBAAmB,CAAC,CAAC;IAChF,MAAM,gBAAgB,GAAa;QAClC,GAAG,EAAE,GAAG,OAAO,YAAY,kBAAkB,CAAC,OAAO,CAAC,SAAS,kBAAkB,CAChF,QAAQ,CACR,GAAG,sBAAsB,CAAC,CAAC,CAAC,IAAI,sBAAsB,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;QAChE,OAAO,EAAE;YACR,CAAC,iCAAY,CAAC,SAAS,CAAC,EAAE;gBACzB,QAAQ;aACR;SACD;KACD,CAAC;IACF,OAAO,gBAAgB,CAAC;AACzB,CAAC;AAnBD,4EAmBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { DriverHeader } from \"@fluidframework/driver-definitions\";\nimport { ShareLinkTypes, ISharingLinkKind } from \"@fluidframework/odsp-driver-definitions\";\nimport { buildOdspShareLinkReqParams } from \"./odspUtils\";\n\n/**\n * Create the request object with url and headers for creating a new file on OneDrive Sharepoint\n * @param siteUrl - Base url for OneDrive\n * @param driveId - drive identifier\n * @param filePath - path where file needs to be created\n * @param fileName - name of the new file to be created\n * @param createShareLinkType - type of sharing link you would like to create for this file. ShareLinkTypes\n * will be deprecated soon, so for any new implementation please provide createShareLinkType of type ShareLink\n * @alpha\n */\nexport function createOdspCreateContainerRequest(\n\tsiteUrl: string,\n\tdriveId: string,\n\tfilePath: string,\n\tfileName: string,\n\tcreateShareLinkType?: ShareLinkTypes | ISharingLinkKind,\n): IRequest {\n\tconst shareLinkRequestParams = buildOdspShareLinkReqParams(createShareLinkType);\n\tconst createNewRequest: IRequest = {\n\t\turl: `${siteUrl}?driveId=${encodeURIComponent(driveId)}&path=${encodeURIComponent(\n\t\t\tfilePath,\n\t\t)}${shareLinkRequestParams ? `&${shareLinkRequestParams}` : \"\"}`,\n\t\theaders: {\n\t\t\t[DriverHeader.createNew]: {\n\t\t\t\tfileName,\n\t\t\t},\n\t\t},\n\t};\n\treturn createNewRequest;\n}\n"]}
1
+ {"version":3,"file":"createOdspCreateContainerRequest.js","sourceRoot":"","sources":["../src/createOdspCreateContainerRequest.ts"],"names":[],"mappings":";;;AAKA,2EAAkE;AAElE,iDAA6D;AAE7D;;;;;;;;;GASG;AACH,SAAgB,gCAAgC,CAC/C,OAAe,EACf,OAAe,EACf,QAAgB,EAChB,QAAgB,EAChB,mBAAsC;IAEtC,MAAM,sBAAsB,GAAG,IAAA,0CAA2B,EAAC,mBAAmB,CAAC,CAAC;IAChF,MAAM,gBAAgB,GAAa;QAClC,GAAG,EAAE,GAAG,OAAO,YAAY,kBAAkB,CAAC,OAAO,CAAC,SAAS,kBAAkB,CAChF,QAAQ,CACR,GAAG,sBAAsB,CAAC,CAAC,CAAC,IAAI,sBAAsB,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;QAChE,OAAO,EAAE;YACR,CAAC,iCAAY,CAAC,SAAS,CAAC,EAAE;gBACzB,QAAQ;aACR;SACD;KACD,CAAC;IACF,OAAO,gBAAgB,CAAC;AACzB,CAAC;AAnBD,4EAmBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { DriverHeader } from \"@fluidframework/driver-definitions\";\nimport { ISharingLinkKind } from \"@fluidframework/odsp-driver-definitions\";\nimport { buildOdspShareLinkReqParams } from \"./odspUtils.js\";\n\n/**\n * Create the request object with url and headers for creating a new file on OneDrive Sharepoint\n * @param siteUrl - Base url for OneDrive\n * @param driveId - drive identifier\n * @param filePath - path where file needs to be created\n * @param fileName - name of the new file to be created\n * @param createShareLinkType - type of sharing link you would like to create for this file. ShareLinkTypes\n * will be deprecated soon, so for any new implementation please provide createShareLinkType of type ShareLink\n * @alpha\n */\nexport function createOdspCreateContainerRequest(\n\tsiteUrl: string,\n\tdriveId: string,\n\tfilePath: string,\n\tfileName: string,\n\tcreateShareLinkType?: ISharingLinkKind,\n): IRequest {\n\tconst shareLinkRequestParams = buildOdspShareLinkReqParams(createShareLinkType);\n\tconst createNewRequest: IRequest = {\n\t\turl: `${siteUrl}?driveId=${encodeURIComponent(driveId)}&path=${encodeURIComponent(\n\t\t\tfilePath,\n\t\t)}${shareLinkRequestParams ? `&${shareLinkRequestParams}` : \"\"}`,\n\t\theaders: {\n\t\t\t[DriverHeader.createNew]: {\n\t\t\t\tfileName,\n\t\t\t},\n\t\t},\n\t};\n\treturn createNewRequest;\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { OdspFluidDataStoreLocator } from "./contractsPublic";
5
+ import { OdspFluidDataStoreLocator } from "./contractsPublic.js";
6
6
  /**
7
7
  * Encodes ODC/SPO information into a URL format that can be handled by the Loader
8
8
  * @param l -The property bag of necessary properties to locate a Fluid data store and craft a url for it
@@ -1 +1 @@
1
- {"version":3,"file":"createOdspUrl.d.ts","sourceRoot":"","sources":["../src/createOdspUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAM9D;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,yBAAyB,GAAG,MAAM,CAYlE"}
1
+ {"version":3,"file":"createOdspUrl.d.ts","sourceRoot":"","sources":["../src/createOdspUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAMjE;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,yBAAyB,GAAG,MAAM,CAYlE"}
@@ -1 +1 @@
1
- {"version":3,"file":"createOdspUrl.js","sourceRoot":"","sources":["../src/createOdspUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AAEH;;;;GAIG;AACH,SAAgB,aAAa,CAAC,CAA4B;IACzD,IAAI,OAAO,GAAG,GAAG,CAAC,CAAC,OAAO,YAAY,kBAAkB,CACvD,CAAC,CAAC,OAAO,CACT,WAAW,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC;IACvF,IAAI,CAAC,CAAC,oBAAoB,EAAE;QAC3B,OAAO,IAAI,yBAAyB,kBAAkB,CAAC,CAAC,CAAC,oBAAoB,CAAC,EAAE,CAAC;KACjF;IACD,IAAI,CAAC,CAAC,WAAW,EAAE;QAClB,OAAO,IAAI,gBAAgB,kBAAkB,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;KAC/D;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAZD,sCAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { OdspFluidDataStoreLocator } from \"./contractsPublic\";\n\n/*\n * Per https://github.com/microsoft/FluidFramework/issues/1556, isolating createOdspUrl() in its own file.\n */\n\n/**\n * Encodes ODC/SPO information into a URL format that can be handled by the Loader\n * @param l -The property bag of necessary properties to locate a Fluid data store and craft a url for it\n * @alpha\n */\nexport function createOdspUrl(l: OdspFluidDataStoreLocator): string {\n\tlet odspUrl = `${l.siteUrl}?driveId=${encodeURIComponent(\n\t\tl.driveId,\n\t)}&itemId=${encodeURIComponent(l.itemId)}&path=${encodeURIComponent(l.dataStorePath)}`;\n\tif (l.containerPackageName) {\n\t\todspUrl += `&containerPackageName=${encodeURIComponent(l.containerPackageName)}`;\n\t}\n\tif (l.fileVersion) {\n\t\todspUrl += `&fileVersion=${encodeURIComponent(l.fileVersion)}`;\n\t}\n\n\treturn odspUrl;\n}\n"]}
1
+ {"version":3,"file":"createOdspUrl.js","sourceRoot":"","sources":["../src/createOdspUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AAEH;;;;GAIG;AACH,SAAgB,aAAa,CAAC,CAA4B;IACzD,IAAI,OAAO,GAAG,GAAG,CAAC,CAAC,OAAO,YAAY,kBAAkB,CACvD,CAAC,CAAC,OAAO,CACT,WAAW,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC;IACvF,IAAI,CAAC,CAAC,oBAAoB,EAAE;QAC3B,OAAO,IAAI,yBAAyB,kBAAkB,CAAC,CAAC,CAAC,oBAAoB,CAAC,EAAE,CAAC;KACjF;IACD,IAAI,CAAC,CAAC,WAAW,EAAE;QAClB,OAAO,IAAI,gBAAgB,kBAAkB,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;KAC/D;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAZD,sCAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { OdspFluidDataStoreLocator } from \"./contractsPublic.js\";\n\n/*\n * Per https://github.com/microsoft/FluidFramework/issues/1556, isolating createOdspUrl() in its own file.\n */\n\n/**\n * Encodes ODC/SPO information into a URL format that can be handled by the Loader\n * @param l -The property bag of necessary properties to locate a Fluid data store and craft a url for it\n * @alpha\n */\nexport function createOdspUrl(l: OdspFluidDataStoreLocator): string {\n\tlet odspUrl = `${l.siteUrl}?driveId=${encodeURIComponent(\n\t\tl.driveId,\n\t)}&itemId=${encodeURIComponent(l.itemId)}&path=${encodeURIComponent(l.dataStorePath)}`;\n\tif (l.containerPackageName) {\n\t\todspUrl += `&containerPackageName=${encodeURIComponent(l.containerPackageName)}`;\n\t}\n\tif (l.fileVersion) {\n\t\todspUrl += `&fileVersion=${encodeURIComponent(l.fileVersion)}`;\n\t}\n\n\treturn odspUrl;\n}\n"]}
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
6
6
  import { RateLimiter } from "@fluidframework/driver-utils";
7
- import { IEntry, IFileEntry, IPersistedCache } from "@fluidframework/odsp-driver-definitions";
8
- import { IOdspResponse } from "./odspUtils";
9
- import { IOdspCache, INonPersistentCache, IPersistedFileCache } from "./odspCache";
7
+ import { IEntry, IFileEntry, IPersistedCache, type HostStoragePolicy } from "@fluidframework/odsp-driver-definitions";
8
+ import { IOdspResponse } from "./odspUtils.js";
9
+ import { IOdspCache, INonPersistentCache, IPersistedFileCache } from "./odspCache.js";
10
10
  /**
11
11
  * @alpha
12
12
  */
@@ -16,7 +16,6 @@ export type FetchType = "blob" | "createBlob" | "createFile" | "joinSession" | "
16
16
  */
17
17
  export type FetchTypeInternal = FetchType | "cache";
18
18
  export declare const Odsp409Error = "Odsp409Error";
19
- export declare const defaultCacheExpiryTimeoutMs: number;
20
19
  /**
21
20
  * In ODSP, the concept of "epoch" refers to binary updates to files. For example, this might include using
22
21
  * version restore, or if the user downloads a Fluid file and then uploads it again. These result in the epoch
@@ -38,12 +37,13 @@ export declare class EpochTracker implements IPersistedFileCache {
38
37
  protected readonly fileEntry: IFileEntry;
39
38
  protected readonly logger: ITelemetryLoggerExt;
40
39
  protected readonly clientIsSummarizer?: boolean | undefined;
40
+ protected readonly hostPolicy?: HostStoragePolicy | undefined;
41
41
  private _fluidEpoch;
42
42
  private readonly snapshotCacheExpiryTimeoutMs;
43
43
  readonly rateLimiter: RateLimiter;
44
44
  private readonly driverId;
45
45
  private networkCallNumber;
46
- constructor(cache: IPersistedCache, fileEntry: IFileEntry, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean | undefined);
46
+ constructor(cache: IPersistedCache, fileEntry: IFileEntry, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean | undefined, hostPolicy?: HostStoragePolicy | undefined);
47
47
  setEpoch(epoch: string, fromCache: boolean, fetchType: FetchTypeInternal): void;
48
48
  get(entry: IEntry): Promise<any>;
49
49
  put(entry: IEntry, value: any): Promise<void>;
@@ -78,7 +78,7 @@ export declare class EpochTracker implements IPersistedFileCache {
78
78
  * @param fetchReason - fetch reason to add to the request.
79
79
  */
80
80
  fetchArray(url: string, fetchOptions: {
81
- [index: string]: any;
81
+ [index: string]: RequestInit;
82
82
  }, fetchType: FetchType, addInBody?: boolean, fetchReason?: string): Promise<IOdspResponse<ArrayBuffer>>;
83
83
  private addEpochInRequest;
84
84
  private addParamInBody;
@@ -93,12 +93,13 @@ export declare class EpochTrackerWithRedemption extends EpochTracker {
93
93
  protected readonly fileEntry: IFileEntry;
94
94
  protected readonly logger: ITelemetryLoggerExt;
95
95
  protected readonly clientIsSummarizer?: boolean | undefined;
96
+ protected readonly hostPolicy?: HostStoragePolicy | undefined;
96
97
  private readonly treesLatestDeferral;
97
- constructor(cache: IPersistedCache, fileEntry: IFileEntry, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean | undefined);
98
+ constructor(cache: IPersistedCache, fileEntry: IFileEntry, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean | undefined, hostPolicy?: HostStoragePolicy | undefined);
98
99
  protected validateEpochFromResponse(epochFromResponse: string | undefined, fetchType: FetchType, fromCache?: boolean): void;
99
100
  get(entry: IEntry): Promise<any>;
100
101
  fetchAndParseAsJSON<T>(url: string, fetchOptions: {
101
- [index: string]: any;
102
+ [index: string]: RequestInit;
102
103
  }, fetchType: FetchType, addInBody?: boolean, fetchReason?: string): Promise<IOdspResponse<T>>;
103
104
  }
104
105
  /**
@@ -108,5 +109,5 @@ export interface ICacheAndTracker {
108
109
  cache: IOdspCache;
109
110
  epochTracker: EpochTracker;
110
111
  }
111
- export declare function createOdspCacheAndTracker(persistedCacheArg: IPersistedCache, nonpersistentCache: INonPersistentCache, fileEntry: IFileEntry, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean): ICacheAndTracker;
112
+ export declare function createOdspCacheAndTracker(persistedCacheArg: IPersistedCache, nonpersistentCache: INonPersistentCache, fileEntry: IFileEntry, logger: ITelemetryLoggerExt, clientIsSummarizer?: boolean, hostPolicy?: HostStoragePolicy): ICacheAndTracker;
112
113
  //# sourceMappingURL=epochTracker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"epochTracker.d.ts","sourceRoot":"","sources":["../src/epochTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,mBAAmB,EAMnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEN,WAAW,EAGX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGN,MAAM,EACN,UAAU,EACV,eAAe,EAIf,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAKN,aAAa,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAMnF;;GAEG;AACH,MAAM,MAAM,SAAS,GAClB,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,KAAK,GACL,MAAM,GACN,cAAc,GACd,aAAa,GACb,eAAe,GACf,MAAM,GACN,UAAU,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpD,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAG3C,eAAO,MAAM,2BAA2B,EAAE,MAAgC,CAAC;AAE3E;;;;;;;;;;;;;;;GA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