@fluidframework/odsp-driver 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.203917

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 (259) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/api-extractor.json +1 -1
  3. package/api-report/odsp-driver.api.md +306 -0
  4. package/dist/ReadBufferUtils.js +3 -3
  5. package/dist/ReadBufferUtils.js.map +1 -1
  6. package/dist/checkUrl.d.ts +1 -0
  7. package/dist/checkUrl.d.ts.map +1 -1
  8. package/dist/checkUrl.js +1 -0
  9. package/dist/checkUrl.js.map +1 -1
  10. package/dist/compactSnapshotParser.d.ts +2 -0
  11. package/dist/compactSnapshotParser.d.ts.map +1 -1
  12. package/dist/compactSnapshotParser.js +1 -0
  13. package/dist/compactSnapshotParser.js.map +1 -1
  14. package/dist/constants.d.ts +6 -0
  15. package/dist/constants.d.ts.map +1 -1
  16. package/dist/constants.js +6 -0
  17. package/dist/constants.js.map +1 -1
  18. package/dist/contracts.d.ts +3 -3
  19. package/dist/contracts.d.ts.map +1 -1
  20. package/dist/contractsPublic.d.ts +15 -0
  21. package/dist/contractsPublic.d.ts.map +1 -1
  22. package/dist/contractsPublic.js +8 -2
  23. package/dist/contractsPublic.js.map +1 -1
  24. package/dist/createOdspCreateContainerRequest.d.ts +1 -0
  25. package/dist/createOdspCreateContainerRequest.d.ts.map +1 -1
  26. package/dist/createOdspCreateContainerRequest.js +1 -0
  27. package/dist/createOdspCreateContainerRequest.js.map +1 -1
  28. package/dist/createOdspUrl.d.ts +1 -0
  29. package/dist/createOdspUrl.d.ts.map +1 -1
  30. package/dist/createOdspUrl.js +1 -0
  31. package/dist/createOdspUrl.js.map +1 -1
  32. package/dist/epochTracker.d.ts +12 -2
  33. package/dist/epochTracker.d.ts.map +1 -1
  34. package/dist/epochTracker.js +1 -0
  35. package/dist/epochTracker.js.map +1 -1
  36. package/dist/fetch.d.ts +1 -1
  37. package/dist/fetch.d.ts.map +1 -1
  38. package/dist/fetchSnapshot.d.ts +1 -0
  39. package/dist/fetchSnapshot.d.ts.map +1 -1
  40. package/dist/fetchSnapshot.js +15 -11
  41. package/dist/fetchSnapshot.js.map +1 -1
  42. package/dist/index.d.ts +5 -1
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +3 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/odsp-driver-alpha.d.ts +558 -0
  47. package/dist/odsp-driver-beta.d.ts +558 -0
  48. package/dist/odsp-driver-public.d.ts +558 -0
  49. package/dist/odsp-driver-untrimmed.d.ts +558 -0
  50. package/dist/odspCache.d.ts +6 -0
  51. package/dist/odspCache.d.ts.map +1 -1
  52. package/dist/odspCache.js.map +1 -1
  53. package/dist/odspDocumentDeltaConnection.d.ts +1 -1
  54. package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
  55. package/dist/odspDocumentDeltaConnection.js +78 -69
  56. package/dist/odspDocumentDeltaConnection.js.map +1 -1
  57. package/dist/odspDocumentService.js +23 -19
  58. package/dist/odspDocumentService.js.map +1 -1
  59. package/dist/odspDocumentServiceFactory.d.ts +4 -0
  60. package/dist/odspDocumentServiceFactory.d.ts.map +1 -1
  61. package/dist/odspDocumentServiceFactory.js +4 -0
  62. package/dist/odspDocumentServiceFactory.js.map +1 -1
  63. package/dist/odspDocumentServiceFactoryCore.d.ts +1 -0
  64. package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
  65. package/dist/odspDocumentServiceFactoryCore.js +32 -27
  66. package/dist/odspDocumentServiceFactoryCore.js.map +1 -1
  67. package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts +2 -1
  68. package/dist/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -1
  69. package/dist/odspDocumentServiceFactoryWithCodeSplit.js +2 -1
  70. package/dist/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -1
  71. package/dist/odspDocumentStorageManager.js +5 -1
  72. package/dist/odspDocumentStorageManager.js.map +1 -1
  73. package/dist/odspDocumentStorageServiceBase.d.ts +1 -1
  74. package/dist/odspDocumentStorageServiceBase.d.ts.map +1 -1
  75. package/dist/odspDocumentStorageServiceBase.js +1 -14
  76. package/dist/odspDocumentStorageServiceBase.js.map +1 -1
  77. package/dist/odspDriverUrlResolver.d.ts +1 -0
  78. package/dist/odspDriverUrlResolver.d.ts.map +1 -1
  79. package/dist/odspDriverUrlResolver.js +2 -0
  80. package/dist/odspDriverUrlResolver.js.map +1 -1
  81. package/dist/odspDriverUrlResolverForShareLink.d.ts +2 -0
  82. package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
  83. package/dist/odspDriverUrlResolverForShareLink.js +1 -0
  84. package/dist/odspDriverUrlResolverForShareLink.js.map +1 -1
  85. package/dist/odspFluidFileLink.d.ts +10 -1
  86. package/dist/odspFluidFileLink.d.ts.map +1 -1
  87. package/dist/odspFluidFileLink.js +14 -6
  88. package/dist/odspFluidFileLink.js.map +1 -1
  89. package/dist/odspPublicUtils.d.ts +6 -0
  90. package/dist/odspPublicUtils.d.ts.map +1 -1
  91. package/dist/odspPublicUtils.js +3 -0
  92. package/dist/odspPublicUtils.js.map +1 -1
  93. package/dist/odspSummaryUploadManager.js +5 -1
  94. package/dist/odspSummaryUploadManager.js.map +1 -1
  95. package/dist/odspUrlHelper.d.ts +5 -0
  96. package/dist/odspUrlHelper.d.ts.map +1 -1
  97. package/dist/odspUrlHelper.js +5 -0
  98. package/dist/odspUrlHelper.js.map +1 -1
  99. package/dist/odspUtils.d.ts +4 -1
  100. package/dist/odspUtils.d.ts.map +1 -1
  101. package/dist/odspUtils.js +1 -0
  102. package/dist/odspUtils.js.map +1 -1
  103. package/dist/opsCaching.d.ts +1 -1
  104. package/dist/opsCaching.d.ts.map +1 -1
  105. package/dist/opsCaching.js +13 -1
  106. package/dist/opsCaching.js.map +1 -1
  107. package/dist/packageVersion.d.ts +1 -1
  108. package/dist/packageVersion.js +1 -1
  109. package/dist/packageVersion.js.map +1 -1
  110. package/dist/prefetchLatestSnapshot.d.ts +2 -0
  111. package/dist/prefetchLatestSnapshot.d.ts.map +1 -1
  112. package/dist/prefetchLatestSnapshot.js +2 -0
  113. package/dist/prefetchLatestSnapshot.js.map +1 -1
  114. package/dist/socketModule.d.ts +7 -0
  115. package/dist/socketModule.d.ts.map +1 -0
  116. package/dist/socketModule.js +10 -0
  117. package/dist/socketModule.js.map +1 -0
  118. package/dist/tsdoc-metadata.json +1 -1
  119. package/dist/zipItDataRepresentationUtils.d.ts +2 -2
  120. package/dist/zipItDataRepresentationUtils.d.ts.map +1 -1
  121. package/dist/zipItDataRepresentationUtils.js +6 -6
  122. package/dist/zipItDataRepresentationUtils.js.map +1 -1
  123. package/lib/ReadBufferUtils.js +3 -3
  124. package/lib/ReadBufferUtils.js.map +1 -1
  125. package/lib/checkUrl.d.ts +1 -0
  126. package/lib/checkUrl.d.ts.map +1 -1
  127. package/lib/checkUrl.js +1 -0
  128. package/lib/checkUrl.js.map +1 -1
  129. package/lib/compactSnapshotParser.d.ts +2 -0
  130. package/lib/compactSnapshotParser.d.ts.map +1 -1
  131. package/lib/compactSnapshotParser.js +1 -0
  132. package/lib/compactSnapshotParser.js.map +1 -1
  133. package/lib/constants.d.ts +6 -0
  134. package/lib/constants.d.ts.map +1 -1
  135. package/lib/constants.js +6 -0
  136. package/lib/constants.js.map +1 -1
  137. package/lib/contracts.d.ts +3 -3
  138. package/lib/contracts.d.ts.map +1 -1
  139. package/lib/contractsPublic.d.ts +15 -0
  140. package/lib/contractsPublic.d.ts.map +1 -1
  141. package/lib/contractsPublic.js +6 -0
  142. package/lib/contractsPublic.js.map +1 -1
  143. package/lib/createOdspCreateContainerRequest.d.ts +1 -0
  144. package/lib/createOdspCreateContainerRequest.d.ts.map +1 -1
  145. package/lib/createOdspCreateContainerRequest.js +1 -0
  146. package/lib/createOdspCreateContainerRequest.js.map +1 -1
  147. package/lib/createOdspUrl.d.ts +1 -0
  148. package/lib/createOdspUrl.d.ts.map +1 -1
  149. package/lib/createOdspUrl.js +1 -0
  150. package/lib/createOdspUrl.js.map +1 -1
  151. package/lib/epochTracker.d.ts +12 -2
  152. package/lib/epochTracker.d.ts.map +1 -1
  153. package/lib/epochTracker.js +1 -0
  154. package/lib/epochTracker.js.map +1 -1
  155. package/lib/fetch.d.ts +1 -1
  156. package/lib/fetch.d.ts.map +1 -1
  157. package/lib/fetchSnapshot.d.ts +1 -0
  158. package/lib/fetchSnapshot.d.ts.map +1 -1
  159. package/lib/fetchSnapshot.js +14 -10
  160. package/lib/fetchSnapshot.js.map +1 -1
  161. package/lib/index.d.ts +5 -1
  162. package/lib/index.d.ts.map +1 -1
  163. package/lib/index.js +1 -0
  164. package/lib/index.js.map +1 -1
  165. package/lib/odspCache.d.ts +6 -0
  166. package/lib/odspCache.d.ts.map +1 -1
  167. package/lib/odspCache.js.map +1 -1
  168. package/lib/odspDocumentDeltaConnection.d.ts +1 -1
  169. package/lib/odspDocumentDeltaConnection.d.ts.map +1 -1
  170. package/lib/odspDocumentDeltaConnection.js +77 -68
  171. package/lib/odspDocumentDeltaConnection.js.map +1 -1
  172. package/lib/odspDocumentService.js +18 -18
  173. package/lib/odspDocumentService.js.map +1 -1
  174. package/lib/odspDocumentServiceFactory.d.ts +4 -0
  175. package/lib/odspDocumentServiceFactory.d.ts.map +1 -1
  176. package/lib/odspDocumentServiceFactory.js +4 -0
  177. package/lib/odspDocumentServiceFactory.js.map +1 -1
  178. package/lib/odspDocumentServiceFactoryCore.d.ts +1 -0
  179. package/lib/odspDocumentServiceFactoryCore.d.ts.map +1 -1
  180. package/lib/odspDocumentServiceFactoryCore.js +27 -26
  181. package/lib/odspDocumentServiceFactoryCore.js.map +1 -1
  182. package/lib/odspDocumentServiceFactoryWithCodeSplit.d.ts +2 -1
  183. package/lib/odspDocumentServiceFactoryWithCodeSplit.d.ts.map +1 -1
  184. package/lib/odspDocumentServiceFactoryWithCodeSplit.js +2 -1
  185. package/lib/odspDocumentServiceFactoryWithCodeSplit.js.map +1 -1
  186. package/lib/odspDocumentStorageServiceBase.d.ts +1 -1
  187. package/lib/odspDocumentStorageServiceBase.d.ts.map +1 -1
  188. package/lib/odspDocumentStorageServiceBase.js +1 -14
  189. package/lib/odspDocumentStorageServiceBase.js.map +1 -1
  190. package/lib/odspDriverUrlResolver.d.ts +1 -0
  191. package/lib/odspDriverUrlResolver.d.ts.map +1 -1
  192. package/lib/odspDriverUrlResolver.js +2 -0
  193. package/lib/odspDriverUrlResolver.js.map +1 -1
  194. package/lib/odspDriverUrlResolverForShareLink.d.ts +2 -0
  195. package/lib/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
  196. package/lib/odspDriverUrlResolverForShareLink.js +1 -0
  197. package/lib/odspDriverUrlResolverForShareLink.js.map +1 -1
  198. package/lib/odspFluidFileLink.d.ts +10 -1
  199. package/lib/odspFluidFileLink.d.ts.map +1 -1
  200. package/lib/odspFluidFileLink.js +14 -6
  201. package/lib/odspFluidFileLink.js.map +1 -1
  202. package/lib/odspPublicUtils.d.ts +6 -0
  203. package/lib/odspPublicUtils.d.ts.map +1 -1
  204. package/lib/odspPublicUtils.js +3 -0
  205. package/lib/odspPublicUtils.js.map +1 -1
  206. package/lib/odspUrlHelper.d.ts +5 -0
  207. package/lib/odspUrlHelper.d.ts.map +1 -1
  208. package/lib/odspUrlHelper.js +5 -0
  209. package/lib/odspUrlHelper.js.map +1 -1
  210. package/lib/odspUtils.d.ts +4 -1
  211. package/lib/odspUtils.d.ts.map +1 -1
  212. package/lib/odspUtils.js +1 -0
  213. package/lib/odspUtils.js.map +1 -1
  214. package/lib/opsCaching.d.ts +1 -1
  215. package/lib/opsCaching.d.ts.map +1 -1
  216. package/lib/opsCaching.js +13 -1
  217. package/lib/opsCaching.js.map +1 -1
  218. package/lib/packageVersion.d.ts +1 -1
  219. package/lib/packageVersion.js +1 -1
  220. package/lib/packageVersion.js.map +1 -1
  221. package/lib/prefetchLatestSnapshot.d.ts +2 -0
  222. package/lib/prefetchLatestSnapshot.d.ts.map +1 -1
  223. package/lib/prefetchLatestSnapshot.js +2 -0
  224. package/lib/prefetchLatestSnapshot.js.map +1 -1
  225. package/lib/socketModule.d.ts +7 -0
  226. package/lib/socketModule.d.ts.map +1 -0
  227. package/lib/socketModule.js +7 -0
  228. package/lib/socketModule.js.map +1 -0
  229. package/lib/zipItDataRepresentationUtils.d.ts +2 -2
  230. package/lib/zipItDataRepresentationUtils.d.ts.map +1 -1
  231. package/lib/zipItDataRepresentationUtils.js +3 -3
  232. package/lib/zipItDataRepresentationUtils.js.map +1 -1
  233. package/package.json +24 -26
  234. package/src/checkUrl.ts +1 -0
  235. package/src/compactSnapshotParser.ts +2 -0
  236. package/src/constants.ts +7 -0
  237. package/src/contractsPublic.ts +15 -1
  238. package/src/createOdspCreateContainerRequest.ts +1 -0
  239. package/src/createOdspUrl.ts +1 -0
  240. package/src/epochTracker.ts +10 -0
  241. package/src/fetchSnapshot.ts +16 -15
  242. package/src/index.ts +10 -1
  243. package/src/odspCache.ts +6 -0
  244. package/src/odspDocumentDeltaConnection.ts +56 -32
  245. package/src/odspDocumentServiceFactory.ts +4 -0
  246. package/src/odspDocumentServiceFactoryCore.ts +1 -0
  247. package/src/odspDocumentServiceFactoryWithCodeSplit.ts +2 -1
  248. package/src/odspDocumentStorageServiceBase.ts +1 -15
  249. package/src/odspDriverUrlResolver.ts +2 -0
  250. package/src/odspDriverUrlResolverForShareLink.ts +2 -0
  251. package/src/odspFluidFileLink.ts +21 -5
  252. package/src/odspPublicUtils.ts +6 -0
  253. package/src/odspUrlHelper.ts +5 -0
  254. package/src/odspUtils.ts +4 -0
  255. package/src/opsCaching.ts +15 -1
  256. package/src/packageVersion.ts +1 -1
  257. package/src/prefetchLatestSnapshot.ts +2 -0
  258. package/src/socketModule.ts +8 -0
  259. package/src/zipItDataRepresentationUtils.ts +5 -1
