@fluidframework/routerlicious-driver 2.0.0-dev-rc.2.0.0.245554 → 2.0.0-dev-rc.3.0.0.250606

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 (317) hide show
  1. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  2. package/api-extractor-lint.json +1 -1
  3. package/api-extractor.json +1 -1
  4. package/{lib/storageContracts.mjs → dist/axios.cjs} +3 -2
  5. package/dist/axios.cjs.map +1 -0
  6. package/dist/axios.d.cts +7 -0
  7. package/dist/axios.d.cts.map +1 -0
  8. package/dist/cache.js +2 -2
  9. package/dist/cache.js.map +1 -1
  10. package/dist/defaultTokenProvider.d.ts +1 -1
  11. package/dist/defaultTokenProvider.d.ts.map +1 -1
  12. package/dist/defaultTokenProvider.js.map +1 -1
  13. package/dist/deltaStorageService.d.ts +3 -3
  14. package/dist/deltaStorageService.d.ts.map +1 -1
  15. package/dist/deltaStorageService.js.map +1 -1
  16. package/dist/documentDeltaConnection.d.ts +1 -1
  17. package/dist/documentDeltaConnection.d.ts.map +1 -1
  18. package/dist/documentDeltaConnection.js +4 -4
  19. package/dist/documentDeltaConnection.js.map +1 -1
  20. package/dist/documentService.d.ts +6 -6
  21. package/dist/documentService.d.ts.map +1 -1
  22. package/dist/documentService.js +22 -22
  23. package/dist/documentService.js.map +1 -1
  24. package/dist/documentServiceFactory.d.ts +3 -3
  25. package/dist/documentServiceFactory.d.ts.map +1 -1
  26. package/dist/documentServiceFactory.js +25 -25
  27. package/dist/documentServiceFactory.js.map +1 -1
  28. package/dist/documentStorageService.d.ts +7 -7
  29. package/dist/documentStorageService.d.ts.map +1 -1
  30. package/dist/documentStorageService.js +4 -4
  31. package/dist/documentStorageService.js.map +1 -1
  32. package/dist/errorUtils.d.ts +1 -1
  33. package/dist/errorUtils.d.ts.map +1 -1
  34. package/dist/errorUtils.js +2 -3
  35. package/dist/errorUtils.js.map +1 -1
  36. package/dist/gitManager.d.ts +3 -3
  37. package/dist/gitManager.d.ts.map +1 -1
  38. package/dist/gitManager.js.map +1 -1
  39. package/dist/historian.d.ts +4 -4
  40. package/dist/historian.d.ts.map +1 -1
  41. package/dist/historian.js.map +1 -1
  42. package/dist/index.d.ts +6 -6
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +7 -7
  45. package/dist/index.js.map +1 -1
  46. package/dist/package.json +3 -0
  47. package/dist/packageVersion.d.ts +1 -1
  48. package/dist/packageVersion.js +1 -1
  49. package/dist/packageVersion.js.map +1 -1
  50. package/dist/r11sSnapshotParser.d.ts +1 -1
  51. package/dist/r11sSnapshotParser.d.ts.map +1 -1
  52. package/dist/r11sSnapshotParser.js.map +1 -1
  53. package/dist/restWrapper.d.ts +4 -4
  54. package/dist/restWrapper.d.ts.map +1 -1
  55. package/dist/restWrapper.js +11 -11
  56. package/dist/restWrapper.js.map +1 -1
  57. package/dist/restWrapperBase.d.ts +2 -2
  58. package/dist/restWrapperBase.d.ts.map +1 -1
  59. package/dist/restWrapperBase.js.map +1 -1
  60. package/dist/retriableGitManager.d.ts +3 -3
  61. package/dist/retriableGitManager.d.ts.map +1 -1
  62. package/dist/retriableGitManager.js.map +1 -1
  63. package/dist/shreddedSummaryDocumentStorageService.d.ts +6 -6
  64. package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  65. package/dist/shreddedSummaryDocumentStorageService.js +7 -7
  66. package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
  67. package/dist/storageContracts.d.ts +2 -2
  68. package/dist/storageContracts.d.ts.map +1 -1
  69. package/dist/storageContracts.js.map +1 -1
  70. package/dist/summaryTreeUploadManager.d.ts +1 -1
  71. package/dist/summaryTreeUploadManager.d.ts.map +1 -1
  72. package/dist/summaryTreeUploadManager.js.map +1 -1
  73. package/dist/treeUtils.d.ts +2 -2
  74. package/dist/treeUtils.d.ts.map +1 -1
  75. package/dist/treeUtils.js.map +1 -1
  76. package/dist/wholeSummaryDocumentStorageService.d.ts +6 -6
  77. package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  78. package/dist/wholeSummaryDocumentStorageService.js +12 -12
  79. package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
  80. package/dist/wholeSummaryUploadManager.d.ts +1 -1
  81. package/dist/wholeSummaryUploadManager.d.ts.map +1 -1
  82. package/dist/wholeSummaryUploadManager.js.map +1 -1
  83. package/lib/axios.cjs +7 -0
  84. package/lib/axios.cjs.map +1 -0
  85. package/lib/axios.d.cts +7 -0
  86. package/lib/axios.d.cts.map +1 -0
  87. package/lib/{cache.d.mts → cache.d.ts} +1 -1
  88. package/lib/cache.d.ts.map +1 -0
  89. package/lib/{cache.mjs → cache.js} +2 -2
  90. package/lib/cache.js.map +1 -0
  91. package/lib/{contracts.d.mts → contracts.d.ts} +1 -1
  92. package/lib/contracts.d.ts.map +1 -0
  93. package/lib/{policies.mjs → contracts.js} +1 -1
  94. package/lib/contracts.js.map +1 -0
  95. package/lib/{createNewUtils.d.mts → createNewUtils.d.ts} +1 -1
  96. package/lib/createNewUtils.d.ts.map +1 -0
  97. package/lib/{createNewUtils.mjs → createNewUtils.js} +1 -1
  98. package/lib/createNewUtils.js.map +1 -0
  99. package/lib/{defaultTokenProvider.d.mts → defaultTokenProvider.d.ts} +2 -2
  100. package/lib/defaultTokenProvider.d.ts.map +1 -0
  101. package/lib/{defaultTokenProvider.mjs → defaultTokenProvider.js} +1 -1
  102. package/lib/defaultTokenProvider.js.map +1 -0
  103. package/lib/{definitions.d.mts → definitions.d.ts} +1 -1
  104. package/lib/definitions.d.ts.map +1 -0
  105. package/lib/{definitions.mjs → definitions.js} +1 -1
  106. package/lib/definitions.js.map +1 -0
  107. package/lib/{deltaStorageService.d.mts → deltaStorageService.d.ts} +4 -4
  108. package/lib/deltaStorageService.d.ts.map +1 -0
  109. package/lib/{deltaStorageService.mjs → deltaStorageService.js} +2 -2
  110. package/lib/deltaStorageService.js.map +1 -0
  111. package/lib/{documentDeltaConnection.d.mts → documentDeltaConnection.d.ts} +2 -2
  112. package/lib/documentDeltaConnection.d.ts.map +1 -0
  113. package/lib/{documentDeltaConnection.mjs → documentDeltaConnection.js} +3 -3
  114. package/lib/documentDeltaConnection.js.map +1 -0
  115. package/lib/{documentService.d.mts → documentService.d.ts} +7 -7
  116. package/lib/documentService.d.ts.map +1 -0
  117. package/lib/{documentService.mjs → documentService.js} +12 -12
  118. package/lib/documentService.js.map +1 -0
  119. package/lib/{documentServiceFactory.d.mts → documentServiceFactory.d.ts} +4 -4
  120. package/lib/documentServiceFactory.d.ts.map +1 -0
  121. package/lib/{documentServiceFactory.mjs → documentServiceFactory.js} +9 -9
  122. package/lib/documentServiceFactory.js.map +1 -0
  123. package/lib/{documentStorageService.d.mts → documentStorageService.d.ts} +8 -8
  124. package/lib/documentStorageService.d.ts.map +1 -0
  125. package/lib/{documentStorageService.mjs → documentStorageService.js} +3 -3
  126. package/lib/documentStorageService.js.map +1 -0
  127. package/lib/{errorUtils.d.mts → errorUtils.d.ts} +2 -2
  128. package/lib/errorUtils.d.ts.map +1 -0
  129. package/lib/{errorUtils.mjs → errorUtils.js} +3 -4
  130. package/lib/errorUtils.js.map +1 -0
  131. package/lib/{gitManager.d.mts → gitManager.d.ts} +4 -4
  132. package/lib/gitManager.d.ts.map +1 -0
  133. package/lib/{gitManager.mjs → gitManager.js} +1 -1
  134. package/lib/gitManager.js.map +1 -0
  135. package/lib/{historian.d.mts → historian.d.ts} +5 -5
  136. package/lib/historian.d.ts.map +1 -0
  137. package/lib/{historian.mjs → historian.js} +1 -1
  138. package/lib/historian.js.map +1 -0
  139. package/lib/{index.d.mts → index.d.ts} +7 -7
  140. package/lib/index.d.ts.map +1 -0
  141. package/lib/index.js +11 -0
  142. package/lib/index.js.map +1 -0
  143. package/lib/{mapWithExpiration.d.mts → mapWithExpiration.d.ts} +1 -1
  144. package/lib/mapWithExpiration.d.ts.map +1 -0
  145. package/lib/{mapWithExpiration.mjs → mapWithExpiration.js} +1 -1
  146. package/lib/mapWithExpiration.js.map +1 -0
  147. package/lib/{nullBlobStorageService.d.mts → nullBlobStorageService.d.ts} +1 -1
  148. package/lib/nullBlobStorageService.d.ts.map +1 -0
  149. package/lib/{nullBlobStorageService.mjs → nullBlobStorageService.js} +1 -1
  150. package/lib/nullBlobStorageService.js.map +1 -0
  151. package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
  152. package/lib/packageVersion.d.ts.map +1 -0
  153. package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
  154. package/lib/packageVersion.js.map +1 -0
  155. package/lib/{policies.d.mts → policies.d.ts} +1 -1
  156. package/lib/policies.d.ts.map +1 -0
  157. package/lib/{contracts.mjs → policies.js} +1 -1
  158. package/lib/policies.js.map +1 -0
  159. package/lib/{r11sSnapshotParser.d.mts → r11sSnapshotParser.d.ts} +2 -2
  160. package/lib/r11sSnapshotParser.d.ts.map +1 -0
  161. package/lib/{r11sSnapshotParser.mjs → r11sSnapshotParser.js} +1 -1
  162. package/lib/r11sSnapshotParser.js.map +1 -0
  163. package/lib/{restWrapper.d.mts → restWrapper.d.ts} +5 -5
  164. package/lib/restWrapper.d.ts.map +1 -0
  165. package/lib/{restWrapper.mjs → restWrapper.js} +7 -7
  166. package/lib/restWrapper.js.map +1 -0
  167. package/lib/{restWrapperBase.d.mts → restWrapperBase.d.ts} +3 -3
  168. package/lib/restWrapperBase.d.ts.map +1 -0
  169. package/lib/{restWrapperBase.mjs → restWrapperBase.js} +1 -1
  170. package/lib/restWrapperBase.js.map +1 -0
  171. package/lib/{retriableGitManager.d.mts → retriableGitManager.d.ts} +4 -4
  172. package/lib/retriableGitManager.d.ts.map +1 -0
  173. package/lib/{retriableGitManager.mjs → retriableGitManager.js} +1 -1
  174. package/lib/retriableGitManager.js.map +1 -0
  175. package/lib/{routerliciousResolvedUrl.d.mts → routerliciousResolvedUrl.d.ts} +1 -1
  176. package/lib/routerliciousResolvedUrl.d.ts.map +1 -0
  177. package/lib/{routerliciousResolvedUrl.mjs → routerliciousResolvedUrl.js} +1 -1
  178. package/lib/routerliciousResolvedUrl.js.map +1 -0
  179. package/lib/{shreddedSummaryDocumentStorageService.d.mts → shreddedSummaryDocumentStorageService.d.ts} +7 -7
  180. package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -0
  181. package/lib/{shreddedSummaryDocumentStorageService.mjs → shreddedSummaryDocumentStorageService.js} +6 -6
  182. package/lib/shreddedSummaryDocumentStorageService.js.map +1 -0
  183. package/lib/{storageContracts.d.mts → storageContracts.d.ts} +3 -3
  184. package/lib/storageContracts.d.ts.map +1 -0
  185. package/lib/storageContracts.js +6 -0
  186. package/lib/storageContracts.js.map +1 -0
  187. package/lib/{summaryTreeUploadManager.d.mts → summaryTreeUploadManager.d.ts} +2 -2
  188. package/lib/summaryTreeUploadManager.d.ts.map +1 -0
  189. package/lib/{summaryTreeUploadManager.mjs → summaryTreeUploadManager.js} +2 -2
  190. package/lib/summaryTreeUploadManager.js.map +1 -0
  191. package/lib/test/cache.spec.js +43 -0
  192. package/lib/test/cache.spec.js.map +1 -0
  193. package/lib/test/errorUtils.spec.js +227 -0
  194. package/lib/test/errorUtils.spec.js.map +1 -0
  195. package/lib/test/mapWithExpiration.spec.js +205 -0
  196. package/lib/test/mapWithExpiration.spec.js.map +1 -0
  197. package/lib/test/restWrapper.spec.js +309 -0
  198. package/lib/test/restWrapper.spec.js.map +1 -0
  199. package/lib/test/types/validateRouterliciousDriverPrevious.generated.js +22 -0
  200. package/lib/test/types/validateRouterliciousDriverPrevious.generated.js.map +1 -0
  201. package/lib/test/urlUtils.spec.js +62 -0
  202. package/lib/test/urlUtils.spec.js.map +1 -0
  203. package/lib/test/wholeSummaryDocumentStorageService.spec.js +144 -0
  204. package/lib/test/wholeSummaryDocumentStorageService.spec.js.map +1 -0
  205. package/lib/{tokens.d.mts → tokens.d.ts} +1 -1
  206. package/lib/tokens.d.ts.map +1 -0
  207. package/lib/{tokens.mjs → tokens.js} +1 -1
  208. package/lib/tokens.js.map +1 -0
  209. package/lib/{treeUtils.d.mts → treeUtils.d.ts} +3 -3
  210. package/lib/treeUtils.d.ts.map +1 -0
  211. package/lib/{treeUtils.mjs → treeUtils.js} +1 -1
  212. package/lib/treeUtils.js.map +1 -0
  213. package/lib/{urlUtils.d.mts → urlUtils.d.ts} +1 -1
  214. package/lib/urlUtils.d.ts.map +1 -0
  215. package/lib/{urlUtils.mjs → urlUtils.js} +1 -1
  216. package/lib/urlUtils.js.map +1 -0
  217. package/lib/{wholeSummaryDocumentStorageService.d.mts → wholeSummaryDocumentStorageService.d.ts} +7 -7
  218. package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -0
  219. package/lib/{wholeSummaryDocumentStorageService.mjs → wholeSummaryDocumentStorageService.js} +7 -7
  220. package/lib/wholeSummaryDocumentStorageService.js.map +1 -0
  221. package/lib/{wholeSummaryUploadManager.d.mts → wholeSummaryUploadManager.d.ts} +2 -2
  222. package/lib/wholeSummaryUploadManager.d.ts.map +1 -0
  223. package/lib/{wholeSummaryUploadManager.mjs → wholeSummaryUploadManager.js} +1 -1
  224. package/lib/wholeSummaryUploadManager.js.map +1 -0
  225. package/package.json +46 -40
  226. package/src/axios.cts +8 -0
  227. package/src/cache.ts +1 -1
  228. package/src/defaultTokenProvider.ts +1 -1
  229. package/src/deltaStorageService.ts +5 -5
  230. package/src/documentDeltaConnection.ts +3 -3
  231. package/src/documentService.ts +17 -17
  232. package/src/documentServiceFactory.ts +14 -14
  233. package/src/documentStorageService.ts +9 -9
  234. package/src/errorUtils.ts +5 -6
  235. package/src/gitManager.ts +3 -3
  236. package/src/historian.ts +4 -4
  237. package/src/index.ts +6 -6
  238. package/src/packageVersion.ts +1 -1
  239. package/src/r11sSnapshotParser.ts +6 -2
  240. package/src/restWrapper.ts +12 -12
  241. package/src/restWrapperBase.ts +2 -2
  242. package/src/retriableGitManager.ts +4 -4
  243. package/src/shreddedSummaryDocumentStorageService.ts +15 -15
  244. package/src/storageContracts.ts +2 -2
  245. package/src/summaryTreeUploadManager.ts +2 -2
  246. package/src/treeUtils.ts +2 -2
  247. package/src/wholeSummaryDocumentStorageService.ts +17 -17
  248. package/src/wholeSummaryUploadManager.ts +1 -1
  249. package/tsconfig.cjs.json +7 -0
  250. package/tsconfig.json +2 -5
  251. package/lib/cache.d.mts.map +0 -1
  252. package/lib/cache.mjs.map +0 -1
  253. package/lib/contracts.d.mts.map +0 -1
  254. package/lib/contracts.mjs.map +0 -1
  255. package/lib/createNewUtils.d.mts.map +0 -1
  256. package/lib/createNewUtils.mjs.map +0 -1
  257. package/lib/defaultTokenProvider.d.mts.map +0 -1
  258. package/lib/defaultTokenProvider.mjs.map +0 -1
  259. package/lib/definitions.d.mts.map +0 -1
  260. package/lib/definitions.mjs.map +0 -1
  261. package/lib/deltaStorageService.d.mts.map +0 -1
  262. package/lib/deltaStorageService.mjs.map +0 -1
  263. package/lib/documentDeltaConnection.d.mts.map +0 -1
  264. package/lib/documentDeltaConnection.mjs.map +0 -1
  265. package/lib/documentService.d.mts.map +0 -1
  266. package/lib/documentService.mjs.map +0 -1
  267. package/lib/documentServiceFactory.d.mts.map +0 -1
  268. package/lib/documentServiceFactory.mjs.map +0 -1
  269. package/lib/documentStorageService.d.mts.map +0 -1
  270. package/lib/documentStorageService.mjs.map +0 -1
  271. package/lib/errorUtils.d.mts.map +0 -1
  272. package/lib/errorUtils.mjs.map +0 -1
  273. package/lib/gitManager.d.mts.map +0 -1
  274. package/lib/gitManager.mjs.map +0 -1
  275. package/lib/historian.d.mts.map +0 -1
  276. package/lib/historian.mjs.map +0 -1
  277. package/lib/index.d.mts.map +0 -1
  278. package/lib/index.mjs +0 -8
  279. package/lib/index.mjs.map +0 -1
  280. package/lib/mapWithExpiration.d.mts.map +0 -1
  281. package/lib/mapWithExpiration.mjs.map +0 -1
  282. package/lib/nullBlobStorageService.d.mts.map +0 -1
  283. package/lib/nullBlobStorageService.mjs.map +0 -1
  284. package/lib/packageVersion.d.mts.map +0 -1
  285. package/lib/packageVersion.mjs.map +0 -1
  286. package/lib/policies.d.mts.map +0 -1
  287. package/lib/policies.mjs.map +0 -1
  288. package/lib/r11sSnapshotParser.d.mts.map +0 -1
  289. package/lib/r11sSnapshotParser.mjs.map +0 -1
  290. package/lib/restWrapper.d.mts.map +0 -1
  291. package/lib/restWrapper.mjs.map +0 -1
  292. package/lib/restWrapperBase.d.mts.map +0 -1
  293. package/lib/restWrapperBase.mjs.map +0 -1
  294. package/lib/retriableGitManager.d.mts.map +0 -1
  295. package/lib/retriableGitManager.mjs.map +0 -1
  296. package/lib/routerliciousResolvedUrl.d.mts.map +0 -1
  297. package/lib/routerliciousResolvedUrl.mjs.map +0 -1
  298. package/lib/shreddedSummaryDocumentStorageService.d.mts.map +0 -1
  299. package/lib/shreddedSummaryDocumentStorageService.mjs.map +0 -1
  300. package/lib/storageContracts.d.mts.map +0 -1
  301. package/lib/storageContracts.mjs.map +0 -1
  302. package/lib/summaryTreeUploadManager.d.mts.map +0 -1
  303. package/lib/summaryTreeUploadManager.mjs.map +0 -1
  304. package/lib/tokens.d.mts.map +0 -1
  305. package/lib/tokens.mjs.map +0 -1
  306. package/lib/treeUtils.d.mts.map +0 -1
  307. package/lib/treeUtils.mjs.map +0 -1
  308. package/lib/urlUtils.d.mts.map +0 -1
  309. package/lib/urlUtils.mjs.map +0 -1
  310. package/lib/wholeSummaryDocumentStorageService.d.mts.map +0 -1
  311. package/lib/wholeSummaryDocumentStorageService.mjs.map +0 -1
  312. package/lib/wholeSummaryUploadManager.d.mts.map +0 -1
  313. package/lib/wholeSummaryUploadManager.mjs.map +0 -1
  314. /package/lib/{routerlicious-driver-alpha.d.mts → routerlicious-driver-alpha.d.ts} +0 -0
  315. /package/lib/{routerlicious-driver-beta.d.mts → routerlicious-driver-beta.d.ts} +0 -0
  316. /package/lib/{routerlicious-driver-public.d.mts → routerlicious-driver-public.d.ts} +0 -0
  317. /package/lib/{routerlicious-driver-untrimmed.d.mts → routerlicious-driver-untrimmed.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wholeSummaryDocumentStorageService.spec.js","sourceRoot":"","sources":["../../src/test/wholeSummaryDocumentStorageService.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAgB,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAOpE,OAAO,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAE9F,yEAAyE;AACzE,MAAM,YAAY,GAA6B;IAC9C;QACC,EAAE,EAAE,2BAA2B;QAC/B,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,CAAC;KACP;IACD;QACC,EAAE,EAAE,2BAA2B;QAC/B,OAAO,EACN,+HAA+H;QAChI,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,GAAG;KACT;IACD;QACC,EAAE,EAAE,2BAA2B;QAC/B,OAAO,EACN,uJAAuJ;QACxJ,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,GAAG;KACT;CACD,CAAC;AAEF,gFAAgF;AAChF,MAAM,WAAW,GAAkC;IAClD;QACC,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,MAAM;KACZ;IACD;QACC,EAAE,EAAE,2BAA2B;QAC/B,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,MAAM;KACZ;IACD;QACC,EAAE,EAAE,2BAA2B;QAC/B,IAAI,EAAE,wBAAwB;QAC9B,IAAI,EAAE,MAAM;KACZ;IACD;QACC,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;KACZ;IACD;QACC,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,MAAM;KACZ;IACD;QACC,IAAI,EAAE,yBAAyB;QAC/B,IAAI,EAAE,MAAM;KACZ;IACD;QACC,EAAE,EAAE,2BAA2B;QAC/B,IAAI,EAAE,gBAAgB;QAC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,EAAE;YACd,UAAU,EAAE,EAAE;SACd,CAAC;IACH,CAAC;CACD;AAED,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IACnD,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,OAAO,GAAG,IAAI,kCAAkC,CACrD,IAAI,EACJ,IAAI,cAAc,EAAS,EAC3B,iBAAiB,CAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,EACvD,EAAE,CACF,CAAC;QAEF,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC;YACzC,IAAI,EAAE,WAAW,CAAC,MAAM;YACxB,UAAU,EAAE,WAAW,CAAC,IAAI;YAC5B,MAAM,EAAE,YAAY;SACpB,CAAC,CAAC;QACH,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,eAAe,EAAE,8BAA8B,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport assert from \"assert\";\nimport { ISummaryTree, SummaryType } from \"@fluidframework/protocol-definitions\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils\";\nimport {\n\tIWholeFlatSnapshot,\n\tIWholeFlatSnapshotBlob,\n\tIWholeFlatSnapshotTreeEntry,\n} from \"../contracts.js\";\nimport { IR11sResponse } from \"../restWrapper.js\";\nimport { WholeSummaryDocumentStorageService } from \"../wholeSummaryDocumentStorageService.js\";\n\n/* Blobs contained within source snapshot tree returned by git manager */\nconst summaryBlobs: IWholeFlatSnapshotBlob[] = [\n\t{\n\t\tid: \"bARCTBK4PQiMLVK2gR5hPRkId\",\n\t\tcontent: \"[]\",\n\t\tencoding: \"utf-8\",\n\t\tsize: 2,\n\t},\n\t{\n\t\tid: \"bARCfbIYtOyFwf1+nY75C4UFc\",\n\t\tcontent:\n\t\t\t'{\"createContainerRuntimeVersion\":\"0.59.1000\",\"createContainerTimestamp\":1651351060440,\"summaryFormatVersion\":1,\"gcFeature\":0}',\n\t\tencoding: \"utf-8\",\n\t\tsize: 125,\n\t},\n\t{\n\t\tid: \"bARAL2CXvHYOch_aQtJAJOker\",\n\t\tcontent:\n\t\t\t'[[\"code\",{\"key\":\"code\",\"value\":{\"package\":\"no-dynamic-package\",\"config\":{}},\"approvalSequenceNumber\":0,\"commitSequenceNumber\":0,\"sequenceNumber\":0}]]',\n\t\tencoding: \"utf-8\",\n\t\tsize: 149,\n\t},\n];\n\n/* Tree entries contained within source snapshot tree returned by git manager */\nconst treeEntries: IWholeFlatSnapshotTreeEntry[] = [\n\t{\n\t\tpath: \".protocol\",\n\t\ttype: \"tree\",\n\t},\n\t{\n\t\tid: \"bARCTBK4PQiMLVK2gR5hPRkId\",\n\t\tpath: \".protocol/attributes\",\n\t\ttype: \"blob\",\n\t},\n\t{\n\t\tid: \"bARAL2CXvHYOch_aQtJAJOker\",\n\t\tpath: \".protocol/quorumValues\",\n\t\ttype: \"blob\",\n\t},\n\t{\n\t\tpath: \".app\",\n\t\ttype: \"tree\",\n\t},\n\t{\n\t\tpath: \".app/.channels\",\n\t\ttype: \"tree\",\n\t},\n\t{\n\t\tpath: \".app/.channels/rootDOId\",\n\t\ttype: \"tree\",\n\t},\n\t{\n\t\tid: \"bARCfbIYtOyFwf1+nY75C4UFc\",\n\t\tpath: \".app/.metadata\",\n\t\ttype: \"blob\",\n\t},\n];\n\n/* Source snapshot returned by git manager */\nconst flatSnapshot: IWholeFlatSnapshot = {\n\tid: \"bBwAAAAAHAAAA\",\n\ttrees: [\n\t\t{\n\t\t\tid: \"bBwAAAAAHAAAA\",\n\t\t\tsequenceNumber: 0,\n\t\t\tentries: treeEntries,\n\t\t},\n\t],\n\tblobs: summaryBlobs,\n};\n\n/* Expoected summary to be returned by downloadSummary */\nconst expectedSummary: ISummaryTree = {\n\ttree: {\n\t\t\".app\": {\n\t\t\ttree: {\n\t\t\t\t\".channels\": {\n\t\t\t\t\ttree: {\n\t\t\t\t\t\trootDOId: {\n\t\t\t\t\t\t\ttree: {},\n\t\t\t\t\t\t\ttype: 1,\n\t\t\t\t\t\t\tunreferenced: undefined,\n\t\t\t\t\t\t\tgroupId: undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\ttype: 1,\n\t\t\t\t\tunreferenced: undefined,\n\t\t\t\t\tgroupId: undefined,\n\t\t\t\t},\n\t\t\t\t\".metadata\": {\n\t\t\t\t\tcontent:\n\t\t\t\t\t\t'{\"createContainerRuntimeVersion\":\"0.59.1000\",\"createContainerTimestamp\":1651351060440,\"summaryFormatVersion\":1,\"gcFeature\":0}',\n\t\t\t\t\ttype: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\ttype: 1,\n\t\t\tunreferenced: undefined,\n\t\t\tgroupId: undefined,\n\t\t},\n\t\t\".protocol\": {\n\t\t\ttree: {\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: \"[]\",\n\t\t\t\t\ttype: 2,\n\t\t\t\t},\n\t\t\t\tquorumValues: {\n\t\t\t\t\tcontent:\n\t\t\t\t\t\t'[[\"code\",{\"key\":\"code\",\"value\":{\"package\":\"no-dynamic-package\",\"config\":{}},\"approvalSequenceNumber\":0,\"commitSequenceNumber\":0,\"sequenceNumber\":0}]]',\n\t\t\t\t\ttype: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\ttype: 1,\n\t\t\tunreferenced: undefined,\n\t\t\tgroupId: undefined,\n\t\t},\n\t},\n\ttype: 1,\n\tunreferenced: undefined,\n\tgroupId: undefined,\n};\n\nclass MockGitManager {\n\tpublic async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {\n\t\treturn {\n\t\t\tcontent: flatSnapshot,\n\t\t\theaders: new Map(),\n\t\t\tpropsToLog: {},\n\t\t\trequestUrl: \"\",\n\t\t};\n\t}\n}\n\ndescribe(\"WholeSummaryDocumentStorageService\", () => {\n\tit(\"downloads summaries in expected format\", async () => {\n\t\tconst service = new WholeSummaryDocumentStorageService(\n\t\t\t\"id\",\n\t\t\tnew MockGitManager() as any,\n\t\t\tcreateChildLogger({ namespace: \"fluid:testSummaries\" }),\n\t\t\t{},\n\t\t);\n\n\t\tconst res = await service.downloadSummary({\n\t\t\ttype: SummaryType.Handle,\n\t\t\thandleType: SummaryType.Tree,\n\t\t\thandle: \"testHandle\",\n\t\t});\n\t\tassert.deepStrictEqual(res, expectedSummary, \"Unexpected summary returned.\");\n\t});\n});\n"]}
