@fluidframework/datastore 2.0.0-internal.6.3.3 → 2.0.0-internal.7.0.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,78 @@
1
1
  # @fluidframework/datastore
2
2
 
3
+ ## 2.0.0-internal.7.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
8
+
9
+ This included the following changes from the protocol-definitions release:
10
+
11
+ - Updating signal interfaces for some planned improvements. The intention is split the interface between signals
12
+ submitted by clients to the server and the resulting signals sent from the server to clients.
13
+ - A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
14
+ been added, which will be the typing for signals sent from the client to the server. Both extend a new
15
+ ISignalMessageBase interface that contains common members.
16
+ - The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
17
+
18
+ - runtime-definitions: `bindToContext` API removed [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
19
+
20
+ `bindToContext` has been removed from `FluidDataStoreRuntime`, `IFluidDataStoreContext` and
21
+ `MockFluidDataStoreContext`. This has been deprecated for several releases and cannot be used anymore.
22
+
23
+ - Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
24
+
25
+ Dependencies on the following Fluid server package have been updated to version 2.0.1:
26
+
27
+ - @fluidframework/gitresources: 2.0.1
28
+ - @fluidframework/server-kafka-orderer: 2.0.1
29
+ - @fluidframework/server-lambdas: 2.0.1
30
+ - @fluidframework/server-lambdas-driver: 2.0.1
31
+ - @fluidframework/server-local-server: 2.0.1
32
+ - @fluidframework/server-memory-orderer: 2.0.1
33
+ - @fluidframework/protocol-base: 2.0.1
34
+ - @fluidframework/server-routerlicious: 2.0.1
35
+ - @fluidframework/server-routerlicious-base: 2.0.1
36
+ - @fluidframework/server-services: 2.0.1
37
+ - @fluidframework/server-services-client: 2.0.1
38
+ - @fluidframework/server-services-core: 2.0.1
39
+ - @fluidframework/server-services-ordering-kafkanode: 2.0.1
40
+ - @fluidframework/server-services-ordering-rdkafka: 2.0.1
41
+ - @fluidframework/server-services-ordering-zookeeper: 2.0.1
42
+ - @fluidframework/server-services-shared: 2.0.1
43
+ - @fluidframework/server-services-telemetry: 2.0.1
44
+ - @fluidframework/server-services-utils: 2.0.1
45
+ - @fluidframework/server-test-utils: 2.0.1
46
+ - tinylicious: 2.0.1
47
+
48
+ - test-utils: provideEntryPoint is required [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
49
+
50
+ The optional `provideEntryPoint` method has become required on a number of constructors. A value will need to be provided to the following classes:
51
+
52
+ - `BaseContainerRuntimeFactory`
53
+ - `RuntimeFactory`
54
+ - `ContainerRuntime` (constructor and `loadRuntime`)
55
+ - `FluidDataStoreRuntime`
56
+
57
+ See [testContainerRuntimeFactoryWithDefaultDataStore.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/test/test-utils/src/testContainerRuntimeFactoryWithDefaultDataStore.ts) for an example implemtation of `provideEntryPoint` for ContainerRuntime.
58
+ See [pureDataObjectFactory.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts#L83) for an example implementation of `provideEntryPoint` for DataStoreRuntime.
59
+
60
+ Subsequently, various `entryPoint` and `getEntryPoint()` endpoints have become required. Please see [containerRuntime.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/runtime/container-runtime/src/containerRuntime.ts) for example implementations of these APIs.
61
+
62
+ For more details, see [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md)
63
+
64
+ - Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
65
+
66
+ The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
67
+
68
+ ## 2.0.0-internal.6.4.0
69
+
70
+ ### Minor Changes
71
+
72
+ - Some stack traces are improved ([#17380](https://github.com/microsoft/FluidFramework/issues/17380)) [34f2808ee9](https://github.com/microsoft/FluidFramework/commits/34f2808ee9764aef21b990f8b48860d9e3ce27a5)
73
+
74
+ Some stack traces have been improved and might now include frames for async functions that weren't previously included.
75
+
3
76
  ## 2.0.0-internal.6.3.0
4
77
 
5
78
  Dependency updates only.
@@ -8,12 +8,6 @@ exports.ChannelDeltaConnection = void 0;
8
8
  const core_utils_1 = require("@fluidframework/core-utils");
9
9
  const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
10
10
  class ChannelDeltaConnection {
11
- constructor(_connected, submit, dirty, addedGCOutboundReference) {
12
- this._connected = _connected;
13
- this.submit = submit;
14
- this.dirty = dirty;
15
- this.addedGCOutboundReference = addedGCOutboundReference;
16
- }
17
11
  get handler() {
18
12
  (0, core_utils_1.assert)(!!this._handler, 0x177 /* "Missing delta handler" */);
19
13
  return this._handler;
@@ -21,6 +15,12 @@ class ChannelDeltaConnection {
21
15
  get connected() {
22
16
  return this._connected;
23
17
  }
18
+ constructor(_connected, submit, dirty, addedGCOutboundReference) {
19
+ this._connected = _connected;
20
+ this.submit = submit;
21
+ this.dirty = dirty;
22
+ this.addedGCOutboundReference = addedGCOutboundReference;
23
+ }
24
24
  attach(handler) {
25
25
  (0, core_utils_1.assert)(this._handler === undefined, 0x178 /* "Missing delta handler on attach" */);
26
26
  this._handler = handler;
@@ -1 +1 @@
1
- {"version":3,"file":"channelDeltaConnection.js","sourceRoot":"","sources":["../src/channelDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAGpD,qEAAsE;AAGtE,MAAa,sBAAsB;IAW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AC,QAAQ,KAAK,SAAS,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACpD;QACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACjD,CAAC;IAEM,cAAc,CAAC,OAAY;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;CACD;AA1DD,wDA0DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { IDeltaConnection, IDeltaHandler } from \"@fluidframework/datastore-definitions\";\nimport { DataProcessingError } from \"@fluidframework/telemetry-utils\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nexport class ChannelDeltaConnection implements IDeltaConnection {\n\tprivate _handler: IDeltaHandler | undefined;\n\n\tprivate get handler(): IDeltaHandler {\n\t\tassert(!!this._handler, 0x177 /* \"Missing delta handler\" */);\n\t\treturn this._handler;\n\t}\n\tpublic get connected(): boolean {\n\t\treturn this._connected;\n\t}\n\n\tconstructor(\n\t\tprivate _connected: boolean,\n\t\tpublic readonly submit: (content: any, localOpMetadata: unknown) => void,\n\t\tpublic readonly dirty: () => void,\n\t\tpublic readonly addedGCOutboundReference: (\n\t\t\tsrcHandle: IFluidHandle,\n\t\t\toutboundHandle: IFluidHandle,\n\t\t) => void,\n\t) {}\n\n\tpublic attach(handler: IDeltaHandler) {\n\t\tassert(this._handler === undefined, 0x178 /* \"Missing delta handler on attach\" */);\n\t\tthis._handler = handler;\n\t}\n\n\tpublic setConnectionState(connected: boolean) {\n\t\tthis._connected = connected;\n\t\tthis.handler.setConnectionState(connected);\n\t}\n\n\tpublic process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) {\n\t\ttry {\n\t\t\t// catches as data processing error whether or not they come from async pending queues\n\t\t\tthis.handler.process(message, local, localOpMetadata);\n\t\t} catch (error) {\n\t\t\tthrow DataProcessingError.wrapIfUnrecognized(\n\t\t\t\terror,\n\t\t\t\t\"channelDeltaConnectionFailedToProcessMessage\",\n\t\t\t\tmessage,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic reSubmit(content: any, localOpMetadata: unknown) {\n\t\tthis.handler.reSubmit(content, localOpMetadata);\n\t}\n\n\tpublic rollback(content: any, localOpMetadata: unknown) {\n\t\tif (this.handler.rollback === undefined) {\n\t\t\tthrow new Error(\"Handler doesn't support rollback\");\n\t\t}\n\t\tthis.handler.rollback(content, localOpMetadata);\n\t}\n\n\tpublic applyStashedOp(content: any): unknown {\n\t\treturn this.handler.applyStashedOp(content);\n\t}\n}\n"]}
1
+ {"version":3,"file":"channelDeltaConnection.js","sourceRoot":"","sources":["../src/channelDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAGpD,qEAAsE;AAGtE,MAAa,sBAAsB;IAGlC,IAAY,OAAO;QAClB,IAAA,mBAAM,EAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IACD,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,YACS,UAAmB,EACX,MAAwD,EACxD,KAAiB,EACjB,wBAGP;QAND,eAAU,GAAV,UAAU,CAAS;QACX,WAAM,GAAN,MAAM,CAAkD;QACxD,UAAK,GAAL,KAAK,CAAY;QACjB,6BAAwB,GAAxB,wBAAwB,CAG/B;IACP,CAAC;IAEG,MAAM,CAAC,OAAsB;QACnC,IAAA,mBAAM,EAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACnF,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,kBAAkB,CAAC,SAAkB;QAC3C,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;IAEM,OAAO,CAAC,OAAkC,EAAE,KAAc,EAAE,eAAwB;QAC1F,IAAI;YACH,sFAAsF;YACtF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;SACtD;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,qCAAmB,CAAC,kBAAkB,CAC3C,KAAK,EACL,8CAA8C,EAC9C,OAAO,CACP,CAAC;SACF;IACF,CAAC;IAEM,QAAQ,CAAC,OAAY,EAAE,eAAwB;QACrD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACjD,CAAC;IAEM,QAAQ,CAAC,OAAY,EAAE,eAAwB;QACrD,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACpD;QACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACjD,CAAC;IAEM,cAAc,CAAC,OAAY;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;CACD;AA1DD,wDA0DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { IDeltaConnection, IDeltaHandler } from \"@fluidframework/datastore-definitions\";\nimport { DataProcessingError } from \"@fluidframework/telemetry-utils\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nexport class ChannelDeltaConnection implements IDeltaConnection {\n\tprivate _handler: IDeltaHandler | undefined;\n\n\tprivate get handler(): IDeltaHandler {\n\t\tassert(!!this._handler, 0x177 /* \"Missing delta handler\" */);\n\t\treturn this._handler;\n\t}\n\tpublic get connected(): boolean {\n\t\treturn this._connected;\n\t}\n\n\tconstructor(\n\t\tprivate _connected: boolean,\n\t\tpublic readonly submit: (content: any, localOpMetadata: unknown) => void,\n\t\tpublic readonly dirty: () => void,\n\t\tpublic readonly addedGCOutboundReference: (\n\t\t\tsrcHandle: IFluidHandle,\n\t\t\toutboundHandle: IFluidHandle,\n\t\t) => void,\n\t) {}\n\n\tpublic attach(handler: IDeltaHandler) {\n\t\tassert(this._handler === undefined, 0x178 /* \"Missing delta handler on attach\" */);\n\t\tthis._handler = handler;\n\t}\n\n\tpublic setConnectionState(connected: boolean) {\n\t\tthis._connected = connected;\n\t\tthis.handler.setConnectionState(connected);\n\t}\n\n\tpublic process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) {\n\t\ttry {\n\t\t\t// catches as data processing error whether or not they come from async pending queues\n\t\t\tthis.handler.process(message, local, localOpMetadata);\n\t\t} catch (error) {\n\t\t\tthrow DataProcessingError.wrapIfUnrecognized(\n\t\t\t\terror,\n\t\t\t\t\"channelDeltaConnectionFailedToProcessMessage\",\n\t\t\t\tmessage,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic reSubmit(content: any, localOpMetadata: unknown) {\n\t\tthis.handler.reSubmit(content, localOpMetadata);\n\t}\n\n\tpublic rollback(content: any, localOpMetadata: unknown) {\n\t\tif (this.handler.rollback === undefined) {\n\t\t\tthrow new Error(\"Handler doesn't support rollback\");\n\t\t}\n\t\tthis.handler.rollback(content, localOpMetadata);\n\t}\n\n\tpublic applyStashedOp(content: any): unknown {\n\t\treturn this.handler.applyStashedOp(content);\n\t}\n}\n"]}
@@ -7,6 +7,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ChannelStorageService = void 0;
8
8
  const runtime_utils_1 = require("@fluidframework/runtime-utils");
9
9
  class ChannelStorageService {
10
+ 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);
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];
18
+ }
19
+ }
10
20
  constructor(tree, storage, logger, extraBlobs) {
11
21
  this.tree = tree;
12
22
  this.storage = storage;
@@ -18,16 +28,6 @@ class ChannelStorageService {
18
28
  ChannelStorageService.flattenTree("", tree, this.flattenedTree);
19
29
  }
20
30
  }
21
- static flattenTree(base, tree, results) {
22
- // eslint-disable-next-line guard-for-in, no-restricted-syntax
23
- for (const path in tree.trees) {
24
- ChannelStorageService.flattenTree(`${base}${path}/`, tree.trees[path], results);
25
- }
26
- // eslint-disable-next-line guard-for-in, no-restricted-syntax
27
- for (const blob in tree.blobs) {
28
- results[`${base}${blob}`] = tree.blobs[blob];
29
- }
30
- }
31
31
  async contains(path) {
32
32
  return this.flattenedTree[path] !== undefined;
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"channelStorageService.js","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,iEAAoF;AAGpF,MAAa,qBAAqB;IAmBjC,YACkB,IAA+B,EAC/B,OAAkD,EAClD,MAA2B,EAC3B,UAAyC;QAHzC,SAAI,GAAJ,IAAI,CAA2B;QAC/B,YAAO,GAAP,OAAO,CAA2C;QAClD,WAAM,GAAN,MAAM,CAAqB;QAC3B,eAAU,GAAV,UAAU,CAA+B;QAE1D,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,mCAAmC;QACnC,IAAI,IAAI,KAAK,SAAS,EAAE;YACvB,qBAAqB,CAAC,WAAW,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,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CAAC,IAAI,CAAC,IAAY;QAC7B,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,MAAM,SAAS,GAAG,IAAA,mDAAmC,EAAC,IAAI,CAAC,CAAC;QAC5D,OAAO,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YAClD,oEAAoE;YACpE,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAG,CAAC;YAChC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB;QACD,IAAI,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACjD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACvC;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 { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { IChannelStorageService } from \"@fluidframework/datastore-definitions\";\nimport { getNormalizedObjectStoragePathParts } from \"@fluidframework/runtime-utils\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\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","source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C,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEjF,IAAI,IAAI,KAAK,SAAS,EAAE;YACvB,OAAO,IAAI,CAAC;SACZ;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CACrB,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,EAAE,KAAK,CAAC,CAC3E,CAAC;QAEF,OAAO,KAAK,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,IAAY;QAC7B,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,MAAM,SAAS,GAAG,IAAA,mDAAmC,EAAC,IAAI,CAAC,CAAC;QAC5D,OAAO,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YAClD,oEAAoE;YACpE,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAG,CAAC;YAChC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB;QACD,IAAI,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACjD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACvC;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 { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { IChannelStorageService } from \"@fluidframework/datastore-definitions\";\nimport { getNormalizedObjectStoragePathParts } from \"@fluidframework/runtime-utils\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\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"]}
@@ -34,7 +34,7 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
34
34
  /**
35
35
  * {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.entryPoint}
36
36
  */
37
- readonly entryPoint?: IFluidHandle<FluidObject>;
37
+ readonly entryPoint: IFluidHandle<FluidObject>;
38
38
  /**
39
39
  * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
40
40
  */
@@ -89,17 +89,14 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
89
89
  * @param dataStoreContext - Context object for the runtime.
90
90
  * @param sharedObjectRegistry - The registry of shared objects that this data store will be able to instantiate.
91
91
  * @param existing - Pass 'true' if loading this datastore from an existing file; pass 'false' otherwise.
92
- * @param initializeEntryPoint - Function to initialize the entryPoint object for the data store runtime. The
92
+ * @param provideEntryPoint - Function to initialize the entryPoint object for the data store runtime. The
93
93
  * handle to this data store runtime will point to the object returned by this function. If this function is not
94
94
  * provided, the handle will be left undefined. This is here so we can start making handles a first-class citizen
95
95
  * and the primary way of interacting with some Fluid objects, and should be used if possible.
96
96
  */
97
- constructor(dataStoreContext: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean, initializeEntryPoint?: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>);
97
+ constructor(dataStoreContext: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean, provideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>);
98
98
  dispose(): void;
99
99
  resolveHandle(request: IRequest): Promise<IResponse>;
100
- /**
101
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
102
- */
103
100
  request(request: IRequest): Promise<IResponse>;
104
101
  getChannel(id: string): Promise<IChannel>;
105
102
  createChannel(id: string | undefined, type: string): IChannel;
@@ -125,14 +122,6 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
125
122
  * This function is called when a handle to this data store is added to a visible DDS.
126
123
  */
127
124
  attachGraph(): void;
128
- /**
129
- * @deprecated - Not necessary if consumers add a new dataStore to the container by storing its handle.
130
- * Binds this runtime to the container
131
- * This includes the following:
132
- * 1. Sending an Attach op that includes all existing state
133
- * 2. Attaching the graph if the data store becomes attached.
134
- */
135
- bindToContext(): void;
136
125
  bind(handle: IFluidHandle): void;
137
126
  setConnectionState(connected: boolean, clientId?: string): void;
138
127
  getQuorum(): IQuorumClients;
@@ -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,EAEN,mBAAmB,EAQnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EAIzB,cAAc,EACd,MAAM,s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,4BAA4B,iCAUD,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,sBAErB,qBAAqB,KAC1B,QAAQ;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,SACvD,4BAA4B,iCAyCD,CAAC"}
@@ -23,23 +23,96 @@ var DataStoreMessageType;
23
23
  // Creates a new channel
24
24
  DataStoreMessageType["Attach"] = "attach";
25
25
  DataStoreMessageType["ChannelOp"] = "op";
26
- })(DataStoreMessageType = exports.DataStoreMessageType || (exports.DataStoreMessageType = {}));
26
+ })(DataStoreMessageType || (exports.DataStoreMessageType = DataStoreMessageType = {}));
27
27
  /**
28
28
  * Base data store class
29
29
  */
30
30
  class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
31
+ /**
32
+ * @deprecated - Instantiate the class using its constructor instead.
33
+ *
34
+ * Loads the data store runtime
35
+ * @param context - The data store context
36
+ * @param sharedObjectRegistry - The registry of shared objects used by this data store
37
+ * @param existing - If loading from an existing file.
38
+ */
39
+ static load(context, sharedObjectRegistry, existing) {
40
+ return new FluidDataStoreRuntime(context, sharedObjectRegistry, existing, async (dataStoreRuntime) => dataStoreRuntime.entryPoint);
41
+ }
42
+ /**
43
+ * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
44
+ */
45
+ get IFluidRouter() {
46
+ return this;
47
+ }
48
+ get connected() {
49
+ return this.dataStoreContext.connected;
50
+ }
51
+ get clientId() {
52
+ return this.dataStoreContext.clientId;
53
+ }
54
+ get clientDetails() {
55
+ return this.dataStoreContext.clientDetails;
56
+ }
57
+ get isAttached() {
58
+ return this.attachState !== container_definitions_1.AttachState.Detached;
59
+ }
60
+ get attachState() {
61
+ return this._attachState;
62
+ }
63
+ get absolutePath() {
64
+ return (0, runtime_utils_1.generateHandleContextPath)(this.id, this.routeContext);
65
+ }
66
+ get routeContext() {
67
+ return this.dataStoreContext.IFluidHandleContext;
68
+ }
69
+ get idCompressor() {
70
+ return this.dataStoreContext.idCompressor;
71
+ }
72
+ get IFluidHandleContext() {
73
+ return this;
74
+ }
75
+ get rootRoutingContext() {
76
+ return this;
77
+ }
78
+ get channelsRoutingContext() {
79
+ return this;
80
+ }
81
+ get objectsRoutingContext() {
82
+ return this;
83
+ }
84
+ get disposed() {
85
+ return this._disposed;
86
+ }
87
+ get logger() {
88
+ return this.mc.logger;
89
+ }
90
+ /**
91
+ * Invokes the given callback and expects that no ops are submitted
92
+ * until execution finishes. If an op is submitted, an error will be raised.
93
+ *
94
+ * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
95
+ *
96
+ * @param callback - the callback to be invoked
97
+ */
98
+ ensureNoDataModelChanges(callback) {
99
+ // back-compat ADO:2309
100
+ return this.dataStoreContext.ensureNoDataModelChanges === undefined
101
+ ? callback()
102
+ : this.dataStoreContext.ensureNoDataModelChanges(callback);
103
+ }
31
104
  /**
32
105
  * Create an instance of a DataStore runtime.
33
106
  *
34
107
  * @param dataStoreContext - Context object for the runtime.
35
108
  * @param sharedObjectRegistry - The registry of shared objects that this data store will be able to instantiate.
36
109
  * @param existing - Pass 'true' if loading this datastore from an existing file; pass 'false' otherwise.
37
- * @param initializeEntryPoint - Function to initialize the entryPoint object for the data store runtime. The
110
+ * @param provideEntryPoint - Function to initialize the entryPoint object for the data store runtime. The
38
111
  * handle to this data store runtime will point to the object returned by this function. If this function is not
39
112
  * provided, the handle will be left undefined. This is here so we can start making handles a first-class citizen
40
113
  * and the primary way of interacting with some Fluid objects, and should be used if possible.
41
114
  */
42
- constructor(dataStoreContext, sharedObjectRegistry, existing, initializeEntryPoint) {
115
+ constructor(dataStoreContext, sharedObjectRegistry, existing, provideEntryPoint) {
43
116
  super();
44
117
  this.dataStoreContext = dataStoreContext;
45
118
  this.sharedObjectRegistry = sharedObjectRegistry;
@@ -98,10 +171,7 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
98
171
  this.contexts.set(path, channelContext);
99
172
  });
100
173
  }
