@fluidframework/routerlicious-driver 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.1

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 (338) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/api-extractor-lint.json +1 -1
  3. package/api-extractor.json +1 -1
  4. package/api-report/routerlicious-driver.api.md +3 -3
  5. package/beta.d.ts +11 -0
  6. package/{lib/storageContracts.mjs → dist/axios.cjs} +3 -2
  7. package/dist/axios.cjs.map +1 -0
  8. package/dist/axios.d.cts +7 -0
  9. package/dist/axios.d.cts.map +1 -0
  10. package/dist/beta.d.ts +15 -0
  11. package/dist/cache.js +2 -2
  12. package/dist/cache.js.map +1 -1
  13. package/dist/defaultTokenProvider.d.ts +1 -1
  14. package/dist/defaultTokenProvider.d.ts.map +1 -1
  15. package/dist/defaultTokenProvider.js.map +1 -1
  16. package/dist/deltaStorageService.d.ts +3 -3
  17. package/dist/deltaStorageService.d.ts.map +1 -1
  18. package/dist/deltaStorageService.js +12 -12
  19. package/dist/deltaStorageService.js.map +1 -1
  20. package/dist/documentDeltaConnection.d.ts +4 -3
  21. package/dist/documentDeltaConnection.d.ts.map +1 -1
  22. package/dist/documentDeltaConnection.js +6 -6
  23. package/dist/documentDeltaConnection.js.map +1 -1
  24. package/dist/documentService.d.ts +7 -7
  25. package/dist/documentService.d.ts.map +1 -1
  26. package/dist/documentService.js +30 -31
  27. package/dist/documentService.js.map +1 -1
  28. package/dist/documentServiceFactory.d.ts +3 -3
  29. package/dist/documentServiceFactory.d.ts.map +1 -1
  30. package/dist/documentServiceFactory.js +43 -43
  31. package/dist/documentServiceFactory.js.map +1 -1
  32. package/dist/documentStorageService.d.ts +8 -8
  33. package/dist/documentStorageService.d.ts.map +1 -1
  34. package/dist/documentStorageService.js +9 -9
  35. package/dist/documentStorageService.js.map +1 -1
  36. package/dist/errorUtils.d.ts +4 -3
  37. package/dist/errorUtils.d.ts.map +1 -1
  38. package/dist/errorUtils.js +8 -9
  39. package/dist/errorUtils.js.map +1 -1
  40. package/dist/gitManager.d.ts +3 -3
  41. package/dist/gitManager.d.ts.map +1 -1
  42. package/dist/gitManager.js.map +1 -1
  43. package/dist/historian.d.ts +4 -4
  44. package/dist/historian.d.ts.map +1 -1
  45. package/dist/historian.js.map +1 -1
  46. package/dist/index.d.ts +6 -6
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +7 -7
  49. package/dist/index.js.map +1 -1
  50. package/dist/legacy.d.ts +18 -0
  51. package/dist/mapWithExpiration.js +2 -2
  52. package/dist/mapWithExpiration.js.map +1 -1
  53. package/dist/nullBlobStorageService.d.ts +1 -1
  54. package/dist/nullBlobStorageService.d.ts.map +1 -1
  55. package/dist/nullBlobStorageService.js.map +1 -1
  56. package/dist/package.json +3 -0
  57. package/dist/packageVersion.d.ts +1 -1
  58. package/dist/packageVersion.js +1 -1
  59. package/dist/packageVersion.js.map +1 -1
  60. package/dist/public.d.ts +15 -0
  61. package/dist/r11sSnapshotParser.d.ts +1 -1
  62. package/dist/r11sSnapshotParser.d.ts.map +1 -1
  63. package/dist/r11sSnapshotParser.js.map +1 -1
  64. package/dist/restWrapper.d.ts +4 -4
  65. package/dist/restWrapper.d.ts.map +1 -1
  66. package/dist/restWrapper.js +16 -16
  67. package/dist/restWrapper.js.map +1 -1
  68. package/dist/restWrapperBase.d.ts +2 -2
  69. package/dist/restWrapperBase.d.ts.map +1 -1
  70. package/dist/restWrapperBase.js.map +1 -1
  71. package/dist/retriableGitManager.d.ts +3 -3
  72. package/dist/retriableGitManager.d.ts.map +1 -1
  73. package/dist/retriableGitManager.js +2 -2
  74. package/dist/retriableGitManager.js.map +1 -1
  75. package/dist/routerliciousResolvedUrl.d.ts +1 -1
  76. package/dist/routerliciousResolvedUrl.d.ts.map +1 -1
  77. package/dist/routerliciousResolvedUrl.js.map +1 -1
  78. package/dist/shreddedSummaryDocumentStorageService.d.ts +6 -6
  79. package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  80. package/dist/shreddedSummaryDocumentStorageService.js +13 -13
  81. package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
  82. package/dist/storageContracts.d.ts +2 -2
  83. package/dist/storageContracts.d.ts.map +1 -1
  84. package/dist/storageContracts.js.map +1 -1
  85. package/dist/summaryTreeUploadManager.d.ts +1 -1
  86. package/dist/summaryTreeUploadManager.d.ts.map +1 -1
  87. package/dist/summaryTreeUploadManager.js +6 -6
  88. package/dist/summaryTreeUploadManager.js.map +1 -1
  89. package/dist/treeUtils.d.ts +2 -2
  90. package/dist/treeUtils.d.ts.map +1 -1
  91. package/dist/treeUtils.js +4 -4
  92. package/dist/treeUtils.js.map +1 -1
  93. package/dist/urlUtils.d.ts +1 -1
  94. package/dist/urlUtils.d.ts.map +1 -1
  95. package/dist/urlUtils.js.map +1 -1
  96. package/dist/wholeSummaryDocumentStorageService.d.ts +6 -6
  97. package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  98. package/dist/wholeSummaryDocumentStorageService.js +25 -25
  99. package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
  100. package/dist/wholeSummaryUploadManager.d.ts +1 -1
  101. package/dist/wholeSummaryUploadManager.d.ts.map +1 -1
  102. package/dist/wholeSummaryUploadManager.js.map +1 -1
  103. package/internal.d.ts +11 -0
  104. package/legacy.d.ts +11 -0
  105. package/lib/axios.cjs +7 -0
  106. package/lib/axios.cjs.map +1 -0
  107. package/lib/axios.d.cts +7 -0
  108. package/lib/axios.d.cts.map +1 -0
  109. package/lib/beta.d.ts +15 -0
  110. package/lib/{cache.d.mts → cache.d.ts} +1 -1
  111. package/lib/cache.d.ts.map +1 -0
  112. package/lib/{cache.mjs → cache.js} +2 -2
  113. package/lib/cache.js.map +1 -0
  114. package/lib/{contracts.d.mts → contracts.d.ts} +1 -1
  115. package/lib/contracts.d.ts.map +1 -0
  116. package/lib/{policies.mjs → contracts.js} +1 -1
  117. package/lib/contracts.js.map +1 -0
  118. package/lib/{createNewUtils.d.mts → createNewUtils.d.ts} +1 -1
  119. package/lib/createNewUtils.d.ts.map +1 -0
  120. package/lib/{createNewUtils.mjs → createNewUtils.js} +1 -1
  121. package/lib/createNewUtils.js.map +1 -0
  122. package/lib/{defaultTokenProvider.d.mts → defaultTokenProvider.d.ts} +2 -2
  123. package/lib/defaultTokenProvider.d.ts.map +1 -0
  124. package/lib/{defaultTokenProvider.mjs → defaultTokenProvider.js} +1 -1
  125. package/lib/defaultTokenProvider.js.map +1 -0
  126. package/lib/{definitions.d.mts → definitions.d.ts} +1 -1
  127. package/lib/definitions.d.ts.map +1 -0
  128. package/lib/{definitions.mjs → definitions.js} +1 -1
  129. package/lib/definitions.js.map +1 -0
  130. package/lib/{deltaStorageService.d.mts → deltaStorageService.d.ts} +4 -4
  131. package/lib/deltaStorageService.d.ts.map +1 -0
  132. package/lib/{deltaStorageService.mjs → deltaStorageService.js} +4 -4
  133. package/lib/deltaStorageService.js.map +1 -0
  134. package/lib/{documentDeltaConnection.d.mts → documentDeltaConnection.d.ts} +5 -4
  135. package/lib/documentDeltaConnection.d.ts.map +1 -0
  136. package/lib/{documentDeltaConnection.mjs → documentDeltaConnection.js} +4 -4
  137. package/lib/documentDeltaConnection.js.map +1 -0
  138. package/lib/{documentService.d.mts → documentService.d.ts} +8 -8
  139. package/lib/documentService.d.ts.map +1 -0
  140. package/lib/{documentService.mjs → documentService.js} +13 -14
  141. package/lib/documentService.js.map +1 -0
  142. package/lib/{documentServiceFactory.d.mts → documentServiceFactory.d.ts} +4 -4
  143. package/lib/documentServiceFactory.d.ts.map +1 -0
  144. package/lib/{documentServiceFactory.mjs → documentServiceFactory.js} +12 -12
  145. package/lib/documentServiceFactory.js.map +1 -0
  146. package/lib/{documentStorageService.d.mts → documentStorageService.d.ts} +9 -9
  147. package/lib/documentStorageService.d.ts.map +1 -0
  148. package/lib/{documentStorageService.mjs → documentStorageService.js} +5 -5
  149. package/lib/documentStorageService.js.map +1 -0
  150. package/lib/{errorUtils.d.mts → errorUtils.d.ts} +5 -4
  151. package/lib/errorUtils.d.ts.map +1 -0
  152. package/lib/{errorUtils.mjs → errorUtils.js} +4 -5
  153. package/lib/errorUtils.js.map +1 -0
  154. package/lib/{gitManager.d.mts → gitManager.d.ts} +4 -4
  155. package/lib/gitManager.d.ts.map +1 -0
  156. package/lib/{gitManager.mjs → gitManager.js} +1 -1
  157. package/lib/gitManager.js.map +1 -0
  158. package/lib/{historian.d.mts → historian.d.ts} +5 -5
  159. package/lib/historian.d.ts.map +1 -0
  160. package/lib/{historian.mjs → historian.js} +1 -1
  161. package/lib/historian.js.map +1 -0
  162. package/lib/{index.d.mts → index.d.ts} +7 -7
  163. package/lib/index.d.ts.map +1 -0
  164. package/lib/index.js +11 -0
  165. package/lib/index.js.map +1 -0
  166. package/lib/legacy.d.ts +18 -0
  167. package/lib/{mapWithExpiration.d.mts → mapWithExpiration.d.ts} +1 -1
  168. package/lib/mapWithExpiration.d.ts.map +1 -0
  169. package/lib/{mapWithExpiration.mjs → mapWithExpiration.js} +2 -2
  170. package/lib/mapWithExpiration.js.map +1 -0
  171. package/lib/{nullBlobStorageService.d.mts → nullBlobStorageService.d.ts} +2 -2
  172. package/lib/nullBlobStorageService.d.ts.map +1 -0
  173. package/lib/{nullBlobStorageService.mjs → nullBlobStorageService.js} +1 -1
  174. package/lib/nullBlobStorageService.js.map +1 -0
  175. package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
  176. package/lib/packageVersion.d.ts.map +1 -0
  177. package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
  178. package/lib/packageVersion.js.map +1 -0
  179. package/lib/{policies.d.mts → policies.d.ts} +1 -1
  180. package/lib/policies.d.ts.map +1 -0
  181. package/lib/{contracts.mjs → policies.js} +1 -1
  182. package/lib/policies.js.map +1 -0
  183. package/lib/public.d.ts +15 -0
  184. package/lib/{r11sSnapshotParser.d.mts → r11sSnapshotParser.d.ts} +2 -2
  185. package/lib/r11sSnapshotParser.d.ts.map +1 -0
  186. package/lib/{r11sSnapshotParser.mjs → r11sSnapshotParser.js} +1 -1
  187. package/lib/r11sSnapshotParser.js.map +1 -0
  188. package/lib/{restWrapper.d.mts → restWrapper.d.ts} +5 -5
  189. package/lib/restWrapper.d.ts.map +1 -0
  190. package/lib/{restWrapper.mjs → restWrapper.js} +8 -8
  191. package/lib/restWrapper.js.map +1 -0
  192. package/lib/{restWrapperBase.d.mts → restWrapperBase.d.ts} +3 -3
  193. package/lib/restWrapperBase.d.ts.map +1 -0
  194. package/lib/{restWrapperBase.mjs → restWrapperBase.js} +1 -1
  195. package/lib/restWrapperBase.js.map +1 -0
  196. package/lib/{retriableGitManager.d.mts → retriableGitManager.d.ts} +4 -4
  197. package/lib/retriableGitManager.d.ts.map +1 -0
  198. package/lib/{retriableGitManager.mjs → retriableGitManager.js} +2 -2
  199. package/lib/retriableGitManager.js.map +1 -0
  200. package/lib/{routerliciousResolvedUrl.d.mts → routerliciousResolvedUrl.d.ts} +2 -2
  201. package/lib/routerliciousResolvedUrl.d.ts.map +1 -0
  202. package/lib/{routerliciousResolvedUrl.mjs → routerliciousResolvedUrl.js} +1 -1
  203. package/lib/routerliciousResolvedUrl.js.map +1 -0
  204. package/lib/{shreddedSummaryDocumentStorageService.d.mts → shreddedSummaryDocumentStorageService.d.ts} +7 -7
  205. package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -0
  206. package/lib/{shreddedSummaryDocumentStorageService.mjs → shreddedSummaryDocumentStorageService.js} +6 -6
  207. package/lib/shreddedSummaryDocumentStorageService.js.map +1 -0
  208. package/lib/{storageContracts.d.mts → storageContracts.d.ts} +3 -3
  209. package/lib/storageContracts.d.ts.map +1 -0
  210. package/lib/storageContracts.js +6 -0
  211. package/lib/storageContracts.js.map +1 -0
  212. package/lib/{summaryTreeUploadManager.d.mts → summaryTreeUploadManager.d.ts} +2 -2
  213. package/lib/summaryTreeUploadManager.d.ts.map +1 -0
  214. package/lib/{summaryTreeUploadManager.mjs → summaryTreeUploadManager.js} +3 -3
  215. package/lib/summaryTreeUploadManager.js.map +1 -0
  216. package/lib/{tokens.d.mts → tokens.d.ts} +1 -1
  217. package/lib/tokens.d.ts.map +1 -0
  218. package/lib/{tokens.mjs → tokens.js} +1 -1
  219. package/lib/tokens.js.map +1 -0
  220. package/lib/{treeUtils.d.mts → treeUtils.d.ts} +3 -3
  221. package/lib/treeUtils.d.ts.map +1 -0
  222. package/lib/{treeUtils.mjs → treeUtils.js} +2 -2
  223. package/lib/treeUtils.js.map +1 -0
  224. package/lib/{urlUtils.d.mts → urlUtils.d.ts} +2 -2
  225. package/lib/urlUtils.d.ts.map +1 -0
  226. package/lib/{urlUtils.mjs → urlUtils.js} +1 -1
  227. package/lib/urlUtils.js.map +1 -0
  228. package/lib/{wholeSummaryDocumentStorageService.d.mts → wholeSummaryDocumentStorageService.d.ts} +7 -7
  229. package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -0
  230. package/lib/{wholeSummaryDocumentStorageService.mjs → wholeSummaryDocumentStorageService.js} +9 -9
  231. package/lib/wholeSummaryDocumentStorageService.js.map +1 -0
  232. package/lib/{wholeSummaryUploadManager.d.mts → wholeSummaryUploadManager.d.ts} +2 -2
  233. package/lib/wholeSummaryUploadManager.d.ts.map +1 -0
  234. package/lib/{wholeSummaryUploadManager.mjs → wholeSummaryUploadManager.js} +1 -1
  235. package/lib/wholeSummaryUploadManager.js.map +1 -0
  236. package/package.json +50 -68
  237. package/src/axios.cts +8 -0
  238. package/src/cache.ts +1 -1
  239. package/src/defaultTokenProvider.ts +1 -1
  240. package/src/deltaStorageService.ts +11 -9
  241. package/src/documentDeltaConnection.ts +7 -5
  242. package/src/documentService.ts +26 -20
  243. package/src/documentServiceFactory.ts +19 -18
  244. package/src/documentStorageService.ts +12 -11
  245. package/src/errorUtils.ts +9 -12
  246. package/src/gitManager.ts +4 -3
  247. package/src/historian.ts +5 -4
  248. package/src/index.ts +6 -6
  249. package/src/mapWithExpiration.ts +1 -1
  250. package/src/nullBlobStorageService.ts +4 -1
  251. package/src/packageVersion.ts +1 -1
  252. package/src/r11sSnapshotParser.ts +7 -2
  253. package/src/restWrapper.ts +15 -13
  254. package/src/restWrapperBase.ts +2 -2
  255. package/src/retriableGitManager.ts +5 -4
  256. package/src/routerliciousResolvedUrl.ts +1 -1
  257. package/src/shreddedSummaryDocumentStorageService.ts +17 -16
  258. package/src/storageContracts.ts +3 -2
  259. package/src/summaryTreeUploadManager.ts +4 -3
  260. package/src/treeUtils.ts +4 -3
  261. package/src/urlUtils.ts +1 -1
  262. package/src/wholeSummaryDocumentStorageService.ts +21 -20
  263. package/src/wholeSummaryUploadManager.ts +2 -1
  264. package/tsconfig.cjs.json +7 -0
  265. package/tsconfig.json +2 -5
  266. package/api-extractor-esm.json +0 -4
  267. package/dist/routerlicious-driver-alpha.d.ts +0 -113
  268. package/dist/routerlicious-driver-beta.d.ts +0 -97
  269. package/dist/routerlicious-driver-public.d.ts +0 -97
  270. package/dist/routerlicious-driver-untrimmed.d.ts +0 -260
  271. package/lib/cache.d.mts.map +0 -1
  272. package/lib/cache.mjs.map +0 -1
  273. package/lib/contracts.d.mts.map +0 -1
  274. package/lib/contracts.mjs.map +0 -1
  275. package/lib/createNewUtils.d.mts.map +0 -1
  276. package/lib/createNewUtils.mjs.map +0 -1
  277. package/lib/defaultTokenProvider.d.mts.map +0 -1
  278. package/lib/defaultTokenProvider.mjs.map +0 -1
  279. package/lib/definitions.d.mts.map +0 -1
  280. package/lib/definitions.mjs.map +0 -1
  281. package/lib/deltaStorageService.d.mts.map +0 -1
  282. package/lib/deltaStorageService.mjs.map +0 -1
  283. package/lib/documentDeltaConnection.d.mts.map +0 -1
  284. package/lib/documentDeltaConnection.mjs.map +0 -1
  285. package/lib/documentService.d.mts.map +0 -1
  286. package/lib/documentService.mjs.map +0 -1
  287. package/lib/documentServiceFactory.d.mts.map +0 -1
  288. package/lib/documentServiceFactory.mjs.map +0 -1
  289. package/lib/documentStorageService.d.mts.map +0 -1
  290. package/lib/documentStorageService.mjs.map +0 -1
  291. package/lib/errorUtils.d.mts.map +0 -1
  292. package/lib/errorUtils.mjs.map +0 -1
  293. package/lib/gitManager.d.mts.map +0 -1
  294. package/lib/gitManager.mjs.map +0 -1
  295. package/lib/historian.d.mts.map +0 -1
  296. package/lib/historian.mjs.map +0 -1
  297. package/lib/index.d.mts.map +0 -1
  298. package/lib/index.mjs +0 -8
  299. package/lib/index.mjs.map +0 -1
  300. package/lib/mapWithExpiration.d.mts.map +0 -1
  301. package/lib/mapWithExpiration.mjs.map +0 -1
  302. package/lib/nullBlobStorageService.d.mts.map +0 -1
  303. package/lib/nullBlobStorageService.mjs.map +0 -1
  304. package/lib/packageVersion.d.mts.map +0 -1
  305. package/lib/packageVersion.mjs.map +0 -1
  306. package/lib/policies.d.mts.map +0 -1
  307. package/lib/policies.mjs.map +0 -1
  308. package/lib/r11sSnapshotParser.d.mts.map +0 -1
  309. package/lib/r11sSnapshotParser.mjs.map +0 -1
  310. package/lib/restWrapper.d.mts.map +0 -1
  311. package/lib/restWrapper.mjs.map +0 -1
  312. package/lib/restWrapperBase.d.mts.map +0 -1
  313. package/lib/restWrapperBase.mjs.map +0 -1
  314. package/lib/retriableGitManager.d.mts.map +0 -1
  315. package/lib/retriableGitManager.mjs.map +0 -1
  316. package/lib/routerlicious-driver-alpha.d.mts +0 -113
  317. package/lib/routerlicious-driver-beta.d.mts +0 -97
  318. package/lib/routerlicious-driver-public.d.mts +0 -97
  319. package/lib/routerlicious-driver-untrimmed.d.mts +0 -260
  320. package/lib/routerliciousResolvedUrl.d.mts.map +0 -1
  321. package/lib/routerliciousResolvedUrl.mjs.map +0 -1
  322. package/lib/shreddedSummaryDocumentStorageService.d.mts.map +0 -1
  323. package/lib/shreddedSummaryDocumentStorageService.mjs.map +0 -1
  324. package/lib/storageContracts.d.mts.map +0 -1
  325. package/lib/storageContracts.mjs.map +0 -1
  326. package/lib/summaryTreeUploadManager.d.mts.map +0 -1
  327. package/lib/summaryTreeUploadManager.mjs.map +0 -1
  328. package/lib/tokens.d.mts.map +0 -1
  329. package/lib/tokens.mjs.map +0 -1
  330. package/lib/treeUtils.d.mts.map +0 -1
  331. package/lib/treeUtils.mjs.map +0 -1
  332. package/lib/urlUtils.d.mts.map +0 -1
  333. package/lib/urlUtils.mjs.map +0 -1
  334. package/lib/wholeSummaryDocumentStorageService.d.mts.map +0 -1
  335. package/lib/wholeSummaryDocumentStorageService.mjs.map +0 -1
  336. package/lib/wholeSummaryUploadManager.d.mts.map +0 -1
  337. package/lib/wholeSummaryUploadManager.mjs.map +0 -1
  338. /package/{dist → lib}/tsdoc-metadata.json +0 -0
