@fluidframework/driver-utils 2.0.0-internal.7.3.0 → 2.0.0-internal.7.4.0

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 (148) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-extractor-lint.json +13 -0
  3. package/api-extractor.json +9 -1
  4. package/api-report/driver-utils.api.md +47 -47
  5. package/dist/adapters/compression/compressionTypes.d.ts +2 -2
  6. package/dist/adapters/compression/compressionTypes.js +1 -1
  7. package/dist/adapters/compression/compressionTypes.js.map +1 -1
  8. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +1 -1
  9. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +1 -1
  10. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
  11. package/dist/adapters/predefinedAdapters.d.ts +1 -1
  12. package/dist/adapters/predefinedAdapters.js +1 -1
  13. package/dist/adapters/predefinedAdapters.js.map +1 -1
  14. package/dist/blob.d.ts +3 -3
  15. package/dist/blob.js +3 -3
  16. package/dist/blob.js.map +1 -1
  17. package/dist/buildSnapshotTree.d.ts +1 -1
  18. package/dist/buildSnapshotTree.js +1 -1
  19. package/dist/buildSnapshotTree.js.map +1 -1
  20. package/dist/documentStorageServiceProxy.d.ts +1 -1
  21. package/dist/documentStorageServiceProxy.js +1 -1
  22. package/dist/documentStorageServiceProxy.js.map +1 -1
  23. package/dist/driver-utils-alpha.d.ts +169 -0
  24. package/dist/driver-utils-beta.d.ts +176 -0
  25. package/dist/driver-utils-public.d.ts +176 -0
  26. package/dist/driver-utils-untrimmed.d.ts +590 -0
  27. package/dist/error.d.ts +1 -1
  28. package/dist/error.js +1 -1
  29. package/dist/error.js.map +1 -1
  30. package/dist/insecureUrlResolver.d.ts +1 -1
  31. package/dist/insecureUrlResolver.js +1 -1
  32. package/dist/insecureUrlResolver.js.map +1 -1
  33. package/dist/messageRecognition.d.ts +3 -3
  34. package/dist/messageRecognition.js +3 -3
  35. package/dist/messageRecognition.js.map +1 -1
  36. package/dist/network.d.ts +19 -19
  37. package/dist/network.d.ts.map +1 -1
  38. package/dist/network.js +18 -18
  39. package/dist/network.js.map +1 -1
  40. package/dist/networkUtils.d.ts +1 -1
  41. package/dist/networkUtils.js +1 -1
  42. package/dist/networkUtils.js.map +1 -1
  43. package/dist/packageVersion.d.ts +1 -1
  44. package/dist/packageVersion.js +1 -1
  45. package/dist/packageVersion.js.map +1 -1
  46. package/dist/parallelRequests.d.ts +6 -6
  47. package/dist/parallelRequests.js +6 -6
  48. package/dist/parallelRequests.js.map +1 -1
  49. package/dist/prefetchDocumentStorageService.d.ts +1 -1
  50. package/dist/prefetchDocumentStorageService.js +1 -1
  51. package/dist/prefetchDocumentStorageService.js.map +1 -1
  52. package/dist/rateLimiter.d.ts +1 -1
  53. package/dist/rateLimiter.js +1 -1
  54. package/dist/rateLimiter.js.map +1 -1
  55. package/dist/readAndParse.d.ts +1 -1
  56. package/dist/readAndParse.js +1 -1
  57. package/dist/readAndParse.js.map +1 -1
  58. package/dist/runWithRetry.d.ts +3 -3
  59. package/dist/runWithRetry.js +2 -2
  60. package/dist/runWithRetry.js.map +1 -1
  61. package/dist/summaryForCreateNew.d.ts +2 -2
  62. package/dist/summaryForCreateNew.js +2 -2
  63. package/dist/summaryForCreateNew.js.map +1 -1
  64. package/dist/treeConversions.d.ts +1 -1
  65. package/dist/treeConversions.js +1 -1
  66. package/dist/treeConversions.js.map +1 -1
  67. package/lib/adapters/compression/compressionTypes.d.ts +2 -2
  68. package/lib/adapters/compression/compressionTypes.js +1 -1
  69. package/lib/adapters/compression/compressionTypes.js.map +1 -1
  70. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +1 -1
  71. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +1 -1
  72. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
  73. package/lib/adapters/predefinedAdapters.d.ts +1 -1
  74. package/lib/adapters/predefinedAdapters.js +1 -1
  75. package/lib/adapters/predefinedAdapters.js.map +1 -1
  76. package/lib/blob.d.ts +3 -3
  77. package/lib/blob.js +3 -3
  78. package/lib/blob.js.map +1 -1
  79. package/lib/buildSnapshotTree.d.ts +1 -1
  80. package/lib/buildSnapshotTree.js +1 -1
  81. package/lib/buildSnapshotTree.js.map +1 -1
  82. package/lib/documentStorageServiceProxy.d.ts +1 -1
  83. package/lib/documentStorageServiceProxy.js +1 -1
  84. package/lib/documentStorageServiceProxy.js.map +1 -1
  85. package/lib/driver-utils-alpha.d.ts +169 -0
  86. package/lib/driver-utils-beta.d.ts +176 -0
  87. package/lib/driver-utils-public.d.ts +176 -0
  88. package/lib/driver-utils-untrimmed.d.ts +590 -0
  89. package/lib/error.d.ts +1 -1
  90. package/lib/error.js +1 -1
  91. package/lib/error.js.map +1 -1
  92. package/lib/insecureUrlResolver.d.ts +1 -1
  93. package/lib/insecureUrlResolver.js +1 -1
  94. package/lib/insecureUrlResolver.js.map +1 -1
  95. package/lib/messageRecognition.d.ts +3 -3
  96. package/lib/messageRecognition.js +3 -3
  97. package/lib/messageRecognition.js.map +1 -1
  98. package/lib/network.d.ts +19 -19
  99. package/lib/network.d.ts.map +1 -1
  100. package/lib/network.js +18 -18
  101. package/lib/network.js.map +1 -1
  102. package/lib/networkUtils.d.ts +1 -1
  103. package/lib/networkUtils.js +1 -1
  104. package/lib/networkUtils.js.map +1 -1
  105. package/lib/packageVersion.d.ts +1 -1
  106. package/lib/packageVersion.js +1 -1
  107. package/lib/packageVersion.js.map +1 -1
  108. package/lib/parallelRequests.d.ts +6 -6
  109. package/lib/parallelRequests.js +6 -6
  110. package/lib/parallelRequests.js.map +1 -1
  111. package/lib/prefetchDocumentStorageService.d.ts +1 -1
  112. package/lib/prefetchDocumentStorageService.js +1 -1
  113. package/lib/prefetchDocumentStorageService.js.map +1 -1
  114. package/lib/rateLimiter.d.ts +1 -1
  115. package/lib/rateLimiter.js +1 -1
  116. package/lib/rateLimiter.js.map +1 -1
  117. package/lib/readAndParse.d.ts +1 -1
  118. package/lib/readAndParse.js +1 -1
  119. package/lib/readAndParse.js.map +1 -1
  120. package/lib/runWithRetry.d.ts +3 -3
  121. package/lib/runWithRetry.js +2 -2
  122. package/lib/runWithRetry.js.map +1 -1
  123. package/lib/summaryForCreateNew.d.ts +2 -2
  124. package/lib/summaryForCreateNew.js +2 -2
  125. package/lib/summaryForCreateNew.js.map +1 -1
  126. package/lib/treeConversions.d.ts +1 -1
  127. package/lib/treeConversions.js +1 -1
  128. package/lib/treeConversions.js.map +1 -1
  129. package/package.json +31 -12
  130. package/src/adapters/compression/compressionTypes.ts +2 -2
  131. package/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts +1 -1
  132. package/src/adapters/predefinedAdapters.ts +1 -1
  133. package/src/blob.ts +3 -3
  134. package/src/buildSnapshotTree.ts +1 -1
  135. package/src/documentStorageServiceProxy.ts +1 -1
  136. package/src/error.ts +1 -1
  137. package/src/insecureUrlResolver.ts +1 -1
  138. package/src/messageRecognition.ts +3 -3
  139. package/src/network.ts +19 -19
  140. package/src/networkUtils.ts +1 -1
  141. package/src/packageVersion.ts +1 -1
  142. package/src/parallelRequests.ts +6 -6
  143. package/src/prefetchDocumentStorageService.ts +1 -1
  144. package/src/rateLimiter.ts +1 -1
  145. package/src/readAndParse.ts +1 -1
  146. package/src/runWithRetry.ts +3 -3
  147. package/src/summaryForCreateNew.ts +2 -2
  148. package/src/treeConversions.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"insecureUrlResolver.js","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEp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E,OAAO;YACb,GAAG,EAAE,WAAW;SAChB,CAAC;QACF,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,WAAyB,EAAE,WAAmB;QACzE,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,CAAC,EAAE,AAAD,EAAG,UAAU,CAAC,GAAG,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9D,yEAAyE;QACzE,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAExE,IAAI,GAAG,GAAG,WAAW,CAAC;QACtB,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACxB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACpB;QAED,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAChF,UAAU,CACV,IAAI,GAAG,EAAE,CAAC;IACZ,CAAC;IAEM,sBAAsB,CAAC,QAAiB;QAC9C,MAAM,gBAAgB,GAAa;YAClC,yEAAyE;YACzE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,aAAa,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;YACrE,OAAO,EAAE;gBACR,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,IAAI;aAC9B;SACD,CAAC;QACF,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { parse } from \"url\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { IResolvedUrl, IUrlResolver, DriverHeader } from \"@fluidframework/driver-definitions\";\nimport Axios from \"axios\";\n\n/**\n * As the name implies this is not secure and should not be used in production. It simply makes the example easier\n * to get up and running.\n *\n * In our example we run a simple web server via webpack-dev-server. This defines a URL format of the form\n * http://localhost:8080/<documentId>/<path>.\n *\n * We then need to map that to a Fluid based URL. These are of the form\n * fluid://orderingUrl/<tenantId>/<documentId>/<path>.\n *\n * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional\n * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service\n * works or a router inside of a single page app framework.\n * @public\n */\nexport class InsecureUrlResolver implements IUrlResolver {\n\tprivate readonly cache = new Map<string, Promise<IResolvedUrl>>();\n\n\tconstructor(\n\t\tprivate readonly hostUrl: string,\n\t\tprivate readonly ordererUrl: string,\n\t\tprivate readonly storageUrl: string,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly bearer: string,\n\t\tprivate readonly isForNodeTest: boolean = false,\n\t) {}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (request.headers?.[DriverHeader.createNew]) {\n\t\t\tconst [, queryString] = request.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst fileName = searchParams.get(\"fileName\");\n\t\t\treturn this.resolveHelper(fileName);\n\t\t}\n\t\tconst parsedUrl = new URL(request.url);\n\t\t// If hosts match then we use the local tenant information. Otherwise we make a REST call out to the hosting\n\t\t// service using our bearer token.\n\t\tif (this.isForNodeTest) {\n\t\t\tconst [, documentId, tmpRelativePath] = parsedUrl.pathname.substr(1).split(\"/\");\n\t\t\tconst relativePath = tmpRelativePath ?? \"\";\n\t\t\treturn this.resolveHelper(documentId, relativePath, parsedUrl.search);\n\t\t} else if (parsedUrl.host === window.location.host) {\n\t\t\tconst fullPath = parsedUrl.pathname.substr(1);\n\t\t\tconst documentId = fullPath.split(\"/\")[0];\n\t\t\tconst documentRelativePath = fullPath.slice(documentId.length);\n\t\t\treturn this.resolveHelper(documentId, documentRelativePath);\n\t\t} else {\n\t\t\tconst maybeResolvedUrl = this.cache.get(request.url);\n\t\t\tif (maybeResolvedUrl) {\n\t\t\t\treturn maybeResolvedUrl;\n\t\t\t}\n\n\t\t\tconst headers = {\n\t\t\t\tAuthorization: `Bearer ${this.bearer}`,\n\t\t\t};\n\t\t\tconst resolvedP = Axios.post<IResolvedUrl>(\n\t\t\t\t`${this.hostUrl}/api/v1/load`,\n\t\t\t\t{\n\t\t\t\t\turl: request.url,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theaders,\n\t\t\t\t},\n\t\t\t);\n\t\t\tthis.cache.set(\n\t\t\t\trequest.url,\n\t\t\t\tresolvedP.then((resolved) => resolved.data),\n\t\t\t);\n\n\t\t\treturn this.cache.get(request.url);\n\t\t}\n\t}\n\n\tprivate resolveHelper(\n\t\tdocumentId: string | null,\n\t\tdocumentRelativePath: string = \"\",\n\t\tqueryParams: string = \"\",\n\t) {\n\t\tconst encodedTenantId = encodeURIComponent(this.tenantId);\n\t\tconst host = new URL(this.ordererUrl).host;\n\t\t// when the document ID is not provided we need to resolve a special create new document URL.\n\t\t// the actual container ID will be generated by the driver.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (!documentId) {\n\t\t\tconst createNewResponse: IResolvedUrl = {\n\t\t\t\tendpoints: {\n\t\t\t\t\tdeltaStorageUrl: `${this.ordererUrl}/deltas/${encodedTenantId}/new`,\n\t\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\t\tstorageUrl: `${this.storageUrl}/repos/${encodedTenantId}`,\n\t\t\t\t},\n\t\t\t\t// document ID is ignored by the driver for new container requests\n\t\t\t\tid: \"\",\n\t\t\t\ttokens: {},\n\t\t\t\ttype: \"fluid\",\n\t\t\t\turl: `fluid://${host}/${encodedTenantId}/new`,\n\t\t\t};\n\t\t\treturn createNewResponse;\n\t\t}\n\t\tconst encodedDocId = encodeURIComponent(documentId);\n\t\tconst relativePath =\n\t\t\t!documentRelativePath || documentRelativePath.startsWith(\"/\")\n\t\t\t\t? documentRelativePath\n\t\t\t\t: `/${documentRelativePath}`;\n\t\tconst documentUrl = `fluid://${host}/${encodedTenantId}/${encodedDocId}${relativePath}${queryParams}`;\n\n\t\tconst deltaStorageUrl = `${this.ordererUrl}/deltas/${encodedTenantId}/${encodedDocId}`;\n\t\tconst storageUrl = `${this.storageUrl}/repos/${encodedTenantId}`;\n\n\t\tconst response: IResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\tstorageUrl,\n\t\t\t},\n\t\t\tid: documentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t\treturn response;\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tconst parsedUrl = parse(resolvedUrl.url);\n\t\tconst [, , documentId] = parsedUrl.pathname?.split(\"/\") ?? [];\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tassert(!!documentId, 0x273 /* \"Invalid document id from parsed URL\" */);\n\n\t\tlet url = relativeUrl;\n\t\tif (url.startsWith(\"/\")) {\n\t\t\turl = url.substr(1);\n\t\t}\n\n\t\treturn `${this.hostUrl}/${encodeURIComponent(this.tenantId)}/${encodeURIComponent(\n\t\t\tdocumentId,\n\t\t)}/${url}`;\n\t}\n\n\tpublic createCreateNewRequest(fileName?: string): IRequest {\n\t\tconst createNewRequest: IRequest = {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\turl: fileName ? `${this.hostUrl}?fileName=${fileName}` : this.hostUrl,\n\t\t\theaders: {\n\t\t\t\t[DriverHeader.createNew]: true,\n\t\t\t},\n\t\t};\n\t\treturn createNewRequest;\n\t}\n}\n"]}
