@fluidframework/datastore 2.74.0 → 2.80.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-report/datastore.legacy.beta.api.md +2 -2
  3. package/dist/channelContext.d.ts +1 -1
  4. package/dist/channelContext.d.ts.map +1 -1
  5. package/dist/channelContext.js.map +1 -1
  6. package/dist/dataStoreLayerCompatState.d.ts +3 -3
  7. package/dist/dataStoreLayerCompatState.d.ts.map +1 -1
  8. package/dist/dataStoreLayerCompatState.js +4 -3
  9. package/dist/dataStoreLayerCompatState.js.map +1 -1
  10. package/dist/dataStoreRuntime.d.ts +2 -2
  11. package/dist/dataStoreRuntime.d.ts.map +1 -1
  12. package/dist/dataStoreRuntime.js +4 -5
  13. package/dist/dataStoreRuntime.js.map +1 -1
  14. package/dist/packageVersion.d.ts +1 -1
  15. package/dist/packageVersion.js +1 -1
  16. package/dist/packageVersion.js.map +1 -1
  17. package/lib/channelContext.d.ts +1 -1
  18. package/lib/channelContext.d.ts.map +1 -1
  19. package/lib/channelContext.js.map +1 -1
  20. package/lib/dataStoreLayerCompatState.d.ts +3 -3
  21. package/lib/dataStoreLayerCompatState.d.ts.map +1 -1
  22. package/lib/dataStoreLayerCompatState.js +4 -3
  23. package/lib/dataStoreLayerCompatState.js.map +1 -1
  24. package/lib/dataStoreRuntime.d.ts +2 -2
  25. package/lib/dataStoreRuntime.d.ts.map +1 -1
  26. package/lib/dataStoreRuntime.js +5 -6
  27. package/lib/dataStoreRuntime.js.map +1 -1
  28. package/lib/packageVersion.d.ts +1 -1
  29. package/lib/packageVersion.js +1 -1
  30. package/lib/packageVersion.js.map +1 -1
  31. package/package.json +23 -23
  32. package/src/channelContext.ts +1 -1
  33. package/src/dataStoreLayerCompatState.ts +8 -7
  34. package/src/dataStoreRuntime.ts +18 -10
  35. package/src/packageVersion.ts +1 -1
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ import { generation, } from "@fluid-internal/client-utils";
5
6
  import { validateLayerCompatibility, } from "@fluidframework/telemetry-utils/internal";
6
7
  import { pkgVersion } from "./packageVersion.js";
7
8
  /**
@@ -16,7 +17,7 @@ export const dataStoreCoreCompatDetails = {
16
17
  /**
17
18
  * The current generation of the DataStore layer.
18
19
  */
19
- generation: 3,
20
+ generation,
20
21
  };
21
22
  /**
22
23
  * DataStore's compatibility details that is exposed to the Runtime layer.
@@ -48,7 +49,7 @@ export const runtimeSupportRequirementsForDataStore = {
48
49
  * Validates that the Runtime layer is compatible with this DataStore.
49
50
  * @internal
50
51
  */