@@ -80,4 +80,4 @@ export interface ITokenProvider {
80
80
  */
81
81
  documentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;
82
82
  }
83
- //# sourceMappingURL=tokens.d.mts.map
83
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B;;;;;;;;;;;;;;OAcG;IACH,0BAA0B,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtF"}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=tokens.mjs.map
6
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITokenClaims } from \"@fluidframework/protocol-definitions\";\n\n/**\n * Abstracts the discovery of claims contained within a token.\n * @internal\n */\nexport interface ITokenService {\n\t/**\n\t * Extracts the {@link @fluidframework/protocol-definitions#ITokenClaims | token claims} from the provided\n\t * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} string representation.\n\t */\n\textractClaims(token: string): ITokenClaims;\n}\n\n/**\n * @public\n */\nexport interface ITokenResponse {\n\t/**\n\t * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.\n\t */\n\tjwt: string;\n\n\t/**\n\t * A flag indicating whether token was obtained from local cache.\n\t *\n\t * @remarks `undefined` indicates that the source of the token could not be determined.\n\t */\n\tfromCache?: boolean;\n}\n\n/**\n * Abstracts the token fetching mechanism for a hosting application.\n * The hosting application is responsible for providing an implementation.\n * @public\n */\nexport interface ITokenProvider {\n\t/**\n\t * Fetches the orderer token from host.\n\t *\n\t * @param tenantId - Tenant ID.\n\t * @param documentId - Optional. Document ID is only required for document-scoped requests.\n\t * @param refresh - Optional flag indicating whether token fetch must bypass local cache.\n\t * This likely indicates that some previous request failed authorization due to an expired token,\n\t * and so a fresh token is required.\n\t *\n\t * Default: `false`.\n\t *\n\t * NOTE: This parameter will be made required in the future.\n\t */\n\tfetchOrdererToken(\n\t\ttenantId: string,\n\t\tdocumentId?: string,\n\t\trefresh?: boolean,\n\t): Promise<ITokenResponse>;\n\n\t/**\n\t * Fetches the storage token from host.\n\t *\n\t * @param tenantId - Tenant ID.\n\t * @param documentId - Document ID.\n\t * @param refresh - Optional flag indicating whether token fetch must bypass local cache.\n\t * This likely indicates that some previous request failed authorization due to an expired token,\n\t * and so a fresh token is required.\n\t *\n\t * Default: `false`.\n\t *\n\t * NOTE: This parameter will be made required in the future.\n\t */\n\tfetchStorageToken(\n\t\ttenantId: string,\n\t\tdocumentId: string,\n\t\trefresh?: boolean,\n\t): Promise<ITokenResponse>;\n\n\t/**\n\t * A callback triggered directly after creating the document. In this callback the client has the opportunity, to\n\t * verify against an authorization service, if the user who claims to create the document is the same user who\n\t * created it.\n\t *\n\t * @remarks Notes:\n\t *\n\t * * Using the callback may have performance impact on the document creation process.\n\t *\n\t * * Any exceptions thrown in the callback would fail the creation workflow.\n\t *\n\t * @param documentId - Document ID.\n\t * @param creationToken - A special token that doesn't provide any kind of access, but it has the user's payload\n\t * and document id. It can be used to validate the identity of the document creator.\n\t */\n\tdocumentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { SummaryType, ISnapshotTree, ISummaryTree } from "@fluidframework/protocol-definitions";
6
- import { INormalizedWholeSnapshot } from "./contracts.mjs";
5
+ import { ISnapshotTree, ISummaryTree, SummaryType } from "@fluidframework/protocol-definitions";
6
+ import { INormalizedWholeSnapshot } from "./contracts.js";
7
7
  /**
8
8
  * Summary tree assembler props
9
9
  */