@@ -6,8 +6,8 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.errorObjectFromSocketError = exports.throwR11sNetworkError = exports.createR11sNetworkError = exports.RouterliciousErrorTypes = void 0;
8
8
  const driver_definitions_1 = require("@fluidframework/driver-definitions");
9
- const driver_utils_1 = require("@fluidframework/driver-utils");
10
- const packageVersion_1 = require("./packageVersion");
9
+ const internal_1 = require("@fluidframework/driver-utils/internal");
10
+ const packageVersion_js_1 = require("./packageVersion.js");
11
11
  /**
12
12
  * Routerlicious Error types
13
13
  * Different error types that may be thrown by the routerlicious driver
@@ -23,28 +23,28 @@ exports.RouterliciousErrorTypes = {
23
23
  };
24
24
  function createR11sNetworkError(errorMessage, statusCode, retryAfterMs) {
25
25
  let error;
26
- const props = { statusCode, driverVersion: packageVersion_1.pkgVersion };
26
+ const props = { statusCode, driverVersion: packageVersion_js_1.pkgVersion };
27
27
  switch (statusCode) {
28
28
  case 401:
29
29
  // The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,
30
30
  // so we treat repeat 401s the same as 403.
31
31
  case 403:
32
- error = new driver_utils_1.AuthorizationError(errorMessage, undefined, undefined, props);
32
+ error = new internal_1.AuthorizationError(errorMessage, undefined, undefined, props);
33
33
  break;
34
34
  case 404:
35
35
  const errorType = exports.RouterliciousErrorTypes.fileNotFoundOrAccessDeniedError;
36
- error = new driver_utils_1.NonRetryableError(errorMessage, errorType, props);
36
+ error = new internal_1.NonRetryableError(errorMessage, errorType, props);
37
37
  break;
38
38
  case 429:
39
- error = (0, driver_utils_1.createGenericNetworkError)(errorMessage, { canRetry: true, retryAfterMs }, props);
39
+ error = (0, internal_1.createGenericNetworkError)(errorMessage, { canRetry: true, retryAfterMs }, props);
40
40
  break;
41
41
  case 500:
42
42
  case 502:
43
- error = new driver_utils_1.GenericNetworkError(errorMessage, true, props);
43
+ error = new internal_1.GenericNetworkError(errorMessage, true, props);
44
44
  break;
45
45
  default:
46
46
  const retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };
47
- error = (0, driver_utils_1.createGenericNetworkError)(errorMessage, retryInfo, props);
47
+ error = (0, internal_1.createGenericNetworkError)(errorMessage, retryInfo, props);
48
48
  break;
49
49
  }
50
50
  error.addTelemetryProperties({ endpointReached: true });
@@ -53,7 +53,6 @@ function createR11sNetworkError(errorMessage, statusCode, retryAfterMs) {
53
53
  exports.createR11sNetworkError = createR11sNetworkError;
54
54
  function throwR11sNetworkError(errorMessage, statusCode, retryAfterMs) {
55
55
  const networkError = createR11sNetworkError(errorMessage, statusCode, retryAfterMs);
56
- // eslint-disable-next-line @typescript-eslint/no-throw-literal
57
56
  throw networkError;
58
57
  }
59
58
  exports.throwR11sNetworkError = throwR11sNetworkError;
@@ -1 +1 @@
1
- {"version":3,"file":"errorUtils.js","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2EAI4C;AAC5C,+DAKsC;AAEtC,qDAA+D;AAE/D;;;;GAIG;AACU,QAAA,uBAAuB,GAAG;IACtC,kCAAkC;IAClC,GAAG,qCAAgB;IAEnB;;OAEG;IACH,YAAY,EAAE,cAAc;CACnB,CAAC;AA2CX,SAAgB,sBAAsB,CACrC,YAAoB,EACpB,UAAkB,EAClB,YAAqB;IAErB,IAAI,KAAkC,CAAC;IACvC,MAA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ACH,SAAgB,0BAA0B,CACzC,WAA6B,EAC7B,OAAe;IAEf,iDAAiD;IACjD,MAAM,OAAO,GAAG,sBAAsB,OAAO,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;IACzE,OAAO,sBAAsB,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;AACpF,CAAC;AAPD,gEAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tDriverError,\n\tIDriverErrorBase,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions\";\nimport {\n\tNonRetryableError,\n\tGenericNetworkError,\n\tcreateGenericNetworkError,\n\tAuthorizationError,\n} from \"@fluidframework/driver-utils\";\nimport { IFluidErrorBase } from \"@fluidframework/telemetry-utils\";\nimport { pkgVersion as driverVersion } from \"./packageVersion\";\n\n/**\n * Routerlicious Error types\n * Different error types that may be thrown by the routerlicious driver\n * @internal\n */\nexport const RouterliciousErrorTypes = {\n\t// Inherit base driver error types\n\t...DriverErrorTypes,\n\n\t/**\n\t * SSL Certificate Error.\n\t */\n\tsslCertError: \"sslCertError\",\n} as const;\n/**\n * @internal\n */\nexport type RouterliciousErrorTypes =\n\t(typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];\n\n/**\n * Interface for error responses for the WebSocket connection\n * Intended to be compatible with output from {@link NetworkError.toJSON}\n */\nexport interface IR11sSocketError {\n\t/**\n\t * An error code number for the error that occurred.\n\t * It will be a valid HTTP status code.\n\t */\n\tcode: number;\n\n\t/**\n\t * A message about the error that occurred for debugging / logging purposes.\n\t * This should not be displayed to the user directly.\n\t */\n\tmessage: string;\n\n\t/**\n\t * Optional Retry-After time in seconds.\n\t * The client should wait this many seconds before retrying its request.\n\t */\n\tretryAfter?: number;\n\n\t/**\n\t * Optional Retry-After time in milliseconds.\n\t * The client should wait this many milliseconds before retrying its request.\n\t */\n\tretryAfterMs?: number;\n}\n\nexport interface IR11sError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: RouterliciousErrorTypes;\n}\n\nexport type R11sError = DriverError | IR11sError;\n\nexport function createR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n): IFluidErrorBase & R11sError {\n\tlet error: IFluidErrorBase & R11sError;\n\tconst props = { statusCode, driverVersion };\n\tswitch (statusCode) {\n\t\tcase 401:\n\t\t// The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,\n\t\t// so we treat repeat 401s the same as 403.\n\t\tcase 403:\n\t\t\terror = new AuthorizationError(errorMessage, undefined, undefined, props);\n\t\t\tbreak;\n\t\tcase 404:\n\t\t\tconst errorType = RouterliciousErrorTypes.fileNotFoundOrAccessDeniedError;\n\t\t\terror = new NonRetryableError(errorMessage, errorType, props);\n\t\t\tbreak;\n\t\tcase 429:\n\t\t\terror = createGenericNetworkError(\n\t\t\t\terrorMessage,\n\t\t\t\t{ canRetry: true, retryAfterMs },\n\t\t\t\tprops,\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 500:\n\t\tcase 502:\n\t\t\terror = new GenericNetworkError(errorMessage, true, props);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconst retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };\n\t\t\terror = createGenericNetworkError(errorMessage, retryInfo, props);\n\t\t\tbreak;\n\t}\n\terror.addTelemetryProperties({ endpointReached: true });\n\treturn error;\n}\n\nexport function throwR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n): never {\n\tconst networkError = createR11sNetworkError(errorMessage, statusCode, retryAfterMs);\n\n\t// eslint-disable-next-line @typescript-eslint/no-throw-literal\n\tthrow networkError;\n}\n\n/**\n * Returns network error based on error object from R11s socket (IR11sSocketError)\n */\nexport function errorObjectFromSocketError(\n\tsocketError: IR11sSocketError,\n\thandler: string,\n): R11sError {\n\t// pre-0.58 error message prefix: R11sSocketError\n\tconst message = `R11s socket error (${handler}): ${socketError.message}`;\n\treturn createR11sNetworkError(message, socketError.code, socketError.retryAfterMs);\n}\n"]}
1
+ {"version":3,"file":"errorUtils.js","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2EAAwF;AAExF,oEAK+C;AAG/C,2DAAkE;AAElE;;;;GAIG;AACU,QAAA,uBAAuB,GAAG;IACtC,kCAAkC;IAClC,GAAG,qCAAgB;IAEnB;;OAEG;IACH,YAAY,EAAE,cAAc;CACnB,CAAC;AA2CX,SAAgB,sBAAsB,CACrC,YAAoB,EACpB,UAAkB,EAClB,YAAqB;IAErB,IAAI,KAAkC,CAAC;IACvC,MAAM,KAAK,GAAG,EAAE,UAAU,EAAE,aAAa,EAAb,8BAAa,EAAE,CAAC;IAC5C,QAAQ,UAAU,EAAE;QACnB,KAAK,GAAG,CAAC;QACT,wFAAwF;QACxF,2CAA2C;QAC3C,KAAK,GAAG;YACP,KAAK,GAAG,IAAI,6BAAkB,CAAC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YAC1E,MAAM;QACP,KAAK,GAAG;YACP,MAAM,SAAS,GAAG,+BAAuB,CAAC,+BAA+B,CAAC;YAC1E,KAAK,GAAG,IAAI,4BAAiB,CAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YAC9D,MAAM;QACP,KAAK,GAAG;YACP,KAAK,GAAG,IAAA,oCAAyB,EAChC,YAAY,EACZ,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,EAChC,KAAK,CACL,CAAC;YACF,MAAM;QACP,KAAK,GAAG,CAAC;QACT,KAAK,GAAG;YACP,KAAK,GAAG,IAAI,8BAAmB,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;YAC3D,MAAM;QACP;YACC,MAAM,SAAS,GAAG,EAAE,QAAQ,EAAE,YAAY,KAAK,SAAS,EAAE,YAAY,EAAE,CAAC;YACzE,KAAK,GAAG,IAAA,oCAAyB,EAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YAClE,MAAM;KACP;IACD,KAAK,CAAC,sBAAsB,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,OAAO,KAAK,CAAC;AACd,CAAC;AApCD,wDAoCC;AAED,SAAgB,qBAAqB,CACpC,YAAoB,EACpB,UAAkB,EAClB,YAAqB;IAErB,MAAM,YAAY,GAAG,sBAAsB,CAAC,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;IAEpF,MAAM,YAAY,CAAC;AACpB,CAAC;AARD,sDAQC;AAED;;GAEG;AACH,SAAgB,0BAA0B,CACzC,WAA6B,EAC7B,OAAe;IAEf,iDAAiD;IACjD,MAAM,OAAO,GAAG,sBAAsB,OAAO,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;IACzE,OAAO,sBAAsB,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;AACpF,CAAC;AAPD,gEAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DriverErrorTypes, IDriverErrorBase } from \"@fluidframework/driver-definitions\";\nimport { DriverError } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tAuthorizationError,\n\tGenericNetworkError,\n\tNonRetryableError,\n\tcreateGenericNetworkError,\n} from \"@fluidframework/driver-utils/internal\";\nimport { IFluidErrorBase } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion as driverVersion } from \"./packageVersion.js\";\n\n/**\n * Routerlicious Error types\n * Different error types that may be thrown by the routerlicious driver\n * @internal\n */\nexport const RouterliciousErrorTypes = {\n\t// Inherit base driver error types\n\t...DriverErrorTypes,\n\n\t/**\n\t * SSL Certificate Error.\n\t */\n\tsslCertError: \"sslCertError\",\n} as const;\n/**\n * @internal\n */\nexport type RouterliciousErrorTypes =\n\t(typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];\n\n/**\n * Interface for error responses for the WebSocket connection\n * Intended to be compatible with output from `NetworkError.toJSON`.\n */\nexport interface IR11sSocketError {\n\t/**\n\t * An error code number for the error that occurred.\n\t * It will be a valid HTTP status code.\n\t */\n\tcode: number;\n\n\t/**\n\t * A message about the error that occurred for debugging / logging purposes.\n\t * This should not be displayed to the user directly.\n\t */\n\tmessage: string;\n\n\t/**\n\t * Optional Retry-After time in seconds.\n\t * The client should wait this many seconds before retrying its request.\n\t */\n\tretryAfter?: number;\n\n\t/**\n\t * Optional Retry-After time in milliseconds.\n\t * The client should wait this many milliseconds before retrying its request.\n\t */\n\tretryAfterMs?: number;\n}\n\nexport interface IR11sError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: RouterliciousErrorTypes;\n}\n\nexport type R11sError = DriverError | IR11sError;\n\nexport function createR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n): IFluidErrorBase & R11sError {\n\tlet error: IFluidErrorBase & R11sError;\n\tconst props = { statusCode, driverVersion };\n\tswitch (statusCode) {\n\t\tcase 401:\n\t\t// The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,\n\t\t// so we treat repeat 401s the same as 403.\n\t\tcase 403:\n\t\t\terror = new AuthorizationError(errorMessage, undefined, undefined, props);\n\t\t\tbreak;\n\t\tcase 404:\n\t\t\tconst errorType = RouterliciousErrorTypes.fileNotFoundOrAccessDeniedError;\n\t\t\terror = new NonRetryableError(errorMessage, errorType, props);\n\t\t\tbreak;\n\t\tcase 429:\n\t\t\terror = createGenericNetworkError(\n\t\t\t\terrorMessage,\n\t\t\t\t{ canRetry: true, retryAfterMs },\n\t\t\t\tprops,\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 500:\n\t\tcase 502:\n\t\t\terror = new GenericNetworkError(errorMessage, true, props);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconst retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };\n\t\t\terror = createGenericNetworkError(errorMessage, retryInfo, props);\n\t\t\tbreak;\n\t}\n\terror.addTelemetryProperties({ endpointReached: true });\n\treturn error;\n}\n\nexport function throwR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n): never {\n\tconst networkError = createR11sNetworkError(errorMessage, statusCode, retryAfterMs);\n\n\tthrow networkError;\n}\n\n/**\n * Returns network error based on error object from R11s socket (IR11sSocketError)\n */\nexport function errorObjectFromSocketError(\n\tsocketError: IR11sSocketError,\n\thandler: string,\n): R11sError {\n\t// pre-0.58 error message prefix: R11sSocketError\n\tconst message = `R11s socket error (${handler}): ${socketError.message}`;\n\treturn createR11sNetworkError(message, socketError.code, socketError.retryAfterMs);\n}\n"]}
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import * as resources from "@fluidframework/gitresources";
6
6
  import { IWholeSummaryPayload, IWriteSummaryResponse } from "@fluidframework/server-services-client";
