@fluidframework/datastore 2.1.0-276985 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/datastore
2
2
 
3
+ ## 2.1.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.0.0-rc.5.0.0
4
8
 
5
9
  ### Minor Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @fluidframework/datastore
2
2
 
3
- <!-- AUTO-GENERATED-CONTENT:START (README_DEPENDENCY_GUIDELINES_SECTION:includeHeading=TRUE) -->
3
+ <!-- AUTO-GENERATED-CONTENT:START (LIBRARY_PACKAGE_README_HEADER) -->
4
4
 
5
5
  <!-- prettier-ignore-start -->
6
6
  <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
@@ -13,6 +13,27 @@ library consumers should always prefer `^`.
13
13
 
14
14
  If using any of Fluid Framework's unstable APIs (for example, its `beta` APIs), we recommend using a more constrained version range, such as `~`.
15
15
 
16
+ ## Installation
17
+
18
+ To get started, install the package by running the following command:
19
+
20
+ ```bash
21
+ npm i @fluidframework/datastore
22
+ ```
23
+
24
+ ## Importing from this package
25
+
26
+ This package leverages [package.json exports](https://nodejs.org/api/packages.html#exports) to separate its APIs by support level.
27
+ For more information on the related support guarantees, see [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
28
+
29
+ To access the `public` ([SemVer](https://semver.org/)) APIs, import via `@fluidframework/datastore` like normal.
30
+
31
+ To access the `legacy` APIs, import via `@fluidframework/datastore/legacy`.
32
+
33
+ ## API Documentation
34
+
35
+ API documentation for **@fluidframework/datastore** is available at <https://fluidframework.com/docs/apis/datastore>.
36
+
16
37
  <!-- prettier-ignore-end -->
17
38
 
18
39
  <!-- AUTO-GENERATED-CONTENT:END -->
@@ -33,11 +54,81 @@ The two major interfaces required to implement a Fluid handle are `IFluidHandle`
33
54
 
34
55
  For more details on Fluid Handles, check this [doc](../../../content/docs/advanced/handles.md).
35
56
 
36
- <!-- AUTO-GENERATED-CONTENT:START (README_TRADEMARK_SECTION:includeHeading=TRUE) -->
57
+ <!-- AUTO-GENERATED-CONTENT:START (LIBRARY_PACKAGE_README_FOOTER) -->
37
58
 
38
59
  <!-- prettier-ignore-start -->
39
60
  <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
40
61
 
62
+ ## Minimum Client Requirements
63
+
64
+ These are the platform requirements for the current version of Fluid Framework Client Packages.
65
+ These requirements err on the side of being too strict since within a major version they can be relaxed over time, but not made stricter.
66
+ For Long Term Support (LTS) versions this can require supporting these platforms for several years.
67
+
68
+ It is likely that other configurations will work, but they are not supported: if they stop working, we do not consider that a bug.
69
+ If you would benefit from support for something not listed here, file an issue and the product team will evaluate your request.
70
+ When making such a request please include if the configuration already works (and thus the request is just that it becomes officially supported), or if changes are required to get it working.
71
+
72
+ ### Supported Runtimes
73
+
74
+ - NodeJs ^20.10.0 except that we will drop support for it [when NodeJs 20 loses its upstream support on 2026-04-30](https://github.com/nodejs/release#release-schedule), and will support a newer LTS version of NodeJS (22) at least 1 year before 20 is end-of-life. This same policy applies to NodeJS 22 when it is end of life (2027-04-30).
75
+ - Modern browsers supporting the es2022 standard library: in response to asks we can add explicit support for using babel to polyfill to target specific standards or runtimes (meaning we can avoid/remove use of things that don't polyfill robustly, but otherwise target modern standards).
76
+
77
+ ### Supported Tools
78
+
79
+ - TypeScript 5.4:
80
+ - All [`strict`](https://www.typescriptlang.org/tsconfig) options are supported.
81
+ - [`strictNullChecks`](https://www.typescriptlang.org/tsconfig) is required.
82
+ - [Configuration options deprecated in 5.0](https://github.com/microsoft/TypeScript/issues/51909) are not supported.
83
+ - `exactOptionalPropertyTypes` is currently not fully supported.
84
+ If used, narrowing members of Fluid Framework types types using `in`, `Reflect.has`, `Object.hasOwn` or `Object.prototype.hasOwnProperty` should be avoided as they may incorrectly exclude `undefined` from the possible values in some cases.
85
+ - [webpack](https://webpack.js.org/) 5
86
+ - We are not intending to be prescriptive about what bundler to use.
87
+ Other bundlers which can handle ES Modules should work, but webpack is the only one we actively test.
88
+
89
+ ### Module Resolution
90
+
91
+ [`Node16`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) resolution should be used with TypeScript compilerOptions to follow the [Node.js v12+ ESM Resolution and Loading algorithm](https://nodejs.github.io/nodejs.dev/en/api/v20/esm/#resolution-and-loading-algorithm).
92
+ Node10 resolution is not supported as it does not support Fluid Framework's API structuring pattern that is used to distinguish stable APIs from those that are in development.
93
+
94
+ ### Module Formats
95
+
96
+ - ES Modules:
97
+ ES Modules are the preferred way to consume our client packages (including in NodeJs) and consuming our client packages from ES Modules is fully supported.
98
+ - CommonJs:
99
+ Consuming our client packages as CommonJs is supported only in NodeJS and only for the cases listed below.
100
+ This is done to accommodate some workflows without good ES Module support.
101
+ If you have a workflow you would like included in this list, file an issue.
102
+ Once this list of workflows motivating CommonJS support is empty, we may drop support for CommonJS one year after notice of the change is posted here.
103
+
104
+ - Testing with Jest (which lacks [stable ESM support](https://jestjs.io/docs/ecmascript-modules) due to [unstable APIs in NodeJs](https://github.com/nodejs/node/issues/37648))
105
+
106
+ ## Contribution Guidelines
107
+
108
+ There are many ways to [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid.
109
+
110
+ - Participate in Q&A in our [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
111
+ - [Submit bugs](https://github.com/microsoft/FluidFramework/issues) and help us verify fixes as they are checked in.
112
+ - Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
113
+ - [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
114
+
115
+ Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/wiki).
116
+
117
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
118
+ 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.
119
+
120
+ This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
121
+ Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
122
+ Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
123
+
124
+ ## Help
125
+
126
+ Not finding what you're looking for in this README? Check out [fluidframework.com](https://fluidframework.com/docs/).
127
+
128
+ Still not finding what you're looking for? Please [file an issue](https://github.com/microsoft/FluidFramework/wiki/Submitting-Bugs-and-Feature-Requests).
129
+
130
+ Thank you!
131
+
41
132
  ## Trademark
42
133
 
43
134
  This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.current.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts"
5
+ }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-base.esm.legacy.json"
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.legacy.json"
4
4
  }
@@ -1,4 +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.esm.current.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-model.esm.json"
4
4
  }
@@ -0,0 +1,9 @@
1
+ ## Public API Report File for "@fluidframework/datastore"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // (No @packageDocumentation comment for this package)
8
+
9
+ ```
@@ -1 +1 @@
1
- {"version":3,"file":"channelStorageService.d.ts","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EACN,uBAAuB,EACvB,aAAa,EACb,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,qBAAa,qBAAsB,YAAW,sBAAsB;IAoBlE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IAtB7B,OAAO,CAAC,MAAM,CAAC,WAAW;IAgB1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA6B;gBAGzC,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,EAClD,MAAM,EAAE,mBAAmB,EAC3B,UAAU,CAAC,0CAA8B;IAS9C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAehD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAepC,YAAY;CAG1B"}
1
+ {"version":3,"file":"channelStorageService.d.ts","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EACN,uBAAuB,EACvB,aAAa,EACb,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,qBAAa,qBAAsB,YAAW,sBAAsB;IAkBlE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IApB7B,OAAO,CAAC,MAAM,CAAC,WAAW;IAc1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA6B;gBAGzC,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,EAClD,MAAM,EAAE,mBAAmB,EAC3B,UAAU,CAAC,0CAA8B;IAS9C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAgBhD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAepC,YAAY;CAG1B"}
@@ -5,16 +5,15 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ChannelStorageService = void 0;
8
- const internal_1 = require("@fluidframework/runtime-utils/internal");
8
+ const internal_1 = require("@fluidframework/core-utils/internal");
9
+ const internal_2 = require("@fluidframework/runtime-utils/internal");
9
10
  class ChannelStorageService {
10
11
  static flattenTree(base, tree, results) {
11
- // eslint-disable-next-line guard-for-in, no-restricted-syntax
12
- for (const path in tree.trees) {
13
- ChannelStorageService.flattenTree(`${base}${path}/`, tree.trees[path], results);
12
+ for (const [path, subtree] of Object.entries(tree.trees)) {
13
+ ChannelStorageService.flattenTree(`${base}${path}/`, subtree, results);
14
14
  }
15
- // eslint-disable-next-line guard-for-in, no-restricted-syntax
16
- for (const blob in tree.blobs) {
17
- results[`${base}${blob}`] = tree.blobs[blob];
15
+ for (const [blobName, blobId] of Object.entries(tree.blobs)) {
16
+ results[`${base}${blobName}`] = blobId;
18
17
  }
19
18
  }
20
19
  constructor(tree, storage, logger, extraBlobs) {
@@ -33,6 +32,7 @@ class ChannelStorageService {
33
32
  }
34
33
  async readBlob(path) {
35
34
  const id = await this.getIdForPath(path);
35
+ (0, internal_1.assert)(id !== undefined, 0x9d7 /* id is undefined in ChannelStorageService.readBlob() */);
36
36
  const blob = this.extraBlobs !== undefined ? this.extraBlobs.get(id) : undefined;
37
37
  if (blob !== undefined) {
38
38
  return blob;
@@ -43,7 +43,7 @@ class ChannelStorageService {
43
43
  }
44
44
  async list(path) {
45
45
  let tree = this.tree;
46
- const pathParts = (0, internal_1.getNormalizedObjectStoragePathParts)(path);
46
+ const pathParts = (0, internal_2.getNormalizedObjectStoragePathParts)(path);
47
47
  while (tree !== undefined && pathParts.length > 0) {
48
48
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
49
49
  const part = pathParts.shift();
@@ -1 +1 @@
1
- {"version":3,"file":"channelStorageService.js","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,qEAA6F;AAG7F,MAAa,qBAAqB;IACzB,MAAM,CAAC,WAAW,CACzB,IAAY,EACZ,IAAmB,EACnB,OAAmC;QAEnC,8DAA8D;QAC9D,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC/B,qBAAqB,CAAC,WAAW,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;QACjF,CAAC;QAED,8DAA8D;QAC9D,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC;IACF,CAAC;IAID,YACkB,IAA+B,EAC/B,O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AAI,CAAC,CAAC;QAC5D,OAAO,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnD,oEAAoE;YACpE,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAG,CAAC;YAChC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;QACD,IAAI,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IACvC,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,IAAY;QACtC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACD;AArED,sDAqEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\tIDocumentStorageService,\n\tISnapshotTree,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { getNormalizedObjectStoragePathParts } from \"@fluidframework/runtime-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nexport class ChannelStorageService implements IChannelStorageService {\n\tprivate static flattenTree(\n\t\tbase: string,\n\t\ttree: ISnapshotTree,\n\t\tresults: { [path: string]: string },\n\t) {\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const path in tree.trees) {\n\t\t\tChannelStorageService.flattenTree(`${base}${path}/`, tree.trees[path], results);\n\t\t}\n\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const blob in tree.blobs) {\n\t\t\tresults[`${base}${blob}`] = tree.blobs[blob];\n\t\t}\n\t}\n\n\tprivate readonly flattenedTree: { [path: string]: string };\n\n\tconstructor(\n\t\tprivate readonly tree: ISnapshotTree | undefined,\n\t\tprivate readonly storage: Pick<IDocumentStorageService, \"readBlob\">,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\tprivate readonly extraBlobs?: Map<string, ArrayBufferLike>,\n\t) {\n\t\tthis.flattenedTree = {};\n\t\t// Create a map from paths to blobs\n\t\tif (tree !== undefined) {\n\t\t\tChannelStorageService.flattenTree(\"\", tree, this.flattenedTree);\n\t\t}\n\t}\n\n\tpublic async contains(path: string): Promise<boolean> {\n\t\treturn this.flattenedTree[path] !== undefined;\n\t}\n\n\tpublic async readBlob(path: string): Promise<ArrayBufferLike> {\n\t\tconst id = await this.getIdForPath(path);\n\t\tconst blob = this.extraBlobs !== undefined ? this.extraBlobs.get(id) : undefined;\n\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\t\tconst blobP = this.storage.readBlob(id);\n\t\tblobP.catch((error) =>\n\t\t\tthis.logger.sendErrorEvent({ eventName: \"ChannelStorageBlobError\" }, error),\n\t\t);\n\n\t\treturn blobP;\n\t}\n\n\tpublic async list(path: string): Promise<string[]> {\n\t\tlet tree = this.tree;\n\t\tconst pathParts = getNormalizedObjectStoragePathParts(path);\n\t\twhile (tree !== undefined && pathParts.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst part = pathParts.shift()!;\n\t\t\ttree = tree.trees[part];\n\t\t}\n\t\tif (tree === undefined || pathParts.length !== 0) {\n\t\t\tthrow new Error(\"path does not exist\");\n\t\t}\n\n\t\treturn Object.keys(tree?.blobs ?? {});\n\t}\n\n\tprivate async getIdForPath(path: string): Promise<string> {\n\t\treturn this.flattenedTree[path];\n\t}\n}\n"]}
1
+ {"version":3,"file":"channelStorageService.js","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAM7D,qEAA6F;AAG7F,M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(c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\tIDocumentStorageService,\n\tISnapshotTree,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { getNormalizedObjectStoragePathParts } from \"@fluidframework/runtime-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nexport class ChannelStorageService implements IChannelStorageService {\n\tprivate static flattenTree(\n\t\tbase: string,\n\t\ttree: ISnapshotTree,\n\t\tresults: { [path: string]: string },\n\t) {\n\t\tfor (const [path, subtree] of Object.entries(tree.trees)) {\n\t\t\tChannelStorageService.flattenTree(`${base}${path}/`, subtree, results);\n\t\t}\n\n\t\tfor (const [blobName, blobId] of Object.entries(tree.blobs)) {\n\t\t\tresults[`${base}${blobName}`] = blobId;\n\t\t}\n\t}\n\n\tprivate readonly flattenedTree: { [path: string]: string };\n\n\tconstructor(\n\t\tprivate readonly tree: ISnapshotTree | undefined,\n\t\tprivate readonly storage: Pick<IDocumentStorageService, \"readBlob\">,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\tprivate readonly extraBlobs?: Map<string, ArrayBufferLike>,\n\t) {\n\t\tthis.flattenedTree = {};\n\t\t// Create a map from paths to blobs\n\t\tif (tree !== undefined) {\n\t\t\tChannelStorageService.flattenTree(\"\", tree, this.flattenedTree);\n\t\t}\n\t}\n\n\tpublic async contains(path: string): Promise<boolean> {\n\t\treturn this.flattenedTree[path] !== undefined;\n\t}\n\n\tpublic async readBlob(path: string): Promise<ArrayBufferLike> {\n\t\tconst id = await this.getIdForPath(path);\n\t\tassert(id !== undefined, 0x9d7 /* id is undefined in ChannelStorageService.readBlob() */);\n\t\tconst blob = this.extraBlobs !== undefined ? this.extraBlobs.get(id) : undefined;\n\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\t\tconst blobP = this.storage.readBlob(id);\n\t\tblobP.catch((error) =>\n\t\t\tthis.logger.sendErrorEvent({ eventName: \"ChannelStorageBlobError\" }, error),\n\t\t);\n\n\t\treturn blobP;\n\t}\n\n\tpublic async list(path: string): Promise<string[]> {\n\t\tlet tree = this.tree;\n\t\tconst pathParts = getNormalizedObjectStoragePathParts(path);\n\t\twhile (tree !== undefined && pathParts.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst part = pathParts.shift()!;\n\t\t\ttree = tree.trees[part];\n\t\t}\n\t\tif (tree === undefined || pathParts.length !== 0) {\n\t\t\tthrow new Error(\"path does not exist\");\n\t\t}\n\n\t\treturn Object.keys(tree?.blobs ?? {});\n\t}\n\n\tprivate async getIdForPath(path: string): Promise<string | undefined> {\n\t\treturn this.flattenedTree[path];\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EACN,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAOrF,OAAO,EACN,QAAQ,EACR,eAAe,EACf,sBAAsB,EACtB,4BAA4B,EAC5B,KAAK,mBAAmB,EACxB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,cAAc,EACd,cAAc,EAId,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,gBAAgB,EAEhB,yBAAyB,EACzB,MAAM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AAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,MAAM;IAK3E;;OAEG;IACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IA2CjC,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,MAAM;IASd;;;;;;OAMG;IACI,QAAQ,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAqBlF;;;;OAIG;IACI,QAAQ,CAAC,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAiBtE,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAoC3D,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,eAAe;IAMvB;;;;OAIG;IACH,OAAO,CAAC,+BAA+B;IAyBhC,cAAc,CAAC,WAAW,EAAE,WAAW,CAAC,SAAS,GAAG,WAAW,CAAC,QAAQ,GAAG,IAAI;CA4CtF;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,mBACf,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,qBAAqB,KAAK,QAAQ,SAAS,CAAC,SACnF,4BAA4B,iCAUD,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,YACtB,CACR,OAAO,EAAE,qBAAqB,KAC1B,QAAQ;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,SACvD,4BAA4B,iCAyCD,CAAC"}
@@ -117,7 +117,7 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
117
117
  const tree = dataStoreContext.baseSnapshot;
118
118
  // Must always receive the data store type inside of the attributes
119
119
  if (tree?.trees !== undefined) {
120
- Object.keys(tree.trees).forEach((path) => {
120
+ Object.entries(tree.trees).forEach(([path, subtree]) => {
121
121
  // Issue #4414
122
122
  if (path === "_search") {
123
123
  return;
@@ -127,7 +127,7 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
127
127
  // container from snapshot where we load detached container from a snapshot, isLocalDataStore would be
128
128
  // true. In this case create a RehydratedLocalChannelContext.
129
129
  if (dataStoreContext.isLocalDataStore) {
130
- channelContext = this.createRehydratedLocalChannelContext(path, tree.trees[path]);
130
+ channelContext = this.createRehydratedLocalChannelContext(path, subtree);
131
131
  // This is the case of rehydrating a detached container from snapshot. Now due to delay loading of
132
132
  // data store, if the data store is loaded after the container is attached, then we missed making
133
133
  // the channel visible. So do it now. Otherwise, add it to local channel context queue, so
@@ -140,7 +140,7 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
140
140
  }
141
141
  }
142
142
  else {
143
- channelContext = new remoteChannelContext_js_1.RemoteChannelContext(this, dataStoreContext, dataStoreContext.storage, (content, localOpMetadata) => this.submitChannelOp(path, content, localOpMetadata), (address) => this.setChannelDirty(address), path, tree.trees[path], this.sharedObjectRegistry, undefined /* extraBlobs */, this.dataStoreContext.getCreateChildSummarizerNodeFn(path, {
143
+ channelContext = new remoteChannelContext_js_1.RemoteChannelContext(this, dataStoreContext, dataStoreContext.storage, (content, localOpMetadata) => this.submitChannelOp(path, content, localOpMetadata), (address) => this.setChannelDirty(address), path, subtree, this.sharedObjectRegistry, undefined /* extraBlobs */, this.dataStoreContext.getCreateChildSummarizerNodeFn(path, {
144
144
  type: internal_3.CreateSummarizerNodeSource.FromSummary,
145
145
  }));
146
146
  }
@@ -198,16 +198,18 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
198
198
  if (id === "_channels" || id === "_custom") {
199
199
  return await this.request(parser.createSubRequest(1));
200
200
  }
201
- // Check for a data type reference first
202
- const context = this.contexts.get(id);
203
- if (context !== undefined && parser.isLeaf(1)) {
204
- try {
205
- const channel = await context.getChannel();
206
- return { mimeType: "fluid/object", status: 200, value: channel };
207
- }
208
- catch (error) {
209
- this.mc.logger.sendErrorEvent({ eventName: "GetChannelFailedInRequest" }, error);
210
- return (0, internal_4.createResponseError)(500, `Failed to get Channel: ${error}`, request);
201
+ if (id !== undefined) {
202
+ // Check for a data type reference first
203
+ const context = this.contexts.get(id);
204
+ if (context !== undefined && parser.isLeaf(1)) {
205
+ try {
206
+ const channel = await context.getChannel();
207
+ return { mimeType: "fluid/object", status: 200, value: channel };
208
+ }
209
+ catch (error) {
210
+ this.mc.logger.sendErrorEvent({ eventName: "GetChannelFailedInRequest" }, error);
211
+ return (0, internal_4.createResponseError)(500, `Failed to get Channel: ${error}`, request);
212
+ }
211
213
  }
212
214
  }
213
215
  // Otherwise defer to an attached request handler
@@ -552,7 +554,10 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
552
554
  // If this channel is not yet loaded, then there should be no changes in the snapshot from which
553
555
  // it was created as it is detached container. So just use the previous snapshot.
554
556
  (0, internal_1.assert)(!!this.dataStoreContext.baseSnapshot, 0x181 /* "BaseSnapshot should be there as detached container loaded from snapshot" */);
555
- summaryTree = (0, internal_4.convertSnapshotTreeToSummaryTree)(this.dataStoreContext.baseSnapshot.trees[contextId]);
557
+ summaryTree = (0, internal_4.convertSnapshotTreeToSummaryTree)(
558
+ // TODO why are we non null asserting here?
559
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
560
+ this.dataStoreContext.baseSnapshot.trees[contextId]);
556
561
  }
557
562
  summaryBuilder.addWithStats(contextId, summaryTree);
558
563
  });