@@ -56,4 +56,4 @@ export declare function evalBlobsAndTrees(snapshot: INormalizedWholeSnapshot): {
56
56
  encodedBlobsSize: number;
57
57
  };
58
58
  export declare function validateBlobsAndTrees(snapshot: ISnapshotTree): void;
59
- //# sourceMappingURL=treeUtils.d.mts.map
59
+ //# sourceMappingURL=tre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AAC,QAAQ,EAAE,aAAa,QAS5D"}
@@ -99,4 +99,4 @@ function countTreesInSnapshotTree(snapshotTree) {
99
99
  }
100
100
  return numTrees;
101
101
  }
102
- //# sourceMappingURL=treeUtils.mjs.map
102
+ //# sourceMappingURL=treeUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeUtils.js","sourceRoot":"","sources":["../src/treeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAIN,WAAW,GACX,MAAM,sCAAsC,CAAC;AAc9C;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAIhC,YAA6B,KAAkC;QAAlC,UAAK,GAAL,KAAK,CAA6B;QAHvD,sBAAiB,GAAW,CAAC,CAAC;QACrB,gBAAW,GAAsC,EAAE,CAAC;IAEH,CAAC;IAEnE;;OAEG;IACH,IAAW,OAAO;QACjB,OAAO;YACN,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;YAC7B,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY;YACtC,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO;SAC5B,CAAC;IACH,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,GAAW,EAAE,OAA4B;QACvD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG;YACvB,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,OAAO;SACP,CAAC;IACH,CAAC;IAED;;OAEG;IACI,SAAS,CACf,GAAW,EACX,UAAwE,EACxE,MAAc;QAEd,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG;YACvB,IAAI,EAAE,WAAW,CAAC,MAAM;YACxB,UAAU;YACV,MAAM;SACN,CAAC;IACH,CAAC;IAED;;OAEG;IACI,OAAO,CAAC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Q,CAAC,YAAY,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;IACrC,IAAI,gBAAgB,GAAG,CAAC,CAAC;IACzB,KAAK,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,IAAI,QAAQ,CAAC,KAAK,EAAE;QAC9C,gBAAgB,IAAI,WAAW,CAAC,UAAU,CAAC;KAC3C;IACD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,QAAuB;IAC5D,MAAM,CACL,QAAQ,CAAC,KAAK,KAAK,SAAS,EAC5B,KAAK,CAAC,oDAAoD,CAC1D,CAAC;IACF,MAAM,CACL,QAAQ,CAAC,KAAK,KAAK,SAAS,EAC5B,KAAK,CAAC,oDAAoD,CAC1D,CAAC;AACH,CAAC;AAED,SAAS,wBAAwB,CAAC,YAA2B;IAC5D,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,KAAK,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;QAC3D,QAAQ,IAAI,CAAC,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC;KAC/C;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tISnapshotTree,\n\tISummaryTree,\n\tSummaryObject,\n\tSummaryType,\n} from \"@fluidframework/protocol-definitions\";\nimport { INormalizedWholeSnapshot } from \"./contracts.js\";\n\n/**\n * Summary tree assembler props\n */\nexport interface ISummaryTreeAssemblerProps {\n\t/**\n\t * Indicates that this tree is unreferenced. If this is not present, the tree is considered referenced.\n\t */\n\tunreferenced?: true;\n\tgroupId?: string;\n}\n\n/**\n * Summary tree assembler (without stats collection).\n */\nexport class SummaryTreeAssembler {\n\tprivate attachmentCounter: number = 0;\n\tprivate readonly summaryTree: { [path: string]: SummaryObject } = {};\n\n\tconstructor(private readonly props?: ISummaryTreeAssemblerProps) {}\n\n\t/**\n\t * Get final summary\n\t */\n\tpublic get summary(): ISummaryTree {\n\t\treturn {\n\t\t\ttype: SummaryType.Tree,\n\t\t\ttree: { ...this.summaryTree },\n\t\t\tunreferenced: this.props?.unreferenced,\n\t\t\tgroupId: this.props?.groupId,\n\t\t};\n\t}\n\n\t/**\n\t * Add blob to summary\n\t */\n\tpublic addBlob(key: string, content: string | Uint8Array): void {\n\t\tthis.summaryTree[key] = {\n\t\t\ttype: SummaryType.Blob,\n\t\t\tcontent,\n\t\t};\n\t}\n\n\t/**\n\t * Add handle to summary\n\t */\n\tpublic addHandle(\n\t\tkey: string,\n\t\thandleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment,\n\t\thandle: string,\n\t): void {\n\t\tthis.summaryTree[key] = {\n\t\t\ttype: SummaryType.Handle,\n\t\t\thandleType,\n\t\t\thandle,\n\t\t};\n\t}\n\n\t/**\n\t * Add tree to summary\n\t */\n\tpublic addTree(key: string, summary: ISummaryTree): void {\n\t\tthis.summaryTree[key] = summary;\n\t}\n\n\t/**\n\t * Add attachment to summary\n\t */\n\tpublic addAttachment(id: string) {\n\t\tthis.summaryTree[this.attachmentCounter++] = { id, type: SummaryType.Attachment };\n\t}\n}\n\n/**\n * Helper function that converts ISnapshotTree and blobs to ISummaryTree\n * @param snapshot - Source snapshot tree\n * @param blobs - Blobs cache\n * @returns Converted snapshot in ISummaryTree format\n */\nexport function convertSnapshotAndBlobsToSummaryTree(\n\tsnapshot: ISnapshotTree,\n\tblobs: Map<string, ArrayBuffer>,\n): ISummaryTree {\n\tconst assembler = new SummaryTreeAssembler({\n\t\tunreferenced: snapshot.unreferenced,\n\t\tgroupId: snapshot.groupId,\n\t});\n\tfor (const [path, id] of Object.entries(snapshot.blobs)) {\n\t\tconst blob = blobs.get(id);\n\t\tassert(blob !== undefined, 0x2dd /* \"Cannot find blob for a given id\" */);\n\t\tassembler.addBlob(path, IsoBuffer.from(blob).toString(\"utf-8\"));\n\t}\n\tfor (const [key, tree] of Object.entries(snapshot.trees)) {\n\t\tconst subtree = convertSnapshotAndBlobsToSummaryTree(tree, blobs);\n\t\tassembler.addTree(key, subtree);\n\t}\n\treturn assembler.summary;\n}\n\nexport function evalBlobsAndTrees(snapshot: INormalizedWholeSnapshot) {\n\tconst trees = countTreesInSnapshotTree(snapshot.snapshotTree);\n\tconst numBlobs = snapshot.blobs.size;\n\tlet encodedBlobsSize = 0;\n\tfor (const [_, blobContent] of snapshot.blobs) {\n\t\tencodedBlobsSize += blobContent.byteLength;\n\t}\n\treturn { trees, numBlobs, encodedBlobsSize };\n}\n\nexport function validateBlobsAndTrees(snapshot: ISnapshotTree) {\n\tassert(\n\t\tsnapshot.trees !== undefined,\n\t\t0x5d0 /* Returned r11s snapshot is malformed. No trees! */,\n\t);\n\tassert(\n\t\tsnapshot.blobs !== undefined,\n\t\t0x5d1 /* Returned r11s snapshot is malformed. No blobs! */,\n\t);\n}\n\nfunction countTreesInSnapshotTree(snapshotTree: ISnapshotTree): number {\n\tlet numTrees = 0;\n\tfor (const [_, tree] of Object.entries(snapshotTree.trees)) {\n\t\tnumTrees += 1 + countTreesInSnapshotTree(tree);\n\t}\n\treturn numTrees;\n}\n"]}
@@ -12,4 +12,4 @@ import { ISession } from "@fluidframework/server-services-client";
12
12
  */
