@fluidframework/runtime-utils 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.224419

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 (187) hide show
  1. package/.eslintrc.js +5 -7
  2. package/.mocharc.js +12 -0
  3. package/CHANGELOG.md +191 -0
  4. package/README.md +68 -1
  5. package/api-extractor-lint.json +4 -0
  6. package/api-extractor.json +2 -2
  7. package/api-report/runtime-utils.api.md +201 -0
  8. package/dist/{dataStoreHandleContextUtils.js → dataStoreHandleContextUtils.cjs} +5 -2
  9. package/dist/dataStoreHandleContextUtils.cjs.map +1 -0
  10. package/dist/dataStoreHandleContextUtils.d.ts +1 -0
  11. package/dist/dataStoreHandleContextUtils.d.ts.map +1 -1
  12. package/dist/{dataStoreHelpers.js → dataStoreHelpers.cjs} +44 -25
  13. package/dist/dataStoreHelpers.cjs.map +1 -0
  14. package/dist/dataStoreHelpers.d.ts +23 -4
  15. package/dist/dataStoreHelpers.d.ts.map +1 -1
  16. package/dist/index.cjs +44 -0
  17. package/dist/index.cjs.map +1 -0
  18. package/dist/index.d.ts +9 -9
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/{objectstoragepartition.js → objectstoragepartition.cjs} +4 -3
  21. package/dist/objectstoragepartition.cjs.map +1 -0
  22. package/dist/objectstoragepartition.d.ts +1 -0
  23. package/dist/objectstoragepartition.d.ts.map +1 -1
  24. package/dist/{objectstorageutils.js → objectstorageutils.cjs} +11 -15
  25. package/dist/objectstorageutils.cjs.map +1 -0
  26. package/dist/objectstorageutils.d.ts +6 -0
  27. package/dist/objectstorageutils.d.ts.map +1 -1
  28. package/dist/{requestParser.js → requestParser.cjs} +7 -11
  29. package/dist/requestParser.cjs.map +1 -0
  30. package/dist/requestParser.d.ts +1 -0
  31. package/dist/requestParser.d.ts.map +1 -1
  32. package/dist/runtime-utils-alpha.d.ts +155 -0
  33. package/dist/runtime-utils-beta.d.ts +103 -0
  34. package/dist/runtime-utils-public.d.ts +103 -0
  35. package/dist/runtime-utils-untrimmed.d.ts +306 -0
  36. package/dist/{runtimeFactoryHelper.js → runtimeFactoryHelper.cjs} +11 -12
  37. package/dist/runtimeFactoryHelper.cjs.map +1 -0
  38. package/dist/runtimeFactoryHelper.d.ts +4 -1
  39. package/dist/runtimeFactoryHelper.d.ts.map +1 -1
  40. package/dist/{summaryUtils.js → summaryUtils.cjs} +138 -34
  41. package/dist/summaryUtils.cjs.map +1 -0
  42. package/dist/summaryUtils.d.ts +66 -4
  43. package/dist/summaryUtils.d.ts.map +1 -1
  44. package/dist/tsdoc-metadata.json +11 -0
  45. package/dist/unpackUsedRoutes.cjs +34 -0
  46. package/dist/unpackUsedRoutes.cjs.map +1 -0
  47. package/dist/unpackUsedRoutes.d.ts +12 -0
  48. package/dist/unpackUsedRoutes.d.ts.map +1 -0
  49. package/dist/{utils.js → utils.cjs} +2 -1
  50. package/dist/utils.cjs.map +1 -0
  51. package/dist/utils.d.ts +7 -2
  52. package/dist/utils.d.ts.map +1 -1
  53. package/lib/{dataStoreHandleContextUtils.d.ts → dataStoreHandleContextUtils.d.mts} +1 -0
  54. package/lib/dataStoreHandleContextUtils.d.mts.map +1 -0
  55. package/lib/{dataStoreHandleContextUtils.js → dataStoreHandleContextUtils.mjs} +5 -2
  56. package/lib/dataStoreHandleContextUtils.mjs.map +1 -0
  57. package/lib/{dataStoreHelpers.d.ts → dataStoreHelpers.d.mts} +23 -4
  58. package/lib/dataStoreHelpers.d.mts.map +1 -0
  59. package/lib/{dataStoreHelpers.js → dataStoreHelpers.mjs} +42 -22
  60. package/lib/dataStoreHelpers.mjs.map +1 -0
  61. package/lib/index.d.mts +14 -0
  62. package/lib/index.d.mts.map +1 -0
  63. package/lib/index.mjs +14 -0
  64. package/lib/index.mjs.map +1 -0
  65. package/lib/{objectstoragepartition.d.ts → objectstoragepartition.d.mts} +1 -0
  66. package/lib/objectstoragepartition.d.mts.map +1 -0
  67. package/lib/{objectstoragepartition.js → objectstoragepartition.mjs} +3 -2
  68. package/lib/objectstoragepartition.mjs.map +1 -0
  69. package/lib/{objectstorageutils.d.ts → objectstorageutils.d.mts} +6 -0
  70. package/lib/objectstorageutils.d.mts.map +1 -0
  71. package/lib/{objectstorageutils.js → objectstorageutils.mjs} +11 -15
  72. package/lib/objectstorageutils.mjs.map +1 -0
  73. package/lib/{requestParser.d.ts → requestParser.d.mts} +1 -4
  74. package/lib/requestParser.d.mts.map +1 -0
  75. package/lib/{requestParser.js → requestParser.mjs} +7 -11
  76. package/lib/requestParser.mjs.map +1 -0
  77. package/lib/runtime-utils-alpha.d.mts +155 -0
  78. package/lib/runtime-utils-beta.d.mts +103 -0
  79. package/lib/runtime-utils-public.d.mts +103 -0
  80. package/lib/runtime-utils-untrimmed.d.mts +306 -0
  81. package/lib/{runtimeFactoryHelper.d.ts → runtimeFactoryHelper.d.mts} +4 -1
  82. package/lib/runtimeFactoryHelper.d.mts.map +1 -0
  83. package/lib/runtimeFactoryHelper.mjs +24 -0
  84. package/lib/runtimeFactoryHelper.mjs.map +1 -0
  85. package/lib/{summaryUtils.d.ts → summaryUtils.d.mts} +66 -4
  86. package/lib/summaryUtils.d.mts.map +1 -0
  87. package/lib/{summaryUtils.js → summaryUtils.mjs} +129 -26
  88. package/lib/summaryUtils.mjs.map +1 -0
  89. package/lib/unpackUsedRoutes.d.mts +12 -0
  90. package/lib/unpackUsedRoutes.d.mts.map +1 -0
  91. package/lib/unpackUsedRoutes.mjs +30 -0
  92. package/lib/unpackUsedRoutes.mjs.map +1 -0
  93. package/lib/{utils.d.ts → utils.d.mts} +7 -2
  94. package/lib/utils.d.mts.map +1 -0
  95. package/lib/{utils.js → utils.mjs} +2 -1
  96. package/lib/utils.mjs.map +1 -0
  97. package/package.json +102 -66
  98. package/prettier.config.cjs +8 -0
  99. package/src/dataStoreHandleContextUtils.ts +24 -16
  100. package/src/dataStoreHelpers.ts +106 -83
  101. package/src/index.ts +31 -9
  102. package/src/objectstoragepartition.ts +18 -14
  103. package/src/objectstorageutils.ts +37 -36
  104. package/src/requestParser.ts +81 -86
  105. package/src/runtimeFactoryHelper.ts +27 -26
  106. package/src/summaryUtils.ts +425 -299
  107. package/src/unpackUsedRoutes.ts +31 -0
  108. package/src/utils.ts +12 -7
  109. package/tsc-multi.test.json +4 -0
  110. package/tsconfig.json +10 -12
  111. package/dist/dataStoreHandleContextUtils.js.map +0 -1
  112. package/dist/dataStoreHelpers.js.map +0 -1
  113. package/dist/index.js +0 -26
  114. package/dist/index.js.map +0 -1
  115. package/dist/objectstoragepartition.js.map +0 -1
  116. package/dist/objectstorageutils.js.map +0 -1
  117. package/dist/packageVersion.d.ts +0 -9
  118. package/dist/packageVersion.d.ts.map +0 -1
  119. package/dist/packageVersion.js +0 -12
  120. package/dist/packageVersion.js.map +0 -1
  121. package/dist/requestParser.js.map +0 -1
  122. package/dist/runtimeFactoryHelper.js.map +0 -1
  123. package/dist/summarizerNode/index.d.ts +0 -8
  124. package/dist/summarizerNode/index.d.ts.map +0 -1
  125. package/dist/summarizerNode/index.js +0 -12
  126. package/dist/summarizerNode/index.js.map +0 -1
  127. package/dist/summarizerNode/summarizerNode.d.ts +0 -139
  128. package/dist/summarizerNode/summarizerNode.d.ts.map +0 -1
  129. package/dist/summarizerNode/summarizerNode.js +0 -480
  130. package/dist/summarizerNode/summarizerNode.js.map +0 -1
  131. package/dist/summarizerNode/summarizerNodeUtils.d.ts +0 -161
  132. package/dist/summarizerNode/summarizerNodeUtils.d.ts.map +0 -1
  133. package/dist/summarizerNode/summarizerNodeUtils.js +0 -225
  134. package/dist/summarizerNode/summarizerNodeUtils.js.map +0 -1
  135. package/dist/summarizerNode/summarizerNodeWithGc.d.ts +0 -133
  136. package/dist/summarizerNode/summarizerNodeWithGc.d.ts.map +0 -1
  137. package/dist/summarizerNode/summarizerNodeWithGc.js +0 -294
  138. package/dist/summarizerNode/summarizerNodeWithGc.js.map +0 -1
  139. package/dist/summaryUtils.js.map +0 -1
  140. package/dist/utils.js.map +0 -1
  141. package/lib/dataStoreHandleContextUtils.d.ts.map +0 -1
  142. package/lib/dataStoreHandleContextUtils.js.map +0 -1
  143. package/lib/dataStoreHelpers.d.ts.map +0 -1
  144. package/lib/dataStoreHelpers.js.map +0 -1
  145. package/lib/index.d.ts +0 -14
  146. package/lib/index.d.ts.map +0 -1
  147. package/lib/index.js +0 -14
  148. package/lib/index.js.map +0 -1
  149. package/lib/objectstoragepartition.d.ts.map +0 -1
  150. package/lib/objectstoragepartition.js.map +0 -1
  151. package/lib/objectstorageutils.d.ts.map +0 -1
  152. package/lib/objectstorageutils.js.map +0 -1
  153. package/lib/packageVersion.d.ts +0 -9
  154. package/lib/packageVersion.d.ts.map +0 -1
  155. package/lib/packageVersion.js +0 -9
  156. package/lib/packageVersion.js.map +0 -1
  157. package/lib/requestParser.d.ts.map +0 -1
  158. package/lib/requestParser.js.map +0 -1
  159. package/lib/runtimeFactoryHelper.d.ts.map +0 -1
  160. package/lib/runtimeFactoryHelper.js +0 -25
  161. package/lib/runtimeFactoryHelper.js.map +0 -1
  162. package/lib/summarizerNode/index.d.ts +0 -8
  163. package/lib/summarizerNode/index.d.ts.map +0 -1
  164. package/lib/summarizerNode/index.js +0 -7
  165. package/lib/summarizerNode/index.js.map +0 -1
  166. package/lib/summarizerNode/summarizerNode.d.ts +0 -139
  167. package/lib/summarizerNode/summarizerNode.d.ts.map +0 -1
  168. package/lib/summarizerNode/summarizerNode.js +0 -475
  169. package/lib/summarizerNode/summarizerNode.js.map +0 -1
  170. package/lib/summarizerNode/summarizerNodeUtils.d.ts +0 -161
  171. package/lib/summarizerNode/summarizerNodeUtils.d.ts.map +0 -1
  172. package/lib/summarizerNode/summarizerNodeUtils.js +0 -216
  173. package/lib/summarizerNode/summarizerNodeUtils.js.map +0 -1
  174. package/lib/summarizerNode/summarizerNodeWithGc.d.ts +0 -133
  175. package/lib/summarizerNode/summarizerNodeWithGc.d.ts.map +0 -1
  176. package/lib/summarizerNode/summarizerNodeWithGc.js +0 -289
  177. package/lib/summarizerNode/summarizerNodeWithGc.js.map +0 -1
  178. package/lib/summaryUtils.d.ts.map +0 -1
  179. package/lib/summaryUtils.js.map +0 -1
  180. package/lib/utils.d.ts.map +0 -1
  181. package/lib/utils.js.map +0 -1
  182. package/src/packageVersion.ts +0 -9
  183. package/src/summarizerNode/index.ts +0 -8
  184. package/src/summarizerNode/summarizerNode.ts +0 -662
  185. package/src/summarizerNode/summarizerNodeUtils.ts +0 -339
  186. package/src/summarizerNode/summarizerNodeWithGc.ts +0 -459
  187. package/tsconfig.esnext.json +0 -7