51
- export function validateRuntimeCompatibility(maybeRuntimeCompatDetails, disposeFn, logger) {
52
- validateLayerCompatibility("dataStore", "runtime", dataStoreCompatDetailsForRuntime, runtimeSupportRequirementsForDataStore, maybeRuntimeCompatDetails, disposeFn, logger);
52
+ export function validateRuntimeCompatibility(maybeRuntimeCompatDetails, disposeFn, mc) {
53
+ validateLayerCompatibility("dataStore", "runtime", dataStoreCompatDetailsForRuntime, runtimeSupportRequirementsForDataStore, maybeRuntimeCompatDetails, disposeFn, mc);
53
54
  }
54
55
  //# sourceMappingURL=dataStoreLayerCompatState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreLayerCompatState.js","sourceRoot":"","sources":["../src/dataStoreLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,0BAA0B,GAE1B,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACzC;;OAEG;IACH,UAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAwB;IACpE,GAAG,0BAA0B;IAC7B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAoC;IACtF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC3C,yBAA0D,EAC1D,SAAqB,EACrB,MAA2B;IAE3B,0BAA0B,CACzB,WAAW,EACX,SAAS,EACT,gCAAgC,EAChC,sCAAsC,EACtC,yBAAyB,EACzB,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport {\n\tvalidateLayerCompatibility,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The core compatibility details of the DataStore layer that is the same across all layer boundaries.\n * @internal\n */\nexport const dataStoreCoreCompatDetails = {\n\t/**\n\t * The package version of the DataStore layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the DataStore layer.\n\t */\n\tgeneration: 3,\n};\n\n/**\n * DataStore's compatibility details that is exposed to the Runtime layer.\n * @internal\n */\nexport const dataStoreCompatDetailsForRuntime: ILayerCompatDetails = {\n\t...dataStoreCoreCompatDetails,\n\t/**\n\t * The features supported by the DataStore layer across the DataStore / Runtime boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\n};\n\n/**\n * The requirements that the Runtime layer must meet to be compatible with this DataStore.\n * @internal\n */\nexport const runtimeSupportRequirementsForDataStore: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Runtime must be at to be compatible with DataStore. Note that 0 is used here so\n\t * that Runtime layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Runtime must support to be compatible with DataStore.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Validates that the Runtime layer is compatible with this DataStore.\n * @internal\n */\nexport function validateRuntimeCompatibility(\n\tmaybeRuntimeCompatDetails: ILayerCompatDetails | undefined,\n\tdisposeFn: () => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"dataStore\",\n\t\t\"runtime\",\n\t\tdataStoreCompatDetailsForRuntime,\n\t\truntimeSupportRequirementsForDataStore,\n\t\tmaybeRuntimeCompatDetails,\n\t\tdisposeFn,\n\t\tlogger,\n\t);\n}\n"]}
1
+ {"version":3,"file":"dataStoreLayerCompatState.js","sourceRoot":"","sources":["../src/dataStoreLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,GAGV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,0BAA0B,GAE1B,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACzC;;OAEG;IACH,UAAU;IACV;;OAEG;IACH,UAAU;CACV,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAwB;IACpE,GAAG,0BAA0B;IAC7B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAoC;IACtF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC3C,yBAA0D,EAC1D,SAAqB,EACrB,EAAqB;IAErB,0BAA0B,CACzB,WAAW,EACX,SAAS,EACT,gCAAgC,EAChC,sCAAsC,EACtC,yBAAyB,EACzB,SAAS,EACT,EAAE,CACF,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tgeneration,\n\ttype ILayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport {\n\tvalidateLayerCompatibility,\n\ttype MonitoringContext,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The core compatibility details of the DataStore layer that is the same across all layer boundaries.\n * @internal\n */\nexport const dataStoreCoreCompatDetails = {\n\t/**\n\t * The package version of the DataStore layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the DataStore layer.\n\t */\n\tgeneration,\n};\n\n/**\n * DataStore's compatibility details that is exposed to the Runtime layer.\n * @internal\n */\nexport const dataStoreCompatDetailsForRuntime: ILayerCompatDetails = {\n\t...dataStoreCoreCompatDetails,\n\t/**\n\t * The features supported by the DataStore layer across the DataStore / Runtime boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\n};\n\n/**\n * The requirements that the Runtime layer must meet to be compatible with this DataStore.\n * @internal\n */\nexport const runtimeSupportRequirementsForDataStore: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Runtime must be at to be compatible with DataStore. Note that 0 is used here so\n\t * that Runtime layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Runtime must support to be compatible with DataStore.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Validates that the Runtime layer is compatible with this DataStore.\n * @internal\n */\nexport function validateRuntimeCompatibility(\n\tmaybeRuntimeCompatDetails: ILayerCompatDetails | undefined,\n\tdisposeFn: () => void,\n\tmc: MonitoringContext,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"dataStore\",\n\t\t\"runtime\",\n\t\tdataStoreCompatDetailsForRuntime,\n\t\truntimeSupportRequirementsForDataStore,\n\t\tmaybeRuntimeCompatDetails,\n\t\tdisposeFn,\n\t\tmc,\n\t);\n}\n"]}
@@ -300,7 +300,7 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
300
300
  * See {@link @fluidframework/runtime-definitions#FluidDataStoreMessage} comment
301
301
  * for opportunity to resolve this.
302
302
  */
303
- reSubmit(type: DataStoreMessageType, content: any, localOpMetadata: unknown, squash?: boolean): void;
303
+ reSubmit(type: DataStoreMessageType, content: any, localOpMetadata: unknown, squash: boolean): void;
304
304
  /**
305
305
  * Revert a local op.
306
306
  * @param content - The content of the original message.
@@ -349,7 +349,7 @@ export declare const mixinRequestHandler: (requestHandler: (request: IRequest, r
349
349
  * @param Base - base class, inherits from FluidDataStoreRuntime
350
350
  * @legacy @beta
351
351
  */
352
- export declare const mixinSummaryHandler: (handler: (runtime: FluidDataStoreRuntime) => Promise<{
352
+ export declare const mixinSummaryHandler: (handler: (runtime: FluidDataStoreRuntime, setCurrentSummarizeStep: (currentStep: string) => void) => Promise<{
353
353
  path: string[];
354
354
  content: string;
355
355
  } | undefined>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime;
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAA4B,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EACX,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,0CAA0C,CAAC;AAQlD,OAAO,KAAK,EACX,QAAQ,EACR,e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MAAM,KAAK,IAAI,KAClD,QAAQ;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,SACvD,4BAA4B,KAChC,4BAkD+B,CAAC"}
@@ -7,7 +7,7 @@ import { AttachState } from "@fluidframework/container-definitions";
7
7
  import { assert, debugAssert, Deferred, LazyPromise, unreachableCase, } from "@fluidframework/core-utils/internal";
8
8
  import { SummaryType, } from "@fluidframework/driver-definitions";
9
9
  import { buildSnapshotTree } from "@fluidframework/driver-utils/internal";
10
- import { CreateSummarizerNodeSource, VisibilityState, gcDataBlobKey, notifiesReadOnlyState, encodeHandlesInContainerRuntime, asLegacyAlpha, } from "@fluidframework/runtime-definitions/internal";
10
+ import { CreateSummarizerNodeSource, VisibilityState, gcDataBlobKey, notifiesReadOnlyState, encodeHandlesInContainerRuntime, asLegacyAlpha, currentSummarizeStepPrefix, currentSummarizeStepPropertyName, } from "@fluidframework/runtime-definitions/internal";
11
11
  import { GCDataBuilder, RequestParser, SummaryTreeBuilder, addBlobToSummary, convertSnapshotTreeToSummaryTree, convertSummaryTreeToITree, create404Response, createResponseError, exceptionToResponse, generateHandleContextPath, processAttachMessageGCData, toFluidHandleInternal, unpackChildNodesUsedRoutes, toDeltaManagerErased, encodeCompactIdToString, } from "@fluidframework/runtime-utils/internal";
12
12
  import { DataProcessingError, LoggingError, UsageError, createChildMonitoringContext, generateStack, raiseConnectedEvent, tagCodeArtifacts, } from "@fluidframework/telemetry-utils/internal";
13
13
  import { v4 as uuid } from "uuid";
@@ -153,7 +153,7 @@ export class FluidDataStoreRuntime extends TypedEventEmitter {
153
153
  });
154
154
  // Validate that the Runtime is compatible with this DataStore.
155
155
  const { ILayerCompatDetails: runtimeCompatDetails } = dataStoreContext;
156
- validateRuntimeCompatibility(runtimeCompatDetails, this.dispose.bind(this), this.mc.logger);
156
+ validateRuntimeCompatibility(runtimeCompatDetails, this.dispose.bind(this), this.mc);
157
157
  if (contextSupportsFeature(dataStoreContext, notifiesReadOnlyState)) {
158
158
  this._readonly = dataStoreContext.isReadOnly();
159
159
  }
@@ -1091,11 +1091,10 @@ export const mixinSummaryHandler = (handler, Base = FluidDataStoreRuntime) => cl
1091
1091
  }
1092
1092
  summary.summary.tree[firstName] = blob;
1093
1093
  }
1094
- async summarize(...args) {
1095
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
1096
- const summary = await super.summarize(...args);
1094
+ async summarize(fullTree = false, trackState = true, telemetryContext) {
1095
+ const summary = await super.summarize(fullTree, trackState, telemetryContext);
1097
1096
  try {
1098
- const content = await handler(this);
1097
+ const content = await handler(this, (currentStep) => telemetryContext?.set(currentSummarizeStepPrefix, currentSummarizeStepPropertyName, `mixinSummaryHandler:${currentStep}`));
1099
1098
  if (content !== undefined) {
1100
1099
  this.addBlob(summary, content.path, content.content);
1101
1100
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRuntime.js","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAA4B,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAkB,MAAM,uCAAuC,CAAC;AAYpF,OAAO,EACN,MAAM,EACN,WAAW,EACX,QAAQ,EACR,WAAW,EACX,eAAe,GACf,MAAM,qCAAqC,CAAC;AAS7C,OAAO,EAKN,WAAW,GACX,MAAM,oCAAoC,CAAC;AAM5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,EAKN,0BAA0B,EAK1B,eAAe,EACf,aAAa,EAIb,qBAAqB,EACrB,+BAA+B,EAG/B,aAAa,GACb,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB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CAAC;QAED,IAAI,IAAI,GAAgC;YACvC,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,OAAO;SACP,CAAC;QACF,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;QAE9C,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;YACnC,IAAI,GAAG;gBACN,IAAI,EAAE,WAAW,CAAC,IAAI;gBACtB,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE;aACtB,CAAC;YACF,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC/B,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,GAAG,IAAW;QAC7B,iEAAiE;QACjE,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC;QAE/C,IAAI,CAAC;YACJ,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;YACpC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC3B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACtD,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,qFAAqF;YACrF,MAAM,mBAAmB,CAAC,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC;QAC5E,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;CAC+B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter, type ILayerCompatDetails } from \"@fluid-internal/client-utils\";\nimport { AttachState, type IAudience } from \"@fluidframework/container-definitions\";\nimport type { IDeltaManager } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIFluidHandle,\n\tIRequest,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleContext,\n\tIFluidHandleInternal,\n} from \"@fluidframework/core-interfaces/internal\";\nimport {\n\tassert,\n\tdebugAssert,\n\tDeferred,\n\tLazyPromise,\n\tunreachableCase,\n} from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIChannel,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIFluidDataStoreRuntimeEvents,\n\tIDeltaManagerErased,\n\tIFluidDataStoreRuntimeAlpha,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\ttype IClientDetails,\n\ttype IQuorumClients,\n\ttype ISummaryBlob,\n\ttype ISummaryTree,\n\tSummaryType,\n} from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { buildSnapshotTree } from \"@fluidframework/driver-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport {\n\ttype ISummaryTreeWithStats,\n\ttype ITelemetryContext,\n\ttype IGarbageCollectionData,\n\ttype CreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\ttype IAttachMessage,\n\ttype IEnvelope,\n\ttype IFluidDataStoreChannel,\n\ttype IFluidDataStoreContext,\n\tVisibilityState,\n\tgcDataBlobKey,\n\ttype IInboundSignalMessage,\n\ttype IRuntimeMessageCollection,\n\ttype IRuntimeMessagesContent,\n\tnotifiesReadOnlyState,\n\tencodeHandlesInContainerRuntime,\n\ttype IFluidDataStorePolicies,\n\ttype MinimumVersionForCollab,\n\tasLegacyAlpha,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tGCDataBuilder,\n\tRequestParser,\n\tSummaryTreeBuilder,\n\taddBlobToSummary,\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tcreate404Response,\n\tcreateResponseError,\n\texceptionToResponse,\n\tgenerateHandleContextPath,\n\tprocessAttachMessageGCData,\n\ttoFluidHandleInternal,\n\tunpackChildNodesUsedRoutes,\n\ttoDeltaManagerErased,\n\tencodeCompactIdToString,\n} from \"@fluidframework/runtime-utils/internal\";\nimport {\n\ttype ITelemetryLoggerExt,\n\tDataProcessingError,\n\tLoggingError,\n\ttype MonitoringContext,\n\tUsageError,\n\tcreateChildMonitoringContext,\n\tgenerateStack,\n\traiseConnectedEvent,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { type IChannelContext, summarizeChannel } from \"./channelContext.js\";\nimport {\n\tdataStoreCompatDetailsForRuntime,\n\tvalidateRuntimeCompatibility,\n} from \"./dataStoreLayerCompatState.js\";\nimport { FluidObjectHandle } from \"./fluidHandle.js\";\nimport {\n\tLocalChannelContext,\n\tLocalChannelContextBase,\n\tRehydratedLocalChannelContext,\n} from \"./localChannelContext.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { RemoteChannelContext } from \"./remoteChannelContext.js\";\n\ntype PickRequired<T extends Record<never, unknown>, K extends keyof T> = Omit<T, K> &\n\tRequired<Pick<T, K>>;\n\ninterface IFluidDataStoreContextFeaturesToTypes {\n\t[encodeHandlesInContainerRuntime]: IFluidDataStoreContext; // No difference in typing with this feature\n\t[notifiesReadOnlyState]: PickRequired<IFluidDataStoreContext, \"isReadOnly\">;\n}\n\nfunction contextSupportsFeature<K extends keyof IFluidDataStoreContextFeaturesToTypes>(\n\tobj: IFluidDataStoreContext,\n\tfeature: K,\n): obj is IFluidDataStoreContextFeaturesToTypes[K] {\n\tconst { ILayerCompatDetails } = obj as FluidObject<ILayerCompatDetails>;\n\treturn ILayerCompatDetails?.supportedFeatures.has(feature) ?? false;\n}\n\n/**\n * @legacy @beta\n */\nexport enum DataStoreMessageType {\n\t// Creates a new channel\n\tAttach = \"attach\",\n\tChannelOp = \"op\",\n}\n\n/**\n * Outgoing {@link FluidDataStoreRuntime} message structures.\n * @internal\n *\n * @privateRemarks\n * The types here are required to satisfy {@link @fluidframework/runtime-definitions#FluidDataStoreMessage} interface.\n */\nexport type LocalFluidDataStoreRuntimeMessage =\n\t| { type: DataStoreMessageType.ChannelOp; content: IEnvelope }\n\t| { type: DataStoreMessageType.Attach; content: IAttachMessage };\n\n/**\n * @legacy @beta\n */\nexport interface ISharedObjectRegistry {\n\t// TODO consider making this async. A consequence is that either the creation of a distributed data type\n\t// is async or we need a new API to split the synchronous vs. asynchronous creation.\n\tget(name: string): IChannelFactory | undefined;\n}\n\nconst defaultPolicies: IFluidDataStorePolicies = {\n\treadonlyInStagingMode: false,\n};\n\n/**\n * Set up the boxed pendingOpCount value.\n */\nfunction initializePendingOpCount(): { value: number } {\n\tlet value = 0;\n\treturn {\n\t\tget value() {\n\t\t\treturn value;\n\t\t},\n\t\tset value(newValue: number) {\n\t\t\tassert(newValue >= 0, 0xbbd /* pendingOpCount must be non-negative */);\n\t\t\tvalue = newValue;\n\t\t},\n\t};\n}\n\n/**\n * Base data store class\n * @legacy @beta\n */\nexport class FluidDataStoreRuntime\n\textends TypedEventEmitter<IFluidDataStoreRuntimeEvents>\n\timplements IFluidDataStoreChannel, IFluidDataStoreRuntime, IFluidHandleContext\n{\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.entryPoint}\n\t */\n\tpublic readonly entryPoint: IFluidHandleInternal<FluidObject>;\n\n\tpublic get connected(): boolean {\n\t\treturn this.dataStoreContext.connected;\n\t}\n\n\tpublic readonly policies: IFluidDataStorePolicies;\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.isReadOnly}\n\t */\n\tpublic readonly isReadOnly = (): boolean => this._readonly;\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this.dataStoreContext.clientId;\n\t}\n\n\tpublic get clientDetails(): IClientDetails {\n\t\treturn this.dataStoreContext.clientDetails;\n\t}\n\n\tpublic get isAttached(): boolean {\n\t\treturn this.attachState !== AttachState.Detached;\n\t}\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._attachState;\n\t}\n\n\tpublic get absolutePath(): string {\n\t\treturn generateHandleContextPath(this.id, this.routeContext);\n\t}\n\n\tpublic get routeContext(): IFluidHandleContext {\n\t\treturn this.dataStoreContext.IFluidHandleContext;\n\t}\n\n\tpublic get idCompressor(): IIdCompressor | undefined {\n\t\treturn this.dataStoreContext.idCompressor;\n\t}\n\n\t// TODO: the methods below should have more specific return typing, per the interfaces they are implementing.\n\t// Doing so would be a breaking change.\n\n\tpublic get IFluidHandleContext(): this {\n\t\treturn this;\n\t}\n\n\tpublic get rootRoutingContext(): this {\n\t\treturn this;\n\t}\n\tpublic get channelsRoutingContext(): this {\n\t\treturn this;\n\t}\n\tpublic get objectsRoutingContext(): this {\n\t\treturn this;\n\t}\n\n\tprivate localOpActivity: \"applyStashed\" | \"rollback\" | undefined = undefined;\n\tpublic get activeLocalOperationActivity(): \"applyStashed\" | \"rollback\" | undefined {\n\t\treturn this.localOpActivity;\n\t}\n\n\tprivate _disposed = false;\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\tprivate readonly contexts = new Map<string, IChannelContext>();\n\tprivate readonly pendingAttach = new Set<string>();\n\n\tprivate readonly deferredAttached = new Deferred<void>();\n\tprivate readonly localChannelContextQueue = new Map<string, LocalChannelContextBase>();\n\tprivate readonly notBoundedChannelContextSet = new Set<string>();\n\tprivate _attachState: AttachState;\n\tpublic visibilityState: VisibilityState;\n\t// A list of handles that are bound when the data store is not visible. We have to make them visible when the data\n\t// store becomes visible.\n\tprivate readonly pendingHandlesToMakeVisible: Set<IFluidHandleInternal> = new Set();\n\n\tpublic readonly id: string;\n\n\t// TODO: use something other than `any` here (breaking change)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic readonly options: Record<string | number, any>;\n\tpublic readonly deltaManagerInternal: IDeltaManager<\n\t\tISequencedDocumentMessage,\n\t\tIDocumentMessage\n\t>;\n\tprivate readonly quorum: IQuorumClients;\n\tprivate readonly audience: IAudience;\n\tprivate readonly mc: MonitoringContext;\n\tpublic get logger(): ITelemetryLoggerExt {\n\t\treturn this.mc.logger;\n\t}\n\n\t/**\n\t * If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.\n\t * So, adding a count of how many telemetry events are logged per data store context. This can be\n\t * controlled via feature flags.\n\t */\n\tprivate localChangesTelemetryCount: number;\n\n\t/**\n\t * The compatibility details of the DataStore layer that is exposed to the Runtime layer\n\t * for validating Runtime-DataStore compatibility.\n\t * @remarks This is for internal use only.\n\t * The type of this should be ILayerCompatDetails. However, ILayerCompatDetails is internal and this class\n\t * is currently marked as legacy alpha. So, using unknown here.\n\t */\n\tpublic readonly ILayerCompatDetails?: unknown = dataStoreCompatDetailsForRuntime;\n\n\t/**\n\t * See IFluidDataStoreRuntimeInternalConfig.submitMessagesWithoutEncodingHandles\n\t *\n\t * Note: this class doesn't declare that it implements IFluidDataStoreRuntimeInternalConfig,\n\t * and we keep this property as private, but consumers may optimistically cast\n\t * to the internal interface to access this property.\n\t */\n\tprivate readonly submitMessagesWithoutEncodingHandles: boolean;\n\n\t/**\n\t * See `IFluidDataStoreRuntimeInternalConfig.minVersionForCollab`.\n\t */\n\tpublic readonly minVersionForCollab?: MinimumVersionForCollab | undefined;\n\n\t/**\n\t * Create an instance of a DataStore runtime.\n\t *\n\t * @param dataStoreContext - Context object for the runtime.\n\t * @param sharedObjectRegistry - The registry of shared objects that this data store will be able to instantiate.\n\t * @param existing - Pass 'true' if loading this datastore from an existing file; pass 'false' otherwise.\n\t * @param provideEntryPoint - Function to initialize the entryPoint object for the data store runtime. The\n\t * handle to this data store runtime will point to the object returned by this function. If this function is not\n\t * provided, the handle will be left undefined. This is here so we can start making handles a first-class citizen\n\t * and the primary way of interacting with some Fluid objects, and should be used if possible.\n\t */\n\tpublic constructor(\n\t\tprivate readonly dataStoreContext: IFluidDataStoreContext,\n\t\tprivate readonly sharedObjectRegistry: ISharedObjectRegistry,\n\t\texisting: boolean,\n\t\tprovideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>,\n\t\tpolicies?: Partial<IFluidDataStorePolicies>,\n\t) {\n\t\tsuper();\n\n\t\tassert(\n\t\t\t!dataStoreContext.id.includes(\"/\"),\n\t\t\t0x30e /* Id cannot contain slashes. DataStoreContext should have validated this. */,\n\t\t);\n\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger: dataStoreContext.baseLogger,\n\t\t\tnamespace: \"FluidDataStoreRuntime\",\n\t\t\tproperties: {\n\t\t\t\tall: { dataStoreId: uuid(), dataStoreVersion: pkgVersion },\n\t\t\t\terror: { inStagingMode: () => this.inStagingMode, isDirty: () => this.isDirty },\n\t\t\t},\n\t\t});\n\n\t\t// Validate that the Runtime is compatible with this DataStore.\n\t\tconst { ILayerCompatDetails: runtimeCompatDetails } =\n\t\t\tdataStoreContext as FluidObject<ILayerCompatDetails>;\n\t\tvalidateRuntimeCompatibility(\n\t\t\truntimeCompatDetails,\n\t\t\tthis.dispose.bind(this),\n\t\t\tthis.mc.logger,\n\t\t);\n\n\t\tif (contextSupportsFeature(dataStoreContext, notifiesReadOnlyState)) {\n\t\t\tthis._readonly = dataStoreContext.isReadOnly();\n\t\t} else {\n\t\t\tthis._readonly = this.dataStoreContext.deltaManager.readOnlyInfo.readonly === true;\n\t\t\tthis.dataStoreContext.deltaManager.on(\"readonly\", (readonly) =>\n\t\t\t\tthis.notifyReadOnlyState(readonly),\n\t\t\t);\n\t\t}\n\n\t\tthis.policies = { ...defaultPolicies, ...policies };\n\n\t\tthis.submitMessagesWithoutEncodingHandles = contextSupportsFeature(\n\t\t\tdataStoreContext,\n\t\t\tencodeHandlesInContainerRuntime,\n\t\t);\n\t\t// We read this property here to avoid a compiler error (unused private member)\n\t\tdebugAssert(() => this.submitMessagesWithoutEncodingHandles !== undefined);\n\n\t\tthis.id = dataStoreContext.id;\n\t\tthis.options = dataStoreContext.options;\n\t\tthis.deltaManagerInternal = dataStoreContext.deltaManager;\n\t\tthis.quorum = dataStoreContext.getQuorum();\n\t\tthis.audience = dataStoreContext.getAudience();\n\n\t\tconst tree = dataStoreContext.baseSnapshot;\n\n\t\t// Must always receive the data store type inside of the attributes\n\t\tif (tree?.trees !== undefined) {\n\t\t\tfor (const [path, subtree] of Object.entries(tree.trees)) {\n\t\t\t\t// Issue #4414\n\t\t\t\tif (path === \"_search\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlet channelContext: RemoteChannelContext | RehydratedLocalChannelContext;\n\t\t\t\t// If already exists on storage, then create a remote channel. However, if it is case of rehydrating a\n\t\t\t\t// container from snapshot where we load detached container from a snapshot, isLocalDataStore would be\n\t\t\t\t// true. In this case create a RehydratedLocalChannelContext.\n\t\t\t\tif (dataStoreContext.isLocalDataStore) {\n\t\t\t\t\tchannelContext = this.createRehydratedLocalChannelContext(path, subtree);\n\t\t\t\t\t// This is the case of rehydrating a detached container from snapshot. Now due to delay loading of\n\t\t\t\t\t// data store, if the data store is loaded after the container is attached, then we missed making\n\t\t\t\t\t// the channel visible. So do it now. Otherwise, add it to local channel context queue, so\n\t\t\t\t\t// that it can be make it visible later with the data store.\n\t\t\t\t\tif (dataStoreContext.attachState === AttachState.Detached) {\n\t\t\t\t\t\tthis.localChannelContextQueue.set(path, channelContext);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchannelContext.makeVisible();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tchannelContext = new RemoteChannelContext(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tdataStoreContext,\n\t\t\t\t\t\tdataStoreContext.storage,\n\t\t\t\t\t\t(content, localOpMetadata) => this.submitChannelOp(path, content, localOpMetadata),\n\t\t\t\t\t\t(address: string) => this.setChannelDirty(address),\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tsubtree,\n\t\t\t\t\t\tthis.sharedObjectRegistry,\n\t\t\t\t\t\tundefined /* extraBlobs */,\n\t\t\t\t\t\tthis.dataStoreContext.getCreateChildSummarizerNodeFn(path, {\n\t\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.contexts.set(path, channelContext);\n\t\t\t}\n\t\t}\n\n\t\tthis.entryPoint = new FluidObjectHandle<FluidObject>(\n\t\t\tnew LazyPromise(async () => provideEntryPoint(this)),\n\t\t\t\"\",\n\t\t\tthis.objectsRoutingContext,\n\t\t);\n\n\t\tthis.attachListener();\n\t\tthis._attachState = dataStoreContext.attachState;\n\n\t\t/**\n\t\t * If existing flag is false, this is a new data store and is not visible. The existing flag can be true in two\n\t\t * conditions:\n\t\t *\n\t\t * 1. It's a local data store that is created when a detached container is rehydrated. In this case, the data\n\t\t * store is locally visible because the snapshot it is loaded from contains locally visible data stores only.\n\t\t *\n\t\t * 2. It's a remote data store that is created when an attached container is loaded is loaded from snapshot or\n\t\t * when an attach op comes in. In both these cases, the data store is already globally visible.\n\t\t */\n\t\tif (existing) {\n\t\t\tthis.visibilityState =\n\t\t\t\tdataStoreContext.attachState === AttachState.Detached\n\t\t\t\t\t? VisibilityState.LocallyVisible\n\t\t\t\t\t: VisibilityState.GloballyVisible;\n\t\t} else {\n\t\t\tthis.visibilityState = VisibilityState.NotVisible;\n\t\t}\n\n\t\t// If it's existing we know it has been attached.\n\t\tif (existing) {\n\t\t\tthis.deferredAttached.resolve();\n\t\t}\n\n\t\t// By default, a data store can log maximum 10 local changes telemetry in summarizer.\n\t\tthis.localChangesTelemetryCount =\n\t\t\tthis.mc.config.getNumber(\"Fluid.Telemetry.LocalChangesTelemetryCount\") ?? 10;\n\n\t\tthis.minVersionForCollab = this.dataStoreContext.minVersionForCollab;\n\t}\n\n\t/**\n\t * Implementation of IFluidDataStoreRuntimeAlpha.inStagingMode\n\t */\n\tprivate get inStagingMode(): IFluidDataStoreRuntimeAlpha[\"inStagingMode\"] {\n\t\treturn asLegacyAlpha(this.dataStoreContext.containerRuntime)?.inStagingMode;\n\t}\n\n\t/**\n\t * Implementation of IFluidDataStoreRuntimeAlpha.isDirty\n\t */\n\tprivate get isDirty(): IFluidDataStoreRuntimeAlpha[\"isDirty\"] {\n\t\treturn this.pendingOpCount.value > 0;\n\t}\n\n\tget deltaManager(): IDeltaManagerErased {\n\t\treturn toDeltaManagerErased(this.deltaManagerInternal);\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis._disposed = true;\n\n\t\tthis.emit(\"dispose\");\n\t\tthis.removeAllListeners();\n\t}\n\n\tpublic async resolveHandle(request: IRequest): Promise<IResponse> {\n\t\treturn this.request(request);\n\t}\n\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\ttry {\n\t\t\tconst parser = RequestParser.create(request);\n\t\t\t// If there are not path parts, and the request is via a handle\n\t\t\t// then we should return the entrypoint object for this runtime.\n\t\t\t// This allows the entrypoint handle to be resolved without the need\n\t\t\t// for the entrypoint object to know anything about requests or handles.\n\t\t\t//\n\t\t\t// This works because the entrypoint handle is an object handle,\n\t\t\t// which always has a real reference to the object itself.\n\t\t\t// Those get serialized and then deserialized into a plain handle, which really just has a path,\n\t\t\t// resolution walks to the runtime, which calls this, and get the true object off the internal object handle\n\t\t\tif (parser.pathParts.length === 0 && request.headers?.viaHandle === true) {\n\t\t\t\treturn { mimeType: \"fluid/object\", status: 200, value: await this.entryPoint.get() };\n\t\t\t}\n\t\t\tconst id = parser.pathParts[0];\n\n\t\t\tif (id === \"_channels\" || id === \"_custom\") {\n\t\t\t\treturn await this.request(parser.createSubRequest(1));\n\t\t\t}\n\n\t\t\tif (id !== undefined) {\n\t\t\t\t// Check for a data type reference first\n\t\t\t\tconst context = this.contexts.get(id);\n\t\t\t\tif (context !== undefined && parser.isLeaf(1)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst channel = await context.getChannel();\n\n\t\t\t\t\t\treturn { mimeType: \"fluid/object\", status: 200, value: channel };\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthis.mc.logger.sendErrorEvent({ eventName: \"GetChannelFailedInRequest\" }, error);\n\n\t\t\t\t\t\treturn createResponseError(500, `Failed to get Channel: ${error}`, request);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise defer to an attached request handler\n\t\t\treturn create404Response(request);\n\t\t} catch (error) {\n\t\t\treturn exceptionToResponse(error);\n\t\t}\n\t}\n\n\tpublic async getChannel(id: string): Promise<IChannel> {\n\t\tthis.verifyNotClosed();\n\n\t\tconst context = this.contexts.get(id);\n\t\tif (context === undefined) {\n\t\t\tthrow new LoggingError(\"Channel does not exist\");\n\t\t}\n\n\t\treturn context.getChannel();\n\t}\n\n\t/**\n\t * Validate user provided channel ID\n\t * Channel ID has limitations. \"/\" is not allowed as IDs in storage can not have slashes - we parse tree paths and use \"/\" as separator.\n\t * IDs cannot start with \"_\" as it could result in collision of IDs with auto-assigned (by FF) short IDs.\n\t * @param id - channel ID.\n\t */\n\tprotected validateChannelId(id: string): void {\n\t\tif (id.includes(\"/\")) {\n\t\t\tthrow new UsageError(`Id cannot contain slashes: ${id}`);\n\t\t}\n\t\tif (id.startsWith(\"_\")) {\n\t\t\tthrow new UsageError(`Id cannot start with underscore: ${id}`);\n\t\t}\n\t}\n\n\t/**\n\t * Api which allows caller to create the channel first and then add it to the runtime.\n\t * The channel type should be present in the registry, otherwise the runtime would reject\n\t * the channel. Also the runtime used to create the channel object should be same to which\n\t * it is added.\n\t * @param channel - channel which needs to be added to the runtime.\n\t */\n\tpublic addChannel(channel: IChannel): void {\n\t\tconst id = channel.id;\n\t\tthis.validateChannelId(id);\n\n\t\tthis.verifyNotClosed();\n\n\t\tassert(!this.contexts.has(id), 0x865 /* addChannel() with existing ID */);\n\n\t\tconst type = channel.attributes.type;\n\t\tconst factory = this.sharedObjectRegistry.get(channel.attributes.type);\n\t\tif (factory === undefined) {\n\t\t\tthrow new Error(`Channel Factory ${type} not registered`);\n\t\t}\n\n\t\tthis.createChannelContext(channel);\n\t\t// Channels (DDS) should not be created in summarizer client.\n\t\tthis.identifyLocalChangeInSummarizer(\"DDSCreatedInSummarizer\", id, type);\n\t}\n\n\tpublic createChannel(idArg: string | undefined, type: string): IChannel {\n\t\tlet id: string;\n\n\t\tif (idArg === undefined) {\n\t\t\t/**\n\t\t\t * Return uuid if short-ids are explicitly disabled via feature flags.\n\t\t\t */\n\t\t\tif (this.mc.config.getBoolean(\"Fluid.Runtime.DisableShortIds\") === true) {\n\t\t\t\tid = uuid();\n\t\t\t} else {\n\t\t\t\t// We use three non-overlapping namespaces:\n\t\t\t\t// - detached state: even numbers\n\t\t\t\t// - attached state: odd numbers\n\t\t\t\t// - uuids\n\t\t\t\t// In first two cases we will encode result as strings in more compact form, with leading underscore,\n\t\t\t\t// to ensure no overlap with user-provided DDS names (see validateChannelId())\n\t\t\t\tif (this.visibilityState === VisibilityState.GloballyVisible) {\n\t\t\t\t\t// Due to back-compat, we could not depend yet on generateDocumentUniqueId() being there.\n\t\t\t\t\t// We can remove the need to leverage uuid() as fall-back in couple releases.\n\t\t\t\t\tconst res =\n\t\t\t\t\t\tthis.dataStoreContext.containerRuntime.generateDocumentUniqueId?.() ?? uuid();\n\t\t\t\t\tid = typeof res === \"number\" ? encodeCompactIdToString(2 * res + 1, \"_\") : res;\n\t\t\t\t} else {\n\t\t\t\t\t// container is detached, only one client observes content, no way to hit collisions with other clients.\n\t\t\t\t\tid = encodeCompactIdToString(2 * this.contexts.size, \"_\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tassert(!id.includes(\"/\"), 0x8fc /* slash */);\n\t\t} else {\n\t\t\tid = idArg;\n\t\t\tthis.validateChannelId(id);\n\t\t}\n\n\t\tthis.verifyNotClosed();\n\t\tassert(!this.contexts.has(id), 0x179 /* \"createChannel() with existing ID\" */);\n\n\t\tassert(type !== undefined, 0x209 /* \"Factory Type should be defined\" */);\n\t\tconst factory = this.sharedObjectRegistry.get(type);\n\t\tif (factory === undefined) {\n\t\t\tthrow new Error(`Channel Factory ${type} not registered`);\n\t\t}\n\n\t\tconst channel = factory.create(this, id);\n\t\tthis.createChannelContext(channel);\n\t\t// Channels (DDS) should not be created in summarizer client.\n\t\tthis.identifyLocalChangeInSummarizer(\"DDSCreatedInSummarizer\", id, type);\n\t\treturn channel;\n\t}\n\n\tprivate createChannelContext(channel: IChannel): void {\n\t\tthis.notBoundedChannelContextSet.add(channel.id);\n\t\tconst context = new LocalChannelContext(\n\t\t\tchannel,\n\t\t\tthis,\n\t\t\tthis.dataStoreContext,\n\t\t\tthis.dataStoreContext.storage,\n\t\t\tthis.logger,\n\t\t\t(content, localOpMetadata) => this.submitChannelOp(channel.id, content, localOpMetadata),\n\t\t\t(address: string) => this.setChannelDirty(address),\n\t\t);\n\t\tthis.contexts.set(channel.id, context);\n\t}\n\n\tprivate createRehydratedLocalChannelContext(\n\t\tid: string,\n\t\ttree: ISnapshotTree,\n\t\tflatBlobs?: Map<string, ArrayBufferLike>,\n\t): RehydratedLocalChannelContext {\n\t\treturn new RehydratedLocalChannelContext(\n\t\t\tid,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis,\n\t\t\tthis.dataStoreContext,\n\t\t\tthis.dataStoreContext.storage,\n\t\t\tthis.logger,\n\t\t\t(content, localOpMetadata) => this.submitChannelOp(id, content, localOpMetadata),\n\t\t\t(address: string) => this.setChannelDirty(address),\n\t\t\ttree,\n\t\t\tflatBlobs,\n\t\t);\n\t}\n\n\t/**\n\t * Binds a channel with the runtime. If the runtime is attached we will attach the channel right away.\n\t * If the runtime is not attached we will defer the attach until the runtime attaches.\n\t * @param channel - channel to be registered.\n\t */\n\tpublic bindChannel(channel: IChannel): void {\n\t\tassert(\n\t\t\tthis.notBoundedChannelContextSet.has(channel.id),\n\t\t\t0x17b /* \"Channel to be bound should be in not bounded set\" */,\n\t\t);\n\t\tthis.notBoundedChannelContextSet.delete(channel.id);\n\t\t// If our data store is attached, then attach the channel.\n\t\tif (this.isAttached) {\n\t\t\tthis.makeChannelLocallyVisible(channel);\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * If this channel is already waiting to be made visible, do nothing. This can happen during attachGraph() when\n\t\t * a channel's graph is attached. It calls bindToContext on the shared object which will end up back here.\n\t\t */\n\t\tif (this.pendingHandlesToMakeVisible.has(toFluidHandleInternal(channel.handle))) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.bind(channel.handle);\n\n\t\t// If our data store is local then add the channel to the queue\n\t\tif (!this.localChannelContextQueue.has(channel.id)) {\n\t\t\tthis.localChannelContextQueue.set(\n\t\t\t\tchannel.id,\n\t\t\t\tthis.contexts.get(channel.id) as LocalChannelContextBase,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * This function is called when a data store becomes root. It does the following:\n\t *\n\t * 1. Marks the data store locally visible in the container.\n\t *\n\t * 2. Attaches the graph of all the handles bound to it.\n\t *\n\t * 3. Calls into the data store context to mark it visible in the container too. If the container is globally\n\t * visible, it will mark us globally visible. Otherwise, it will mark us globally visible when it becomes\n\t * globally visible.\n\t */\n\tpublic makeVisibleAndAttachGraph(): void {\n\t\tif (this.visibilityState !== VisibilityState.NotVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis.visibilityState = VisibilityState.LocallyVisible;\n\n\t\tfor (const handle of this.pendingHandlesToMakeVisible) {\n\t\t\thandle.attachGraph();\n\t\t}\n\t\tthis.pendingHandlesToMakeVisible.clear();\n\t\tthis.dataStoreContext.makeLocallyVisible();\n\t}\n\n\t/**\n\t * This function is called when a handle to this data store is added to a visible DDS.\n\t */\n\tpublic attachGraph(): void {\n\t\tthis.makeVisibleAndAttachGraph();\n\t}\n\n\tpublic bind(handle: IFluidHandle): void {\n\t\t// If visible, attach the incoming handle's graph. Else, this will be done when we become visible.\n\t\tif (this.visibilityState !== VisibilityState.NotVisible) {\n\t\t\ttoFluidHandleInternal(handle).attachGraph();\n\t\t\treturn;\n\t\t}\n\t\tthis.pendingHandlesToMakeVisible.add(toFluidHandleInternal(handle));\n\t}\n\n\tpublic setConnectionState(connected: boolean, clientId?: string): void {\n\t\tthis.verifyNotClosed();\n\n\t\tfor (const [, object] of this.contexts) {\n\t\t\tobject.setConnectionState(connected, clientId);\n\t\t}\n\n\t\traiseConnectedEvent(this.logger, this, connected, clientId);\n\t}\n\n\tprivate _readonly: boolean;\n\t/**\n\t * This function is used by the datastore context to configure the\n\t * readonly state of this object. It should not be invoked by\n\t * any other callers.\n\t */\n\tpublic notifyReadOnlyState(readonly: boolean): void {\n\t\tthis.verifyNotClosed();\n\t\tif (readonly !== this._readonly) {\n\t\t\tthis._readonly = readonly;\n\t\t\tthis.emit(\"readonly\", readonly);\n\t\t}\n\t}\n\n\tpublic getQuorum(): IQuorumClients {\n\t\treturn this.quorum;\n\t}\n\n\tpublic getAudience(): IAudience {\n\t\treturn this.audience;\n\t}\n\n\tpublic async uploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandle<ArrayBufferLike>> {\n\t\tthis.verifyNotClosed();\n\n\t\treturn this.dataStoreContext.uploadBlob(blob, signal);\n\t}\n\n\tprivate createRemoteChannelContext(\n\t\tattachMessage: IAttachMessage,\n\t\tsummarizerNodeParams: CreateChildSummarizerNodeParam,\n\t): RemoteChannelContext {\n\t\tconst flatBlobs = new Map<string, ArrayBufferLike>();\n\t\tconst snapshotTree = buildSnapshotTree(attachMessage.snapshot.entries, flatBlobs);\n\n\t\treturn new RemoteChannelContext(\n\t\t\tthis,\n\t\t\tthis.dataStoreContext,\n\t\t\tthis.dataStoreContext.storage,\n\t\t\t(content, localContentMetadata) =>\n\t\t\t\tthis.submitChannelOp(attachMessage.id, content, localContentMetadata),\n\t\t\t(address: string) => this.setChannelDirty(address),\n\t\t\tattachMessage.id,\n\t\t\tsnapshotTree,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tflatBlobs,\n\t\t\tthis.dataStoreContext.getCreateChildSummarizerNodeFn(\n\t\t\t\tattachMessage.id,\n\t\t\t\tsummarizerNodeParams,\n\t\t\t),\n\t\t\tattachMessage.type,\n\t\t);\n\t}\n\n\t/**\n\t * Process channel messages. The messages here are contiguous channel types messages in a batch for this data\n\t * store.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tprivate processChannelMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tthis.verifyNotClosed();\n\n\t\t/*\n\t\t * Bunch contiguous messages for the same channel and send them together.\n\t\t * This is an optimization where DDSes can process a bunch of ops together. DDSes\n\t\t * like merge tree or shared tree can process ops more efficiently when they are bunched together.\n\t\t */\n\t\tlet currentAddress: string | undefined;\n\t\tlet currentMessagesContent: IRuntimeMessagesContent[] = [];\n\t\tconst { messagesContent, local, envelope } = messageCollection;\n\n\t\tconst sendBunchedMessages = (): void => {\n\t\t\t// Current address will be undefined for the first message in the list.\n\t\t\tif (currentAddress === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// process the last set of channel ops\n\t\t\tconst channelContext = this.contexts.get(currentAddress);\n\t\t\tassert(!!channelContext, 0xa6b /* Channel context not found */);\n\n\t\t\tchannelContext.processMessages({\n\t\t\t\tenvelope,\n\t\t\t\tmessagesContent: currentMessagesContent,\n\t\t\t\tlocal,\n\t\t\t});\n\n\t\t\tcurrentMessagesContent = [];\n\t\t};\n\n\t\tfor (const { contents, ...restOfMessagesContent } of messagesContent) {\n\t\t\tconst contentsEnvelope = contents as IEnvelope;\n\n\t\t\t// If the address of the message changes while processing the batch, send the current bunch.\n\t\t\tif (currentAddress !== contentsEnvelope.address) {\n\t\t\t\tsendBunchedMessages();\n\t\t\t}\n\n\t\t\tcurrentMessagesContent.push({\n\t\t\t\tcontents: contentsEnvelope.contents,\n\t\t\t\t...restOfMessagesContent,\n\t\t\t});\n\t\t\tcurrentAddress = contentsEnvelope.address;\n\t\t}\n\n\t\t// Process the last bunch of messages.\n\t\tsendBunchedMessages();\n\t}\n\n\tprivate processAttachMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, messagesContent, local } = messageCollection;\n\t\tfor (const { contents } of messagesContent) {\n\t\t\tconst attachMessage = contents as IAttachMessage;\n\t\t\tconst id = attachMessage.id;\n\n\t\t\t// We need to process the GC Data for both local and remote attach messages\n\t\t\tprocessAttachMessageGCData(attachMessage.snapshot, (nodeId, toPath) => {\n\t\t\t\t// Note: nodeId will be \"/\" unless and until we support sub-DDS GC Nodes\n\t\t\t\tconst fromPath = `/${this.id}/${id}${nodeId === \"/\" ? \"\" : nodeId}`;\n\t\t\t\tthis.dataStoreContext.addedGCOutboundRoute(fromPath, toPath, envelope.timestamp);\n\t\t\t});\n\n\t\t\t// If a non-local operation then go and create the object\n\t\t\t// Otherwise mark it as officially attached.\n\t\t\tif (local) {\n\t\t\t\tassert(\n\t\t\t\t\tthis.pendingAttach.delete(id),\n\t\t\t\t\t0x17c /* \"Unexpected attach (local) channel OP\" */,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tassert(!this.contexts.has(id), 0x17d /* \"Unexpected attach channel OP\" */);\n\n\t\t\t\tconst summarizerNodeParams = {\n\t\t\t\t\ttype: CreateSummarizerNodeSource.FromAttach,\n\t\t\t\t\tsequenceNumber: envelope.sequenceNumber,\n\t\t\t\t\tsnapshot: attachMessage.snapshot,\n\t\t\t\t};\n\n\t\t\t\tconst remoteChannelContext = this.createRemoteChannelContext(\n\t\t\t\t\tattachMessage,\n\t\t\t\t\tsummarizerNodeParams,\n\t\t\t\t);\n\t\t\t\tthis.contexts.set(id, remoteChannelContext);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Process messages for this data store. The messages here are contiguous messages in a batch.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tpublic processMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tthis.verifyNotClosed();\n\n\t\tconst { envelope, local, messagesContent } = messageCollection;\n\n\t\tif (local) {\n\t\t\tthis.pendingOpCount.value -= messagesContent.length;\n\t\t}\n\n\t\ttry {\n\t\t\tswitch (envelope.type) {\n\t\t\t\tcase DataStoreMessageType.ChannelOp: {\n\t\t\t\t\tthis.processChannelMessages(messageCollection);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase DataStoreMessageType.Attach: {\n\t\t\t\t\tthis.processAttachMessages(messageCollection);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow DataProcessingError.wrapIfUnrecognized(\n\t\t\t\terror,\n\t\t\t\t\"fluidDataStoreRuntimeFailedToProcessMessage\",\n\t\t\t\tenvelope,\n\t\t\t);\n\t\t}\n\n\t\tfor (const { contents, clientSequenceNumber } of messagesContent) {\n\t\t\tthis.emit(\"op\", { ...envelope, contents, clientSequenceNumber });\n\t\t}\n\t}\n\n\tpublic processSignal(message: IInboundSignalMessage, local: boolean): void {\n\t\tthis.emit(\"signal\", message, local);\n\t}\n\n\tprivate isChannelAttached(id: string): boolean {\n\t\treturn (\n\t\t\t// Added in createChannel\n\t\t\t// Removed when bindChannel is called\n\t\t\t!this.notBoundedChannelContextSet.has(id) &&\n\t\t\t// Added in bindChannel only if this is not attached yet\n\t\t\t// Removed when this is attached by calling attachGraph\n\t\t\t!this.localChannelContextQueue.has(id) &&\n\t\t\t// Added in attachChannel called by bindChannel\n\t\t\t// Removed when attach op is broadcast\n\t\t\t!this.pendingAttach.has(id)\n\t\t);\n\t}\n\n\t/**\n\t * Returns the outbound routes of this channel. Currently, all contexts in this channel are considered\n\t * referenced and are hence outbound. This will change when we have root and non-root channel contexts.\n\t * The only root contexts will be considered as referenced.\n\t */\n\tprivate getOutboundRoutes(): string[] {\n\t\tconst outboundRoutes: string[] = [];\n\t\tfor (const [contextId] of this.contexts) {\n\t\t\toutboundRoutes.push(`${this.absolutePath}/${contextId}`);\n\t\t}\n\t\treturn outboundRoutes;\n\t}\n\n\t/**\n\t * Updates the GC nodes of this channel. It does the following:\n\t * - Adds a back route to self to all its child GC nodes.\n\t * - Adds a node for this channel.\n\t * @param builder - The builder that contains the GC nodes for this channel's children.\n\t */\n\tprivate updateGCNodes(builder: GCDataBuilder): void {\n\t\t// Add a back route to self in each child's GC nodes. If any child is referenced, then its parent should\n\t\t// be considered referenced as well.\n\t\tbuilder.addRouteToAllNodes(this.absolutePath);\n\n\t\t// Get the outbound routes and add a GC node for this channel.\n\t\tbuilder.addNode(\"/\", this.getOutboundRoutes());\n\t}\n\n\t/**\n\t * Returns a summary at the current sequence number.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tpublic async summarize(\n\t\tfullTree: boolean = false,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats> {\n\t\tconst summaryBuilder = new SummaryTreeBuilder();\n\t\tawait this.visitContextsDuringSummary(\n\t\t\tasync (contextId: string, context: IChannelContext) => {\n\t\t\t\tconst contextSummary = await context.summarize(fullTree, trackState, telemetryContext);\n\t\t\t\tsummaryBuilder.addWithStats(contextId, contextSummary);\n\t\t\t},\n\t\t);\n\t\treturn summaryBuilder.getSummaryTree();\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. This includes a list of GC nodes that represent this channel\n\t * including any of its child channel contexts. Each node has a set of outbound routes to other GC nodes in the\n\t * document. It does the following:\n\t *\n\t * 1. Calls into each child context to get its GC data.\n\t *\n\t * 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be\n\t * identified as belonging to the child.\n\t *\n\t * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent\n\t * the GC data of this channel.\n\t *\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tconst builder = new GCDataBuilder();\n\t\tawait this.visitContextsDuringSummary(\n\t\t\tasync (contextId: string, context: IChannelContext) => {\n\t\t\t\tconst contextGCData = await context.getGCData(fullGC);\n\t\t\t\t// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.\n\t\t\t\t// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t},\n\t\t);\n\t\tthis.updateGCNodes(builder);\n\t\treturn builder.getGCData();\n\t}\n\n\t/**\n\t * After GC has run, called to notify this channel of routes that are used in it. It calls the child contexts to\n\t * update their used routes.\n\t * @param usedRoutes - The routes that are used in all contexts in this channel.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: string[]): void {\n\t\t// Get a map of channel ids to routes used in it.\n\t\tconst usedContextRoutes = unpackChildNodesUsedRoutes(usedRoutes);\n\n\t\t// Verify that the used routes are correct.\n\t\tfor (const [id] of usedContextRoutes) {\n\t\t\tassert(\n\t\t\t\tthis.contexts.has(id),\n\t\t\t\t0x17e /* \"Used route does not belong to any known context\" */,\n\t\t\t);\n\t\t}\n\n\t\t// Update the used routes in each context. Used routes is empty for unused context.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.updateUsedRoutes(usedContextRoutes.get(contextId) ?? []);\n\t\t}\n\t}\n\n\tpublic getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\tconst summaryBuilder = new SummaryTreeBuilder();\n\t\tthis.visitLocalBoundContextsDuringAttach(\n\t\t\t(contextId: string, context: LocalChannelContextBase) => {\n\t\t\t\tlet summaryTree: ISummaryTreeWithStats;\n\t\t\t\tif (context.isLoaded) {\n\t\t\t\t\tconst contextSummary = context.getAttachSummary(telemetryContext);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tcontextSummary.summary.type === SummaryType.Tree,\n\t\t\t\t\t\t0x180 /* \"getAttachSummary should always return a tree\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tsummaryTree = { stats: contextSummary.stats, summary: contextSummary.summary };\n\t\t\t\t} else {\n\t\t\t\t\t// If this channel is not yet loaded, then there should be no changes in the snapshot from which\n\t\t\t\t\t// it was created as it is detached container. So just use the previous snapshot.\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!!this.dataStoreContext.baseSnapshot,\n\t\t\t\t\t\t0x181 /* \"BaseSnapshot should be there as detached container loaded from snapshot\" */,\n\t\t\t\t\t);\n\t\t\t\t\tsummaryTree = convertSnapshotTreeToSummaryTree(\n\t\t\t\t\t\t// TODO why are we non null asserting here?\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\tthis.dataStoreContext.baseSnapshot.trees[contextId]!,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tsummaryBuilder.addWithStats(contextId, summaryTree);\n\t\t\t},\n\t\t);\n\n\t\treturn summaryBuilder.getSummaryTree();\n\t}\n\n\t/**\n\t * Get the GC Data for the initial state being attached so remote clients can learn of this DataStore's outbound routes\n\t */\n\tpublic getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {\n\t\tconst gcDataBuilder = new GCDataBuilder();\n\t\tthis.visitLocalBoundContextsDuringAttach(\n\t\t\t(contextId: string, context: LocalChannelContextBase) => {\n\t\t\t\tif (context.isLoaded) {\n\t\t\t\t\tconst contextGCData = context.getAttachGCData(telemetryContext);\n\n\t\t\t\t\t// Incorporate the GC Data for this context\n\t\t\t\t\tgcDataBuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t\t}\n\t\t\t\t// else: Rehydrating detached container case. GC doesn't run until the container is attached, so nothing to do here.\n\t\t\t},\n\t\t);\n\t\tthis.updateGCNodes(gcDataBuilder);\n\n\t\treturn gcDataBuilder.getGCData();\n\t}\n\n\t/**\n\t * Helper method for preparing to summarize this channel.\n\t * Runs the callback for each bound context to incorporate its data however the caller specifies\n\t */\n\tprivate async visitContextsDuringSummary(\n\t\tvisitor: (contextId: string, context: IChannelContext) => Promise<void>,\n\t): Promise<void> {\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tconst isAttached = this.isChannelAttached(contextId);\n\t\t\t// We are not expecting local dds! Summary / GC data may not capture local state.\n\t\t\tassert(isAttached, 0x17f /* \"Not expecting detached channels during summarize\" */);\n\t\t\tawait visitor(contextId, context);\n\t\t}\n\t}\n\n\t/**\n\t * Helper method for preparing to attach this dataStore.\n\t * Runs the callback for each bound context to incorporate its data however the caller specifies\n\t */\n\tprivate visitLocalBoundContextsDuringAttach(\n\t\tvisitor: (contextId: string, context: LocalChannelContextBase) => void,\n\t): void {\n\t\tassert(\n\t\t\tthis.visibilityState === VisibilityState.LocallyVisible,\n\t\t\t0xc2c /* The data store should be locally visible when generating attach summary */,\n\t\t);\n\n\t\tconst visitedContexts = new Set<string>();\n\t\tlet visitedLength = -1;\n\t\twhile (visitedLength !== visitedContexts.size) {\n\t\t\t// detect changes in the visitedContexts set, as on visiting a context\n\t\t\t// it could could make contexts available by removing other contexts\n\t\t\t// from the notBoundedChannelContextSet, so we need to ensure those get processed as well.\n\t\t\t// only once the loop can run with no new contexts added to the visitedContexts set do we\n\t\t\t// know for sure all possible contexts have been visited.\n\t\t\tvisitedLength = visitedContexts.size;\n\t\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\t\tif (!(context instanceof LocalChannelContextBase)) {\n\t\t\t\t\tthrow new LoggingError(\"Should only be called with local channel handles\");\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!visitedContexts.has(contextId) &&\n\t\t\t\t\t!this.notBoundedChannelContextSet.has(contextId)\n\t\t\t\t) {\n\t\t\t\t\tvisitor(contextId, context);\n\t\t\t\t\tvisitedContexts.add(contextId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Submits the signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal. Should be a JSON serializable object or primitive.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\tpublic submitSignal(type: string, content: unknown, targetClientId?: string): void {\n\t\tthis.verifyNotClosed();\n\t\tthis.dataStoreContext.submitSignal(type, content, targetClientId);\n\t}\n\n\t/**\n\t * Will return when the data store is attached.\n\t */\n\tpublic async waitAttached(): Promise<void> {\n\t\treturn this.deferredAttached.promise;\n\t}\n\n\t/**\n\t * Assuming this DataStore is already attached, this will make the given channel locally visible\n\t * by submitting its attach op.\n\t */\n\tprivate makeChannelLocallyVisible(channel: IChannel): void {\n\t\tthis.verifyNotClosed();\n\t\t// If this handle is already attached no need to attach again.\n\t\tif (channel.handle.isAttached) {\n\t\t\treturn;\n\t\t}\n\n\t\ttoFluidHandleInternal(channel.handle).attachGraph();\n\n\t\tassert(\n\t\t\tthis.isAttached,\n\t\t\t0x182 /* \"Data store should be attached to attach the channel.\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.visibilityState === VisibilityState.GloballyVisible,\n\t\t\t0x2d0 /* \"Data store should be globally visible to attach channels.\" */,\n\t\t);\n\n\t\tconst summarizeResult = summarizeChannel(\n\t\t\tchannel,\n\t\t\ttrue /* fullTree */,\n\t\t\tfalse /* trackState */,\n\t\t);\n\n\t\t// We need to include the channel's GC Data so remote clients can learn of this channel's outbound routes\n\t\tconst gcData = channel.getGCData(/* fullGC: */ true);\n\t\taddBlobToSummary(summarizeResult, gcDataBlobKey, JSON.stringify(gcData));\n\n\t\t// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.\n\t\tconst snapshot = convertSummaryTreeToITree(summarizeResult.summary);\n\n\t\tconst message: IAttachMessage = {\n\t\t\tid: channel.id,\n\t\t\tsnapshot,\n\t\t\ttype: channel.attributes.type,\n\t\t};\n\t\tthis.pendingAttach.add(channel.id);\n\t\tthis.submit({ type: DataStoreMessageType.Attach, content: message });\n\n\t\tconst context = this.contexts.get(channel.id) as LocalChannelContextBase;\n\t\tcontext.makeVisible();\n\t}\n\n\tprivate submitChannelOp(address: string, contents: unknown, localOpMetadata: unknown): void {\n\t\tconst envelope: IEnvelope = { address, contents };\n\t\tthis.verifyNotClosed();\n\t\tthis.submit({ type: DataStoreMessageType.ChannelOp, content: envelope }, localOpMetadata);\n\t}\n\n\t/**\n\t * Count of pending ops that have been submitted but not yet ack'd.\n\t * Used to compute {@link FluidDataStoreRuntime.isDirty}\n\t */\n\tprivate readonly pendingOpCount: { value: number } = initializePendingOpCount();\n\n\tprivate submit(\n\t\tmessage: LocalFluidDataStoreRuntimeMessage,\n\t\tlocalOpMetadata: unknown = undefined,\n\t): void {\n\t\tthis.dataStoreContext.submitMessage(message.type, message.content, localOpMetadata);\n\t\t++this.pendingOpCount.value;\n\t}\n\n\t/**\n\t * For messages of type MessageType.Operation, finds the right channel and asks it to resubmit the message.\n\t * For all other messages, just submit it again.\n\t * This typically happens when we reconnect and there are unacked messages.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t *\n\t * @privateRemarks\n\t * `type` parameter's type of `DataStoreMessageType` is a covariance exception\n\t * over `string` that `IFluidDataStoreChannel` specifies. So long as local\n\t * submissions conform to this type all is well. (`unreachableCase` might be\n\t * reachable over time without better typing in this area if a mistake is made.)\n\t * See {@link @fluidframework/runtime-definitions#FluidDataStoreMessage} comment\n\t * for opportunity to resolve this.\n\t */\n\tpublic reSubmit(\n\t\ttype: DataStoreMessageType,\n\t\t// TODO: use something other than `any` here (breaking change)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tcontent: any,\n\t\tlocalOpMetadata: unknown,\n\t\tsquash?: boolean,\n\t): void {\n\t\tthis.verifyNotClosed();\n\n\t\t// The op being resubmitted was not / will not be submitted, so decrement the count.\n\t\t// The calls below may result in one or more ops submitted again, which will increment the count (or not if nothing needs to be submitted anymore).\n\t\t--this.pendingOpCount.value;\n\n\t\tswitch (type) {\n\t\t\tcase DataStoreMessageType.ChannelOp: {\n\t\t\t\t// For Operations, find the right channel and trigger resubmission on it.\n\t\t\t\tconst envelope = content as IEnvelope;\n\t\t\t\tconst channelContext = this.contexts.get(envelope.address);\n\t\t\t\tassert(!!channelContext, 0x183 /* \"There should be a channel context for the op\" */);\n\n\t\t\t\tchannelContext.reSubmit(envelope.contents, localOpMetadata, squash);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DataStoreMessageType.Attach: {\n\t\t\t\t// For Attach messages, just submit them again.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- `content` needs typed better than `any`\n\t\t\t\tthis.submit({ type, content }, localOpMetadata);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Revert a local op.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t *\n\t * @privateRemarks\n\t * `type` parameter's type of `DataStoreMessageType` is a covariance exception\n\t * over `string` that `IFluidDataStoreChannel` specifies. So long as local\n\t * submissions conform to this type all is well. (`unreachableCase` might be\n\t * reachable over time without better typing in this area if a mistake is made.)\n\t * See {@link @fluidframework/runtime-definitions#FluidDataStoreMessage} comment\n\t * for opportunity to resolve this.\n\t */\n\tpublic rollback?(\n\t\ttype: DataStoreMessageType,\n\t\t// TODO: use something other than `any` here (breaking change)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tcontent: any,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tthis.verifyNotClosed();\n\t\tassert(\n\t\t\t!this.localOpActivity,\n\t\t\t0xca2 /* localOpActivity must be undefined when entering rollback */,\n\t\t);\n\t\tthis.localOpActivity = \"rollback\";\n\t\ttry {\n\t\t\t// The op being rolled back was not/will not be submitted, so decrement the count.\n\t\t\t--this.pendingOpCount.value;\n\n\t\t\tswitch (type) {\n\t\t\t\tcase DataStoreMessageType.ChannelOp: {\n\t\t\t\t\t// For Operations, find the right channel and trigger resubmission on it.\n\t\t\t\t\tconst envelope = content as IEnvelope;\n\t\t\t\t\tconst channelContext = this.contexts.get(envelope.address);\n\t\t\t\t\tassert(!!channelContext, 0x2ed /* \"There should be a channel context for the op\" */);\n\n\t\t\t\t\tchannelContext.rollback(envelope.contents, localOpMetadata);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new LoggingError(`Can't rollback ${type} message`);\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.localOpActivity = undefined;\n\t\t}\n\t}\n\n\t// TODO: use something other than `any` here\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\tpublic async applyStashedOp(content: any): Promise<unknown> {\n\t\tassert(\n\t\t\t!this.localOpActivity,\n\t\t\t0xca3 /* localOpActivity must be undefined when entering applyStashedOp */,\n\t\t);\n\t\tthis.localOpActivity = \"applyStashed\";\n\t\ttry {\n\t\t\t// The op being applied may have been submitted in a previous session, so we increment the count here.\n\t\t\t// Either the ack will arrive and be processed, or that previous session's connection will end, at which point the op will be resubmitted.\n\t\t\t++this.pendingOpCount.value;\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\tconst type = content?.type as DataStoreMessageType;\n\t\t\tswitch (type) {\n\t\t\t\tcase DataStoreMessageType.Attach: {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\t\tconst attachMessage = content.content as IAttachMessage;\n\n\t\t\t\t\tconst flatBlobs = new Map<string, ArrayBufferLike>();\n\t\t\t\t\tconst snapshotTree = buildSnapshotTree(attachMessage.snapshot.entries, flatBlobs);\n\n\t\t\t\t\tconst channelContext = this.createRehydratedLocalChannelContext(\n\t\t\t\t\t\tattachMessage.id,\n\t\t\t\t\t\tsnapshotTree,\n\t\t\t\t\t\tflatBlobs,\n\t\t\t\t\t);\n\t\t\t\t\tawait channelContext.getChannel();\n\t\t\t\t\tthis.contexts.set(attachMessage.id, channelContext);\n\t\t\t\t\tif (this.attachState === AttachState.Detached) {\n\t\t\t\t\t\tthis.localChannelContextQueue.set(attachMessage.id, channelContext);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchannelContext.makeVisible();\n\t\t\t\t\t\tthis.pendingAttach.add(attachMessage.id);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcase DataStoreMessageType.ChannelOp: {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\t\tconst envelope = content.content as IEnvelope;\n\t\t\t\t\tconst channelContext = this.contexts.get(envelope.address);\n\t\t\t\t\tassert(!!channelContext, 0x184 /* \"There should be a channel context for the op\" */);\n\t\t\t\t\tawait channelContext.getChannel();\n\t\t\t\t\treturn channelContext.applyStashedOp(envelope.contents);\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tunreachableCase(type);\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.localOpActivity = undefined;\n\t\t}\n\t}\n\n\t/**\n\t * Indicates the given channel is dirty from Summarizer's point of view,\n\t * i.e. it has local changes that need to be included in the summary.\n\t *\n\t * @remarks If a channel's changes are rolled back or rebased away, we won't\n\t * clear the dirty flag set here.\n\t */\n\tprivate setChannelDirty(address: string): void {\n\t\tthis.verifyNotClosed();\n\t\tthis.dataStoreContext.setChannelDirty(address);\n\t}\n\n\tprivate attachListener(): void {\n\t\tthis.setMaxListeners(Number.MAX_SAFE_INTEGER);\n\n\t\t// back-compat, to be removed in the future.\n\t\t// Added in \"2.0.0-rc.2.0.0\" timeframe.\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any\n\t\t(this.dataStoreContext as any).once?.(\"attaching\", () => {\n\t\t\tthis.setAttachState(AttachState.Attaching);\n\t\t});\n\n\t\t// back-compat, to be removed in the future.\n\t\t// Added in \"2.0.0-rc.2.0.0\" timeframe.\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any\n\t\t(this.dataStoreContext as any).once?.(\"attached\", () => {\n\t\t\tthis.setAttachState(AttachState.Attached);\n\t\t});\n\t}\n\n\tprivate verifyNotClosed(): void {\n\t\tif (this._disposed) {\n\t\t\tthrow new LoggingError(\"Runtime is closed\");\n\t\t}\n\t}\n\n\t/**\n\t * Summarizer client should not have local changes. These changes can become part of the summary and can break\n\t * eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas\n\t * other clients that are up-to-date till seq# 100 may not have them yet.\n\t */\n\tprivate identifyLocalChangeInSummarizer(\n\t\teventName: string,\n\t\tchannelId: string,\n\t\tchannelType: string,\n\t): void {\n\t\tif (this.clientDetails.type !== \"summarizer\" || this.localChangesTelemetryCount <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Log a telemetry if there are local changes in the summarizer. This will give us data on how often\n\t\t// this is happening and which data stores do this. The eventual goal is to disallow local changes\n\t\t// in the summarizer and the data will help us plan this.\n\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\teventName,\n\t\t\t...tagCodeArtifacts({\n\t\t\t\tchannelType,\n\t\t\t\tchannelId,\n\t\t\t\tfluidDataStoreId: this.id,\n\t\t\t\tfluidDataStorePackagePath: this.dataStoreContext.packagePath.join(\"/\"),\n\t\t\t}),\n\t\t\tstack: generateStack(30),\n\t\t});\n\t\tthis.localChangesTelemetryCount--;\n\t}\n\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {\n\t\tswitch (attachState) {\n\t\t\tcase AttachState.Attaching: {\n\t\t\t\t/**\n\t\t\t\t * back-compat 0.59.1000 - Ideally, attachGraph() should have already been called making the data store\n\t\t\t\t * locally visible. However, before visibility state was added, this may not have been the case and data\n\t\t\t\t * store can move to \"attaching\" state in 2 scenarios:\n\t\t\t\t * 1) Before attachGraph() is called - When a data store is created and bound in an attached container.\n\t\t\t\t * 2) After attachGraph() is called - When a detached container is attached.\n\t\t\t\t *\n\t\t\t\t * The basic idea is that all local object should become locally visible before they are globally visible.\n\t\t\t\t */\n\t\t\t\tthis.attachGraph();\n\n\t\t\t\tthis._attachState = AttachState.Attaching;\n\n\t\t\t\tassert(\n\t\t\t\t\tthis.visibilityState === VisibilityState.LocallyVisible,\n\t\t\t\t\t0x2d1 /* \"Data store should be locally visible before it can become globally visible.\" */,\n\t\t\t\t);\n\n\t\t\t\t// Mark the data store globally visible and make its child channels visible as well.\n\t\t\t\tthis.visibilityState = VisibilityState.GloballyVisible;\n\t\t\t\tfor (const [, channel] of this.localChannelContextQueue) {\n\t\t\t\t\tchannel.makeVisible();\n\t\t\t\t}\n\t\t\t\tthis.localChannelContextQueue.clear();\n\n\t\t\t\t// This promise resolution will be moved to attached event once we fix the scheduler.\n\t\t\t\tthis.deferredAttached.resolve();\n\t\t\t\tthis.emit(\"attaching\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase AttachState.Attached: {\n\t\t\t\tassert(\n\t\t\t\t\tthis.visibilityState === VisibilityState.GloballyVisible,\n\t\t\t\t\t0x2d2 /* \"Data store should be globally visible when its attached.\" */,\n\t\t\t\t);\n\t\t\t\tthis._attachState = AttachState.Attached;\n\t\t\t\tthis.emit(\"attached\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(attachState, \"unreached\");\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Mixin class that adds request handler to FluidDataStoreRuntime\n * Request handler is only called when data store can't resolve request, i.e. for custom requests.\n * @param Base - base class, inherits from FluidDataStoreRuntime\n * @param requestHandler - request handler to mix in\n * @legacy @beta\n */\nexport const mixinRequestHandler = (\n\trequestHandler: (request: IRequest, runtime: FluidDataStoreRuntime) => Promise<IResponse>,\n\tBase: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n): typeof FluidDataStoreRuntime =>\n\tclass RuntimeWithRequestHandler extends Base {\n\t\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\t\tconst response = await super.request(request);\n\t\t\tif (response.status === 404) {\n\t\t\t\treturn requestHandler(request, this);\n\t\t\t}\n\t\t\treturn response;\n\t\t}\n\t} as typeof FluidDataStoreRuntime;\n\n/**\n * Mixin class that adds await for DataObject to finish initialization before we proceed to summary.\n * @param handler - handler that returns info about blob to be added to summary.\n * Or undefined not to add anything to summary.\n * @param Base - base class, inherits from FluidDataStoreRuntime\n * @legacy @beta\n */\nexport const mixinSummaryHandler = (\n\thandler: (\n\t\truntime: FluidDataStoreRuntime,\n\t) => Promise<{ path: string[]; content: string } | undefined>,\n\tBase: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n): typeof FluidDataStoreRuntime =>\n\tclass RuntimeWithSummarizerHandler extends Base {\n\t\tprivate addBlob(summary: ISummaryTreeWithStats, path: string[], content: string): void {\n\t\t\tconst firstName = path.shift();\n\t\t\tif (firstName === undefined) {\n\t\t\t\tthrow new LoggingError(\"Path can't be empty\");\n\t\t\t}\n\n\t\t\tlet blob: ISummaryTree | ISummaryBlob = {\n\t\t\t\ttype: SummaryType.Blob,\n\t\t\t\tcontent,\n\t\t\t};\n\t\t\tsummary.stats.blobNodeCount++;\n\t\t\tsummary.stats.totalBlobSize += content.length;\n\n\t\t\tfor (const name of path.reverse()) {\n\t\t\t\tblob = {\n\t\t\t\t\ttype: SummaryType.Tree,\n\t\t\t\t\ttree: { [name]: blob },\n\t\t\t\t};\n\t\t\t\tsummary.stats.treeNodeCount++;\n\t\t\t}\n\t\t\tsummary.summary.tree[firstName] = blob;\n\t\t}\n\n\t\tasync summarize(...args: any[]): Promise<ISummaryTreeWithStats> {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\tconst summary = await super.summarize(...args);\n\n\t\t\ttry {\n\t\t\t\tconst content = await handler(this);\n\t\t\t\tif (content !== undefined) {\n\t\t\t\t\tthis.addBlob(summary, content.path, content.content);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t// Any error coming from app-provided handler should be marked as DataProcessingError\n\t\t\t\tthrow DataProcessingError.wrapIfUnrecognized(error, \"mixinSummaryHandler\");\n\t\t\t}\n\n\t\t\treturn summary;\n\t\t}\n\t} as typeof FluidDataStoreRuntime;\n"]}
1
+ {"version":3,"file":"dataStoreRuntime.js","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAA4B,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAkB,MAAM,uCAAuC,CAAC;AAYpF,OAAO,EACN,MAAM,EACN,WAAW,EACX,QAAQ,EACR,WAAW,EACX,eAAe,GACf,MAAM,qCAAqC,CAAC;AAS7C,OAAO,EAKN,WAAW,GACX,MAAM,oCAAoC,CAAC;AAM5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,EAKN,0BAA0B,EAK1B,eAAe,EACf,aAAa,EAIb,qBAAqB,EACrB,+BAA+B,EAG/B,aAAa,EACb,0BAA0B,EAC1B,gCAAgC,GAChC,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,GACvB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAEN,mBAAmB,EACnB,YAAY,EAEZ,UAAU,EACV,4BAA4B,EAC5B,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GAChB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,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AE,CAAC;YACnC,IAAI,GAAG;gBACN,IAAI,EAAE,WAAW,CAAC,IAAI;gBACtB,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE;aACtB,CAAC;YACF,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC/B,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,SAAS,CACd,WAAoB,KAAK,EACzB,aAAsB,IAAI,EAC1B,gBAAoC;QAEpC,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;QAE9E,IAAI,CAAC;YACJ,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC,WAAmB,EAAE,EAAE,CAC3D,gBAAgB,EAAE,GAAG,CACpB,0BAA0B,EAC1B,gCAAgC,EAChC,uBAAuB,WAAW,EAAE,CACpC,CACD,CAAC;YACF,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC3B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACtD,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,qFAAqF;YACrF,MAAM,mBAAmB,CAAC,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC;QAC5E,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;CAC+B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter, type ILayerCompatDetails } from \"@fluid-internal/client-utils\";\nimport { AttachState, type IAudience } from \"@fluidframework/container-definitions\";\nimport type { IDeltaManager } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIFluidHandle,\n\tIRequest,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleContext,\n\tIFluidHandleInternal,\n} from \"@fluidframework/core-interfaces/internal\";\nimport {\n\tassert,\n\tdebugAssert,\n\tDeferred,\n\tLazyPromise,\n\tunreachableCase,\n} from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIChannel,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n\tIFluidDataStoreRuntimeEvents,\n\tIDeltaManagerErased,\n\tIFluidDataStoreRuntimeAlpha,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\ttype IClientDetails,\n\ttype IQuorumClients,\n\ttype ISummaryBlob,\n\ttype ISummaryTree,\n\tSummaryType,\n} from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { buildSnapshotTree } from \"@fluidframework/driver-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport {\n\ttype ISummaryTreeWithStats,\n\ttype ITelemetryContext,\n\ttype IGarbageCollectionData,\n\ttype CreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\ttype IAttachMessage,\n\ttype IEnvelope,\n\ttype IFluidDataStoreChannel,\n\ttype IFluidDataStoreContext,\n\tVisibilityState,\n\tgcDataBlobKey,\n\ttype IInboundSignalMessage,\n\ttype IRuntimeMessageCollection,\n\ttype IRuntimeMessagesContent,\n\tnotifiesReadOnlyState,\n\tencodeHandlesInContainerRuntime,\n\ttype IFluidDataStorePolicies,\n\ttype MinimumVersionForCollab,\n\tasLegacyAlpha,\n\tcurrentSummarizeStepPrefix,\n\tcurrentSummarizeStepPropertyName,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tGCDataBuilder,\n\tRequestParser,\n\tSummaryTreeBuilder,\n\taddBlobToSummary,\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertSummaryTreeToITree,\n\tcreate404Response,\n\tcreateResponseError,\n\texceptionToResponse,\n\tgenerateHandleContextPath,\n\tprocessAttachMessageGCData,\n\ttoFluidHandleInternal,\n\tunpackChildNodesUsedRoutes,\n\ttoDeltaManagerErased,\n\tencodeCompactIdToString,\n} from \"@fluidframework/runtime-utils/internal\";\nimport {\n\ttype ITelemetryLoggerExt,\n\tDataProcessingError,\n\tLoggingError,\n\ttype MonitoringContext,\n\tUsageError,\n\tcreateChildMonitoringContext,\n\tgenerateStack,\n\traiseConnectedEvent,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { type IChannelContext, summarizeChannel } from \"./channelContext.js\";\nimport {\n\tdataStoreCompatDetailsForRuntime,\n\tvalidateRuntimeCompatibility,\n} from \"./dataStoreLayerCompatState.js\";\nimport { FluidObjectHandle } from \"./fluidHandle.js\";\nimport {\n\tLocalChannelContext,\n\tLocalChannelContextBase,\n\tRehydratedLocalChannelContext,\n} from \"./localChannelContext.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\nimport { RemoteChannelContext } from \"./remoteChannelContext.js\";\n\ntype PickRequired<T extends Record<never, unknown>, K extends keyof T> = Omit<T, K> &\n\tRequired<Pick<T, K>>;\n\ninterface IFluidDataStoreContextFeaturesToTypes {\n\t[encodeHandlesInContainerRuntime]: IFluidDataStoreContext; // No difference in typing with this feature\n\t[notifiesReadOnlyState]: PickRequired<IFluidDataStoreContext, \"isReadOnly\">;\n}\n\nfunction contextSupportsFeature<K extends keyof IFluidDataStoreContextFeaturesToTypes>(\n\tobj: IFluidDataStoreContext,\n\tfeature: K,\n): obj is IFluidDataStoreContextFeaturesToTypes[K] {\n\tconst { ILayerCompatDetails } = obj as FluidObject<ILayerCompatDetails>;\n\treturn ILayerCompatDetails?.supportedFeatures.has(feature) ?? false;\n}\n\n/**\n * @legacy @beta\n */\nexport enum DataStoreMessageType {\n\t// Creates a new channel\n\tAttach = \"attach\",\n\tChannelOp = \"op\",\n}\n\n/**\n * Outgoing {@link FluidDataStoreRuntime} message structures.\n * @internal\n *\n * @privateRemarks\n * The types here are required to satisfy {@link @fluidframework/runtime-definitions#FluidDataStoreMessage} interface.\n */\nexport type LocalFluidDataStoreRuntimeMessage =\n\t| { type: DataStoreMessageType.ChannelOp; content: IEnvelope }\n\t| { type: DataStoreMessageType.Attach; content: IAttachMessage };\n\n/**\n * @legacy @beta\n */\nexport interface ISharedObjectRegistry {\n\t// TODO consider making this async. A consequence is that either the creation of a distributed data type\n\t// is async or we need a new API to split the synchronous vs. asynchronous creation.\n\tget(name: string): IChannelFactory | undefined;\n}\n\nconst defaultPolicies: IFluidDataStorePolicies = {\n\treadonlyInStagingMode: false,\n};\n\n/**\n * Set up the boxed pendingOpCount value.\n */\nfunction initializePendingOpCount(): { value: number } {\n\tlet value = 0;\n\treturn {\n\t\tget value() {\n\t\t\treturn value;\n\t\t},\n\t\tset value(newValue: number) {\n\t\t\tassert(newValue >= 0, 0xbbd /* pendingOpCount must be non-negative */);\n\t\t\tvalue = newValue;\n\t\t},\n\t};\n}\n\n/**\n * Base data store class\n * @legacy @beta\n */\nexport class FluidDataStoreRuntime\n\textends TypedEventEmitter<IFluidDataStoreRuntimeEvents>\n\timplements IFluidDataStoreChannel, IFluidDataStoreRuntime, IFluidHandleContext\n{\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.entryPoint}\n\t */\n\tpublic readonly entryPoint: IFluidHandleInternal<FluidObject>;\n\n\tpublic get connected(): boolean {\n\t\treturn this.dataStoreContext.connected;\n\t}\n\n\tpublic readonly policies: IFluidDataStorePolicies;\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.isReadOnly}\n\t */\n\tpublic readonly isReadOnly = (): boolean => this._readonly;\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this.dataStoreContext.clientId;\n\t}\n\n\tpublic get clientDetails(): IClientDetails {\n\t\treturn this.dataStoreContext.clientDetails;\n\t}\n\n\tpublic get isAttached(): boolean {\n\t\treturn this.attachState !== AttachState.Detached;\n\t}\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._attachState;\n\t}\n\n\tpublic get absolutePath(): string {\n\t\treturn generateHandleContextPath(this.id, this.routeContext);\n\t}\n\n\tpublic get routeContext(): IFluidHandleContext {\n\t\treturn this.dataStoreContext.IFluidHandleContext;\n\t}\n\n\tpublic get idCompressor(): IIdCompressor | undefined {\n\t\treturn this.dataStoreContext.idCompressor;\n\t}\n\n\t// TODO: the methods below should have more specific return typing, per the interfaces they are implementing.\n\t// Doing so would be a breaking change.\n\n\tpublic get IFluidHandleContext(): this {\n\t\treturn this;\n\t}\n\n\tpublic get rootRoutingContext(): this {\n\t\treturn this;\n\t}\n\tpublic get channelsRoutingContext(): this {\n\t\treturn this;\n\t}\n\tpublic get objectsRoutingContext(): this {\n\t\treturn this;\n\t}\n\n\tprivate localOpActivity: \"applyStashed\" | \"rollback\" | undefined = undefined;\n\tpublic get activeLocalOperationActivity(): \"applyStashed\" | \"rollback\" | undefined {\n\t\treturn this.localOpActivity;\n\t}\n\n\tprivate _disposed = false;\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\tprivate readonly contexts = new Map<string, IChannelContext>();\n\tprivate readonly pendingAttach = new Set<string>();\n\n\tprivate readonly deferredAttached = new Deferred<void>();\n\tprivate readonly localChannelContextQueue = new Map<string, LocalChannelContextBase>();\n\tprivate readonly notBoundedChannelContextSet = new Set<string>();\n\tprivate _attachState: AttachState;\n\tpublic visibilityState: VisibilityState;\n\t// A list of handles that are bound when the data store is not visible. We have to make them visible when the data\n\t// store becomes visible.\n\tprivate readonly pendingHandlesToMakeVisible: Set<IFluidHandleInternal> = new Set();\n\n\tpublic readonly id: string;\n\n\t// TODO: use something other than `any` here (breaking change)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic readonly options: Record<string | number, any>;\n\tpublic readonly deltaManagerInternal: IDeltaManager<\n\t\tISequencedDocumentMessage,\n\t\tIDocumentMessage\n\t>;\n\tprivate readonly quorum: IQuorumClients;\n\tprivate readonly audience: IAudience;\n\tprivate readonly mc: MonitoringContext;\n\tpublic get logger(): ITelemetryLoggerExt {\n\t\treturn this.mc.logger;\n\t}\n\n\t/**\n\t * If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.\n\t * So, adding a count of how many telemetry events are logged per data store context. This can be\n\t * controlled via feature flags.\n\t */\n\tprivate localChangesTelemetryCount: number;\n\n\t/**\n\t * The compatibility details of the DataStore layer that is exposed to the Runtime layer\n\t * for validating Runtime-DataStore compatibility.\n\t * @remarks This is for internal use only.\n\t * The type of this should be ILayerCompatDetails. However, ILayerCompatDetails is internal and this class\n\t * is currently marked as legacy alpha. So, using unknown here.\n\t */\n\tpublic readonly ILayerCompatDetails?: unknown = dataStoreCompatDetailsForRuntime;\n\n\t/**\n\t * See IFluidDataStoreRuntimeInternalConfig.submitMessagesWithoutEncodingHandles\n\t *\n\t * Note: this class doesn't declare that it implements IFluidDataStoreRuntimeInternalConfig,\n\t * and we keep this property as private, but consumers may optimistically cast\n\t * to the internal interface to access this property.\n\t */\n\tprivate readonly submitMessagesWithoutEncodingHandles: boolean;\n\n\t/**\n\t * See `IFluidDataStoreRuntimeInternalConfig.minVersionForCollab`.\n\t */\n\tpublic readonly minVersionForCollab?: MinimumVersionForCollab | undefined;\n\n\t/**\n\t * Create an instance of a DataStore runtime.\n\t *\n\t * @param dataStoreContext - Context object for the runtime.\n\t * @param sharedObjectRegistry - The registry of shared objects that this data store will be able to instantiate.\n\t * @param existing - Pass 'true' if loading this datastore from an existing file; pass 'false' otherwise.\n\t * @param provideEntryPoint - Function to initialize the entryPoint object for the data store runtime. The\n\t * handle to this data store runtime will point to the object returned by this function. If this function is not\n\t * provided, the handle will be left undefined. This is here so we can start making handles a first-class citizen\n\t * and the primary way of interacting with some Fluid objects, and should be used if possible.\n\t */\n\tpublic constructor(\n\t\tprivate readonly dataStoreContext: IFluidDataStoreContext,\n\t\tprivate readonly sharedObjectRegistry: ISharedObjectRegistry,\n\t\texisting: boolean,\n\t\tprovideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>,\n\t\tpolicies?: Partial<IFluidDataStorePolicies>,\n\t) {\n\t\tsuper();\n\n\t\tassert(\n\t\t\t!dataStoreContext.id.includes(\"/\"),\n\t\t\t0x30e /* Id cannot contain slashes. DataStoreContext should have validated this. */,\n\t\t);\n\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger: dataStoreContext.baseLogger,\n\t\t\tnamespace: \"FluidDataStoreRuntime\",\n\t\t\tproperties: {\n\t\t\t\tall: { dataStoreId: uuid(), dataStoreVersion: pkgVersion },\n\t\t\t\terror: { inStagingMode: () => this.inStagingMode, isDirty: () => this.isDirty },\n\t\t\t},\n\t\t});\n\n\t\t// Validate that the Runtime is compatible with this DataStore.\n\t\tconst { ILayerCompatDetails: runtimeCompatDetails } =\n\t\t\tdataStoreContext as FluidObject<ILayerCompatDetails>;\n\t\tvalidateRuntimeCompatibility(runtimeCompatDetails, this.dispose.bind(this), this.mc);\n\n\t\tif (contextSupportsFeature(dataStoreContext, notifiesReadOnlyState)) {\n\t\t\tthis._readonly = dataStoreContext.isReadOnly();\n\t\t} else {\n\t\t\tthis._readonly = this.dataStoreContext.deltaManager.readOnlyInfo.readonly === true;\n\t\t\tthis.dataStoreContext.deltaManager.on(\"readonly\", (readonly) =>\n\t\t\t\tthis.notifyReadOnlyState(readonly),\n\t\t\t);\n\t\t}\n\n\t\tthis.policies = { ...defaultPolicies, ...policies };\n\n\t\tthis.submitMessagesWithoutEncodingHandles = contextSupportsFeature(\n\t\t\tdataStoreContext,\n\t\t\tencodeHandlesInContainerRuntime,\n\t\t);\n\t\t// We read this property here to avoid a compiler error (unused private member)\n\t\tdebugAssert(() => this.submitMessagesWithoutEncodingHandles !== undefined);\n\n\t\tthis.id = dataStoreContext.id;\n\t\tthis.options = dataStoreContext.options;\n\t\tthis.deltaManagerInternal = dataStoreContext.deltaManager;\n\t\tthis.quorum = dataStoreContext.getQuorum();\n\t\tthis.audience = dataStoreContext.getAudience();\n\n\t\tconst tree = dataStoreContext.baseSnapshot;\n\n\t\t// Must always receive the data store type inside of the attributes\n\t\tif (tree?.trees !== undefined) {\n\t\t\tfor (const [path, subtree] of Object.entries(tree.trees)) {\n\t\t\t\t// Issue #4414\n\t\t\t\tif (path === \"_search\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlet channelContext: RemoteChannelContext | RehydratedLocalChannelContext;\n\t\t\t\t// If already exists on storage, then create a remote channel. However, if it is case of rehydrating a\n\t\t\t\t// container from snapshot where we load detached container from a snapshot, isLocalDataStore would be\n\t\t\t\t// true. In this case create a RehydratedLocalChannelContext.\n\t\t\t\tif (dataStoreContext.isLocalDataStore) {\n\t\t\t\t\tchannelContext = this.createRehydratedLocalChannelContext(path, subtree);\n\t\t\t\t\t// This is the case of rehydrating a detached container from snapshot. Now due to delay loading of\n\t\t\t\t\t// data store, if the data store is loaded after the container is attached, then we missed making\n\t\t\t\t\t// the channel visible. So do it now. Otherwise, add it to local channel context queue, so\n\t\t\t\t\t// that it can be make it visible later with the data store.\n\t\t\t\t\tif (dataStoreContext.attachState === AttachState.Detached) {\n\t\t\t\t\t\tthis.localChannelContextQueue.set(path, channelContext);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchannelContext.makeVisible();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tchannelContext = new RemoteChannelContext(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tdataStoreContext,\n\t\t\t\t\t\tdataStoreContext.storage,\n\t\t\t\t\t\t(content, localOpMetadata) => this.submitChannelOp(path, content, localOpMetadata),\n\t\t\t\t\t\t(address: string) => this.setChannelDirty(address),\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tsubtree,\n\t\t\t\t\t\tthis.sharedObjectRegistry,\n\t\t\t\t\t\tundefined /* extraBlobs */,\n\t\t\t\t\t\tthis.dataStoreContext.getCreateChildSummarizerNodeFn(path, {\n\t\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tthis.contexts.set(path, channelContext);\n\t\t\t}\n\t\t}\n\n\t\tthis.entryPoint = new FluidObjectHandle<FluidObject>(\n\t\t\tnew LazyPromise(async () => provideEntryPoint(this)),\n\t\t\t\"\",\n\t\t\tthis.objectsRoutingContext,\n\t\t);\n\n\t\tthis.attachListener();\n\t\tthis._attachState = dataStoreContext.attachState;\n\n\t\t/**\n\t\t * If existing flag is false, this is a new data store and is not visible. The existing flag can be true in two\n\t\t * conditions:\n\t\t *\n\t\t * 1. It's a local data store that is created when a detached container is rehydrated. In this case, the data\n\t\t * store is locally visible because the snapshot it is loaded from contains locally visible data stores only.\n\t\t *\n\t\t * 2. It's a remote data store that is created when an attached container is loaded is loaded from snapshot or\n\t\t * when an attach op comes in. In both these cases, the data store is already globally visible.\n\t\t */\n\t\tif (existing) {\n\t\t\tthis.visibilityState =\n\t\t\t\tdataStoreContext.attachState === AttachState.Detached\n\t\t\t\t\t? VisibilityState.LocallyVisible\n\t\t\t\t\t: VisibilityState.GloballyVisible;\n\t\t} else {\n\t\t\tthis.visibilityState = VisibilityState.NotVisible;\n\t\t}\n\n\t\t// If it's existing we know it has been attached.\n\t\tif (existing) {\n\t\t\tthis.deferredAttached.resolve();\n\t\t}\n\n\t\t// By default, a data store can log maximum 10 local changes telemetry in summarizer.\n\t\tthis.localChangesTelemetryCount =\n\t\t\tthis.mc.config.getNumber(\"Fluid.Telemetry.LocalChangesTelemetryCount\") ?? 10;\n\n\t\tthis.minVersionForCollab = this.dataStoreContext.minVersionForCollab;\n\t}\n\n\t/**\n\t * Implementation of IFluidDataStoreRuntimeAlpha.inStagingMode\n\t */\n\tprivate get inStagingMode(): IFluidDataStoreRuntimeAlpha[\"inStagingMode\"] {\n\t\treturn asLegacyAlpha(this.dataStoreContext.containerRuntime)?.inStagingMode;\n\t}\n\n\t/**\n\t * Implementation of IFluidDataStoreRuntimeAlpha.isDirty\n\t */\n\tprivate get isDirty(): IFluidDataStoreRuntimeAlpha[\"isDirty\"] {\n\t\treturn this.pendingOpCount.value > 0;\n\t}\n\n\tget deltaManager(): IDeltaManagerErased {\n\t\treturn toDeltaManagerErased(this.deltaManagerInternal);\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis._disposed = true;\n\n\t\tthis.emit(\"dispose\");\n\t\tthis.removeAllListeners();\n\t}\n\n\tpublic async resolveHandle(request: IRequest): Promise<IResponse> {\n\t\treturn this.request(request);\n\t}\n\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\ttry {\n\t\t\tconst parser = RequestParser.create(request);\n\t\t\t// If there are not path parts, and the request is via a handle\n\t\t\t// then we should return the entrypoint object for this runtime.\n\t\t\t// This allows the entrypoint handle to be resolved without the need\n\t\t\t// for the entrypoint object to know anything about requests or handles.\n\t\t\t//\n\t\t\t// This works because the entrypoint handle is an object handle,\n\t\t\t// which always has a real reference to the object itself.\n\t\t\t// Those get serialized and then deserialized into a plain handle, which really just has a path,\n\t\t\t// resolution walks to the runtime, which calls this, and get the true object off the internal object handle\n\t\t\tif (parser.pathParts.length === 0 && request.headers?.viaHandle === true) {\n\t\t\t\treturn { mimeType: \"fluid/object\", status: 200, value: await this.entryPoint.get() };\n\t\t\t}\n\t\t\tconst id = parser.pathParts[0];\n\n\t\t\tif (id === \"_channels\" || id === \"_custom\") {\n\t\t\t\treturn await this.request(parser.createSubRequest(1));\n\t\t\t}\n\n\t\t\tif (id !== undefined) {\n\t\t\t\t// Check for a data type reference first\n\t\t\t\tconst context = this.contexts.get(id);\n\t\t\t\tif (context !== undefined && parser.isLeaf(1)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst channel = await context.getChannel();\n\n\t\t\t\t\t\treturn { mimeType: \"fluid/object\", status: 200, value: channel };\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthis.mc.logger.sendErrorEvent({ eventName: \"GetChannelFailedInRequest\" }, error);\n\n\t\t\t\t\t\treturn createResponseError(500, `Failed to get Channel: ${error}`, request);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise defer to an attached request handler\n\t\t\treturn create404Response(request);\n\t\t} catch (error) {\n\t\t\treturn exceptionToResponse(error);\n\t\t}\n\t}\n\n\tpublic async getChannel(id: string): Promise<IChannel> {\n\t\tthis.verifyNotClosed();\n\n\t\tconst context = this.contexts.get(id);\n\t\tif (context === undefined) {\n\t\t\tthrow new LoggingError(\"Channel does not exist\");\n\t\t}\n\n\t\treturn context.getChannel();\n\t}\n\n\t/**\n\t * Validate user provided channel ID\n\t * Channel ID has limitations. \"/\" is not allowed as IDs in storage can not have slashes - we parse tree paths and use \"/\" as separator.\n\t * IDs cannot start with \"_\" as it could result in collision of IDs with auto-assigned (by FF) short IDs.\n\t * @param id - channel ID.\n\t */\n\tprotected validateChannelId(id: string): void {\n\t\tif (id.includes(\"/\")) {\n\t\t\tthrow new UsageError(`Id cannot contain slashes: ${id}`);\n\t\t}\n\t\tif (id.startsWith(\"_\")) {\n\t\t\tthrow new UsageError(`Id cannot start with underscore: ${id}`);\n\t\t}\n\t}\n\n\t/**\n\t * Api which allows caller to create the channel first and then add it to the runtime.\n\t * The channel type should be present in the registry, otherwise the runtime would reject\n\t * the channel. Also the runtime used to create the channel object should be same to which\n\t * it is added.\n\t * @param channel - channel which needs to be added to the runtime.\n\t */\n\tpublic addChannel(channel: IChannel): void {\n\t\tconst id = channel.id;\n\t\tthis.validateChannelId(id);\n\n\t\tthis.verifyNotClosed();\n\n\t\tassert(!this.contexts.has(id), 0x865 /* addChannel() with existing ID */);\n\n\t\tconst type = channel.attributes.type;\n\t\tconst factory = this.sharedObjectRegistry.get(channel.attributes.type);\n\t\tif (factory === undefined) {\n\t\t\tthrow new Error(`Channel Factory ${type} not registered`);\n\t\t}\n\n\t\tthis.createChannelContext(channel);\n\t\t// Channels (DDS) should not be created in summarizer client.\n\t\tthis.identifyLocalChangeInSummarizer(\"DDSCreatedInSummarizer\", id, type);\n\t}\n\n\tpublic createChannel(idArg: string | undefined, type: string): IChannel {\n\t\tlet id: string;\n\n\t\tif (idArg === undefined) {\n\t\t\t/**\n\t\t\t * Return uuid if short-ids are explicitly disabled via feature flags.\n\t\t\t */\n\t\t\tif (this.mc.config.getBoolean(\"Fluid.Runtime.DisableShortIds\") === true) {\n\t\t\t\tid = uuid();\n\t\t\t} else {\n\t\t\t\t// We use three non-overlapping namespaces:\n\t\t\t\t// - detached state: even numbers\n\t\t\t\t// - attached state: odd numbers\n\t\t\t\t// - uuids\n\t\t\t\t// In first two cases we will encode result as strings in more compact form, with leading underscore,\n\t\t\t\t// to ensure no overlap with user-provided DDS names (see validateChannelId())\n\t\t\t\tif (this.visibilityState === VisibilityState.GloballyVisible) {\n\t\t\t\t\t// Due to back-compat, we could not depend yet on generateDocumentUniqueId() being there.\n\t\t\t\t\t// We can remove the need to leverage uuid() as fall-back in couple releases.\n\t\t\t\t\tconst res =\n\t\t\t\t\t\tthis.dataStoreContext.containerRuntime.generateDocumentUniqueId?.() ?? uuid();\n\t\t\t\t\tid = typeof res === \"number\" ? encodeCompactIdToString(2 * res + 1, \"_\") : res;\n\t\t\t\t} else {\n\t\t\t\t\t// container is detached, only one client observes content, no way to hit collisions with other clients.\n\t\t\t\t\tid = encodeCompactIdToString(2 * this.contexts.size, \"_\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tassert(!id.includes(\"/\"), 0x8fc /* slash */);\n\t\t} else {\n\t\t\tid = idArg;\n\t\t\tthis.validateChannelId(id);\n\t\t}\n\n\t\tthis.verifyNotClosed();\n\t\tassert(!this.contexts.has(id), 0x179 /* \"createChannel() with existing ID\" */);\n\n\t\tassert(type !== undefined, 0x209 /* \"Factory Type should be defined\" */);\n\t\tconst factory = this.sharedObjectRegistry.get(type);\n\t\tif (factory === undefined) {\n\t\t\tthrow new Error(`Channel Factory ${type} not registered`);\n\t\t}\n\n\t\tconst channel = factory.create(this, id);\n\t\tthis.createChannelContext(channel);\n\t\t// Channels (DDS) should not be created in summarizer client.\n\t\tthis.identifyLocalChangeInSummarizer(\"DDSCreatedInSummarizer\", id, type);\n\t\treturn channel;\n\t}\n\n\tprivate createChannelContext(channel: IChannel): void {\n\t\tthis.notBoundedChannelContextSet.add(channel.id);\n\t\tconst context = new LocalChannelContext(\n\t\t\tchannel,\n\t\t\tthis,\n\t\t\tthis.dataStoreContext,\n\t\t\tthis.dataStoreContext.storage,\n\t\t\tthis.logger,\n\t\t\t(content, localOpMetadata) => this.submitChannelOp(channel.id, content, localOpMetadata),\n\t\t\t(address: string) => this.setChannelDirty(address),\n\t\t);\n\t\tthis.contexts.set(channel.id, context);\n\t}\n\n\tprivate createRehydratedLocalChannelContext(\n\t\tid: string,\n\t\ttree: ISnapshotTree,\n\t\tflatBlobs?: Map<string, ArrayBufferLike>,\n\t): RehydratedLocalChannelContext {\n\t\treturn new RehydratedLocalChannelContext(\n\t\t\tid,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis,\n\t\t\tthis.dataStoreContext,\n\t\t\tthis.dataStoreContext.storage,\n\t\t\tthis.logger,\n\t\t\t(content, localOpMetadata) => this.submitChannelOp(id, content, localOpMetadata),\n\t\t\t(address: string) => this.setChannelDirty(address),\n\t\t\ttree,\n\t\t\tflatBlobs,\n\t\t);\n\t}\n\n\t/**\n\t * Binds a channel with the runtime. If the runtime is attached we will attach the channel right away.\n\t * If the runtime is not attached we will defer the attach until the runtime attaches.\n\t * @param channel - channel to be registered.\n\t */\n\tpublic bindChannel(channel: IChannel): void {\n\t\tassert(\n\t\t\tthis.notBoundedChannelContextSet.has(channel.id),\n\t\t\t0x17b /* \"Channel to be bound should be in not bounded set\" */,\n\t\t);\n\t\tthis.notBoundedChannelContextSet.delete(channel.id);\n\t\t// If our data store is attached, then attach the channel.\n\t\tif (this.isAttached) {\n\t\t\tthis.makeChannelLocallyVisible(channel);\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * If this channel is already waiting to be made visible, do nothing. This can happen during attachGraph() when\n\t\t * a channel's graph is attached. It calls bindToContext on the shared object which will end up back here.\n\t\t */\n\t\tif (this.pendingHandlesToMakeVisible.has(toFluidHandleInternal(channel.handle))) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.bind(channel.handle);\n\n\t\t// If our data store is local then add the channel to the queue\n\t\tif (!this.localChannelContextQueue.has(channel.id)) {\n\t\t\tthis.localChannelContextQueue.set(\n\t\t\t\tchannel.id,\n\t\t\t\tthis.contexts.get(channel.id) as LocalChannelContextBase,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * This function is called when a data store becomes root. It does the following:\n\t *\n\t * 1. Marks the data store locally visible in the container.\n\t *\n\t * 2. Attaches the graph of all the handles bound to it.\n\t *\n\t * 3. Calls into the data store context to mark it visible in the container too. If the container is globally\n\t * visible, it will mark us globally visible. Otherwise, it will mark us globally visible when it becomes\n\t * globally visible.\n\t */\n\tpublic makeVisibleAndAttachGraph(): void {\n\t\tif (this.visibilityState !== VisibilityState.NotVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis.visibilityState = VisibilityState.LocallyVisible;\n\n\t\tfor (const handle of this.pendingHandlesToMakeVisible) {\n\t\t\thandle.attachGraph();\n\t\t}\n\t\tthis.pendingHandlesToMakeVisible.clear();\n\t\tthis.dataStoreContext.makeLocallyVisible();\n\t}\n\n\t/**\n\t * This function is called when a handle to this data store is added to a visible DDS.\n\t */\n\tpublic attachGraph(): void {\n\t\tthis.makeVisibleAndAttachGraph();\n\t}\n\n\tpublic bind(handle: IFluidHandle): void {\n\t\t// If visible, attach the incoming handle's graph. Else, this will be done when we become visible.\n\t\tif (this.visibilityState !== VisibilityState.NotVisible) {\n\t\t\ttoFluidHandleInternal(handle).attachGraph();\n\t\t\treturn;\n\t\t}\n\t\tthis.pendingHandlesToMakeVisible.add(toFluidHandleInternal(handle));\n\t}\n\n\tpublic setConnectionState(connected: boolean, clientId?: string): void {\n\t\tthis.verifyNotClosed();\n\n\t\tfor (const [, object] of this.contexts) {\n\t\t\tobject.setConnectionState(connected, clientId);\n\t\t}\n\n\t\traiseConnectedEvent(this.logger, this, connected, clientId);\n\t}\n\n\tprivate _readonly: boolean;\n\t/**\n\t * This function is used by the datastore context to configure the\n\t * readonly state of this object. It should not be invoked by\n\t * any other callers.\n\t */\n\tpublic notifyReadOnlyState(readonly: boolean): void {\n\t\tthis.verifyNotClosed();\n\t\tif (readonly !== this._readonly) {\n\t\t\tthis._readonly = readonly;\n\t\t\tthis.emit(\"readonly\", readonly);\n\t\t}\n\t}\n\n\tpublic getQuorum(): IQuorumClients {\n\t\treturn this.quorum;\n\t}\n\n\tpublic getAudience(): IAudience {\n\t\treturn this.audience;\n\t}\n\n\tpublic async uploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandle<ArrayBufferLike>> {\n\t\tthis.verifyNotClosed();\n\n\t\treturn this.dataStoreContext.uploadBlob(blob, signal);\n\t}\n\n\tprivate createRemoteChannelContext(\n\t\tattachMessage: IAttachMessage,\n\t\tsummarizerNodeParams: CreateChildSummarizerNodeParam,\n\t): RemoteChannelContext {\n\t\tconst flatBlobs = new Map<string, ArrayBufferLike>();\n\t\tconst snapshotTree = buildSnapshotTree(attachMessage.snapshot.entries, flatBlobs);\n\n\t\treturn new RemoteChannelContext(\n\t\t\tthis,\n\t\t\tthis.dataStoreContext,\n\t\t\tthis.dataStoreContext.storage,\n\t\t\t(content, localContentMetadata) =>\n\t\t\t\tthis.submitChannelOp(attachMessage.id, content, localContentMetadata),\n\t\t\t(address: string) => this.setChannelDirty(address),\n\t\t\tattachMessage.id,\n\t\t\tsnapshotTree,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tflatBlobs,\n\t\t\tthis.dataStoreContext.getCreateChildSummarizerNodeFn(\n\t\t\t\tattachMessage.id,\n\t\t\t\tsummarizerNodeParams,\n\t\t\t),\n\t\t\tattachMessage.type,\n\t\t);\n\t}\n\n\t/**\n\t * Process channel messages. The messages here are contiguous channel types messages in a batch for this data\n\t * store.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tprivate processChannelMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tthis.verifyNotClosed();\n\n\t\t/*\n\t\t * Bunch contiguous messages for the same channel and send them together.\n\t\t * This is an optimization where DDSes can process a bunch of ops together. DDSes\n\t\t * like merge tree or shared tree can process ops more efficiently when they are bunched together.\n\t\t */\n\t\tlet currentAddress: string | undefined;\n\t\tlet currentMessagesContent: IRuntimeMessagesContent[] = [];\n\t\tconst { messagesContent, local, envelope } = messageCollection;\n\n\t\tconst sendBunchedMessages = (): void => {\n\t\t\t// Current address will be undefined for the first message in the list.\n\t\t\tif (currentAddress === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// process the last set of channel ops\n\t\t\tconst channelContext = this.contexts.get(currentAddress);\n\t\t\tassert(!!channelContext, 0xa6b /* Channel context not found */);\n\n\t\t\tchannelContext.processMessages({\n\t\t\t\tenvelope,\n\t\t\t\tmessagesContent: currentMessagesContent,\n\t\t\t\tlocal,\n\t\t\t});\n\n\t\t\tcurrentMessagesContent = [];\n\t\t};\n\n\t\tfor (const { contents, ...restOfMessagesContent } of messagesContent) {\n\t\t\tconst contentsEnvelope = contents as IEnvelope;\n\n\t\t\t// If the address of the message changes while processing the batch, send the current bunch.\n\t\t\tif (currentAddress !== contentsEnvelope.address) {\n\t\t\t\tsendBunchedMessages();\n\t\t\t}\n\n\t\t\tcurrentMessagesContent.push({\n\t\t\t\tcontents: contentsEnvelope.contents,\n\t\t\t\t...restOfMessagesContent,\n\t\t\t});\n\t\t\tcurrentAddress = contentsEnvelope.address;\n\t\t}\n\n\t\t// Process the last bunch of messages.\n\t\tsendBunchedMessages();\n\t}\n\n\tprivate processAttachMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, messagesContent, local } = messageCollection;\n\t\tfor (const { contents } of messagesContent) {\n\t\t\tconst attachMessage = contents as IAttachMessage;\n\t\t\tconst id = attachMessage.id;\n\n\t\t\t// We need to process the GC Data for both local and remote attach messages\n\t\t\tprocessAttachMessageGCData(attachMessage.snapshot, (nodeId, toPath) => {\n\t\t\t\t// Note: nodeId will be \"/\" unless and until we support sub-DDS GC Nodes\n\t\t\t\tconst fromPath = `/${this.id}/${id}${nodeId === \"/\" ? \"\" : nodeId}`;\n\t\t\t\tthis.dataStoreContext.addedGCOutboundRoute(fromPath, toPath, envelope.timestamp);\n\t\t\t});\n\n\t\t\t// If a non-local operation then go and create the object\n\t\t\t// Otherwise mark it as officially attached.\n\t\t\tif (local) {\n\t\t\t\tassert(\n\t\t\t\t\tthis.pendingAttach.delete(id),\n\t\t\t\t\t0x17c /* \"Unexpected attach (local) channel OP\" */,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tassert(!this.contexts.has(id), 0x17d /* \"Unexpected attach channel OP\" */);\n\n\t\t\t\tconst summarizerNodeParams = {\n\t\t\t\t\ttype: CreateSummarizerNodeSource.FromAttach,\n\t\t\t\t\tsequenceNumber: envelope.sequenceNumber,\n\t\t\t\t\tsnapshot: attachMessage.snapshot,\n\t\t\t\t};\n\n\t\t\t\tconst remoteChannelContext = this.createRemoteChannelContext(\n\t\t\t\t\tattachMessage,\n\t\t\t\t\tsummarizerNodeParams,\n\t\t\t\t);\n\t\t\t\tthis.contexts.set(id, remoteChannelContext);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Process messages for this data store. The messages here are contiguous messages in a batch.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tpublic processMessages(messageCollection: IRuntimeMessageCollection): void {\n\t\tthis.verifyNotClosed();\n\n\t\tconst { envelope, local, messagesContent } = messageCollection;\n\n\t\tif (local) {\n\t\t\tthis.pendingOpCount.value -= messagesContent.length;\n\t\t}\n\n\t\ttry {\n\t\t\tswitch (envelope.type) {\n\t\t\t\tcase DataStoreMessageType.ChannelOp: {\n\t\t\t\t\tthis.processChannelMessages(messageCollection);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase DataStoreMessageType.Attach: {\n\t\t\t\t\tthis.processAttachMessages(messageCollection);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow DataProcessingError.wrapIfUnrecognized(\n\t\t\t\terror,\n\t\t\t\t\"fluidDataStoreRuntimeFailedToProcessMessage\",\n\t\t\t\tenvelope,\n\t\t\t);\n\t\t}\n\n\t\tfor (const { contents, clientSequenceNumber } of messagesContent) {\n\t\t\tthis.emit(\"op\", { ...envelope, contents, clientSequenceNumber });\n\t\t}\n\t}\n\n\tpublic processSignal(message: IInboundSignalMessage, local: boolean): void {\n\t\tthis.emit(\"signal\", message, local);\n\t}\n\n\tprivate isChannelAttached(id: string): boolean {\n\t\treturn (\n\t\t\t// Added in createChannel\n\t\t\t// Removed when bindChannel is called\n\t\t\t!this.notBoundedChannelContextSet.has(id) &&\n\t\t\t// Added in bindChannel only if this is not attached yet\n\t\t\t// Removed when this is attached by calling attachGraph\n\t\t\t!this.localChannelContextQueue.has(id) &&\n\t\t\t// Added in attachChannel called by bindChannel\n\t\t\t// Removed when attach op is broadcast\n\t\t\t!this.pendingAttach.has(id)\n\t\t);\n\t}\n\n\t/**\n\t * Returns the outbound routes of this channel. Currently, all contexts in this channel are considered\n\t * referenced and are hence outbound. This will change when we have root and non-root channel contexts.\n\t * The only root contexts will be considered as referenced.\n\t */\n\tprivate getOutboundRoutes(): string[] {\n\t\tconst outboundRoutes: string[] = [];\n\t\tfor (const [contextId] of this.contexts) {\n\t\t\toutboundRoutes.push(`${this.absolutePath}/${contextId}`);\n\t\t}\n\t\treturn outboundRoutes;\n\t}\n\n\t/**\n\t * Updates the GC nodes of this channel. It does the following:\n\t * - Adds a back route to self to all its child GC nodes.\n\t * - Adds a node for this channel.\n\t * @param builder - The builder that contains the GC nodes for this channel's children.\n\t */\n\tprivate updateGCNodes(builder: GCDataBuilder): void {\n\t\t// Add a back route to self in each child's GC nodes. If any child is referenced, then its parent should\n\t\t// be considered referenced as well.\n\t\tbuilder.addRouteToAllNodes(this.absolutePath);\n\n\t\t// Get the outbound routes and add a GC node for this channel.\n\t\tbuilder.addNode(\"/\", this.getOutboundRoutes());\n\t}\n\n\t/**\n\t * Returns a summary at the current sequence number.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tpublic async summarize(\n\t\tfullTree: boolean = false,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats> {\n\t\tconst summaryBuilder = new SummaryTreeBuilder();\n\t\tawait this.visitContextsDuringSummary(\n\t\t\tasync (contextId: string, context: IChannelContext) => {\n\t\t\t\tconst contextSummary = await context.summarize(fullTree, trackState, telemetryContext);\n\t\t\t\tsummaryBuilder.addWithStats(contextId, contextSummary);\n\t\t\t},\n\t\t);\n\t\treturn summaryBuilder.getSummaryTree();\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. This includes a list of GC nodes that represent this channel\n\t * including any of its child channel contexts. Each node has a set of outbound routes to other GC nodes in the\n\t * document. It does the following:\n\t *\n\t * 1. Calls into each child context to get its GC data.\n\t *\n\t * 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be\n\t * identified as belonging to the child.\n\t *\n\t * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent\n\t * the GC data of this channel.\n\t *\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tconst builder = new GCDataBuilder();\n\t\tawait this.visitContextsDuringSummary(\n\t\t\tasync (contextId: string, context: IChannelContext) => {\n\t\t\t\tconst contextGCData = await context.getGCData(fullGC);\n\t\t\t\t// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.\n\t\t\t\t// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t},\n\t\t);\n\t\tthis.updateGCNodes(builder);\n\t\treturn builder.getGCData();\n\t}\n\n\t/**\n\t * After GC has run, called to notify this channel of routes that are used in it. It calls the child contexts to\n\t * update their used routes.\n\t * @param usedRoutes - The routes that are used in all contexts in this channel.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: string[]): void {\n\t\t// Get a map of channel ids to routes used in it.\n\t\tconst usedContextRoutes = unpackChildNodesUsedRoutes(usedRoutes);\n\n\t\t// Verify that the used routes are correct.\n\t\tfor (const [id] of usedContextRoutes) {\n\t\t\tassert(\n\t\t\t\tthis.contexts.has(id),\n\t\t\t\t0x17e /* \"Used route does not belong to any known context\" */,\n\t\t\t);\n\t\t}\n\n\t\t// Update the used routes in each context. Used routes is empty for unused context.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.updateUsedRoutes(usedContextRoutes.get(contextId) ?? []);\n\t\t}\n\t}\n\n\tpublic getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\tconst summaryBuilder = new SummaryTreeBuilder();\n\t\tthis.visitLocalBoundContextsDuringAttach(\n\t\t\t(contextId: string, context: LocalChannelContextBase) => {\n\t\t\t\tlet summaryTree: ISummaryTreeWithStats;\n\t\t\t\tif (context.isLoaded) {\n\t\t\t\t\tconst contextSummary = context.getAttachSummary(telemetryContext);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tcontextSummary.summary.type === SummaryType.Tree,\n\t\t\t\t\t\t0x180 /* \"getAttachSummary should always return a tree\" */,\n\t\t\t\t\t);\n\n\t\t\t\t\tsummaryTree = { stats: contextSummary.stats, summary: contextSummary.summary };\n\t\t\t\t} else {\n\t\t\t\t\t// If this channel is not yet loaded, then there should be no changes in the snapshot from which\n\t\t\t\t\t// it was created as it is detached container. So just use the previous snapshot.\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!!this.dataStoreContext.baseSnapshot,\n\t\t\t\t\t\t0x181 /* \"BaseSnapshot should be there as detached container loaded from snapshot\" */,\n\t\t\t\t\t);\n\t\t\t\t\tsummaryTree = convertSnapshotTreeToSummaryTree(\n\t\t\t\t\t\t// TODO why are we non null asserting here?\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\tthis.dataStoreContext.baseSnapshot.trees[contextId]!,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tsummaryBuilder.addWithStats(contextId, summaryTree);\n\t\t\t},\n\t\t);\n\n\t\treturn summaryBuilder.getSummaryTree();\n\t}\n\n\t/**\n\t * Get the GC Data for the initial state being attached so remote clients can learn of this DataStore's outbound routes\n\t */\n\tpublic getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {\n\t\tconst gcDataBuilder = new GCDataBuilder();\n\t\tthis.visitLocalBoundContextsDuringAttach(\n\t\t\t(contextId: string, context: LocalChannelContextBase) => {\n\t\t\t\tif (context.isLoaded) {\n\t\t\t\t\tconst contextGCData = context.getAttachGCData(telemetryContext);\n\n\t\t\t\t\t// Incorporate the GC Data for this context\n\t\t\t\t\tgcDataBuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t\t}\n\t\t\t\t// else: Rehydrating detached container case. GC doesn't run until the container is attached, so nothing to do here.\n\t\t\t},\n\t\t);\n\t\tthis.updateGCNodes(gcDataBuilder);\n\n\t\treturn gcDataBuilder.getGCData();\n\t}\n\n\t/**\n\t * Helper method for preparing to summarize this channel.\n\t * Runs the callback for each bound context to incorporate its data however the caller specifies\n\t */\n\tprivate async visitContextsDuringSummary(\n\t\tvisitor: (contextId: string, context: IChannelContext) => Promise<void>,\n\t): Promise<void> {\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tconst isAttached = this.isChannelAttached(contextId);\n\t\t\t// We are not expecting local dds! Summary / GC data may not capture local state.\n\t\t\tassert(isAttached, 0x17f /* \"Not expecting detached channels during summarize\" */);\n\t\t\tawait visitor(contextId, context);\n\t\t}\n\t}\n\n\t/**\n\t * Helper method for preparing to attach this dataStore.\n\t * Runs the callback for each bound context to incorporate its data however the caller specifies\n\t */\n\tprivate visitLocalBoundContextsDuringAttach(\n\t\tvisitor: (contextId: string, context: LocalChannelContextBase) => void,\n\t): void {\n\t\tassert(\n\t\t\tthis.visibilityState === VisibilityState.LocallyVisible,\n\t\t\t0xc2c /* The data store should be locally visible when generating attach summary */,\n\t\t);\n\n\t\tconst visitedContexts = new Set<string>();\n\t\tlet visitedLength = -1;\n\t\twhile (visitedLength !== visitedContexts.size) {\n\t\t\t// detect changes in the visitedContexts set, as on visiting a context\n\t\t\t// it could could make contexts available by removing other contexts\n\t\t\t// from the notBoundedChannelContextSet, so we need to ensure those get processed as well.\n\t\t\t// only once the loop can run with no new contexts added to the visitedContexts set do we\n\t\t\t// know for sure all possible contexts have been visited.\n\t\t\tvisitedLength = visitedContexts.size;\n\t\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\t\tif (!(context instanceof LocalChannelContextBase)) {\n\t\t\t\t\tthrow new LoggingError(\"Should only be called with local channel handles\");\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!visitedContexts.has(contextId) &&\n\t\t\t\t\t!this.notBoundedChannelContextSet.has(contextId)\n\t\t\t\t) {\n\t\t\t\t\tvisitor(contextId, context);\n\t\t\t\t\tvisitedContexts.add(contextId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Submits the signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal. Should be a JSON serializable object or primitive.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\tpublic submitSignal(type: string, content: unknown, targetClientId?: string): void {\n\t\tthis.verifyNotClosed();\n\t\tthis.dataStoreContext.submitSignal(type, content, targetClientId);\n\t}\n\n\t/**\n\t * Will return when the data store is attached.\n\t */\n\tpublic async waitAttached(): Promise<void> {\n\t\treturn this.deferredAttached.promise;\n\t}\n\n\t/**\n\t * Assuming this DataStore is already attached, this will make the given channel locally visible\n\t * by submitting its attach op.\n\t */\n\tprivate makeChannelLocallyVisible(channel: IChannel): void {\n\t\tthis.verifyNotClosed();\n\t\t// If this handle is already attached no need to attach again.\n\t\tif (channel.handle.isAttached) {\n\t\t\treturn;\n\t\t}\n\n\t\ttoFluidHandleInternal(channel.handle).attachGraph();\n\n\t\tassert(\n\t\t\tthis.isAttached,\n\t\t\t0x182 /* \"Data store should be attached to attach the channel.\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.visibilityState === VisibilityState.GloballyVisible,\n\t\t\t0x2d0 /* \"Data store should be globally visible to attach channels.\" */,\n\t\t);\n\n\t\tconst summarizeResult = summarizeChannel(\n\t\t\tchannel,\n\t\t\ttrue /* fullTree */,\n\t\t\tfalse /* trackState */,\n\t\t);\n\n\t\t// We need to include the channel's GC Data so remote clients can learn of this channel's outbound routes\n\t\tconst gcData = channel.getGCData(/* fullGC: */ true);\n\t\taddBlobToSummary(summarizeResult, gcDataBlobKey, JSON.stringify(gcData));\n\n\t\t// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.\n\t\tconst snapshot = convertSummaryTreeToITree(summarizeResult.summary);\n\n\t\tconst message: IAttachMessage = {\n\t\t\tid: channel.id,\n\t\t\tsnapshot,\n\t\t\ttype: channel.attributes.type,\n\t\t};\n\t\tthis.pendingAttach.add(channel.id);\n\t\tthis.submit({ type: DataStoreMessageType.Attach, content: message });\n\n\t\tconst context = this.contexts.get(channel.id) as LocalChannelContextBase;\n\t\tcontext.makeVisible();\n\t}\n\n\tprivate submitChannelOp(address: string, contents: unknown, localOpMetadata: unknown): void {\n\t\tconst envelope: IEnvelope = { address, contents };\n\t\tthis.verifyNotClosed();\n\t\tthis.submit({ type: DataStoreMessageType.ChannelOp, content: envelope }, localOpMetadata);\n\t}\n\n\t/**\n\t * Count of pending ops that have been submitted but not yet ack'd.\n\t * Used to compute {@link FluidDataStoreRuntime.isDirty}\n\t */\n\tprivate readonly pendingOpCount: { value: number } = initializePendingOpCount();\n\n\tprivate submit(\n\t\tmessage: LocalFluidDataStoreRuntimeMessage,\n\t\tlocalOpMetadata: unknown = undefined,\n\t): void {\n\t\tthis.dataStoreContext.submitMessage(message.type, message.content, localOpMetadata);\n\t\t++this.pendingOpCount.value;\n\t}\n\n\t/**\n\t * For messages of type MessageType.Operation, finds the right channel and asks it to resubmit the message.\n\t * For all other messages, just submit it again.\n\t * This typically happens when we reconnect and there are unacked messages.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t *\n\t * @privateRemarks\n\t * `type` parameter's type of `DataStoreMessageType` is a covariance exception\n\t * over `string` that `IFluidDataStoreChannel` specifies. So long as local\n\t * submissions conform to this type all is well. (`unreachableCase` might be\n\t * reachable over time without better typing in this area if a mistake is made.)\n\t * See {@link @fluidframework/runtime-definitions#FluidDataStoreMessage} comment\n\t * for opportunity to resolve this.\n\t */\n\tpublic reSubmit(\n\t\ttype: DataStoreMessageType,\n\t\t// TODO: use something other than `any` here (breaking change)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tcontent: any,\n\t\tlocalOpMetadata: unknown,\n\t\tsquash: boolean,\n\t): void {\n\t\tthis.verifyNotClosed();\n\n\t\t// The op being resubmitted was not / will not be submitted, so decrement the count.\n\t\t// The calls below may result in one or more ops submitted again, which will increment the count (or not if nothing needs to be submitted anymore).\n\t\t--this.pendingOpCount.value;\n\n\t\tswitch (type) {\n\t\t\tcase DataStoreMessageType.ChannelOp: {\n\t\t\t\t// For Operations, find the right channel and trigger resubmission on it.\n\t\t\t\tconst envelope = content as IEnvelope;\n\t\t\t\tconst channelContext = this.contexts.get(envelope.address);\n\t\t\t\tassert(!!channelContext, 0x183 /* \"There should be a channel context for the op\" */);\n\n\t\t\t\tchannelContext.reSubmit(envelope.contents, localOpMetadata, squash);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DataStoreMessageType.Attach: {\n\t\t\t\t// For Attach messages, just submit them again.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- `content` needs typed better than `any`\n\t\t\t\tthis.submit({ type, content }, localOpMetadata);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Revert a local op.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t *\n\t * @privateRemarks\n\t * `type` parameter's type of `DataStoreMessageType` is a covariance exception\n\t * over `string` that `IFluidDataStoreChannel` specifies. So long as local\n\t * submissions conform to this type all is well. (`unreachableCase` might be\n\t * reachable over time without better typing in this area if a mistake is made.)\n\t * See {@link @fluidframework/runtime-definitions#FluidDataStoreMessage} comment\n\t * for opportunity to resolve this.\n\t */\n\tpublic rollback?(\n\t\ttype: DataStoreMessageType,\n\t\t// TODO: use something other than `any` here (breaking change)\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\t\tcontent: any,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tthis.verifyNotClosed();\n\t\tassert(\n\t\t\t!this.localOpActivity,\n\t\t\t0xca2 /* localOpActivity must be undefined when entering rollback */,\n\t\t);\n\t\tthis.localOpActivity = \"rollback\";\n\t\ttry {\n\t\t\t// The op being rolled back was not/will not be submitted, so decrement the count.\n\t\t\t--this.pendingOpCount.value;\n\n\t\t\tswitch (type) {\n\t\t\t\tcase DataStoreMessageType.ChannelOp: {\n\t\t\t\t\t// For Operations, find the right channel and trigger resubmission on it.\n\t\t\t\t\tconst envelope = content as IEnvelope;\n\t\t\t\t\tconst channelContext = this.contexts.get(envelope.address);\n\t\t\t\t\tassert(!!channelContext, 0x2ed /* \"There should be a channel context for the op\" */);\n\n\t\t\t\t\tchannelContext.rollback(envelope.contents, localOpMetadata);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new LoggingError(`Can't rollback ${type} message`);\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.localOpActivity = undefined;\n\t\t}\n\t}\n\n\t// TODO: use something other than `any` here\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\tpublic async applyStashedOp(content: any): Promise<unknown> {\n\t\tassert(\n\t\t\t!this.localOpActivity,\n\t\t\t0xca3 /* localOpActivity must be undefined when entering applyStashedOp */,\n\t\t);\n\t\tthis.localOpActivity = \"applyStashed\";\n\t\ttry {\n\t\t\t// The op being applied may have been submitted in a previous session, so we increment the count here.\n\t\t\t// Either the ack will arrive and be processed, or that previous session's connection will end, at which point the op will be resubmitted.\n\t\t\t++this.pendingOpCount.value;\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\tconst type = content?.type as DataStoreMessageType;\n\t\t\tswitch (type) {\n\t\t\t\tcase DataStoreMessageType.Attach: {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\t\tconst attachMessage = content.content as IAttachMessage;\n\n\t\t\t\t\tconst flatBlobs = new Map<string, ArrayBufferLike>();\n\t\t\t\t\tconst snapshotTree = buildSnapshotTree(attachMessage.snapshot.entries, flatBlobs);\n\n\t\t\t\t\tconst channelContext = this.createRehydratedLocalChannelContext(\n\t\t\t\t\t\tattachMessage.id,\n\t\t\t\t\t\tsnapshotTree,\n\t\t\t\t\t\tflatBlobs,\n\t\t\t\t\t);\n\t\t\t\t\tawait channelContext.getChannel();\n\t\t\t\t\tthis.contexts.set(attachMessage.id, channelContext);\n\t\t\t\t\tif (this.attachState === AttachState.Detached) {\n\t\t\t\t\t\tthis.localChannelContextQueue.set(attachMessage.id, channelContext);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchannelContext.makeVisible();\n\t\t\t\t\t\tthis.pendingAttach.add(attachMessage.id);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcase DataStoreMessageType.ChannelOp: {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\t\tconst envelope = content.content as IEnvelope;\n\t\t\t\t\tconst channelContext = this.contexts.get(envelope.address);\n\t\t\t\t\tassert(!!channelContext, 0x184 /* \"There should be a channel context for the op\" */);\n\t\t\t\t\tawait channelContext.getChannel();\n\t\t\t\t\treturn channelContext.applyStashedOp(envelope.contents);\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tunreachableCase(type);\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.localOpActivity = undefined;\n\t\t}\n\t}\n\n\t/**\n\t * Indicates the given channel is dirty from Summarizer's point of view,\n\t * i.e. it has local changes that need to be included in the summary.\n\t *\n\t * @remarks If a channel's changes are rolled back or rebased away, we won't\n\t * clear the dirty flag set here.\n\t */\n\tprivate setChannelDirty(address: string): void {\n\t\tthis.verifyNotClosed();\n\t\tthis.dataStoreContext.setChannelDirty(address);\n\t}\n\n\tprivate attachListener(): void {\n\t\tthis.setMaxListeners(Number.MAX_SAFE_INTEGER);\n\n\t\t// back-compat, to be removed in the future.\n\t\t// Added in \"2.0.0-rc.2.0.0\" timeframe.\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any\n\t\t(this.dataStoreContext as any).once?.(\"attaching\", () => {\n\t\t\tthis.setAttachState(AttachState.Attaching);\n\t\t});\n\n\t\t// back-compat, to be removed in the future.\n\t\t// Added in \"2.0.0-rc.2.0.0\" timeframe.\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any\n\t\t(this.dataStoreContext as any).once?.(\"attached\", () => {\n\t\t\tthis.setAttachState(AttachState.Attached);\n\t\t});\n\t}\n\n\tprivate verifyNotClosed(): void {\n\t\tif (this._disposed) {\n\t\t\tthrow new LoggingError(\"Runtime is closed\");\n\t\t}\n\t}\n\n\t/**\n\t * Summarizer client should not have local changes. These changes can become part of the summary and can break\n\t * eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas\n\t * other clients that are up-to-date till seq# 100 may not have them yet.\n\t */\n\tprivate identifyLocalChangeInSummarizer(\n\t\teventName: string,\n\t\tchannelId: string,\n\t\tchannelType: string,\n\t): void {\n\t\tif (this.clientDetails.type !== \"summarizer\" || this.localChangesTelemetryCount <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Log a telemetry if there are local changes in the summarizer. This will give us data on how often\n\t\t// this is happening and which data stores do this. The eventual goal is to disallow local changes\n\t\t// in the summarizer and the data will help us plan this.\n\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\teventName,\n\t\t\t...tagCodeArtifacts({\n\t\t\t\tchannelType,\n\t\t\t\tchannelId,\n\t\t\t\tfluidDataStoreId: this.id,\n\t\t\t\tfluidDataStorePackagePath: this.dataStoreContext.packagePath.join(\"/\"),\n\t\t\t}),\n\t\t\tstack: generateStack(30),\n\t\t});\n\t\tthis.localChangesTelemetryCount--;\n\t}\n\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {\n\t\tswitch (attachState) {\n\t\t\tcase AttachState.Attaching: {\n\t\t\t\t/**\n\t\t\t\t * back-compat 0.59.1000 - Ideally, attachGraph() should have already been called making the data store\n\t\t\t\t * locally visible. However, before visibility state was added, this may not have been the case and data\n\t\t\t\t * store can move to \"attaching\" state in 2 scenarios:\n\t\t\t\t * 1) Before attachGraph() is called - When a data store is created and bound in an attached container.\n\t\t\t\t * 2) After attachGraph() is called - When a detached container is attached.\n\t\t\t\t *\n\t\t\t\t * The basic idea is that all local object should become locally visible before they are globally visible.\n\t\t\t\t */\n\t\t\t\tthis.attachGraph();\n\n\t\t\t\tthis._attachState = AttachState.Attaching;\n\n\t\t\t\tassert(\n\t\t\t\t\tthis.visibilityState === VisibilityState.LocallyVisible,\n\t\t\t\t\t0x2d1 /* \"Data store should be locally visible before it can become globally visible.\" */,\n\t\t\t\t);\n\n\t\t\t\t// Mark the data store globally visible and make its child channels visible as well.\n\t\t\t\tthis.visibilityState = VisibilityState.GloballyVisible;\n\t\t\t\tfor (const [, channel] of this.localChannelContextQueue) {\n\t\t\t\t\tchannel.makeVisible();\n\t\t\t\t}\n\t\t\t\tthis.localChannelContextQueue.clear();\n\n\t\t\t\t// This promise resolution will be moved to attached event once we fix the scheduler.\n\t\t\t\tthis.deferredAttached.resolve();\n\t\t\t\tthis.emit(\"attaching\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase AttachState.Attached: {\n\t\t\t\tassert(\n\t\t\t\t\tthis.visibilityState === VisibilityState.GloballyVisible,\n\t\t\t\t\t0x2d2 /* \"Data store should be globally visible when its attached.\" */,\n\t\t\t\t);\n\t\t\t\tthis._attachState = AttachState.Attached;\n\t\t\t\tthis.emit(\"attached\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(attachState, \"unreached\");\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Mixin class that adds request handler to FluidDataStoreRuntime\n * Request handler is only called when data store can't resolve request, i.e. for custom requests.\n * @param Base - base class, inherits from FluidDataStoreRuntime\n * @param requestHandler - request handler to mix in\n * @legacy @beta\n */\nexport const mixinRequestHandler = (\n\trequestHandler: (request: IRequest, runtime: FluidDataStoreRuntime) => Promise<IResponse>,\n\tBase: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n): typeof FluidDataStoreRuntime =>\n\tclass RuntimeWithRequestHandler extends Base {\n\t\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\t\tconst response = await super.request(request);\n\t\t\tif (response.status === 404) {\n\t\t\t\treturn requestHandler(request, this);\n\t\t\t}\n\t\t\treturn response;\n\t\t}\n\t} as typeof FluidDataStoreRuntime;\n\n/**\n * Mixin class that adds await for DataObject to finish initialization before we proceed to summary.\n * @param handler - handler that returns info about blob to be added to summary.\n * Or undefined not to add anything to summary.\n * @param Base - base class, inherits from FluidDataStoreRuntime\n * @legacy @beta\n */\nexport const mixinSummaryHandler = (\n\thandler: (\n\t\truntime: FluidDataStoreRuntime,\n\t\tsetCurrentSummarizeStep: (currentStep: string) => void,\n\t) => Promise<{ path: string[]; content: string } | undefined>,\n\tBase: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n): typeof FluidDataStoreRuntime =>\n\tclass RuntimeWithSummarizerHandler extends Base {\n\t\tprivate addBlob(summary: ISummaryTreeWithStats, path: string[], content: string): void {\n\t\t\tconst firstName = path.shift();\n\t\t\tif (firstName === undefined) {\n\t\t\t\tthrow new LoggingError(\"Path can't be empty\");\n\t\t\t}\n\n\t\t\tlet blob: ISummaryTree | ISummaryBlob = {\n\t\t\t\ttype: SummaryType.Blob,\n\t\t\t\tcontent,\n\t\t\t};\n\t\t\tsummary.stats.blobNodeCount++;\n\t\t\tsummary.stats.totalBlobSize += content.length;\n\n\t\t\tfor (const name of path.reverse()) {\n\t\t\t\tblob = {\n\t\t\t\t\ttype: SummaryType.Tree,\n\t\t\t\t\ttree: { [name]: blob },\n\t\t\t\t};\n\t\t\t\tsummary.stats.treeNodeCount++;\n\t\t\t}\n\t\t\tsummary.summary.tree[firstName] = blob;\n\t\t}\n\n\t\tasync summarize(\n\t\t\tfullTree: boolean = false,\n\t\t\ttrackState: boolean = true,\n\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t): Promise<ISummaryTreeWithStats> {\n\t\t\tconst summary = await super.summarize(fullTree, trackState, telemetryContext);\n\n\t\t\ttry {\n\t\t\t\tconst content = await handler(this, (currentStep: string) =>\n\t\t\t\t\ttelemetryContext?.set(\n\t\t\t\t\t\tcurrentSummarizeStepPrefix,\n\t\t\t\t\t\tcurrentSummarizeStepPropertyName,\n\t\t\t\t\t\t`mixinSummaryHandler:${currentStep}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tif (content !== undefined) {\n\t\t\t\t\tthis.addBlob(summary, content.path, content.content);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t// Any error coming from app-provided handler should be marked as DataProcessingError\n\t\t\t\tthrow DataProcessingError.wrapIfUnrecognized(error, \"mixinSummaryHandler\");\n\t\t\t}\n\n\t\t\treturn summary;\n\t\t}\n\t} as typeof FluidDataStoreRuntime;\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/datastore";
8
- export declare const pkgVersion = "2.74.0";
8
+ export declare const pkgVersion = "2.80.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/datastore";
8
- export const pkgVersion = "2.74.0";
8
+ export const pkgVersion = "2.80.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -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,QAAQ,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.74.0\";\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,QAAQ,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.80.0\";\n"]}