13
13
  export declare const replaceDocumentIdInPath: (urlPath: string, documentId: string) => string;
14
14
  export declare const getDiscoveredFluidResolvedUrl: (resolvedUrl: IResolvedUrl, session: ISession) => IResolvedUrl;
15
- //# sourceMappingURL=urlUtils.d.mts.map
15
+ //# sourceMappingURL=urlUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlUtils.d.ts","sourceRoot":"","sources":["../src/urlUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,YAAa,MAAM,cAAc,MAAM,KAAG,MACf,CAAC;AAEhE,eAAO,MAAM,6BAA6B,gBAC5B,YAAY,WAChB,QAAQ,KACf,YAuBF,CAAC"}
@@ -31,4 +31,4 @@ export const getDiscoveredFluidResolvedUrl = (resolvedUrl, session) => {
31
31
  };
32
32
  return discoveredResolvedUrl;
33
33
  };
34
- //# sourceMappingURL=urlUtils.mjs.map
34
+ //# sourceMappingURL=urlUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlUtils.js","sourceRoot":"","sources":["../src/urlUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAe,EAAE,UAAkB,EAAU,EAAE,CACtF,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC5C,WAAyB,EACzB,OAAiB,EACF,EAAE;IACjB,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACzD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IACvE,eAAe,CAAC,IAAI,GAAG,oBAAoB,CAAC,IAAI,CAAC;IAEjD,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC7D,UAAU,CAAC,IAAI,GAAG,oBAAoB,CAAC,IAAI,CAAC;IAE5C,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC3C,MAAM,qBAAqB,GAAiB;QAC3C,SAAS,EAAE;YACV,eAAe,EAAE,eAAe,CAAC,QAAQ,EAAE;YAC3C,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,UAAU,EAAE,UAAU,CAAC,QAAQ,EAAE;SACjC;QACD,EAAE,EAAE,WAAW,CAAC,EAAE;QAClB,MAAM,EAAE,WAAW,CAAC,MAAM;QAC1B,IAAI,EAAE,WAAW,CAAC,IAAI;QACtB,GAAG,EAAE,IAAI,GAAG,CAAC,WAAW,oBAAoB,CAAC,IAAI,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE;KACpF,CAAC;IACF,OAAO,qBAAqB,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { ISession } from \"@fluidframework/server-services-client\";\n\n/**\n * Assume documentId is at end of url path.\n * This is true for Routerlicious' and Tinylicious' documentUrl and deltaStorageUrl.\n * Routerlicious and Tinylicious do not use documentId in storageUrl nor ordererUrl.\n * TODO: Ideally we would be able to regenerate the resolvedUrl, rather than patching the current one.\n */\nexport const replaceDocumentIdInPath = (urlPath: string, documentId: string): string =>\n\turlPath.split(\"/\").slice(0, -1).concat([documentId]).join(\"/\");\n\nexport const getDiscoveredFluidResolvedUrl = (\n\tresolvedUrl: IResolvedUrl,\n\tsession: ISession,\n): IResolvedUrl => {\n\tconst discoveredOrdererUrl = new URL(session.ordererUrl);\n\tconst deltaStorageUrl = new URL(resolvedUrl.endpoints.deltaStorageUrl);\n\tdeltaStorageUrl.host = discoveredOrdererUrl.host;\n\n\tconst discoveredStorageUrl = new URL(session.historianUrl);\n\tconst storageUrl = new URL(resolvedUrl.endpoints.storageUrl);\n\tstorageUrl.host = discoveredStorageUrl.host;\n\n\tconst parsedUrl = new URL(resolvedUrl.url);\n\tconst discoveredResolvedUrl: IResolvedUrl = {\n\t\tendpoints: {\n\t\t\tdeltaStorageUrl: deltaStorageUrl.toString(),\n\t\t\tordererUrl: session.ordererUrl,\n\t\t\tdeltaStreamUrl: session.deltaStreamUrl,\n\t\t\tstorageUrl: storageUrl.toString(),\n\t\t},\n\t\tid: resolvedUrl.id,\n\t\ttokens: resolvedUrl.tokens,\n\t\ttype: resolvedUrl.type,\n\t\turl: new URL(`https://${discoveredOrdererUrl.host}${parsedUrl.pathname}`).toString(),\n\t};\n\treturn discoveredResolvedUrl;\n};\n"]}
@@ -2,13 +2,13 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
6
- import { IDocumentStorageService, ISummaryContext, IDocumentStorageServicePolicies } from "@fluidframework/driver-definitions";
5
+ import { IDocumentStorageService, IDocumentStorageServicePolicies, ISummaryContext } from "@fluidframework/driver-definitions";
7
6
  import { ICreateBlobResponse, ISnapshotTree, ISummaryHandle, ISummaryTree, IVersion } from "@fluidframework/protocol-definitions";