7
- import { IGitManager, IHistorian } from "./storageContracts";
8
- import { IR11sResponse } from "./restWrapper";
9
- import { IWholeFlatSnapshot } from "./contracts";
7
+ import { IWholeFlatSnapshot } from "./contracts.js";
8
+ import { IR11sResponse } from "./restWrapper.js";
9
+ import { IGitManager, IHistorian } from "./storageContracts.js";
10
10
  export declare class GitManager implements IGitManager {
11
11
  private readonly historian;
12
12
  constructor(historian: IHistorian);
@@ -1 +1 @@
1
- {"version":3,"file":"gitManager.d.ts","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,SAAS,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EACN,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAA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tB,GAAW,EACX,KAAa;QAEb,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,SAAS,GAAG,IAAI;QAClD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,GAAW;QAC/B,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAEM,KAAK,CAAC,UAAU,CACtB,OAAe,EACf,QAA4B;QAE5B,MAAM,IAAI,GAAgC;YACzC,OAAO;YACP,QAAQ;SACR,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,MAAmC;QAEnC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,KAAK,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAA6B,EAC7B,UAAmB,KAAK;QAExB,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,GAAW;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;CACD;AApDD,gCAoDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as resources from \"@fluidframework/gitresources\";\nimport {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\nimport { IGitManager, IHistorian } from \"./storageContracts\";\nimport { IR11sResponse } from \"./restWrapper\";\nimport { IWholeFlatSnapshot } from \"./contracts\";\n\nexport class GitManager implements IGitManager {\n\tconstructor(private readonly historian: IHistorian) {}\n\n\t/**\n\t * Reads the object with the given ID. We defer to the client implementation to do the actual read.\n\t */\n\tpublic async getCommits(\n\t\tsha: string,\n\t\tcount: number,\n\t): Promise<IR11sResponse<resources.ICommitDetails[]>> {\n\t\treturn this.historian.getCommits(sha, count);\n\t}\n\n\t/**\n\t * Reads the object with the given ID. We defer to the client implementation to do the actual read.\n\t */\n\tpublic async getTree(root: string, recursive = true): Promise<IR11sResponse<resources.ITree>> {\n\t\treturn this.historian.getTree(root, recursive);\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<resources.IBlob>> {\n\t\treturn this.historian.getBlob(sha);\n\t}\n\n\tpublic async createBlob(\n\t\tcontent: string,\n\t\tencoding: \"utf-8\" | \"base64\",\n\t): Promise<IR11sResponse<resources.ICreateBlobResponse>> {\n\t\tconst blob: resources.ICreateBlobParams = {\n\t\t\tcontent,\n\t\t\tencoding,\n\t\t};\n\t\treturn this.historian.createBlob(blob);\n\t}\n\n\tpublic async createGitTree(\n\t\tparams: resources.ICreateTreeParams,\n\t): Promise<IR11sResponse<resources.ITree>> {\n\t\tconst treeP = this.historian.createTree(params);\n\t\treturn treeP;\n\t}\n\n\tpublic async createSummary(\n\t\tsummary: IWholeSummaryPayload,\n\t\tinitial: boolean = false,\n\t): Promise<IR11sResponse<IWriteSummaryResponse>> {\n\t\treturn this.historian.createSummary(summary, initial);\n\t}\n\n\tpublic async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {\n\t\treturn this.historian.getSnapshot(sha);\n\t}\n}\n"]}
1
+ {"version":3,"file":"gitManager.js","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAYH,MAAa,UAAU;IACtB,YAA6B,SAAqB;QAArB,cAAS,GAAT,SAAS,CAAY;IAAG,CAAC;IAEtD;;OAEG;IACI,KAAK,CAAC,UAAU,CACtB,GAAW,EACX,KAAa;QAEb,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,SAAS,GAAG,IAAI;QAClD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,GAAW;QAC/B,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAEM,KAAK,CAAC,UAAU,CACtB,OAAe,EACf,QAA4B;QAE5B,MAAM,IAAI,GAAgC;YACzC,OAAO;YACP,QAAQ;SACR,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,MAAmC;QAEnC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,KAAK,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAA6B,EAC7B,UAAmB,KAAK;QAExB,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,GAAW;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;CACD;AApDD,gCAoDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as resources from \"@fluidframework/gitresources\";\nimport {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\n\nimport { IWholeFlatSnapshot } from \"./contracts.js\";\nimport { IR11sResponse } from \"./restWrapper.js\";\nimport { IGitManager, IHistorian } from \"./storageContracts.js\";\n\nexport class GitManager implements IGitManager {\n\tconstructor(private readonly historian: IHistorian) {}\n\n\t/**\n\t * Reads the object with the given ID. We defer to the client implementation to do the actual read.\n\t */\n\tpublic async getCommits(\n\t\tsha: string,\n\t\tcount: number,\n\t): Promise<IR11sResponse<resources.ICommitDetails[]>> {\n\t\treturn this.historian.getCommits(sha, count);\n\t}\n\n\t/**\n\t * Reads the object with the given ID. We defer to the client implementation to do the actual read.\n\t */\n\tpublic async getTree(root: string, recursive = true): Promise<IR11sResponse<resources.ITree>> {\n\t\treturn this.historian.getTree(root, recursive);\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<resources.IBlob>> {\n\t\treturn this.historian.getBlob(sha);\n\t}\n\n\tpublic async createBlob(\n\t\tcontent: string,\n\t\tencoding: \"utf-8\" | \"base64\",\n\t): Promise<IR11sResponse<resources.ICreateBlobResponse>> {\n\t\tconst blob: resources.ICreateBlobParams = {\n\t\t\tcontent,\n\t\t\tencoding,\n\t\t};\n\t\treturn this.historian.createBlob(blob);\n\t}\n\n\tpublic async createGitTree(\n\t\tparams: resources.ICreateTreeParams,\n\t): Promise<IR11sResponse<resources.ITree>> {\n\t\tconst treeP = this.historian.createTree(params);\n\t\treturn treeP;\n\t}\n\n\tpublic async createSummary(\n\t\tsummary: IWholeSummaryPayload,\n\t\tinitial: boolean = false,\n\t): Promise<IR11sResponse<IWriteSummaryResponse>> {\n\t\treturn this.historian.createSummary(summary, initial);\n\t}\n\n\tpublic async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {\n\t\treturn this.historian.getSnapshot(sha);\n\t}\n}\n"]}
@@ -4,10 +4,10 @@
4
4
  */