1
+ {"version":3,"file":"insecureUrlResolver.js","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corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { parse } from \"url\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { IResolvedUrl, IUrlResolver, DriverHeader } from \"@fluidframework/driver-definitions\";\nimport Axios from \"axios\";\n\n/**\n * As the name implies this is not secure and should not be used in production. It simply makes the example easier\n * to get up and running.\n *\n * In our example we run a simple web server via webpack-dev-server. This defines a URL format of the form\n * http://localhost:8080/<documentId>/<path>.\n *\n * We then need to map that to a Fluid based URL. These are of the form\n * fluid://orderingUrl/<tenantId>/<documentId>/<path>.\n *\n * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional\n * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service\n * works or a router inside of a single page app framework.\n * @internal\n */\nexport class InsecureUrlResolver implements IUrlResolver {\n\tprivate readonly cache = new Map<string, Promise<IResolvedUrl>>();\n\n\tconstructor(\n\t\tprivate readonly hostUrl: string,\n\t\tprivate readonly ordererUrl: string,\n\t\tprivate readonly storageUrl: string,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly bearer: string,\n\t\tprivate readonly isForNodeTest: boolean = false,\n\t) {}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (request.headers?.[DriverHeader.createNew]) {\n\t\t\tconst [, queryString] = request.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst fileName = searchParams.get(\"fileName\");\n\t\t\treturn this.resolveHelper(fileName);\n\t\t}\n\t\tconst parsedUrl = new URL(request.url);\n\t\t// If hosts match then we use the local tenant information. Otherwise we make a REST call out to the hosting\n\t\t// service using our bearer token.\n\t\tif (this.isForNodeTest) {\n\t\t\tconst [, documentId, tmpRelativePath] = parsedUrl.pathname.substr(1).split(\"/\");\n\t\t\tconst relativePath = tmpRelativePath ?? \"\";\n\t\t\treturn this.resolveHelper(documentId, relativePath, parsedUrl.search);\n\t\t} else if (parsedUrl.host === window.location.host) {\n\t\t\tconst fullPath = parsedUrl.pathname.substr(1);\n\t\t\tconst documentId = fullPath.split(\"/\")[0];\n\t\t\tconst documentRelativePath = fullPath.slice(documentId.length);\n\t\t\treturn this.resolveHelper(documentId, documentRelativePath);\n\t\t} else {\n\t\t\tconst maybeResolvedUrl = this.cache.get(request.url);\n\t\t\tif (maybeResolvedUrl) {\n\t\t\t\treturn maybeResolvedUrl;\n\t\t\t}\n\n\t\t\tconst headers = {\n\t\t\t\tAuthorization: `Bearer ${this.bearer}`,\n\t\t\t};\n\t\t\tconst resolvedP = Axios.post<IResolvedUrl>(\n\t\t\t\t`${this.hostUrl}/api/v1/load`,\n\t\t\t\t{\n\t\t\t\t\turl: request.url,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theaders,\n\t\t\t\t},\n\t\t\t);\n\t\t\tthis.cache.set(\n\t\t\t\trequest.url,\n\t\t\t\tresolvedP.then((resolved) => resolved.data),\n\t\t\t);\n\n\t\t\treturn this.cache.get(request.url);\n\t\t}\n\t}\n\n\tprivate resolveHelper(\n\t\tdocumentId: string | null,\n\t\tdocumentRelativePath: string = \"\",\n\t\tqueryParams: string = \"\",\n\t) {\n\t\tconst encodedTenantId = encodeURIComponent(this.tenantId);\n\t\tconst host = new URL(this.ordererUrl).host;\n\t\t// when the document ID is not provided we need to resolve a special create new document URL.\n\t\t// the actual container ID will be generated by the driver.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (!documentId) {\n\t\t\tconst createNewResponse: IResolvedUrl = {\n\t\t\t\tendpoints: {\n\t\t\t\t\tdeltaStorageUrl: `${this.ordererUrl}/deltas/${encodedTenantId}/new`,\n\t\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\t\tstorageUrl: `${this.storageUrl}/repos/${encodedTenantId}`,\n\t\t\t\t},\n\t\t\t\t// document ID is ignored by the driver for new container requests\n\t\t\t\tid: \"\",\n\t\t\t\ttokens: {},\n\t\t\t\ttype: \"fluid\",\n\t\t\t\turl: `fluid://${host}/${encodedTenantId}/new`,\n\t\t\t};\n\t\t\treturn createNewResponse;\n\t\t}\n\t\tconst encodedDocId = encodeURIComponent(documentId);\n\t\tconst relativePath =\n\t\t\t!documentRelativePath || documentRelativePath.startsWith(\"/\")\n\t\t\t\t? documentRelativePath\n\t\t\t\t: `/${documentRelativePath}`;\n\t\tconst documentUrl = `fluid://${host}/${encodedTenantId}/${encodedDocId}${relativePath}${queryParams}`;\n\n\t\tconst deltaStorageUrl = `${this.ordererUrl}/deltas/${encodedTenantId}/${encodedDocId}`;\n\t\tconst storageUrl = `${this.storageUrl}/repos/${encodedTenantId}`;\n\n\t\tconst response: IResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\tstorageUrl,\n\t\t\t},\n\t\t\tid: documentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t\treturn response;\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tconst parsedUrl = parse(resolvedUrl.url);\n\t\tconst [, , documentId] = parsedUrl.pathname?.split(\"/\") ?? [];\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tassert(!!documentId, 0x273 /* \"Invalid document id from parsed URL\" */);\n\n\t\tlet url = relativeUrl;\n\t\tif (url.startsWith(\"/\")) {\n\t\t\turl = url.substr(1);\n\t\t}\n\n\t\treturn `${this.hostUrl}/${encodeURIComponent(this.tenantId)}/${encodeURIComponent(\n\t\t\tdocumentId,\n\t\t)}/${url}`;\n\t}\n\n\tpublic createCreateNewRequest(fileName?: string): IRequest {\n\t\tconst createNewRequest: IRequest = {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\turl: fileName ? `${this.hostUrl}?fileName=${fileName}` : this.hostUrl,\n\t\t\theaders: {\n\t\t\t\t[DriverHeader.createNew]: true,\n\t\t\t},\n\t\t};\n\t\treturn createNewRequest;\n\t}\n}\n"]}
@@ -7,7 +7,7 @@ import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/pro
7
7
  * Tells if message was sent by container runtime