8
- import { ICache } from "./cache.mjs";
9
- import { IRouterliciousDriverPolicies } from "./policies.mjs";
10
- import { GitManager } from "./gitManager.mjs";
11
- import { INormalizedWholeSnapshot } from "./contracts.mjs";
7
+ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
8
+ import { ICache } from "./cache.js";
9
+ import { INormalizedWholeSnapshot } from "./contracts.js";
10
+ import { GitManager } from "./gitManager.js";
11
+ import { IRouterliciousDriverPolicies } from "./policies.js";
12
12
  export declare class WholeSummaryDocumentStorageService implements IDocumentStorageService {
13
13
  protected readonly id: string;
14
14
  protected readonly manager: GitManager;
@@ -34,4 +34,4 @@ export declare class WholeSummaryDocumentStorageService implements IDocumentStor
34
34
  private updateBlobsCache;
35
35
  private getCacheKey;
36
36
  }
37
- //# sourceMappingURL=wholeSummaryDocumentStorageService.d.mts.map
37
+ //# sourceMappingURL=wholeSummaryDocumentStorageService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wholeSummaryDocumentStorageService.d.ts","sourceRoot":"","sources":["../src/wholeSummaryDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,uBAAuB,EACvB,+BAA+B,EAC/B,eAAe,EACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,mBAAmB,EAInB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,MAAM,EAAiB,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAsB,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAa7D,qBAAa,kCAAmC,YAAW,uBAAuB;IAUhF,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM;IAC7B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU;IACtC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,mBAAmB;aAC9B,QAAQ,EAAE,+BAA+B;IACzD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACnC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAjBnC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;IACvC,OAAO,CAAC,iBAAiB,CAAiB;YAE5B,uBAAuB;gBAMjB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,mBAAmB,EAC9B,QAAQ,EAAE,+BAA+B,EACxC,cAAc,CAAC,0CAA8B,EAC7C,SAAS,GAAE,MAAM,CAAC,eAAe,CAAuB,EACxD,iBAAiB,GAAE,MAAM,CAAC,wBAAwB,CAAuB,EACzE,iBAAiB,CAAC,wBAAY,EAC9B,iBAAiB,GAAE,CACnC,YAAY,CAAC,EAAE,OAAO,KAClB,OAAO,CAAC,UAAU,CAGP;IAQJ,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IA0FzE,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IA+BlE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAgClD,wBAAwB,CACpC,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC;IAqBL,eAAe,CAAC,aAAa,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAwBrE,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC;YAqB9D,iBAAiB;YA4CjB,sBAAsB;YAetB,gBAAgB;IAS9B,OAAO,CAAC,WAAW;CAGnB"}
@@ -2,14 +2,14 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { PerformanceEvent, createChildMonitoringContext, } from "@fluidframework/telemetry-utils";
6
- import { performance, stringToBuffer, Uint8ArrayToString } from "@fluid-internal/client-utils";
5
+ import { Uint8ArrayToString, performance, stringToBuffer } from "@fluid-internal/client-utils";
7
6
  import { assert } from "@fluidframework/core-utils";
8
7
  import { getW3CData, promiseRaceWithWinner } from "@fluidframework/driver-base";
9
- import { InMemoryCache } from "./cache.mjs";
10
- import { convertSnapshotAndBlobsToSummaryTree, evalBlobsAndTrees, validateBlobsAndTrees, } from "./treeUtils.mjs";
11
- import { WholeSummaryUploadManager } from "./wholeSummaryUploadManager.mjs";
12
- import { convertWholeFlatSnapshotToSnapshotTreeAndBlobs } from "./r11sSnapshotParser.mjs";
8
+ import { PerformanceEvent, createChildMonitoringContext, } from "@fluidframework/telemetry-utils";
9
+ import { InMemoryCache } from "./cache.js";
10
+ import { convertWholeFlatSnapshotToSnapshotTreeAndBlobs } from "./r11sSnapshotParser.js";
11
+ import { convertSnapshotAndBlobsToSummaryTree, evalBlobsAndTrees, validateBlobsAndTrees, } from "./treeUtils.js";
12
+ import { WholeSummaryUploadManager } from "./wholeSummaryUploadManager.js";
13
13
  const latestSnapshotId = "latest";