101
- if (initializeEntryPoint) {
102
- const promise = new core_utils_1.LazyPromise(async () => initializeEntryPoint(this));
103
- this.entryPoint = new fluidHandle_1.FluidObjectHandle(promise, "", this.objectsRoutingContext);
104
- }
174
+ this.entryPoint = new fluidHandle_1.FluidObjectHandle(new core_utils_1.LazyPromise(async () => provideEntryPoint(this)), "", this.objectsRoutingContext);
105
175
  this.attachListener();
106
176
  this._attachState = dataStoreContext.attachState;
107
177
  /**
@@ -131,79 +201,6 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
131
201
  this.localChangesTelemetryCount =
132
202
  this.mc.config.getNumber("Fluid.Telemetry.LocalChangesTelemetryCount") ?? 10;
133
203
  }
134
- /**
135
- * @deprecated - Instantiate the class using its constructor instead.
136
- *
137
- * Loads the data store runtime
138
- * @param context - The data store context
139
- * @param sharedObjectRegistry - The registry of shared objects used by this data store
140
- * @param existing - If loading from an existing file.
141
- */
142
- static load(context, sharedObjectRegistry, existing) {
143
- return new FluidDataStoreRuntime(context, sharedObjectRegistry, existing, async (dataStoreRuntime) => (0, runtime_utils_1.requestFluidObject)(dataStoreRuntime, "/"));
144
- }
145
- /**
146
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
147
- */
148
- get IFluidRouter() {
149
- return this;
150
- }
151
- get connected() {
152
- return this.dataStoreContext.connected;
153
- }
154
- get clientId() {
155
- return this.dataStoreContext.clientId;
156
- }
157
- get clientDetails() {
158
- return this.dataStoreContext.clientDetails;
159
- }
160
- get isAttached() {
161
- return this.attachState !== container_definitions_1.AttachState.Detached;
162
- }
163
- get attachState() {
164
- return this._attachState;
165
- }
166
- get absolutePath() {
167
- return (0, runtime_utils_1.generateHandleContextPath)(this.id, this.routeContext);
168
- }
169
- get routeContext() {
170
- return this.dataStoreContext.IFluidHandleContext;
171
- }
172
- get idCompressor() {
173
- return this.dataStoreContext.idCompressor;
174
- }
175
- get IFluidHandleContext() {
176
- return this;
177
- }
178
- get rootRoutingContext() {
179
- return this;
180
- }
181
- get channelsRoutingContext() {
182
- return this;
183
- }
184
- get objectsRoutingContext() {
185
- return this;
186
- }
187
- get disposed() {
188
- return this._disposed;
189
- }
190
- get logger() {
191
- return this.mc.logger;
192
- }
193
- /**
194
- * Invokes the given callback and expects that no ops are submitted
195
- * until execution finishes. If an op is submitted, an error will be raised.
196
- *
197
- * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
198
- *
199
- * @param callback - the callback to be invoked
200
- */
201
- ensureNoDataModelChanges(callback) {
202
- // back-compat ADO:2309
203
- return this.dataStoreContext.ensureNoDataModelChanges === undefined
204
- ? callback()
205
- : this.dataStoreContext.ensureNoDataModelChanges(callback);
206
- }
207
204
  dispose() {
208
205
  if (this._disposed) {
209
206
  return;
@@ -215,15 +212,12 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
215
212
  async resolveHandle(request) {
216
213
  return this.request(request);
217
214
  }
218
- /**
219
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
220
- */
221
215
  async request(request) {
222
216
  try {
223
217
  const parser = runtime_utils_1.RequestParser.create(request);
224
218
  const id = parser.pathParts[0];
225
219
  if (id === "_channels" || id === "_custom") {
226
- return this.request(parser.createSubRequest(1));
220
+ return await this.request(parser.createSubRequest(1));
227
221
  }
228
222
  // Check for a data type reference first
229
223
  const context = this.contexts.get(id);
@@ -319,16 +313,6 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
319
313
  attachGraph() {
320
314
  this.makeVisibleAndAttachGraph();
321
315
  }
322
- /**
323
- * @deprecated - Not necessary if consumers add a new dataStore to the container by storing its handle.
324
- * Binds this runtime to the container
325
- * This includes the following:
326
- * 1. Sending an Attach op that includes all existing state
327
- * 2. Attaching the graph if the data store becomes attached.
328
- */
329
- bindToContext() {
330
- this.makeVisibleAndAttachGraph();
331
- }
332
316
  bind(handle) {
333
317
  // If visible, attach the incoming handle's graph. Else, this will be done when we become visible.
334
318
  if (this.visibilityState !== runtime_definitions_1.VisibilityState.NotVisible) {
@@ -801,9 +785,15 @@ const mixinSummaryHandler = (handler, Base = FluidDataStoreRuntime) => class Run
801
785
  }
802
786
  async summarize(...args) {
803
787
  const summary = await super.summarize(...args);
804
- const content = await handler(this);
805
- if (content !== undefined) {
806
- this.addBlob(summary, content.path, content.content);
788
+ try {
789
+ const content = await handler(this);
790
+ if (content !== undefined) {
791
+ this.addBlob(summary, content.path, content.content);
792
+ }
793
+ }
794
+ catch (e) {
795
+ // Any error coming from app-provided handler should be marked as DataProcessingError
796
+ throw telemetry_utils_1.DataProcessingError.wrapIfUnrecognized(e, "mixinSummaryHandler");
807
797
  }
808
798
  return summary;
809
799
  }