@fluidframework/odsp-driver 0.57.1 → 0.58.0-55561

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 (97) hide show
  1. package/dist/createFile.d.ts.map +1 -1
  2. package/dist/createFile.js +3 -3
  3. package/dist/createFile.js.map +1 -1
  4. package/dist/epochTracker.d.ts.map +1 -1
  5. package/dist/epochTracker.js +2 -3
  6. package/dist/epochTracker.js.map +1 -1
  7. package/dist/fetchSnapshot.d.ts.map +1 -1
  8. package/dist/fetchSnapshot.js +66 -25
  9. package/dist/fetchSnapshot.js.map +1 -1
  10. package/dist/getFileLink.js +2 -2
  11. package/dist/getFileLink.js.map +1 -1
  12. package/dist/odspDocumentDeltaConnection.js +1 -1
  13. package/dist/odspDocumentDeltaConnection.js.map +1 -1
  14. package/dist/odspDocumentService.d.ts.map +1 -1
  15. package/dist/odspDocumentService.js +1 -1
  16. package/dist/odspDocumentService.js.map +1 -1
  17. package/dist/odspDocumentStorageManager.d.ts.map +1 -1
  18. package/dist/odspDocumentStorageManager.js +5 -5
  19. package/dist/odspDocumentStorageManager.js.map +1 -1
  20. package/dist/odspDriverUrlResolver.d.ts +2 -2
  21. package/dist/odspDriverUrlResolver.d.ts.map +1 -1
  22. package/dist/odspDriverUrlResolver.js +14 -3
  23. package/dist/odspDriverUrlResolver.js.map +1 -1
  24. package/dist/odspDriverUrlResolverForShareLink.d.ts +2 -2
  25. package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
  26. package/dist/odspDriverUrlResolverForShareLink.js +15 -4
  27. package/dist/odspDriverUrlResolverForShareLink.js.map +1 -1
  28. package/dist/odspError.d.ts.map +1 -1
  29. package/dist/odspError.js +2 -2
  30. package/dist/odspError.js.map +1 -1
  31. package/dist/odspUtils.d.ts.map +1 -1
  32. package/dist/odspUtils.js +10 -10
  33. package/dist/odspUtils.js.map +1 -1
  34. package/dist/packageVersion.d.ts +1 -1
  35. package/dist/packageVersion.d.ts.map +1 -1
  36. package/dist/packageVersion.js +1 -1
  37. package/dist/packageVersion.js.map +1 -1
  38. package/dist/retryErrorsStorageAdapter.js +1 -1
  39. package/dist/retryErrorsStorageAdapter.js.map +1 -1
  40. package/dist/zipItDataRepresentationUtils.js +1 -1
  41. package/dist/zipItDataRepresentationUtils.js.map +1 -1
  42. package/lib/createFile.d.ts.map +1 -1
  43. package/lib/createFile.js +3 -3
  44. package/lib/createFile.js.map +1 -1
  45. package/lib/epochTracker.d.ts.map +1 -1
  46. package/lib/epochTracker.js +2 -3
  47. package/lib/epochTracker.js.map +1 -1
  48. package/lib/fetchSnapshot.d.ts.map +1 -1
  49. package/lib/fetchSnapshot.js +66 -25
  50. package/lib/fetchSnapshot.js.map +1 -1
  51. package/lib/getFileLink.js +2 -2
  52. package/lib/getFileLink.js.map +1 -1
  53. package/lib/odspDocumentDeltaConnection.js +1 -1
  54. package/lib/odspDocumentDeltaConnection.js.map +1 -1
  55. package/lib/odspDocumentService.d.ts.map +1 -1
  56. package/lib/odspDocumentService.js +1 -1
  57. package/lib/odspDocumentService.js.map +1 -1
  58. package/lib/odspDocumentStorageManager.d.ts.map +1 -1
  59. package/lib/odspDocumentStorageManager.js +5 -5
  60. package/lib/odspDocumentStorageManager.js.map +1 -1
  61. package/lib/odspDriverUrlResolver.d.ts +2 -2
  62. package/lib/odspDriverUrlResolver.d.ts.map +1 -1
  63. package/lib/odspDriverUrlResolver.js +15 -4
  64. package/lib/odspDriverUrlResolver.js.map +1 -1
  65. package/lib/odspDriverUrlResolverForShareLink.d.ts +2 -2
  66. package/lib/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
  67. package/lib/odspDriverUrlResolverForShareLink.js +15 -4
  68. package/lib/odspDriverUrlResolverForShareLink.js.map +1 -1
  69. package/lib/odspError.d.ts.map +1 -1
  70. package/lib/odspError.js +2 -2
  71. package/lib/odspError.js.map +1 -1
  72. package/lib/odspUtils.d.ts.map +1 -1
  73. package/lib/odspUtils.js +10 -10
  74. package/lib/odspUtils.js.map +1 -1
  75. package/lib/packageVersion.d.ts +1 -1
  76. package/lib/packageVersion.d.ts.map +1 -1
  77. package/lib/packageVersion.js +1 -1
  78. package/lib/packageVersion.js.map +1 -1
  79. package/lib/retryErrorsStorageAdapter.js +1 -1
  80. package/lib/retryErrorsStorageAdapter.js.map +1 -1
  81. package/lib/zipItDataRepresentationUtils.js +1 -1
  82. package/lib/zipItDataRepresentationUtils.js.map +1 -1
  83. package/package.json +10 -10
  84. package/src/createFile.ts +2 -4
  85. package/src/epochTracker.ts +5 -4
  86. package/src/fetchSnapshot.ts +66 -33
  87. package/src/getFileLink.ts +0 -2
  88. package/src/odspDocumentDeltaConnection.ts +1 -1
  89. package/src/odspDocumentService.ts +0 -1
  90. package/src/odspDocumentStorageManager.ts +1 -6
  91. package/src/odspDriverUrlResolver.ts +18 -5
  92. package/src/odspDriverUrlResolverForShareLink.ts +17 -9
  93. package/src/odspError.ts +1 -2
  94. package/src/odspUtils.ts +10 -13
  95. package/src/packageVersion.ts +1 -1
  96. package/src/retryErrorsStorageAdapter.ts +1 -1
  97. package/src/zipItDataRepresentationUtils.ts +1 -2