14
14
  export class WholeSummaryDocumentStorageService {
15
15
  async getSummaryUploadManager() {
@@ -245,4 +245,4 @@ export class WholeSummaryDocumentStorageService {
245
245
  return `${this.id}:${blobId}`;
246
246
  }
247
247
  }
248
- //# sourceMappingURL=wholeSummaryDocumentStorageService.mjs.map
248
+ //# sourceMappingURL=wholeSummaryDocumentStorageService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wholeSummaryDocumentStorageService.js","sourceRoot":"","sources":["../src/wholeSummaryDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAahF,OAAO,EAGN,gBAAgB,EAChB,4BAA4B,GAC5B,MAAM,iCAAiC,CAAC;AAC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AC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC;IAEO,WAAW,CAAC,MAAc;QACjC,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,MAAM,EAAE,CAAC;IAC/B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Uint8ArrayToString, performance, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { getW3CData, promiseRaceWithWinner } from \"@fluidframework/driver-base\";\nimport {\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISummaryContext,\n} from \"@fluidframework/driver-definitions\";\nimport {\n\tICreateBlobResponse,\n\tISnapshotTree,\n\tISummaryHandle,\n\tISummaryTree,\n\tIVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n\tITelemetryLoggerExt,\n\tMonitoringContext,\n\tPerformanceEvent,\n\tcreateChildMonitoringContext,\n} from \"@fluidframework/telemetry-utils\";\nimport { ICache, InMemoryCache } from \"./cache.js\";\nimport { INormalizedWholeSnapshot, IWholeFlatSnapshot } from \"./contracts.js\";\nimport { GitManager } from \"./gitManager.js\";\nimport { IRouterliciousDriverPolicies } from \"./policies.js\";\nimport { convertWholeFlatSnapshotToSnapshotTreeAndBlobs } from \"./r11sSnapshotParser.js\";\nimport { IR11sResponse } from \"./restWrapper.js\";\nimport { ISummaryUploadManager } from \"./storageContracts.js\";\nimport {\n\tconvertSnapshotAndBlobsToSummaryTree,\n\tevalBlobsAndTrees,\n\tvalidateBlobsAndTrees,\n} from \"./treeUtils.js\";\nimport { WholeSummaryUploadManager } from \"./wholeSummaryUploadManager.js\";\n\nconst latestSnapshotId: string = \"latest\";\n\nexport class WholeSummaryDocumentStorageService implements IDocumentStorageService {\n\tprivate readonly mc: MonitoringContext;\n\tprivate firstVersionsCall: boolean = true;\n\n\tprivate async getSummaryUploadManager(): Promise<ISummaryUploadManager> {\n\t\tconst manager = await this.getStorageManager();\n\t\treturn new WholeSummaryUploadManager(manager);\n\t}\n\n\tconstructor(\n\t\tprotected readonly id: string,\n\t\tprotected readonly manager: GitManager,\n\t\tprotected readonly logger: ITelemetryLoggerExt,\n\t\tpublic readonly policies: IDocumentStorageServicePolicies,\n\t\tprivate readonly driverPolicies?: IRouterliciousDriverPolicies,\n\t\tprivate readonly blobCache: ICache<ArrayBufferLike> = new InMemoryCache(),\n\t\tprivate readonly snapshotTreeCache: ICache<INormalizedWholeSnapshot> = new InMemoryCache(),\n\t\tprivate readonly noCacheGitManager?: GitManager,\n\t\tprivate readonly getStorageManager: (\n\t\t\tdisableCache?: boolean,\n\t\t) => Promise<GitManager> = async (disableCache) =>\n\t\t\tdisableCache && this.noCacheGitManager !== undefined\n\t\t\t\t? this.noCacheGitManager\n\t\t\t\t: this.manager,\n\t) {\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger,\n\t\t});\n\t}\n\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (versionId !== this.id && versionId !== null) {\n\t\t\t// Blobs/Trees in this scenario will never have multiple versions, so return versionId as is\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: versionId,\n\t\t\t\t\ttreeId: undefined!,\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t\t// If this is the first versions call for the document, we know we will want the latest summary.\n\t\t// Fetch latest summary, cache it, and return its id.\n\t\tif (this.firstVersionsCall && count === 1) {\n\t\t\tconst normalizedSnapshotContents = await PerformanceEvent.timedExecAsync(\n\t\t\t\tthis.logger,\n\t\t\t\t{\n\t\t\t\t\teventName: \"ObtainSnapshot\",\n\t\t\t\t\tversionId: versionId ?? undefined,\n\t\t\t\t\tcount,\n\t\t\t\t\tenableDiscovery: this.driverPolicies?.enableDiscovery,\n\t\t\t\t},\n\t\t\t\tasync (event) => {\n\t\t\t\t\tlet method: string;\n\t\t\t\t\tconst cachedSnapshotP = this.snapshotTreeCache.get(\n\t\t\t\t\t\tthis.getCacheKey(latestSnapshotId),\n\t\t\t\t\t);\n\n\t\t\t\t\tconst networkSnapshotP = !this.driverPolicies?.enableDiscovery\n\t\t\t\t\t\t? this.fetchSnapshotTree(latestSnapshotId, false, \"getVersions\")\n\t\t\t\t\t\t: this.fetchSnapshotTree(latestSnapshotId, true, \"getVersions\");\n\n\t\t\t\t\tconst promiseRaceWinner = await promiseRaceWithWinner([\n\t\t\t\t\t\tcachedSnapshotP.catch(() => undefined),\n\t\t\t\t\t\tnetworkSnapshotP.catch(() => undefined),\n\t\t\t\t\t]);\n\n\t\t\t\t\tlet retrievedSnapshot = promiseRaceWinner.value;\n\t\t\t\t\tmethod = promiseRaceWinner.index === 0 ? \"cache\" : \"network\";\n\n\t\t\t\t\tif (retrievedSnapshot === undefined) {\n\t\t\t\t\t\t// if network failed -> wait for cache ( then return network failure)\n\t\t\t\t\t\t// If cache returned empty or failed -> wait for network (success of failure)\n\t\t\t\t\t\tif (promiseRaceWinner.index === 1) {\n\t\t\t\t\t\t\tretrievedSnapshot = await cachedSnapshotP;\n\t\t\t\t\t\t\tmethod = \"cache\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (retrievedSnapshot === undefined) {\n\t\t\t\t\t\t\tretrievedSnapshot = await networkSnapshotP;\n\t\t\t\t\t\t\tmethod = \"network\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tevent.end({\n\t\t\t\t\t\tmethod,\n\t\t\t\t\t});\n\t\t\t\t\treturn retrievedSnapshot;\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tconst _id = await this.initializeFromSnapshot(normalizedSnapshotContents);\n\t\t\tthis.firstVersionsCall = false;\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: _id,\n\t\t\t\t\ttreeId: normalizedSnapshotContents.snapshotTree.id!,\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\t// Otherwise, get the latest version of the document as normal.\n\t\tconst id = versionId ? versionId : this.id;\n\t\tconst commits = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"getVersions\",\n\t\t\t\tversionId: id,\n\t\t\t\tcount,\n\t\t\t},\n\t\t\tasync () => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\treturn (await manager.getCommits(id, count)).content;\n\t\t\t},\n\t\t);\n\t\treturn commits.map((commit) => ({\n\t\t\tdate: commit.commit.author.date,\n\t\t\tid: commit.sha,\n\t\t\ttreeId: commit.commit.tree.sha,\n\t\t}));\n\t}\n\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n\t\tlet requestVersion = version;\n\t\tif (!requestVersion) {\n\t\t\tconst versions = await this.getVersions(this.id, 1);\n\t\t\tif (versions.length === 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\trequestVersion = versions[0];\n\t\t}\n\n\t\tlet normalizedWholeSnapshot = await this.snapshotTreeCache.get(\n\t\t\tthis.getCacheKey(requestVersion.id),\n\t\t);\n\t\tif (normalizedWholeSnapshot !== undefined) {\n\t\t\treturn normalizedWholeSnapshot.snapshotTree;\n\t\t}\n\n\t\tnormalizedWholeSnapshot = await this.fetchSnapshotTree(\n\t\t\trequestVersion.id,\n\t\t\tundefined,\n\t\t\t\"getSnapshotTree\",\n\t\t);\n\n\t\t// Currently retrieving blobs from network is not supported by AFR for WholeSummaryDocumentStorageService\n\t\t// Blobs are expected to be put in the cache\n\t\tawait this.updateBlobsCache(normalizedWholeSnapshot.blobs);\n\n\t\treturn normalizedWholeSnapshot.snapshotTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tconst cachedBlob = await this.blobCache.get(this.getCacheKey(blobId));\n\t\tif (cachedBlob !== undefined) {\n\t\t\treturn cachedBlob;\n\t\t}\n\n\t\t// Note: AFR does not support readBlobs, but potentially other r11s like servers do\n\t\tconst blob = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"readBlob\",\n\t\t\t\tblobId,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\tconst response = (await manager.getBlob(blobId)).content;\n\t\t\t\tevent.end({\n\t\t\t\t\tsize: response.size,\n\t\t\t\t});\n\t\t\t\treturn response;\n\t\t\t},\n\t\t\tundefined, // workers\n\t\t\tundefined, // recordHeapSize\n\t\t\tthis.mc.config.getNumber(\"Fluid.Driver.ReadBlobTelemetrySampling\"),\n\t\t);\n\t\tconst bufferValue = stringToBuffer(blob.content, blob.encoding);\n\n\t\tawait this.blobCache.put(this.getCacheKey(blob.sha), bufferValue);\n\n\t\treturn bufferValue;\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\tconst summaryHandle = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"uploadSummaryWithContext\",\n\t\t\t\tproposalHandle: context.proposalHandle,\n\t\t\t\tackHandle: context.ackHandle,\n\t\t\t\treferenceSequenceNumber: context.referenceSequenceNumber,\n\t\t\t},\n\t\t\tasync () => {\n\t\t\t\tconst summaryUploadManager = await this.getSummaryUploadManager();\n\t\t\t\treturn summaryUploadManager.writeSummaryTree(\n\t\t\t\t\tsummary,\n\t\t\t\t\tcontext.ackHandle ?? \"\",\n\t\t\t\t\t\"channel\",\n\t\t\t\t);\n\t\t\t},\n\t\t);\n\t\treturn summaryHandle;\n\t}\n\n\tpublic async downloadSummary(summaryHandle: ISummaryHandle): Promise<ISummaryTree> {\n\t\tconst wholeFlatSnapshot = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"getWholeFlatSummary\",\n\t\t\t\ttreeId: summaryHandle.handle,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\tconst response = await manager.getSnapshot(summaryHandle.handle);\n\t\t\t\tevent.end({\n\t\t\t\t\tsize: response.content.trees[0]?.entries.length,\n\t\t\t\t});\n\t\t\t\treturn response.content;\n\t\t\t},\n\t\t);\n\n\t\tconst { blobs, snapshotTree } = convertWholeFlatSnapshotToSnapshotTreeAndBlobs(\n\t\t\twholeFlatSnapshot,\n\t\t\t\"\",\n\t\t);\n\t\treturn convertSnapshotAndBlobsToSummaryTree(snapshotTree, blobs);\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\tconst uint8ArrayFile = new Uint8Array(file);\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"createBlob\",\n\t\t\t\tsize: uint8ArrayFile.length,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\tconst response = await manager\n\t\t\t\t\t.createBlob(Uint8ArrayToString(uint8ArrayFile, \"base64\"), \"base64\")\n\t\t\t\t\t.then((r) => ({ id: r.content.sha, url: r.content.url }));\n\t\t\t\tevent.end({\n\t\t\t\t\tblobId: response.id,\n\t\t\t\t});\n\t\t\t\treturn response;\n\t\t\t},\n\t\t);\n\t}\n\n\tprivate async fetchSnapshotTree(\n\t\tversionId: string,\n\t\tdisableCache?: boolean,\n\t\tscenarioName?: string,\n\t): Promise<INormalizedWholeSnapshot> {\n\t\tconst normalizedWholeSummary = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"getWholeFlatSummary\",\n\t\t\t\ttreeId: versionId,\n\t\t\t\tscenarioName,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst manager = await this.getStorageManager(disableCache);\n\t\t\t\tconst response: IR11sResponse<IWholeFlatSnapshot> =\n\t\t\t\t\tawait manager.getSnapshot(versionId);\n\t\t\t\tconst start = performance.now();\n\t\t\t\tconst snapshot: INormalizedWholeSnapshot =\n\t\t\t\t\tconvertWholeFlatSnapshotToSnapshotTreeAndBlobs(response.content);\n\t\t\t\tconst snapshotConversionTime = performance.now() - start;\n\t\t\t\tvalidateBlobsAndTrees(snapshot.snapshotTree);\n\t\t\t\tconst { trees, numBlobs, encodedBlobsSize } = evalBlobsAndTrees(snapshot);\n\n\t\t\t\tevent.end({\n\t\t\t\t\tsize: response.content.trees[0]?.entries.length,\n\t\t\t\t\ttrees,\n\t\t\t\t\tblobs: numBlobs,\n\t\t\t\t\tencodedBlobsSize,\n\t\t\t\t\tsequenceNumber: snapshot.sequenceNumber,\n\t\t\t\t\t...response.propsToLog,\n\t\t\t\t\tsnapshotConversionTime,\n\t\t\t\t\t...getW3CData(response.requestUrl, \"xmlhttprequest\"),\n\t\t\t\t});\n\t\t\t\treturn snapshot;\n\t\t\t},\n\t\t);\n\n\t\t// Also add the result into the cache.\n\t\tawait this.snapshotTreeCache\n\t\t\t.put(this.getCacheKey(versionId), normalizedWholeSummary)\n\t\t\t.catch(() => undefined);\n\t\treturn normalizedWholeSummary;\n\t}\n\n\tprivate async initializeFromSnapshot(\n\t\tnormalizedWholeSummary: INormalizedWholeSnapshot,\n\t): Promise<string> {\n\t\tconst snapshotId = normalizedWholeSummary.id;\n\t\tassert(snapshotId !== undefined, 0x275 /* \"Root tree should contain the id\" */);\n\t\tconst cachePs: Promise<any>[] = [\n\t\t\tthis.snapshotTreeCache.put(this.getCacheKey(snapshotId), normalizedWholeSummary),\n\t\t\tthis.updateBlobsCache(normalizedWholeSummary.blobs),\n\t\t];\n\n\t\tawait Promise.all(cachePs);\n\n\t\treturn snapshotId;\n\t}\n\n\tprivate async updateBlobsCache(blobs: Map<string, ArrayBuffer>): Promise<void> {\n\t\tconst blobCachePutPs: Promise<void>[] = [];\n\t\tblobs.forEach((value, id) => {\n\t\t\tconst cacheKey = this.getCacheKey(id);\n\t\t\tblobCachePutPs.push(this.blobCache.put(cacheKey, value));\n\t\t});\n\t\tawait Promise.all(blobCachePutPs);\n\t}\n\n\tprivate getCacheKey(blobId: string): string {\n\t\treturn `${this.id}:${blobId}`;\n\t}\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ISummaryTree, IWholeSummaryPayloadType } from "@fluidframework/server-services-client";
6
- import { IGitManager, ISummaryUploadManager } from "./storageContracts.mjs";
6
+ import { IGitManager, ISummaryUploadManager } from "./storageContracts.js";
7
7
  /**
8
8
  * Converts summary to snapshot tree and uploads with single snaphot tree payload.
9
9
  */
@@ -13,4 +13,4 @@ export declare class WholeSummaryUploadManager implements ISummaryUploadManager
13
13
  writeSummaryTree(summaryTree: ISummaryTree, parentHandle: string | undefined, summaryType: IWholeSummaryPayloadType, sequenceNumber?: number, initial?: boolean): Promise<string>;
14
14
  private writeSummaryTreeCore;
15
15
  }
