@fluidframework/driver-utils 2.0.0-internal.8.0.1 → 2.0.0-rc.1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +1 -7
  3. package/api-extractor-esm.json +4 -0
  4. package/api-extractor-lint.json +1 -10
  5. package/api-extractor.json +1 -9
  6. package/api-report/driver-utils.api.md +2 -2
  7. package/dist/adapters/compression/compressionTypes.d.ts +2 -2
  8. package/dist/adapters/compression/compressionTypes.js +1 -1
  9. package/dist/adapters/compression/compressionTypes.js.map +1 -1
  10. package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts +1 -1
  11. package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts.map +1 -1
  12. package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.js.map +1 -1
  13. package/dist/driver-utils-alpha.d.ts +2 -8
  14. package/dist/driver-utils-beta.d.ts +14 -12
  15. package/dist/driver-utils-public.d.ts +14 -12
  16. package/dist/driver-utils-untrimmed.d.ts +2 -2
  17. package/dist/packageVersion.d.ts +1 -1
  18. package/dist/packageVersion.d.ts.map +1 -1
  19. package/dist/packageVersion.js +1 -1
  20. package/dist/packageVersion.js.map +1 -1
  21. package/dist/runWithRetry.d.ts.map +1 -1
  22. package/dist/runWithRetry.js +2 -3
  23. package/dist/runWithRetry.js.map +1 -1
  24. package/lib/adapters/compression/{compressionTypes.d.ts → compressionTypes.d.mts} +3 -3
  25. package/lib/adapters/compression/compressionTypes.d.mts.map +1 -0
  26. package/lib/adapters/compression/{compressionTypes.js → compressionTypes.mjs} +2 -2
  27. package/lib/adapters/compression/compressionTypes.mjs.map +1 -0
  28. package/lib/adapters/compression/{documentServiceCompressionAdapter.d.ts → documentServiceCompressionAdapter.d.mts} +3 -3
  29. package/lib/adapters/compression/documentServiceCompressionAdapter.d.mts.map +1 -0
  30. package/lib/adapters/compression/{documentServiceCompressionAdapter.js → documentServiceCompressionAdapter.mjs} +3 -3
  31. package/lib/adapters/compression/documentServiceCompressionAdapter.mjs.map +1 -0
  32. package/lib/adapters/compression/{documentServiceFactoryCompressionAdapter.d.ts → documentServiceFactoryCompressionAdapter.d.mts} +3 -3
  33. package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.mts.map +1 -0
  34. package/lib/adapters/compression/{documentServiceFactoryCompressionAdapter.js → documentServiceFactoryCompressionAdapter.mjs} +4 -4
  35. package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.mjs.map +1 -0
  36. package/lib/adapters/compression/{index.d.ts → index.d.mts} +4 -4
  37. package/lib/adapters/compression/index.d.mts.map +1 -0
  38. package/lib/adapters/compression/{index.js → index.mjs} +4 -4
  39. package/lib/adapters/compression/{index.js.map → index.mjs.map} +1 -1
  40. package/lib/adapters/compression/summaryblob/{documentStorageServiceSummaryBlobCompressionAdapter.d.ts → documentStorageServiceSummaryBlobCompressionAdapter.d.mts} +3 -3
  41. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.mts.map +1 -0
  42. package/lib/adapters/compression/summaryblob/{documentStorageServiceSummaryBlobCompressionAdapter.js → documentStorageServiceSummaryBlobCompressionAdapter.mjs} +3 -3
  43. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.mjs.map +1 -0
  44. package/lib/adapters/compression/summaryblob/{index.d.ts → index.d.mts} +2 -2
  45. package/lib/adapters/compression/summaryblob/index.d.mts.map +1 -0
  46. package/lib/adapters/compression/summaryblob/{index.js → index.mjs} +2 -2
  47. package/lib/adapters/compression/summaryblob/index.mjs.map +1 -0
  48. package/lib/adapters/{index.d.ts → index.d.mts} +3 -3
  49. package/lib/adapters/index.d.mts.map +1 -0
  50. package/lib/adapters/{index.js → index.mjs} +3 -3
  51. package/lib/adapters/index.mjs.map +1 -0
  52. package/lib/adapters/{predefinedAdapters.d.ts → predefinedAdapters.d.mts} +2 -2
  53. package/lib/adapters/predefinedAdapters.d.mts.map +1 -0
  54. package/lib/adapters/{predefinedAdapters.js → predefinedAdapters.mjs} +2 -2
  55. package/lib/adapters/predefinedAdapters.mjs.map +1 -0
  56. package/lib/{blob.d.ts → blob.d.mts} +1 -1
  57. package/lib/blob.d.mts.map +1 -0
  58. package/lib/{blob.js → blob.mjs} +1 -1
  59. package/lib/blob.mjs.map +1 -0
  60. package/lib/{buildSnapshotTree.d.ts → buildSnapshotTree.d.mts} +1 -1
  61. package/lib/buildSnapshotTree.d.mts.map +1 -0
  62. package/lib/{buildSnapshotTree.js → buildSnapshotTree.mjs} +1 -1
  63. package/lib/buildSnapshotTree.mjs.map +1 -0
  64. package/lib/{documentServiceFactoryProxy.d.ts → documentServiceFactoryProxy.d.mts} +1 -1
  65. package/lib/documentServiceFactoryProxy.d.mts.map +1 -0
  66. package/lib/{documentServiceFactoryProxy.js → documentServiceFactoryProxy.mjs} +1 -1
  67. package/lib/documentServiceFactoryProxy.mjs.map +1 -0
  68. package/lib/{documentServiceProxy.d.ts → documentServiceProxy.d.mts} +1 -1
  69. package/lib/documentServiceProxy.d.mts.map +1 -0
  70. package/lib/{documentServiceProxy.js → documentServiceProxy.mjs} +1 -1
  71. package/lib/documentServiceProxy.mjs.map +1 -0
  72. package/lib/{documentStorageServiceProxy.d.ts → documentStorageServiceProxy.d.mts} +1 -1
  73. package/lib/documentStorageServiceProxy.d.mts.map +1 -0
  74. package/lib/{documentStorageServiceProxy.js → documentStorageServiceProxy.mjs} +1 -1
  75. package/lib/documentStorageServiceProxy.mjs.map +1 -0
  76. package/lib/{driver-utils-alpha.d.ts → driver-utils-alpha.d.mts} +2 -8
  77. package/lib/{driver-utils-beta.d.ts → driver-utils-beta.d.mts} +14 -12
  78. package/lib/{driver-utils-public.d.ts → driver-utils-public.d.mts} +14 -12
  79. package/lib/{driver-utils-untrimmed.d.ts → driver-utils-untrimmed.d.mts} +2 -2
  80. package/lib/{error.d.ts → error.d.mts} +1 -1
  81. package/lib/error.d.mts.map +1 -0
  82. package/lib/{error.js → error.mjs} +1 -2
  83. package/lib/error.mjs.map +1 -0
  84. package/lib/{index.d.ts → index.d.mts} +17 -17
  85. package/lib/index.d.mts.map +1 -0
  86. package/lib/{index.js → index.mjs} +17 -17
  87. package/lib/index.mjs.map +1 -0
  88. package/lib/{insecureUrlResolver.d.ts → insecureUrlResolver.d.mts} +1 -1
  89. package/lib/insecureUrlResolver.d.mts.map +1 -0
  90. package/lib/{insecureUrlResolver.js → insecureUrlResolver.mjs} +1 -1
  91. package/lib/insecureUrlResolver.mjs.map +1 -0
  92. package/lib/{messageRecognition.d.ts → messageRecognition.d.mts} +1 -5
  93. package/lib/messageRecognition.d.mts.map +1 -0
  94. package/lib/{messageRecognition.js → messageRecognition.mjs} +1 -5
  95. package/lib/messageRecognition.mjs.map +1 -0
  96. package/lib/{network.d.ts → network.d.mts} +1 -1
  97. package/lib/network.d.mts.map +1 -0
  98. package/lib/{network.js → network.mjs} +1 -1
  99. package/lib/network.mjs.map +1 -0
  100. package/lib/{networkUtils.d.ts → networkUtils.d.mts} +1 -1
  101. package/lib/networkUtils.d.mts.map +1 -0
  102. package/lib/{networkUtils.js → networkUtils.mjs} +2 -2
  103. package/lib/networkUtils.mjs.map +1 -0
  104. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +2 -2
  105. package/lib/packageVersion.d.mts.map +1 -0
  106. package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
  107. package/lib/packageVersion.mjs.map +1 -0
  108. package/lib/{parallelRequests.d.ts → parallelRequests.d.mts} +1 -1
  109. package/lib/parallelRequests.d.mts.map +1 -0
  110. package/lib/{parallelRequests.js → parallelRequests.mjs} +5 -10
  111. package/lib/parallelRequests.mjs.map +1 -0
  112. package/lib/{prefetchDocumentStorageService.d.ts → prefetchDocumentStorageService.d.mts} +2 -6
  113. package/lib/prefetchDocumentStorageService.d.mts.map +1 -0
  114. package/lib/{prefetchDocumentStorageService.js → prefetchDocumentStorageService.mjs} +3 -7
  115. package/lib/prefetchDocumentStorageService.mjs.map +1 -0
  116. package/lib/{rateLimiter.d.ts → rateLimiter.d.mts} +1 -1
  117. package/lib/rateLimiter.d.mts.map +1 -0
  118. package/lib/{rateLimiter.js → rateLimiter.mjs} +1 -1
  119. package/lib/rateLimiter.mjs.map +1 -0
  120. package/lib/{readAndParse.d.ts → readAndParse.d.mts} +1 -1
  121. package/lib/readAndParse.d.mts.map +1 -0
  122. package/lib/{readAndParse.js → readAndParse.mjs} +1 -1
  123. package/lib/readAndParse.mjs.map +1 -0
  124. package/lib/{runWithRetry.d.ts → runWithRetry.d.mts} +1 -1
  125. package/lib/runWithRetry.d.mts.map +1 -0
  126. package/lib/{runWithRetry.js → runWithRetry.mjs} +4 -5
  127. package/lib/runWithRetry.mjs.map +1 -0
  128. package/lib/{summaryForCreateNew.d.ts → summaryForCreateNew.d.mts} +1 -1
  129. package/lib/summaryForCreateNew.d.mts.map +1 -0
  130. package/lib/{summaryForCreateNew.js → summaryForCreateNew.mjs} +1 -1
  131. package/lib/summaryForCreateNew.mjs.map +1 -0
  132. package/lib/{treeConversions.d.ts → treeConversions.d.mts} +1 -1
  133. package/lib/treeConversions.d.mts.map +1 -0
  134. package/lib/{treeConversions.js → treeConversions.mjs} +3 -3
  135. package/lib/treeConversions.mjs.map +1 -0
  136. package/package.json +24 -23
  137. package/src/adapters/compression/compressionTypes.ts +2 -2
  138. package/src/adapters/compression/documentServiceFactoryCompressionAdapter.ts +1 -1
  139. package/src/packageVersion.ts +1 -1
  140. package/src/runWithRetry.ts +2 -3
  141. package/tsconfig.json +6 -4
  142. package/lib/adapters/compression/compressionTypes.d.ts.map +0 -1
  143. package/lib/adapters/compression/compressionTypes.js.map +0 -1
  144. package/lib/adapters/compression/documentServiceCompressionAdapter.d.ts.map +0 -1
  145. package/lib/adapters/compression/documentServiceCompressionAdapter.js.map +0 -1
  146. package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts.map +0 -1
  147. package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.js.map +0 -1
  148. package/lib/adapters/compression/index.d.ts.map +0 -1
  149. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +0 -1
  150. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +0 -1
  151. package/lib/adapters/compression/summaryblob/index.d.ts.map +0 -1
  152. package/lib/adapters/compression/summaryblob/index.js.map +0 -1
  153. package/lib/adapters/index.d.ts.map +0 -1
  154. package/lib/adapters/index.js.map +0 -1
  155. package/lib/adapters/predefinedAdapters.d.ts.map +0 -1
  156. package/lib/adapters/predefinedAdapters.js.map +0 -1
  157. package/lib/blob.d.ts.map +0 -1
  158. package/lib/blob.js.map +0 -1
  159. package/lib/buildSnapshotTree.d.ts.map +0 -1
  160. package/lib/buildSnapshotTree.js.map +0 -1
  161. package/lib/documentServiceFactoryProxy.d.ts.map +0 -1
  162. package/lib/documentServiceFactoryProxy.js.map +0 -1
  163. package/lib/documentServiceProxy.d.ts.map +0 -1
  164. package/lib/documentServiceProxy.js.map +0 -1
  165. package/lib/documentStorageServiceProxy.d.ts.map +0 -1
  166. package/lib/documentStorageServiceProxy.js.map +0 -1
  167. package/lib/error.d.ts.map +0 -1
  168. package/lib/error.js.map +0 -1
  169. package/lib/index.d.ts.map +0 -1
  170. package/lib/index.js.map +0 -1
  171. package/lib/insecureUrlResolver.d.ts.map +0 -1
  172. package/lib/insecureUrlResolver.js.map +0 -1
  173. package/lib/messageRecognition.d.ts.map +0 -1
  174. package/lib/messageRecognition.js.map +0 -1
  175. package/lib/network.d.ts.map +0 -1
  176. package/lib/network.js.map +0 -1
  177. package/lib/networkUtils.d.ts.map +0 -1
  178. package/lib/networkUtils.js.map +0 -1
  179. package/lib/packageVersion.d.ts.map +0 -1
  180. package/lib/packageVersion.js.map +0 -1
  181. package/lib/parallelRequests.d.ts.map +0 -1
  182. package/lib/parallelRequests.js.map +0 -1
  183. package/lib/prefetchDocumentStorageService.d.ts.map +0 -1
  184. package/lib/prefetchDocumentStorageService.js.map +0 -1
  185. package/lib/rateLimiter.d.ts.map +0 -1
  186. package/lib/rateLimiter.js.map +0 -1
  187. package/lib/readAndParse.d.ts.map +0 -1
  188. package/lib/readAndParse.js.map +0 -1
  189. package/lib/runWithRetry.d.ts.map +0 -1
  190. package/lib/runWithRetry.js.map +0 -1
  191. package/lib/summaryForCreateNew.d.ts.map +0 -1
  192. package/lib/summaryForCreateNew.js.map +0 -1
  193. package/lib/treeConversions.d.ts.map +0 -1
  194. package/lib/treeConversions.js.map +0 -1
  195. package/tsconfig.esnext.json +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @fluidframework/driver-utils