@@ -1 +1 @@
1
- {"version":3,"file":"zipItDataRepresentationUtils.js","sourceRoot":"","sources":["../src/zipItDataRepresentationUtils.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UAAU,kBAAkB,CAAC,IAAe,EAAE,OAAe;IAClE,IAAI,OAAO,IAAI,KAAK,SAAS,EAAE;QAC9B,OAAO;KACP;IACD,yBAAyB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,yBAAyB,CACjC,IAAe,EACf,gBAA0B,EAC1B,OAAe;IAEf,MAAM,IAAI,iBAAiB,CAC1B,6BAA6B,OAAO,EAAE,EACtC,eAAe,CAAC,uBAAuB,EACvC;QACC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;QAC3B,gBAAgB;QAChB,aAAa;KACb,CACD,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,KAAgB;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9B,OAAO,QAAQ,CAAC;KAChB;SAAM,IAAI,KAAK,YAAY,QAAQ,EAAE;QACrC,OAAO,UAAU,CAAC;KAClB;SAAM,IAAI,KAAK,YAAY,QAAQ,EAAE;QACrC,OAAO,UAAU,CAAC;KAClB;SAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;QACtC,OAAO,SAAS,CAAC;KACjB;SAAM,IAAI,KAAK,CAAC,cAAc,EAAE;QAChC,OAAO,QAAQ,CAAC;KAChB;IACD,OAAO,aAAa,CAAC;AACtB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Data representation which is followed(zipIt Protocol) here is described in this document:\n * https://microsoft.sharepoint-df.com/:w:/t/ODSPFileStore/ER06b64K_XdDjEyAKl-UT60BJiId39SCVkYSyo_2pvH9gQ?e=KYQ0c5\n */\n\nimport { Uint8ArrayToArrayBuffer, Uint8ArrayToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { NonRetryableError } from \"@fluidframework/driver-utils\";\nimport { DriverErrorType } from \"@fluidframework/driver-definitions\";\nimport { ReadBuffer } from \"./ReadBufferUtils\";\nimport { pkgVersion as driverVersion } from \"./packageVersion\";\nimport { measure } from \"./odspUtils\";\n\n// https://onedrive.visualstudio.com/SharePoint%20Online/_git/SPO?path=/cobalt/Base/Property/BinaryEncodedPropertyReader.cs&version=GBmaster&_a=contents\n/**\n * Control codes used by tree serialization / decentralization code. Same as on server. These can be found on\n * filestore code on server too at above link.\n */\nexport enum MarkerCodes {\n\tBoolTrue = 11, // value = true\n\tBoolFalse = 12, // value = false\n\n\tStringEmpty = 13, // value = \"\"\n\tString8Length = 14, // unsigned-8-bit little-endian length, follows by UTF-8 bytes of length\n\tString16Length = 15, // unsigned-16-bit little-endian length, follows by UTF-8 bytes of length\n\tString32Length = 16, // unsigned-32-bit little-endian length, follows by UTF-8 bytes of length\n\n\tConstString8Id = 17, // unsigned-8-bit little-endian const string id follows\n\tConstString16Id = 18, // unsigned-16-bit little-endian const string id follows\n\tConstString32Id = 19, // unsigned-32-bit little-endian const string id follows\n\tConstStringDeclare = 20, // Code for declaring a const string with size <= 1 byte\n\tConstStringDeclareBig = 21, // Code for declaring a const string with size > 1 byte. It is represented in 4 bytes.\n\n\tInt0 = 1, // value = 0\n\tUInt8 = 3, // unsigned-8-bit little-endian follows\n\tUInt16 = 5, // unsigned-16-bit little-endian follows\n\tUInt32 = 7, // unsigned-32-bit little-endian follows\n\tUInt64 = 9, // unsigned-64-bit little-endian follows\n\tInt8 = 2, // signed-8-bit little-endian follows\n\tInt16 = 4, // signed-16-bit little-endian follows\n\tInt32 = 6, // signed-32-bit little-endian follows\n\tInt64 = 8, // signed-64-bit little-endian follows\n\n\tBinaryEmpty = 32, // value = byte[]\n\tBinarySingle8 = 33, // unsigned-8-bit little-endian length, follows by bytes of length\n\tBinarySingle16 = 34, // unsigned-16-bit little-endian length, follows by bytes of length\n\tBinarySingle32 = 35, // unsigned-32-bit little-endian length, follows by bytes of length\n\tBinarySingle64 = 36, // unsigned-64-bit little-endian length, follows by bytes of length\n}\n\n/**\n * Control codes used by tree serialization / decentralization code. They mark the start of sections.\n */\nexport enum MarkerCodesStart {\n\t\"list\" = 49,\n\t\"set\" = 51,\n}\n\n/**\n * Control codes used by tree serialization / decentralization code. They mark the end of sections.\n */\nexport enum MarkerCodesEnd {\n\t\"list\" = 50,\n\t\"set\" = 52,\n}\n\n/**\n * This contains mapping of Marker Codes to number of bytes in which the corresponding data\n * will be stored.\n */\nexport const codeToBytesMap = {\n\t// Integer code to bytes\n\t1: 0,\n\t2: 1,\n\t3: 1,\n\t4: 2,\n\t5: 2,\n\t6: 4,\n\t7: 4,\n\t8: 8,\n\t9: 8,\n\n\t// String code to Bytes\n\t13: 0,\n\t14: 1,\n\t15: 2,\n\t16: 4,\n\n\t17: 1,\n\t18: 2,\n\t19: 4,\n\n\t20: 1,\n\t21: 4,\n\n\t// Binary code to bytes\n\t32: 0,\n\t33: 1,\n\t34: 2,\n\t35: 4,\n\t36: 8,\n};\n\nexport function getValueSafely(map: { [index: number]: number }, key: number) {\n\tconst val = map[key];\n\tassert(val !== undefined, 0x287 /* key must exist in the map */);\n\treturn val;\n}\n\nexport function getNodeProps(node: NodeCore) {\n\tconst res: Record<string, NodeTypes> = {};\n\tfor (const [keyNode, valueNode] of node.iteratePairs()) {\n\t\tconst id = getStringInstance(keyNode, \"keynode should be a string\");\n\t\tres[id] = valueNode;\n\t}\n\treturn res;\n}\n\nexport function iteratePairs<T>(it: IterableIterator<T>) {\n\tconst res: IterableIterator<[T, T]> = {\n\t\tnext: () => {\n\t\t\tconst a = it.next();\n\t\t\tif (a.done) {\n\t\t\t\treturn { value: undefined, done: true };\n\t\t\t}\n\t\t\tconst b = it.next();\n\t\t\tassert(b.done !== true, 0x22b /* \"Should be a pair\" */);\n\t\t\treturn { value: [a.value, b.value], done: b.done };\n\t\t},\n\t\t[Symbol.iterator]: () => {\n\t\t\treturn res;\n\t\t},\n\t};\n\treturn res;\n}\n\n/**\n * Helper function that returns iterator from an object\n * @param obj - object that supports iteration\n */\nexport function iterate<T>(obj: { [Symbol.iterator]: () => IterableIterator<T> }) {\n\treturn obj[Symbol.iterator]();\n}\n\n/**\n * Base class to represent binary blob element.\n * Binary blob is one of three types supported as a leaf node of a tree.\n * Note: concrete implementations (derived classes) are not exposed from this module\n */\nexport abstract class BlobCore {\n\tpublic abstract get buffer(): Uint8Array;\n\tpublic abstract get arrayBuffer(): ArrayBufferLike;\n\n\t/**\n\t * Represents a blob.\n\t */\n\tconstructor() {}\n}\n\n/**\n * \"deep copy\" blob, holds to binary data passed in\n * It is called deep copy as a counter-part to BlobShallowCopy, which\n * is a reference to underlying binary stream (ReadBuffer).\n */\nclass BlobDeepCopy extends BlobCore {\n\t/**\n\t * Represents a deep copy of the blob.\n\t * @param data - Data array of the blob\n\t */\n\tconstructor(protected readonly data: Uint8Array) {\n\t\tsuper();\n\t}\n\n\tpublic get buffer() {\n\t\treturn this.data;\n\t}\n\n\tpublic get arrayBuffer(): ArrayBufferLike {\n\t\treturn Uint8ArrayToArrayBuffer(this.buffer);\n\t}\n\n\tpublic static read(buffer: ReadBuffer, lengthLen: number): BlobCore {\n\t\tconst length = buffer.read(lengthLen);\n\t\tconst data = new Uint8Array(length);\n\t\tfor (let counter = 0; counter < length; counter++) {\n\t\t\tdata[counter] = buffer.read();\n\t\t}\n\t\treturn new BlobDeepCopy(data);\n\t}\n}\n\n/**\n * Shallow copy blob, keeps a reference to portion of ReadBuffer\n * it was constructed from. It takes much less memory compared to BlobDeepCopy\n */\nexport class BlobShallowCopy extends BlobCore {\n\t/**\n\t * Represents a shallow copy of the blob. It is not a separate blob, just reference to original blobs.\n\t * @param data - Data array of the blob\n\t * @param start - Start point of the blob in the buffer.\n\t * @param end - End point of the blob in the buffer.\n\t */\n\tconstructor(protected data: Uint8Array, protected start: number, protected end: number) {\n\t\tsuper();\n\t}\n\n\tpublic get buffer() {\n\t\treturn this.data.subarray(this.start, this.end);\n\t}\n\n\t// Equivalent to Uint8ArrayToArrayBuffer(this.buffer)\n\tpublic get arrayBuffer(): ArrayBufferLike {\n\t\tconst offset = this.data.byteOffset;\n\t\treturn this.data.buffer.slice(this.start + offset, this.end + offset);\n\t}\n\n\tpublic static read(buffer: ReadBuffer, lengthLen: number): BlobCore {\n\t\tconst length = buffer.read(lengthLen);\n\t\tconst pos = buffer.pos;\n\t\tbuffer.skip(length);\n\t\treturn new BlobShallowCopy(buffer.buffer, pos, pos + length);\n\t}\n}\n\nexport const addStringProperty = (node: NodeCore, a: string, b: string) => {\n\tnode.addDictionaryString(a);\n\tnode.addString(b);\n};\nexport const addDictionaryStringProperty = (node: NodeCore, a: string, b: string) => {\n\tnode.addDictionaryString(a);\n\tnode.addString(b);\n};\nexport const addNumberProperty = (node: NodeCore, a: string, b: number) => {\n\tnode.addDictionaryString(a);\n\tnode.addNumber(b);\n};\nexport const addBoolProperty = (node: NodeCore, a: string, b: boolean) => {\n\tnode.addDictionaryString(a);\n\tnode.addBool(b);\n};\n\nexport interface IStringElement {\n\tcontent: string;\n\tdictionary: boolean;\n\t_stringElement: true;\n}\n\nexport interface IStringElementInternal extends Omit<IStringElement, \"content\"> {\n\tcontent?: string;\n\tstartPos: number;\n\tendPos: number;\n}\n\n/**\n * Three leaf types supported by tree:\n * 1. Node (sub-tree)\n * 2. binary blob\n * 3. integer\n * 4. boolean\n */\nexport type NodeTypes = NodeCore | BlobCore | number | boolean | IStringElement;\n\nexport type NodeCoreTypes = \"list\" | \"set\";\n\n/**\n * Node - node in the tree (non-leaf element of the tree)\n */\nexport class NodeCore {\n\t// It is an array of nodes.\n\tprivate readonly children: NodeTypes[] = [];\n\tpublic get nodes() {\n\t\treturn this.children;\n\t}\n\n\tconstructor(public type: NodeCoreTypes = \"set\") {}\n\n\tpublic [Symbol.iterator]() {\n\t\treturn this.children[Symbol.iterator]();\n\t}\n\n\tpublic iteratePairs() {\n\t\tassert(this.length % 2 === 0, 0x22c /* \"reading pairs\" */);\n\t\treturn iteratePairs(iterate(this));\n\t}\n\n\tpublic get length() {\n\t\treturn this.children.length;\n\t}\n\n\tpublic get(index: number) {\n\t\treturn this.children[index];\n\t}\n\n\tpublic getString(index: number): string {\n\t\tconst node = this.children[index];\n\t\treturn getStringInstance(node, \"getString should return string\");\n\t}\n\n\tpublic getMaybeString(index: number) {\n\t\tconst node = this.children[index];\n\t\treturn getMaybeStringInstance(node);\n\t}\n\n\tpublic getBlob(index: number): BlobCore {\n\t\tconst node = this.children[index];\n\t\tassertBlobCoreInstance(node, \"getBlob should return a blob\");\n\t\treturn node;\n\t}\n\n\tpublic getNode(index: number): NodeCore {\n\t\tconst node = this.children[index];\n\t\tassertNodeCoreInstance(node, \"getNode should return a node\");\n\t\treturn node;\n\t}\n\n\tpublic getNumber(index: number): number {\n\t\tconst node = this.children[index];\n\t\tassertNumberInstance(node, \"getNumber should return a number\");\n\t\treturn node;\n\t}\n\n\tpublic getBool(index: number): boolean {\n\t\tconst node = this.children[index];\n\t\tassertBoolInstance(node, \"getBool should return a boolean\");\n\t\treturn node;\n\t}\n\n\tpublic addNode(type?: NodeCoreTypes): NodeCore {\n\t\tconst node = new NodeCore(type);\n\t\tthis.children.push(node);\n\t\treturn node;\n\t}\n\n\tpublic addBlob(blob: Uint8Array) {\n\t\tthis.children.push(new BlobDeepCopy(blob));\n\t}\n\n\tpublic addDictionaryString(payload: string) {\n\t\tthis.children.push({\n\t\t\tcontent: payload,\n\t\t\tdictionary: true,\n\t\t\t_stringElement: true,\n\t\t});\n\t}\n\n\tpublic addString(payload: string) {\n\t\tthis.children.push({\n\t\t\tcontent: payload,\n\t\t\tdictionary: false,\n\t\t\t_stringElement: true,\n\t\t});\n\t}\n\n\tpublic addNumber(payload: number | undefined) {\n\t\tassert(Number.isInteger(payload), 0x231 /* \"Number should be an integer\" */);\n\t\tassert(payload !== undefined && payload >= 0, 0x232 /* \"Payload should not be negative\" */);\n\t\tthis.children.push(payload);\n\t}\n\n\tpublic addBool(payload: boolean) {\n\t\tthis.children.push(payload);\n\t}\n\n\t// Can we do more efficiently here, without extra objects somehow??\n\tprivate static readString(buffer: ReadBuffer, code: number, dictionary: boolean) {\n\t\tconst lengthLen = getValueSafely(codeToBytesMap, code);\n\t\tconst length = buffer.read(lengthLen);\n\t\tconst startPos = buffer.pos;\n\t\tbuffer.skip(length);\n\t\tconst result: IStringElementInternal = {\n\t\t\t// Note: Setting here property 'content: undefined' makes code substantially slower!\n\t\t\tdictionary,\n\t\t\t_stringElement: true,\n\t\t\tstartPos,\n\t\t\tendPos: buffer.pos,\n\t\t};\n\n\t\t// We are lying here in terms of presence of `content` property.\n\t\t// This will be addressed at the bottom of NodeCore.load() by resolving all strings at once!\n\t\t// It's equivalent (but much slower!) to do it here via\n\t\t// result.content = Uint8ArrayToString(buffer.buffer.subarray(startPos, buffer.pos), \"utf-8\");\n\t\treturn result as IStringElementInternal & IStringElement;\n\t}\n\n\t/**\n\t * Load and parse the buffer into a tree.\n\t * @param buffer - buffer to read from.\n\t */\n\tprotected load(buffer: ReadBuffer, logger: ITelemetryLoggerExt) {\n\t\tconst [stringsToResolve, durationStructure] = measure(() =>\n\t\t\tthis.loadStructure(buffer, logger),\n\t\t);\n\t\tconst [, durationStrings] = measure(() =>\n\t\t\tthis.loadStrings(buffer, stringsToResolve, logger),\n\t\t);\n\t\treturn { durationStructure, durationStrings };\n\t}\n\n\t/**\n\t * Load and parse the buffer into a tree.\n\t * @param buffer - buffer to read from.\n\t */\n\tprotected loadStructure(buffer: ReadBuffer, logger: ITelemetryLoggerExt) {\n\t\tconst stack: NodeTypes[][] = [];\n\t\tconst stringsToResolve: IStringElementInternal[] = [];\n\t\tconst dictionary: IStringElement[] = [];\n\n\t\tlet children = this.children;\n\t\tfor (; !buffer.eof; ) {\n\t\t\tconst code = buffer.read();\n\t\t\tswitch (code) {\n\t\t\t\tcase MarkerCodesStart.list:\n\t\t\t\tcase MarkerCodesStart.set: {\n\t\t\t\t\tconst childValue = new NodeCore(code === MarkerCodesStart.set ? \"set\" : \"list\");\n\t\t\t\t\tchildren.push(childValue);\n\t\t\t\t\tstack.push(children);\n\t\t\t\t\tchildren = childValue.children;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.ConstStringDeclare:\n\t\t\t\tcase MarkerCodes.ConstStringDeclareBig: {\n\t\t\t\t\tconst stringId = buffer.read(getValueSafely(codeToBytesMap, code));\n\t\t\t\t\tconst constString = NodeCore.readString(buffer, code, true /* dictionary */);\n\t\t\t\t\tstringsToResolve.push(constString);\n\t\t\t\t\tdictionary[stringId] = constString;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.ConstString8Id:\n\t\t\t\tcase MarkerCodes.ConstString16Id:\n\t\t\t\tcase MarkerCodes.ConstString32Id: {\n\t\t\t\t\tconst stringId = buffer.read(getValueSafely(codeToBytesMap, code));\n\t\t\t\t\tconst content = dictionary[stringId];\n\t\t\t\t\tassert(content !== undefined, 0x3de /* const string not found */);\n\t\t\t\t\tchildren.push(content);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.StringEmpty:\n\t\t\t\tcase MarkerCodes.String8Length:\n\t\t\t\tcase MarkerCodes.String16Length:\n\t\t\t\tcase MarkerCodes.String32Length: {\n\t\t\t\t\tconst str = NodeCore.readString(buffer, code, false /* dictionary */);\n\t\t\t\t\tstringsToResolve.push(str);\n\t\t\t\t\tchildren.push(str);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.BinaryEmpty:\n\t\t\t\tcase MarkerCodes.BinarySingle8:\n\t\t\t\tcase MarkerCodes.BinarySingle16:\n\t\t\t\tcase MarkerCodes.BinarySingle32:\n\t\t\t\tcase MarkerCodes.BinarySingle64: {\n\t\t\t\t\tchildren.push(\n\t\t\t\t\t\tBlobShallowCopy.read(buffer, getValueSafely(codeToBytesMap, code)),\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// If integer is 0.\n\t\t\t\tcase MarkerCodes.Int0: {\n\t\t\t\t\tchildren.push(0);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.UInt8:\n\t\t\t\tcase MarkerCodes.UInt16:\n\t\t\t\tcase MarkerCodes.UInt32:\n\t\t\t\tcase MarkerCodes.UInt64:\n\t\t\t\tcase MarkerCodes.Int8:\n\t\t\t\tcase MarkerCodes.Int16:\n\t\t\t\tcase MarkerCodes.Int32:\n\t\t\t\tcase MarkerCodes.Int64: {\n\t\t\t\t\tchildren.push(buffer.read(getValueSafely(codeToBytesMap, code)));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.BoolTrue:\n\t\t\t\t\tchildren.push(true);\n\t\t\t\t\tcontinue;\n\t\t\t\tcase MarkerCodes.BoolFalse:\n\t\t\t\t\tchildren.push(false);\n\t\t\t\t\tcontinue;\n\t\t\t\tcase MarkerCodesEnd.list:\n\t\t\t\tcase MarkerCodesEnd.set:\n\t\t\t\t\t// Note: We are not checking that end marker matches start marker.\n\t\t\t\t\t// I.e. that we do not have a case where we start a 'list' but end with a 'set'\n\t\t\t\t\t// Checking it would require more state tracking that seems not very useful, given\n\t\t\t\t\t// our code does not care.\n\t\t\t\t\tchildren = stack.pop()!;\n\n\t\t\t\t\t// To my surprise, checking children !== undefined adds measurable cost!\n\t\t\t\t\t// We will rely on children.push() crashing in case of mismatch, and check below\n\t\t\t\t\t// (outside of the loop)\n\t\t\t\t\tcontinue;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(`Invalid code: ${code}`);\n\t\t\t}\n\t\t}\n\n\t\t// This also ensures that stack.length === 0.\n\t\tassert(children === this.children, 0x3e7 /* Unpaired start/end list/set markers! */);\n\n\t\treturn stringsToResolve;\n\t}\n\n\tprivate loadStrings(\n\t\tbuffer: ReadBuffer,\n\t\tstringsToResolve: IStringElementInternal[],\n\t\tlogger: ITelemetryLoggerExt,\n\t) {\n\t\t/**\n\t\t * Process all the strings at once!\n\t\t */\n\t\tlet length = 0;\n\t\tfor (const el of stringsToResolve) {\n\t\t\tlength += el.endPos - el.startPos + 1;\n\t\t}\n\t\tconst stringBuffer = new Uint8Array(length);\n\n\t\tlength = 0;\n\t\tconst input = buffer.buffer;\n\t\tassert(input.byteOffset === 0, 0x3e8 /* code below assumes no offset */);\n\n\t\tfor (const el of stringsToResolve) {\n\t\t\tfor (let it = el.startPos; it < el.endPos; it++) {\n\t\t\t\tstringBuffer[length] = input[it];\n\t\t\t\tlength++;\n\t\t\t}\n\t\t\tstringBuffer[length] = 0;\n\t\t\tlength++;\n\t\t}\n\t\tassert(length === stringBuffer.length, 0x418 /* properly encoded */);\n\n\t\tconst result = Uint8ArrayToString(stringBuffer, \"utf-8\").split(String.fromCharCode(0));\n\t\tif (result.length === stringsToResolve.length + 1) {\n\t\t\t// All is good, we expect all the cases to get here\n\t\t\tfor (let i = 0; i < stringsToResolve.length; i++) {\n\t\t\t\tstringsToResolve[i].content = result[i];\n\t\t\t}\n\t\t} else {\n\t\t\t// String content has \\0 chars!\n\t\t\t// Recovery code\n\t\t\tlogger.sendErrorEvent({ eventName: \"StringParsingError\" });\n\t\t\tfor (const el of stringsToResolve) {\n\t\t\t\tassert(\n\t\t\t\t\tel.content ===\n\t\t\t\t\t\tUint8ArrayToString(input.subarray(el.startPos, el.endPos), \"utf-8\"),\n\t\t\t\t\t0x3ea /* test */,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * TreeBuilder - Root of the tree.\n * Provides loading and serialization capabilities.\n */\nexport class TreeBuilder extends NodeCore {\n\tstatic load(buffer: ReadBuffer, logger: ITelemetryLoggerExt) {\n\t\tconst builder = new TreeBuilder();\n\t\tconst telemetryProps = builder.load(buffer, logger);\n\t\tassert(buffer.eof, 0x233 /* \"Unexpected data at the end of buffer\" */);\n\t\treturn { builder, telemetryProps };\n\t}\n}\n\nexport function getMaybeStringInstance(node: NodeTypes): string | undefined {\n\tconst maybeString = node as IStringElement;\n\tif (maybeString._stringElement) {\n\t\treturn maybeString.content;\n\t}\n}\n\nexport function getStringInstance(node: NodeTypes, message: string): string {\n\tconst maybeString = node as IStringElement;\n\tif (maybeString._stringElement) {\n\t\treturn maybeString.content;\n\t}\n\tthrowBufferParseException(node, \"BlobCore\", message);\n}\n\nexport function assertBlobCoreInstance(node: NodeTypes, message: string): asserts node is BlobCore {\n\tif (node instanceof BlobCore) {\n\t\treturn;\n\t}\n\tthrowBufferParseException(node, \"BlobCore\", message);\n}\n\nexport function assertNodeCoreInstance(node: NodeTypes, message: string): asserts node is NodeCore {\n\tif (node instanceof NodeCore) {\n\t\treturn;\n\t}\n\tthrowBufferParseException(node, \"NodeCore\", message);\n}\n\nexport function assertNumberInstance(node: NodeTypes, message: string): asserts node is number {\n\tif (typeof node === \"number\") {\n\t\treturn;\n\t}\n\tthrowBufferParseException(node, \"Number\", message);\n}\n\nexport function assertBoolInstance(node: NodeTypes, message: string): asserts node is boolean {\n\tif (typeof node === \"boolean\") {\n\t\treturn;\n\t}\n\tthrowBufferParseException(node, \"Boolean\", message);\n}\n\nfunction throwBufferParseException(\n\tnode: NodeTypes,\n\texpectedNodeType: NodeType,\n\tmessage: string,\n): never {\n\tthrow new NonRetryableError(\n\t\t`Buffer parsing exception: ${message}`,\n\t\tDriverErrorType.incorrectServerResponse,\n\t\t{\n\t\t\tnodeType: getNodeType(node),\n\t\t\texpectedNodeType,\n\t\t\tdriverVersion,\n\t\t},\n\t);\n}\n\nfunction getNodeType(value: NodeTypes): NodeType {\n\tif (typeof value === \"number\") {\n\t\treturn \"Number\";\n\t} else if (value instanceof BlobCore) {\n\t\treturn \"BlobCore\";\n\t} else if (value instanceof NodeCore) {\n\t\treturn \"NodeCore\";\n\t} else if (typeof value === \"boolean\") {\n\t\treturn \"Boolean\";\n\t} else if (value._stringElement) {\n\t\treturn \"String\";\n\t}\n\treturn \"UnknownType\";\n}\n\ntype NodeType = \"Number\" | \"BlobCore\" | \"NodeCore\" | \"Boolean\" | \"UnknownType\" | \"String\";\n"]}
1
+ {"version":3,"file":"zipItDataRepresentationUtils.js","sourceRoot":"","sources":["../src/zipItDataRepresentationUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,wJAAwJ;AACxJ;;;GAGG;AACH,MAAM,CAAN,IAAY,WA8BX;AA9BD,WAAY,WAAW;IACtB,sDAAa,CAAA;IACb,wDAAc,CAAA;IAEd,4DAAgB,CAAA;IAChB,gEAAkB,CAAA;IAClB,kEAAmB,CAAA;IACnB,kEAAmB,CAAA;IAEnB,kEAAmB,CAAA;IACnB,oEAAoB,CAAA;IACpB,oEAAoB,CAAA;IACpB,0EAAuB,CAAA;IACvB,gFAA0B,CAAA;IAE1B,6CAAQ,CAAA;IACR,+CAAS,CAAA;IACT,iDAAU,CAAA;IACV,iDAAU,CAAA;IACV,iDAAU,CAAA;IACV,6CAAQ,CAAA;IACR,+CAAS,CAAA;IACT,+CAAS,CAAA;IACT,+CAAS,CAAA;IAET,4DAAgB,CAAA;IAChB,gEAAkB,CAAA;IAClB,kEAAmB,CAAA;IACnB,kEAAmB,CAAA;IACnB,kEAAmB,CAAA;AACpB,CAAC,EA9BW,WAAW,KAAX,WAAW,QA8BtB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC3B,wDAAW,CAAA;IACX,sDAAU,CAAA;AACX,CAAC,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AAQ,EAAE;QAC7B,OAAO;KACP;IACD,yBAAyB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAe,EAAE,OAAe;IAClE,IAAI,OAAO,IAAI,KAAK,SAAS,EAAE;QAC9B,OAAO;KACP;IACD,yBAAyB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,yBAAyB,CACjC,IAAe,EACf,gBAA0B,EAC1B,OAAe;IAEf,MAAM,IAAI,iBAAiB,CAC1B,6BAA6B,OAAO,EAAE,EACtC,eAAe,CAAC,uBAAuB,EACvC;QACC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;QAC3B,gBAAgB;QAChB,aAAa;KACb,CACD,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,KAAgB;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9B,OAAO,QAAQ,CAAC;KAChB;SAAM,IAAI,KAAK,YAAY,QAAQ,EAAE;QACrC,OAAO,UAAU,CAAC;KAClB;SAAM,IAAI,KAAK,YAAY,QAAQ,EAAE;QACrC,OAAO,UAAU,CAAC;KAClB;SAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;QACtC,OAAO,SAAS,CAAC;KACjB;SAAM,IAAI,KAAK,CAAC,cAAc,EAAE;QAChC,OAAO,QAAQ,CAAC;KAChB;IACD,OAAO,aAAa,CAAC;AACtB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Data representation which is followed(zipIt Protocol) here is described in this document:\n * https://microsoft.sharepoint-df.com/:w:/t/ODSPFileStore/ER06b64K_XdDjEyAKl-UT60BJiId39SCVkYSyo_2pvH9gQ?e=KYQ0c5\n */\n\nimport { Uint8ArrayToArrayBuffer, Uint8ArrayToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { NonRetryableError } from \"@fluidframework/driver-utils\";\nimport { DriverErrorType } from \"@fluidframework/driver-definitions\";\nimport { ReadBuffer } from \"./ReadBufferUtils\";\nimport { pkgVersion as driverVersion } from \"./packageVersion\";\nimport { measure } from \"./odspUtils\";\n\n// https://onedrive.visualstudio.com/SharePoint%20Online/_git/SPO?path=/cobalt/Base/Property/BinaryEncodedPropertyReader.cs&version=GBmaster&_a=contents\n/**\n * Control codes used by tree serialization / decentralization code. Same as on server. These can be found on\n * filestore code on server too at above link.\n */\nexport enum MarkerCodes {\n\tBoolTrue = 11, // value = true\n\tBoolFalse = 12, // value = false\n\n\tStringEmpty = 13, // value = \"\"\n\tString8Length = 14, // unsigned-8-bit little-endian length, follows by UTF-8 bytes of length\n\tString16Length = 15, // unsigned-16-bit little-endian length, follows by UTF-8 bytes of length\n\tString32Length = 16, // unsigned-32-bit little-endian length, follows by UTF-8 bytes of length\n\n\tConstString8Id = 17, // unsigned-8-bit little-endian const string id follows\n\tConstString16Id = 18, // unsigned-16-bit little-endian const string id follows\n\tConstString32Id = 19, // unsigned-32-bit little-endian const string id follows\n\tConstStringDeclare = 20, // Code for declaring a const string with size <= 1 byte\n\tConstStringDeclareBig = 21, // Code for declaring a const string with size > 1 byte. It is represented in 4 bytes.\n\n\tInt0 = 1, // value = 0\n\tUInt8 = 3, // unsigned-8-bit little-endian follows\n\tUInt16 = 5, // unsigned-16-bit little-endian follows\n\tUInt32 = 7, // unsigned-32-bit little-endian follows\n\tUInt64 = 9, // unsigned-64-bit little-endian follows\n\tInt8 = 2, // signed-8-bit little-endian follows\n\tInt16 = 4, // signed-16-bit little-endian follows\n\tInt32 = 6, // signed-32-bit little-endian follows\n\tInt64 = 8, // signed-64-bit little-endian follows\n\n\tBinaryEmpty = 32, // value = byte[]\n\tBinarySingle8 = 33, // unsigned-8-bit little-endian length, follows by bytes of length\n\tBinarySingle16 = 34, // unsigned-16-bit little-endian length, follows by bytes of length\n\tBinarySingle32 = 35, // unsigned-32-bit little-endian length, follows by bytes of length\n\tBinarySingle64 = 36, // unsigned-64-bit little-endian length, follows by bytes of length\n}\n\n/**\n * Control codes used by tree serialization / decentralization code. They mark the start of sections.\n */\nexport enum MarkerCodesStart {\n\t\"list\" = 49,\n\t\"set\" = 51,\n}\n\n/**\n * Control codes used by tree serialization / decentralization code. They mark the end of sections.\n */\nexport enum MarkerCodesEnd {\n\t\"list\" = 50,\n\t\"set\" = 52,\n}\n\n/**\n * This contains mapping of Marker Codes to number of bytes in which the corresponding data\n * will be stored.\n */\nexport const codeToBytesMap = {\n\t// Integer code to bytes\n\t1: 0,\n\t2: 1,\n\t3: 1,\n\t4: 2,\n\t5: 2,\n\t6: 4,\n\t7: 4,\n\t8: 8,\n\t9: 8,\n\n\t// String code to Bytes\n\t13: 0,\n\t14: 1,\n\t15: 2,\n\t16: 4,\n\n\t17: 1,\n\t18: 2,\n\t19: 4,\n\n\t20: 1,\n\t21: 4,\n\n\t// Binary code to bytes\n\t32: 0,\n\t33: 1,\n\t34: 2,\n\t35: 4,\n\t36: 8,\n};\n\nexport function getValueSafely(map: { [index: number]: number }, key: number) {\n\tconst val = map[key];\n\tassert(val !== undefined, 0x287 /* key must exist in the map */);\n\treturn val;\n}\n\nexport function getNodeProps(node: NodeCore) {\n\tconst res: Record<string, NodeTypes> = {};\n\tfor (const [keyNode, valueNode] of node.iteratePairs()) {\n\t\tconst id = getStringInstance(keyNode, \"keynode should be a string\");\n\t\tres[id] = valueNode;\n\t}\n\treturn res;\n}\n\nexport function iteratePairs<T>(it: IterableIterator<T>) {\n\tconst res: IterableIterator<[T, T]> = {\n\t\tnext: () => {\n\t\t\tconst a = it.next();\n\t\t\tif (a.done) {\n\t\t\t\treturn { value: undefined, done: true };\n\t\t\t}\n\t\t\tconst b = it.next();\n\t\t\tassert(b.done !== true, 0x22b /* \"Should be a pair\" */);\n\t\t\treturn { value: [a.value, b.value], done: b.done };\n\t\t},\n\t\t[Symbol.iterator]: () => {\n\t\t\treturn res;\n\t\t},\n\t};\n\treturn res;\n}\n\n/**\n * Helper function that returns iterator from an object\n * @param obj - object that supports iteration\n */\nexport function iterate<T>(obj: { [Symbol.iterator]: () => IterableIterator<T> }) {\n\treturn obj[Symbol.iterator]();\n}\n\n/**\n * Base class to represent binary blob element.\n * Binary blob is one of three types supported as a leaf node of a tree.\n * Note: concrete implementations (derived classes) are not exposed from this module\n */\nexport abstract class BlobCore {\n\tpublic abstract get buffer(): Uint8Array;\n\tpublic abstract get arrayBuffer(): ArrayBufferLike;\n\n\t/**\n\t * Represents a blob.\n\t */\n\tconstructor() {}\n}\n\n/**\n * \"deep copy\" blob, holds to binary data passed in\n * It is called deep copy as a counter-part to BlobShallowCopy, which\n * is a reference to underlying binary stream (ReadBuffer).\n */\nclass BlobDeepCopy extends BlobCore {\n\t/**\n\t * Represents a deep copy of the blob.\n\t * @param data - Data array of the blob\n\t */\n\tconstructor(protected readonly data: Uint8Array) {\n\t\tsuper();\n\t}\n\n\tpublic get buffer() {\n\t\treturn this.data;\n\t}\n\n\tpublic get arrayBuffer(): ArrayBufferLike {\n\t\treturn Uint8ArrayToArrayBuffer(this.buffer);\n\t}\n\n\tpublic static read(buffer: ReadBuffer, lengthLen: number): BlobCore {\n\t\tconst length = buffer.read(lengthLen);\n\t\tconst data = new Uint8Array(length);\n\t\tfor (let counter = 0; counter < length; counter++) {\n\t\t\tdata[counter] = buffer.read();\n\t\t}\n\t\treturn new BlobDeepCopy(data);\n\t}\n}\n\n/**\n * Shallow copy blob, keeps a reference to portion of ReadBuffer\n * it was constructed from. It takes much less memory compared to BlobDeepCopy\n */\nexport class BlobShallowCopy extends BlobCore {\n\t/**\n\t * Represents a shallow copy of the blob. It is not a separate blob, just reference to original blobs.\n\t * @param data - Data array of the blob\n\t * @param start - Start point of the blob in the buffer.\n\t * @param end - End point of the blob in the buffer.\n\t */\n\tconstructor(\n\t\tprotected data: Uint8Array,\n\t\tprotected start: number,\n\t\tprotected end: number,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic get buffer() {\n\t\treturn this.data.subarray(this.start, this.end);\n\t}\n\n\t// Equivalent to Uint8ArrayToArrayBuffer(this.buffer)\n\tpublic get arrayBuffer(): ArrayBufferLike {\n\t\tconst offset = this.data.byteOffset;\n\t\treturn this.data.buffer.slice(this.start + offset, this.end + offset);\n\t}\n\n\tpublic static read(buffer: ReadBuffer, lengthLen: number): BlobCore {\n\t\tconst length = buffer.read(lengthLen);\n\t\tconst pos = buffer.pos;\n\t\tbuffer.skip(length);\n\t\treturn new BlobShallowCopy(buffer.buffer, pos, pos + length);\n\t}\n}\n\nexport const addStringProperty = (node: NodeCore, a: string, b: string) => {\n\tnode.addDictionaryString(a);\n\tnode.addString(b);\n};\nexport const addDictionaryStringProperty = (node: NodeCore, a: string, b: string) => {\n\tnode.addDictionaryString(a);\n\tnode.addString(b);\n};\nexport const addNumberProperty = (node: NodeCore, a: string, b: number) => {\n\tnode.addDictionaryString(a);\n\tnode.addNumber(b);\n};\nexport const addBoolProperty = (node: NodeCore, a: string, b: boolean) => {\n\tnode.addDictionaryString(a);\n\tnode.addBool(b);\n};\n\nexport interface IStringElement {\n\tcontent: string;\n\tdictionary: boolean;\n\t_stringElement: true;\n}\n\nexport interface IStringElementInternal extends Omit<IStringElement, \"content\"> {\n\tcontent?: string;\n\tstartPos: number;\n\tendPos: number;\n}\n\n/**\n * Three leaf types supported by tree:\n * 1. Node (sub-tree)\n * 2. binary blob\n * 3. integer\n * 4. boolean\n */\nexport type NodeTypes = NodeCore | BlobCore | number | boolean | IStringElement;\n\nexport type NodeCoreTypes = \"list\" | \"set\";\n\n/**\n * Node - node in the tree (non-leaf element of the tree)\n */\nexport class NodeCore {\n\t// It is an array of nodes.\n\tprivate readonly children: NodeTypes[] = [];\n\tpublic get nodes() {\n\t\treturn this.children;\n\t}\n\n\tconstructor(public type: NodeCoreTypes = \"set\") {}\n\n\tpublic [Symbol.iterator]() {\n\t\treturn this.children[Symbol.iterator]();\n\t}\n\n\tpublic iteratePairs() {\n\t\tassert(this.length % 2 === 0, 0x22c /* \"reading pairs\" */);\n\t\treturn iteratePairs(iterate(this));\n\t}\n\n\tpublic get length() {\n\t\treturn this.children.length;\n\t}\n\n\tpublic get(index: number) {\n\t\treturn this.children[index];\n\t}\n\n\tpublic getString(index: number): string {\n\t\tconst node = this.children[index];\n\t\treturn getStringInstance(node, \"getString should return string\");\n\t}\n\n\tpublic getMaybeString(index: number) {\n\t\tconst node = this.children[index];\n\t\treturn getMaybeStringInstance(node);\n\t}\n\n\tpublic getBlob(index: number): BlobCore {\n\t\tconst node = this.children[index];\n\t\tassertBlobCoreInstance(node, \"getBlob should return a blob\");\n\t\treturn node;\n\t}\n\n\tpublic getNode(index: number): NodeCore {\n\t\tconst node = this.children[index];\n\t\tassertNodeCoreInstance(node, \"getNode should return a node\");\n\t\treturn node;\n\t}\n\n\tpublic getNumber(index: number): number {\n\t\tconst node = this.children[index];\n\t\tassertNumberInstance(node, \"getNumber should return a number\");\n\t\treturn node;\n\t}\n\n\tpublic getBool(index: number): boolean {\n\t\tconst node = this.children[index];\n\t\tassertBoolInstance(node, \"getBool should return a boolean\");\n\t\treturn node;\n\t}\n\n\tpublic addNode(type?: NodeCoreTypes): NodeCore {\n\t\tconst node = new NodeCore(type);\n\t\tthis.children.push(node);\n\t\treturn node;\n\t}\n\n\tpublic addBlob(blob: Uint8Array) {\n\t\tthis.children.push(new BlobDeepCopy(blob));\n\t}\n\n\tpublic addDictionaryString(payload: string) {\n\t\tthis.children.push({\n\t\t\tcontent: payload,\n\t\t\tdictionary: true,\n\t\t\t_stringElement: true,\n\t\t});\n\t}\n\n\tpublic addString(payload: string) {\n\t\tthis.children.push({\n\t\t\tcontent: payload,\n\t\t\tdictionary: false,\n\t\t\t_stringElement: true,\n\t\t});\n\t}\n\n\tpublic addNumber(payload: number | undefined) {\n\t\tassert(Number.isInteger(payload), 0x231 /* \"Number should be an integer\" */);\n\t\tassert(payload !== undefined && payload >= 0, 0x232 /* \"Payload should not be negative\" */);\n\t\tthis.children.push(payload);\n\t}\n\n\tpublic addBool(payload: boolean) {\n\t\tthis.children.push(payload);\n\t}\n\n\t// Can we do more efficiently here, without extra objects somehow??\n\tprivate static readString(buffer: ReadBuffer, code: number, dictionary: boolean) {\n\t\tconst lengthLen = getValueSafely(codeToBytesMap, code);\n\t\tconst length = buffer.read(lengthLen);\n\t\tconst startPos = buffer.pos;\n\t\tbuffer.skip(length);\n\t\tconst result: IStringElementInternal = {\n\t\t\t// Note: Setting here property 'content: undefined' makes code substantially slower!\n\t\t\tdictionary,\n\t\t\t_stringElement: true,\n\t\t\tstartPos,\n\t\t\tendPos: buffer.pos,\n\t\t};\n\n\t\t// We are lying here in terms of presence of `content` property.\n\t\t// This will be addressed at the bottom of NodeCore.load() by resolving all strings at once!\n\t\t// It's equivalent (but much slower!) to do it here via\n\t\t// result.content = Uint8ArrayToString(buffer.buffer.subarray(startPos, buffer.pos), \"utf-8\");\n\t\treturn result as IStringElementInternal & IStringElement;\n\t}\n\n\t/**\n\t * Load and parse the buffer into a tree.\n\t * @param buffer - buffer to read from.\n\t */\n\tprotected load(buffer: ReadBuffer, logger: ITelemetryLoggerExt) {\n\t\tconst [stringsToResolve, durationStructure] = measure(() =>\n\t\t\tthis.loadStructure(buffer, logger),\n\t\t);\n\t\tconst [, durationStrings] = measure(() =>\n\t\t\tthis.loadStrings(buffer, stringsToResolve, logger),\n\t\t);\n\t\treturn { durationStructure, durationStrings };\n\t}\n\n\t/**\n\t * Load and parse the buffer into a tree.\n\t * @param buffer - buffer to read from.\n\t */\n\tprotected loadStructure(buffer: ReadBuffer, logger: ITelemetryLoggerExt) {\n\t\tconst stack: NodeTypes[][] = [];\n\t\tconst stringsToResolve: IStringElementInternal[] = [];\n\t\tconst dictionary: IStringElement[] = [];\n\n\t\tlet children = this.children;\n\t\tfor (; !buffer.eof; ) {\n\t\t\tconst code = buffer.read();\n\t\t\tswitch (code) {\n\t\t\t\tcase MarkerCodesStart.list:\n\t\t\t\tcase MarkerCodesStart.set: {\n\t\t\t\t\tconst childValue = new NodeCore(code === MarkerCodesStart.set ? \"set\" : \"list\");\n\t\t\t\t\tchildren.push(childValue);\n\t\t\t\t\tstack.push(children);\n\t\t\t\t\tchildren = childValue.children;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.ConstStringDeclare:\n\t\t\t\tcase MarkerCodes.ConstStringDeclareBig: {\n\t\t\t\t\tconst stringId = buffer.read(getValueSafely(codeToBytesMap, code));\n\t\t\t\t\tconst constString = NodeCore.readString(buffer, code, true /* dictionary */);\n\t\t\t\t\tstringsToResolve.push(constString);\n\t\t\t\t\tdictionary[stringId] = constString;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.ConstString8Id:\n\t\t\t\tcase MarkerCodes.ConstString16Id:\n\t\t\t\tcase MarkerCodes.ConstString32Id: {\n\t\t\t\t\tconst stringId = buffer.read(getValueSafely(codeToBytesMap, code));\n\t\t\t\t\tconst content = dictionary[stringId];\n\t\t\t\t\tassert(content !== undefined, 0x3de /* const string not found */);\n\t\t\t\t\tchildren.push(content);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.StringEmpty:\n\t\t\t\tcase MarkerCodes.String8Length:\n\t\t\t\tcase MarkerCodes.String16Length:\n\t\t\t\tcase MarkerCodes.String32Length: {\n\t\t\t\t\tconst str = NodeCore.readString(buffer, code, false /* dictionary */);\n\t\t\t\t\tstringsToResolve.push(str);\n\t\t\t\t\tchildren.push(str);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.BinaryEmpty:\n\t\t\t\tcase MarkerCodes.BinarySingle8:\n\t\t\t\tcase MarkerCodes.BinarySingle16:\n\t\t\t\tcase MarkerCodes.BinarySingle32:\n\t\t\t\tcase MarkerCodes.BinarySingle64: {\n\t\t\t\t\tchildren.push(\n\t\t\t\t\t\tBlobShallowCopy.read(buffer, getValueSafely(codeToBytesMap, code)),\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// If integer is 0.\n\t\t\t\tcase MarkerCodes.Int0: {\n\t\t\t\t\tchildren.push(0);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.UInt8:\n\t\t\t\tcase MarkerCodes.UInt16:\n\t\t\t\tcase MarkerCodes.UInt32:\n\t\t\t\tcase MarkerCodes.UInt64:\n\t\t\t\tcase MarkerCodes.Int8:\n\t\t\t\tcase MarkerCodes.Int16:\n\t\t\t\tcase MarkerCodes.Int32:\n\t\t\t\tcase MarkerCodes.Int64: {\n\t\t\t\t\tchildren.push(buffer.read(getValueSafely(codeToBytesMap, code)));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcase MarkerCodes.BoolTrue:\n\t\t\t\t\tchildren.push(true);\n\t\t\t\t\tcontinue;\n\t\t\t\tcase MarkerCodes.BoolFalse:\n\t\t\t\t\tchildren.push(false);\n\t\t\t\t\tcontinue;\n\t\t\t\tcase MarkerCodesEnd.list:\n\t\t\t\tcase MarkerCodesEnd.set:\n\t\t\t\t\t// Note: We are not checking that end marker matches start marker.\n\t\t\t\t\t// I.e. that we do not have a case where we start a 'list' but end with a 'set'\n\t\t\t\t\t// Checking it would require more state tracking that seems not very useful, given\n\t\t\t\t\t// our code does not care.\n\t\t\t\t\tchildren = stack.pop()!;\n\n\t\t\t\t\t// To my surprise, checking children !== undefined adds measurable cost!\n\t\t\t\t\t// We will rely on children.push() crashing in case of mismatch, and check below\n\t\t\t\t\t// (outside of the loop)\n\t\t\t\t\tcontinue;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(`Invalid code: ${code}`);\n\t\t\t}\n\t\t}\n\n\t\t// This also ensures that stack.length === 0.\n\t\tassert(children === this.children, 0x3e7 /* Unpaired start/end list/set markers! */);\n\n\t\treturn stringsToResolve;\n\t}\n\n\tprivate loadStrings(\n\t\tbuffer: ReadBuffer,\n\t\tstringsToResolve: IStringElementInternal[],\n\t\tlogger: ITelemetryLoggerExt,\n\t) {\n\t\t/**\n\t\t * Process all the strings at once!\n\t\t */\n\t\tlet length = 0;\n\t\tfor (const el of stringsToResolve) {\n\t\t\tlength += el.endPos - el.startPos + 1;\n\t\t}\n\t\tconst stringBuffer = new Uint8Array(length);\n\n\t\tlength = 0;\n\t\tconst input = buffer.buffer;\n\t\tassert(input.byteOffset === 0, 0x3e8 /* code below assumes no offset */);\n\n\t\tfor (const el of stringsToResolve) {\n\t\t\tfor (let it = el.startPos; it < el.endPos; it++) {\n\t\t\t\tstringBuffer[length] = input[it];\n\t\t\t\tlength++;\n\t\t\t}\n\t\t\tstringBuffer[length] = 0;\n\t\t\tlength++;\n\t\t}\n\t\tassert(length === stringBuffer.length, 0x418 /* properly encoded */);\n\n\t\tconst result = Uint8ArrayToString(stringBuffer, \"utf-8\").split(String.fromCharCode(0));\n\t\tif (result.length === stringsToResolve.length + 1) {\n\t\t\t// All is good, we expect all the cases to get here\n\t\t\tfor (let i = 0; i < stringsToResolve.length; i++) {\n\t\t\t\tstringsToResolve[i].content = result[i];\n\t\t\t}\n\t\t} else {\n\t\t\t// String content has \\0 chars!\n\t\t\t// Recovery code\n\t\t\tlogger.sendErrorEvent({ eventName: \"StringParsingError\" });\n\t\t\tfor (const el of stringsToResolve) {\n\t\t\t\tassert(\n\t\t\t\t\tel.content ===\n\t\t\t\t\t\tUint8ArrayToString(input.subarray(el.startPos, el.endPos), \"utf-8\"),\n\t\t\t\t\t0x3ea /* test */,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * TreeBuilder - Root of the tree.\n * Provides loading and serialization capabilities.\n */\nexport class TreeBuilder extends NodeCore {\n\tstatic load(buffer: ReadBuffer, logger: ITelemetryLoggerExt) {\n\t\tconst builder = new TreeBuilder();\n\t\tconst telemetryProps = builder.load(buffer, logger);\n\t\tassert(buffer.eof, 0x233 /* \"Unexpected data at the end of buffer\" */);\n\t\treturn { builder, telemetryProps };\n\t}\n}\n\nexport function getMaybeStringInstance(node: NodeTypes): string | undefined {\n\tconst maybeString = node as IStringElement;\n\tif (maybeString._stringElement) {\n\t\treturn maybeString.content;\n\t}\n}\n\nexport function getStringInstance(node: NodeTypes, message: string): string {\n\tconst maybeString = node as IStringElement;\n\tif (maybeString._stringElement) {\n\t\treturn maybeString.content;\n\t}\n\tthrowBufferParseException(node, \"BlobCore\", message);\n}\n\nexport function assertBlobCoreInstance(node: NodeTypes, message: string): asserts node is BlobCore {\n\tif (node instanceof BlobCore) {\n\t\treturn;\n\t}\n\tthrowBufferParseException(node, \"BlobCore\", message);\n}\n\nexport function assertNodeCoreInstance(node: NodeTypes, message: string): asserts node is NodeCore {\n\tif (node instanceof NodeCore) {\n\t\treturn;\n\t}\n\tthrowBufferParseException(node, \"NodeCore\", message);\n}\n\nexport function assertNumberInstance(node: NodeTypes, message: string): asserts node is number {\n\tif (typeof node === \"number\") {\n\t\treturn;\n\t}\n\tthrowBufferParseException(node, \"Number\", message);\n}\n\nexport function assertBoolInstance(node: NodeTypes, message: string): asserts node is boolean {\n\tif (typeof node === \"boolean\") {\n\t\treturn;\n\t}\n\tthrowBufferParseException(node, \"Boolean\", message);\n}\n\nfunction throwBufferParseException(\n\tnode: NodeTypes,\n\texpectedNodeType: NodeType,\n\tmessage: string,\n): never {\n\tthrow new NonRetryableError(\n\t\t`Buffer parsing exception: ${message}`,\n\t\tDriverErrorType.incorrectServerResponse,\n\t\t{\n\t\t\tnodeType: getNodeType(node),\n\t\t\texpectedNodeType,\n\t\t\tdriverVersion,\n\t\t},\n\t);\n}\n\nfunction getNodeType(value: NodeTypes): NodeType {\n\tif (typeof value === \"number\") {\n\t\treturn \"Number\";\n\t} else if (value instanceof BlobCore) {\n\t\treturn \"BlobCore\";\n\t} else if (value instanceof NodeCore) {\n\t\treturn \"NodeCore\";\n\t} else if (typeof value === \"boolean\") {\n\t\treturn \"Boolean\";\n\t} else if (value._stringElement) {\n\t\treturn \"String\";\n\t}\n\treturn \"UnknownType\";\n}\n\ntype NodeType = \"Number\" | \"BlobCore\" | \"NodeCore\" | \"Boolean\" | \"UnknownType\" | \"String\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/odsp-driver",
3
- "version": "2.0.0-dev.6.4.0.192049",
3
+ "version": "2.0.0-dev.7.2.0.203917",
4
4
  "description": "Socket storage implementation for SPO and ODC",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,47 +35,45 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluid-internal/client-utils": "2.0.0-dev.6.4.0.192049",
39
- "@fluidframework/core-interfaces": "2.0.0-dev.6.4.0.192049",
40
- "@fluidframework/core-utils": "2.0.0-dev.6.4.0.192049",
41
- "@fluidframework/driver-base": "2.0.0-dev.6.4.0.192049",
42
- "@fluidframework/driver-definitions": "2.0.0-dev.6.4.0.192049",
43
- "@fluidframework/driver-utils": "2.0.0-dev.6.4.0.192049",
44
- "@fluidframework/gitresources": "^1.0.1",
45
- "@fluidframework/odsp-doclib-utils": "2.0.0-dev.6.4.0.192049",
46
- "@fluidframework/odsp-driver-definitions": "2.0.0-dev.6.4.0.192049",
47
- "@fluidframework/protocol-base": "^1.0.1",
48
- "@fluidframework/protocol-definitions": "^1.1.0",
49
- "@fluidframework/telemetry-utils": "2.0.0-dev.6.4.0.192049",
38
+ "@fluid-internal/client-utils": "2.0.0-dev.7.2.0.203917",
39
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.2.0.203917",
40
+ "@fluidframework/core-utils": "2.0.0-dev.7.2.0.203917",
41
+ "@fluidframework/driver-base": "2.0.0-dev.7.2.0.203917",
42
+ "@fluidframework/driver-definitions": "2.0.0-dev.7.2.0.203917",
43
+ "@fluidframework/driver-utils": "2.0.0-dev.7.2.0.203917",
44
+ "@fluidframework/odsp-doclib-utils": "2.0.0-dev.7.2.0.203917",
45
+ "@fluidframework/odsp-driver-definitions": "2.0.0-dev.7.2.0.203917",
46
+ "@fluidframework/protocol-base": "^2.0.1",
47
+ "@fluidframework/protocol-definitions": "^3.0.0",
48
+ "@fluidframework/telemetry-utils": "2.0.0-dev.7.2.0.203917",
50
49
  "node-fetch": "^2.6.9",
51
50
  "socket.io-client": "^4.6.1",
52
51
  "uuid": "^9.0.0"
53
52
  },
54
53
  "devDependencies": {
55
- "@fluid-tools/build-cli": "^0.22.0",
56
- "@fluidframework/build-common": "^2.0.0",
57
- "@fluidframework/build-tools": "^0.22.0",
58
- "@fluidframework/eslint-config-fluid": "^2.1.0",
59
- "@fluidframework/mocha-test-setup": "2.0.0-dev.6.4.0.192049",
60
- "@fluidframework/odsp-driver-previous": "npm:@fluidframework/odsp-driver@2.0.0-internal.6.3.0",
61
- "@microsoft/api-extractor": "^7.34.4",
54
+ "@fluid-tools/build-cli": "0.26.0-203096",
55
+ "@fluidframework/build-common": "^2.0.2",
56
+ "@fluidframework/build-tools": "0.26.0-203096",
57
+ "@fluidframework/eslint-config-fluid": "^3.0.0",
58
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.2.0.203917",
59
+ "@fluidframework/odsp-driver-previous": "npm:@fluidframework/odsp-driver@2.0.0-internal.7.1.0",
60
+ "@microsoft/api-extractor": "^7.37.0",
62
61
  "@types/mocha": "^9.1.1",
63
62
  "@types/node": "^16.18.38",
64
63
  "@types/node-fetch": "^2.5.10",
65
64
  "@types/sha.js": "^2.4.0",
66
65
  "@types/sinon": "^7.0.13",
67
66
  "c8": "^7.7.1",
68
- "copyfiles": "^2.4.1",
69
67
  "cross-env": "^7.0.3",
70
- "eslint": "~8.6.0",
68
+ "eslint": "~8.50.0",
71
69
  "mocha": "^10.2.0",
72
70
  "mocha-json-output-reporter": "^2.0.1",
73
71
  "mocha-multi-reporters": "^1.5.1",
74
72
  "moment": "^2.21.0",
75
- "prettier": "~2.6.2",
73
+ "prettier": "~3.0.3",
76
74
  "rimraf": "^4.4.0",
77
75
  "sinon": "^7.4.2",
78
- "typescript": "~4.5.5"
76
+ "typescript": "~5.1.6"
79
77
  },
80
78
  "typeValidation": {
81
79
  "broken": {}
@@ -84,11 +82,11 @@
84
82
  "build": "fluid-build . --task build",
85
83
  "build:commonjs": "fluid-build . --task commonjs",
86
84
  "build:compile": "fluid-build . --task compile",
87
- "build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
85
+ "build:docs": "api-extractor run --local",
88
86
  "build:esnext": "tsc --project ./tsconfig.esnext.json",
89
87
  "build:genver": "gen-version",
90
88
  "build:test": "tsc --project ./src/test/tsconfig.json",
91
- "ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
89
+ "ci:build:docs": "api-extractor run",
92
90
  "clean": "rimraf --glob 'dist' 'lib' '*.tsbuildinfo' '*.build.log' '_api-extractor-temp' 'nyc'",
93
91
  "eslint": "eslint --format stylish src",
94
92
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
package/src/checkUrl.ts CHANGED
@@ -11,6 +11,7 @@ import { getLocatorFromOdspUrl } from "./odspFluidFileLink";
11
11
  * Note that returning information here is NOT a full guarantee that resolve will ultimately be successful.
12
12
  * Instead, this should be used as a lightweight check that can filter out easily detectable unsupported URLs
13
13
  * before the entire Fluid loading process needs to be kicked off.
14
+ * @public
14
15
  */
15
16
  export function checkUrl(documentUrl: URL): DriverPreCheckInfo | undefined {
16
17
  const locator = getLocatorFromOdspUrl(documentUrl);
@@ -27,6 +27,7 @@ export const currentReadVersion = "1.0";
27
27
  /**
28
28
  * The parsing is significantly faster if the position of props is well known instead of dynamic. So these variables
29
29
  * represents how many times slower parsing path is executed. This will be then logged into telemetry.
30
+ * @public
30
31
  */
31
32
  export interface ISnapshotContentsWithProps extends ISnapshotContents {
32
33
  telemetryProps: Record<string, number>;
@@ -216,6 +217,7 @@ function readSnapshotSection(node: NodeTypes) {
216
217
  * Converts snapshot from binary compact representation to tree/blobs/ops.
217
218
  * @param buffer - Compact snapshot to be parsed into tree/blobs/ops.
218
219
  * @returns Tree, blobs and ops from the snapshot.
220
+ * @public
219
221
  */
220
222
  export function parseCompactSnapshotResponse(
221
223
  buffer: Uint8Array,
package/src/constants.ts CHANGED
@@ -3,5 +3,12 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ /**
7
+ * @public
8
+ */
6
9
  export const OdcApiSiteOrigin = "https://my.microsoftpersonalcontent.com";
10
+
11
+ /**
12
+ * @public
13
+ */
7
14
  export const OdcFileSiteOrigin = "https://1drv.ms";
@@ -5,6 +5,9 @@
5
5
 
6
6
  import { IOdspUrlParts } from "@fluidframework/odsp-driver-definitions";
7
7
 
8
+ /**
9
+ * @public
10
+ */
8
11
  export interface OdspFluidDataStoreLocator extends IOdspUrlParts {
9
12
  dataStorePath: string;
10
13
  appName?: string;
@@ -13,22 +16,33 @@ export interface OdspFluidDataStoreLocator extends IOdspUrlParts {
13
16
  context?: string;
14
17
  }
15
18
 
19
+ /**
20
+ * @public
21
+ */
16
22
  export enum SharingLinkHeader {
17
23
  // Can be used in request made to resolver, to tell the resolver that the passed in URL is a sharing link
18
24
  // which can be redeemed at server to get permissions.
19
25
  isSharingLinkToRedeem = "isSharingLinkToRedeem",
20
26
  }
21
27
 
28
+ /**
29
+ * @public
30
+ */
22
31
  export interface ISharingLinkHeader {
23
32
  [SharingLinkHeader.isSharingLinkToRedeem]: boolean;
24
33
  }
25
-
34
+ /**
35
+ * @public
36
+ */
26
37
  export enum ClpCompliantAppHeader {
27
38
  // Can be used in request made to resolver, to tell the resolver that the host app is CLP compliant.
28
39
  // Odsp will not return Classified, labeled, or protected documents if the host app cannot support them.
29
40
  isClpCompliantApp = "X-CLP-Compliant-App",
30
41
  }
31
42
 
43
+ /**
44
+ * @public
45
+ */
32
46
  export interface IClpCompliantAppHeader {
33
47
  [ClpCompliantAppHeader.isClpCompliantApp]: boolean;
34
48
  }
@@ -15,6 +15,7 @@ import { buildOdspShareLinkReqParams } from "./odspUtils";
15
15
  * @param fileName - name of the new file to be created
16
16
  * @param createShareLinkType - type of sharing link you would like to create for this file. ShareLinkTypes
17
17
  * will be deprecated soon, so for any new implementation please provide createShareLinkType of type ShareLink
18
+ * @public
18
19
  */
19
20
  export function createOdspCreateContainerRequest(
20
21
  siteUrl: string,
@@ -12,6 +12,7 @@ import { OdspFluidDataStoreLocator } from "./contractsPublic";
12
12
  /**
13
13
  * Encodes ODC/SPO information into a URL format that can be handled by the Loader
14
14
  * @param l -The property bag of necessary properties to locate a Fluid data store and craft a url for it
15
+ * @public
15
16
  */
16
17
  export function createOdspUrl(l: OdspFluidDataStoreLocator): string {
17
18
  let odspUrl = `${l.siteUrl}?driveId=${encodeURIComponent(
@@ -43,6 +43,9 @@ import { ClpCompliantAppHeader } from "./contractsPublic";
43
43
  import { pkgVersion as driverVersion } from "./packageVersion";
44
44
  import { patchOdspResolvedUrl } from "./odspLocationRedirection";
45
45
 
46
+ /**
47
+ * @public
48
+ */
46
49
  export type FetchType =
47
50
  | "blob"
48
51
  | "createBlob"
@@ -56,6 +59,9 @@ export type FetchType =
56
59
  | "push"
57
60
  | "versions";
58
61
 
62
+ /**
63
+ * @public
64
+ */
59
65
  export type FetchTypeInternal = FetchType | "cache";
60
66
 
61
67
  export const Odsp409Error = "Odsp409Error";
@@ -77,6 +83,7 @@ export const defaultCacheExpiryTimeoutMs: number = 2 * 24 * 60 * 60 * 1000; // 2
77
83
  * server can match it with its epoch value in order to match the version.
78
84
  * It also validates the epoch value received in response of fetch calls. If the epoch does not match,
79
85
  * then it also clears all the cached entries for the given container.
86
+ * @public
80
87
  */
81
88
  export class EpochTracker implements IPersistedFileCache {
82
89
  private _fluidEpoch: string | undefined;
@@ -595,6 +602,9 @@ export class EpochTrackerWithRedemption extends EpochTracker {
595
602
  }
596
603
  }
597
604
 
605
+ /**
606
+ * @public
607
+ */
598
608
  export interface ICacheAndTracker {
599
609
  cache: IOdspCache;
600
610
  epochTracker: EpochTracker;
@@ -56,6 +56,7 @@ import { pkgVersion } from "./packageVersion";
56
56
 
57
57
  /**
58
58
  * Enum to support different types of snapshot formats.
59
+ * @public
59
60
  */
60
61
  export enum SnapshotFormatSupportType {
61
62
  Json = 0,
@@ -508,7 +509,6 @@ export interface ISnapshotRequestAndResponseOptions {
508
509
  function getFormBodyAndHeaders(
509
510
  odspResolvedUrl: IOdspResolvedUrl,
510
511
  storageToken: string,
511
- snapshotOptions: ISnapshotOptions | undefined,
512
512
  headers?: { [index: string]: string },
513
513
  ) {
514
514
  const formBoundary = uuid();
@@ -516,13 +516,7 @@ function getFormBodyAndHeaders(
516
516
  formParams.push(`--${formBoundary}`);
517
517
  formParams.push(`Authorization: Bearer ${storageToken}`);
518
518
  formParams.push(`X-HTTP-Method-Override: GET`);
519
- if (snapshotOptions !== undefined) {
520
- Object.entries(snapshotOptions).forEach(([key, value]) => {
521
- if (value !== undefined) {
522
- formParams.push(`${key}: ${value}`);
523
- }
524
- });
525
- }
519
+
526
520
  if (headers !== undefined) {
527
521
  Object.entries(headers).forEach(([key, value]) => {
528
522
  if (value !== undefined) {
@@ -600,18 +594,25 @@ export async function downloadSnapshot(
600
594
  }
601
595
 
602
596
  const snapshotUrl = odspResolvedUrl.endpoints.snapshotStorageUrl;
603
- const url = `${snapshotUrl}/trees/latest?ump=1`;
597
+
598
+ const queryParams = { ump: 1 };
599
+ if (snapshotOptions !== undefined) {
600
+ Object.entries(snapshotOptions).forEach(([key, value]) => {
601
+ // Exclude "timeout" from query string
602
+ if (value !== undefined && key !== "timeout") {
603
+ queryParams[key] = value;
604
+ }
605
+ });
606
+ }
607
+
608
+ const queryString = getQueryString(queryParams);
609
+ const url = `${snapshotUrl}/trees/latest${queryString}`;
604
610
  // The location of file can move on Spo in which case server returns 308(Permanent Redirect) error.
605
611
  // Adding below header will make VROOM API return 404 instead of 308 and browser can intercept it.
606
612
  // This error thrown by server will contain the new redirect location. Look at the 404 error parsing
607
613
  // for futher reference here: \packages\utils\odsp-doclib-utils\src\odspErrorUtils.ts
608
614
  const header = { prefer: "manualredirect" };
609
- const { body, headers } = getFormBodyAndHeaders(
610
- odspResolvedUrl,
611
- storageToken,
612
- snapshotOptions,
613
- header,
614
- );
615
+ const { body, headers } = getFormBodyAndHeaders(odspResolvedUrl, storageToken, header);
615
616
  const fetchOptions = {
616
617
  body,
617
618
  headers,
package/src/index.ts CHANGED
@@ -49,4 +49,13 @@ export {
49
49
  storeLocatorInOdspUrl,
50
50
  } from "./odspFluidFileLink";
51
51
 
52
- export { parseCompactSnapshotResponse } from "./compactSnapshotParser";
52
+ export {
53
+ IOdspCache,
54
+ IPersistedFileCache,
55
+ INonPersistentCache,
56
+ IPrefetchSnapshotContents,
57
+ } from "./odspCache";
58
+ export { ICacheAndTracker, type EpochTracker, FetchType, FetchTypeInternal } from "./epochTracker";
59
+ export { IOdspResponse } from "./odspUtils";
60
+ export { SnapshotFormatSupportType } from "./fetchSnapshot";
61
+ export { ISnapshotContentsWithProps, parseCompactSnapshotResponse } from "./compactSnapshotParser";
package/src/odspCache.ts CHANGED
@@ -16,6 +16,7 @@ import { ISnapshotContents } from "./odspPublicUtils";
16
16
 
17
17
  /**
18
18
  * Similar to IPersistedCache, but exposes cache interface for single file
19
+ * @public
19
20
  */
20
21
  export interface IPersistedFileCache {
21
22
  get(entry: IEntry): Promise<any>;
@@ -90,6 +91,7 @@ export class PromiseCacheWithOneHourSlidingExpiry<T> extends PromiseCache<string
90
91
 
91
92
  /**
92
93
  * Internal cache interface used within driver only
94
+ * @public
93
95
  */
94
96
  export interface INonPersistentCache {
95
97
  /**
@@ -114,6 +116,7 @@ export interface INonPersistentCache {
114
116
 
115
117
  /**
116
118
  * Internal cache interface used within driver only
119
+ * @public
117
120
  */
118
121
  export interface IOdspCache extends INonPersistentCache {
119
122
  /**
@@ -136,6 +139,9 @@ export class NonPersistentCache implements INonPersistentCache {
136
139
  >();
137
140
  }
138
141
 
142
+ /**
143
+ * @public
144
+ */
139
145
  export interface IPrefetchSnapshotContents extends ISnapshotContents {
140
146
  fluidEpoch: string;
141
147
  prefetchStartTime: number;