@@ -1 +1 @@
1
- {"version":3,"file":"zipItDataRepresentationUtils.js","sourceRoot":"","sources":["../src/zipItDataRepresentationUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;EAGE;AAEF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC9G,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;AAE/D,mCAAmC;AACnC,wJAAwJ;AACxJ;;;GAGG;AACH,MAAM,CAAN,IAAY,WA8BX;AA9BD,WAAY,WAAW;IACnB,sDAAa,CAAA;IACb,wDAAc,CAAA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aAAa;KAChB,CAAC,CAAC;AACX,CAAC;AAED,SAAS,WAAW,CAAC,KAAgB;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,OAAO,QAAQ,CAAC;KACnB;SAAM,IAAG,KAAK,YAAY,QAAQ,EAAE;QACjC,OAAO,UAAU,CAAC;KACrB;SAAM,IAAI,KAAK,YAAY,QAAQ,EAAE;QAClC,OAAO,UAAU,CAAC;KACrB;SAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;QACnC,OAAO,SAAS,CAAC;KACpB;IACD,OAAO,aAAa,CAAC;AACzB,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 { assert, IsoBuffer, Uint8ArrayToArrayBuffer, Uint8ArrayToString } from \"@fluidframework/common-utils\";\nimport { NonRetryableError } from \"@fluidframework/driver-utils\";\nimport { DriverErrorType } from \"@fluidframework/driver-definitions\";\nimport { ReadBuffer } from \"./ReadBufferUtils\";\nimport { pkgVersion as driverVersion } from \"./packageVersion\";\n\n// eslint-disable-next-line max-len\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 BoolTrue = 11, // value = true\n BoolFalse = 12, // value = false\n\n StringEmpty = 13, // value = \"\"\n String8Length = 14, // unsigned-8-bit little-endian length, follows by UTF-8 bytes of length\n String16Length = 15, // unsigned-16-bit little-endian length, follows by UTF-8 bytes of length\n String32Length = 16, // unsigned-32-bit little-endian length, follows by UTF-8 bytes of length\n\n ConstString8Id = 17, // unsigned-8-bit little-endian const string id follows\n ConstString16Id = 18, // unsigned-16-bit little-endian const string id follows\n ConstString32Id = 19, // unsigned-32-bit little-endian const string id follows\n ConstStringDeclare = 20, // Code for declaring a const string with size <= 1 byte\n ConstStringDeclareBig = 21, // Code for declaring a const string with size > 1 byte. It is represented in 4 bytes.\n\n Int0 = 1, // value = 0\n UInt8 = 3, // unsigned-8-bit little-endian follows\n UInt16 = 5, // unsigned-16-bit little-endian follows\n UInt32 = 7, // unsigned-32-bit little-endian follows\n UInt64 = 9, // unsigned-64-bit little-endian follows\n Int8 = 2, // signed-8-bit little-endian follows\n Int16 = 4, // signed-16-bit little-endian follows\n Int32 = 6, // signed-32-bit little-endian follows\n Int64 = 8, // signed-64-bit little-endian follows\n\n BinaryEmpty = 32, // value = byte[]\n BinarySingle8 = 33, // unsigned-8-bit little-endian length, follows by bytes of length\n BinarySingle16 = 34, // unsigned-16-bit little-endian length, follows by bytes of length\n BinarySingle32 = 35, // unsigned-32-bit little-endian length, follows by bytes of length\n BinarySingle64 = 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 \"list\" = 49,\n \"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 \"list\" = 50,\n \"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 // Integer code to bytes\n 1: 0,\n 2: 1,\n 3: 1,\n 4: 2,\n 5: 2,\n 6: 4,\n 7: 4,\n 8: 8,\n 9: 8,\n\n // String code to Bytes\n 13: 0,\n 14: 1,\n 15: 2,\n 16: 4,\n\n 17: 1,\n 18: 2,\n 19: 4,\n\n 20: 1,\n 21: 4,\n\n // Binary code to bytes\n 32: 0,\n 33: 1,\n 34: 2,\n 35: 4,\n 36: 8,\n};\n\nexport function getValueSafely(map: {[index: number]: number}, key: number) {\n const val = map[key];\n assert(val !== undefined, 0x287 /* `key= ${key} must exist in the map` */);\n return val;\n}\n\nexport function getAndValidateNodeProps(node: NodeCore, props: string[], enforceAllProps = true) {\n const propSet = new Set(props);\n const res: Record<string, NodeTypes> = {};\n for (const [keyNode, valueNode] of node.iteratePairs()) {\n assertBlobCoreInstance(keyNode, \"keynode should be a blob\");\n const keyStr = keyNode.toString();\n if (propSet.has(keyStr)) {\n propSet.delete(keyStr);\n res[keyStr] = valueNode;\n }\n }\n if (enforceAllProps) {\n assert(propSet.size === 0, 0x288 /* `All properties should exist, Not found: ${[...propSet.keys()]}` */);\n }\n return res;\n}\n\nexport function iteratePairs<T>(it: IterableIterator<T>) {\n const res: IterableIterator<[T, T]> = {\n next: () => {\n const a = it.next();\n if (a.done) {\n return { value: undefined, done: true };\n }\n const b = it.next();\n assert(b.done !== true, 0x22b /* \"Should be a pair\" */);\n return { value: [a.value, b.value], done: b.done };\n },\n [Symbol.iterator]: () => { return res; },\n };\n return 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 return 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 public abstract get buffer(): Uint8Array;\n public get arrayBuffer(): ArrayBufferLike {\n return Uint8ArrayToArrayBuffer(this.buffer);\n }\n\n /**\n * Represents a blob.\n * @param constString - Whether it contains const string declaration.\n * @param useUtf8Code - Represents if the utf8 string marker code should be used when representing.\n */\n constructor(public readonly constString: boolean, public readonly useUtf8Code: boolean = false) {}\n\n public toString() {\n return Uint8ArrayToString(this.buffer, \"utf-8\");\n }\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 /**\n * Represents a deep copy of the blob.\n * @param data - Data array of the blob\n * @param constString - Whether it contains const string declaration.\n * @param useUtf8Code - Represents if the utf8 string marker code should be used when representing.\n */\n constructor(protected readonly data: Uint8Array, constString: boolean, useUtf8Code: boolean = false) {\n super(constString, useUtf8Code);\n }\n\n public get buffer() {\n return this.data;\n }\n\n public static read(buffer: ReadBuffer, lengthLen: number, constString: boolean): BlobCore {\n const length = buffer.read(lengthLen);\n const data = new Uint8Array(length);\n for (let counter = 0; counter < length; counter++) {\n data[counter] = buffer.read();\n }\n return new BlobDeepCopy(data, constString);\n }\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 */\n export class BlobShallowCopy extends BlobCore {\n /**\n * Represents a shallow copy of the blob. It is not a separate blob, just reference to original blobs.\n * @param data - Data array of the blob\n * @param start - Start point of the blob in the buffer.\n * @param end - End point of the blob in the buffer.\n * @param constString - Whether it contains const string declaration.\n */\n constructor(\n protected data: ReadBuffer,\n protected start: number,\n protected end: number,\n constString: boolean,\n ) {\n super(constString);\n }\n\n public get buffer() {\n return this.data.buffer.subarray(this.start, this.end);\n }\n\n public static read(buffer: ReadBuffer, lengthLen: number, constString: boolean): BlobCore {\n const length = buffer.read(lengthLen);\n const pos = buffer.pos;\n buffer.skip(length);\n return new BlobShallowCopy(buffer, pos, pos + length, constString);\n }\n}\n\nexport const addStringProperty = (node: NodeCore, a: string, b: string, encodeValAsConstString: boolean = false) =>\n { node.addString(a, true); node.addString(b, encodeValAsConstString); };\nexport const addNumberProperty = (node: NodeCore, a: string, b: number) =>\n { node.addString(a, true); node.addNumber(b); };\nexport const addBoolProperty = (node: NodeCore, a: string, b: boolean) =>\n { node.addString(a, true); node.addBool(b); };\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;\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 // It is an array of nodes.\n private readonly children: NodeTypes[] = [];\n public get nodes() {\n return this.children;\n }\n\n constructor(public type: NodeCoreTypes = \"set\") {}\n\n public [Symbol.iterator]() {\n return this.children[Symbol.iterator]();\n }\n\n public iteratePairs() {\n assert((this.length % 2) === 0, 0x22c /* \"reading pairs\" */);\n return iteratePairs(iterate(this));\n }\n\n public get length() { return this.children.length; }\n\n public get(index: number) { return this.children[index]; }\n\n public getString(index: number): string {\n const node = this.children[index];\n assertBlobCoreInstance(node, \"getString should return stringblob\");\n return node.toString();\n }\n\n public getBlob(index: number): BlobCore {\n const node = this.children[index];\n assertBlobCoreInstance(node, \"getBlob should return a blob\");\n return node;\n }\n\n public getNode(index: number): NodeCore\n {\n const node = this.children[index];\n assertNodeCoreInstance(node, \"getNode should return a node\");\n return node;\n }\n\n public getNumber(index: number): number\n {\n const node = this.children[index];\n assertNumberInstance(node, \"getNumber should return a number\");\n return node;\n }\n\n public getBool(index: number): boolean {\n const node = this.children[index];\n assertBoolInstance(node, \"getBool should return a boolean\");\n return node;\n }\n\n public addNode(type?: NodeCoreTypes): NodeCore {\n const node = new NodeCore(type);\n this.children.push(node);\n return node;\n }\n\n public addBlob(blob: Uint8Array, constString: boolean, useUtf8Code: boolean = false) {\n this.children.push(new BlobDeepCopy(blob, constString, useUtf8Code));\n }\n\n public addString(payload: string, constString: boolean) {\n this.addBlob(IsoBuffer.from(payload, \"utf-8\"), constString, true);\n }\n\n public addNumber(payload: number | undefined) {\n assert(Number.isInteger(payload), 0x231 /* \"Number should be an integer\" */);\n assert(payload !== undefined && payload >= 0, 0x232 /* \"Payload should not be negative\" */);\n this.children.push(payload);\n }\n\n public addBool(payload: boolean) {\n this.children.push(payload);\n }\n\n /**\n * Load and parse the buffer into a tree.\n * @param buffer - buffer to read from.\n */\n protected load(buffer: ReadBuffer, dictionary: BlobCore[]) {\n for (;!buffer.eof;) {\n let childValue: NodeTypes | undefined;\n const code = buffer.read();\n switch (code) {\n case MarkerCodesStart.list:\n case MarkerCodesStart.set: {\n childValue = new NodeCore(code === MarkerCodesStart.set ? \"set\" : \"list\");\n this.children.push(childValue);\n childValue.load(buffer, dictionary);\n break;\n }\n case MarkerCodes.ConstStringDeclare:\n case MarkerCodes.ConstStringDeclareBig:\n {\n const stringId = buffer.read(getValueSafely(codeToBytesMap, code));\n const constString = BlobShallowCopy.read(buffer, getValueSafely(codeToBytesMap, code), true);\n dictionary[stringId] = constString;\n break;\n }\n case MarkerCodes.ConstString8Id:\n case MarkerCodes.ConstString16Id:\n case MarkerCodes.ConstString32Id:\n {\n const stringId = buffer.read(getValueSafely(codeToBytesMap, code));\n childValue = dictionary[stringId];\n this.children.push(childValue);\n break;\n }\n case MarkerCodes.StringEmpty:\n case MarkerCodes.String8Length:\n case MarkerCodes.String16Length:\n case MarkerCodes.String32Length:\n case MarkerCodes.BinaryEmpty:\n case MarkerCodes.BinarySingle8:\n case MarkerCodes.BinarySingle16:\n case MarkerCodes.BinarySingle32:\n case MarkerCodes.BinarySingle64:\n {\n childValue = BlobShallowCopy.read(buffer, getValueSafely(codeToBytesMap, code), false);\n this.children.push(childValue);\n break;\n }\n // If integer is 0.\n case MarkerCodes.Int0:\n {\n childValue = 0;\n this.children.push(childValue);\n break;\n }\n case MarkerCodes.UInt8:\n case MarkerCodes.UInt16:\n case MarkerCodes.UInt32:\n case MarkerCodes.UInt64:\n case MarkerCodes.Int8:\n case MarkerCodes.Int16:\n case MarkerCodes.Int32:\n case MarkerCodes.Int64:\n {\n childValue = buffer.read(getValueSafely(codeToBytesMap, code));\n this.children.push(childValue);\n break;\n }\n case MarkerCodes.BoolTrue:\n this.children.push(true);\n break;\n case MarkerCodes.BoolFalse:\n this.children.push(false);\n break;\n case MarkerCodesEnd.list:\n case MarkerCodesEnd.set:\n return;\n default:\n throw new Error(`Invalid code: ${code}`);\n }\n }\n }\n}\n\n /**\n * TreeBuilder - Root of the tree.\n * Provides loading and serialization capabilities.\n */\nexport class TreeBuilder extends NodeCore {\n static load(buffer: ReadBuffer): TreeBuilder {\n const builder = new TreeBuilder();\n const dictionary = new Array<BlobCore>();\n builder.load(buffer, dictionary);\n assert(buffer.eof, 0x233 /* \"Unexpected data at the end of buffer\" */);\n return builder;\n }\n}\n\nexport function assertBlobCoreInstance(\n node: NodeTypes,\n message: string,\n): asserts node is BlobCore {\n if (node instanceof BlobCore) {\n return;\n }\n throwBufferParseException(node, \"BlobCore\", message);\n}\n\nexport function assertNodeCoreInstance(\n node: NodeTypes,\n message: string,\n): asserts node is NodeCore {\n if (node instanceof NodeCore) {\n return;\n }\n throwBufferParseException(node, \"NodeCore\", message);\n}\n\nexport function assertNumberInstance(\n node: NodeTypes,\n message: string,\n): asserts node is number {\n if (typeof node === \"number\") {\n return;\n }\n throwBufferParseException(node, \"Number\", message);\n}\n\nexport function assertBoolInstance(\n node: NodeTypes,\n message: string,\n): asserts node is boolean {\n if (typeof node === \"boolean\") {\n return;\n }\n throwBufferParseException(node, \"Boolean\", message);\n}\n\nfunction throwBufferParseException(\n node: NodeTypes,\n expectedNodeType: NodeType,\n message: string,\n): never {\n throw new NonRetryableError(\n \"bufferParsingException\",\n message,\n DriverErrorType.incorrectServerResponse,\n {\n nodeType: getNodeType(node),\n expectedNodeType,\n driverVersion,\n });\n}\n\nfunction getNodeType(value: NodeTypes): NodeType {\n if (typeof value === \"number\") {\n return \"Number\";\n } else if(value instanceof BlobCore) {\n return \"BlobCore\";\n } else if (value instanceof NodeCore) {\n return \"NodeCore\";\n } else if (typeof value === \"boolean\") {\n return \"Boolean\";\n }\n return \"UnknownType\";\n}\n\ntype NodeType = \"Number\" | \"BlobCore\" | \"NodeCore\" | \"Boolean\" | \"UnknownType\";\n"]}
1
+ {"version":3,"file":"zipItDataRepresentationUtils.js","sourceRoot":"","sources":["../src/zipItDataRepresentationUtils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EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAC9B,IAAe,EACf,OAAe;IAEf,IAAI,OAAO,IAAI,KAAK,SAAS,EAAE;QAC3B,OAAO;KACV;IACD,yBAAyB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,yBAAyB,CAC9B,IAAe,EACf,gBAA0B,EAC1B,OAAe;IAEf,MAAM,IAAI,iBAAiB,CACvB,6BAA6B,OAAO,EAAE,EACtC,eAAe,CAAC,uBAAuB,EACvC;QACI,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;QAC3B,gBAAgB;QAChB,aAAa;KAChB,CAAC,CAAC;AACX,CAAC;AAED,SAAS,WAAW,CAAC,KAAgB;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,OAAO,QAAQ,CAAC;KACnB;SAAM,IAAG,KAAK,YAAY,QAAQ,EAAE;QACjC,OAAO,UAAU,CAAC;KACrB;SAAM,IAAI,KAAK,YAAY,QAAQ,EAAE;QAClC,OAAO,UAAU,CAAC;KACrB;SAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;QACnC,OAAO,SAAS,CAAC;KACpB;IACD,OAAO,aAAa,CAAC;AACzB,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 { assert, IsoBuffer, Uint8ArrayToArrayBuffer, Uint8ArrayToString } from \"@fluidframework/common-utils\";\nimport { NonRetryableError } from \"@fluidframework/driver-utils\";\nimport { DriverErrorType } from \"@fluidframework/driver-definitions\";\nimport { ReadBuffer } from \"./ReadBufferUtils\";\nimport { pkgVersion as driverVersion } from \"./packageVersion\";\n\n// eslint-disable-next-line max-len\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 BoolTrue = 11, // value = true\n BoolFalse = 12, // value = false\n\n StringEmpty = 13, // value = \"\"\n String8Length = 14, // unsigned-8-bit little-endian length, follows by UTF-8 bytes of length\n String16Length = 15, // unsigned-16-bit little-endian length, follows by UTF-8 bytes of length\n String32Length = 16, // unsigned-32-bit little-endian length, follows by UTF-8 bytes of length\n\n ConstString8Id = 17, // unsigned-8-bit little-endian const string id follows\n ConstString16Id = 18, // unsigned-16-bit little-endian const string id follows\n ConstString32Id = 19, // unsigned-32-bit little-endian const string id follows\n ConstStringDeclare = 20, // Code for declaring a const string with size <= 1 byte\n ConstStringDeclareBig = 21, // Code for declaring a const string with size > 1 byte. It is represented in 4 bytes.\n\n Int0 = 1, // value = 0\n UInt8 = 3, // unsigned-8-bit little-endian follows\n UInt16 = 5, // unsigned-16-bit little-endian follows\n UInt32 = 7, // unsigned-32-bit little-endian follows\n UInt64 = 9, // unsigned-64-bit little-endian follows\n Int8 = 2, // signed-8-bit little-endian follows\n Int16 = 4, // signed-16-bit little-endian follows\n Int32 = 6, // signed-32-bit little-endian follows\n Int64 = 8, // signed-64-bit little-endian follows\n\n BinaryEmpty = 32, // value = byte[]\n BinarySingle8 = 33, // unsigned-8-bit little-endian length, follows by bytes of length\n BinarySingle16 = 34, // unsigned-16-bit little-endian length, follows by bytes of length\n BinarySingle32 = 35, // unsigned-32-bit little-endian length, follows by bytes of length\n BinarySingle64 = 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 \"list\" = 49,\n \"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 \"list\" = 50,\n \"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 // Integer code to bytes\n 1: 0,\n 2: 1,\n 3: 1,\n 4: 2,\n 5: 2,\n 6: 4,\n 7: 4,\n 8: 8,\n 9: 8,\n\n // String code to Bytes\n 13: 0,\n 14: 1,\n 15: 2,\n 16: 4,\n\n 17: 1,\n 18: 2,\n 19: 4,\n\n 20: 1,\n 21: 4,\n\n // Binary code to bytes\n 32: 0,\n 33: 1,\n 34: 2,\n 35: 4,\n 36: 8,\n};\n\nexport function getValueSafely(map: {[index: number]: number}, key: number) {\n const val = map[key];\n assert(val !== undefined, 0x287 /* `key= ${key} must exist in the map` */);\n return val;\n}\n\nexport function getAndValidateNodeProps(node: NodeCore, props: string[], enforceAllProps = true) {\n const propSet = new Set(props);\n const res: Record<string, NodeTypes> = {};\n for (const [keyNode, valueNode] of node.iteratePairs()) {\n assertBlobCoreInstance(keyNode, \"keynode should be a blob\");\n const keyStr = keyNode.toString();\n if (propSet.has(keyStr)) {\n propSet.delete(keyStr);\n res[keyStr] = valueNode;\n }\n }\n if (enforceAllProps) {\n assert(propSet.size === 0, 0x288 /* `All properties should exist, Not found: ${[...propSet.keys()]}` */);\n }\n return res;\n}\n\nexport function iteratePairs<T>(it: IterableIterator<T>) {\n const res: IterableIterator<[T, T]> = {\n next: () => {\n const a = it.next();\n if (a.done) {\n return { value: undefined, done: true };\n }\n const b = it.next();\n assert(b.done !== true, 0x22b /* \"Should be a pair\" */);\n return { value: [a.value, b.value], done: b.done };\n },\n [Symbol.iterator]: () => { return res; },\n };\n return 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 return 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 public abstract get buffer(): Uint8Array;\n public get arrayBuffer(): ArrayBufferLike {\n return Uint8ArrayToArrayBuffer(this.buffer);\n }\n\n /**\n * Represents a blob.\n * @param constString - Whether it contains const string declaration.\n * @param useUtf8Code - Represents if the utf8 string marker code should be used when representing.\n */\n constructor(public readonly constString: boolean, public readonly useUtf8Code: boolean = false) {}\n\n public toString() {\n return Uint8ArrayToString(this.buffer, \"utf-8\");\n }\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 /**\n * Represents a deep copy of the blob.\n * @param data - Data array of the blob\n * @param constString - Whether it contains const string declaration.\n * @param useUtf8Code - Represents if the utf8 string marker code should be used when representing.\n */\n constructor(protected readonly data: Uint8Array, constString: boolean, useUtf8Code: boolean = false) {\n super(constString, useUtf8Code);\n }\n\n public get buffer() {\n return this.data;\n }\n\n public static read(buffer: ReadBuffer, lengthLen: number, constString: boolean): BlobCore {\n const length = buffer.read(lengthLen);\n const data = new Uint8Array(length);\n for (let counter = 0; counter < length; counter++) {\n data[counter] = buffer.read();\n }\n return new BlobDeepCopy(data, constString);\n }\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 */\n export class BlobShallowCopy extends BlobCore {\n /**\n * Represents a shallow copy of the blob. It is not a separate blob, just reference to original blobs.\n * @param data - Data array of the blob\n * @param start - Start point of the blob in the buffer.\n * @param end - End point of the blob in the buffer.\n * @param constString - Whether it contains const string declaration.\n */\n constructor(\n protected data: ReadBuffer,\n protected start: number,\n protected end: number,\n constString: boolean,\n ) {\n super(constString);\n }\n\n public get buffer() {\n return this.data.buffer.subarray(this.start, this.end);\n }\n\n public static read(buffer: ReadBuffer, lengthLen: number, constString: boolean): BlobCore {\n const length = buffer.read(lengthLen);\n const pos = buffer.pos;\n buffer.skip(length);\n return new BlobShallowCopy(buffer, pos, pos + length, constString);\n }\n}\n\nexport const addStringProperty = (node: NodeCore, a: string, b: string, encodeValAsConstString: boolean = false) =>\n { node.addString(a, true); node.addString(b, encodeValAsConstString); };\nexport const addNumberProperty = (node: NodeCore, a: string, b: number) =>\n { node.addString(a, true); node.addNumber(b); };\nexport const addBoolProperty = (node: NodeCore, a: string, b: boolean) =>\n { node.addString(a, true); node.addBool(b); };\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;\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 // It is an array of nodes.\n private readonly children: NodeTypes[] = [];\n public get nodes() {\n return this.children;\n }\n\n constructor(public type: NodeCoreTypes = \"set\") {}\n\n public [Symbol.iterator]() {\n return this.children[Symbol.iterator]();\n }\n\n public iteratePairs() {\n assert((this.length % 2) === 0, 0x22c /* \"reading pairs\" */);\n return iteratePairs(iterate(this));\n }\n\n public get length() { return this.children.length; }\n\n public get(index: number) { return this.children[index]; }\n\n public getString(index: number): string {\n const node = this.children[index];\n assertBlobCoreInstance(node, \"getString should return stringblob\");\n return node.toString();\n }\n\n public getBlob(index: number): BlobCore {\n const node = this.children[index];\n assertBlobCoreInstance(node, \"getBlob should return a blob\");\n return node;\n }\n\n public getNode(index: number): NodeCore\n {\n const node = this.children[index];\n assertNodeCoreInstance(node, \"getNode should return a node\");\n return node;\n }\n\n public getNumber(index: number): number\n {\n const node = this.children[index];\n assertNumberInstance(node, \"getNumber should return a number\");\n return node;\n }\n\n public getBool(index: number): boolean {\n const node = this.children[index];\n assertBoolInstance(node, \"getBool should return a boolean\");\n return node;\n }\n\n public addNode(type?: NodeCoreTypes): NodeCore {\n const node = new NodeCore(type);\n this.children.push(node);\n return node;\n }\n\n public addBlob(blob: Uint8Array, constString: boolean, useUtf8Code: boolean = false) {\n this.children.push(new BlobDeepCopy(blob, constString, useUtf8Code));\n }\n\n public addString(payload: string, constString: boolean) {\n this.addBlob(IsoBuffer.from(payload, \"utf-8\"), constString, true);\n }\n\n public addNumber(payload: number | undefined) {\n assert(Number.isInteger(payload), 0x231 /* \"Number should be an integer\" */);\n assert(payload !== undefined && payload >= 0, 0x232 /* \"Payload should not be negative\" */);\n this.children.push(payload);\n }\n\n public addBool(payload: boolean) {\n this.children.push(payload);\n }\n\n /**\n * Load and parse the buffer into a tree.\n * @param buffer - buffer to read from.\n */\n protected load(buffer: ReadBuffer, dictionary: BlobCore[]) {\n for (;!buffer.eof;) {\n let childValue: NodeTypes | undefined;\n const code = buffer.read();\n switch (code) {\n case MarkerCodesStart.list:\n case MarkerCodesStart.set: {\n childValue = new NodeCore(code === MarkerCodesStart.set ? \"set\" : \"list\");\n this.children.push(childValue);\n childValue.load(buffer, dictionary);\n break;\n }\n case MarkerCodes.ConstStringDeclare:\n case MarkerCodes.ConstStringDeclareBig:\n {\n const stringId = buffer.read(getValueSafely(codeToBytesMap, code));\n const constString = BlobShallowCopy.read(buffer, getValueSafely(codeToBytesMap, code), true);\n dictionary[stringId] = constString;\n break;\n }\n case MarkerCodes.ConstString8Id:\n case MarkerCodes.ConstString16Id:\n case MarkerCodes.ConstString32Id:\n {\n const stringId = buffer.read(getValueSafely(codeToBytesMap, code));\n childValue = dictionary[stringId];\n this.children.push(childValue);\n break;\n }\n case MarkerCodes.StringEmpty:\n case MarkerCodes.String8Length:\n case MarkerCodes.String16Length:\n case MarkerCodes.String32Length:\n case MarkerCodes.BinaryEmpty:\n case MarkerCodes.BinarySingle8:\n case MarkerCodes.BinarySingle16:\n case MarkerCodes.BinarySingle32:\n case MarkerCodes.BinarySingle64:\n {\n childValue = BlobShallowCopy.read(buffer, getValueSafely(codeToBytesMap, code), false);\n this.children.push(childValue);\n break;\n }\n // If integer is 0.\n case MarkerCodes.Int0:\n {\n childValue = 0;\n this.children.push(childValue);\n break;\n }\n case MarkerCodes.UInt8:\n case MarkerCodes.UInt16:\n case MarkerCodes.UInt32:\n case MarkerCodes.UInt64:\n case MarkerCodes.Int8:\n case MarkerCodes.Int16:\n case MarkerCodes.Int32:\n case MarkerCodes.Int64:\n {\n childValue = buffer.read(getValueSafely(codeToBytesMap, code));\n this.children.push(childValue);\n break;\n }\n case MarkerCodes.BoolTrue:\n this.children.push(true);\n break;\n case MarkerCodes.BoolFalse:\n this.children.push(false);\n break;\n case MarkerCodesEnd.list:\n case MarkerCodesEnd.set:\n return;\n default:\n throw new Error(`Invalid code: ${code}`);\n }\n }\n }\n}\n\n /**\n * TreeBuilder - Root of the tree.\n * Provides loading and serialization capabilities.\n */\nexport class TreeBuilder extends NodeCore {\n static load(buffer: ReadBuffer): TreeBuilder {\n const builder = new TreeBuilder();\n const dictionary = new Array<BlobCore>();\n builder.load(buffer, dictionary);\n assert(buffer.eof, 0x233 /* \"Unexpected data at the end of buffer\" */);\n return builder;\n }\n}\n\nexport function assertBlobCoreInstance(\n node: NodeTypes,\n message: string,\n): asserts node is BlobCore {\n if (node instanceof BlobCore) {\n return;\n }\n throwBufferParseException(node, \"BlobCore\", message);\n}\n\nexport function assertNodeCoreInstance(\n node: NodeTypes,\n message: string,\n): asserts node is NodeCore {\n if (node instanceof NodeCore) {\n return;\n }\n throwBufferParseException(node, \"NodeCore\", message);\n}\n\nexport function assertNumberInstance(\n node: NodeTypes,\n message: string,\n): asserts node is number {\n if (typeof node === \"number\") {\n return;\n }\n throwBufferParseException(node, \"Number\", message);\n}\n\nexport function assertBoolInstance(\n node: NodeTypes,\n message: string,\n): asserts node is boolean {\n if (typeof node === \"boolean\") {\n return;\n }\n throwBufferParseException(node, \"Boolean\", message);\n}\n\nfunction throwBufferParseException(\n node: NodeTypes,\n expectedNodeType: NodeType,\n message: string,\n): never {\n throw new NonRetryableError(\n `Buffer parsing exception: ${message}`,\n DriverErrorType.incorrectServerResponse,\n {\n nodeType: getNodeType(node),\n expectedNodeType,\n driverVersion,\n });\n}\n\nfunction getNodeType(value: NodeTypes): NodeType {\n if (typeof value === \"number\") {\n return \"Number\";\n } else if(value instanceof BlobCore) {\n return \"BlobCore\";\n } else if (value instanceof NodeCore) {\n return \"NodeCore\";\n } else if (typeof value === \"boolean\") {\n return \"Boolean\";\n }\n return \"UnknownType\";\n}\n\ntype NodeType = \"Number\" | \"BlobCore\" | \"NodeCore\" | \"Boolean\" | \"UnknownType\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/odsp-driver",
3
- "version": "0.57.1",
3
+ "version": "0.58.0-55561",
4
4
  "description": "Socket storage implementation for SPO and ODC",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": "https://github.com/microsoft/FluidFramework",
@@ -58,24 +58,24 @@
58
58
  "@fluidframework/common-definitions": "^0.20.1",
59
59
  "@fluidframework/common-utils": "^0.32.1",
60
60
  "@fluidframework/core-interfaces": "^0.42.0",
61
- "@fluidframework/driver-base": "^0.57.1",
62
- "@fluidframework/driver-definitions": "^0.44.0",
63
- "@fluidframework/driver-utils": "^0.57.1",
61
+ "@fluidframework/driver-base": "0.58.0-55561",
62
+ "@fluidframework/driver-definitions": "^0.45.0-0",
63
+ "@fluidframework/driver-utils": "0.58.0-55561",
64
64
  "@fluidframework/gitresources": "^0.1034.0",
65
- "@fluidframework/odsp-doclib-utils": "^0.57.1",
66
- "@fluidframework/odsp-driver-definitions": "^0.57.1",
65
+ "@fluidframework/odsp-doclib-utils": "0.58.0-55561",
66
+ "@fluidframework/odsp-driver-definitions": "0.58.0-55561",
67
67
  "@fluidframework/protocol-base": "^0.1034.0",
68
68
  "@fluidframework/protocol-definitions": "^0.1026.0",
69
- "@fluidframework/telemetry-utils": "^0.57.1",
69
+ "@fluidframework/telemetry-utils": "0.58.0-55561",
70
70
  "abort-controller": "^3.0.0",
71
71
  "node-fetch": "^2.6.1",
72
- "socket.io-client": "^2.4.0",
72
+ "socket.io-client": "^4.4.1",
73
73
  "uuid": "^8.3.1"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@fluidframework/build-common": "^0.23.0",
77
- "@fluidframework/eslint-config-fluid": "^0.26.0",
78
- "@fluidframework/mocha-test-setup": "^0.57.1",
77
+ "@fluidframework/eslint-config-fluid": "^0.26.0-0",
78
+ "@fluidframework/mocha-test-setup": "0.58.0-55561",
79
79
  "@microsoft/api-extractor": "^7.16.1",
80
80
  "@rushstack/eslint-config": "^2.5.1",
81
81
  "@types/mocha": "^8.2.2",
package/src/createFile.ts CHANGED
@@ -61,7 +61,7 @@ export async function createNewFluidFile(
61
61
  // Check for valid filename before the request to create file is actually made.
62
62
  if (isInvalidFileName(newFileInfo.filename)) {
63
63
  throw new NonRetryableError(
64
- "createNewInvalidFilename", "Invalid filename", OdspErrorType.invalidFileNameError, { driverVersion });
64
+ "Invalid filename for createNew", OdspErrorType.invalidFileNameError, { driverVersion });
65
65
  }
66
66
 
67
67
  let itemId: string;
@@ -154,8 +154,7 @@ export async function createNewEmptyFluidFile(
154
154
  const content = fetchResponse.content;
155
155
  if (!content || !content.id) {
156
156
  throw new NonRetryableError(
157
- "createEmptyFileNoItemId",
158
- "ODSP CreateFile call returned no item ID",
157
+ "ODSP CreateFile call returned no item ID (for empty file)",
159
158
  DriverErrorType.incorrectServerResponse,
160
159
  { driverVersion });
161
160
  }
@@ -215,7 +214,6 @@ export async function createNewFluidFileFromSummary(
215
214
  const content = fetchResponse.content;
216
215
  if (!content || !content.itemId) {
217
216
  throw new NonRetryableError(
218
- "createFileNoItemId",
219
217
  "ODSP CreateFile call returned no item ID",
220
218
  DriverErrorType.incorrectServerResponse,
221
219
  { driverVersion });
@@ -323,8 +323,6 @@ export class EpochTracker implements IPersistedFileCache {
323
323
  if (isFluidError(error) && error.errorType === DriverErrorType.fileOverwrittenInStorage) {
324
324
  const epochError = this.checkForEpochErrorCore(epochFromResponse);
325
325
  if (epochError !== undefined) {
326
- assert(isFluidError(epochError),
327
- 0x21f /* "epochError expected to be thrown by throwOdspNetworkError and of known type" */);
328
326
  epochError.addTelemetryProperties({
329
327
  fromCache,
330
328
  clientEpoch: this.fluidEpoch,
@@ -338,7 +336,10 @@ export class EpochTracker implements IPersistedFileCache {
338
336
  // If it was categorized as epoch error but the epoch returned in response matches with the client epoch
339
337
  // then it was coherency 409, so rethrow it as throttling error so that it can retried. Default throttling
340
338
  // time is 1s.
341
- throw new ThrottlingError("coherency409", error.message, 1, { [Odsp409Error]: true, driverVersion });
339
+ throw new ThrottlingError(
340
+ `Coherency 409: ${error.message}`,
341
+ 1 /* retryAfterSeconds */,
342
+ { [Odsp409Error]: true, driverVersion });
342
343
  }
343
344
  }
344
345
 
@@ -350,7 +351,7 @@ export class EpochTracker implements IPersistedFileCache {
350
351
  // This is similar in nature to how fluidEpochMismatchError (409) is handled.
351
352
  // Difference - client detected mismatch, instead of server detecting it.
352
353
  return new NonRetryableError(
353
- "epochMismatch", "Epoch mismatch", DriverErrorType.fileOverwrittenInStorage, { driverVersion });
354
+ "Epoch mismatch", DriverErrorType.fileOverwrittenInStorage, { driverVersion });
354
355
  }
355
356
  }
356
357
 
@@ -216,23 +216,33 @@ async function fetchLatestSnapshotCore(
216
216
  logger,
217
217
  perfEvent,
218
218
  async (event) => {
219
- const startTime = performance.now();
220
219
  const response = await snapshotDownloader(
221
220
  odspResolvedUrl,
222
221
  storageToken,
223
222
  snapshotOptions,
224
223
  controller,
225
224
  );
226
- const endTime = performance.now();
227
- const overallTime = endTime - startTime;
228
225
  const snapshot = response.odspSnapshotResponse.content;
229
- let dnstime: number | undefined; // domainLookupEnd - domainLookupStart
230
- let redirectTime: number | undefined; // redirectEnd -redirectStart
226
+ // From: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming
227
+ // fetchStart: immediately before the browser starts to fetch the resource.
228
+ // requestStart: immediately before the browser starts requesting the resource from the server
229
+ // responseStart: immediately after the browser receives the first byte of the response from the server.
230
+ // responseEnd: immediately after the browser receives the last byte of the resource
231
+ // or immediately before the transport connection is closed, whichever comes first.
232
+ // secureConnectionStart: immediately before the browser starts the handshake process to secure the
233
+ // current connection. If a secure connection is not used, this property returns zero.
234
+ // startTime: Time when the resource fetch started. This value is equivalent to fetchStart.
235
+ // domainLookupStart: immediately before the browser starts the domain name lookup for the resource.
236
+ // domainLookupEnd: immediately after the browser finishes the domain name lookup for the resource.
237
+ // redirectStart: start time of the fetch which that initiates the redirect.
238
+ // redirectEnd: immediately after receiving the last byte of the response of the last redirect.
239
+ let dnsLookupTime: number | undefined; // domainLookupEnd - domainLookupStart
240
+ let redirectTime: number | undefined; // redirectEnd - redirectStart
231
241
  let tcpHandshakeTime: number | undefined; // connectEnd - connectStart
232
- let secureConntime: number | undefined; // connectEnd - secureConnectionStart
233
- let responseTime: number | undefined; // responsEnd - responseStart
234
- let fetchStToRespEndTime: number | undefined; // responseEnd - fetchStart
235
- let reqStToRespEndTime: number | undefined; // responseEnd - requestStart
242
+ let secureConnectionTime: number | undefined; // connectEnd - secureConnectionStart
243
+ let responseNetworkTime: number | undefined; // responsEnd - responseStart
244
+ let fetchStartToResponseEndTime: number | undefined; // responseEnd - fetchStart
245
+ let reqStartToResponseEndTime: number | undefined; // responseEnd - requestStart
236
246
  let networkTime: number | undefined; // responseEnd - startTime
237
247
  const spReqDuration = response.odspSnapshotResponse.headers.get("sprequestduration");
238
248
 
@@ -246,17 +256,19 @@ async function fetchLatestSnapshotCore(
246
256
  if ((resource_initiatortype.localeCompare("fetch") === 0)
247
257
  && (resource_name.localeCompare(response.requestUrl) === 0)) {
248
258
  redirectTime = indResTime.redirectEnd - indResTime.redirectStart;
249
- dnstime = indResTime.domainLookupEnd - indResTime.domainLookupStart;
259
+ dnsLookupTime = indResTime.domainLookupEnd - indResTime.domainLookupStart;
250
260
  tcpHandshakeTime = indResTime.connectEnd - indResTime.connectStart;
251
- secureConntime = (indResTime.secureConnectionStart > 0) ?
252
- (indResTime.connectEnd - indResTime.secureConnectionStart) : 0;
253
- responseTime = indResTime.responseEnd - indResTime.responseStart;
254
- fetchStToRespEndTime = (indResTime.fetchStart > 0) ?
255
- (indResTime.responseEnd - indResTime.fetchStart) : 0;
256
- reqStToRespEndTime = (indResTime.requestStart > 0) ?
257
- (indResTime.responseEnd - indResTime.requestStart) : 0;
258
- networkTime = (indResTime.startTime > 0) ? (indResTime.responseEnd - indResTime.startTime) : 0;
259
- if (spReqDuration) {
261
+ secureConnectionTime = (indResTime.secureConnectionStart > 0) ?
262
+ (indResTime.connectEnd - indResTime.secureConnectionStart) : undefined;
263
+ responseNetworkTime = (indResTime.responseStart > 0) ?
264
+ (indResTime.responseEnd - indResTime.responseStart) : undefined;
265
+ fetchStartToResponseEndTime = (indResTime.fetchStart > 0) ?
266
+ (indResTime.responseEnd - indResTime.fetchStart) : undefined;
267
+ reqStartToResponseEndTime = (indResTime.requestStart > 0) ?
268
+ (indResTime.responseEnd - indResTime.requestStart) : undefined;
269
+ networkTime = (indResTime.startTime > 0) ?
270
+ (indResTime.responseEnd - indResTime.fetchStart) : undefined;
271
+ if (spReqDuration !== undefined && networkTime !== undefined) {
260
272
  networkTime = networkTime - parseInt(spReqDuration, 10);
261
273
  }
262
274
  break;
@@ -265,7 +277,6 @@ async function fetchLatestSnapshotCore(
265
277
 
266
278
  const { numTrees, numBlobs, encodedBlobsSize } =
267
279
  validateAndEvalBlobsAndTrees(response.odspSnapshotResponse.content);
268
- const clientTime = networkTime ? overallTime - networkTime : undefined;
269
280
 
270
281
  // There are some scenarios in ODSP where we cannot cache, trees/latest will explicitly tell us when we
271
282
  // cannot cache using an HTTP response header.
@@ -303,16 +314,23 @@ async function fetchLatestSnapshotCore(
303
314
  sequenceNumber,
304
315
  ops: snapshot.ops?.length ?? 0,
305
316
  headers: Object.keys(response.requestHeaders).length !== 0 ? true : undefined,
306
- redirecttime: redirectTime,
307
- dnsLookuptime: dnstime,
308
- responsenetworkTime: responseTime,
309
- tcphandshakeTime: tcpHandshakeTime,
310
- secureconnectiontime: secureConntime,
311
- fetchstarttorespendtime: fetchStToRespEndTime,
312
- reqstarttorespendtime: reqStToRespEndTime,
313
- overalltime: overallTime,
314
- networktime: networkTime,
315
- clienttime: clientTime,
317
+ // Interval between the first fetch until the last byte of the last redirect.
318
+ redirectTime,
319
+ // Interval between start and finish of the domain name lookup for the resource.
320
+ dnsLookupTime,
321
+ // Interval to receive all (first to last) bytes form the server.
322
+ responseNetworkTime,
323
+ // Time to establish the connection to the server to retrieve the resource.
324
+ tcpHandshakeTime,
325
+ // Time from the end of the connection until the inital handshake process to secure the connection.
326
+ secureConnectionTime,
327
+ // Interval between the initial fetch until the last byte is received.
328
+ fetchStartToResponseEndTime,
329
+ // Interval between starting the request for the resource until receiving the last byte.
330
+ reqStartToResponseEndTime,
331
+ // Interval between starting the request for the resource until receiving the last byte but
332
+ // excluding the Snaphot request duration indicated on the snapshot response header.
333
+ networkTime,
316
334
  // Sharing link telemetry regarding sharing link redeem status and performance. Ex: FRL; dur=100,
317
335
  // Azure Fluid Relay service; desc=S, FRP; desc=False. Here, FRL is the duration taken for redeem,
318
336
  // Azure Fluid Relay service is the redeem status (S means success), and FRP is a flag to indicate
@@ -360,7 +378,14 @@ async function fetchSnapshotContentsCoreV1(
360
378
  ): Promise<ISnapshotRequestAndResponseOptions> {
361
379
  const snapshotUrl = odspResolvedUrl.endpoints.snapshotStorageUrl;
362
380
  const url = `${snapshotUrl}/trees/latest?ump=1`;
363
- const { body, headers } = getFormBodyAndHeaders(odspResolvedUrl, storageToken, snapshotOptions);
381
+ // The location of file can move on Spo in which case server returns 308(Permanent Redirect) error.
382
+ // Adding below header will make VROOM API return 404 instead of 308 and browser can intercept it.
383
+ // This error thrown by server will contain the new redirect location. Look at the 404 error parsing
384
+ // for futher reference here: \packages\utils\odsp-doclib-utils\src\odspErrorUtils.ts
385
+ const header = {"prefer": "manualredirect"};
386
+ const { body, headers } = getFormBodyAndHeaders(
387
+ odspResolvedUrl, storageToken, snapshotOptions, header);
388
+ headers.accept = "application/json";
364
389
  const fetchOptions = {
365
390
  body,
366
391
  headers,
@@ -422,6 +447,7 @@ function getFormBodyAndHeaders(
422
447
  odspResolvedUrl: IOdspResolvedUrl,
423
448
  storageToken: string,
424
449
  snapshotOptions: ISnapshotOptions | undefined,
450
+ headers?: {[index: string]: string},
425
451
  ) {
426
452
  const formBoundary = uuid();
427
453
  const formParams: string[] = [];
@@ -435,16 +461,23 @@ function getFormBodyAndHeaders(
435
461
  }
436
462
  });
437
463
  }
464
+ if (headers !== undefined) {
465
+ Object.entries(headers).forEach(([key, value]) => {
466
+ if (value !== undefined) {
467
+ formParams.push(`${key}: ${value}`);
468
+ }
469
+ });
470
+ }
438
471
  if (odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem) {
439
472
  formParams.push(`sl: ${odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem}`);
440
473
  }
441
474
  formParams.push(`_post: 1`);
442
475
  formParams.push(`\r\n--${formBoundary}--`);
443
476
  const postBody = formParams.join("\r\n");
444
- const headers: {[index: string]: any} = {
477
+ const header: {[index: string]: any} = {
445
478
  "Content-Type": `multipart/form-data;boundary=${formBoundary}`,
446
479
  };
447
- return { body: postBody, headers };
480
+ return { body: postBody, headers: header };
448
481
  }
449
482
 
450
483
  function validateAndEvalBlobsAndTrees(snapshot: ISnapshotContents) {
@@ -125,7 +125,6 @@ async function getFileLinkCore(
125
125
  if (typeof directUrl !== "string") {
126
126
  // This will retry once in getWithRetryForTokenRefresh
127
127
  throw new NonRetryableError(
128
- "getFileLinkCoreMalformedResponse",
129
128
  "Malformed GetSharingInformation response",
130
129
  DriverErrorType.incorrectServerResponse,
131
130
  { driverVersion });
@@ -182,7 +181,6 @@ async function getFileItemLite(
182
181
  if (!isFileItemLite(responseJson)) {
183
182
  // This will retry once in getWithRetryForTokenRefresh
184
183
  throw new NonRetryableError(
185
- "getFileItemLiteMalformedResponse",
186
184
  "Malformed getFileItemLite response",
187
185
  DriverErrorType.incorrectServerResponse,
188
186
  { driverVersion });
@@ -425,7 +425,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
425
425
  this.pushCallCounter++;
426
426
  const nonce = `${this.requestOpsNoncePrefix}${this.pushCallCounter}`;
427
427
  // There should be only one flush ops in flight, kicked out by upload summary workflow
428
- // That said, it could timeout, and request could be repeated, so theoretically we can
428
+ // That said, it could timeout and request could be repeated, so theoretically we can
429
429
  // get overlapping requests, but it should be very rare
430
430
  if (this.flushDeferred !== undefined) {
431
431
  this.logger.sendErrorEvent({ eventName: "FlushOpsTooMany" });
@@ -268,7 +268,6 @@ export class OdspDocumentService implements IDocumentService {
268
268
  const finalWebsocketToken = websocketToken ?? (websocketEndpoint.socketToken || null);
269
269
  if (finalWebsocketToken === null) {
270
270
  throw new NonRetryableError(
271
- "pushTokenIsNull",
272
271
  "Websocket token is null",
273
272
  OdspErrorType.fetchTokenError,
274
273
  { driverVersion });
@@ -529,15 +529,13 @@ export class OdspDocumentStorageService implements IDocumentStorageService {
529
529
  const versionsResponse = response.content;
530
530
  if (!versionsResponse) {
531
531
  throw new NonRetryableError(
532
- "getVersionsReturnedNoResponse",
533
532
  "No response from /versions endpoint",
534
533
  DriverErrorType.genericNetworkError,
535
534
  { driverVersion });
536
535
  }
537
536
  if (!Array.isArray(versionsResponse.value)) {
538
537
  throw new NonRetryableError(
539
- "getVersionsReturnedNonArrayResponse",
540
- "Incorrect response from /versions endpoint",
538
+ "Incorrect response from /versions endpoint, expected an array",
541
539
  DriverErrorType.genericNetworkError,
542
540
  { driverVersion });
543
541
  }
@@ -714,7 +712,6 @@ export class OdspDocumentStorageService implements IDocumentStorageService {
714
712
  private checkSnapshotUrl() {
715
713
  if (!this.snapshotUrl) {
716
714
  throw new NonRetryableError(
717
- "noSnapshotUrlProvided",
718
715
  "Method failed because no snapshot url was available",
719
716
  DriverErrorType.genericError,
720
717
  { driverVersion });
@@ -724,7 +721,6 @@ export class OdspDocumentStorageService implements IDocumentStorageService {
724
721
  private checkAttachmentPOSTUrl() {
725
722
  if (!this.attachmentPOSTUrl) {
726
723
  throw new NonRetryableError(
727
- "noAttachmentPOSTUrlProvided",
728
724
  "Method failed because no attachment POST url was available",
729
725
  DriverErrorType.genericError,
730
726
  { driverVersion });
@@ -734,7 +730,6 @@ export class OdspDocumentStorageService implements IDocumentStorageService {
734
730
  private checkAttachmentGETUrl() {
735
731
  if (!this.attachmentGETUrl) {
736
732
  throw new NonRetryableError(
737
- "noAttachmentGETUrlWasProvided",
738
733
  "Method failed because no attachment GET url was available",
739
734
  DriverErrorType.genericError,
740
735
  { driverVersion });
@@ -5,7 +5,12 @@
5
5
 
6
6
  import { assert } from "@fluidframework/common-utils";
7
7
  import { IFluidCodeDetails, IRequest, isFluidPackage } from "@fluidframework/core-interfaces";
8
- import { DriverHeader, IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
8
+ import {
9
+ DriverHeader,
10
+ IContainerPackageInfo,
11
+ IResolvedUrl,
12
+ IUrlResolver,
13
+ } from "@fluidframework/driver-definitions";
9
14
  import { IOdspResolvedUrl, ShareLinkTypes, ShareLinkInfoType } from "@fluidframework/odsp-driver-definitions";
10
15
  import { createOdspUrl } from "./createOdspUrl";
11
16
  import { getApiRoot } from "./odspUrlHelper";
@@ -151,16 +156,24 @@ export class OdspDriverUrlResolver implements IUrlResolver {
151
156
  public async getAbsoluteUrl(
152
157
  resolvedUrl: IResolvedUrl,
153
158
  relativeUrl: string,
154
- codeDetails?: IFluidCodeDetails,
159
+ packageInfoSource?: IContainerPackageInfo | IFluidCodeDetails,
155
160
  ): Promise<string> {
156
161
  let dataStorePath = relativeUrl;
157
162
  if (dataStorePath.startsWith("/")) {
158
163
  dataStorePath = dataStorePath.substr(1);
159
164
  }
160
165
  const odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);
161
- const containerPackageName =
162
- isFluidPackage(codeDetails?.package) ? codeDetails?.package.name : codeDetails?.package ??
163
- odspResolvedUrl.codeHint?.containerPackageName;
166
+
167
+ // back-compat: IFluidCodeDetails usage to be removed in 0.58.0
168
+ let containerPackageName;
169
+ if (packageInfoSource && "name" in packageInfoSource) {
170
+ containerPackageName = packageInfoSource.name
171
+ } else if (isFluidPackage(packageInfoSource?.package)) {
172
+ containerPackageName = packageInfoSource?.package.name
173
+ } else {
174
+ containerPackageName = packageInfoSource?.package
175
+ }
176
+ containerPackageName = containerPackageName ?? odspResolvedUrl.codeHint?.containerPackageName
164
177
 
165
178
  return createOdspUrl({
166
179
  ... odspResolvedUrl,
@@ -5,7 +5,11 @@
5
5
 
6
6
  import { PromiseCache } from "@fluidframework/common-utils";
7
7
  import { IFluidCodeDetails, IRequest, isFluidPackage } from "@fluidframework/core-interfaces";
8
- import { IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
8
+ import {
9
+ IContainerPackageInfo,
10
+ IResolvedUrl,
11
+ IUrlResolver,
12
+ } from "@fluidframework/driver-definitions";
9
13
  import { ITelemetryBaseLogger, ITelemetryLogger } from "@fluidframework/common-definitions";
10
14
  import { NonRetryableError } from "@fluidframework/driver-utils";
11
15
  import { PerformanceEvent } from "@fluidframework/telemetry-utils";
@@ -164,8 +168,7 @@ export class OdspDriverUrlResolverForShareLink implements IUrlResolver {
164
168
  async (event) => tokenFetcher(options).then((tokenResponse) => {
165
169
  if (tokenResponse === null) {
166
170
  throw new NonRetryableError(
167
- "shareLinkTokenIsNull",
168
- "Token callback returned null",
171
+ "Token callback returned null for share link",
169
172
  OdspErrorType.fetchTokenError,
170
173
  { driverVersion });
171
174
  }
@@ -214,17 +217,22 @@ export class OdspDriverUrlResolverForShareLink implements IUrlResolver {
214
217
  public async getAbsoluteUrl(
215
218
  resolvedUrl: IResolvedUrl,
216
219
  dataStorePath: string,
217
- codeDetails?: IFluidCodeDetails,
220
+ packageInfoSource?: IContainerPackageInfo | IFluidCodeDetails,
218
221
  ): Promise<string> {
219
222
  const odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);
220
-
221
223
  const shareLink = await this.getShareLinkPromise(odspResolvedUrl);
222
-
223
224
  const shareLinkUrl = new URL(shareLink);
224
225
 
225
- const containerPackageName =
226
- isFluidPackage(codeDetails?.package) ? codeDetails?.package.name : codeDetails?.package ??
227
- odspResolvedUrl.codeHint?.containerPackageName;
226
+ // back-compat: IFluidCodeDetails usage to be removed in 0.58.0
227
+ let containerPackageName;
228
+ if (packageInfoSource && "name" in packageInfoSource) {
229
+ containerPackageName = packageInfoSource.name
230
+ } else if (isFluidPackage(packageInfoSource?.package)) {
231
+ containerPackageName = packageInfoSource?.package.name
232
+ } else {
233
+ containerPackageName = packageInfoSource?.package
234
+ }
235
+ containerPackageName = containerPackageName ?? odspResolvedUrl.codeHint?.containerPackageName
228
236
 
229
237
  storeLocatorInOdspUrl(shareLinkUrl, {
230
238
  siteUrl: odspResolvedUrl.siteUrl,
package/src/odspError.ts CHANGED
@@ -10,9 +10,8 @@ import { IOdspSocketError } from "./contracts";
10
10
  * Returns network error based on error object from ODSP socket (IOdspSocketError)
11
11
  */
12
12
  export function errorObjectFromSocketError(socketError: IOdspSocketError, handler: string) {
13
- const message = `OdspSocketError (${handler}): ${socketError.message}`;
13
+ const message = `ODSP socket error (${handler}): ${socketError.message}`;
14
14
  const error = createOdspNetworkError(
15
- `odspSocketError [${handler}]`,
16
15
  message,
17
16
  socketError.code,
18
17
  socketError.retryAfter);