package/.eslintrc.js CHANGED
@@ -4,10 +4,8 @@
4
4
  */
5
5
 
6
6
  module.exports = {
7
- "extends": [
8
- require.resolve("@fluidframework/eslint-config-fluid")
9
- ],
10
- "parserOptions": {
11
- "project": ["./tsconfig.json", "./src/test/tsconfig.json"]
12
- },
13
- }
7
+ extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
8
+ parserOptions: {
9
+ project: ["./tsconfig.json", "./src/test/tsconfig.json"],
10
+ },
11
+ };
package/.mocharc.js ADDED
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ "use strict";
7
+
8
+ const getFluidTestMochaConfig = require("@fluidframework/mocha-test-setup/mocharc-common");
9
+
10
+ const packageDir = __dirname;
11
+ const config = getFluidTestMochaConfig(packageDir);
12
+ module.exports = config;
package/CHANGELOG.md ADDED
@@ -0,0 +1,191 @@
1
+ # @fluidframework/runtime-utils
2
+
3
+ ## 2.0.0-internal.8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - container-definitions: Fix ISnapshotTreeWithBlobContents and mark internal [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
8
+
9
+ `ISnapshotTreeWithBlobContents` is an internal type that should not be used externally. Additionally, the type didn't
10
+ match the usage, specifically in runtime-utils where an `any` cast was used to work around undefined blobContents. The
11
+ type has been updated to reflect that blobContents can be undefined.
12
+
13
+ - runtime-utils: Removed requestFluidObject [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
14
+
15
+ The `requestFluidObject` utility has been removed. Please migrate all usage of it to the new `entryPoint` pattern.
16
+
17
+ See [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md) for more details.
18
+
19
+ ## 2.0.0-internal.7.4.0
20
+
21
+ Dependency updates only.
22
+
23
+ ## 2.0.0-internal.7.3.0
24
+
25
+ Dependency updates only.
26
+
27
+ ## 2.0.0-internal.7.2.0
28
+
29
+ Dependency updates only.
30
+
31
+ ## 2.0.0-internal.7.1.0
32
+
33
+ Dependency updates only.
34
+
35
+ ## 2.0.0-internal.7.0.0
36
+
37
+ ### Major Changes
38
+
39
+ - Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
40
+
41
+ This included the following changes from the protocol-definitions release:
42
+
43
+ - Updating signal interfaces for some planned improvements. The intention is split the interface between signals
44
+ submitted by clients to the server and the resulting signals sent from the server to clients.
45
+ - A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
46
+ been added, which will be the typing for signals sent from the client to the server. Both extend a new
47
+ ISignalMessageBase interface that contains common members.
48
+ - The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
49
+
50
+ - DEPRECATED: container-loader: Various request related APIs have been deprecated [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
51
+
52
+ Please remove all calls to the following functions and instead use the new `entryPoint` pattern:
53
+
54
+ - `requestFluidObject`
55
+ - `requestResolvedObjectFromContainer`
56
+ - `getDefaultObjectFromContainer`
57
+ - `getObjectWithIdFromContainer`
58
+ - `getObjectFromContainer`
59
+
60
+ See [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md) for more details.
61
+
62
+ - Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
63
+
64
+ Dependencies on the following Fluid server package have been updated to version 2.0.1:
65
+
66
+ - @fluidframework/gitresources: 2.0.1
67
+ - @fluidframework/server-kafka-orderer: 2.0.1
68
+ - @fluidframework/server-lambdas: 2.0.1
69
+ - @fluidframework/server-lambdas-driver: 2.0.1
70
+ - @fluidframework/server-local-server: 2.0.1
71
+ - @fluidframework/server-memory-orderer: 2.0.1
72
+ - @fluidframework/protocol-base: 2.0.1
73
+ - @fluidframework/server-routerlicious: 2.0.1
74
+ - @fluidframework/server-routerlicious-base: 2.0.1
75
+ - @fluidframework/server-services: 2.0.1
76
+ - @fluidframework/server-services-client: 2.0.1
77
+ - @fluidframework/server-services-core: 2.0.1
78
+ - @fluidframework/server-services-ordering-kafkanode: 2.0.1
79
+ - @fluidframework/server-services-ordering-rdkafka: 2.0.1
80
+ - @fluidframework/server-services-ordering-zookeeper: 2.0.1
81
+ - @fluidframework/server-services-shared: 2.0.1
82
+ - @fluidframework/server-services-telemetry: 2.0.1
83
+ - @fluidframework/server-services-utils: 2.0.1
84
+ - @fluidframework/server-test-utils: 2.0.1
85
+ - tinylicious: 2.0.1
86
+
87
+ - Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
88
+
89
+ The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
90
+
91
+ ## 2.0.0-internal.6.4.0
92
+
93
+ Dependency updates only.
94
+
95
+ ## 2.0.0-internal.6.3.0
96
+
97
+ Dependency updates only.
98
+
99
+ ## 2.0.0-internal.6.2.0
100
+
101
+ Dependency updates only.
102
+
103
+ ## 2.0.0-internal.6.1.0
104
+
105
+ Dependency updates only.
106
+
107
+ ## 2.0.0-internal.6.0.0
108
+
109
+ ### Major Changes
110
+
111
+ - Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
112
+
113
+ Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
114
+
115
+ - Remove packagePathToTelemetryProperty Function [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
116
+
117
+ packagePathToTelemetryProperty was previously deprecated and is now removed. Use tagCodeArtifacts instead.
118
+
119
+ ## 2.0.0-internal.5.4.0
120
+
121
+ Dependency updates only.
122
+
123
+ ## 2.0.0-internal.5.3.0
124
+
125
+ Dependency updates only.
126
+
127
+ ## 2.0.0-internal.5.2.0
128
+
129
+ Dependency updates only.
130
+
131
+ ## 2.0.0-internal.5.1.0
132
+
133
+ Dependency updates only.
134
+
135
+ ## 2.0.0-internal.5.0.0
136
+
137
+ ### Major Changes
138
+
139
+ - The `@fluidframework/garbage-collector` package was deprecated in version 2.0.0-internal.4.1.0. [8b242fdc79](https://github.com/microsoft/FluidFramework/commits/8b242fdc796714cf1da9ad3f90d02efb122af0c2)
140
+ It has now been removed with the following functions, interfaces, and types in it.
141
+
142
+ - `cloneGCData`
143
+ - `concatGarbageCollectionData`
144
+ - `concatGarbageCollectionStates`
145
+ - `GCDataBuilder`
146
+ - `getGCDataFromSnapshot`
147
+ - `IGCResult`
148
+ - `removeRouteFromAllNodes`
149
+ - `runGarbageCollection`
150
+ - `trimLeadingAndTrailingSlashes`
151
+ - `trimLeadingSlashes`
152
+ - `trimTrailingSlashes`
153
+ - `unpackChildNodesGCDetails`
154
+ - `unpackChildNodesUsedRoutes`
155
+
156
+ ## 2.0.0-internal.4.4.0
157
+
158
+ Dependency updates only.
159
+
160
+ ## 2.0.0-internal.4.1.0
161
+
162
+ ### Minor Changes
163
+
164
+ - GC interfaces removed from runtime-definitions ([#14750](https://github.com/microsoft/FluidFramework/pull-requests/14750)) [60274eacab](https://github.com/microsoft/FluidFramework/commits/60274eacabf14d42f52f6ad1c2f64356e64ba1a2)
165
+
166
+ The following interfaces available in `@fluidframework/runtime-definitions` are internal implementation details and have been deprecated for public use. They will be removed in an upcoming release.
167
+
168
+ - `IGarbageCollectionNodeData`
169
+ - `IGarbageCollectionState`
170
+ - `IGarbageCollectionSnapshotData`
171
+ - `IGarbageCollectionSummaryDetailsLegacy`
172
+
173
+ - @fluidframework/garbage-collector deprecated ([#14750](https://github.com/microsoft/FluidFramework/pull-requests/14750)) [60274eacab](https://github.com/microsoft/FluidFramework/commits/60274eacabf14d42f52f6ad1c2f64356e64ba1a2)
174
+
175
+ The `@fluidframework/garbage-collector` package is deprecated with the following functions, interfaces, and types in it.
176
+ These are internal implementation details and have been deprecated for public use. They will be removed in an upcoming
177
+ release.
178
+
179
+ - `cloneGCData`
180
+ - `concatGarbageCollectionData`
181
+ - `concatGarbageCollectionStates`
182
+ - `GCDataBuilder`
183
+ - `getGCDataFromSnapshot`
184
+ - `IGCResult`
185
+ - `removeRouteFromAllNodes`
186
+ - `runGarbageCollection`
187
+ - `trimLeadingAndTrailingSlashes`
188
+ - `trimLeadingSlashes`
189
+ - `trimTrailingSlashes`
190
+ - `unpackChildNodesGCDetails`
191
+ - `unpackChildNodesUsedRoutes`
package/README.md CHANGED
@@ -2,4 +2,71 @@
2
2
 
3
3
  This package contains code for common utilities used by Fluid Framework runtimes.
4
4
 
5
- See [GitHub](https://github.com/microsoft/FluidFramework) for more details on the Fluid Framework and packages within.
5
+ <!-- AUTO-GENERATED-CONTENT:START (LIBRARY_PACKAGE_README:scripts=FALSE) -->
6
+
7
+ <!-- prettier-ignore-start -->
8
+ <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
9
+
10
+ ## Using Fluid Framework libraries
11
+
12
+ When taking a dependency on a Fluid Framework library, we recommend using a `^` (caret) version range, such as `^1.3.4`.
13
+ While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
14
+ library consumers should always prefer `^`.
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
+ ## Installation
23
+
24
+ To get started, install the package by running the following command:
25
+
26
+ ```bash
27
+ npm i @fluidframework/runtime-utils
28
+ ```
29
+
30
+ ## API Documentation
31
+
32
+ API documentation for **@fluidframework/runtime-utils** is available at <https://fluidframework.com/docs/apis/runtime-utils>.
33
+
34
+ ## Contribution Guidelines
35
+
36
+ There are many ways to [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid.
37
+
38
+ - Participate in Q&A in our [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
39
+ - [Submit bugs](https://github.com/microsoft/FluidFramework/issues) and help us verify fixes as they are checked in.
40
+ - Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
41
+ - [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
42
+
43
+ Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/wiki).
44
+
45
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
46
+ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
47
+
48
+ This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
49
+ Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
50
+ Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
51
+
52
+ ## Help
53
+
54
+ Not finding what you're looking for in this README? Check out our [GitHub
55
+ Wiki](https://github.com/microsoft/FluidFramework/wiki) or [fluidframework.com](https://fluidframework.com/docs/).
56
+
57
+ Still not finding what you're looking for? Please [file an
58
+ issue](https://github.com/microsoft/FluidFramework/wiki/Submitting-Bugs-and-Feature-Requests).
59
+
60
+ Thank you!
61
+
62
+ ## Trademark
63
+
64
+ This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
65
+
66
+ Use of these trademarks or logos must follow Microsoft's [Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
67
+
68
+ Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
69
+
70
+ <!-- prettier-ignore-end -->
71
+
72
+ <!-- AUTO-GENERATED-CONTENT:END -->
@@ -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-lint.json"
4
+ }
@@ -1,4 +1,4 @@
1
1
  {
2
- "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "@fluidframework/build-common/api-extractor-common-report.json"
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
4
  }
@@ -0,0 +1,201 @@
1
+ ## API Report File for "@fluidframework/runtime-utils"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
8
+ import { IContainerContext } from '@fluidframework/container-definitions';
9
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
10
+ import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
11
+ import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
12
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
13
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
14
+ import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
15
+ import { IRequest } from '@fluidframework/core-interfaces';
16
+ import { IRequestHeader } from '@fluidframework/core-interfaces';
17
+ import { IResponse } from '@fluidframework/core-interfaces';
18
+ import { IRuntime } from '@fluidframework/container-definitions';
19
+ import { IRuntimeFactory } from '@fluidframework/container-definitions';
20
+ import { ISnapshotTree } from '@fluidframework/protocol-definitions';
21
+ import { ISnapshotTreeWithBlobContents } from '@fluidframework/container-definitions';
22
+ import { ISummarizeResult } from '@fluidframework/runtime-definitions';
23
+ import { ISummaryBlob } from '@fluidframework/protocol-definitions';
24
+ import { ISummaryStats } from '@fluidframework/runtime-definitions';
25
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
26
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
27
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
28
+ import { ITree } from '@fluidframework/protocol-definitions';
29
+ import { SummaryObject } from '@fluidframework/protocol-definitions';
30
+ import { SummaryType } from '@fluidframework/protocol-definitions';
31
+ import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
32
+
33
+ // @internal (undocumented)
34
+ export function addBlobToSummary(summary: ISummaryTreeWithStats, key: string, content: string | Uint8Array): void;
35
+
36
+ // @internal (undocumented)
37
+ export function addSummarizeResultToSummary(summary: ISummaryTreeWithStats, key: string, summarizeResult: ISummarizeResult): void;
38
+
39
+ // @internal (undocumented)
40
+ export function addTreeToSummary(summary: ISummaryTreeWithStats, key: string, summarizeResult: ISummarizeResult): void;
41
+
42
+ // @internal (undocumented)
43
+ export function calculateStats(summary: SummaryObject): ISummaryStats;
44
+
45
+ // @internal
46
+ export function convertSnapshotTreeToSummaryTree(snapshot: ISnapshotTreeWithBlobContents): ISummaryTreeWithStats;
47
+
48
+ // @internal
49
+ export function convertSummaryTreeToITree(summaryTree: ISummaryTree): ITree;
50
+
51
+ // @internal
52
+ export function convertToSummaryTree(snapshot: ITree, fullTree?: boolean): ISummarizeResult;
53
+
54
+ // @alpha
55
+ export function convertToSummaryTreeWithStats(snapshot: ITree, fullTree?: boolean): ISummaryTreeWithStats;
56
+
57
+ // @internal (undocumented)
58
+ export const create404Response: (request: IRequest) => IResponse;
59
+
60
+ // @internal (undocumented)
61
+ export function createDataStoreFactory(type: string, factory: Factory | Promise<Factory>): IFluidDataStoreFactory & IFluidDataStoreRegistry;
62
+
63
+ // @internal (undocumented)
64
+ export function createResponseError(status: number, value: string, request: IRequest, headers?: {
65
+ [key: string]: any;
66
+ }): IResponse;
67
+
68
+ // @internal (undocumented)
69
+ export function exceptionToResponse(err: any): IResponse;
70
+
71
+ // @internal (undocumented)
72
+ export type Factory = IFluidDataStoreFactory & Partial<IProvideFluidDataStoreRegistry>;
73
+
74
+ // @internal
75
+ export class GCDataBuilder implements IGarbageCollectionData {
76
+ // (undocumented)
77
+ addNode(id: string, outboundRoutes: string[]): void;
78
+ // (undocumented)
79
+ addNodes(gcNodes: {
80
+ [id: string]: string[];
81
+ }): void;
82
+ addRouteToAllNodes(outboundRoute: string): void;
83
+ // (undocumented)
84
+ get gcNodes(): {
85
+ [id: string]: string[];
86
+ };
87
+ // (undocumented)
88
+ getGCData(): IGarbageCollectionData;
89
+ prefixAndAddNodes(prefixId: string, gcNodes: {
90
+ [id: string]: string[];
91
+ }): void;
92
+ }
93
+
94
+ // @internal
95
+ export function generateHandleContextPath(path: string, routeContext?: IFluidHandleContext): string;
96
+
97
+ // @internal (undocumented)
98
+ export function getBlobSize(content: ISummaryBlob["content"]): number;
99
+
100
+ // @internal (undocumented)
101
+ export function getNormalizedObjectStoragePathParts(path: string): string[];
102
+
103
+ // @internal (undocumented)
104
+ export function listBlobsAtTreePath(inputTree: ITree | undefined, path: string): Promise<string[]>;
105
+
106
+ // @internal
107
+ export function mergeStats(...stats: ISummaryStats[]): ISummaryStats;
108
+
109
+ // @internal
110
+ export class ObjectStoragePartition implements IChannelStorageService {
111
+ constructor(storage: IChannelStorageService, path: string);
112
+ // (undocumented)
113
+ contains(path: string): Promise<boolean>;
114
+ // (undocumented)
115
+ list(path: string): Promise<string[]>;
116
+ // (undocumented)
117
+ readBlob(path: string): Promise<ArrayBufferLike>;
118
+ }
119
+
120
+ // @internal
121
+ export type ReadAndParseBlob = <T>(id: string) => Promise<T>;
122
+
123
+ // @alpha
124
+ export class RequestParser implements IRequest {
125
+ protected constructor(request: Readonly<IRequest>);
126
+ // (undocumented)
127
+ static create(request: Readonly<IRequest>): RequestParser;
128
+ createSubRequest(startingPathIndex: number): IRequest;
129
+ static getPathParts(url: string): readonly string[];
130
+ // (undocumented)
131
+ get headers(): IRequestHeader | undefined;
132
+ isLeaf(elements: number): boolean;
133
+ get pathParts(): readonly string[];
134
+ // (undocumented)
135
+ readonly query: string;
136
+ // (undocumented)
137
+ get url(): string;
138
+ }
139
+
140
+ // @internal (undocumented)
141
+ export function responseToException(response: IResponse, request: IRequest): Error;
142
+
143
+ // @alpha (undocumented)
144
+ export abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
145
+ // (undocumented)
146
+ hasInitialized(_runtime: T): Promise<void>;
147
+ // (undocumented)
148
+ instantiateFirstTime(_runtime: T): Promise<void>;
149
+ // (undocumented)
150
+ instantiateFromExisting(_runtime: T): Promise<void>;
151
+ // (undocumented)
152
+ instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
153
+ // (undocumented)
154
+ get IRuntimeFactory(): this;
155
+ // (undocumented)
156
+ abstract preInitialize(context: IContainerContext, existing: boolean): Promise<IRuntime & T>;
157
+ }
158
+
159
+ // @internal
160
+ export function seqFromTree(tree: ISnapshotTree, readAndParseBlob: ReadAndParseBlob): Promise<number>;
161
+
162
+ // @alpha (undocumented)
163
+ export class SummaryTreeBuilder implements ISummaryTreeWithStats {
164
+ constructor();
165
+ // (undocumented)
166
+ addAttachment(id: string): void;
167
+ // (undocumented)
168
+ addBlob(key: string, content: string | Uint8Array): void;
169
+ // (undocumented)
170
+ addHandle(key: string, handleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment, handle: string): void;
171
+ // (undocumented)
172
+ addWithStats(key: string, summarizeResult: ISummarizeResult): void;
173
+ // (undocumented)
174
+ getSummaryTree(): ISummaryTreeWithStats;
175
+ // (undocumented)
176
+ get stats(): Readonly<ISummaryStats>;
177
+ // (undocumented)
178
+ get summary(): ISummaryTree;
179
+ }
180
+
181
+ // @internal (undocumented)
182
+ export class TelemetryContext implements ITelemetryContext {
183
+ // (undocumented)
184
+ get(prefix: string, property: string): TelemetryEventPropertyType;
185
+ // (undocumented)
186
+ serialize(): string;
187
+ // (undocumented)
188
+ set(prefix: string, property: string, value: TelemetryEventPropertyType): void;
189
+ // (undocumented)
190
+ setMultiple(prefix: string, property: string, values: Record<string, TelemetryEventPropertyType>): void;
191
+ }
192
+
193
+ // @internal
194
+ export function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]): Map<string, string[]>;
195
+
196
+ // @internal (undocumented)
197
+ export function utf8ByteLength(str: string): number;
198
+
199
+ // (No @packageDocumentation comment for this package)
200
+
201
+ ```
@@ -10,6 +10,7 @@ exports.generateHandleContextPath = void 0;
10
10
  * @param path - The path to the Fluid object relative to the route context.
11
11
  * @param routeContext - The route context that contains the Fluid object.
12
12
  * @returns The absolute path to the Fluid object from the root of the Container.
13
+ * @internal
13
14
  */
14
15
  function generateHandleContextPath(path, routeContext) {
15
16
  if (path === "") {
@@ -21,7 +22,9 @@ function generateHandleContextPath(path, routeContext) {
21
22
  else {
22
23
  // Remove beginning and trailing slashes, if any, from the path.
23
24
  let normalizedPath = path.startsWith("/") ? path.slice(1) : path;
24
- normalizedPath = normalizedPath.endsWith("/") ? normalizedPath.slice(0, -1) : normalizedPath;
25
+ normalizedPath = normalizedPath.endsWith("/")
26
+ ? normalizedPath.slice(0, -1)
27
+ : normalizedPath;
25
28
  // If the routeContext does not exist, path is the absolute path.
26
29
  // If the routeContext exists, absolute path is routeContext's absolute path plus the path.
27
30
  return routeContext === undefined
@@ -30,4 +33,4 @@ function generateHandleContextPath(path, routeContext) {
30
33
  }
31
34
  }
32
35
  exports.generateHandleContextPath = generateHandleContextPath;
33
- //# sourceMappingURL=dataStoreHandleContextUtils.js.map
36
+ //# sourceMappingURL=dataStoreHandleContextUtils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataStoreHandleContextUtils.cjs","sourceRoot":"","sources":["../src/dataStoreHandleContextUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;;;;GAMG;AACH,SAAgB,yBAAyB,CACxC,IAAY,EACZ,YAAkC;IAElC,IAAI,IAAI,KAAK,EAAE,EAAE;QAChB,uBAAuB;QACvB,wDAAwD;QACxD,yFAAyF;QACzF,OAAO,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC;KACnE;SAAM;QACN,gEAAgE;QAChE,IAAI,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACjE,cAAc,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC;YAC5C,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC7B,CAAC,CAAC,cAAc,CAAC;QAElB,iEAAiE;QACjE,2FAA2F;QAC3F,OAAO,YAAY,KAAK,SAAS;YAChC,CAAC,CAAC,IAAI,cAAc,EAAE;YACtB,CAAC,CAAC,GACA,YAAY,CAAC,YAAY,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,YACtD,IAAI,cAAc,EAAE,CAAC;KACxB;AACF,CAAC;AAxBD,8DAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces\";\n\n/**\n * Generates the absolute path for a Fluid object given its path and its parent routeContext.\n * @param path - The path to the Fluid object relative to the route context.\n * @param routeContext - The route context that contains the Fluid object.\n * @returns The absolute path to the Fluid object from the root of the Container.\n * @internal\n */\nexport function generateHandleContextPath(\n\tpath: string,\n\trouteContext?: IFluidHandleContext,\n): string {\n\tif (path === \"\") {\n\t\t// The `path` is empty.\n\t\t// If the routeContext does not exist, this is the root.\n\t\t// If the routeContext exists, the absolute path is the same as that of the routeContext.\n\t\treturn routeContext === undefined ? \"\" : routeContext.absolutePath;\n\t} else {\n\t\t// Remove beginning and trailing slashes, if any, from the path.\n\t\tlet normalizedPath = path.startsWith(\"/\") ? path.slice(1) : path;\n\t\tnormalizedPath = normalizedPath.endsWith(\"/\")\n\t\t\t? normalizedPath.slice(0, -1)\n\t\t\t: normalizedPath;\n\n\t\t// If the routeContext does not exist, path is the absolute path.\n\t\t// If the routeContext exists, absolute path is routeContext's absolute path plus the path.\n\t\treturn routeContext === undefined\n\t\t\t? `/${normalizedPath}`\n\t\t\t: `${\n\t\t\t\t\trouteContext.absolutePath === \"/\" ? \"\" : routeContext.absolutePath\n\t\t\t }/${normalizedPath}`;\n\t}\n}\n"]}
@@ -8,6 +8,7 @@ import { IFluidHandleContext } from "@fluidframework/core-interfaces";
8
8
  * @param path - The path to the Fluid object relative to the route context.
9
9
  * @param routeContext - The route context that contains the Fluid object.
10
10
  * @returns The absolute path to the Fluid object from the root of the Container.
11
+ * @internal
11
12
  */
12
13
  export declare function generateHandleContextPath(path: string, routeContext?: IFluidHandleContext): string;
13
14
  //# sourceMappingURL=dataStoreHandleContextUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreHandleContextUtils.d.ts","sourceRoot":"","sources":["../src/dataStoreHandleContextUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAiBlG"}
1
+ {"version":3,"file":"dataStoreHandleContextUtils.d.ts","sourceRoot":"","sources":["../src/dataStoreHandleContextUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACxC,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,mBAAmB,GAChC,MAAM,CAqBR"}