2
2
 
3
+ ## 2.0.0-rc.1.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Updated server dependencies ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
8
+
9
+ The following Fluid server dependencies have been updated to the latest version, 3.0.0. [See the full changelog.](https://github.com/microsoft/FluidFramework/releases/tag/server_v3.0.0)
10
+
11
+ - @fluidframework/gitresources
12
+ - @fluidframework/server-kafka-orderer
13
+ - @fluidframework/server-lambdas
14
+ - @fluidframework/server-lambdas-driver
15
+ - @fluidframework/server-local-server
16
+ - @fluidframework/server-memory-orderer
17
+ - @fluidframework/protocol-base
18
+ - @fluidframework/server-routerlicious
19
+ - @fluidframework/server-routerlicious-base
20
+ - @fluidframework/server-services
21
+ - @fluidframework/server-services-client
22
+ - @fluidframework/server-services-core
23
+ - @fluidframework/server-services-ordering-kafkanode
24
+ - @fluidframework/server-services-ordering-rdkafka
25
+ - @fluidframework/server-services-ordering-zookeeper
26
+ - @fluidframework/server-services-shared
27
+ - @fluidframework/server-services-telemetry
28
+ - @fluidframework/server-services-utils
29
+ - @fluidframework/server-test-utils
30
+ - tinylicious
31
+
32
+ - Updated @fluidframework/protocol-definitions ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
33
+
34
+ The @fluidframework/protocol-definitions dependency has been upgraded to v3.1.0. [See the full
35
+ changelog.](https://github.com/microsoft/FluidFramework/blob/main/common/lib/protocol-definitions/CHANGELOG.md#310)
36
+
3
37
  ## 2.0.0-internal.8.0.0
4
38
 
5
39
  Dependency updates only.
package/README.md CHANGED
@@ -13,12 +13,6 @@ When taking a dependency on a Fluid Framework library, we recommend using a `^`
13
13
  While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
14
14
  library consumers should always prefer `^`.
15
15
 
16
- Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
17
- you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
18
- Standard `^` and `~` ranges will not work as expected.
19
- See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
20
- package for more information including tools to convert between version schemes.
21
-
22
16
  ## Installation
23
17
 
24
18
  To get started, install the package by running the following command:
@@ -29,7 +23,7 @@ npm i @fluidframework/driver-utils
29
23
 
30
24
  ## API Documentation
31
25
 
32
- API documentation for **@fluidframework/driver-utils** is available at <https://fluidframework.com/docs/apis/driver-utils>.
26
+ API documentation for **@fluidframework/driver-utils** is available at <https://fluidframework.com/docs/api/v1/driver-utils>.
33
27
 
34
28
  ## Contribution Guidelines
35
29
 
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-base-esm.json"
4
+ }
@@ -1,13 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-lint.json",
4
- "messages": {
5
- "extractorMessageReporting": {
6
- // TODO: remove once base config has this enabled as an error
7
- "ae-incompatible-release-tags": {
8
- "logLevel": "error",
9
- "addToApiReportFile": false
10
- }
11
- }
12
- }
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.json"
13
4
  }
