@fluidframework/datastore 2.1.0-276326 → 2.1.0-281041

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.
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,2BAA2B,CAAC;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,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/datastore\";\nexport const pkgVersion = \"2.1.0-276326\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,2BAA2B,CAAC;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,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/datastore\";\nexport const pkgVersion = \"2.1.0-281041\";\n"]}
package/lib/public.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  /*
7
7
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
- * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
8
+ * Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
9
9
  */
10
10
 
11
11
  export {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/datastore",
3
- "version": "2.1.0-276326",
3
+ "version": "2.1.0-281041",
4
4
  "description": "Fluid data store implementation",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -67,29 +67,29 @@
67
67
  "temp-directory": "nyc/.nyc_output"
68
68
  },
69
69
  "dependencies": {
70
- "@fluid-internal/client-utils": "2.1.0-276326",
71
- "@fluidframework/container-definitions": "2.1.0-276326",
72
- "@fluidframework/core-interfaces": "2.1.0-276326",
73
- "@fluidframework/core-utils": "2.1.0-276326",
74
- "@fluidframework/datastore-definitions": "2.1.0-276326",
75
- "@fluidframework/driver-definitions": "2.1.0-276326",
76
- "@fluidframework/driver-utils": "2.1.0-276326",
77
- "@fluidframework/id-compressor": "2.1.0-276326",
78
- "@fluidframework/runtime-definitions": "2.1.0-276326",
79
- "@fluidframework/runtime-utils": "2.1.0-276326",
80
- "@fluidframework/telemetry-utils": "2.1.0-276326",
70
+ "@fluid-internal/client-utils": "2.1.0-281041",
71
+ "@fluidframework/container-definitions": "2.1.0-281041",
72
+ "@fluidframework/core-interfaces": "2.1.0-281041",
73
+ "@fluidframework/core-utils": "2.1.0-281041",
74
+ "@fluidframework/datastore-definitions": "2.1.0-281041",
75
+ "@fluidframework/driver-definitions": "2.1.0-281041",
76
+ "@fluidframework/driver-utils": "2.1.0-281041",
77
+ "@fluidframework/id-compressor": "2.1.0-281041",
78
+ "@fluidframework/runtime-definitions": "2.1.0-281041",
79
+ "@fluidframework/runtime-utils": "2.1.0-281041",
80
+ "@fluidframework/telemetry-utils": "2.1.0-281041",
81
81
  "uuid": "^9.0.0"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@arethetypeswrong/cli": "^0.15.2",
85
- "@biomejs/biome": "^1.7.3",
86
- "@fluid-internal/mocha-test-setup": "2.1.0-276326",
87
- "@fluid-tools/build-cli": "^0.39.0",
85
+ "@biomejs/biome": "~1.8.3",
86
+ "@fluid-internal/mocha-test-setup": "2.1.0-281041",
87
+ "@fluid-tools/build-cli": "^0.40.0",
88
88
  "@fluidframework/build-common": "^2.0.3",
89
- "@fluidframework/build-tools": "^0.39.0",
90
- "@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.0.0-rc.5.0.0",
89
+ "@fluidframework/build-tools": "^0.40.0",
90
+ "@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.0.0",
91
91
  "@fluidframework/eslint-config-fluid": "^5.3.0",
92
- "@fluidframework/test-runtime-utils": "2.1.0-276326",
92
+ "@fluidframework/test-runtime-utils": "2.1.0-281041",
93
93
  "@microsoft/api-extractor": "^7.45.1",
94
94
  "@types/lodash": "^4.14.118",
95
95
  "@types/mocha": "^9.1.1",
@@ -116,18 +116,19 @@
116
116
  "api-extractor:commonjs": "flub generate entrypoints --outDir ./dist",
117
117
  "api-extractor:esnext": "flub generate entrypoints --outDir ./lib --node10TypeCompat",
118
118
  "build": "fluid-build . --task build",
119
+ "build:api-reports": "concurrently \"npm:build:api-reports:*\"",
120
+ "build:api-reports:current": "api-extractor run --local --config api-extractor/api-extractor.current.json",
121
+ "build:api-reports:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
119
122
  "build:commonjs": "fluid-build . --task commonjs",
120
123
  "build:compile": "fluid-build . --task compile",
121
- "build:docs": "concurrently \"npm:build:docs:*\"",
122
- "build:docs:current": "api-extractor run --local",
123
- "build:docs:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
124
+ "build:docs": "api-extractor run --local",
124
125
  "build:esnext": "tsc --project ./tsconfig.json",
125
126
  "build:genver": "gen-version",
126
127
  "build:test": "npm run build:test:esm && npm run build:test:cjs",
127
128
  "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
128
129
  "build:test:esm": "tsc --project ./src/test/tsconfig.json",
129
130
  "check:are-the-types-wrong": "attw --pack .",
130
- "check:biome": "biome check . --formatter-enabled=true",
131
+ "check:biome": "biome check .",
131
132
  "check:exports": "concurrently \"npm:check:exports:*\"",
132
133
  "check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
133
134
  "check:exports:cjs:legacy": "api-extractor run --config api-extractor/api-extractor-lint-legacy.cjs.json",
@@ -136,14 +137,15 @@
136
137
  "check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
137
138
  "check:format": "npm run check:biome",
138
139
  "check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
139
- "ci:build:docs": "concurrently \"npm:ci:build:docs:*\"",
140
- "ci:build:docs:current": "api-extractor run",
141
- "ci:build:docs:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
140
+ "ci:build:api-reports": "concurrently \"npm:ci:build:api-reports:*\"",
141
+ "ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor.current.json",
142
+ "ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
143
+ "ci:build:docs": "api-extractor run",
142
144
  "clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
143
145
  "eslint": "eslint --format stylish src",
144
146
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
145
147
  "format": "npm run format:biome",
146
- "format:biome": "biome check . --formatter-enabled=true --apply",
148
+ "format:biome": "biome check . --write",
147
149
  "format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
148
150
  "lint": "fluid-build . --task lint",
149
151
  "lint:fix": "fluid-build . --task eslint:fix --task format",
@@ -3,6 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import { assert } from "@fluidframework/core-utils/internal";
6
7
  import { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
7
8
  import {
8
9
  IDocumentStorageService,
@@ -17,14 +18,12 @@ export class ChannelStorageService implements IChannelStorageService {
17
18
  tree: ISnapshotTree,
18
19
  results: { [path: string]: string },
19
20
  ) {
20
- // eslint-disable-next-line guard-for-in, no-restricted-syntax
21
- for (const path in tree.trees) {
22
- ChannelStorageService.flattenTree(`${base}${path}/`, tree.trees[path], results);
21
+ for (const [path, subtree] of Object.entries(tree.trees)) {
22
+ ChannelStorageService.flattenTree(`${base}${path}/`, subtree, results);
23
23
  }
24
24
 
25
- // eslint-disable-next-line guard-for-in, no-restricted-syntax
26
- for (const blob in tree.blobs) {
27
- results[`${base}${blob}`] = tree.blobs[blob];
25
+ for (const [blobName, blobId] of Object.entries(tree.blobs)) {
26
+ results[`${base}${blobName}`] = blobId;
28
27
  }
29
28
  }
30
29
 
@@ -49,6 +48,7 @@ export class ChannelStorageService implements IChannelStorageService {
49
48
 
50
49
  public async readBlob(path: string): Promise<ArrayBufferLike> {
51
50
  const id = await this.getIdForPath(path);
51
+ assert(id !== undefined, "id is undefined in ChannelStorageService.readBlob()");
52
52
  const blob = this.extraBlobs !== undefined ? this.extraBlobs.get(id) : undefined;
53
53
 
54
54
  if (blob !== undefined) {
@@ -77,7 +77,7 @@ export class ChannelStorageService implements IChannelStorageService {
77
77
  return Object.keys(tree?.blobs ?? {});
78
78
  }
79
79
 
80
- private async getIdForPath(path: string): Promise<string> {
80
+ private async getIdForPath(path: string): Promise<string | undefined> {
81
81
  return this.flattenedTree[path];
82
82
  }
83
83
  }
@@ -255,7 +255,7 @@ export class FluidDataStoreRuntime
255
255
 
256
256
  // Must always receive the data store type inside of the attributes
257
257
  if (tree?.trees !== undefined) {
258
- Object.keys(tree.trees).forEach((path) => {
258
+ Object.entries(tree.trees).forEach(([path, subtree]) => {
259
259
  // Issue #4414
260
260
  if (path === "_search") {
261
261
  return;
@@ -266,7 +266,7 @@ export class FluidDataStoreRuntime
266
266
  // container from snapshot where we load detached container from a snapshot, isLocalDataStore would be
267
267
  // true. In this case create a RehydratedLocalChannelContext.
268
268
  if (dataStoreContext.isLocalDataStore) {
269
- channelContext = this.createRehydratedLocalChannelContext(path, tree.trees[path]);
269
+ channelContext = this.createRehydratedLocalChannelContext(path, subtree);
270
270
  // This is the case of rehydrating a detached container from snapshot. Now due to delay loading of
271
271
  // data store, if the data store is loaded after the container is attached, then we missed making
272
272
  // the channel visible. So do it now. Otherwise, add it to local channel context queue, so
@@ -284,7 +284,7 @@ export class FluidDataStoreRuntime
284
284
  (content, localOpMetadata) => this.submitChannelOp(path, content, localOpMetadata),
285
285
  (address: string) => this.setChannelDirty(address),
286
286
  path,
287
- tree.trees[path],
287
+ subtree,
288
288
  this.sharedObjectRegistry,
289
289
  undefined /* extraBlobs */,
290
290
  this.dataStoreContext.getCreateChildSummarizerNodeFn(path, {
@@ -362,17 +362,19 @@ export class FluidDataStoreRuntime
362
362
  return await this.request(parser.createSubRequest(1));
363
363
  }
364
364
 
365
- // Check for a data type reference first
366
- const context = this.contexts.get(id);
367
- if (context !== undefined && parser.isLeaf(1)) {
368
- try {
369
- const channel = await context.getChannel();
365
+ if (id !== undefined) {
366
+ // Check for a data type reference first
367
+ const context = this.contexts.get(id);
368
+ if (context !== undefined && parser.isLeaf(1)) {
369
+ try {
370
+ const channel = await context.getChannel();
370
371
 
371
- return { mimeType: "fluid/object", status: 200, value: channel };
372
- } catch (error) {
373
- this.mc.logger.sendErrorEvent({ eventName: "GetChannelFailedInRequest" }, error);
372
+ return { mimeType: "fluid/object", status: 200, value: channel };
373
+ } catch (error) {
374
+ this.mc.logger.sendErrorEvent({ eventName: "GetChannelFailedInRequest" }, error);
374
375
 
375
- return createResponseError(500, `Failed to get Channel: ${error}`, request);
376
+ return createResponseError(500, `Failed to get Channel: ${error}`, request);
377
+ }
376
378
  }
377
379
  }
378
380
 
@@ -850,7 +852,9 @@ export class FluidDataStoreRuntime
850
852
  0x181 /* "BaseSnapshot should be there as detached container loaded from snapshot" */,
851
853
  );
852
854
  summaryTree = convertSnapshotTreeToSummaryTree(
853
- this.dataStoreContext.baseSnapshot.trees[contextId],
855
+ // TODO why are we non null asserting here?
856
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
857
+ this.dataStoreContext.baseSnapshot.trees[contextId]!,
854
858
  );
855
859
  }
856
860
  summaryBuilder.addWithStats(contextId, summaryTree);
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/datastore";
9
- export const pkgVersion = "2.1.0-276326";
9
+ export const pkgVersion = "2.1.0-281041";
package/tsconfig.json CHANGED
@@ -5,7 +5,6 @@
5
5
  "compilerOptions": {
6
6
  "rootDir": "./src",
7
7
  "outDir": "./lib",
8
- "noUncheckedIndexedAccess": false,
9
8
  "exactOptionalPropertyTypes": false,
10
9
  },
11
10
  }