5
5
  import * as git from "@fluidframework/gitresources";
6
6
  import { IWholeSummaryPayload, IWriteSummaryResponse } from "@fluidframework/server-services-client";
7
- import { RestWrapper } from "./restWrapperBase";
8
- import { IR11sResponse } from "./restWrapper";
9
- import { IHistorian } from "./storageContracts";
10
- import { IWholeFlatSnapshot } from "./contracts";
7
+ import { IWholeFlatSnapshot } from "./contracts.js";
8
+ import { IR11sResponse } from "./restWrapper.js";
9
+ import { RestWrapper } from "./restWrapperBase.js";
10
+ import { IHistorian } from "./storageContracts.js";
11
11
  export interface ICredentials {
12
12
  user: string;
13
13
  password: string;
@@ -1 +1 @@
1
- {"version":3,"file":"historian.d.ts","sourceRoot":"","sources":["../src/historian.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AACpD,OAAO,EACN,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAmB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,oCAAoC,gBAAiB,YAAY,KAAG,MACN,CAAC;AAE5E;;GAEG;AACH,qBAAa,SAAU,YAAW,UAAU;IAK1C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAN7B,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAuB;IAC1D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;gBAGlB,YAAY,EAAE,OAAO,EACtC,YAAY,EAAE,OAAO,EACJ,WAAW,EAAE,WAAW;IAU7B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAOvD,UAAU,CACtB,IAAI,EAAE,GAAG,CAAC,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AkB;YAC1B,GAAG,WAAW;SACd,CAAC;IACH,CAAC;CACD;AA7FD,8BA6FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fromUtf8ToBase64 } from \"@fluid-internal/client-utils\";\nimport * as git from \"@fluidframework/gitresources\";\nimport {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\nimport { QueryStringType, RestWrapper } from \"./restWrapperBase\";\nimport { IR11sResponse } from \"./restWrapper\";\nimport { IHistorian } from \"./storageContracts\";\nimport { IWholeFlatSnapshot } from \"./contracts\";\n\nexport interface ICredentials {\n\tuser: string;\n\tpassword: string;\n}\n\nexport const getAuthorizationTokenFromCredentials = (credentials: ICredentials): string =>\n\t`Basic ${fromUtf8ToBase64(`${credentials.user}:${credentials.password}`)}`;\n\n/**\n * Implementation of the IHistorian interface that calls out to a REST interface\n */\nexport class Historian implements IHistorian {\n\tprivate readonly defaultQueryString: QueryStringType = {};\n\tprivate readonly cacheBust: boolean;\n\n\tconstructor(\n\t\tprivate readonly historianApi: boolean,\n\t\tdisableCache: boolean,\n\t\tprivate readonly restWrapper: RestWrapper,\n\t) {\n\t\tif (disableCache && this.historianApi) {\n\t\t\tthis.defaultQueryString.disableCache = disableCache;\n\t\t\tthis.cacheBust = false;\n\t\t} else {\n\t\t\tthis.cacheBust = disableCache;\n\t\t}\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<git.IBlob>> {\n\t\treturn this.restWrapper.get<git.IBlob>(\n\t\t\t`/git/blobs/${encodeURIComponent(sha)}`,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tpublic async createBlob(\n\t\tblob: git.ICreateBlobParams,\n\t): Promise<IR11sResponse<git.ICreateBlobResponse>> {\n\t\treturn this.restWrapper.post<git.ICreateBlobResponse>(\n\t\t\t`/git/blobs`,\n\t\t\tblob,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tpublic async getCommits(\n\t\tsha: string,\n\t\tcount: number,\n\t): Promise<IR11sResponse<git.ICommitDetails[]>> {\n\t\treturn this.restWrapper\n\t\t\t.get<git.ICommitDetails[]>(`/commits`, this.getQueryString({ count, sha }))\n\t\t\t.catch(async (error) =>\n\t\t\t\terror.statusCode === 400 || error.statusCode === 404\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcontent: [],\n\t\t\t\t\t\t\theaders: new Map(),\n\t\t\t\t\t\t\tpropsToLog: {},\n\t\t\t\t\t\t\trequestUrl: \"\",\n\t\t\t\t\t }\n\t\t\t\t\t: Promise.reject<IR11sResponse<git.ICommitDetails[]>>(error),\n\t\t\t);\n\t}\n\n\tpublic async createTree(tree: git.ICreateTreeParams): Promise<IR11sResponse<git.ITree>> {\n\t\treturn this.restWrapper.post<git.ITree>(`/git/trees`, tree, this.getQueryString());\n\t}\n\n\tpublic async getTree(sha: string, recursive: boolean): Promise<IR11sResponse<git.ITree>> {\n\t\treturn this.restWrapper.get<git.ITree>(\n\t\t\t`/git/trees/${encodeURIComponent(sha)}`,\n\t\t\tthis.getQueryString({ recursive: recursive ? 1 : 0 }),\n\t\t);\n\t}\n\tpublic async createSummary(\n\t\tsummary: IWholeSummaryPayload,\n\t\tinitial?: boolean,\n\t): Promise<IR11sResponse<IWriteSummaryResponse>> {\n\t\treturn this.restWrapper.post<IWriteSummaryResponse>(\n\t\t\t`/git/summaries`,\n\t\t\tsummary,\n\t\t\tthis.getQueryString(initial !== undefined ? { initial } : undefined),\n\t\t);\n\t}\n\n\tpublic async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {\n\t\treturn this.restWrapper.get<IWholeFlatSnapshot>(\n\t\t\t`/git/summaries/${sha}`,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tprivate getQueryString(queryString?: QueryStringType): QueryStringType {\n\t\tif (this.cacheBust) {\n\t\t\treturn {\n\t\t\t\tcacheBust: Date.now(),\n\t\t\t\t...this.defaultQueryString,\n\t\t\t\t...queryString,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...this.defaultQueryString,\n\t\t\t...queryString,\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"historian.js","sourceRoot":"","sources":["../src/historian.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAgE;AAiBzD,MAAM,oCAAoC,GAAG,CAAC,WAAyB,EAAU,EAAE,CACzF,SAAS,IAAA,+BAAgB,EAAC,GAAG,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;AAD/D,QAAA,oCAAoC,wCAC2B;AAE5E;;GAEG;AACH,MAAa,SAAS;IAIrB,YACkB,YAAqB,EACtC,YAAqB,EACJ,WAAwB;QAFxB,iBAAY,GAAZ,YAAY,CAAS;QAErB,gBAAW,GAAX,WAAW,CAAa;QANzB,uBAAkB,GAAoB,EAAE,CAAC;QAQzD,IAAI,YAAY,IAAI,IAAI,CAAC,YAAY,EAAE;YACtC,IAAI,CAAC,kBAAkB,CAAC,YAAY,GAAG,YAAY,CAAC;YACpD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;SACvB;aAAM;YACN,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC;SAC9B;IACF,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,GAAW;QAC/B,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAC1B,cAAc,kBAAkB,CAAC,GAAG,CAAC,EAAE,EACvC,IAAI,CAAC,cAAc,EAAE,CACrB,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,UAAU,CACtB,IAA2B;QAE3B,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAC3B,YAAY,EACZ,IAAI,EACJ,IAAI,CAAC,cAAc,EAAE,CACrB,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,UAAU,CACtB,GAAW,EACX,KAAa;QAEb,OAAO,IAAI,CAAC,WAAW;aACrB,GA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AC,cAAc,EAAE,CACrB,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,WAA6B;QACnD,IAAI,IAAI,CAAC,SAAS,EAAE;YACnB,OAAO;gBACN,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;gBACrB,GAAG,IAAI,CAAC,kBAAkB;gBAC1B,GAAG,WAAW;aACd,CAAC;SACF;QACD,OAAO;YACN,GAAG,IAAI,CAAC,kBAAkB;YAC1B,GAAG,WAAW;SACd,CAAC;IACH,CAAC;CACD;AA7FD,8BA6FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fromUtf8ToBase64 } from \"@fluid-internal/client-utils\";\nimport * as git from \"@fluidframework/gitresources\";\nimport {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\n\nimport { IWholeFlatSnapshot } from \"./contracts.js\";\nimport { IR11sResponse } from \"./restWrapper.js\";\nimport { QueryStringType, RestWrapper } from \"./restWrapperBase.js\";\nimport { IHistorian } from \"./storageContracts.js\";\n\nexport interface ICredentials {\n\tuser: string;\n\tpassword: string;\n}\n\nexport const getAuthorizationTokenFromCredentials = (credentials: ICredentials): string =>\n\t`Basic ${fromUtf8ToBase64(`${credentials.user}:${credentials.password}`)}`;\n\n/**\n * Implementation of the IHistorian interface that calls out to a REST interface\n */\nexport class Historian implements IHistorian {\n\tprivate readonly defaultQueryString: QueryStringType = {};\n\tprivate readonly cacheBust: boolean;\n\n\tconstructor(\n\t\tprivate readonly historianApi: boolean,\n\t\tdisableCache: boolean,\n\t\tprivate readonly restWrapper: RestWrapper,\n\t) {\n\t\tif (disableCache && this.historianApi) {\n\t\t\tthis.defaultQueryString.disableCache = disableCache;\n\t\t\tthis.cacheBust = false;\n\t\t} else {\n\t\t\tthis.cacheBust = disableCache;\n\t\t}\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<git.IBlob>> {\n\t\treturn this.restWrapper.get<git.IBlob>(\n\t\t\t`/git/blobs/${encodeURIComponent(sha)}`,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tpublic async createBlob(\n\t\tblob: git.ICreateBlobParams,\n\t): Promise<IR11sResponse<git.ICreateBlobResponse>> {\n\t\treturn this.restWrapper.post<git.ICreateBlobResponse>(\n\t\t\t`/git/blobs`,\n\t\t\tblob,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tpublic async getCommits(\n\t\tsha: string,\n\t\tcount: number,\n\t): Promise<IR11sResponse<git.ICommitDetails[]>> {\n\t\treturn this.restWrapper\n\t\t\t.get<git.ICommitDetails[]>(`/commits`, this.getQueryString({ count, sha }))\n\t\t\t.catch(async (error) =>\n\t\t\t\terror.statusCode === 400 || error.statusCode === 404\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcontent: [],\n\t\t\t\t\t\t\theaders: new Map(),\n\t\t\t\t\t\t\tpropsToLog: {},\n\t\t\t\t\t\t\trequestUrl: \"\",\n\t\t\t\t\t }\n\t\t\t\t\t: Promise.reject<IR11sResponse<git.ICommitDetails[]>>(error),\n\t\t\t);\n\t}\n\n\tpublic async createTree(tree: git.ICreateTreeParams): Promise<IR11sResponse<git.ITree>> {\n\t\treturn this.restWrapper.post<git.ITree>(`/git/trees`, tree, this.getQueryString());\n\t}\n\n\tpublic async getTree(sha: string, recursive: boolean): Promise<IR11sResponse<git.ITree>> {\n\t\treturn this.restWrapper.get<git.ITree>(\n\t\t\t`/git/trees/${encodeURIComponent(sha)}`,\n\t\t\tthis.getQueryString({ recursive: recursive ? 1 : 0 }),\n\t\t);\n\t}\n\tpublic async createSummary(\n\t\tsummary: IWholeSummaryPayload,\n\t\tinitial?: boolean,\n\t): Promise<IR11sResponse<IWriteSummaryResponse>> {\n\t\treturn this.restWrapper.post<IWriteSummaryResponse>(\n\t\t\t`/git/summaries`,\n\t\t\tsummary,\n\t\t\tthis.getQueryString(initial !== undefined ? { initial } : undefined),\n\t\t);\n\t}\n\n\tpublic async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {\n\t\treturn this.restWrapper.get<IWholeFlatSnapshot>(\n\t\t\t`/git/summaries/${sha}`,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tprivate getQueryString(queryString?: QueryStringType): QueryStringType {\n\t\tif (this.cacheBust) {\n\t\t\treturn {\n\t\t\t\tcacheBust: Date.now(),\n\t\t\t\t...this.defaultQueryString,\n\t\t\t\t...queryString,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...this.defaultQueryString,\n\t\t\t...queryString,\n\t\t};\n\t}\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export type { IRouterliciousResolvedUrl } from "./routerliciousResolvedUrl";
6
- export { DefaultTokenProvider } from "./defaultTokenProvider";
7
- export { ITokenProvider, ITokenResponse, ITokenService } from "./tokens";
8
- export { RouterliciousErrorTypes } from "./errorUtils";
9
- export { DocumentPostCreateError, RouterliciousDocumentServiceFactory, } from "./documentServiceFactory";
10
- export { IRouterliciousDriverPolicies } from "./policies";
5
+ export type { IRouterliciousResolvedUrl } from "./routerliciousResolvedUrl.js";
6
+ export { DefaultTokenProvider } from "./defaultTokenProvider.js";
7
+ export { ITokenProvider, ITokenResponse, ITokenService } from "./tokens.js";
8
+ export { RouterliciousErrorTypes } from "./errorUtils.js";
9
+ export { DocumentPostCreateError, RouterliciousDocumentServiceFactory, } from "./documentServiceFactory.js";
10
+ export { IRouterliciousDriverPolicies } from "./policies.js";
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAG5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EACN,uBAAuB,EACvB,mCAAmC,GACnC,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EACN,uBAAuB,EACvB,mCAAmC,GACnC,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -6,13 +6,13 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.RouterliciousDocumentServiceFactory = exports.DocumentPostCreateError = exports.RouterliciousErrorTypes = exports.DefaultTokenProvider = void 0;
8
8
  // Tokens
9
- var defaultTokenProvider_1 = require("./defaultTokenProvider");
10
- Object.defineProperty(exports, "DefaultTokenProvider", { enumerable: true, get: function () { return defaultTokenProvider_1.DefaultTokenProvider; } });
9
+ var defaultTokenProvider_js_1 = require("./defaultTokenProvider.js");
10
+ Object.defineProperty(exports, "DefaultTokenProvider", { enumerable: true, get: function () { return defaultTokenProvider_js_1.DefaultTokenProvider; } });
11
11
  // Errors
12
- var errorUtils_1 = require("./errorUtils");
13
- Object.defineProperty(exports, "RouterliciousErrorTypes", { enumerable: true, get: function () { return errorUtils_1.RouterliciousErrorTypes; } });
12
+ var errorUtils_js_1 = require("./errorUtils.js");
13
+ Object.defineProperty(exports, "RouterliciousErrorTypes", { enumerable: true, get: function () { return errorUtils_js_1.RouterliciousErrorTypes; } });
14
14
  // Factory
15
- var documentServiceFactory_1 = require("./documentServiceFactory");
16
- Object.defineProperty(exports, "DocumentPostCreateError", { enumerable: true, get: function () { return documentServiceFactory_1.DocumentPostCreateError; } });
17
- Object.defineProperty(exports, "RouterliciousDocumentServiceFactory", { enumerable: true, get: function () { return documentServiceFactory_1.RouterliciousDocumentServiceFactory; } });
15
+ var documentServiceFactory_js_1 = require("./documentServiceFactory.js");
16
+ Object.defineProperty(exports, "DocumentPostCreateError", { enumerable: true, get: function () { return documentServiceFactory_js_1.DocumentPostCreateError; } });
17
+ Object.defineProperty(exports, "RouterliciousDocumentServiceFactory", { enumerable: true, get: function () { return documentServiceFactory_js_1.RouterliciousDocumentServiceFactory; } });
18
18
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,SAAS;AACT,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAG7B,SAAS;AACT,2CAAuD;AAA9C,qHAAA,uBAAuB,OAAA;AAEhC,UAAU;AACV,mEAGkC;AAFjC,iIAAA,uBAAuB,OAAA;AACvB,6IAAA,mCAAmC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// URL\nexport type { IRouterliciousResolvedUrl } from \"./routerliciousResolvedUrl\";\n\n// Tokens\nexport { DefaultTokenProvider } from \"./defaultTokenProvider\";\nexport { ITokenProvider, ITokenResponse, ITokenService } from \"./tokens\";\n\n// Errors\nexport { RouterliciousErrorTypes } from \"./errorUtils\";\n\n// Factory\nexport {\n\tDocumentPostCreateError,\n\tRouterliciousDocumentServiceFactory,\n} from \"./documentServiceFactory\";\n\n// Configuration\nexport { IRouterliciousDriverPolicies } from \"./policies\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,SAAS;AACT,qEAAiE;AAAxD,+HAAA,oBAAoB,OAAA;AAG7B,SAAS;AACT,iDAA0D;AAAjD,wHAAA,uBAAuB,OAAA;AAEhC,UAAU;AACV,yEAGqC;AAFpC,oIAAA,uBAAuB,OAAA;AACvB,gJAAA,mCAAmC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// URL\nexport type { IRouterliciousResolvedUrl } from \"./routerliciousResolvedUrl.js\";\n\n// Tokens\nexport { DefaultTokenProvider } from \"./defaultTokenProvider.js\";\nexport { ITokenProvider, ITokenResponse, ITokenService } from \"./tokens.js\";\n\n// Errors\nexport { RouterliciousErrorTypes } from \"./errorUtils.js\";\n\n// Factory\nexport {\n\tDocumentPostCreateError,\n\tRouterliciousDocumentServiceFactory,\n} from \"./documentServiceFactory.js\";\n\n// Configuration\nexport { IRouterliciousDriverPolicies } from \"./policies.js\";\n"]}
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export {
12
+ // public APIs
13
+ ITokenProvider,
14
+ ITokenResponse,
15
+
16
+ // alpha APIs
17
+ IRouterliciousResolvedUrl
18
+ } from "./index.js";
@@ -5,7 +5,7 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.MapWithExpiration = void 0;
8
- const core_utils_1 = require("@fluidframework/core-utils");
8
+ const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  /**
10
10
  * An extension of Map that expires (deletes) entries after a period of inactivity.
11
11
  * The policy is based on the last time a key was written to.
@@ -26,7 +26,7 @@ class MapWithExpiration extends Map {
26
26
  */
27
27
  checkExpiry(key, cleanUp = false) {
28
28
  const refreshTime = this.lastRefreshedTimes.get(key);
29
- (0, core_utils_1.assert)((refreshTime !== undefined) === super.has(key), 0x50c /* freshness map out of sync */);
29
+ (0, internal_1.assert)((refreshTime !== undefined) === super.has(key), 0x50c /* freshness map out of sync */);
30
30
  if (refreshTime === undefined) {
31
31
  return undefined;
32
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mapWithExpiration.js","sourceRoot":"","sources":["../src/mapWithExpiration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAEpD;;;GAGG;AACH,MAAa,iBAA4C,SAAQ,GAAiB;IAIjF,YAA6B,QAAgB;QAC5C,KAAK,EAAE,CAAC;QADoB,aAAQ,GAAR,QAAQ,CAAQ;QAH7C,2EAA2E;QAC1D,uBAAkB,GAAG,IAAI,GAAG,EAAgB,CAAC;IAI9D,CAAC;IAEO,OAAO,CAAC,GAAS;QACxB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACK,WAAW,CAAC,GAAS,EAAE,UAAmB,KAAK;QACtD,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrD,IAAA,mBAAM,EACL,CAAC,WAAW,KAAK,SAAS,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAC9C,KAAK,CAAC,+BAA+B,CACrC,CAAC;QAEF,IAAI,WAAW,KAAK,SAAS,EAAE;YAC9B,OAAO,SAAS,CAAC;SACjB;QACD,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,WAA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ACZ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;YACX,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;gBACjC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACpB;iBAAM;gBACN,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;aAClC;QACF,CAAC,CAED,CAAC;QAEF,kEAAkE;QAClE,WAAW,CAAC,OAAO,CAAC,CAAC,GAAS,EAAE,EAAE;YACjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO;QACN,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IACD,IAAI;QACH,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IACD,MAAM;QACL,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACjC,CAAC;IAED,OAAO;QACN,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;CACD;AAhHD,8CAgHC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * An extension of Map that expires (deletes) entries after a period of inactivity.\n * The policy is based on the last time a key was written to.\n */\nexport class MapWithExpiration<TKey = any, TValue = any> extends Map<TKey, TValue> {\n\t/** Timestamps (as epoch ms numbers) of when each key was last refreshed */\n\tprivate readonly lastRefreshedTimes = new Map<TKey, number>();\n\n\tconstructor(private readonly expiryMs: number) {\n\t\tsuper();\n\t}\n\n\tprivate refresh(key: TKey): void {\n\t\tthis.lastRefreshedTimes.set(key, new Date().valueOf());\n\t}\n\n\t/**\n\t * Returns true if the key is present and expired, false if it's not expired, and undefined if it's not found\n\t * If cleanUp is passed as true, then delete any expired entry before returning.\n\t */\n\tprivate checkExpiry(key: TKey, cleanUp: boolean = false): boolean | undefined {\n\t\tconst refreshTime = this.lastRefreshedTimes.get(key);\n\t\tassert(\n\t\t\t(refreshTime !== undefined) === super.has(key),\n\t\t\t0x50c /* freshness map out of sync */,\n\t\t);\n\n\t\tif (refreshTime === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst expired = new Date().valueOf() - refreshTime >= this.expiryMs;\n\t\tif (expired && cleanUp) {\n\t\t\tthis.delete(key);\n\t\t}\n\t\treturn expired;\n\t}\n\n\tprivate clearExpiredEntries() {\n\t\t// forEach clears out any expired entries\n\t\tthis.forEach(() => {});\n\t}\n\n\tget size(): number {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.size;\n\t}\n\n\thas(key: TKey): boolean {\n\t\tthis.checkExpiry(key, true /* cleanUp */);\n\t\treturn super.has(key);\n\t}\n\n\tget(key: TKey): TValue | undefined {\n\t\tthis.checkExpiry(key, true /* cleanUp */);\n\t\treturn super.get(key);\n\t}\n\n\tset(key: TKey, value: TValue): this {\n\t\t// Sliding window expiration policy (on write)\n\t\tthis.refresh(key);\n\t\treturn super.set(key, value);\n\t}\n\n\tdelete(key: TKey): boolean {\n\t\tthis.lastRefreshedTimes.delete(key);\n\t\treturn super.delete(key);\n\t}\n\n\tclear(): void {\n\t\tthis.lastRefreshedTimes.clear();\n\t\tsuper.clear();\n\t}\n\n\tforEach(\n\t\tcallbackfn: (value: TValue, key: TKey, map: Map<TKey, TValue>) => void,\n\t\tthisArg?: any,\n\t): void {\n\t\tconst expiredKeys: TKey[] = [];\n\t\tsuper.forEach(\n\t\t\t(v, k, m) => {\n\t\t\t\tif (this.checkExpiry(k) === true) {\n\t\t\t\t\texpiredKeys.push(k);\n\t\t\t\t} else {\n\t\t\t\t\tcallbackfn.bind(thisArg)(v, k, m);\n\t\t\t\t}\n\t\t\t},\n\t\t\t// Note we don't pass thisArg here, since we bind it directly to callbackFn and don't need it otherwise\n\t\t);\n\n\t\t// Clean up keys we know are expired now that we're done iterating\n\t\texpiredKeys.forEach((key: TKey) => {\n\t\t\tthis.delete(key);\n\t\t});\n\t}\n\n\tentries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.entries();\n\t}\n\tkeys(): IterableIterator<TKey> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.keys();\n\t}\n\tvalues(): IterableIterator<TValue> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.values();\n\t}\n\t[Symbol.iterator](): IterableIterator<[TKey, TValue]> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super[Symbol.iterator]();\n\t}\n\n\tvalueOf() {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.valueOf();\n\t}\n}\n"]}
1
+ {"version":3,"file":"mapWithExpiration.js","sourceRoot":"","sources":["../src/mapWithExpiration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D;;;GAGG;AACH,MAAa,iBAA4C,SAAQ,GAAiB;IAIjF,YAA6B,QAAgB;QAC5C,KAAK,EAAE,CAAC;QADoB,aAAQ,GAAR,QAAQ,CAAQ;QAH7C,2EAA2E;QAC1D,uBAAkB,GAAG,IAAI,GAAG,EAAgB,CAAC;IAI9D,CAAC;IAEO,OAAO,CAAC,GAAS;QACxB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IACxD,CAAC;IAED;;;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AAC;QAC3B,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACjC,CAAC;IAED,OAAO;QACN,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;CACD;AAhHD,8CAgHC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\n/**\n * An extension of Map that expires (deletes) entries after a period of inactivity.\n * The policy is based on the last time a key was written to.\n */\nexport class MapWithExpiration<TKey = any, TValue = any> extends Map<TKey, TValue> {\n\t/** Timestamps (as epoch ms numbers) of when each key was last refreshed */\n\tprivate readonly lastRefreshedTimes = new Map<TKey, number>();\n\n\tconstructor(private readonly expiryMs: number) {\n\t\tsuper();\n\t}\n\n\tprivate refresh(key: TKey): void {\n\t\tthis.lastRefreshedTimes.set(key, new Date().valueOf());\n\t}\n\n\t/**\n\t * Returns true if the key is present and expired, false if it's not expired, and undefined if it's not found\n\t * If cleanUp is passed as true, then delete any expired entry before returning.\n\t */\n\tprivate checkExpiry(key: TKey, cleanUp: boolean = false): boolean | undefined {\n\t\tconst refreshTime = this.lastRefreshedTimes.get(key);\n\t\tassert(\n\t\t\t(refreshTime !== undefined) === super.has(key),\n\t\t\t0x50c /* freshness map out of sync */,\n\t\t);\n\n\t\tif (refreshTime === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst expired = new Date().valueOf() - refreshTime >= this.expiryMs;\n\t\tif (expired && cleanUp) {\n\t\t\tthis.delete(key);\n\t\t}\n\t\treturn expired;\n\t}\n\n\tprivate clearExpiredEntries() {\n\t\t// forEach clears out any expired entries\n\t\tthis.forEach(() => {});\n\t}\n\n\tget size(): number {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.size;\n\t}\n\n\thas(key: TKey): boolean {\n\t\tthis.checkExpiry(key, true /* cleanUp */);\n\t\treturn super.has(key);\n\t}\n\n\tget(key: TKey): TValue | undefined {\n\t\tthis.checkExpiry(key, true /* cleanUp */);\n\t\treturn super.get(key);\n\t}\n\n\tset(key: TKey, value: TValue): this {\n\t\t// Sliding window expiration policy (on write)\n\t\tthis.refresh(key);\n\t\treturn super.set(key, value);\n\t}\n\n\tdelete(key: TKey): boolean {\n\t\tthis.lastRefreshedTimes.delete(key);\n\t\treturn super.delete(key);\n\t}\n\n\tclear(): void {\n\t\tthis.lastRefreshedTimes.clear();\n\t\tsuper.clear();\n\t}\n\n\tforEach(\n\t\tcallbackfn: (value: TValue, key: TKey, map: Map<TKey, TValue>) => void,\n\t\tthisArg?: any,\n\t): void {\n\t\tconst expiredKeys: TKey[] = [];\n\t\tsuper.forEach(\n\t\t\t(v, k, m) => {\n\t\t\t\tif (this.checkExpiry(k) === true) {\n\t\t\t\t\texpiredKeys.push(k);\n\t\t\t\t} else {\n\t\t\t\t\tcallbackfn.bind(thisArg)(v, k, m);\n\t\t\t\t}\n\t\t\t},\n\t\t\t// Note we don't pass thisArg here, since we bind it directly to callbackFn and don't need it otherwise\n\t\t);\n\n\t\t// Clean up keys we know are expired now that we're done iterating\n\t\texpiredKeys.forEach((key: TKey) => {\n\t\t\tthis.delete(key);\n\t\t});\n\t}\n\n\tentries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.entries();\n\t}\n\tkeys(): IterableIterator<TKey> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.keys();\n\t}\n\tvalues(): IterableIterator<TValue> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.values();\n\t}\n\t[Symbol.iterator](): IterableIterator<[TKey, TValue]> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super[Symbol.iterator]();\n\t}\n\n\tvalueOf() {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.valueOf();\n\t}\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 { IDocumentStorageService, ISummaryContext } from "@fluidframework/driver-definitions";
5
+ import { IDocumentStorageService, ISummaryContext } from "@fluidframework/driver-definitions/internal";
6
6
  import * as api from "@fluidframework/protocol-definitions";
7
7
  /**
8
8
  * Document access to underlying storage. It is default implementation of a storage service.
@@ -1 +1 @@
1
- {"version":3,"file":"nullBlobStorageService.d.ts","sourceRoot":"","sources":["../src/nullBlobStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAE5D;;;GAGG;AACH,qBAAa,sBAAuB,YAAW,uBAAuB;IACxD,eAAe,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC;IAI1E,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAI7E,wBAAwB,CACpC,OAAO,EAAE,GAAG,CAAC,YAAY,EACzB,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC;IAIL,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IAItE,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAGnE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CAG/D"}
1
+ {"version":3,"file":"nullBlobStorageService.d.ts","sourceRoot":"","sources":["../src/nullBlobStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,uBAAuB,EACvB,eAAe,EACf,MAAM,6CAA6C,CAAC;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AAC,MAA0B;QACtD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QAC5C,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC1D,CAAC;IACM,KAAK,CAAC,QAAQ,CAAC,MAAc;QACnC,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACxD,CAAC;CACD;AA1BD,wDA0BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDocumentStorageService, ISummaryContext } from \"@fluidframework/driver-definitions\";\nimport * as api from \"@fluidframework/protocol-definitions\";\n\n/**\n * Document access to underlying storage. It is default implementation of a storage service.\n * Does not read/write anything.\n */\nexport class NullBlobStorageService implements IDocumentStorageService {\n\tpublic async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {\n\t\treturn version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {\n\t\treturn [];\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: api.ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse> {\n\t\tthrow new Error(\"Null blob storage can not create blob\");\n\t}\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tthrow new Error(\"Null blob storage can not read blob\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"nullBlobStorageService.js","sourceRoot":"","sources":["../src/nullBlobStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH;;;GAGG;AACH,MAAa,sBAAsB;IAC3B,KAAK,CAAC,eAAe,CAAC,OAAsB;QAClD,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,SAAwB,EAAE,KAAa;QAC/D,OAAO,EAAE,CAAC;IACX,CAAC;IAEM,KAAK,CAAC,wBAAwB,CACpC,OAAyB,EACzB,OAAwB;QAExB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAA0B;QACtD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QAC5C,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC1D,CAAC;IACM,KAAK,CAAC,QAAQ,CAAC,MAAc;QACnC,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACxD,CAAC;CACD;AA1BD,wDA0BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDocumentStorageService,\n\tISummaryContext,\n} from \"@fluidframework/driver-definitions/internal\";\nimport * as api from \"@fluidframework/protocol-definitions\";\n\n/**\n * Document access to underlying storage. It is default implementation of a storage service.\n * Does not read/write anything.\n */\nexport class NullBlobStorageService implements IDocumentStorageService {\n\tpublic async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {\n\t\treturn version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {\n\t\treturn [];\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: api.ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async downloadSummary(handle: api.ISummaryHandle): Promise<api.ISummaryTree> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<api.ICreateBlobResponse> {\n\t\tthrow new Error(\"Null blob storage can not create blob\");\n\t}\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tthrow new Error(\"Null blob storage can not read blob\");\n\t}\n}\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/routerlicious-driver";
8
- export declare const pkgVersion = "2.0.0-rc.2.0.2";
8
+ export declare const pkgVersion = "2.0.0-rc.3.0.1";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/routerlicious-driver";
11
- exports.pkgVersion = "2.0.0-rc.2.0.2";
11
+ exports.pkgVersion = "2.0.0-rc.3.0.1";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sCAAsC,CAAC;AACjD,QAAA,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/routerlicious-driver\";\nexport const pkgVersion = \"2.0.0-rc.2.0.2\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sCAAsC,CAAC;AACjD,QAAA,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/routerlicious-driver\";\nexport const pkgVersion = \"2.0.0-rc.3.0.1\";\n"]}
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export {
12
+ // public APIs
13
+ ITokenProvider,
14
+ ITokenResponse
15
+ } from "./index.js";
@@ -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 { INormalizedWholeSnapshot, IWholeFlatSnapshot } from "./contracts";
5
+ import { INormalizedWholeSnapshot, IWholeFlatSnapshot } from "./contracts.js";
6
6
  /**
7
7
  * Converts existing IWholeFlatSnapshot to snapshot tree, blob array, and sequence number.
8
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"r11sSnapshotParser.d.ts","sourceRoot":"","sources":["../src/r11sSnapshotParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAA0B,MAAM,aAAa,CAAC;AAgDnG;;;;;;GAMG;AACH,wBAAgB,8CAA8C,CAC7D,YAAY,EAAE,kBAAkB,EAChC,kBAAkB,GAAE,MAAe,GACjC,wBAAwB,CAiB1B"}
1
+ {"version":3,"file":"r11sSnapshotParser.d.ts","sourceRoot":"","sources":["../src/r11sSnapshotParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,wBAAwB,EACxB,kBAAkB,EAElB,MAAM,gBAAgB,CAAC;AAgDxB;;;;;;GAMG;AACH,wBAAgB,8CAA8C,CAC7D,YAAY,EAAE,kBAAkB,EAChC,kBAAkB,GAAE,MAAe,GACjC,wBAAwB,CAiB1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"r11sSnapshotParser.js","sourceRoot":"","sources":["../src/r11sSnapshotParser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAA8D;AAG9D;;;;;;GAMG;AACH,SAAS,cAAc,CACtB,QAAgC,EAChC,kBAA0B;IAE1B,MAAM,MAAM,GAAsC,EAAE,CAAC;IACrD,uEAAuE;IACvE,MAAM,IAAI,GAAkB,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACtE,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAElB,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,OAAO,EAAE;QACrC,8FAA8F;QAC9F,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,kBAAkB,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;QAChF,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC7C,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;QAChE,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;QAErD,8FAA8F;QAC9F,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;QAElC,iCAAiC;QACjC,IAAI,KAAK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AAE,YAAY,CAAC,EAAE;KACnB,CAAC;AACH,CAAC;AApBD,wGAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { INormalizedWholeSnapshot, IWholeFlatSnapshot, IWholeFlatSnapshotTree } from \"./contracts\";\n\n/**\n * Build a tree hierarchy from a flat tree.\n *\n * @param flatTree - a flat tree\n * @param treePrefixToRemove - tree prefix to strip\n * @returns the heirarchical tree\n */\nfunction buildHierarchy(\n\tflatTree: IWholeFlatSnapshotTree,\n\ttreePrefixToRemove: string,\n): ISnapshotTree {\n\tconst lookup: { [path: string]: ISnapshotTree } = {};\n\t// Root tree id will be used to determine which version was downloaded.\n\tconst root: ISnapshotTree = { id: flatTree.id, blobs: {}, trees: {} };\n\tlookup[\"\"] = root;\n\n\tfor (const entry of flatTree.entries) {\n\t\t// Strip the `treePrefixToRemove` path from tree entries such that they are stored under root.\n\t\tconst entryPath = entry.path.replace(new RegExp(`^${treePrefixToRemove}/`), \"\");\n\t\tconst lastIndex = entryPath.lastIndexOf(\"/\");\n\t\tconst entryPathDir = entryPath.slice(0, Math.max(0, lastIndex));\n\t\tconst entryPathBase = entryPath.slice(lastIndex + 1);\n\n\t\t// The flat output is breadth-first so we can assume we see tree nodes prior to their contents\n\t\tconst node = lookup[entryPathDir];\n\n\t\t// Add in either the blob or tree\n\t\tif (entry.type === \"tree\") {\n\t\t\tconst newTree: ISnapshotTree = {\n\t\t\t\tblobs: {},\n\t\t\t\ttrees: {},\n\t\t\t\tunreferenced: entry.unreferenced,\n\t\t\t\tgroupId: entry.groupId,\n\t\t\t};\n\t\t\tnode.trees[decodeURIComponent(entryPathBase)] = newTree;\n\t\t\tlookup[entryPath] = newTree;\n\t\t} else if (entry.type === \"blob\") {\n\t\t\tnode.blobs[decodeURIComponent(entryPathBase)] = entry.id;\n\t\t} else {\n\t\t\tthrow new Error(`Unknown entry type!!`);\n\t\t}\n\t}\n\n\treturn root;\n}\n\n/**\n * Converts existing IWholeFlatSnapshot to snapshot tree, blob array, and sequence number.\n *\n * @param flatSnapshot - flat snapshot\n * @param treePrefixToRemove - tree prefix to strip. By default we are stripping \".app\" prefix\n * @returns snapshot tree, blob array, and sequence number\n */\nexport function convertWholeFlatSnapshotToSnapshotTreeAndBlobs(\n\tflatSnapshot: IWholeFlatSnapshot,\n\ttreePrefixToRemove: string = \".app\",\n): INormalizedWholeSnapshot {\n\tconst blobs = new Map<string, ArrayBuffer>();\n\tif (flatSnapshot.blobs) {\n\t\tflatSnapshot.blobs.forEach((blob) => {\n\t\t\tblobs.set(blob.id, stringToBuffer(blob.content, blob.encoding ?? \"utf-8\"));\n\t\t});\n\t}\n\tconst flatSnapshotTree = flatSnapshot.trees?.[0];\n\tconst sequenceNumber = flatSnapshotTree?.sequenceNumber;\n\tconst snapshotTree = buildHierarchy(flatSnapshotTree, treePrefixToRemove);\n\n\treturn {\n\t\tblobs,\n\t\tsnapshotTree,\n\t\tsequenceNumber,\n\t\tid: flatSnapshot.id,\n\t};\n}\n"]}
1
+ {"version":3,"file":"r11sSnapshotParser.js","sourceRoot":"","sources":["../src/r11sSnapshotParser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAS9D;;;;;;GAMG;AACH,SAAS,cAAc,CACtB,QAAgC,EAChC,kBAA0B;IAE1B,MAAM,MAAM,GAAsC,EAAE,CAAC;IACrD,uEAAuE;IACvE,MAAM,IAAI,GAAkB,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACtE,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAElB,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,OAAO,EAAE;QACrC,8FAA8F;QAC9F,MAAM,SAAS,GAAG,KAAK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OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACnC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAA,6BAAc,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;KACH;IACD,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IACjD,MAAM,cAAc,GAAG,gBAAgB,EAAE,cAAc,CAAC;IACxD,MAAM,YAAY,GAAG,cAAc,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;IAE1E,OAAO;QACN,KAAK;QACL,YAAY;QACZ,cAAc;QACd,EAAE,EAAE,YAAY,CAAC,EAAE;KACnB,CAAC;AACH,CAAC;AApBD,wGAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\n\nimport {\n\tINormalizedWholeSnapshot,\n\tIWholeFlatSnapshot,\n\tIWholeFlatSnapshotTree,\n} from \"./contracts.js\";\n\n/**\n * Build a tree hierarchy from a flat tree.\n *\n * @param flatTree - a flat tree\n * @param treePrefixToRemove - tree prefix to strip\n * @returns the heirarchical tree\n */\nfunction buildHierarchy(\n\tflatTree: IWholeFlatSnapshotTree,\n\ttreePrefixToRemove: string,\n): ISnapshotTree {\n\tconst lookup: { [path: string]: ISnapshotTree } = {};\n\t// Root tree id will be used to determine which version was downloaded.\n\tconst root: ISnapshotTree = { id: flatTree.id, blobs: {}, trees: {} };\n\tlookup[\"\"] = root;\n\n\tfor (const entry of flatTree.entries) {\n\t\t// Strip the `treePrefixToRemove` path from tree entries such that they are stored under root.\n\t\tconst entryPath = entry.path.replace(new RegExp(`^${treePrefixToRemove}/`), \"\");\n\t\tconst lastIndex = entryPath.lastIndexOf(\"/\");\n\t\tconst entryPathDir = entryPath.slice(0, Math.max(0, lastIndex));\n\t\tconst entryPathBase = entryPath.slice(lastIndex + 1);\n\n\t\t// The flat output is breadth-first so we can assume we see tree nodes prior to their contents\n\t\tconst node = lookup[entryPathDir];\n\n\t\t// Add in either the blob or tree\n\t\tif (entry.type === \"tree\") {\n\t\t\tconst newTree: ISnapshotTree = {\n\t\t\t\tblobs: {},\n\t\t\t\ttrees: {},\n\t\t\t\tunreferenced: entry.unreferenced,\n\t\t\t\tgroupId: entry.groupId,\n\t\t\t};\n\t\t\tnode.trees[decodeURIComponent(entryPathBase)] = newTree;\n\t\t\tlookup[entryPath] = newTree;\n\t\t} else if (entry.type === \"blob\") {\n\t\t\tnode.blobs[decodeURIComponent(entryPathBase)] = entry.id;\n\t\t} else {\n\t\t\tthrow new Error(`Unknown entry type!!`);\n\t\t}\n\t}\n\n\treturn root;\n}\n\n/**\n * Converts existing IWholeFlatSnapshot to snapshot tree, blob array, and sequence number.\n *\n * @param flatSnapshot - flat snapshot\n * @param treePrefixToRemove - tree prefix to strip. By default we are stripping \".app\" prefix\n * @returns snapshot tree, blob array, and sequence number\n */\nexport function convertWholeFlatSnapshotToSnapshotTreeAndBlobs(\n\tflatSnapshot: IWholeFlatSnapshot,\n\ttreePrefixToRemove: string = \".app\",\n): INormalizedWholeSnapshot {\n\tconst blobs = new Map<string, ArrayBuffer>();\n\tif (flatSnapshot.blobs) {\n\t\tflatSnapshot.blobs.forEach((blob) => {\n\t\t\tblobs.set(blob.id, stringToBuffer(blob.content, blob.encoding ?? \"utf-8\"));\n\t\t});\n\t}\n\tconst flatSnapshotTree = flatSnapshot.trees?.[0];\n\tconst sequenceNumber = flatSnapshotTree?.sequenceNumber;\n\tconst snapshotTree = buildHierarchy(flatSnapshotTree, treePrefixToRemove);\n\n\treturn {\n\t\tblobs,\n\t\tsnapshotTree,\n\t\tsequenceNumber,\n\t\tid: flatSnapshot.id,\n\t};\n}\n"]}
@@ -3,11 +3,11 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
6
+ import { RateLimiter } from "@fluidframework/driver-utils/internal";
6
7
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
7
- import { RateLimiter } from "@fluidframework/driver-utils";
8
- import type { AxiosRequestConfig } from "axios";
9
- import { ITokenProvider, ITokenResponse } from "./tokens";
10
- import { QueryStringType, RestWrapper } from "./restWrapperBase";
8
+ import type { AxiosRequestConfig } from "./axios.cjs";
9
+ import { QueryStringType, RestWrapper } from "./restWrapperBase.js";
10
+ import { ITokenProvider, ITokenResponse } from "./tokens.js";
11
11
  type AuthorizationHeaderGetter = (token: ITokenResponse) => string;
12
12
  export type TokenFetcher = (refresh?: boolean) => Promise<ITokenResponse>;
13
13
  export interface IR11sResponse<T> {
@@ -1 +1 @@
1
- {"version":3,"file":"restWrapper.d.ts","sourceRoot":"","sources":["../src/restWrapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EACN,mBAAmB,EAGnB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAA0C,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAQnG,OAAO,KAAK,EAAE,kBAAkB,EAA0B,MAAM,OAAO,CAAC;AAGxE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEjE,KAAK,yBAAyB,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,MAAM,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;AAmB1E,MAAM,WAAW,aAAa,CAAC,CAAC;IAC/B,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,GAAG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AC,CAAC;YAkGd,eAAe;IAchB,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;IAUzC,QAAQ,CAAC,KAAK,EAAE,cAAc;CAGrC;AAED,qBAAa,+BAAgC,SAAQ,wBAAwB;IAC5E,OAAO;WAsBa,IAAI,CACvB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,OAAO,EACpB,OAAO,CAAC,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GACrC,OAAO,CAAC,+BAA+B,CAAC;CA4B3C;AAED,qBAAa,+BAAgC,SAAQ,wBAAwB;IAC5E,OAAO;WAsBa,IAAI,CACvB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,OAAO,EACpB,OAAO,CAAC,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GACrC,OAAO,CAAC,+BAA+B,CAAC;CAmB3C;AAED,wBAAgB,qCAAqC,CACpD,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,aAAa,EAAE,cAAc,EAC7B,MAAM,EAAE,mBAAmB,GACzB,YAAY,CAoBd;AAED,wBAAgB,qCAAqC,CACpD,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,cAAc,EAC7B,MAAM,EAAE,mBAAmB,GACzB,YAAY,CAqBd"}
@@ -8,16 +8,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
8
8
  };
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.toInstrumentedR11sStorageTokenFetcher = exports.toInstrumentedR11sOrdererTokenFetcher = exports.RouterliciousOrdererRestWrapper = exports.RouterliciousStorageRestWrapper = exports.RouterliciousRestWrapper = exports.getPropsToLogFromResponse = exports.createR11sResponseFromContent = void 0;
11
- const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
12
- const core_utils_1 = require("@fluidframework/core-utils");
13
11
  const client_utils_1 = require("@fluid-internal/client-utils");
14
- const driver_utils_1 = require("@fluidframework/driver-utils");
12
+ const internal_1 = require("@fluidframework/core-utils/internal");
13
+ const internal_2 = require("@fluidframework/driver-utils/internal");
15
14
  const server_services_client_1 = require("@fluidframework/server-services-client");
15
+ const internal_3 = require("@fluidframework/telemetry-utils/internal");
16
16
  const cross_fetch_1 = __importDefault(require("cross-fetch"));
17
17
  const json_stringify_safe_1 = __importDefault(require("json-stringify-safe"));
18
- const errorUtils_1 = require("./errorUtils");
19
- const packageVersion_1 = require("./packageVersion");
20
- const restWrapperBase_1 = require("./restWrapperBase");
18
+ const errorUtils_js_1 = require("./errorUtils.js");
19
+ const packageVersion_js_1 = require("./packageVersion.js");
20
+ const restWrapperBase_js_1 = require("./restWrapperBase.js");
21
21
  const axiosRequestConfigToFetchRequestConfig = (requestConfig) => {
22
22
  const requestInfo = requestConfig.baseURL !== undefined
23
23
  ? `${requestConfig.baseURL}${requestConfig.url ?? ""}`
@@ -61,7 +61,7 @@ function getPropsToLogFromResponse(headers) {
61
61
  { headerName: "content-type", logName: "contentType" },
62
62
  ];
63
63
  const additionalProps = {
64
- contentsize: (0, telemetry_utils_1.numberFromString)(headers.get("content-length")),
64
+ contentsize: (0, internal_3.numberFromString)(headers.get("content-length")),
65
65
  };
66
66
  headersToLog.forEach((header) => {
67
67
  const headerValue = headers.get(header.headerName);
@@ -72,7 +72,7 @@ function getPropsToLogFromResponse(headers) {
72
72
  return additionalProps;
73
73
  }
74
74
  exports.getPropsToLogFromResponse = getPropsToLogFromResponse;
75
- class RouterliciousRestWrapper extends restWrapperBase_1.RestWrapper {
75
+ class RouterliciousRestWrapper extends restWrapperBase_js_1.RestWrapper {
76
76
  constructor(logger, rateLimiter, fetchRefreshedToken, getAuthorizationHeader, useRestLess, baseurl, tokenP, defaultQueryString = {}) {
77
77
  super(baseurl, defaultQueryString);
78
78
  this.rateLimiter = rateLimiter;
@@ -103,10 +103,10 @@ class RouterliciousRestWrapper extends restWrapperBase_1.RestWrapper {
103
103
  // If there exists a self-signed SSL certificates error, throw a NonRetryableError
104
104
  // TODO: instead of relying on string matching, filter error based on the error code like we do for websocket connections
105
105
  const err = errorMessage.includes("failed, reason: self signed certificate")
106
- ? new driver_utils_1.NonRetryableError(errorMessage, errorUtils_1.RouterliciousErrorTypes.sslCertError, {
107
- driverVersion: packageVersion_1.pkgVersion,
106
+ ? new internal_2.NonRetryableError(errorMessage, errorUtils_js_1.RouterliciousErrorTypes.sslCertError, {
107
+ driverVersion: packageVersion_js_1.pkgVersion,
108
108
  })
109
- : new driver_utils_1.GenericNetworkError(errorMessage, errorMessage.startsWith("NetworkError"), { driverVersion: packageVersion_1.pkgVersion });
109
+ : new internal_2.GenericNetworkError(errorMessage, errorMessage.startsWith("NetworkError"), { driverVersion: packageVersion_js_1.pkgVersion });
110
110
  throw err;
111
111
  });
112
112
  return {
@@ -159,14 +159,14 @@ class RouterliciousRestWrapper extends restWrapperBase_1.RestWrapper {
159
159
  ? responseBody
160
160
  : (0, json_stringify_safe_1.default)(responseBody)
161
161
  : response.statusText;
162
- (0, errorUtils_1.throwR11sNetworkError)(`R11s fetch error: ${responseSummary}`, response.status, responseBody?.retryAfter);
162
+ (0, errorUtils_js_1.throwR11sNetworkError)(`R11s fetch error: ${responseSummary}`, response.status, responseBody?.retryAfter);
163
163
  }
164
164
  async generateHeaders(requestHeaders) {
165
165
  const token = await this.getToken();
166
- (0, core_utils_1.assert)(token !== undefined, 0x679 /* token should be present */);
166
+ (0, internal_1.assert)(token !== undefined, 0x679 /* token should be present */);
167
167
  const headers = {
168
168
  ...requestHeaders,
169
- [server_services_client_1.DriverVersionHeaderName]: packageVersion_1.pkgVersion,
169
+ [server_services_client_1.DriverVersionHeaderName]: packageVersion_js_1.pkgVersion,
170
170
  // NOTE: If this.authorizationHeader is undefined, should "Authorization" be removed entirely?
171
171
  Authorization: this.getAuthorizationHeader(token),
172
172
  };
@@ -221,7 +221,7 @@ class RouterliciousOrdererRestWrapper extends RouterliciousRestWrapper {
221
221
  exports.RouterliciousOrdererRestWrapper = RouterliciousOrdererRestWrapper;
222
222
  function toInstrumentedR11sOrdererTokenFetcher(tenantId, documentId, tokenProvider, logger) {
223
223
  const fetchOrdererToken = async (refreshToken) => {
224
- return telemetry_utils_1.PerformanceEvent.timedExecAsync(logger, {
224
+ return internal_3.PerformanceEvent.timedExecAsync(logger, {
225
225
  eventName: "FetchOrdererToken",
226
226
  docId: documentId,
227
227
  }, async () => {
@@ -234,7 +234,7 @@ function toInstrumentedR11sOrdererTokenFetcher(tenantId, documentId, tokenProvid
234
234
  exports.toInstrumentedR11sOrdererTokenFetcher = toInstrumentedR11sOrdererTokenFetcher;
235
235
  function toInstrumentedR11sStorageTokenFetcher(tenantId, documentId, tokenProvider, logger) {
236
236
  const fetchStorageToken = async (refreshToken) => {
237
- return telemetry_utils_1.PerformanceEvent.timedExecAsync(logger, {
237
+ return internal_3.PerformanceEvent.timedExecAsync(logger, {
238
238
  eventName: "FetchStorageToken",
239
239
  docId: documentId,
240
240
  }, async () => {