@@ -1,12 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.json",
4
- "messages": {
5
- "extractorMessageReporting": {
6
- // TODO: Add missing documentation and remove this rule override
7
- "ae-undocumented": {
8
- "logLevel": "none"
9
- }
10
- }
11
- }
3
+ "extends": "../../../common/build/build-common/api-extractor-base.json"
12
4
  }
@@ -194,7 +194,7 @@ export const getRetryDelayFromError: (error: any) => number | undefined;
194
194
  // @internal
195
195
  export const getRetryDelaySecondsFromError: (error: any) => number | undefined;
196
196
 
197
- // @alpha (undocumented)
197
+ // @public (undocumented)
198
198
  export interface ICompressionStorageConfig {
199
199
  // (undocumented)
200
200
  algorithm: SummaryCompressionAlgorithm;
@@ -355,7 +355,7 @@ export function streamFromMessages(messagesArg: Promise<ISequencedDocumentMessag
355
355
  // @internal (undocumented)
356
356
  export function streamObserver<T>(stream: IStream<T>, handler: (value: IStreamResult<T>) => void): IStream<T>;
357
357
 
358
- // @alpha (undocumented)
358
+ // @public (undocumented)
359
359
  export enum SummaryCompressionAlgorithm {
360
360
  // (undocumented)
361
361
  LZ4 = 1,
@@ -3,14 +3,14 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * @alpha
6
+ * @public
7
7
  */
8
8
  export declare enum SummaryCompressionAlgorithm {
9
9
  None = 0,
10
10
  LZ4 = 1
11
11
  }
12
12
  /**
13
- * @alpha
13
+ * @public
14
14
  */
15
15
  export interface ICompressionStorageConfig {
16
16
  algorithm: SummaryCompressionAlgorithm;
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.DefaultCompressionStorageConfig = exports.SummaryCompressionAlgorithm = void 0;
8
8
  /**
9
- * @alpha
9
+ * @public
10
10
  */
11
11
  var SummaryCompressionAlgorithm;
12
12
  (function (SummaryCompressionAlgorithm) {
@@ -1 +1 @@
1
- {"version":3,"file":"compressionTypes.js","sourceRoot":"","sources":["../../../src/adapters/compression/compressionTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACtC,6EAAQ,CAAA;IACR,2EAAO,CAAA;AACR,CAAC,EAHW,2BAA2B,2CAA3B,2BAA2B,QAGtC;AAUY,QAAA,+BAA+B,GAAG;IAC9C,SAAS,EAAE,2BAA2B,CAAC,GAAG;IAC1C,iBAAiB,EAAE,GAAG;CACtB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @alpha\n */\nexport enum SummaryCompressionAlgorithm {\n\tNone = 0,\n\tLZ4 = 1,\n}\n\n/**\n * @alpha\n */\nexport interface ICompressionStorageConfig {\n\talgorithm: SummaryCompressionAlgorithm;\n\tminSizeToCompress: number;\n}\n\nexport const DefaultCompressionStorageConfig = {\n\talgorithm: SummaryCompressionAlgorithm.LZ4,\n\tminSizeToCompress: 500,\n};\n"]}
1
+ {"version":3,"file":"compressionTypes.js","sourceRoot":"","sources":["../../../src/adapters/compression/compressionTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACtC,6EAAQ,CAAA;IACR,2EAAO,CAAA;AACR,CAAC,EAHW,2BAA2B,2CAA3B,2BAA2B,QAGtC;AAUY,QAAA,+BAA+B,GAAG;IAC9C,SAAS,EAAE,2BAA2B,CAAC,GAAG;IAC1C,iBAAiB,EAAE,GAAG;CACtB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @public\n */\nexport enum SummaryCompressionAlgorithm {\n\tNone = 0,\n\tLZ4 = 1,\n}\n\n/**\n * @public\n */\nexport interface ICompressionStorageConfig {\n\talgorithm: SummaryCompressionAlgorithm;\n\tminSizeToCompress: number;\n}\n\nexport const DefaultCompressionStorageConfig = {\n\talgorithm: SummaryCompressionAlgorithm.LZ4,\n\tminSizeToCompress: 500,\n};\n"]}
@@ -6,7 +6,7 @@ import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
6
  import { IDocumentService, IDocumentServiceFactory, IResolvedUrl } from "@fluidframework/driver-definitions";
7
7
  import { ISummaryTree } from "@fluidframework/protocol-definitions";
8
8
  import { DocumentServiceFactoryProxy } from "../../documentServiceFactoryProxy";
9
- import { ICompressionStorageConfig } from "..";
9
+ import { ICompressionStorageConfig } from "./compressionTypes";
10
10
  export declare class DocumentServiceFactoryCompressionAdapter extends DocumentServiceFactoryProxy {
11
11
  private readonly _config;
12
12
  constructor(serviceFactory: IDocumentServiceFactory, _config: ICompressionStorageConfig);
@@ -1 +1 @@
1
- {"version":3,"file":"documentServiceFactoryCompressionAdapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/compression/documentServiceFactoryCompressionAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,IAAI,CAAC;AAI/C,qBAAa,wCAAyC,SAAQ,2BAA2B;IAGvF,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADxB,cAAc,EAAE,uBAAuB,EACtB,OAAO,EAAE,yBAAyB;IAKvC,eAAe,CAC3B,gBAAgB,EAAE,YAAY,GAAG,SAAS,EAC1C,oBAAoB,EAAE,YAAY,EAClC,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAmBf,qBAAqB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAIxF"}
1
+ {"version":3,"file":"documentServiceFactoryCompressionAdapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/compression/documentServiceFactoryCompressionAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAI/D,qBAAa,wCAAyC,SAAQ,2BAA2B;IAGvF,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADxB,cAAc,EAAE,uBAAuB,EACtB,OAAO,EAAE,yBAAyB;IAKvC,eAAe,CAC3B,gBAAgB,EAAE,YAAY,GAAG,SAAS,EAC1C,oBAAoB,EAAE,YAAY,EAClC,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAmBf,qBAAqB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAIxF"}
@@ -1 +1 @@
1
- {"version":3,"file":"documentServiceFactoryCompressionAdapter.js","sourceRoot":"","sources":["../../../src/adapters/compression/documentServiceFactoryCompressionAdapter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,mFAAgF;AAEhF,+CAAgI;AAChI,2FAAwF;AAExF,MAAa,wCAAyC,SAAQ,yDAA2B;IACxF,YACC,cAAuC,EACtB,OAAkC;QAEnD,KAAK,CAAC,cAAc,CAAC,CAAC;QAFL,YAAO,GAAP,OAAO,CAA2B;IAGpD,CAAC;IAEM,KAAK,CAAC,eAAe,CAC3B,gBAA0C,EAC1C,oBAAkC,EAClC,MAA6B,EAC7B,kBAA4B;QAE5B,IAAI,gBAAgB,KAAK,SAAS,EAAE;YACnC,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC;YACtC,MAAM,YAAY,GACjB,sDAAmD,CAAC,eAAe,CAClE,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAiB,EAC7C,gBAAgB,CAChB,CAAC;YACH,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC;SAC7C;QACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CACxD,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,EACN,kBAAkB,CAClB,CAAC;QACF,OAAO,IAAI,qEAAiC,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;IAEM,KAAK,CAAC,qBAAqB,CAAC,WAAyB;QAC3D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAC7E,OAAO,IAAI,qEAAiC,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CACD;AApCD,4FAoCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { DocumentServiceFactoryProxy } from \"../../documentServiceFactoryProxy\";\nimport { ICompressionStorageConfig } from \"..\";\nimport { DocumentStorageServiceCompressionAdapter as DocumentStorageServiceSummaryBlobCompressionAdapter } from \"./summaryblob\";\nimport { DocumentServiceCompressionAdapter } from \"./documentServiceCompressionAdapter\";\n\nexport class DocumentServiceFactoryCompressionAdapter extends DocumentServiceFactoryProxy {\n\tconstructor(\n\t\tserviceFactory: IDocumentServiceFactory,\n\t\tprivate readonly _config: ICompressionStorageConfig,\n\t) {\n\t\tsuper(serviceFactory);\n\t}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tif (createNewSummary !== undefined) {\n\t\t\tconst configForInitial = this._config;\n\t\t\tconst newAppSumary =\n\t\t\t\tDocumentStorageServiceSummaryBlobCompressionAdapter.compressSummary(\n\t\t\t\t\tcreateNewSummary.tree[\".app\"] as ISummaryTree,\n\t\t\t\t\tconfigForInitial,\n\t\t\t\t);\n\t\t\tcreateNewSummary.tree[\".app\"] = newAppSumary;\n\t\t}\n\t\tconst service = await this.serviceFactory.createContainer(\n\t\t\tcreateNewSummary,\n\t\t\tcreateNewResolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t\treturn new DocumentServiceCompressionAdapter(service, this._config);\n\t}\n\n\tpublic async createDocumentService(resolvedUrl: IResolvedUrl): Promise<IDocumentService> {\n\t\tconst service = await this.serviceFactory.createDocumentService(resolvedUrl);\n\t\treturn new DocumentServiceCompressionAdapter(service, this._config);\n\t}\n}\n"]}
1
+ {"version":3,"file":"documentServiceFactoryCompressionAdapter.js","sourceRoot":"","sources":["../../../src/adapters/compression/documentServiceFactoryCompressionAdapter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,mFAAgF;AAEhF,+CAAgI;AAChI,2FAAwF;AAExF,MAAa,wCAAyC,SAAQ,yDAA2B;IACxF,YACC,cAAuC,EACtB,OAAkC;QAEnD,KAAK,CAAC,cAAc,CAAC,CAAC;QAFL,YAAO,GAAP,OAAO,CAA2B;IAGpD,CAAC;IAEM,KAAK,CAAC,eAAe,CAC3B,gBAA0C,EAC1C,oBAAkC,EAClC,MAA6B,EAC7B,kBAA4B;QAE5B,IAAI,gBAAgB,KAAK,SAAS,EAAE;YACnC,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC;YACtC,MAAM,YAAY,GACjB,sDAAmD,CAAC,eAAe,CAClE,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAiB,EAC7C,gBAAgB,CAChB,CAAC;YACH,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC;SAC7C;QACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CACxD,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,EACN,kBAAkB,CAClB,CAAC;QACF,OAAO,IAAI,qEAAiC,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;IAEM,KAAK,CAAC,qBAAqB,CAAC,WAAyB;QAC3D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAC7E,OAAO,IAAI,qEAAiC,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CACD;AApCD,4FAoCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { DocumentServiceFactoryProxy } from \"../../documentServiceFactoryProxy\";\nimport { ICompressionStorageConfig } from \"./compressionTypes\";\nimport { DocumentStorageServiceCompressionAdapter as DocumentStorageServiceSummaryBlobCompressionAdapter } from \"./summaryblob\";\nimport { DocumentServiceCompressionAdapter } from \"./documentServiceCompressionAdapter\";\n\nexport class DocumentServiceFactoryCompressionAdapter extends DocumentServiceFactoryProxy {\n\tconstructor(\n\t\tserviceFactory: IDocumentServiceFactory,\n\t\tprivate readonly _config: ICompressionStorageConfig,\n\t) {\n\t\tsuper(serviceFactory);\n\t}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tif (createNewSummary !== undefined) {\n\t\t\tconst configForInitial = this._config;\n\t\t\tconst newAppSumary =\n\t\t\t\tDocumentStorageServiceSummaryBlobCompressionAdapter.compressSummary(\n\t\t\t\t\tcreateNewSummary.tree[\".app\"] as ISummaryTree,\n\t\t\t\t\tconfigForInitial,\n\t\t\t\t);\n\t\t\tcreateNewSummary.tree[\".app\"] = newAppSumary;\n\t\t}\n\t\tconst service = await this.serviceFactory.createContainer(\n\t\t\tcreateNewSummary,\n\t\t\tcreateNewResolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t\treturn new DocumentServiceCompressionAdapter(service, this._config);\n\t}\n\n\tpublic async createDocumentService(resolvedUrl: IResolvedUrl): Promise<IDocumentService> {\n\t\tconst service = await this.serviceFactory.createDocumentService(resolvedUrl);\n\t\treturn new DocumentServiceCompressionAdapter(service, this._config);\n\t}\n}\n"]}
@@ -79,10 +79,8 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
79
79
 
80
80
  /* Excluded from this release type: getRetryDelaySecondsFromError */
81
81
 
82
- /* Excluded from this release type: IAuthorizationError */
83
-
84
82
  /**
85
- * @alpha
83
+ * @public
86
84
  */
87
85
  export declare interface ICompressionStorageConfig {
88
86
  algorithm: SummaryCompressionAlgorithm;
@@ -93,8 +91,6 @@ export declare interface ICompressionStorageConfig {
93
91
 
94
92
  /* Excluded from this release type: IFluidErrorBase */
95
93
 
96
- /* Excluded from this release type: ILocationRedirectionError */
97
-
98
94
  /* Excluded from this release type: InsecureUrlResolver */
99
95
 
100
96
  /* Excluded from this release type: IProgress */
@@ -105,8 +101,6 @@ export declare interface ICompressionStorageConfig {
105
101
 
106
102
  /* Excluded from this release type: isRuntimeMessage */
107
103
 
108
- /* Excluded from this release type: IThrottlingWarning */
109
-
110
104
  /* Excluded from this release type: LocationRedirectionError */
111
105
 
112
106
  /* Excluded from this release type: LoggingError */
@@ -153,7 +147,7 @@ export declare class RateLimiter {
153
147
  /* Excluded from this release type: streamObserver */
154
148
 
155
149
  /**
156
- * @alpha
150
+ * @public
157
151
  */
158
152
  export declare enum SummaryCompressionAlgorithm {
159
153
  None = 0,
@@ -83,7 +83,13 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
83
83
 
84
84
  /* Excluded from this release type: IAuthorizationError */
85
85
 
86
- /* Excluded from this release type: ICompressionStorageConfig */
86
+ /**
87
+ * @public
88
+ */
89
+ export declare interface ICompressionStorageConfig {
90
+ algorithm: SummaryCompressionAlgorithm;
91
+ minSizeToCompress: number;
92
+ }
87
93
 
88
94
  /* Excluded from this release type: IDeltasFetchResult */
89
95
 
@@ -93,8 +99,6 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
93
99
 
94
100
  /* Excluded from this release type: IDocumentStorageServicePolicies */
95
101
 
96
- /* Excluded from this release type: IDriverErrorBase */
97
-
98
102
  /* Excluded from this release type: IFluidErrorBase */
99
103
 
100
104
  /* Excluded from this release type: ILocationRedirectionError */
@@ -103,8 +107,6 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
103
107
 
104
108
  /* Excluded from this release type: IProgress */
105
109
 
106
- /* Excluded from this release type: IRequest */
107
-
108
110
  /* Excluded from this release type: IResolvedUrl */
109
111
 
110
112
  /* Excluded from this release type: isCombinedAppAndProtocolSummary */
@@ -119,12 +121,6 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
119
121
 
120
122
  /* Excluded from this release type: ISummaryContext */
121
123
 
122
- /* Excluded from this release type: ITelemetryErrorEvent */
123
-
124
- /* Excluded from this release type: ITelemetryLoggerExt */
125
-
126
- /* Excluded from this release type: ITelemetryProperties */
127
-
128
124
  /* Excluded from this release type: IThrottlingWarning */
129
125
 
130
126
  /* Excluded from this release type: IUrlResolver */
@@ -165,7 +161,13 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
165
161
 
166
162
  /* Excluded from this release type: streamObserver */
167
163
 
168
- /* Excluded from this release type: SummaryCompressionAlgorithm */
164
+ /**
165
+ * @public
166
+ */
167
+ export declare enum SummaryCompressionAlgorithm {
168
+ None = 0,
169
+ LZ4 = 1
170
+ }
169
171
 
170
172
  /* Excluded from this release type: ThrottlingError */
171
173
 
@@ -83,7 +83,13 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
83
83
 
84
84
  /* Excluded from this release type: IAuthorizationError */
85
85
 
86
- /* Excluded from this release type: ICompressionStorageConfig */
86
+ /**
87
+ * @public
88
+ */
89
+ export declare interface ICompressionStorageConfig {
90
+ algorithm: SummaryCompressionAlgorithm;
91
+ minSizeToCompress: number;
92
+ }
87
93
 
88
94
  /* Excluded from this release type: IDeltasFetchResult */
89
95
 
@@ -93,8 +99,6 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
93
99
 
94
100
  /* Excluded from this release type: IDocumentStorageServicePolicies */
95
101
 
96
- /* Excluded from this release type: IDriverErrorBase */
97
-
98
102
  /* Excluded from this release type: IFluidErrorBase */
99
103
 
100
104
  /* Excluded from this release type: ILocationRedirectionError */
@@ -103,8 +107,6 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
103
107
 
104
108
  /* Excluded from this release type: IProgress */
105
109
 
106
- /* Excluded from this release type: IRequest */
107
-
108
110
  /* Excluded from this release type: IResolvedUrl */
109
111
 
110
112
  /* Excluded from this release type: isCombinedAppAndProtocolSummary */
@@ -119,12 +121,6 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
119
121
 
120
122
  /* Excluded from this release type: ISummaryContext */
121
123
 
122
- /* Excluded from this release type: ITelemetryErrorEvent */
123
-
124
- /* Excluded from this release type: ITelemetryLoggerExt */
125
-
126
- /* Excluded from this release type: ITelemetryProperties */
127
-
128
124
  /* Excluded from this release type: IThrottlingWarning */
129
125
 
130
126
  /* Excluded from this release type: IUrlResolver */
@@ -165,7 +161,13 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
165
161
 
166
162
  /* Excluded from this release type: streamObserver */
167
163
 
168
- /* Excluded from this release type: SummaryCompressionAlgorithm */
164
+ /**
165
+ * @public
166
+ */
167
+ export declare enum SummaryCompressionAlgorithm {
168
+ None = 0,
169
+ LZ4 = 1
170
+ }
169
171
 
170
172
  /* Excluded from this release type: ThrottlingError */
171
173
 
@@ -253,7 +253,7 @@ export declare const getRetryDelayFromError: (error: any) => number | undefined;
253
253
  export declare const getRetryDelaySecondsFromError: (error: any) => number | undefined;
254
254
 
255
255
  /**
256
- * @alpha
256
+ * @public
257
257
  */
258
258
  export declare interface ICompressionStorageConfig {
259
259
  algorithm: SummaryCompressionAlgorithm;
@@ -542,7 +542,7 @@ export declare function streamFromMessages(messagesArg: Promise<ISequencedDocume
542
542
  export declare function streamObserver<T>(stream: IStream<T>, handler: (value: IStreamResult<T>) => void): IStream<T>;
543
543
 
544
544
  /**
545
- * @alpha
545
+ * @public
546
546
  */
547
547
  export declare enum SummaryCompressionAlgorithm {
548
548
  None = 0,
@@ -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.8.0.1";
8
+ export declare const pkgVersion = "2.0.0-rc.1.0.1";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,iCAAiC,CAAC;AACtD,eAAO,MAAM,UAAU,yBAAyB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,iCAAiC,CAAC;AACtD,eAAO,MAAM,UAAU,mBAAmB,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/driver-utils";
11
- exports.pkgVersion = "2.0.0-internal.8.0.1";
11
+ exports.pkgVersion = "2.0.0-rc.1.0.1";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,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.8.0.1\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.0.0-rc.1.0.1\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"runWithRetry.d.ts","sourceRoot":"","sources":["../src/runWithRetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAgB,MAAM,iCAAiC,CAAC;AAQpF;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACzB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;;;;OAOG;IACH,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;CAC9C;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,CAAC,EACnC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,EACzC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,SAAS,GACjB,OAAO,CAAC,CAAC,CAAC,CAsFZ;AAKD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAU5E"}
1
+ {"version":3,"file":"runWithRetry.d.ts","sourceRoot":"","sources":["../src/runWithRetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAgB,MAAM,iCAAiC,CAAC;AAOpF;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACzB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;;;;OAOG;IACH,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;CAC9C;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,CAAC,EACnC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,EACzC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,SAAS,GACjB,OAAO,CAAC,CAAC,CAAC,CAsFZ;AAKD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAU5E"}
@@ -11,7 +11,6 @@ const core_utils_1 = require("@fluidframework/core-utils");
11
11
  const driver_definitions_1 = require("@fluidframework/driver-definitions");
12
12
  const network_1 = require("./network");
13
13
  const packageVersion_1 = require("./packageVersion");
14
- const _1 = require(".");
15
14
  /**
16
15
  * @internal
17
16
  */
@@ -47,7 +46,7 @@ async function runWithRetry(api, fetchCallName, logger, progress) {
47
46
  fetchCallName,
48
47
  reason: progress.cancel.reason,
49
48
  }, err);
50
- throw new _1.NonRetryableError("runWithRetry was Aborted", driver_definitions_1.DriverErrorTypes.genericError, {
49
+ throw new network_1.NonRetryableError("runWithRetry was Aborted", driver_definitions_1.DriverErrorTypes.genericError, {
51
50
  driverVersion: packageVersion_1.pkgVersion,
52
51
  fetchCallName,
53
52
  reason: progress.cancel.reason,
@@ -100,7 +99,7 @@ const MaxReconnectDelayInMsWhenEndpointIsNotReachable = 8000;
100
99
  function calculateMaxWaitTime(delayMs, error) {
101
100
  const retryDelayFromError = (0, network_1.getRetryDelayFromError)(error);
102
101
  let newDelayMs = Math.max(retryDelayFromError ?? 0, delayMs * 2);
103
- newDelayMs = Math.min(delayMs, (0, telemetry_utils_1.isFluidError)(error) && error.getTelemetryProperties().endpointReached === true
102
+ newDelayMs = Math.min(newDelayMs, (0, telemetry_utils_1.isFluidError)(error) && error.getTelemetryProperties().endpointReached === true
104
103
  ? MaxReconnectDelayInMsWhenEndpointIsReachable
105
104
  : MaxReconnectDelayInMsWhenEndpointIsNotReachable);
106
105
  return newDelayMs;
@@ -1 +1 @@
1
- {"version":3,"file":"runWithRetry.js","sourceRoot":"","sources":["../src/runWithRetry.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt, isFluidError } from \"@fluidframework/telemetry-utils\";\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { delay } from \"@fluidframework/core-utils\";\nimport { DriverErrorTypes } from \"@fluidframework/driver-definitions\";\nimport { canRetryOnError, getRetryDelayFromError } from \"./network\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { NonRetryableError } from \".\";\n\n/**\n * Interface describing an object passed to various network APIs.\n * It allows caller to control cancellation, as well as learn about any delays.\n * @internal\n */\nexport interface IProgress {\n\t/**\n\t * Abort signal used to cancel operation.\n\t *\n\t * @remarks Note that most of the layers do not use this signal yet. We need to change that over time.\n\t * Please consult with API documentation / implementation.\n\t * Note that number of layers may not check this signal while holding this request in a queue,\n\t * so it may take a while it takes effect. This can be improved in the future.\n\t *\n\t * The layers in question are:\n\t *\n\t * - driver (RateLimiter)\n\t *\n\t * - runWithRetry\n\t */\n\tcancel?: AbortSignal;\n\n\t/**\n\t * Called whenever api returns cancellable error and the call is going to be retried.\n\t * Any exception thrown from this call back result in cancellation of operation\n\t * and propagation of thrown exception.\n\t * @param delayInMs - delay before next retry. This value will depend on internal back-off logic,\n\t * as well as information provided by service (like 429 error asking to wait for some time before retry)\n\t * @param error - error object returned from the call.\n\t */\n\tonRetry?(delayInMs: number, error: any): void;\n}\n\n/**\n * @internal\n */\nexport async function runWithRetry<T>(\n\tapi: (cancel?: AbortSignal) => Promise<T>,\n\tfetchCallName: string,\n\tlogger: ITelemetryLoggerExt,\n\tprogress: IProgress,\n): Promise<T> {\n\tlet result: T | undefined;\n\tlet success = false;\n\t// We double this value in first try in when we calculate time to wait for in \"calculateMaxWaitTime\" function.\n\tlet retryAfterMs = 500; // has to be positive!\n\tlet numRetries = 0;\n\tconst startTime = performance.now();\n\tlet lastError: any;\n\tdo {\n\t\ttry {\n\t\t\tresult = await api(progress.cancel);\n\t\t\tsuccess = true;\n\t\t} catch (err) {\n\t\t\t// If it is not retriable, then just throw the error.\n\t\t\tif (!canRetryOnError(err)) {\n\t\t\t\tlogger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: `${fetchCallName}_cancel`,\n\t\t\t\t\t\tretry: numRetries,\n\t\t\t\t\t\tduration: performance.now() - startTime,\n\t\t\t\t\t\tfetchCallName,\n\t\t\t\t\t},\n\t\t\t\t\terr,\n\t\t\t\t);\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\tif (progress.cancel?.aborted === true) {\n\t\t\t\tlogger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: `${fetchCallName}_runWithRetryAborted`,\n\t\t\t\t\t\tretry: numRetries,\n\t\t\t\t\t\tduration: performance.now() - startTime,\n\t\t\t\t\t\tfetchCallName,\n\t\t\t\t\t\treason: progress.cancel.reason,\n\t\t\t\t\t},\n\t\t\t\t\terr,\n\t\t\t\t);\n\t\t\t\tthrow new NonRetryableError(\n\t\t\t\t\t\"runWithRetry was Aborted\",\n\t\t\t\t\tDriverErrorTypes.genericError,\n\t\t\t\t\t{\n\t\t\t\t\t\tdriverVersion: pkgVersion,\n\t\t\t\t\t\tfetchCallName,\n\t\t\t\t\t\treason: progress.cancel.reason,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// logging the first failed retry instead of every attempt. We want to avoid filling telemetry\n\t\t\t// when we have tight loop of retrying in offline mode, but we also want to know what caused\n\t\t\t// the failure in the first place\n\t\t\tif (numRetries === 0) {\n\t\t\t\tlogger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: `${fetchCallName}_firstFailed`,\n\t\t\t\t\t\tduration: performance.now() - startTime,\n\t\t\t\t\t\tfetchCallName,\n\t\t\t\t\t},\n\t\t\t\t\terr,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tnumRetries++;\n\t\t\tlastError = err;\n\t\t\t// Wait for the calculated time before retrying.\n\t\t\tretryAfterMs = calculateMaxWaitTime(retryAfterMs, err);\n\t\t\tif (progress.onRetry) {\n\t\t\t\tprogress.onRetry(retryAfterMs, err);\n\t\t\t}\n\t\t\tawait delay(retryAfterMs);\n\t\t}\n\t} while (!success);\n\tif (numRetries > 0) {\n\t\tlogger.sendTelemetryEvent(\n\t\t\t{\n\t\t\t\teventName: `${fetchCallName}_lastError`,\n\t\t\t\tretry: numRetries,\n\t\t\t\tduration: performance.now() - startTime,\n\t\t\t\tfetchCallName,\n\t\t\t},\n\t\t\tlastError,\n\t\t);\n\t}\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\treturn result!;\n}\n\nconst MaxReconnectDelayInMsWhenEndpointIsReachable = 60000;\nconst MaxReconnectDelayInMsWhenEndpointIsNotReachable = 8000;\n\n/**\n * Calculates time to wait for after an error based on the error and wait time for previous iteration.\n * In case endpoint(service or socket) is not reachable, then we maybe offline or may have got some\n * transient error not related to endpoint, in that case we want to try at faster pace and hence the\n * max wait is lesser 8s as compared to when endpoint is reachable in which case it is 60s.\n * @param delayMs - wait time for previous iteration\n * @param error - error based on which we decide wait time.\n * @returns Wait time to wait for.\n * @internal\n */\nexport function calculateMaxWaitTime(delayMs: number, error: unknown): number {\n\tconst retryDelayFromError = getRetryDelayFromError(error);\n\tlet newDelayMs = Math.max(retryDelayFromError ?? 0, delayMs * 2);\n\tnewDelayMs = Math.min(\n\t\tdelayMs,\n\t\tisFluidError(error) && error.getTelemetryProperties().endpointReached === true\n\t\t\t? MaxReconnectDelayInMsWhenEndpointIsReachable\n\t\t\t: MaxReconnectDelayInMsWhenEndpointIsNotReachable,\n\t);\n\treturn newDelayMs;\n}\n"]}
1
+ {"version":3,"file":"runWithRetry.js","sourceRoot":"","sources":["../src/runWithRetry.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt, isFluidError } from \"@fluidframework/telemetry-utils\";\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { delay } from \"@fluidframework/core-utils\";\nimport { DriverErrorTypes } from \"@fluidframework/driver-definitions\";\nimport { canRetryOnError, getRetryDelayFromError, NonRetryableError } from \"./network\";\nimport { pkgVersion } from \"./packageVersion\";\n\n/**\n * Interface describing an object passed to various network APIs.\n * It allows caller to control cancellation, as well as learn about any delays.\n * @internal\n */\nexport interface IProgress {\n\t/**\n\t * Abort signal used to cancel operation.\n\t *\n\t * @remarks Note that most of the layers do not use this signal yet. We need to change that over time.\n\t * Please consult with API documentation / implementation.\n\t * Note that number of layers may not check this signal while holding this request in a queue,\n\t * so it may take a while it takes effect. This can be improved in the future.\n\t *\n\t * The layers in question are:\n\t *\n\t * - driver (RateLimiter)\n\t *\n\t * - runWithRetry\n\t */\n\tcancel?: AbortSignal;\n\n\t/**\n\t * Called whenever api returns cancellable error and the call is going to be retried.\n\t * Any exception thrown from this call back result in cancellation of operation\n\t * and propagation of thrown exception.\n\t * @param delayInMs - delay before next retry. This value will depend on internal back-off logic,\n\t * as well as information provided by service (like 429 error asking to wait for some time before retry)\n\t * @param error - error object returned from the call.\n\t */\n\tonRetry?(delayInMs: number, error: any): void;\n}\n\n/**\n * @internal\n */\nexport async function runWithRetry<T>(\n\tapi: (cancel?: AbortSignal) => Promise<T>,\n\tfetchCallName: string,\n\tlogger: ITelemetryLoggerExt,\n\tprogress: IProgress,\n): Promise<T> {\n\tlet result: T | undefined;\n\tlet success = false;\n\t// We double this value in first try in when we calculate time to wait for in \"calculateMaxWaitTime\" function.\n\tlet retryAfterMs = 500; // has to be positive!\n\tlet numRetries = 0;\n\tconst startTime = performance.now();\n\tlet lastError: any;\n\tdo {\n\t\ttry {\n\t\t\tresult = await api(progress.cancel);\n\t\t\tsuccess = true;\n\t\t} catch (err) {\n\t\t\t// If it is not retriable, then just throw the error.\n\t\t\tif (!canRetryOnError(err)) {\n\t\t\t\tlogger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: `${fetchCallName}_cancel`,\n\t\t\t\t\t\tretry: numRetries,\n\t\t\t\t\t\tduration: performance.now() - startTime,\n\t\t\t\t\t\tfetchCallName,\n\t\t\t\t\t},\n\t\t\t\t\terr,\n\t\t\t\t);\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\tif (progress.cancel?.aborted === true) {\n\t\t\t\tlogger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: `${fetchCallName}_runWithRetryAborted`,\n\t\t\t\t\t\tretry: numRetries,\n\t\t\t\t\t\tduration: performance.now() - startTime,\n\t\t\t\t\t\tfetchCallName,\n\t\t\t\t\t\treason: progress.cancel.reason,\n\t\t\t\t\t},\n\t\t\t\t\terr,\n\t\t\t\t);\n\t\t\t\tthrow new NonRetryableError(\n\t\t\t\t\t\"runWithRetry was Aborted\",\n\t\t\t\t\tDriverErrorTypes.genericError,\n\t\t\t\t\t{\n\t\t\t\t\t\tdriverVersion: pkgVersion,\n\t\t\t\t\t\tfetchCallName,\n\t\t\t\t\t\treason: progress.cancel.reason,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// logging the first failed retry instead of every attempt. We want to avoid filling telemetry\n\t\t\t// when we have tight loop of retrying in offline mode, but we also want to know what caused\n\t\t\t// the failure in the first place\n\t\t\tif (numRetries === 0) {\n\t\t\t\tlogger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: `${fetchCallName}_firstFailed`,\n\t\t\t\t\t\tduration: performance.now() - startTime,\n\t\t\t\t\t\tfetchCallName,\n\t\t\t\t\t},\n\t\t\t\t\terr,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tnumRetries++;\n\t\t\tlastError = err;\n\t\t\t// Wait for the calculated time before retrying.\n\t\t\tretryAfterMs = calculateMaxWaitTime(retryAfterMs, err);\n\t\t\tif (progress.onRetry) {\n\t\t\t\tprogress.onRetry(retryAfterMs, err);\n\t\t\t}\n\t\t\tawait delay(retryAfterMs);\n\t\t}\n\t} while (!success);\n\tif (numRetries > 0) {\n\t\tlogger.sendTelemetryEvent(\n\t\t\t{\n\t\t\t\teventName: `${fetchCallName}_lastError`,\n\t\t\t\tretry: numRetries,\n\t\t\t\tduration: performance.now() - startTime,\n\t\t\t\tfetchCallName,\n\t\t\t},\n\t\t\tlastError,\n\t\t);\n\t}\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\treturn result!;\n}\n\nconst MaxReconnectDelayInMsWhenEndpointIsReachable = 60000;\nconst MaxReconnectDelayInMsWhenEndpointIsNotReachable = 8000;\n\n/**\n * Calculates time to wait for after an error based on the error and wait time for previous iteration.\n * In case endpoint(service or socket) is not reachable, then we maybe offline or may have got some\n * transient error not related to endpoint, in that case we want to try at faster pace and hence the\n * max wait is lesser 8s as compared to when endpoint is reachable in which case it is 60s.\n * @param delayMs - wait time for previous iteration\n * @param error - error based on which we decide wait time.\n * @returns Wait time to wait for.\n * @internal\n */\nexport function calculateMaxWaitTime(delayMs: number, error: unknown): number {\n\tconst retryDelayFromError = getRetryDelayFromError(error);\n\tlet newDelayMs = Math.max(retryDelayFromError ?? 0, delayMs * 2);\n\tnewDelayMs = Math.min(\n\t\tnewDelayMs,\n\t\tisFluidError(error) && error.getTelemetryProperties().endpointReached === true\n\t\t\t? MaxReconnectDelayInMsWhenEndpointIsReachable\n\t\t\t: MaxReconnectDelayInMsWhenEndpointIsNotReachable,\n\t);\n\treturn newDelayMs;\n}\n"]}
@@ -3,14 +3,14 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * @alpha
6
+ * @public
7
7
  */
8
8
  export declare enum SummaryCompressionAlgorithm {
9
9
  None = 0,
10
10
  LZ4 = 1
11
11
  }
12
12
  /**
13
- * @alpha
13
+ * @public
14
14
  */
15
15
  export interface ICompressionStorageConfig {
16
16
  algorithm: SummaryCompressionAlgorithm;
@@ -20,4 +20,4 @@ export declare const DefaultCompressionStorageConfig: {
20
20
  algorithm: SummaryCompressionAlgorithm;
21
21
  minSizeToCompress: number;
22
22
  };
23
- //# sourceMappingURL=compressionTypes.d.ts.map
23
+ //# sourceMappingURL=compressionTypes.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compressionTypes.d.mts","sourceRoot":"","sources":["../../../src/adapters/compression/compressionTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,oBAAY,2BAA2B;IACtC,IAAI,IAAI;IACR,GAAG,IAAI;CACP;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,SAAS,EAAE,2BAA2B,CAAC;IACvC,iBAAiB,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,+BAA+B;;;CAG3C,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * @alpha
6
+ * @public
7
7
  */
8
8
  export var SummaryCompressionAlgorithm;
9
9
  (function (SummaryCompressionAlgorithm) {
@@ -14,4 +14,4 @@ export const DefaultCompressionStorageConfig = {
14
14
  algorithm: SummaryCompressionAlgorithm.LZ4,
15
15
  minSizeToCompress: 500,
16
16
  };
17
- //# sourceMappingURL=compressionTypes.js.map
17
+ //# sourceMappingURL=compressionTypes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compressionTypes.mjs","sourceRoot":"","sources":["../../../src/adapters/compression/compressionTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACtC,6EAAQ,CAAA;IACR,2EAAO,CAAA;AACR,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC;AAUD,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC9C,SAAS,EAAE,2BAA2B,CAAC,GAAG;IAC1C,iBAAiB,EAAE,GAAG;CACtB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @public\n */\nexport enum SummaryCompressionAlgorithm {\n\tNone = 0,\n\tLZ4 = 1,\n}\n\n/**\n * @public\n */\nexport interface ICompressionStorageConfig {\n\talgorithm: SummaryCompressionAlgorithm;\n\tminSizeToCompress: number;\n}\n\nexport const DefaultCompressionStorageConfig = {\n\talgorithm: SummaryCompressionAlgorithm.LZ4,\n\tminSizeToCompress: 500,\n};\n"]}
@@ -3,11 +3,11 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { IDocumentService, IDocumentStorageService } from "@fluidframework/driver-definitions";
6
- import { DocumentServiceProxy } from "../../documentServiceProxy";
7
- import { ICompressionStorageConfig } from "./compressionTypes";
6
+ import { DocumentServiceProxy } from "../../documentServiceProxy.mjs";
7
+ import { ICompressionStorageConfig } from "./compressionTypes.mjs";
8
8
  export declare class DocumentServiceCompressionAdapter extends DocumentServiceProxy {
9
9
  private readonly _config;
10
10
  constructor(service: IDocumentService, _config: ICompressionStorageConfig);
11
11
  connectToStorage(): Promise<IDocumentStorageService>;
12
12
  }
13
- //# sourceMappingURL=documentServiceCompressionAdapter.d.ts.map
13
+ //# sourceMappingURL=documentServiceCompressionAdapter.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentServiceCompressionAdapter.d.mts","sourceRoot":"","sources":["../../../src/adapters/compression/documentServiceCompressionAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,oCAAoC;OACvF,EAAE,oBAAoB,EAAE;OAExB,EAAE,yBAAyB,EAAE;AAEpC,qBAAa,iCAAkC,SAAQ,oBAAoB;IAGzE,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADxB,OAAO,EAAE,gBAAgB,EACR,OAAO,EAAE,yBAAyB;IAKvC,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC;CASjE"}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { DocumentServiceProxy } from "../../documentServiceProxy";
6
- import { DocumentStorageServiceCompressionAdapter as DocumentStorageServiceSummaryBlobCompressionAdapter } from "./summaryblob";
5
+ import { DocumentServiceProxy } from "../../documentServiceProxy.mjs";
6
+ import { DocumentStorageServiceCompressionAdapter as DocumentStorageServiceSummaryBlobCompressionAdapter } from "./summaryblob/index.mjs";
7
7
  export class DocumentServiceCompressionAdapter extends DocumentServiceProxy {
8
8
  constructor(service, _config) {
9
9
  super(service);
@@ -16,4 +16,4 @@ export class DocumentServiceCompressionAdapter extends DocumentServiceProxy {
16
16
  return wrapped;
17
17
  }
18
18
  }
19
- //# sourceMappingURL=documentServiceCompressionAdapter.js.map
19
+ //# sourceMappingURL=documentServiceCompressionAdapter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentServiceCompressionAdapter.mjs","sourceRoot":"","sources":["../../../src/adapters/compression/documentServiceCompressionAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAAE,oBAAoB,EAAE;OACxB,EAAE,wCAAwC,IAAI,mDAAmD,EAAE;AAG1G,MAAM,OAAO,iCAAkC,SAAQ,oBAAoB;IAC1E,YACC,OAAyB,EACR,OAAkC;QAEnD,KAAK,CAAC,OAAO,CAAC,CAAC;QAFE,YAAO,GAAP,OAAO,CAA2B;IAGpD,CAAC;IAEM,KAAK,CAAC,gBAAgB;QAC5B,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAC/C,MAAM,OAAO,GAAG,IAAI,mDAAmD,CACtE,OAAO,EACP,IAAI,CAAC,OAAO,CACZ,CAAC;QACF,MAAM,OAAO,CAAC,eAAe,EAAE,CAAC;QAChC,OAAO,OAAO,CAAC;IAChB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDocumentService, IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { DocumentServiceProxy } from \"../../documentServiceProxy\";\nimport { DocumentStorageServiceCompressionAdapter as DocumentStorageServiceSummaryBlobCompressionAdapter } from \"./summaryblob\";\nimport { ICompressionStorageConfig } from \"./compressionTypes\";\n\nexport class DocumentServiceCompressionAdapter extends DocumentServiceProxy {\n\tconstructor(\n\t\tservice: IDocumentService,\n\t\tprivate readonly _config: ICompressionStorageConfig,\n\t) {\n\t\tsuper(service);\n\t}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\tconst storage = await super.connectToStorage();\n\t\tconst wrapped = new DocumentStorageServiceSummaryBlobCompressionAdapter(\n\t\t\tstorage,\n\t\t\tthis._config,\n\t\t);\n\t\tawait wrapped.getSnapshotTree();\n\t\treturn wrapped;\n\t}\n}\n"]}
@@ -5,12 +5,12 @@
5
5
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
6
  import { IDocumentService, IDocumentServiceFactory, IResolvedUrl } from "@fluidframework/driver-definitions";
7
7
  import { ISummaryTree } from "@fluidframework/protocol-definitions";
8
- import { DocumentServiceFactoryProxy } from "../../documentServiceFactoryProxy";
9
- import { ICompressionStorageConfig } from "..";
8
+ import { DocumentServiceFactoryProxy } from "../../documentServiceFactoryProxy.mjs";
9
+ import { ICompressionStorageConfig } from "./compressionTypes.mjs";
10
10
  export declare class DocumentServiceFactoryCompressionAdapter extends DocumentServiceFactoryProxy {
11
11
  private readonly _config;
12
12
  constructor(serviceFactory: IDocumentServiceFactory, _config: ICompressionStorageConfig);
13
13
  createContainer(createNewSummary: ISummaryTree | undefined, createNewResolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
14
14
  createDocumentService(resolvedUrl: IResolvedUrl): Promise<IDocumentService>;
15
15
  }
16
- //# sourceMappingURL=documentServiceFactoryCompressionAdapter.d.ts.map
16
+ //# sourceMappingURL=documentServiceFactoryCompressionAdapter.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentServiceFactoryCompressionAdapter.d.mts","sourceRoot":"","sources":["../../../src/adapters/compression/documentServiceFactoryCompressionAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,oBAAoB,EAAE,MAAM,iCAAiC;OAC/D,EACN,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC;OACpC,EAAE,YAAY,EAAE,MAAM,sCAAsC;OAC5D,EAAE,2BAA2B,EAAE;OAC/B,EAAE,yBAAyB,EAAE;AAIpC,qBAAa,wCAAyC,SAAQ,2BAA2B;IAGvF,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADxB,cAAc,EAAE,uBAAuB,EACtB,OAAO,EAAE,yBAAyB;IAKvC,eAAe,CAC3B,gBAAgB,EAAE,YAAY,GAAG,SAAS,EAC1C,oBAAoB,EAAE,YAAY,EAClC,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAmBf,qBAAqB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAIxF"}
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { DocumentServiceFactoryProxy } from "../../documentServiceFactoryProxy";
6
- import { DocumentStorageServiceCompressionAdapter as DocumentStorageServiceSummaryBlobCompressionAdapter } from "./summaryblob";
7
- import { DocumentServiceCompressionAdapter } from "./documentServiceCompressionAdapter";
5
+ import { DocumentServiceFactoryProxy } from "../../documentServiceFactoryProxy.mjs";
6
+ import { DocumentStorageServiceCompressionAdapter as DocumentStorageServiceSummaryBlobCompressionAdapter } from "./summaryblob/index.mjs";
7
+ import { DocumentServiceCompressionAdapter } from "./documentServiceCompressionAdapter.mjs";
8
8
  export class DocumentServiceFactoryCompressionAdapter extends DocumentServiceFactoryProxy {
9
9
  constructor(serviceFactory, _config) {
10
10
  super(serviceFactory);
@@ -24,4 +24,4 @@ export class DocumentServiceFactoryCompressionAdapter extends DocumentServiceFac
24
24
  return new DocumentServiceCompressionAdapter(service, this._config);
25
25
  }
26
26
  }
27
- //# sourceMappingURL=documentServiceFactoryCompressionAdapter.js.map
27
+ //# sourceMappingURL=documentServiceFactoryCompressionAdapter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentServiceFactoryCompressionAdapter.mjs","sourceRoot":"","sources":["../../../src/adapters/compression/documentServiceFactoryCompressionAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;OASI,EAAE,2BAA2B,EAAE;OAE/B,EAAE,wCAAwC,IAAI,mDAAmD,EAAE;OACnG,EAAE,iCAAiC,EAAE;AAE5C,MAAM,OAAO,wCAAyC,SAAQ,2BAA2B;IACxF,YACC,cAAuC,EACtB,OAAkC;QAEnD,KAAK,CAAC,cAAc,CAAC,CAAC;QAFL,YAAO,GAAP,OAAO,CAA2B;IAGpD,CAAC;IAEM,KAAK,CAAC,eAAe,CAC3B,gBAA0C,EAC1C,oBAAkC,EAClC,MAA6B,EAC7B,kBAA4B;QAE5B,IAAI,gBAAgB,KAAK,SAAS,EAAE;YACnC,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC;YACtC,MAAM,YAAY,GACjB,mDAAmD,CAAC,eAAe,CAClE,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAiB,EAC7C,gBAAgB,CAChB,CAAC;YACH,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC;SAC7C;QACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CACxD,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,EACN,kBAAkB,CAClB,CAAC;QACF,OAAO,IAAI,iCAAiC,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;IAEM,KAAK,CAAC,qBAAqB,CAAC,WAAyB;QAC3D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAC7E,OAAO,IAAI,iCAAiC,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { DocumentServiceFactoryProxy } from \"../../documentServiceFactoryProxy\";\nimport { ICompressionStorageConfig } from \"./compressionTypes\";\nimport { DocumentStorageServiceCompressionAdapter as DocumentStorageServiceSummaryBlobCompressionAdapter } from \"./summaryblob\";\nimport { DocumentServiceCompressionAdapter } from \"./documentServiceCompressionAdapter\";\n\nexport class DocumentServiceFactoryCompressionAdapter extends DocumentServiceFactoryProxy {\n\tconstructor(\n\t\tserviceFactory: IDocumentServiceFactory,\n\t\tprivate readonly _config: ICompressionStorageConfig,\n\t) {\n\t\tsuper(serviceFactory);\n\t}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tif (createNewSummary !== undefined) {\n\t\t\tconst configForInitial = this._config;\n\t\t\tconst newAppSumary =\n\t\t\t\tDocumentStorageServiceSummaryBlobCompressionAdapter.compressSummary(\n\t\t\t\t\tcreateNewSummary.tree[\".app\"] as ISummaryTree,\n\t\t\t\t\tconfigForInitial,\n\t\t\t\t);\n\t\t\tcreateNewSummary.tree[\".app\"] = newAppSumary;\n\t\t}\n\t\tconst service = await this.serviceFactory.createContainer(\n\t\t\tcreateNewSummary,\n\t\t\tcreateNewResolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t\treturn new DocumentServiceCompressionAdapter(service, this._config);\n\t}\n\n\tpublic async createDocumentService(resolvedUrl: IResolvedUrl): Promise<IDocumentService> {\n\t\tconst service = await this.serviceFactory.createDocumentService(resolvedUrl);\n\t\treturn new DocumentServiceCompressionAdapter(service, this._config);\n\t}\n}\n"]}