16
- //# sourceMappingURL=wholeSummaryUploadManager.d.mts.map
16
+ //# sourceMappingURL=wholeSummaryUploadManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wholeSummaryUploadManager.d.ts","sourceRoot":"","sources":["../src/wholeSummaryUploadManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,YAAY,EAEZ,wBAAwB,EAExB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE3E;;GAEG;AACH,qBAAa,yBAA0B,YAAW,qBAAqB;IAC1D,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,WAAW;IAEpC,gBAAgB,CAC5B,WAAW,EAAE,YAAY,EACzB,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,WAAW,EAAE,wBAAwB,EACrC,cAAc,GAAE,MAAU,EAC1B,OAAO,GAAE,OAAe,GACtB,OAAO,CAAC,MAAM,CAAC;YAcJ,oBAAoB;CAwBlC"}
@@ -30,4 +30,4 @@ export class WholeSummaryUploadManager {
30
30
  .then((response) => response.content.id);
31
31
  }
32
32
  }
33
- //# sourceMappingURL=wholeSummaryUploadManager.mjs.map
33
+ //# sourceMappingURL=wholeSummaryUploadManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wholeSummaryUploadManager.js","sourceRoot":"","sources":["../src/wholeSummaryUploadManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,oCAAoC,GACpC,MAAM,wCAAwC,CAAC;AAGhD;;GAEG;AACH,MAAM,OAAO,yBAAyB;IACrC,YAA6B,OAAoB;QAApB,YAAO,GAAP,OAAO,CAAa;IAAG,CAAC;IAE9C,KAAK,CAAC,gBAAgB,CAC5B,WAAyB,EACzB,YAAgC,EAChC,WAAqC,EACrC,iBAAyB,CAAC,EAC1B,UAAmB,KAAK;QAExB,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,oBAAoB,CACzC,YAAY,EACZ,WAAW,EACX,WAAW,EACX,cAAc,EACd,OAAO,CACP,CAAC;QACF,IAAI,CAAC,EAAE,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SAChD;QACD,OAAO,EAAE,CAAC;IACX,CAAC;IAEO,KAAK,CAAC,oBAAoB,CACjC,YAAgC,EAChC,IAAkB,EAClB,IAA8B,EAC9B,cAAsB,EACtB,OAAgB;QAEhB,MAAM,YAAY,GAAG,oCAAoC,CACxD,YAAY,EACZ,IAAI,EACJ,EAAE,EACF,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAChC,CAAC;QACF,MAAM,eAAe,GAAyB;YAC7C,OAAO,EAAE,YAAY,CAAC,OAAO,IAAI,EAAE;YACnC,OAAO,EAAE,EAAE;YACX,cAAc;YACd,IAAI;SACJ,CAAC;QAEF,OAAO,IAAI,CAAC,OAAO;aACjB,aAAa,CAAC,eAAe,EAAE,OAAO,CAAC;aACvC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tISummaryTree,\n\tIWholeSummaryPayload,\n\tIWholeSummaryPayloadType,\n\tconvertSummaryTreeToWholeSummaryTree,\n} from \"@fluidframework/server-services-client\";\nimport { IGitManager, ISummaryUploadManager } from \"./storageContracts.js\";\n\n/**\n * Converts summary to snapshot tree and uploads with single snaphot tree payload.\n */\nexport class WholeSummaryUploadManager implements ISummaryUploadManager {\n\tconstructor(private readonly manager: IGitManager) {}\n\n\tpublic async writeSummaryTree(\n\t\tsummaryTree: ISummaryTree,\n\t\tparentHandle: string | undefined,\n\t\tsummaryType: IWholeSummaryPayloadType,\n\t\tsequenceNumber: number = 0,\n\t\tinitial: boolean = false,\n\t): Promise<string> {\n\t\tconst id = await this.writeSummaryTreeCore(\n\t\t\tparentHandle,\n\t\t\tsummaryTree,\n\t\t\tsummaryType,\n\t\t\tsequenceNumber,\n\t\t\tinitial,\n\t\t);\n\t\tif (!id) {\n\t\t\tthrow new Error(`Failed to write summary tree`);\n\t\t}\n\t\treturn id;\n\t}\n\n\tprivate async writeSummaryTreeCore(\n\t\tparentHandle: string | undefined,\n\t\ttree: ISummaryTree,\n\t\ttype: IWholeSummaryPayloadType,\n\t\tsequenceNumber: number,\n\t\tinitial: boolean,\n\t): Promise<string> {\n\t\tconst snapshotTree = convertSummaryTreeToWholeSummaryTree(\n\t\t\tparentHandle,\n\t\t\ttree,\n\t\t\t\"\",\n\t\t\ttype === \"channel\" ? \".app\" : \"\",\n\t\t);\n\t\tconst snapshotPayload: IWholeSummaryPayload = {\n\t\t\tentries: snapshotTree.entries ?? [],\n\t\t\tmessage: \"\",\n\t\t\tsequenceNumber,\n\t\t\ttype,\n\t\t};\n\n\t\treturn this.manager\n\t\t\t.createSummary(snapshotPayload, initial)\n\t\t\t.then((response) => response.content.id);\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/routerlicious-driver",
3
- "version": "2.0.0-dev-rc.2.0.0.245554",
3
+ "version": "2.0.0-dev-rc.3.0.0.250606",
4
4
  "description": "Socket.IO + Git implementation of Fluid service API",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -11,72 +11,72 @@
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
13
  "sideEffects": false,