8
8
  * @privateRemarks ADO #1385: To be moved to container-definitions
9
9
  * @returns whether the message is a runtime message
10
- * @public
10
+ * @internal
11
11
  */
12
12
  export declare function isRuntimeMessage(message: {
13
13
  type: string;
@@ -15,14 +15,14 @@ export declare function isRuntimeMessage(message: {
15
15
  /**
16
16
  * @privateRemarks ADO #1385: staging code changes across layers.
17
17
  * Eventually to be replaced by MessageType.accept
18
- * @public
18
+ * @internal
19
19
  */
20
20
  export declare enum MessageType2 {
21
21
  Accept = "accept"
22
22
  }
23
23
  /**
24
24
  * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
25
- * @public
25
+ * @internal
26
26
  */
27
27
  export declare function canBeCoalescedByService(message: ISequencedDocumentMessage | IDocumentMessage): boolean;
28
28
  //# sourceMappingURL=messageRecognition.d.ts.map
@@ -7,7 +7,7 @@ import { MessageType, } from "@fluidframework/protocol-definitions";
7
7
  * Tells if message was sent by container runtime
8
8
  * @privateRemarks ADO #1385: To be moved to container-definitions
9
9
  * @returns whether the message is a runtime message
10
- * @public
10
+ * @internal
11
11
  */
12
12
  export function isRuntimeMessage(message) {
13
13
  return message.type === MessageType.Operation;
@@ -15,7 +15,7 @@ export function isRuntimeMessage(message) {
15
15
  /**
16
16
  * @privateRemarks ADO #1385: staging code changes across layers.
17
17
  * Eventually to be replaced by MessageType.accept
18
- * @public
18
+ * @internal
19
19
  */
20
20
  export var MessageType2;
21
21
  (function (MessageType2) {
@@ -23,7 +23,7 @@ export var MessageType2;
23
23
  })(MessageType2 || (MessageType2 = {}));
24
24
  /**
25
25
  * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
26
- * @public
26
+ * @internal
27
27
  */
28
28
  export function canBeCoalescedByService(message) {
29
29
  // This assumes that in the future relay service may implement coalescing of accept messages,
@@ -1 +1 @@
1
- {"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGN,WAAW,GACX,MAAM,sCAAsC,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,YAEX;AAFD,WAAY,YAAY;IACvB,iCAAiB,CAAA;AAClB,CAAC,EAFW,YAAY,KAAZ,YAAY,QAEvB;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CACtC,OAAqD;IAErD,6FAA6F;IAC7F,mEAAmE;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC;AAClF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tMessageType,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Tells if message was sent by container runtime\n * @privateRemarks ADO #1385: To be moved to container-definitions\n * @returns whether the message is a runtime message\n * @public\n */\nexport function isRuntimeMessage(message: { type: string }): boolean {\n\treturn message.type === MessageType.Operation;\n}\n\n/**\n * @privateRemarks ADO #1385: staging code changes across layers.\n * Eventually to be replaced by MessageType.accept\n * @public\n */\nexport enum MessageType2 {\n\tAccept = \"accept\",\n}\n\n/**\n * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts\n * @public\n */\nexport function canBeCoalescedByService(\n\tmessage: ISequencedDocumentMessage | IDocumentMessage,\n): boolean {\n\t// This assumes that in the future relay service may implement coalescing of accept messages,\n\t// same way it was doing coalescing of immediate noops in the past.\n\treturn message.type === MessageType.NoOp || message.type === MessageType2.Accept;\n}\n"]}
1
+ {"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGN,WAAW,GACX,MAAM,sCAAsC,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,YAEX;AAFD,WAAY,YAAY;IACvB,iCAAiB,CAAA;AAClB,CAAC,EAFW,YAAY,KAAZ,YAAY,QAEvB;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CACtC,OAAqD;IAErD,6FAA6F;IAC7F,mEAAmE;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC;AAClF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tMessageType,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Tells if message was sent by container runtime\n * @privateRemarks ADO #1385: To be moved to container-definitions\n * @returns whether the message is a runtime message\n * @internal\n */\nexport function isRuntimeMessage(message: { type: string }): boolean {\n\treturn message.type === MessageType.Operation;\n}\n\n/**\n * @privateRemarks ADO #1385: staging code changes across layers.\n * Eventually to be replaced by MessageType.accept\n * @internal\n */\nexport enum MessageType2 {\n\tAccept = \"accept\",\n}\n\n/**\n * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts\n * @internal\n */\nexport function canBeCoalescedByService(\n\tmessage: ISequencedDocumentMessage | IDocumentMessage,\n): boolean {\n\t// This assumes that in the future relay service may implement coalescing of accept messages,\n\t// same way it was doing coalescing of immediate noops in the past.\n\treturn message.type === MessageType.NoOp || message.type === MessageType2.Accept;\n}\n"]}
package/lib/network.d.ts CHANGED
@@ -6,7 +6,7 @@ import { IThrottlingWarning, IDriverErrorBase, IAuthorizationError, DriverErrorT
6
6
  import { ITelemetryProperties } from "@fluidframework/core-interfaces";
7
7
  import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
8
8
  /**
9
- * @public
9
+ * @internal
10
10
  */
11
11
  export declare enum OnlineStatus {
12
12
  Offline = 0,
@@ -17,19 +17,19 @@ export declare enum OnlineStatus {
17
17
  * It tells if we have local connection only - we might not have connection to web.
18
18
  * No solution for node.js (other than resolve dns names / ping specific sites)
19
19
  * Can also use window.addEventListener("online" / "offline")
20
- * @public
20
+ * @internal
21
21
  */
22
22
  export declare function isOnline(): OnlineStatus;
23
23
  /**
24
24
  * Telemetry props with driver-specific required properties
25
- * @public
25
+ * @internal
26
26
  */
27
27
  export type DriverErrorTelemetryProps = ITelemetryProperties & {
28
28
  driverVersion: string | undefined;
29
29
  };
30
30
  /**
31
31
  * Generic network error class.
32
- * @public
32
+ * @internal
33
33
  */
34
34
  export declare class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
35
35
  readonly canRetry: boolean;
@@ -38,7 +38,7 @@ export declare class GenericNetworkError extends LoggingError implements IDriver
38
38
  }
39
39
  /**
40
40
  * FluidInvalidSchema error class.
41
- * @public
41
+ * @internal
42
42
  */
43
43
  export declare class FluidInvalidSchemaError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
44
44
  readonly errorType = DriverErrorType.fluidInvalidSchema;
@@ -46,7 +46,7 @@ export declare class FluidInvalidSchemaError extends LoggingError implements IDr
46
46
  constructor(message: string, props: DriverErrorTelemetryProps);
47
47
  }
48
48
  /**
49
- * @public
49
+ * @internal
50
50
  */
51
51
  export declare class DeltaStreamConnectionForbiddenError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
52
52
  static readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;
@@ -56,7 +56,7 @@ export declare class DeltaStreamConnectionForbiddenError extends LoggingError im
56
56
  constructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string);
57
57
  }
58
58
  /**
59
- * @public
59
+ * @internal
60
60
  */
61
61
  export declare class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {
62
62
  readonly claims: string | undefined;
@@ -66,7 +66,7 @@ export declare class AuthorizationError extends LoggingError implements IAuthori
66
66
  constructor(message: string, claims: string | undefined, tenantId: string | undefined, props: DriverErrorTelemetryProps);
67
67
  }
68
68
  /**
69
- * @public
69
+ * @internal
70
70
  */
71
71
  export declare class LocationRedirectionError extends LoggingError implements ILocationRedirectionError, IFluidErrorBase {
72
72
  readonly redirectUrl: IResolvedUrl;
@@ -75,7 +75,7 @@ export declare class LocationRedirectionError extends LoggingError implements IL
75
75
  constructor(message: string, redirectUrl: IResolvedUrl, props: DriverErrorTelemetryProps);
76
76
  }
77
77
  /**
78
- * @public
78
+ * @internal
79
79
  */
80
80
  export declare class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {
81
81
  readonly errorType: T;
@@ -83,14 +83,14 @@ export declare class NetworkErrorBasic<T extends string> extends LoggingError im
83
83
  constructor(message: string, errorType: T, canRetry: boolean, props: DriverErrorTelemetryProps);
84
84
  }
85
85
  /**
86
- * @public
86
+ * @internal
87
87
  */
88
88
  export declare class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {
89
89
  readonly errorType: T;
90
90
  constructor(message: string, errorType: T, props: DriverErrorTelemetryProps);
91
91
  }
92
92
  /**
93
- * @public
93
+ * @internal
94
94
  */
95
95
  export declare class RetryableError<T extends string> extends NetworkErrorBasic<T> {
96
96
  readonly errorType: T;
@@ -98,7 +98,7 @@ export declare class RetryableError<T extends string> extends NetworkErrorBasic<
98
98
  }
99
99
  /**
100
100
  * Throttling error class - used to communicate all throttling errors
101
- * @public
101
+ * @internal
102
102
  */
103
103
  export declare class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {
104
104
  readonly retryAfterSeconds: number;
@@ -107,11 +107,11 @@ export declare class ThrottlingError extends LoggingError implements IThrottling
107
107
  constructor(message: string, retryAfterSeconds: number, props: DriverErrorTelemetryProps);
108
108
  }
109
109
  /**
110
- * @public
110
+ * @internal
111
111
  */
112
112
  export declare const createWriteError: (message: string, props: DriverErrorTelemetryProps) => NonRetryableError<"writeError">;
113
113
  /**
114
- * @public
114
+ * @internal
115
115
  */
116
116
  export declare function createGenericNetworkError(message: string, retryInfo: {
117
117
  canRetry: boolean;
@@ -121,17 +121,17 @@ export declare function createGenericNetworkError(message: string, retryInfo: {
121
121
  * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.
122
122
  * I.e. asserts or unexpected exceptions in our code result in container failure.
123
123
  * @param error - The error to inspect for ability to retry
124
- * @public
124
+ * @internal
125
125
  */
126
126
  export declare const canRetryOnError: (error: any) => boolean;
127
127
  /**
128
128
  * Check retryAfterSeconds property on error
129
- * @public
130
- * */
129
+ * @internal
130
+ */
131
131
  export declare const getRetryDelaySecondsFromError: (error: any) => number | undefined;
132
132
  /**
133
133
  * Check retryAfterSeconds property on error and convert to ms
134
- * @public
135
- * */
134
+ * @internal
135
+ */
136
136
  export declare const getRetryDelayFromError: (error: any) => number | undefined;
137
137
  //# sourceMappingURL=network.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EAEnB,eAAe,EACf,yBAAyB,EACzB,YAAY,EAEZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,i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AS,yBAAyB,oCACf,CAAC;AAEpE;;GAEG;AACH,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EACvD,KAAK,EAAE,yBAAyB,GAC9B,eAAe,GAAG,mBAAmB,CAKvC;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,UAAW,GAAG,KAAG,OAAmC,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,UAAW,GAAG,KAAG,MAAM,GAAG,SACrB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,UAAW,GAAG,KAAG,MAAM,GAAG,SACuB,CAAC"}
package/lib/network.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  DriverErrorType, DriverErrorTypes, } from "@fluidframework/driver-definitions";
8
8
  import { LoggingError } from "@fluidframework/telemetry-utils";
9
9
  /**
10
- * @public
10
+ * @internal
11
11
  */
12
12
  export var OnlineStatus;
13
13
  (function (OnlineStatus) {
@@ -19,7 +19,7 @@ export var OnlineStatus;
19
19
  * It tells if we have local connection only - we might not have connection to web.
20
20
  * No solution for node.js (other than resolve dns names / ping specific sites)
21
21
  * Can also use window.addEventListener("online" / "offline")
22
- * @public
22
+ * @internal
23
23
  */
24
24
  export function isOnline() {
25
25
  if (typeof navigator === "object" &&
@@ -31,7 +31,7 @@ export function isOnline() {
31
31
  }
32
32
  /**
33
33
  * Generic network error class.
34
- * @public
34
+ * @internal
35
35
  */
36
36
  export class GenericNetworkError extends LoggingError {
37
37
  constructor(message, canRetry, props) {
@@ -43,7 +43,7 @@ export class GenericNetworkError extends LoggingError {
43
43
  }
44
44
  /**
45
45
  * FluidInvalidSchema error class.
46
- * @public
46
+ * @internal
47
47
  */
48
48
  export class FluidInvalidSchemaError extends LoggingError {
49
49
  constructor(message, props) {
@@ -54,7 +54,7 @@ export class FluidInvalidSchemaError extends LoggingError {
54
54
  }
55
55
  }
56
56
  /**
57
- * @public
57
+ * @internal
58
58
  */
59
59
  export class DeltaStreamConnectionForbiddenError extends LoggingError {
60
60
  constructor(message, props, storageOnlyReason) {
@@ -67,7 +67,7 @@ export class DeltaStreamConnectionForbiddenError extends LoggingError {
67
67
  // eslint-disable-next-line import/no-deprecated
68
68
  DeltaStreamConnectionForbiddenError.errorType = DriverErrorType.deltaStreamConnectionForbidden;
69
69
  /**
70
- * @public
70
+ * @internal
71
71
  */
72
72
  export class AuthorizationError extends LoggingError {
73
73
  constructor(message, claims, tenantId, props) {
@@ -81,7 +81,7 @@ export class AuthorizationError extends LoggingError {
81
81
  }
82
82
  }
83
83
  /**
84
- * @public
84
+ * @internal
85
85
  */
86
86
  export class LocationRedirectionError extends LoggingError {
87
87
  constructor(message, redirectUrl, props) {
@@ -94,7 +94,7 @@ export class LocationRedirectionError extends LoggingError {
94
94
  }
95
95
  }
96
96
  /**
97
- * @public
97
+ * @internal
98
98
  */
99
99
  export class NetworkErrorBasic extends LoggingError {
100
100
  constructor(message, errorType, canRetry, props) {
@@ -104,7 +104,7 @@ export class NetworkErrorBasic extends LoggingError {
104
104
  }
105
105
  }
106
106
  /**
107
- * @public
107
+ * @internal
108
108
  */
109
109
  export class NonRetryableError extends NetworkErrorBasic {
110
110
  constructor(message, errorType, props) {
@@ -113,7 +113,7 @@ export class NonRetryableError extends NetworkErrorBasic {
113
113
  }
114
114
  }
115
115
  /**
116
- * @public
116
+ * @internal
117
117
  */
118
118
  export class RetryableError extends NetworkErrorBasic {
119
119
  constructor(message, errorType, props) {
@@ -123,7 +123,7 @@ export class RetryableError extends NetworkErrorBasic {
123
123
  }
124
124
  /**
125
125
  * Throttling error class - used to communicate all throttling errors
126
- * @public
126
+ * @internal
127
127
  */
128
128
  export class ThrottlingError extends LoggingError {
129
129
  constructor(message, retryAfterSeconds, props) {
@@ -135,11 +135,11 @@ export class ThrottlingError extends LoggingError {
135
135
  }
136
136
  }
137
137
  /**
138
- * @public
138
+ * @internal
139
139
  */
140
140
  export const createWriteError = (message, props) => new NonRetryableError(message, DriverErrorTypes.writeError, props);
141
141
  /**
142
- * @public
142
+ * @internal
143
143
  */
144
144
  export function createGenericNetworkError(message, retryInfo, props) {
145
145
  if (retryInfo.retryAfterMs !== undefined && retryInfo.canRetry) {
@@ -151,17 +151,17 @@ export function createGenericNetworkError(message, retryInfo, props) {
151
151
  * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.
152
152
  * I.e. asserts or unexpected exceptions in our code result in container failure.
153
153
  * @param error - The error to inspect for ability to retry
154
- * @public
154
+ * @internal
155
155
  */
156
156
  export const canRetryOnError = (error) => error?.canRetry === true;
157
157
  /**
158
158
  * Check retryAfterSeconds property on error
159
- * @public
160
- * */
159
+ * @internal
160
+ */
161
161
  export const getRetryDelaySecondsFromError = (error) => error?.retryAfterSeconds;
162
162
  /**
163
163
  * Check retryAfterSeconds property on error and convert to ms
164
- * @public
165
- * */
164
+ * @internal
165
+ */
166
166
  export const getRetryDelayFromError = (error) => error?.retryAfterSeconds !== undefined ? error.retryAfterSeconds * 1000 : undefined;
167
167
  //# sourceMappingURL=network.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO;AAIN,gDAAgD;AAChD,eAAe,EAGf,gBAAgB,GAChB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAmB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;GAEG;AACH,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,qDAAO,CAAA;AACR,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ;IACvB,IACC,OAAO,SAAS,KAAK,QAAQ;QAC7B,SAAS,KAAK,IAAI;QAClB,OAAO,SAAS,CAAC,MAAM,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AAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIThrottlingWarning,\n\tIDriverErrorBase,\n\tIAuthorizationError,\n\t// eslint-disable-next-line import/no-deprecated\n\tDriverErrorType,\n\tILocationRedirectionError,\n\tIResolvedUrl,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions\";\nimport { ITelemetryProperties } from \"@fluidframework/core-interfaces\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils\";\n\n/**\n * @public\n */\nexport enum OnlineStatus {\n\tOffline,\n\tOnline,\n\tUnknown,\n}\n\n/**\n * It tells if we have local connection only - we might not have connection to web.\n * No solution for node.js (other than resolve dns names / ping specific sites)\n * Can also use window.addEventListener(\"online\" / \"offline\")\n * @public\n */\nexport function isOnline(): OnlineStatus {\n\tif (\n\t\ttypeof navigator === \"object\" &&\n\t\tnavigator !== null &&\n\t\ttypeof navigator.onLine === \"boolean\"\n\t) {\n\t\treturn navigator.onLine ? OnlineStatus.Online : OnlineStatus.Offline;\n\t}\n\treturn OnlineStatus.Unknown;\n}\n\n/**\n * Telemetry props with driver-specific required properties\n * @public\n */\nexport type DriverErrorTelemetryProps = ITelemetryProperties & {\n\tdriverVersion: string | undefined;\n};\n\n/**\n * Generic network error class.\n * @public\n */\nexport class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.genericNetworkError;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * FluidInvalidSchema error class.\n * @public\n */\nexport class FluidInvalidSchemaError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.fluidInvalidSchema;\n\treadonly canRetry = false;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @public\n */\nexport class DeltaStreamConnectionForbiddenError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\t// eslint-disable-next-line import/no-deprecated\n\tstatic readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;\n\treadonly errorType = DeltaStreamConnectionForbiddenError.errorType;\n\treadonly canRetry = false;\n\treadonly storageOnlyReason: string | undefined;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string) {\n\t\tsuper(message, { ...props, statusCode: 400 });\n\t\tthis.storageOnlyReason = storageOnlyReason;\n\t}\n}\n\n/**\n * @public\n */\nexport class AuthorizationError\n\textends LoggingError\n\timplements IAuthorizationError, IFluidErrorBase\n{\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.authorizationError;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly claims: string | undefined,\n\t\treadonly tenantId: string | undefined,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// don't log claims or tenantId\n\t\tsuper(message, props, new Set([\"claims\", \"tenantId\"]));\n\t}\n}\n\n/**\n * @public\n */\nexport class LocationRedirectionError\n\textends LoggingError\n\timplements ILocationRedirectionError, IFluidErrorBase\n{\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.locationRedirection;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly redirectUrl: IResolvedUrl,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// do not log redirectURL\n\t\tsuper(message, props, new Set([\"redirectUrl\"]));\n\t}\n}\n\n/**\n * @public\n */\nexport class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @public\n */\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, false, props);\n\t}\n}\n\n/**\n * @public\n */\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, true, props);\n\t}\n}\n\n/**\n * Throttling error class - used to communicate all throttling errors\n * @public\n */\nexport class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.throttlingError;\n\treadonly canRetry = true;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly retryAfterSeconds: number,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @public\n */\nexport const createWriteError = (message: string, props: DriverErrorTelemetryProps) =>\n\tnew NonRetryableError(message, DriverErrorTypes.writeError, props);\n\n/**\n * @public\n */\nexport function createGenericNetworkError(\n\tmessage: string,\n\tretryInfo: { canRetry: boolean; retryAfterMs?: number },\n\tprops: DriverErrorTelemetryProps,\n): ThrottlingError | GenericNetworkError {\n\tif (retryInfo.retryAfterMs !== undefined && retryInfo.canRetry) {\n\t\treturn new ThrottlingError(message, retryInfo.retryAfterMs / 1000, props);\n\t}\n\treturn new GenericNetworkError(message, retryInfo.canRetry, props);\n}\n\n/**\n * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.\n * I.e. asserts or unexpected exceptions in our code result in container failure.\n * @param error - The error to inspect for ability to retry\n * @public\n */\nexport const canRetryOnError = (error: any): boolean => error?.canRetry === true;\n\n/**\n * Check retryAfterSeconds property on error\n * @public\n * */\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds as number | undefined;\n\n/**\n * Check retryAfterSeconds property on error and convert to ms\n * @public\n * */\nexport const getRetryDelayFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds !== undefined ? error.retryAfterSeconds * 1000 : undefined;\n"]}
1
+ {"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO;AAIN,gDAAgD;AAChD,eAAe,EAGf,gBAAgB,GAChB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAmB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;GAEG;AACH,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,qDAAO,CAAA;AACR,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ;IACvB,IACC,OAAO,SAAS,KAAK,QAAQ;QAC7B,SAAS,KAAK,IAAI;QAClB,OAAO,SAAS,CAAC,MAAM,KAAK,SAAS,EACpC;QACD,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC;KACrE;IACD,OAAO,YAAY,CAAC,OAAO,CAAC;AAC7B,CAAC;AAUD;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IAIpD,YACC,OAAe,EACN,QAAiB,EAC1B,KAAgC;QAEhC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAHb,aAAQ,GAAR,QAAQ,CAAS;QAL3B,gDAAgD;QACvC,cAAS,GAAG,eAAe,CAAC,mBAAmB,CAAC;IAQzD,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,OAAO,uBACZ,SAAQ,YAAY;IAOpB,YAAY,OA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G;AACH,MAAM,UAAU,yBAAyB,CACxC,OAAe,EACf,SAAuD,EACvD,KAAgC;IAEhC,IAAI,SAAS,CAAC,YAAY,KAAK,SAAS,IAAI,SAAS,CAAC,QAAQ,EAAE;QAC/D,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;KAC1E;IACD,OAAO,IAAI,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACpE,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAU,EAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;AAEjF;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,KAAU,EAAsB,EAAE,CAC/E,KAAK,EAAE,iBAAuC,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAU,EAAsB,EAAE,CACxE,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIThrottlingWarning,\n\tIDriverErrorBase,\n\tIAuthorizationError,\n\t// eslint-disable-next-line import/no-deprecated\n\tDriverErrorType,\n\tILocationRedirectionError,\n\tIResolvedUrl,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions\";\nimport { ITelemetryProperties } from \"@fluidframework/core-interfaces\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils\";\n\n/**\n * @internal\n */\nexport enum OnlineStatus {\n\tOffline,\n\tOnline,\n\tUnknown,\n}\n\n/**\n * It tells if we have local connection only - we might not have connection to web.\n * No solution for node.js (other than resolve dns names / ping specific sites)\n * Can also use window.addEventListener(\"online\" / \"offline\")\n * @internal\n */\nexport function isOnline(): OnlineStatus {\n\tif (\n\t\ttypeof navigator === \"object\" &&\n\t\tnavigator !== null &&\n\t\ttypeof navigator.onLine === \"boolean\"\n\t) {\n\t\treturn navigator.onLine ? OnlineStatus.Online : OnlineStatus.Offline;\n\t}\n\treturn OnlineStatus.Unknown;\n}\n\n/**\n * Telemetry props with driver-specific required properties\n * @internal\n */\nexport type DriverErrorTelemetryProps = ITelemetryProperties & {\n\tdriverVersion: string | undefined;\n};\n\n/**\n * Generic network error class.\n * @internal\n */\nexport class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.genericNetworkError;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * FluidInvalidSchema error class.\n * @internal\n */\nexport class FluidInvalidSchemaError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.fluidInvalidSchema;\n\treadonly canRetry = false;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class DeltaStreamConnectionForbiddenError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\t// eslint-disable-next-line import/no-deprecated\n\tstatic readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;\n\treadonly errorType = DeltaStreamConnectionForbiddenError.errorType;\n\treadonly canRetry = false;\n\treadonly storageOnlyReason: string | undefined;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string) {\n\t\tsuper(message, { ...props, statusCode: 400 });\n\t\tthis.storageOnlyReason = storageOnlyReason;\n\t}\n}\n\n/**\n * @internal\n */\nexport class AuthorizationError\n\textends LoggingError\n\timplements IAuthorizationError, IFluidErrorBase\n{\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.authorizationError;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly claims: string | undefined,\n\t\treadonly tenantId: string | undefined,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// don't log claims or tenantId\n\t\tsuper(message, props, new Set([\"claims\", \"tenantId\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class LocationRedirectionError\n\textends LoggingError\n\timplements ILocationRedirectionError, IFluidErrorBase\n{\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.locationRedirection;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly redirectUrl: IResolvedUrl,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// do not log redirectURL\n\t\tsuper(message, props, new Set([\"redirectUrl\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, false, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, true, props);\n\t}\n}\n\n/**\n * Throttling error class - used to communicate all throttling errors\n * @internal\n */\nexport class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.throttlingError;\n\treadonly canRetry = true;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly retryAfterSeconds: number,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport const createWriteError = (message: string, props: DriverErrorTelemetryProps) =>\n\tnew NonRetryableError(message, DriverErrorTypes.writeError, props);\n\n/**\n * @internal\n */\nexport function createGenericNetworkError(\n\tmessage: string,\n\tretryInfo: { canRetry: boolean; retryAfterMs?: number },\n\tprops: DriverErrorTelemetryProps,\n): ThrottlingError | GenericNetworkError {\n\tif (retryInfo.retryAfterMs !== undefined && retryInfo.canRetry) {\n\t\treturn new ThrottlingError(message, retryInfo.retryAfterMs / 1000, props);\n\t}\n\treturn new GenericNetworkError(message, retryInfo.canRetry, props);\n}\n\n/**\n * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.\n * I.e. asserts or unexpected exceptions in our code result in container failure.\n * @param error - The error to inspect for ability to retry\n * @internal\n */\nexport const canRetryOnError = (error: any): boolean => error?.canRetry === true;\n\n/**\n * Check retryAfterSeconds property on error\n * @internal\n */\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds as number | undefined;\n\n/**\n * Check retryAfterSeconds property on error and convert to ms\n * @internal\n */\nexport const getRetryDelayFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds !== undefined ? error.retryAfterSeconds * 1000 : undefined;\n"]}
@@ -5,7 +5,7 @@
5
5
  import { ITelemetryErrorEvent } from "@fluidframework/core-interfaces";
6
6
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
7
7
  /**
8
- * @public
8
+ * @internal
9
9
  */
10
10
  export declare function logNetworkFailure(logger: ITelemetryLoggerExt, event: ITelemetryErrorEvent, error?: any): void;
11
11
  //# sourceMappingURL=networkUtils.d.ts.map
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { isOnline, OnlineStatus, canRetryOnError } from "./network";
6
6
  /**
7
- * @public
7
+ * @internal
8
8
  */
9
9
  export function logNetworkFailure(logger, event, error) {
10
10
  const newEvent = { ...event };
@@ -1 +1 @@
1
- {"version":3,"file":"networkUtils.js","sourceRoot":"","sources":["../src/networkUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAChC,MAA2B,EAC3B,KAA2B,EAC3B,KAAW;IAEX,MAAM,QAAQ,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IAE9B,MAAM,eAAe,GAAG,KAAK,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,MAAM;QACd,OAAO,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;IAElF,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,EAAE;QACxD,MAAM,GAAG,GAAG,SAAgB,CAAC;QAC7B,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,gBAAgB,CAAC;QAC/E,IAAI,UAAU,KAAK,IAAI,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;YAC1D,QAAQ,CAAC,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;SAC1C;KACD;IAED,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;IACjE,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryErrorEvent } from \"@fluidframework/core-interfaces\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { isOnline, OnlineStatus, canRetryOnError } from \"./network\";\n\n/**\n * @public\n */\nexport function logNetworkFailure(\n\tlogger: ITelemetryLoggerExt,\n\tevent: ITelemetryErrorEvent,\n\terror?: any,\n) {\n\tconst newEvent = { ...event };\n\n\tconst errorOnlineProp = error?.online;\n\tnewEvent.online =\n\t\ttypeof errorOnlineProp === \"string\" ? errorOnlineProp : OnlineStatus[isOnline()];\n\n\tif (typeof navigator === \"object\" && navigator !== null) {\n\t\tconst nav = navigator as any;\n\t\tconst connection = nav.connection ?? nav.mozConnection ?? nav.webkitConnection;\n\t\tif (connection !== null && typeof connection === \"object\") {\n\t\t\tnewEvent.connectionType = connection.type;\n\t\t}\n\t}\n\n\t// non-retryable errors are fatal and should be logged as errors\n\tnewEvent.category = canRetryOnError(error) ? \"generic\" : \"error\";\n\tlogger.sendTelemetryEvent(newEvent, error);\n}\n"]}
1
+ {"version":3,"file":"networkUtils.js","sourceRoot":"","sources":["../src/networkUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAChC,MAA2B,EAC3B,KAA2B,EAC3B,KAAW;IAEX,MAAM,QAAQ,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IAE9B,MAAM,eAAe,GAAG,KAAK,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,MAAM;QACd,OAAO,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;IAElF,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,EAAE;QACxD,MAAM,GAAG,GAAG,SAAgB,CAAC;QAC7B,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,gBAAgB,CAAC;QAC/E,IAAI,UAAU,KAAK,IAAI,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;YAC1D,QAAQ,CAAC,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;SAC1C;KACD;IAED,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;IACjE,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryErrorEvent } from \"@fluidframework/core-interfaces\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { isOnline, OnlineStatus, canRetryOnError } from \"./network\";\n\n/**\n * @internal\n */\nexport function logNetworkFailure(\n\tlogger: ITelemetryLoggerExt,\n\tevent: ITelemetryErrorEvent,\n\terror?: any,\n) {\n\tconst newEvent = { ...event };\n\n\tconst errorOnlineProp = error?.online;\n\tnewEvent.online =\n\t\ttypeof errorOnlineProp === \"string\" ? errorOnlineProp : OnlineStatus[isOnline()];\n\n\tif (typeof navigator === \"object\" && navigator !== null) {\n\t\tconst nav = navigator as any;\n\t\tconst connection = nav.connection ?? nav.mozConnection ?? nav.webkitConnection;\n\t\tif (connection !== null && typeof connection === \"object\") {\n\t\t\tnewEvent.connectionType = connection.type;\n\t\t}\n\t}\n\n\t// non-retryable errors are fatal and should be logged as errors\n\tnewEvent.category = canRetryOnError(error) ? \"generic\" : \"error\";\n\tlogger.sendTelemetryEvent(newEvent, error);\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/driver-utils";
8
- export declare const pkgVersion = "2.0.0-internal.7.3.0";
8
+ export declare const pkgVersion = "2.0.0-internal.7.4.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/driver-utils";
8
- export const pkgVersion = "2.0.0-internal.7.3.0";
8
+ export const pkgVersion = "2.0.0-internal.7.4.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.0.0-internal.7.3.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.0.0-internal.7.4.0\";\n"]}
@@ -13,7 +13,7 @@ import { IDeltasFetchResult, IStream, IStreamResult } from "@fluidframework/driv
13
13
  * @param logger - logger to use
14
14
  * @param requestCallback - callback to request batches
15
15
  * @returns Queue that can be used to retrieve data
16
- * @public
16
+ * @internal
17
17
  */
18
18
  export declare class ParallelRequests<T> {
19
19
  private to;
@@ -48,7 +48,7 @@ export declare class ParallelRequests<T> {
48
48
  /**
49
49
  * Helper queue class to allow async push / pull
50
50
  * It's essentially a pipe allowing multiple writers, and single reader
51
- * @public
51
+ * @internal
52
52
  */
53
53
  export declare class Queue<T> implements IStream<T> {
54
54
  private readonly queue;
@@ -71,19 +71,19 @@ export declare class Queue<T> implements IStream<T> {
71
71
  * @param signal - Cancelation signal
72
72
  * @param scenarioName - Reason for fetching ops
73
73
  * @returns Messages fetched
74
- * @public
74
+ * @internal
75
75
  */
76
76
  export declare function requestOps(get: (from: number, to: number, telemetryProps: ITelemetryProperties) => Promise<IDeltasFetchResult>, concurrency: number, fromTotal: number, toTotal: number | undefined, payloadSize: number, logger: ITelemetryLoggerExt, signal?: AbortSignal, scenarioName?: string): IStream<ISequencedDocumentMessage[]>;
77
77
  /**
78
- * @public
78
+ * @internal
79
79
  */
80
80
  export declare const emptyMessageStream: IStream<ISequencedDocumentMessage[]>;
81
81
  /**
82
- * @public
82
+ * @internal
83
83
  */
84
84
  export declare function streamFromMessages(messagesArg: Promise<ISequencedDocumentMessage[]>): IStream<ISequencedDocumentMessage[]>;
85
85
  /**
86
- * @public
86
+ * @internal
87
87
  */
88
88
  export declare function streamObserver<T>(stream: IStream<T>, handler: (value: IStreamResult<T>) => void): IStream<T>;
89
89
  //# sourceMappingURL=parallelRequests.d.ts.map
@@ -23,7 +23,7 @@ const MissingFetchDelayInMs = 50;
23
23
  * @param logger - logger to use
24
24
  * @param requestCallback - callback to request batches
25
25
  * @returns Queue that can be used to retrieve data
26
- * @public
26
+ * @internal
27
27
  */
28
28
  export class ParallelRequests {
29
29
  get working() {
@@ -263,7 +263,7 @@ export class ParallelRequests {
263
263
  /**
264
264
  * Helper queue class to allow async push / pull
265
265
  * It's essentially a pipe allowing multiple writers, and single reader
266
- * @public
266
+ * @internal
267
267
  */
268
268
  export class Queue {
269
269
  constructor() {
@@ -423,7 +423,7 @@ async function getSingleOpBatch(get, props, strongTo, logger, signal, scenarioNa
423
423
  * @param signal - Cancelation signal
424
424
  * @param scenarioName - Reason for fetching ops
425
425
  * @returns Messages fetched
426
- * @public
426
+ * @internal
427
427
  */
428
428
  export function requestOps(get, concurrency, fromTotal, toTotal, payloadSize, logger, signal, scenarioName) {
429
429
  let requests = 0;
@@ -498,7 +498,7 @@ export function requestOps(get, concurrency, fromTotal, toTotal, payloadSize, lo
498
498
  return queue;
499
499
  }
500
500
  /**
501
- * @public
501
+ * @internal
502
502
  */
503
503
  export const emptyMessageStream = {
504
504
  read: async () => {
@@ -506,7 +506,7 @@ export const emptyMessageStream = {
506
506
  },
507
507
  };
508
508
  /**
509
- * @public
509
+ * @internal
510
510
  */
511
511
  export function streamFromMessages(messagesArg) {
512
512
  let messages = messagesArg;
@@ -522,7 +522,7 @@ export function streamFromMessages(messagesArg) {
522
522
  };
523
523
  }
524
524
  /**
525
- * @public
525
+ * @internal
526
526
  */
527
527
  export function streamObserver(stream, handler) {
528
528
  return {