14
+ "type": "module",
14
15
  "exports": {
15
16
  ".": {
16
17
  "import": {
17
- "types": "./lib/index.d.mts",
18
- "default": "./lib/index.mjs"
18
+ "types": "./lib/index.d.ts",
19
+ "default": "./lib/index.js"
19
20
  },
20
21
  "require": {
21
22
  "types": "./dist/index.d.ts",
22
23
  "default": "./dist/index.js"
23
24
  }
24
25
  },
25
- "./alpha": {
26
+ "./public": {
26
27
  "import": {
27
- "types": "./lib/routerlicious-driver-alpha.d.mts",
28
- "default": "./lib/index.mjs"
28
+ "types": "./lib/routerlicious-driver-public.d.ts",
29
+ "default": "./lib/index.js"
29
30
  },
30
31
  "require": {
31
- "types": "./dist/routerlicious-driver-alpha.d.ts",
32
+ "types": "./dist/routerlicious-driver-public.d.ts",
32
33
  "default": "./dist/index.js"
33
34
  }
34
35
  },
35
36
  "./beta": {
36
37
  "import": {
37
- "types": "./lib/routerlicious-driver-beta.d.mts",
38
- "default": "./lib/index.mjs"
38
+ "types": "./lib/routerlicious-driver-beta.d.ts",
39
+ "default": "./lib/index.js"
39
40
  },
40
41
  "require": {
41
42
  "types": "./dist/routerlicious-driver-beta.d.ts",
42
43
  "default": "./dist/index.js"
43
44
  }
44
45
  },
45
- "./internal": {
46
+ "./alpha": {
46
47
  "import": {
47
- "types": "./lib/index.d.mts",
48
- "default": "./lib/index.mjs"
48
+ "types": "./lib/routerlicious-driver-alpha.d.ts",
49
+ "default": "./lib/index.js"
49
50
  },
50
51
  "require": {
51
- "types": "./dist/index.d.ts",
52
+ "types": "./dist/routerlicious-driver-alpha.d.ts",
52
53
  "default": "./dist/index.js"
53
54
  }
54
55
  },
55
- "./public": {
56
+ "./internal": {
56
57
  "import": {
57
- "types": "./lib/routerlicious-driver-public.d.mts",
58
- "default": "./lib/index.mjs"
58
+ "types": "./lib/index.d.ts",
59
+ "default": "./lib/index.js"
59
60
  },
60
61
  "require": {
61
- "types": "./dist/routerlicious-driver-public.d.ts",
62
+ "types": "./dist/index.d.ts",
62
63
  "default": "./dist/index.js"
63
64
  }
64
65
  }
65
66
  },
66
67
  "main": "dist/index.js",
67
- "module": "lib/index.mjs",
68
68
  "types": "dist/index.d.ts",
69
69
  "c8": {
70
70
  "all": true,
71
71
  "cache-dir": "nyc/.cache",
72
72
  "exclude": [
73
73
  "src/test/**/*.*ts",
74
- "dist/test/**/*.*js"
74
+ "lib/test/**/*.*js"
75
75
  ],
76
76
  "exclude-after-remap": false,
77
77
  "include": [
78
78
  "src/**/*.*ts",
79
- "dist/**/*.*js"
79
+ "lib/**/*.*js"
80
80
  ],
81
81
  "report-dir": "nyc/report",
82
82
  "reporter": [
@@ -87,17 +87,17 @@
87
87
  "temp-directory": "nyc/.nyc_output"
88
88
  },
89
89
  "dependencies": {
90
- "@fluid-internal/client-utils": "2.0.0-dev-rc.2.0.0.245554",
91
- "@fluidframework/core-interfaces": "2.0.0-dev-rc.2.0.0.245554",
92
- "@fluidframework/core-utils": "2.0.0-dev-rc.2.0.0.245554",
93
- "@fluidframework/driver-base": "2.0.0-dev-rc.2.0.0.245554",
94
- "@fluidframework/driver-definitions": "2.0.0-dev-rc.2.0.0.245554",
95
- "@fluidframework/driver-utils": "2.0.0-dev-rc.2.0.0.245554",
90
+ "@fluid-internal/client-utils": "2.0.0-dev-rc.3.0.0.250606",
91
+ "@fluidframework/core-interfaces": "2.0.0-dev-rc.3.0.0.250606",
92
+ "@fluidframework/core-utils": "2.0.0-dev-rc.3.0.0.250606",
93
+ "@fluidframework/driver-base": "2.0.0-dev-rc.3.0.0.250606",
94
+ "@fluidframework/driver-definitions": "2.0.0-dev-rc.3.0.0.250606",
95
+ "@fluidframework/driver-utils": "2.0.0-dev-rc.3.0.0.250606",
96
96
  "@fluidframework/gitresources": "^4.0.0",
97
97
  "@fluidframework/protocol-base": "^4.0.0",
98
98
  "@fluidframework/protocol-definitions": "^3.2.0",
99
99
  "@fluidframework/server-services-client": "^4.0.0",
100
- "@fluidframework/telemetry-utils": "2.0.0-dev-rc.2.0.0.245554",
100
+ "@fluidframework/telemetry-utils": "2.0.0-dev-rc.3.0.0.250606",
101
101
  "cross-fetch": "^3.1.5",
102
102
  "json-stringify-safe": "5.0.1",
103
103
  "socket.io-client": "^4.7.3",
@@ -105,7 +105,8 @@
105
105
  },
106
106
  "devDependencies": {
107
107
  "@arethetypeswrong/cli": "^0.13.3",
108
- "@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.2.0.0.245554",
108
+ "@biomejs/biome": "^1.6.2",
109
+ "@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.3.0.0.250606",
109
110
  "@fluid-tools/build-cli": "^0.34.0",
110
111
  "@fluidframework/build-common": "^2.0.3",
111
112
  "@fluidframework/build-tools": "^0.34.0",
@@ -130,7 +131,6 @@
130
131
  "prettier": "~3.0.3",
131
132
  "rimraf": "^4.4.0",
132
133
  "sinon": "^17.0.1",
133
- "tsc-multi": "^1.1.0",
134
134
  "typescript": "~5.1.6"
135
135
  },
136
136
  "fluidBuild": {
@@ -158,31 +158,37 @@
158
158
  },
159
159
  "scripts": {
160
160
  "api": "fluid-build . --task api",
161
- "api-extractor:commonjs": "api-extractor run --local",
162
- "api-extractor:esnext": "api-extractor run --config ./api-extractor-esm.json",
161
+ "api-extractor:commonjs": "api-extractor run --config ./api-extractor-cjs.json",
162
+ "api-extractor:esnext": "api-extractor run --local",
163
163
  "build": "fluid-build . --task build",
164
164
  "build:commonjs": "fluid-build . --task commonjs",
165
165
  "build:compile": "fluid-build . --task compile",
166
166
  "build:docs": "fluid-build . --task api",
167
- "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
167
+ "build:esnext": "tsc --project ./tsconfig.json",
168
168
  "build:genver": "gen-version",
169
- "build:test": "tsc --project ./src/test/tsconfig.json",
169
+ "build:test": "npm run build:test:esm && npm run build:test:cjs",
170
+ "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
171
+ "build:test:esm": "tsc --project ./src/test/tsconfig.json",
170
172
  "check:are-the-types-wrong": "attw --pack . --entrypoints .",
173
+ "check:biome": "biome check .",
174
+ "check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
171
175
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
172
176
  "ci:build:docs": "api-extractor run",
173
177
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
174
178
  "eslint": "eslint --format stylish src",
175
179
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
176
- "format": "npm run prettier:fix",
177
- "lint": "npm run prettier && npm run check:release-tags && npm run eslint",
178
- "lint:fix": "npm run prettier:fix && npm run eslint:fix",
179
- "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
180
- "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
180
+ "format": "fluid-build --task format .",
181
+ "format:biome": "biome check --apply .",
182
+ "format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
183
+ "lint": "fluid-build . --task lint",
184
+ "lint:fix": "fluid-build . --task eslint:fix --task format",
181
185
  "test": "npm run test:mocha",
182
186
  "test:coverage": "c8 npm test",
183
- "test:mocha": "mocha --ignore \"dist/test/types/*\" --recursive dist/test -r node_modules/@fluid-internal/mocha-test-setup",
187
+ "test:mocha": "npm run test:mocha:esm && npm run test:mocha:cjs",
188
+ "test:mocha:cjs": "mocha --recursive \"dist/test/**/*.spec.*js\" --exit",
189
+ "test:mocha:esm": "mocha --recursive \"lib/test/**/*.spec.*js\" --exit",
184
190
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
185
- "tsc": "tsc",
191
+ "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
186
192
  "typetests:gen": "fluid-type-test-generator",
187
193
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
188
194
  }
package/src/axios.cts ADDED
@@ -0,0 +1,8 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import type { AxiosRequestConfig, AxiosRequestHeaders, RawAxiosRequestHeaders } from "axios";
7
+
8
+ export { AxiosRequestConfig, AxiosRequestHeaders, RawAxiosRequestHeaders };
package/src/cache.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { MapWithExpiration } from "./mapWithExpiration";
6
+ import { MapWithExpiration } from "./mapWithExpiration.js";
7
7
 
8
8
  export interface ICache<T> {
9
9
  get(key: string): Promise<T | undefined>;
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITokenProvider, ITokenResponse } from "./tokens";
6
+ import { ITokenProvider, ITokenResponse } from "./tokens.js";
7
7
 
8
8
  /**
9
9
  * Default token provider in case the host does not provide one. It simply caches the provided jwt and returns it back.
@@ -7,20 +7,20 @@ import { ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
7
7
  import { getW3CData, validateMessages } from "@fluidframework/driver-base";
8
8
  import {
9
9
  IDeltaStorageService,
10
- IDocumentDeltaStorageService,
11
10
  IDeltasFetchResult,
11
+ IDocumentDeltaStorageService,
12
12
  IStream,
13
13
  } from "@fluidframework/driver-definitions";
14
- import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
15
14
  import {
15
+ emptyMessageStream,
16
16
  readAndParse,
17
17
  requestOps,
18
- emptyMessageStream,
19
18
  streamObserver,
20
19
  } from "@fluidframework/driver-utils";
20
+ import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
21
21
  import { ITelemetryLoggerExt, PerformanceEvent } from "@fluidframework/telemetry-utils";
22
- import { DocumentStorageService } from "./documentStorageService";
23
- import { RestWrapper } from "./restWrapperBase";
22
+ import { DocumentStorageService } from "./documentStorageService.js";
23
+ import { RestWrapper } from "./restWrapperBase.js";
24
24
 
25
25
  /**
26
26
  * Maximum number of ops we can fetch at a time. This should be kept at 2k, as
@@ -3,13 +3,13 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
7
6
  import { DocumentDeltaConnection } from "@fluidframework/driver-base";
8
7
  import { IAnyDriverError, IDocumentDeltaConnection } from "@fluidframework/driver-definitions";
9
8
  import { IClient, IConnect } from "@fluidframework/protocol-definitions";
9
+ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
10
10
  import type { io as SocketIOClientStatic } from "socket.io-client";
11
- import { errorObjectFromSocketError, IR11sSocketError } from "./errorUtils";
12
- import { pkgVersion as driverVersion } from "./packageVersion";
11
+ import { IR11sSocketError, errorObjectFromSocketError } from "./errorUtils.js";
12
+ import { pkgVersion as driverVersion } from "./packageVersion.js";
13
13
 
14
14
  const protocolVersions = ["^0.4.0", "^0.3.0", "^0.2.0", "^0.1.0"];
15
15
 
@@ -6,29 +6,29 @@
6
6
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
7
7
  import { assert } from "@fluidframework/core-utils";
8
8
  import * as api from "@fluidframework/driver-definitions";
9
- import { RateLimiter, NetworkErrorBasic, canRetryOnError } from "@fluidframework/driver-utils";
9
+ import { NetworkErrorBasic, RateLimiter, canRetryOnError } from "@fluidframework/driver-utils";
10
10
  import { IClient } from "@fluidframework/protocol-definitions";
11
+ import { ITelemetryLoggerExt, PerformanceEvent, wrapError } from "@fluidframework/telemetry-utils";
11
12
  import io from "socket.io-client";
12
- import { PerformanceEvent, wrapError, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
13
- import { RouterliciousErrorTypes } from "./errorUtils";
14
- import { DeltaStorageService, DocumentDeltaStorageService } from "./deltaStorageService";
15
- import { DocumentStorageService } from "./documentStorageService";
16
- import { R11sDocumentDeltaConnection } from "./documentDeltaConnection";
17
- import { NullBlobStorageService } from "./nullBlobStorageService";
18
- import { ITokenProvider } from "./tokens";
13
+ import { ICache } from "./cache.js";
14
+ import { INormalizedWholeSnapshot } from "./contracts.js";
15
+ import { ISnapshotTreeVersion } from "./definitions.js";
16
+ import { DeltaStorageService, DocumentDeltaStorageService } from "./deltaStorageService.js";
17
+ import { R11sDocumentDeltaConnection } from "./documentDeltaConnection.js";
18
+ import { DocumentStorageService } from "./documentStorageService.js";
19
+ import { RouterliciousErrorTypes } from "./errorUtils.js";
20
+ import { GitManager } from "./gitManager.js";
21
+ import { Historian } from "./historian.js";
22
+ import { NullBlobStorageService } from "./nullBlobStorageService.js";
23
+ import { pkgVersion as driverVersion } from "./packageVersion.js";
24
+ import { IRouterliciousDriverPolicies } from "./policies.js";
19
25
  import {
20
26
  RouterliciousOrdererRestWrapper,
21
27
  RouterliciousStorageRestWrapper,
22
28
  TokenFetcher,
23
- } from "./restWrapper";
24
- import { IRouterliciousDriverPolicies } from "./policies";
25
- import { ICache } from "./cache";
26
- import { ISnapshotTreeVersion } from "./definitions";
27
- import { pkgVersion as driverVersion } from "./packageVersion";
28
- import { GitManager } from "./gitManager";
29
- import { Historian } from "./historian";
30
- import { RestWrapper } from "./restWrapperBase";
31
- import { INormalizedWholeSnapshot } from "./contracts";
29
+ } from "./restWrapper.js";
30
+ import { RestWrapper } from "./restWrapperBase.js";
31
+ import { ITokenProvider } from "./tokens.js";
32
32
 
33
33
  /**
34
34
  * Amount of time between discoveries within which we don't need to rediscover on re-connect.