@fluidframework/container-loader 2.53.1 → 2.61.0-355054
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.cjs +1 -2
- package/CHANGELOG.md +4 -0
- package/api-report/{container-loader.legacy.alpha.api.md → container-loader.legacy.beta.api.md} +24 -24
- package/dist/attachment.d.ts +3 -3
- package/dist/attachment.d.ts.map +1 -1
- package/dist/attachment.js.map +1 -1
- package/dist/audience.d.ts +3 -3
- package/dist/audience.d.ts.map +1 -1
- package/dist/audience.js.map +1 -1
- package/dist/catchUpMonitor.d.ts +2 -2
- package/dist/catchUpMonitor.d.ts.map +1 -1
- package/dist/catchUpMonitor.js.map +1 -1
- package/dist/connectionManager.d.ts +7 -7
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +7 -7
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +7 -8
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +1 -2
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +7 -7
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +5 -5
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts +5 -5
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/createAndLoadContainerUtils.d.ts +12 -19
- package/dist/createAndLoadContainerUtils.d.ts.map +1 -1
- package/dist/createAndLoadContainerUtils.js +3 -6
- package/dist/createAndLoadContainerUtils.js.map +1 -1
- package/dist/debugLogger.d.ts +2 -2
- package/dist/debugLogger.d.ts.map +1 -1
- package/dist/debugLogger.js.map +1 -1
- package/dist/deltaManager.d.ts +8 -8
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js.map +1 -1
- package/dist/deltaQueue.d.ts +1 -1
- package/dist/deltaQueue.d.ts.map +1 -1
- package/dist/deltaQueue.js.map +1 -1
- package/dist/disposal.d.ts +1 -1
- package/dist/disposal.d.ts.map +1 -1
- package/dist/disposal.js.map +1 -1
- package/dist/error.d.ts +2 -2
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +4 -2
- package/dist/loadPaused.d.ts +2 -2
- package/dist/loadPaused.d.ts.map +1 -1
- package/dist/loadPaused.js.map +1 -1
- package/dist/loader.d.ts +11 -16
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +1 -2
- package/dist/loader.js.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts +3 -3
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/dist/noopHeuristic.d.ts +2 -2
- package/dist/noopHeuristic.d.ts.map +1 -1
- package/dist/noopHeuristic.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/protocol/index.d.ts +2 -2
- package/dist/protocol/index.d.ts.map +1 -1
- package/dist/protocol/index.js.map +1 -1
- package/dist/protocol/protocol.d.ts +5 -7
- package/dist/protocol/protocol.d.ts.map +1 -1
- package/dist/protocol/protocol.js.map +1 -1
- package/dist/protocol/quorum.d.ts +5 -8
- package/dist/protocol/quorum.d.ts.map +1 -1
- package/dist/protocol/quorum.js.map +1 -1
- package/dist/protocol.d.ts +5 -7
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/protocolTreeDocumentStorageService.d.ts +3 -3
- package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- package/dist/public.d.ts +2 -1
- package/dist/quorum.d.ts +2 -2
- package/dist/quorum.d.ts.map +1 -1
- package/dist/quorum.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts +4 -4
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/dist/serializedStateManager.d.ts +4 -4
- package/dist/serializedStateManager.d.ts.map +1 -1
- package/dist/serializedStateManager.js.map +1 -1
- package/dist/utils.d.ts +6 -9
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -2
- package/dist/utils.js.map +1 -1
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/attachment.d.ts +3 -3
- package/lib/attachment.d.ts.map +1 -1
- package/lib/attachment.js.map +1 -1
- package/lib/audience.d.ts +3 -3
- package/lib/audience.d.ts.map +1 -1
- package/lib/audience.js.map +1 -1
- package/lib/catchUpMonitor.d.ts +2 -2
- package/lib/catchUpMonitor.d.ts.map +1 -1
- package/lib/catchUpMonitor.js.map +1 -1
- package/lib/connectionManager.d.ts +7 -7
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +7 -7
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +7 -8
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +1 -2
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +7 -7
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +5 -5
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts +5 -5
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/createAndLoadContainerUtils.d.ts +12 -19
- package/lib/createAndLoadContainerUtils.d.ts.map +1 -1
- package/lib/createAndLoadContainerUtils.js +3 -6
- package/lib/createAndLoadContainerUtils.js.map +1 -1
- package/lib/debugLogger.d.ts +2 -2
- package/lib/debugLogger.d.ts.map +1 -1
- package/lib/debugLogger.js.map +1 -1
- package/lib/deltaManager.d.ts +8 -8
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js.map +1 -1
- package/lib/deltaQueue.d.ts +1 -1
- package/lib/deltaQueue.d.ts.map +1 -1
- package/lib/deltaQueue.js.map +1 -1
- package/lib/disposal.d.ts +1 -1
- package/lib/disposal.d.ts.map +1 -1
- package/lib/disposal.js.map +1 -1
- package/lib/error.d.ts +2 -2
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/index.d.ts +6 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +4 -2
- package/lib/loadPaused.d.ts +2 -2
- package/lib/loadPaused.d.ts.map +1 -1
- package/lib/loadPaused.js.map +1 -1
- package/lib/loader.d.ts +11 -16
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +1 -2
- package/lib/loader.js.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts +3 -3
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/lib/noopHeuristic.d.ts +2 -2
- package/lib/noopHeuristic.d.ts.map +1 -1
- package/lib/noopHeuristic.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/protocol/index.d.ts +2 -2
- package/lib/protocol/index.d.ts.map +1 -1
- package/lib/protocol/index.js.map +1 -1
- package/lib/protocol/protocol.d.ts +5 -7
- package/lib/protocol/protocol.d.ts.map +1 -1
- package/lib/protocol/protocol.js.map +1 -1
- package/lib/protocol/quorum.d.ts +5 -8
- package/lib/protocol/quorum.d.ts.map +1 -1
- package/lib/protocol/quorum.js.map +1 -1
- package/lib/protocol.d.ts +5 -7
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +1 -1
- package/lib/protocol.js.map +1 -1
- package/lib/protocolTreeDocumentStorageService.d.ts +3 -3
- package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- package/lib/public.d.ts +2 -1
- package/lib/quorum.d.ts +2 -2
- package/lib/quorum.d.ts.map +1 -1
- package/lib/quorum.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts +4 -4
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/lib/serializedStateManager.d.ts +4 -4
- package/lib/serializedStateManager.d.ts.map +1 -1
- package/lib/serializedStateManager.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/utils.d.ts +6 -9
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -2
- package/lib/utils.js.map +1 -1
- package/package.json +21 -21
- package/src/attachment.ts +3 -3
- package/src/audience.ts +3 -3
- package/src/catchUpMonitor.ts +3 -3
- package/src/connectionManager.ts +30 -23
- package/src/connectionStateHandler.ts +9 -9
- package/src/container.ts +44 -45
- package/src/containerContext.ts +8 -8
- package/src/containerStorageAdapter.ts +6 -6
- package/src/contracts.ts +8 -8
- package/src/createAndLoadContainerUtils.ts +13 -20
- package/src/debugLogger.ts +3 -3
- package/src/deltaManager.ts +15 -15
- package/src/deltaQueue.ts +1 -1
- package/src/disposal.ts +1 -1
- package/src/error.ts +4 -4
- package/src/index.ts +12 -12
- package/src/loadPaused.ts +2 -3
- package/src/loader.ts +18 -23
- package/src/location-redirection-utilities/resolveWithLocationRedirection.ts +4 -4
- package/src/noopHeuristic.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/protocol/index.ts +5 -5
- package/src/protocol/protocol.ts +13 -15
- package/src/protocol/quorum.ts +5 -8
- package/src/protocol.ts +13 -11
- package/src/protocolTreeDocumentStorageService.ts +4 -4
- package/src/quorum.ts +2 -2
- package/src/retriableDocumentStorageService.ts +4 -4
- package/src/serializedStateManager.ts +9 -9
- package/src/utils.ts +9 -13
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { ILayerCompatDetails, IProvideLayerCompatDetails } from "@fluid-internal/client-utils";
|
|
6
|
-
import { AttachState, IAudience, ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
7
|
-
import { IBatchMessage, IContainerContext, ILoader, ILoaderOptions, IDeltaManager,
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { IClientDetails, IQuorumClients } from "@fluidframework/driver-definitions";
|
|
11
|
-
import { ISnapshot, IDocumentMessage, ISnapshotTree, ISummaryContent, IVersion, MessageType, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
12
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
6
|
+
import type { AttachState, IAudience, ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
7
|
+
import type { IBatchMessage, IContainerContext, ILoader, ILoaderOptions, IDeltaManager, IContainerStorageService } from "@fluidframework/container-definitions/internal";
|
|
8
|
+
import type { FluidObject } from "@fluidframework/core-interfaces";
|
|
9
|
+
import type { ISignalEnvelope } from "@fluidframework/core-interfaces/internal";
|
|
10
|
+
import type { IClientDetails, IQuorumClients } from "@fluidframework/driver-definitions";
|
|
11
|
+
import type { ISnapshot, IDocumentMessage, ISnapshotTree, ISummaryContent, IVersion, MessageType, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
12
|
+
import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
13
13
|
import type { ConnectionState } from "./connectionState.js";
|
|
14
14
|
/**
|
|
15
15
|
* Configuration object for ContainerContext constructor.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerContext.d.ts","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,0BAA0B,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"containerContext.d.ts","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,0BAA0B,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EACX,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,KAAK,EACX,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAA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\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tIProvideLayerCompatDetails,\n} from \"@fluid-internal/client-utils\";\nimport {\n\tAttachState,\n\tIAudience,\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nimport {\n\tIBatchMessage,\n\tIContainerContext,\n\tILoader,\n\tILoaderOptions,\n\tIDeltaManager,\n\ttype IContainerStorageService,\n} from \"@fluidframework/container-definitions/internal\";\nimport { type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { type ISignalEnvelope } from \"@fluidframework/core-interfaces/internal\";\nimport { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport {\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISummaryContent,\n\tIVersion,\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { ConnectionState } from \"./connectionState.js\";\nimport { loaderCompatDetailsForRuntime } from \"./loaderLayerCompatState.js\";\n\n/**\n * Configuration object for ContainerContext constructor.\n */\nexport interface IContainerContextConfig {\n\treadonly options: ILoaderOptions;\n\treadonly scope: FluidObject;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly version: IVersion | undefined;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly storage: IContainerStorageService;\n\treadonly quorum: IQuorumClients;\n\treadonly audience: IAudience;\n\treadonly loader: ILoader;\n\treadonly submitFn: (\n\t\ttype: MessageType,\n\t\tcontents: unknown,\n\t\tbatch: boolean,\n\t\tappData: unknown,\n\t) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSignalFn: (\n\t\tcontent: unknown | ISignalEnvelope,\n\t\ttargetClientId?: string,\n\t) => void;\n\treadonly disposeFn: (error?: ICriticalContainerError) => void;\n\treadonly closeFn: (error?: ICriticalContainerError) => void;\n\treadonly updateDirtyContainerState: (dirty: boolean) => void;\n\treadonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;\n\treadonly getContainerDiagnosticId: () => string | undefined;\n\treadonly getClientId: () => string | undefined;\n\treadonly getAttachState: () => AttachState;\n\treadonly getConnected: () => boolean;\n\treadonly getConnectionState: () => ConnectionState;\n\treadonly clientDetails: IClientDetails;\n\treadonly existing: boolean;\n\treadonly taggedLogger: ITelemetryLoggerExt;\n\treadonly pendingLocalState?: unknown;\n\treadonly snapshotWithContents?: ISnapshot;\n}\n\n/**\n * {@inheritDoc @fluidframework/container-definitions#IContainerContext}\n */\nexport class ContainerContext implements IContainerContext, IProvideLayerCompatDetails {\n\t/**\n\t * @deprecated - This has been replaced by ILayerCompatDetails.\n\t */\n\tpublic readonly supportedFeatures: ReadonlyMap<string, unknown> = new Map([\n\t\t/**\n\t\t * This version of the loader accepts `referenceSequenceNumber`, provided by the container runtime,\n\t\t * as a parameter to the `submitBatchFn` and `submitSummaryFn` functions.\n\t\t * This is then used to set the reference sequence numbers of the submitted ops in the DeltaManager.\n\t\t */\n\t\t[\"referenceSequenceNumbers\", true],\n\t]);\n\n\tpublic readonly options: ILoaderOptions;\n\tpublic readonly scope: FluidObject;\n\tpublic readonly baseSnapshot: ISnapshotTree | undefined;\n\tpublic readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\tpublic readonly storage: IContainerStorageService;\n\tpublic readonly quorum: IQuorumClients;\n\tpublic readonly audience: IAudience;\n\tpublic readonly loader: ILoader;\n\tpublic readonly submitFn: (\n\t\ttype: MessageType,\n\t\tcontents: unknown,\n\t\tbatch: boolean,\n\t\tappData: unknown,\n\t) => number;\n\tpublic readonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t/**\n\t * @returns clientSequenceNumber of last message in a batch\n\t */\n\tpublic readonly submitBatchFn: (\n\t\tbatch: IBatchMessage[],\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t/**\n\t * `unknown` should be removed once `@alpha` tag is removed from IContainerContext\n\t * @see {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}\n\t * Any changes to submitSignalFn `content` should be checked internally by temporarily changing IContainerContext and removing all `unknown`s\n\t */\n\tpublic readonly submitSignalFn: (\n\t\tcontent: unknown | ISignalEnvelope,\n\t\ttargetClientId?: string,\n\t) => void;\n\tpublic readonly disposeFn: (error?: ICriticalContainerError) => void;\n\tpublic readonly closeFn: (error?: ICriticalContainerError) => void;\n\tpublic readonly updateDirtyContainerState: (dirty: boolean) => void;\n\tpublic readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;\n\tpublic readonly clientDetails: IClientDetails;\n\tpublic readonly existing: boolean;\n\tpublic readonly taggedLogger: ITelemetryLoggerExt;\n\tpublic readonly pendingLocalState: unknown;\n\tpublic readonly snapshotWithContents: ISnapshot | undefined;\n\n\tpublic readonly getConnectionState: () => ConnectionState;\n\n\tprivate readonly _getClientId: () => string | undefined;\n\tprivate readonly _getContainerDiagnosticId: () => string | undefined;\n\tprivate readonly _getConnected: () => boolean;\n\tprivate readonly _getAttachState: () => AttachState;\n\tprivate readonly version: IVersion | undefined;\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this._getClientId();\n\t}\n\n\t/**\n\t * DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.\n\t */\n\tpublic get id(): string {\n\t\treturn this._getContainerDiagnosticId() ?? \"\";\n\t}\n\n\t/**\n\t * When true, ops are free to flow\n\t * When false, ops should be kept as pending or rejected\n\t */\n\tpublic get connected(): boolean {\n\t\treturn this._getConnected();\n\t}\n\n\t/**\n\t * The compatibility details of the Loader layer that is exposed to the Runtime layer\n\t * for validating Runtime-Loader compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails {\n\t\treturn loaderCompatDetailsForRuntime;\n\t}\n\n\tconstructor(config: IContainerContextConfig) {\n\t\tthis.options = config.options;\n\t\tthis.scope = config.scope;\n\t\tthis.baseSnapshot = config.baseSnapshot;\n\t\tthis.deltaManager = config.deltaManager;\n\t\tthis.storage = config.storage;\n\t\tthis.quorum = config.quorum;\n\t\tthis.audience = config.audience;\n\t\tthis.loader = config.loader;\n\t\tthis.submitFn = config.submitFn;\n\t\tthis.submitSummaryFn = config.submitSummaryFn;\n\t\tthis.submitBatchFn = config.submitBatchFn;\n\t\tthis.submitSignalFn = config.submitSignalFn;\n\t\tthis.disposeFn = config.disposeFn;\n\t\tthis.closeFn = config.closeFn;\n\t\tthis.updateDirtyContainerState = config.updateDirtyContainerState;\n\t\tthis.getAbsoluteUrl = config.getAbsoluteUrl;\n\t\tthis.clientDetails = config.clientDetails;\n\t\tthis.existing = config.existing;\n\t\tthis.taggedLogger = config.taggedLogger;\n\t\tthis.pendingLocalState = config.pendingLocalState;\n\t\tthis.snapshotWithContents = config.snapshotWithContents;\n\n\t\tthis.getConnectionState = config.getConnectionState;\n\t\tthis._getClientId = config.getClientId;\n\t\tthis._getContainerDiagnosticId = config.getContainerDiagnosticId;\n\t\tthis._getConnected = config.getConnected;\n\t\tthis._getAttachState = config.getAttachState;\n\t\tthis.version = config.version;\n\t}\n\n\tpublic getLoadedFromVersion(): IVersion | undefined {\n\t\treturn this.version;\n\t}\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._getAttachState();\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"containerContext.js","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAkCH,2EAA4E;AA8C5E;;GAEG;AACH,MAAa,gBAAgB;IAiE5B,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,EA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GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAClD,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC,oBAAoB,CAAC;QAExD,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,yBAAyB,GAAG,MAAM,CAAC,wBAAwB,CAAC;QACjE,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC/B,CAAC;IAEM,oBAAoB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACD;AAlID,4CAkIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tIProvideLayerCompatDetails,\n} from \"@fluid-internal/client-utils\";\nimport type {\n\tAttachState,\n\tIAudience,\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nimport type {\n\tIBatchMessage,\n\tIContainerContext,\n\tILoader,\n\tILoaderOptions,\n\tIDeltaManager,\n\tIContainerStorageService,\n} from \"@fluidframework/container-definitions/internal\";\nimport type { FluidObject } from \"@fluidframework/core-interfaces\";\nimport type { ISignalEnvelope } from \"@fluidframework/core-interfaces/internal\";\nimport type { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type {\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISummaryContent,\n\tIVersion,\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { ConnectionState } from \"./connectionState.js\";\nimport { loaderCompatDetailsForRuntime } from \"./loaderLayerCompatState.js\";\n\n/**\n * Configuration object for ContainerContext constructor.\n */\nexport interface IContainerContextConfig {\n\treadonly options: ILoaderOptions;\n\treadonly scope: FluidObject;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly version: IVersion | undefined;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly storage: IContainerStorageService;\n\treadonly quorum: IQuorumClients;\n\treadonly audience: IAudience;\n\treadonly loader: ILoader;\n\treadonly submitFn: (\n\t\ttype: MessageType,\n\t\tcontents: unknown,\n\t\tbatch: boolean,\n\t\tappData: unknown,\n\t) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSignalFn: (\n\t\tcontent: unknown | ISignalEnvelope,\n\t\ttargetClientId?: string,\n\t) => void;\n\treadonly disposeFn: (error?: ICriticalContainerError) => void;\n\treadonly closeFn: (error?: ICriticalContainerError) => void;\n\treadonly updateDirtyContainerState: (dirty: boolean) => void;\n\treadonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;\n\treadonly getContainerDiagnosticId: () => string | undefined;\n\treadonly getClientId: () => string | undefined;\n\treadonly getAttachState: () => AttachState;\n\treadonly getConnected: () => boolean;\n\treadonly getConnectionState: () => ConnectionState;\n\treadonly clientDetails: IClientDetails;\n\treadonly existing: boolean;\n\treadonly taggedLogger: ITelemetryLoggerExt;\n\treadonly pendingLocalState?: unknown;\n\treadonly snapshotWithContents?: ISnapshot;\n}\n\n/**\n * {@inheritDoc @fluidframework/container-definitions#IContainerContext}\n */\nexport class ContainerContext implements IContainerContext, IProvideLayerCompatDetails {\n\t/**\n\t * @deprecated - This has been replaced by ILayerCompatDetails.\n\t */\n\tpublic readonly supportedFeatures: ReadonlyMap<string, unknown> = new Map([\n\t\t/**\n\t\t * This version of the loader accepts `referenceSequenceNumber`, provided by the container runtime,\n\t\t * as a parameter to the `submitBatchFn` and `submitSummaryFn` functions.\n\t\t * This is then used to set the reference sequence numbers of the submitted ops in the DeltaManager.\n\t\t */\n\t\t[\"referenceSequenceNumbers\", true],\n\t]);\n\n\tpublic readonly options: ILoaderOptions;\n\tpublic readonly scope: FluidObject;\n\tpublic readonly baseSnapshot: ISnapshotTree | undefined;\n\tpublic readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\tpublic readonly storage: IContainerStorageService;\n\tpublic readonly quorum: IQuorumClients;\n\tpublic readonly audience: IAudience;\n\tpublic readonly loader: ILoader;\n\tpublic readonly submitFn: (\n\t\ttype: MessageType,\n\t\tcontents: unknown,\n\t\tbatch: boolean,\n\t\tappData: unknown,\n\t) => number;\n\tpublic readonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t/**\n\t * @returns clientSequenceNumber of last message in a batch\n\t */\n\tpublic readonly submitBatchFn: (\n\t\tbatch: IBatchMessage[],\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t/**\n\t * `unknown` should be removed once `@alpha` tag is removed from IContainerContext\n\t * @see {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}\n\t * Any changes to submitSignalFn `content` should be checked internally by temporarily changing IContainerContext and removing all `unknown`s\n\t */\n\tpublic readonly submitSignalFn: (\n\t\tcontent: unknown | ISignalEnvelope,\n\t\ttargetClientId?: string,\n\t) => void;\n\tpublic readonly disposeFn: (error?: ICriticalContainerError) => void;\n\tpublic readonly closeFn: (error?: ICriticalContainerError) => void;\n\tpublic readonly updateDirtyContainerState: (dirty: boolean) => void;\n\tpublic readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;\n\tpublic readonly clientDetails: IClientDetails;\n\tpublic readonly existing: boolean;\n\tpublic readonly taggedLogger: ITelemetryLoggerExt;\n\tpublic readonly pendingLocalState: unknown;\n\tpublic readonly snapshotWithContents: ISnapshot | undefined;\n\n\tpublic readonly getConnectionState: () => ConnectionState;\n\n\tprivate readonly _getClientId: () => string | undefined;\n\tprivate readonly _getContainerDiagnosticId: () => string | undefined;\n\tprivate readonly _getConnected: () => boolean;\n\tprivate readonly _getAttachState: () => AttachState;\n\tprivate readonly version: IVersion | undefined;\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this._getClientId();\n\t}\n\n\t/**\n\t * DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.\n\t */\n\tpublic get id(): string {\n\t\treturn this._getContainerDiagnosticId() ?? \"\";\n\t}\n\n\t/**\n\t * When true, ops are free to flow\n\t * When false, ops should be kept as pending or rejected\n\t */\n\tpublic get connected(): boolean {\n\t\treturn this._getConnected();\n\t}\n\n\t/**\n\t * The compatibility details of the Loader layer that is exposed to the Runtime layer\n\t * for validating Runtime-Loader compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails {\n\t\treturn loaderCompatDetailsForRuntime;\n\t}\n\n\tconstructor(config: IContainerContextConfig) {\n\t\tthis.options = config.options;\n\t\tthis.scope = config.scope;\n\t\tthis.baseSnapshot = config.baseSnapshot;\n\t\tthis.deltaManager = config.deltaManager;\n\t\tthis.storage = config.storage;\n\t\tthis.quorum = config.quorum;\n\t\tthis.audience = config.audience;\n\t\tthis.loader = config.loader;\n\t\tthis.submitFn = config.submitFn;\n\t\tthis.submitSummaryFn = config.submitSummaryFn;\n\t\tthis.submitBatchFn = config.submitBatchFn;\n\t\tthis.submitSignalFn = config.submitSignalFn;\n\t\tthis.disposeFn = config.disposeFn;\n\t\tthis.closeFn = config.closeFn;\n\t\tthis.updateDirtyContainerState = config.updateDirtyContainerState;\n\t\tthis.getAbsoluteUrl = config.getAbsoluteUrl;\n\t\tthis.clientDetails = config.clientDetails;\n\t\tthis.existing = config.existing;\n\t\tthis.taggedLogger = config.taggedLogger;\n\t\tthis.pendingLocalState = config.pendingLocalState;\n\t\tthis.snapshotWithContents = config.snapshotWithContents;\n\n\t\tthis.getConnectionState = config.getConnectionState;\n\t\tthis._getClientId = config.getClientId;\n\t\tthis._getContainerDiagnosticId = config.getContainerDiagnosticId;\n\t\tthis._getConnected = config.getConnected;\n\t\tthis._getAttachState = config.getAttachState;\n\t\tthis.version = config.version;\n\t}\n\n\tpublic getLoadedFromVersion(): IVersion | undefined {\n\t\treturn this.version;\n\t}\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._getAttachState();\n\t}\n}\n"]}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ISnapshotTreeWithBlobContents,
|
|
6
|
-
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
|
|
8
|
-
import { FetchSource, IDocumentService, IDocumentStorageService, IDocumentStorageServicePolicies, ISnapshot, ISnapshotFetchOptions, ISummaryContext, ICreateBlobResponse, ISnapshotTree, IVersion } from "@fluidframework/driver-definitions/internal";
|
|
9
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
5
|
+
import type { ISnapshotTreeWithBlobContents, IContainerStorageService } from "@fluidframework/container-definitions/internal";
|
|
6
|
+
import type { IDisposable } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
|
|
8
|
+
import type { FetchSource, IDocumentService, IDocumentStorageService, IDocumentStorageServicePolicies, ISnapshot, ISnapshotFetchOptions, ISummaryContext, ICreateBlobResponse, ISnapshotTree, IVersion } from "@fluidframework/driver-definitions/internal";
|
|
9
|
+
import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
10
10
|
import type { MemoryDetachedBlobStorage } from "./memoryBlobStorage.js";
|
|
11
11
|
import type { ISerializedStateManagerDocumentStorageService, ISnapshotInfo } from "./serializedStateManager.js";
|
|
12
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerStorageAdapter.d.ts","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"containerStorageAdapter.d.ts","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,6BAA6B,EAC7B,wBAAwB,EACxB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,KAAK,EACX,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,+BAA+B,EAC/B,SAAS,EACT,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,MAAM,6CAA6C,CAAC;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGxE,OAAO,KAAK,EACX,6CAA6C,EAC7C,aAAa,EACb,MAAM,6BAA6B,CAAC;AAGrC;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACzC,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB;AAED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AAK,CAAC,CAAC;QAC5D,CAAC;aAAM,CAAC;YACP,2CAA2C,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACpE,CAAC;IACF,CAAC;IACD,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QACtC,IAAA,iBAAM,EAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAChF,oDAAoD;QACpD,KAAK,CAAC,EAAE,CAAC,GAAG,IAAA,6BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;AACF,CAAC;AAED,wDAAwD;AACxD,SAAS,0CAA0C,CAClD,IAAmC,EACnC,KAAgC;IAEhC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC7C,IAAA,iBAAM,EACL,EAAE,KAAK,SAAS,EAChB,KAAK,CAAC,mEAAmE,CACzE,CAAC;IACF,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;IACtC,IAAA,iBAAM,EAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC9E,oDAAoD;IACpD,KAAK,CAAC,EAAE,CAAC,GAAG,IAAA,6BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport {\n\tISnapshotTreeWithBlobContents,\n\ttype IContainerStorageService,\n} from \"@fluidframework/container-definitions/internal\";\nimport { IDisposable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISummaryHandle, ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tFetchSource,\n\tIDocumentService,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tISummaryContext,\n\tICreateBlobResponse,\n\tISnapshotTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { isInstanceOfISnapshot, UsageError } from \"@fluidframework/driver-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { MemoryDetachedBlobStorage } from \"./memoryBlobStorage.js\";\nimport { ProtocolTreeStorageService } from \"./protocolTreeDocumentStorageService.js\";\nimport { RetriableDocumentStorageService } from \"./retriableDocumentStorageService.js\";\nimport type {\n\tISerializedStateManagerDocumentStorageService,\n\tISnapshotInfo,\n} from \"./serializedStateManager.js\";\nimport { convertSnapshotInfoToSnapshot } from \"./utils.js\";\n\n/**\n * Stringified blobs from a summary/snapshot tree.\n * @internal\n */\nexport interface ISerializableBlobContents {\n\t[id: string]: string;\n}\n\n/**\n * This class wraps the actual storage and make sure no wrong apis are called according to\n * container attach state.\n */\nexport class ContainerStorageAdapter\n\timplements\n\t\tISerializedStateManagerDocumentStorageService,\n\t\tIContainerStorageService,\n\t\tIDisposable\n{\n\tprivate _storageService: IDocumentStorageService & Partial<IDisposable>;\n\n\tprivate _summarizeProtocolTree: boolean | undefined;\n\t/**\n\t * Whether the adapter will enforce sending combined summary trees.\n\t */\n\tpublic get summarizeProtocolTree(): boolean {\n\t\treturn this._summarizeProtocolTree === true;\n\t}\n\n\tprivate _loadedGroupIdSnapshots: Record<string, ISnapshot> = {};\n\t/**\n\t * Any loading group id (virtualized) snapshot download from storage will be stored here.\n\t */\n\tpublic get loadedGroupIdSnapshots(): Record<string, ISnapshot> {\n\t\treturn this._loadedGroupIdSnapshots;\n\t}\n\n\t/**\n\t * An adapter that ensures we're using detachedBlobStorage up until we connect to a real service, and then\n\t * after connecting to a real service augments it with retry and combined summary tree enforcement.\n\t * @param detachedBlobStorage - The detached blob storage to use up until we connect to a real service\n\t * @param logger - Telemetry logger\n\t * @param loadingGroupIdSnapshotsFromPendingState - in offline mode, any loading group snapshots we've downloaded from the service that were stored in the pending state\n\t * @param addProtocolSummaryIfMissing - a callback to permit the container to inspect the summary we're about to\n\t * upload, and fix it up with a protocol tree if needed\n\t * @param enableSummarizeProtocolTree - Enable uploading a protocol summary. Note: preference is given to service policy's \"summarizeProtocolTree\" before this value.\n\t */\n\tpublic constructor(\n\t\tdetachedBlobStorage: MemoryDetachedBlobStorage | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\t/**\n\t\t * ArrayBufferLikes or utf8 encoded strings, containing blobs from a snapshot\n\t\t */\n\t\tprivate readonly blobContents: { [id: string]: ArrayBufferLike | string } = {},\n\t\tprivate loadingGroupIdSnapshotsFromPendingState: Record<string, ISnapshotInfo> | undefined,\n\t\tprivate readonly addProtocolSummaryIfMissing: (summaryTree: ISummaryTree) => ISummaryTree,\n\t\tprivate readonly enableSummarizeProtocolTree: boolean | undefined,\n\t) {\n\t\tthis._storageService = new BlobOnlyStorage(detachedBlobStorage, logger);\n\t}\n\n\tdisposed: boolean = false;\n\tdispose(error?: Error): void {\n\t\tthis._storageService?.dispose?.(error);\n\t\tthis.disposed = true;\n\t}\n\n\tpublic connectToService(service: IDocumentService): void {\n\t\tif (!(this._storageService instanceof BlobOnlyStorage)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst storageServiceP = service.connectToStorage();\n\t\tconst retriableStorage = (this._storageService = new RetriableDocumentStorageService(\n\t\t\tstorageServiceP,\n\t\t\tthis.logger,\n\t\t));\n\n\t\t// A storage service wrapper which intercept calls to uploadSummaryWithContext and ensure they include\n\t\t// the protocol summary, provided single-commit summary is enabled.\n\t\tthis._storageService = new ProtocolTreeStorageService(\n\t\t\tretriableStorage,\n\t\t\t(...props) => {\n\t\t\t\tthis.logger.sendTelemetryEvent({ eventName: \"summarizeProtocolTreeEnabled\" });\n\t\t\t\treturn this.addProtocolSummaryIfMissing(...props);\n\t\t\t},\n\t\t\t// A callback to ensure we fetch the most updated value of service.policies.summarizeProtocolTree, which could be set\n\t\t\t// based on the response received from the service after connection is established.\n\t\t\t() => {\n\t\t\t\t// Determine whether or not container should upload the protocol summary along with the summary.\n\t\t\t\t// This is determined based on what value is set for serve policy's summariProtocolTree value or the enableSummarizeProtocolTree\n\t\t\t\t// retrievd from the loader options or monitoring context config.\n\t\t\t\tconst shouldSummarizeProtocolTree =\n\t\t\t\t\tservice.policies?.summarizeProtocolTree ?? this.enableSummarizeProtocolTree ?? false;\n\n\t\t\t\tif (this._summarizeProtocolTree !== shouldSummarizeProtocolTree) {\n\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\teventName: \"isSummarizeProtocolTreeEnabled\",\n\t\t\t\t\t\tdetails: { value: shouldSummarizeProtocolTree },\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthis._summarizeProtocolTree = shouldSummarizeProtocolTree;\n\t\t\t\treturn this._summarizeProtocolTree;\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic loadSnapshotFromSnapshotBlobs(snapshotBlobs: ISerializableBlobContents): void {\n\t\tfor (const [id, value] of Object.entries(snapshotBlobs)) {\n\t\t\tthis.blobContents[id] = value;\n\t\t}\n\t}\n\n\tpublic clearPendingState(): void {\n\t\tthis.loadingGroupIdSnapshotsFromPendingState = undefined;\n\t}\n\n\tpublic get policies(): IDocumentStorageServicePolicies | undefined {\n\t\t// back-compat 0.40 containerRuntime requests policies even in detached container if storage is present\n\t\t// and storage is always present in >=0.41.\n\t\ttry {\n\t\t\treturn this._storageService.policies;\n\t\t} catch {\n\t\t\t// No-op\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic get maximumCacheDurationMs(): IDocumentStorageServicePolicies[\"maximumCacheDurationMs\"] {\n\t\treturn this.policies?.maximumCacheDurationMs;\n\t}\n\n\tpublic async getSnapshotTree(\n\t\tversion?: IVersion,\n\t\tscenarioName?: string,\n\t\t// API called below uses null\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t): Promise<ISnapshotTree | null> {\n\t\treturn this._storageService.getSnapshotTree(version, scenarioName);\n\t}\n\n\tpublic async getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot> {\n\t\tlet snapshot: ISnapshot;\n\t\tif (\n\t\t\tthis.loadingGroupIdSnapshotsFromPendingState !== undefined &&\n\t\t\tsnapshotFetchOptions?.loadingGroupIds !== undefined\n\t\t) {\n\t\t\tconst localSnapshot =\n\t\t\t\tthis.loadingGroupIdSnapshotsFromPendingState[snapshotFetchOptions.loadingGroupIds[0]];\n\t\t\tassert(localSnapshot !== undefined, 0x970 /* Local snapshot must be present */);\n\t\t\tsnapshot = convertSnapshotInfoToSnapshot(\n\t\t\t\tlocalSnapshot,\n\t\t\t\tlocalSnapshot.snapshotSequenceNumber,\n\t\t\t);\n\t\t} else {\n\t\t\tif (this._storageService.getSnapshot === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"getSnapshot api should exist in internal storage in ContainerStorageAdapter\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tsnapshot = await this._storageService.getSnapshot(snapshotFetchOptions);\n\t\t}\n\n\t\t// Track the latest snapshot for each loading group id\n\t\tconst loadingGroupIds = snapshotFetchOptions?.loadingGroupIds;\n\t\tassert(\n\t\t\tsnapshot.sequenceNumber !== undefined,\n\t\t\t0x971 /* Snapshot must have sequence number */,\n\t\t);\n\t\tif (loadingGroupIds !== undefined) {\n\t\t\tfor (const loadingGroupId of loadingGroupIds) {\n\t\t\t\t// Do we actually want to update the stored snapshot?\n\t\t\t\t// What if the incoming snapshot is way newer than the stored snapshot?\n\t\t\t\t// We only want to update the stored snapshot if the incoming snapshot is newer (stored sequence number < incoming sequence number)\n\t\t\t\tconst storedSeqNum =\n\t\t\t\t\tthis._loadedGroupIdSnapshots[loadingGroupId]?.sequenceNumber ?? -1;\n\t\t\t\tif (storedSeqNum < snapshot.sequenceNumber) {\n\t\t\t\t\tthis._loadedGroupIdSnapshots[loadingGroupId] = snapshot;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn snapshot;\n\t}\n\n\tpublic async readBlob(id: string): Promise<ArrayBufferLike> {\n\t\tconst maybeBlob = this.blobContents[id];\n\t\tif (maybeBlob !== undefined) {\n\t\t\tif (typeof maybeBlob === \"string\") {\n\t\t\t\tconst blob = stringToBuffer(maybeBlob, \"utf8\");\n\t\t\t\treturn blob;\n\t\t\t}\n\t\t\treturn maybeBlob;\n\t\t}\n\t\treturn this._storageService.readBlob(id);\n\t}\n\n\tpublic async getVersions(\n\t\t// API used below uses null\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]> {\n\t\treturn this._storageService.getVersions(versionId, count, scenarioName, fetchSource);\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\treturn this._storageService.uploadSummaryWithContext(summary, context);\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this._storageService.createBlob(file);\n\t}\n\n\t/**\n\t * {@link IRuntimeStorageService.downloadSummary}.\n\t *\n\t * @deprecated - This API is deprecated and will be removed in a future release. No replacement is planned as\n\t * it is unused in the Runtime and below layers.\n\t */\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\treturn this._storageService.downloadSummary(handle);\n\t}\n}\n\n/**\n * Storage which only supports createBlob() and readBlob(). This is used with IDetachedBlobStorage to support\n * blobs in detached containers.\n */\nclass BlobOnlyStorage implements IDocumentStorageService {\n\tconstructor(\n\t\tprivate readonly detachedStorage: MemoryDetachedBlobStorage | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {}\n\n\tpublic async createBlob(content: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this.verifyStorage().createBlob(content);\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.verifyStorage().readBlob(blobId);\n\t}\n\n\tprivate verifyStorage(): MemoryDetachedBlobStorage {\n\t\tif (this.detachedStorage === undefined) {\n\t\t\tthrow new UsageError(\"Real storage calls not allowed in Unattached container\");\n\t\t}\n\t\treturn this.detachedStorage;\n\t}\n\n\tpublic get policies(): IDocumentStorageServicePolicies | undefined {\n\t\treturn this.notCalled();\n\t}\n\n\t/* eslint-disable @typescript-eslint/unbound-method */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic getSnapshotTree: () => Promise<ISnapshotTree | null> = this.notCalled;\n\tpublic getSnapshot: () => Promise<ISnapshot> = this.notCalled;\n\tpublic getVersions: () => Promise<IVersion[]> = this.notCalled;\n\tpublic write: () => Promise<IVersion> = this.notCalled;\n\tpublic uploadSummaryWithContext: () => Promise<string> = this.notCalled;\n\tpublic downloadSummary: () => Promise<ISummaryTree> = this.notCalled;\n\t/* eslint-enable @typescript-eslint/unbound-method */\n\n\tprivate notCalled(): never {\n\t\tthis.verifyStorage();\n\t\ttry {\n\t\t\t// some browsers may not populate stack unless exception is thrown\n\t\t\tthrow new Error(\"BlobOnlyStorage not implemented method used\");\n\t\t} catch (error) {\n\t\t\tthis.logger.sendTelemetryEvent({ eventName: \"BlobOnlyStorageWrongCall\" }, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\n// runtime will write a tree to the summary containing \"attachment\" type entries\n// which reference attachment blobs by ID, along with a blob containing the blob redirect table.\n// However, some drivers do not support the \"attachment\" type and will convert them to \"blob\" type\n// entries. We want to avoid saving these to reduce the size of stashed change blobs, but we\n// need to make sure the blob redirect table is saved.\nconst blobsTreeName = \".blobs\";\nconst redirectTableBlobName = \".redirectTable\";\n\n/**\n * Get blob contents of a snapshot tree from storage (or, ideally, cache)\n */\nexport async function getBlobContentsFromTree(\n\tsnapshot: ISnapshot | ISnapshotTree,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n): Promise<ISerializableBlobContents> {\n\tconst blobs = {};\n\tif (isInstanceOfISnapshot(snapshot)) {\n\t\tconst blobContents = snapshot.blobContents;\n\t\tfor (const [id, content] of blobContents.entries()) {\n\t\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\t\tblobs[id] = bufferToString(content, \"utf8\");\n\t\t}\n\t} else {\n\t\tawait getBlobContentsFromTreeCore(snapshot, blobs, storage);\n\t}\n\treturn blobs;\n}\n\nasync function getBlobContentsFromTreeCore(\n\ttree: ISnapshotTree,\n\tblobs: ISerializableBlobContents,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n\troot = true,\n): Promise<unknown[]> {\n\tconst treePs: Promise<unknown>[] = [];\n\tfor (const [key, subTree] of Object.entries(tree.trees)) {\n\t\tif (root && key === blobsTreeName) {\n\t\t\ttreePs.push(getBlobManagerTreeFromTree(subTree, blobs, storage));\n\t\t} else {\n\t\t\ttreePs.push(getBlobContentsFromTreeCore(subTree, blobs, storage, false));\n\t\t}\n\t}\n\tfor (const id of Object.values(tree.blobs)) {\n\t\tconst blob = await storage.readBlob(id);\n\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\tblobs[id] = bufferToString(blob, \"utf8\");\n\t}\n\treturn Promise.all(treePs);\n}\n\n// save redirect table from .blobs tree but nothing else\nasync function getBlobManagerTreeFromTree(\n\ttree: ISnapshotTree,\n\tblobs: ISerializableBlobContents,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n): Promise<void> {\n\tconst id = tree.blobs[redirectTableBlobName];\n\tassert(id !== undefined, 0x9ce /* id is undefined in getBlobManagerTreeFromTree */);\n\tconst blob = await storage.readBlob(id);\n\t// ArrayBufferLike will not survive JSON.stringify()\n\tblobs[id] = bufferToString(blob, \"utf8\");\n}\n\n/**\n * Extract blob contents from a snapshot tree with blob contents\n */\nexport function getBlobContentsFromTreeWithBlobContents(\n\tsnapshot: ISnapshotTreeWithBlobContents,\n): ISerializableBlobContents {\n\tconst blobs = {};\n\tgetBlobContentsFromTreeWithBlobContentsCore(snapshot, blobs);\n\treturn blobs;\n}\n\nfunction getBlobContentsFromTreeWithBlobContentsCore(\n\ttree: ISnapshotTreeWithBlobContents,\n\tblobs: ISerializableBlobContents,\n\troot = true,\n): void {\n\tfor (const [key, subTree] of Object.entries(tree.trees)) {\n\t\tif (root && key === blobsTreeName) {\n\t\t\tgetBlobManagerTreeFromTreeWithBlobContents(subTree, blobs);\n\t\t} else {\n\t\t\tgetBlobContentsFromTreeWithBlobContentsCore(subTree, blobs, false);\n\t\t}\n\t}\n\tfor (const id of Object.values(tree.blobs)) {\n\t\tconst blob = tree.blobsContents?.[id];\n\t\tassert(blob !== undefined, 0x2ec /* \"Blob must be present in blobsContents\" */);\n\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\tblobs[id] = bufferToString(blob, \"utf8\");\n\t}\n}\n\n// save redirect table from .blobs tree but nothing else\nfunction getBlobManagerTreeFromTreeWithBlobContents(\n\ttree: ISnapshotTreeWithBlobContents,\n\tblobs: ISerializableBlobContents,\n): void {\n\tconst id = tree.blobs[redirectTableBlobName];\n\tassert(\n\t\tid !== undefined,\n\t\t0x9cf /* id is undefined in getBlobManagerTreeFromTreeWithBlobContents */,\n\t);\n\tconst blob = tree.blobsContents?.[id];\n\tassert(blob !== undefined, 0x70f /* Blob must be present in blobsContents */);\n\t// ArrayBufferLike will not survive JSON.stringify()\n\tblobs[id] = bufferToString(blob, \"utf8\");\n}\n"]}
|
|
1
|
+
{"version":3,"file":"containerStorageAdapter.js","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8E;AAM9E,kEAA6D;AAc7D,oEAA0F;AAI1F,mGAAqF;AACrF,6FAAuF;AAKvF,yCAA2D;AAU3D;;;GAGG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AAE,CAAC;QACzD,IAAI,IAAI,IAAI,GAAG,KAAK,aAAa,EAAE,CAAC;YACnC,0CAA0C,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC5D,CAAC;aAAM,CAAC;YACP,2CAA2C,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACpE,CAAC;IACF,CAAC;IACD,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QACtC,IAAA,iBAAM,EAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAChF,oDAAoD;QACpD,KAAK,CAAC,EAAE,CAAC,GAAG,IAAA,6BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;AACF,CAAC;AAED,wDAAwD;AACxD,SAAS,0CAA0C,CAClD,IAAmC,EACnC,KAAgC;IAEhC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC7C,IAAA,iBAAM,EACL,EAAE,KAAK,SAAS,EAChB,KAAK,CAAC,mEAAmE,CACzE,CAAC;IACF,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;IACtC,IAAA,iBAAM,EAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC9E,oDAAoD;IACpD,KAAK,CAAC,EAAE,CAAC,GAAG,IAAA,6BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport type {\n\tISnapshotTreeWithBlobContents,\n\tIContainerStorageService,\n} from \"@fluidframework/container-definitions/internal\";\nimport type { IDisposable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { ISummaryHandle, ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport type {\n\tFetchSource,\n\tIDocumentService,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tISummaryContext,\n\tICreateBlobResponse,\n\tISnapshotTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { isInstanceOfISnapshot, UsageError } from \"@fluidframework/driver-utils/internal\";\nimport type { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { MemoryDetachedBlobStorage } from \"./memoryBlobStorage.js\";\nimport { ProtocolTreeStorageService } from \"./protocolTreeDocumentStorageService.js\";\nimport { RetriableDocumentStorageService } from \"./retriableDocumentStorageService.js\";\nimport type {\n\tISerializedStateManagerDocumentStorageService,\n\tISnapshotInfo,\n} from \"./serializedStateManager.js\";\nimport { convertSnapshotInfoToSnapshot } from \"./utils.js\";\n\n/**\n * Stringified blobs from a summary/snapshot tree.\n * @internal\n */\nexport interface ISerializableBlobContents {\n\t[id: string]: string;\n}\n\n/**\n * This class wraps the actual storage and make sure no wrong apis are called according to\n * container attach state.\n */\nexport class ContainerStorageAdapter\n\timplements\n\t\tISerializedStateManagerDocumentStorageService,\n\t\tIContainerStorageService,\n\t\tIDisposable\n{\n\tprivate _storageService: IDocumentStorageService & Partial<IDisposable>;\n\n\tprivate _summarizeProtocolTree: boolean | undefined;\n\t/**\n\t * Whether the adapter will enforce sending combined summary trees.\n\t */\n\tpublic get summarizeProtocolTree(): boolean {\n\t\treturn this._summarizeProtocolTree === true;\n\t}\n\n\tprivate _loadedGroupIdSnapshots: Record<string, ISnapshot> = {};\n\t/**\n\t * Any loading group id (virtualized) snapshot download from storage will be stored here.\n\t */\n\tpublic get loadedGroupIdSnapshots(): Record<string, ISnapshot> {\n\t\treturn this._loadedGroupIdSnapshots;\n\t}\n\n\t/**\n\t * An adapter that ensures we're using detachedBlobStorage up until we connect to a real service, and then\n\t * after connecting to a real service augments it with retry and combined summary tree enforcement.\n\t * @param detachedBlobStorage - The detached blob storage to use up until we connect to a real service\n\t * @param logger - Telemetry logger\n\t * @param loadingGroupIdSnapshotsFromPendingState - in offline mode, any loading group snapshots we've downloaded from the service that were stored in the pending state\n\t * @param addProtocolSummaryIfMissing - a callback to permit the container to inspect the summary we're about to\n\t * upload, and fix it up with a protocol tree if needed\n\t * @param enableSummarizeProtocolTree - Enable uploading a protocol summary. Note: preference is given to service policy's \"summarizeProtocolTree\" before this value.\n\t */\n\tpublic constructor(\n\t\tdetachedBlobStorage: MemoryDetachedBlobStorage | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\t/**\n\t\t * ArrayBufferLikes or utf8 encoded strings, containing blobs from a snapshot\n\t\t */\n\t\tprivate readonly blobContents: { [id: string]: ArrayBufferLike | string } = {},\n\t\tprivate loadingGroupIdSnapshotsFromPendingState: Record<string, ISnapshotInfo> | undefined,\n\t\tprivate readonly addProtocolSummaryIfMissing: (summaryTree: ISummaryTree) => ISummaryTree,\n\t\tprivate readonly enableSummarizeProtocolTree: boolean | undefined,\n\t) {\n\t\tthis._storageService = new BlobOnlyStorage(detachedBlobStorage, logger);\n\t}\n\n\tdisposed: boolean = false;\n\tdispose(error?: Error): void {\n\t\tthis._storageService?.dispose?.(error);\n\t\tthis.disposed = true;\n\t}\n\n\tpublic connectToService(service: IDocumentService): void {\n\t\tif (!(this._storageService instanceof BlobOnlyStorage)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst storageServiceP = service.connectToStorage();\n\t\tconst retriableStorage = (this._storageService = new RetriableDocumentStorageService(\n\t\t\tstorageServiceP,\n\t\t\tthis.logger,\n\t\t));\n\n\t\t// A storage service wrapper which intercept calls to uploadSummaryWithContext and ensure they include\n\t\t// the protocol summary, provided single-commit summary is enabled.\n\t\tthis._storageService = new ProtocolTreeStorageService(\n\t\t\tretriableStorage,\n\t\t\t(...props) => {\n\t\t\t\tthis.logger.sendTelemetryEvent({ eventName: \"summarizeProtocolTreeEnabled\" });\n\t\t\t\treturn this.addProtocolSummaryIfMissing(...props);\n\t\t\t},\n\t\t\t// A callback to ensure we fetch the most updated value of service.policies.summarizeProtocolTree, which could be set\n\t\t\t// based on the response received from the service after connection is established.\n\t\t\t() => {\n\t\t\t\t// Determine whether or not container should upload the protocol summary along with the summary.\n\t\t\t\t// This is determined based on what value is set for serve policy's summariProtocolTree value or the enableSummarizeProtocolTree\n\t\t\t\t// retrievd from the loader options or monitoring context config.\n\t\t\t\tconst shouldSummarizeProtocolTree =\n\t\t\t\t\tservice.policies?.summarizeProtocolTree ?? this.enableSummarizeProtocolTree ?? false;\n\n\t\t\t\tif (this._summarizeProtocolTree !== shouldSummarizeProtocolTree) {\n\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\teventName: \"isSummarizeProtocolTreeEnabled\",\n\t\t\t\t\t\tdetails: { value: shouldSummarizeProtocolTree },\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthis._summarizeProtocolTree = shouldSummarizeProtocolTree;\n\t\t\t\treturn this._summarizeProtocolTree;\n\t\t\t},\n\t\t);\n\t}\n\n\tpublic loadSnapshotFromSnapshotBlobs(snapshotBlobs: ISerializableBlobContents): void {\n\t\tfor (const [id, value] of Object.entries(snapshotBlobs)) {\n\t\t\tthis.blobContents[id] = value;\n\t\t}\n\t}\n\n\tpublic clearPendingState(): void {\n\t\tthis.loadingGroupIdSnapshotsFromPendingState = undefined;\n\t}\n\n\tpublic get policies(): IDocumentStorageServicePolicies | undefined {\n\t\t// back-compat 0.40 containerRuntime requests policies even in detached container if storage is present\n\t\t// and storage is always present in >=0.41.\n\t\ttry {\n\t\t\treturn this._storageService.policies;\n\t\t} catch {\n\t\t\t// No-op\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic get maximumCacheDurationMs(): IDocumentStorageServicePolicies[\"maximumCacheDurationMs\"] {\n\t\treturn this.policies?.maximumCacheDurationMs;\n\t}\n\n\tpublic async getSnapshotTree(\n\t\tversion?: IVersion,\n\t\tscenarioName?: string,\n\t\t// API called below uses null\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t): Promise<ISnapshotTree | null> {\n\t\treturn this._storageService.getSnapshotTree(version, scenarioName);\n\t}\n\n\tpublic async getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot> {\n\t\tlet snapshot: ISnapshot;\n\t\tif (\n\t\t\tthis.loadingGroupIdSnapshotsFromPendingState !== undefined &&\n\t\t\tsnapshotFetchOptions?.loadingGroupIds !== undefined\n\t\t) {\n\t\t\tconst localSnapshot =\n\t\t\t\tthis.loadingGroupIdSnapshotsFromPendingState[snapshotFetchOptions.loadingGroupIds[0]];\n\t\t\tassert(localSnapshot !== undefined, 0x970 /* Local snapshot must be present */);\n\t\t\tsnapshot = convertSnapshotInfoToSnapshot(\n\t\t\t\tlocalSnapshot,\n\t\t\t\tlocalSnapshot.snapshotSequenceNumber,\n\t\t\t);\n\t\t} else {\n\t\t\tif (this._storageService.getSnapshot === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"getSnapshot api should exist in internal storage in ContainerStorageAdapter\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tsnapshot = await this._storageService.getSnapshot(snapshotFetchOptions);\n\t\t}\n\n\t\t// Track the latest snapshot for each loading group id\n\t\tconst loadingGroupIds = snapshotFetchOptions?.loadingGroupIds;\n\t\tassert(\n\t\t\tsnapshot.sequenceNumber !== undefined,\n\t\t\t0x971 /* Snapshot must have sequence number */,\n\t\t);\n\t\tif (loadingGroupIds !== undefined) {\n\t\t\tfor (const loadingGroupId of loadingGroupIds) {\n\t\t\t\t// Do we actually want to update the stored snapshot?\n\t\t\t\t// What if the incoming snapshot is way newer than the stored snapshot?\n\t\t\t\t// We only want to update the stored snapshot if the incoming snapshot is newer (stored sequence number < incoming sequence number)\n\t\t\t\tconst storedSeqNum =\n\t\t\t\t\tthis._loadedGroupIdSnapshots[loadingGroupId]?.sequenceNumber ?? -1;\n\t\t\t\tif (storedSeqNum < snapshot.sequenceNumber) {\n\t\t\t\t\tthis._loadedGroupIdSnapshots[loadingGroupId] = snapshot;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn snapshot;\n\t}\n\n\tpublic async readBlob(id: string): Promise<ArrayBufferLike> {\n\t\tconst maybeBlob = this.blobContents[id];\n\t\tif (maybeBlob !== undefined) {\n\t\t\tif (typeof maybeBlob === \"string\") {\n\t\t\t\tconst blob = stringToBuffer(maybeBlob, \"utf8\");\n\t\t\t\treturn blob;\n\t\t\t}\n\t\t\treturn maybeBlob;\n\t\t}\n\t\treturn this._storageService.readBlob(id);\n\t}\n\n\tpublic async getVersions(\n\t\t// API used below uses null\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]> {\n\t\treturn this._storageService.getVersions(versionId, count, scenarioName, fetchSource);\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\treturn this._storageService.uploadSummaryWithContext(summary, context);\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this._storageService.createBlob(file);\n\t}\n\n\t/**\n\t * {@link IRuntimeStorageService.downloadSummary}.\n\t *\n\t * @deprecated - This API is deprecated and will be removed in a future release. No replacement is planned as\n\t * it is unused in the Runtime and below layers.\n\t */\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\treturn this._storageService.downloadSummary(handle);\n\t}\n}\n\n/**\n * Storage which only supports createBlob() and readBlob(). This is used with IDetachedBlobStorage to support\n * blobs in detached containers.\n */\nclass BlobOnlyStorage implements IDocumentStorageService {\n\tconstructor(\n\t\tprivate readonly detachedStorage: MemoryDetachedBlobStorage | undefined,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {}\n\n\tpublic async createBlob(content: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this.verifyStorage().createBlob(content);\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.verifyStorage().readBlob(blobId);\n\t}\n\n\tprivate verifyStorage(): MemoryDetachedBlobStorage {\n\t\tif (this.detachedStorage === undefined) {\n\t\t\tthrow new UsageError(\"Real storage calls not allowed in Unattached container\");\n\t\t}\n\t\treturn this.detachedStorage;\n\t}\n\n\tpublic get policies(): IDocumentStorageServicePolicies | undefined {\n\t\treturn this.notCalled();\n\t}\n\n\t/* eslint-disable @typescript-eslint/unbound-method */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic getSnapshotTree: () => Promise<ISnapshotTree | null> = this.notCalled;\n\tpublic getSnapshot: () => Promise<ISnapshot> = this.notCalled;\n\tpublic getVersions: () => Promise<IVersion[]> = this.notCalled;\n\tpublic write: () => Promise<IVersion> = this.notCalled;\n\tpublic uploadSummaryWithContext: () => Promise<string> = this.notCalled;\n\tpublic downloadSummary: () => Promise<ISummaryTree> = this.notCalled;\n\t/* eslint-enable @typescript-eslint/unbound-method */\n\n\tprivate notCalled(): never {\n\t\tthis.verifyStorage();\n\t\ttry {\n\t\t\t// some browsers may not populate stack unless exception is thrown\n\t\t\tthrow new Error(\"BlobOnlyStorage not implemented method used\");\n\t\t} catch (error) {\n\t\t\tthis.logger.sendTelemetryEvent({ eventName: \"BlobOnlyStorageWrongCall\" }, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\n// runtime will write a tree to the summary containing \"attachment\" type entries\n// which reference attachment blobs by ID, along with a blob containing the blob redirect table.\n// However, some drivers do not support the \"attachment\" type and will convert them to \"blob\" type\n// entries. We want to avoid saving these to reduce the size of stashed change blobs, but we\n// need to make sure the blob redirect table is saved.\nconst blobsTreeName = \".blobs\";\nconst redirectTableBlobName = \".redirectTable\";\n\n/**\n * Get blob contents of a snapshot tree from storage (or, ideally, cache)\n */\nexport async function getBlobContentsFromTree(\n\tsnapshot: ISnapshot | ISnapshotTree,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n): Promise<ISerializableBlobContents> {\n\tconst blobs = {};\n\tif (isInstanceOfISnapshot(snapshot)) {\n\t\tconst blobContents = snapshot.blobContents;\n\t\tfor (const [id, content] of blobContents.entries()) {\n\t\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\t\tblobs[id] = bufferToString(content, \"utf8\");\n\t\t}\n\t} else {\n\t\tawait getBlobContentsFromTreeCore(snapshot, blobs, storage);\n\t}\n\treturn blobs;\n}\n\nasync function getBlobContentsFromTreeCore(\n\ttree: ISnapshotTree,\n\tblobs: ISerializableBlobContents,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n\troot = true,\n): Promise<unknown[]> {\n\tconst treePs: Promise<unknown>[] = [];\n\tfor (const [key, subTree] of Object.entries(tree.trees)) {\n\t\tif (root && key === blobsTreeName) {\n\t\t\ttreePs.push(getBlobManagerTreeFromTree(subTree, blobs, storage));\n\t\t} else {\n\t\t\ttreePs.push(getBlobContentsFromTreeCore(subTree, blobs, storage, false));\n\t\t}\n\t}\n\tfor (const id of Object.values(tree.blobs)) {\n\t\tconst blob = await storage.readBlob(id);\n\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\tblobs[id] = bufferToString(blob, \"utf8\");\n\t}\n\treturn Promise.all(treePs);\n}\n\n// save redirect table from .blobs tree but nothing else\nasync function getBlobManagerTreeFromTree(\n\ttree: ISnapshotTree,\n\tblobs: ISerializableBlobContents,\n\tstorage: Pick<IDocumentStorageService, \"readBlob\">,\n): Promise<void> {\n\tconst id = tree.blobs[redirectTableBlobName];\n\tassert(id !== undefined, 0x9ce /* id is undefined in getBlobManagerTreeFromTree */);\n\tconst blob = await storage.readBlob(id);\n\t// ArrayBufferLike will not survive JSON.stringify()\n\tblobs[id] = bufferToString(blob, \"utf8\");\n}\n\n/**\n * Extract blob contents from a snapshot tree with blob contents\n */\nexport function getBlobContentsFromTreeWithBlobContents(\n\tsnapshot: ISnapshotTreeWithBlobContents,\n): ISerializableBlobContents {\n\tconst blobs = {};\n\tgetBlobContentsFromTreeWithBlobContentsCore(snapshot, blobs);\n\treturn blobs;\n}\n\nfunction getBlobContentsFromTreeWithBlobContentsCore(\n\ttree: ISnapshotTreeWithBlobContents,\n\tblobs: ISerializableBlobContents,\n\troot = true,\n): void {\n\tfor (const [key, subTree] of Object.entries(tree.trees)) {\n\t\tif (root && key === blobsTreeName) {\n\t\t\tgetBlobManagerTreeFromTreeWithBlobContents(subTree, blobs);\n\t\t} else {\n\t\t\tgetBlobContentsFromTreeWithBlobContentsCore(subTree, blobs, false);\n\t\t}\n\t}\n\tfor (const id of Object.values(tree.blobs)) {\n\t\tconst blob = tree.blobsContents?.[id];\n\t\tassert(blob !== undefined, 0x2ec /* \"Blob must be present in blobsContents\" */);\n\t\t// ArrayBufferLike will not survive JSON.stringify()\n\t\tblobs[id] = bufferToString(blob, \"utf8\");\n\t}\n}\n\n// save redirect table from .blobs tree but nothing else\nfunction getBlobManagerTreeFromTreeWithBlobContents(\n\ttree: ISnapshotTreeWithBlobContents,\n\tblobs: ISerializableBlobContents,\n): void {\n\tconst id = tree.blobs[redirectTableBlobName];\n\tassert(\n\t\tid !== undefined,\n\t\t0x9cf /* id is undefined in getBlobManagerTreeFromTreeWithBlobContents */,\n\t);\n\tconst blob = tree.blobsContents?.[id];\n\tassert(blob !== undefined, 0x70f /* Blob must be present in blobsContents */);\n\t// ArrayBufferLike will not survive JSON.stringify()\n\tblobs[id] = bufferToString(blob, \"utf8\");\n}\n"]}
|
package/dist/contracts.d.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
6
|
-
import { IDeltaQueue, ReadOnlyInfo, IFluidCodeDetails, IConnectionDetails } from "@fluidframework/container-definitions/internal";
|
|
7
|
-
import { IErrorBase, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
8
|
-
import { ConnectionMode, IClientDetails } from "@fluidframework/driver-definitions";
|
|
9
|
-
import { IContainerPackageInfo, IClientConfiguration, IDocumentMessage, ISignalClient, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/driver-definitions/internal";
|
|
5
|
+
import type { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
6
|
+
import { type IDeltaQueue, type ReadOnlyInfo, type IFluidCodeDetails, type IConnectionDetails } from "@fluidframework/container-definitions/internal";
|
|
7
|
+
import type { IErrorBase, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
8
|
+
import type { ConnectionMode, IClientDetails } from "@fluidframework/driver-definitions";
|
|
9
|
+
import type { IContainerPackageInfo, IClientConfiguration, IDocumentMessage, ISignalClient, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/driver-definitions/internal";
|
|
10
10
|
export declare enum ReconnectMode {
|
|
11
11
|
Never = "Never",
|
|
12
12
|
Disabled = "Disabled",
|
package/dist/contracts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,iBAAiB,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;AACjD,CAAC,CAAC;AATW,QAAA,cAAc,kBASzB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,6EAMwD;AAYxD,IAAY,aAIX;AAJD,WAAY,aAAa;IACxB,gCAAe,CAAA;IACf,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;AACpB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAoLD;;;GAGG;AACI,MAAM,cAAc,GAAG,CAC7B,WAA0C,EAClB,EAAE;IAC1B,wBAAwB;IACxB,6DAA6D;IAC7D,MAAM,oBAAoB,GAAuB,IAAA,yBAAc,EAAC,WAAW,EAAE,OAAO,CAAC;QACpF,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI;QAC3B,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,IAAI,EAAE,oBAA8B,EAAE,CAAC;AACjD,CAAC,CAAC;AATW,QAAA,cAAc,kBASzB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\ttype IDeltaQueue,\n\ttype ReadOnlyInfo,\n\ttype IFluidCodeDetails,\n\tisFluidPackage,\n\ttype IConnectionDetails,\n} from \"@fluidframework/container-definitions/internal\";\nimport type { IErrorBase, ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport type { ConnectionMode, IClientDetails } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIContainerPackageInfo,\n\tIClientConfiguration,\n\tIDocumentMessage,\n\tISignalClient,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\nexport enum ReconnectMode {\n\tNever = \"Never\",\n\tDisabled = \"Disabled\",\n\tEnabled = \"Enabled\",\n}\n\nexport interface IConnectionStateChangeReason<T extends IErrorBase = IErrorBase> {\n\ttext: string;\n\terror?: T;\n}\n\n/**\n * Internal version of IConnectionDetails with props are only exposed internally\n */\nexport interface IConnectionDetailsInternal extends IConnectionDetails {\n\tmode: ConnectionMode;\n\tversion: string;\n\tinitialClients: ISignalClient[];\n\treason: IConnectionStateChangeReason;\n}\n\n/**\n * Connection manager (implements this interface) is responsible for maintaining connection\n * to relay service.\n */\nexport interface IConnectionManager {\n\treadonly connected: boolean;\n\n\treadonly clientId: string | undefined;\n\n\t/**\n\t * The queue of outbound delta messages\n\t */\n\treadonly outbound: IDeltaQueue<IDocumentMessage[]>;\n\n\t/**\n\t * Details of client\n\t */\n\treadonly clientDetails: IClientDetails;\n\n\t/**\n\t * Protocol version being used to communicate with the service\n\t */\n\treadonly version: string;\n\n\t/**\n\t * Max message size allowed to the delta manager\n\t */\n\treadonly maxMessageSize: number;\n\n\t/**\n\t * Service configuration provided by the service.\n\t */\n\treadonly serviceConfiguration: IClientConfiguration | undefined;\n\n\treadonly readOnlyInfo: ReadOnlyInfo;\n\n\t// Various connectivity properties for telemetry describing type of current connection\n\t// Things like connection mode, service info, etc.\n\t// Called when connection state changes (connect / disconnect)\n\treadonly connectionProps: ITelemetryBaseProperties;\n\n\t// Verbose information about connection logged to telemetry in case of issues with\n\t// maintaining healthy connection, including op gaps, not receiving join op in time, etc.\n\t// Contains details information, like sequence numbers at connection time, initial ops info, etc.\n\treadonly connectionVerboseProps: ITelemetryBaseProperties;\n\n\t/**\n\t * Prepares message to be sent. Fills in clientSequenceNumber.\n\t * Called only when active connection is present.\n\t */\n\tprepareMessageToSend(\n\t\tmessage: Omit<IDocumentMessage, \"clientSequenceNumber\">,\n\t): IDocumentMessage | undefined;\n\n\t/**\n\t * Called before incoming message is processed. Incoming messages can be combing from connection,\n\t * but also could come from storage.\n\t * This call allows connection manager to adjust knowledge about acked ops sent on previous connection.\n\t * Can be called at any time, including when there is no active connection.\n\t */\n\tbeforeProcessingIncomingOp(message: ISequencedDocumentMessage): void;\n\n\t/**\n\t * Submits signal to relay service.\n\t * Called only when active connection is present.\n\t */\n\tsubmitSignal: (content: string, targetClientId?: string) => void;\n\n\t/**\n\t * Submits messages to relay service.\n\t * Called only when active connection is present.\n\t */\n\tsendMessages(messages: IDocumentMessage[]): void;\n\n\t/**\n\t * Initiates connection to relay service (noop if already connected).\n\t */\n\tconnect(reason: IConnectionStateChangeReason, connectionMode?: ConnectionMode): void;\n\n\t/**\n\t * Disposed connection manager\n\t */\n\tdispose(error?: ICriticalContainerError, switchToReadonly?: boolean): void;\n\n\tget connectionMode(): ConnectionMode;\n}\n\n/**\n * This interface represents a set of callbacks provided by DeltaManager to IConnectionManager on its creation\n * IConnectionManager instance will use them to communicate to DeltaManager about various events.\n */\nexport interface IConnectionManagerFactoryArgs {\n\t/**\n\t * Called by connection manager for each incoming op. Some ops maybe delivered before\n\t * connectHandler is called (initial ops on socket connection)\n\t */\n\treadonly incomingOpHandler: (messages: ISequencedDocumentMessage[], reason: string) => void;\n\n\t/**\n\t * Called by connection manager for each incoming signal.\n\t * May be called before connectHandler is called (due to initial signals on socket connection)\n\t */\n\treadonly signalHandler: (signals: ISignalMessage[]) => void;\n\n\t/**\n\t * Called when connection manager experiences delay in connecting to relay service.\n\t * This can happen because client is offline, or service is busy and asks to not connect for some time.\n\t * Can be called many times while not connected.\n\t * Situation is considered resolved when connection is established and connectHandler is called.\n\t */\n\treadonly reconnectionDelayHandler: (delayMs: number, error: unknown) => void;\n\n\t/**\n\t * Called by connection manager whenever critical error happens and container should be closed.\n\t * Expects dispose() call in response to this call.\n\t */\n\treadonly closeHandler: (error?: IErrorBase) => void;\n\n\t/**\n\t * Called whenever connection to relay service is lost.\n\t */\n\treadonly disconnectHandler: (reason: IConnectionStateChangeReason) => void;\n\n\t/**\n\t * Called whenever new connection to rely service is established\n\t */\n\treadonly connectHandler: (connection: IConnectionDetailsInternal) => void;\n\n\t/**\n\t * Called whenever ping/pong messages are roundtripped on connection.\n\t */\n\treadonly pongHandler: (latency: number) => void;\n\n\t/**\n\t * Called whenever connection type changes from writable to read-only or vice versa.\n\t *\n\t * @remarks\n\t *\n\t * Connection can be read-only if user has no edit permissions, or if container forced\n\t * connection to be read-only.\n\t * This should not be confused with \"read\" / \"write\"connection mode which is internal\n\t * optimization.\n\t *\n\t * @param readonly - Whether or not the container is now read-only.\n\t * `undefined` indicates that user permissions are not yet known.\n\t * @param readonlyConnectionReason - reason/error if any for the change\n\t */\n\treadonly readonlyChangeHandler: (\n\t\treadonly?: boolean,\n\t\treadonlyConnectionReason?: IConnectionStateChangeReason,\n\t) => void;\n\n\t/**\n\t * Called whenever we try to start establishing a new connection.\n\t */\n\treadonly establishConnectionHandler: (reason: IConnectionStateChangeReason) => void;\n\n\t/**\n\t * Called whenever we cancel the connection in progress.\n\t */\n\treadonly cancelConnectionHandler: (reason: IConnectionStateChangeReason) => void;\n}\n\n/**\n * Gets the name of the Fluid package.\n * @param codeDetails- - Data structure used to describe the code to load on the Fluid document\n */\nexport const getPackageName = (\n\tcodeDetails: IFluidCodeDetails | undefined,\n): IContainerPackageInfo => {\n\t// TODO: use a real type\n\t// This is the normal path that any modern customer would hit\n\tconst containerPackageName: string | undefined = isFluidPackage(codeDetails?.package)\n\t\t? codeDetails?.package.name\n\t\t: codeDetails?.package;\n\treturn { name: containerPackageName as string };\n};\n"]}
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IContainer, ICodeDetailsLoader, IFluidCodeDetails,
|
|
6
|
-
import { FluidObject, IConfigProviderBase, IRequest, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { IClientDetails } from "@fluidframework/driver-definitions";
|
|
8
|
-
import { IDocumentServiceFactory, IUrlResolver } from "@fluidframework/driver-definitions/internal";
|
|
9
|
-
import { ProtocolHandlerBuilder } from "./protocol.js";
|
|
5
|
+
import type { IContainer, ICodeDetailsLoader, IFluidCodeDetails, IContainerPolicies } from "@fluidframework/container-definitions/internal";
|
|
6
|
+
import type { FluidObject, IConfigProviderBase, IRequest, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type { IClientDetails } from "@fluidframework/driver-definitions";
|
|
8
|
+
import type { IDocumentServiceFactory, IUrlResolver } from "@fluidframework/driver-definitions/internal";
|
|
9
|
+
import type { ProtocolHandlerBuilder } from "./protocol.js";
|
|
10
10
|
/**
|
|
11
11
|
* Properties necessary for creating and loading a container.
|
|
12
|
-
* @legacy
|
|
13
|
-
* @alpha
|
|
12
|
+
* @legacy @beta
|
|
14
13
|
*/
|
|
15
14
|
export interface ICreateAndLoadContainerProps {
|
|
16
15
|
/**
|
|
@@ -64,8 +63,7 @@ export interface ICreateAndLoadContainerProps {
|
|
|
64
63
|
}
|
|
65
64
|
/**
|
|
66
65
|
* Props used to load a container.
|
|
67
|
-
* @legacy
|
|
68
|
-
* @alpha
|
|
66
|
+
* @legacy @beta
|
|
69
67
|
*/
|
|
70
68
|
export interface ILoadExistingContainerProps extends ICreateAndLoadContainerProps {
|
|
71
69
|
/**
|
|
@@ -79,8 +77,7 @@ export interface ILoadExistingContainerProps extends ICreateAndLoadContainerProp
|
|
|
79
77
|
}
|
|
80
78
|
/**
|
|
81
79
|
* Props used to create a detached container.
|
|
82
|
-
* @legacy
|
|
83
|
-
* @alpha
|
|
80
|
+
* @legacy @beta
|
|
84
81
|
*/
|
|
85
82
|
export interface ICreateDetachedContainerProps extends ICreateAndLoadContainerProps {
|
|
86
83
|
/**
|
|
@@ -90,8 +87,7 @@ export interface ICreateDetachedContainerProps extends ICreateAndLoadContainerPr
|
|
|
90
87
|
}
|
|
91
88
|
/**
|
|
92
89
|
* Props used to rehydrate a detached container.
|
|
93
|
-
* @legacy
|
|
94
|
-
* @alpha
|
|
90
|
+
* @legacy @beta
|
|
95
91
|
*/
|
|
96
92
|
export interface IRehydrateDetachedContainerProps extends ICreateAndLoadContainerProps {
|
|
97
93
|
/**
|
|
@@ -103,23 +99,20 @@ export interface IRehydrateDetachedContainerProps extends ICreateAndLoadContaine
|
|
|
103
99
|
* Creates a new container using the specified code details but in an unattached state. While unattached, all
|
|
104
100
|
* updates will only be local until the user explicitly attaches the container to a service provider.
|
|
105
101
|
* @param createDetachedContainerProps - Services and properties necessary for creating detached container.
|
|
106
|
-
* @legacy
|
|
107
|
-
* @alpha
|
|
102
|
+
* @legacy @beta
|
|
108
103
|
*/
|
|
109
104
|
export declare function createDetachedContainer(createDetachedContainerProps: ICreateDetachedContainerProps): Promise<IContainer>;
|
|
110
105
|
/**
|
|
111
106
|
* Creates a new container using the specified snapshot but in an unattached state. While unattached, all
|
|
112
107
|
* updates will only be local until the user explicitly attaches the container to a service provider.
|
|
113
108
|
* @param rehydrateDetachedContainerProps - Services and properties necessary for rehydrating detached container from a previously serialized container's state.
|
|
114
|
-
* @legacy
|
|
115
|
-
* @alpha
|
|
109
|
+
* @legacy @beta
|
|
116
110
|
*/
|
|
117
111
|
export declare function rehydrateDetachedContainer(rehydrateDetachedContainerProps: IRehydrateDetachedContainerProps): Promise<IContainer>;
|
|
118
112
|
/**
|
|
119
113
|
* Loads a container with an existing snapshot from the service.
|
|
120
114
|
* @param loadExistingContainerProps - Services and properties necessary for loading an existing container.
|
|
121
|
-
* @legacy
|
|
122
|
-
* @alpha
|
|
115
|
+
* @legacy @beta
|
|
123
116
|
*/
|
|
124
117
|
export declare function loadExistingContainer(loadExistingContainerProps: ILoadExistingContainerProps): Promise<IContainer>;
|
|
125
118
|
//# sourceMappingURL=createAndLoadContainerUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAndLoadContainerUtils.d.ts","sourceRoot":"","sources":["../src/createAndLoadContainerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"createAndLoadContainerUtils.d.ts","sourceRoot":"","sources":["../src/createAndLoadContainerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACX,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EACX,uBAAuB,EACvB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAGrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE5D;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,sBAAsB,EAAE,uBAAuB,CAAC;IACzD;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IAExC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAElD;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAE1D;;;OAGG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAErE;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE9C;;OAEG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;CAC5D;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,4BAA4B;IAChF;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,4BAA4B;IAClF;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAiC,SAAQ,4BAA4B;IACrF;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC5C,4BAA4B,EAAE,6BAA6B,GACzD,OAAO,CAAC,UAAU,CAAC,CAMrB;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC/C,+BAA+B,EAAE,gCAAgC,GAC/D,OAAO,CAAC,UAAU,CAAC,CASrB;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAC1C,0BAA0B,EAAE,2BAA2B,GACrD,OAAO,CAAC,UAAU,CAAC,CAMrB"}
|
|
@@ -10,8 +10,7 @@ const loader_js_1 = require("./loader.js");
|
|
|
10
10
|
* Creates a new container using the specified code details but in an unattached state. While unattached, all
|
|
11
11
|
* updates will only be local until the user explicitly attaches the container to a service provider.
|
|
12
12
|
* @param createDetachedContainerProps - Services and properties necessary for creating detached container.
|
|
13
|
-
* @legacy
|
|
14
|
-
* @alpha
|
|
13
|
+
* @legacy @beta
|
|
15
14
|
*/
|
|
16
15
|
async function createDetachedContainer(createDetachedContainerProps) {
|
|
17
16
|
const loader = new loader_js_1.Loader(createDetachedContainerProps);
|
|
@@ -25,8 +24,7 @@ exports.createDetachedContainer = createDetachedContainer;
|
|
|
25
24
|
* Creates a new container using the specified snapshot but in an unattached state. While unattached, all
|
|
26
25
|
* updates will only be local until the user explicitly attaches the container to a service provider.
|
|
27
26
|
* @param rehydrateDetachedContainerProps - Services and properties necessary for rehydrating detached container from a previously serialized container's state.
|
|
28
|
-
* @legacy
|
|
29
|
-
* @alpha
|
|
27
|
+
* @legacy @beta
|
|
30
28
|
*/
|
|
31
29
|
async function rehydrateDetachedContainer(rehydrateDetachedContainerProps) {
|
|
32
30
|
const loader = new loader_js_1.Loader(rehydrateDetachedContainerProps);
|
|
@@ -39,8 +37,7 @@ exports.rehydrateDetachedContainer = rehydrateDetachedContainer;
|
|
|
39
37
|
/**
|
|
40
38
|
* Loads a container with an existing snapshot from the service.
|
|
41
39
|
* @param loadExistingContainerProps - Services and properties necessary for loading an existing container.
|
|
42
|
-
* @legacy
|
|
43
|
-
* @alpha
|
|
40
|
+
* @legacy @beta
|
|
44
41
|
*/
|
|
45
42
|
async function loadExistingContainer(loadExistingContainerProps) {
|
|
46
43
|
const loader = new loader_js_1.Loader(loadExistingContainerProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAndLoadContainerUtils.js","sourceRoot":"","sources":["../src/createAndLoadContainerUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoBH,2CAAqC;
|
|
1
|
+
{"version":3,"file":"createAndLoadContainerUtils.js","sourceRoot":"","sources":["../src/createAndLoadContainerUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoBH,2CAAqC;AAuGrC;;;;;GAKG;AACI,KAAK,UAAU,uBAAuB,CAC5C,4BAA2D;IAE3D,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC,4BAA4B,CAAC,CAAC;IACxD,OAAO,MAAM,CAAC,uBAAuB,CAAC,4BAA4B,CAAC,WAAW,EAAE;QAC/E,YAAY,EAAE,4BAA4B,CAAC,cAAc;QACzD,qBAAqB,EAAE,4BAA4B,CAAC,qBAAqB;KACzE,CAAC,CAAC;AACJ,CAAC;AARD,0DAQC;AAED;;;;;GAKG;AACI,KAAK,UAAU,0BAA0B,CAC/C,+BAAiE;IAEjE,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC,+BAA+B,CAAC,CAAC;IAC3D,OAAO,MAAM,CAAC,sCAAsC,CACnD,+BAA+B,CAAC,eAAe,EAC/C;QACC,YAAY,EAAE,+BAA+B,CAAC,cAAc;QAC5D,qBAAqB,EAAE,+BAA+B,CAAC,qBAAqB;KAC5E,CACD,CAAC;AACH,CAAC;AAXD,gEAWC;AAED;;;;GAIG;AACI,KAAK,UAAU,qBAAqB,CAC1C,0BAAuD;IAEvD,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC,0BAA0B,CAAC,CAAC;IACtD,OAAO,MAAM,CAAC,OAAO,CACpB,0BAA0B,CAAC,OAAO,EAClC,0BAA0B,CAAC,iBAAiB,CAC5C,CAAC;AACH,CAAC;AARD,sDAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIContainer,\n\tICodeDetailsLoader,\n\tIFluidCodeDetails,\n\tIContainerPolicies,\n} from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIConfigProviderBase,\n\tIRequest,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { IClientDetails } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentServiceFactory,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { Loader } from \"./loader.js\";\nimport type { ProtocolHandlerBuilder } from \"./protocol.js\";\n\n/**\n * Properties necessary for creating and loading a container.\n * @legacy @beta\n */\nexport interface ICreateAndLoadContainerProps {\n\t/**\n\t * The url resolver used by the loader for resolving external urls\n\t * into Fluid urls such that the container specified by the\n\t * external url can be loaded.\n\t */\n\treadonly urlResolver: IUrlResolver;\n\t/**\n\t * The document service factory take the Fluid url provided\n\t * by the resolved url and constructs all the necessary services\n\t * for communication with the container's server.\n\t */\n\treadonly documentServiceFactory: IDocumentServiceFactory;\n\t/**\n\t * The code loader handles loading the necessary code\n\t * for running a container once it is loaded.\n\t */\n\treadonly codeLoader: ICodeDetailsLoader;\n\n\t/**\n\t * A property bag of options/policies used by various layers\n\t * to control features\n\t */\n\treadonly options?: IContainerPolicies | undefined;\n\n\t/**\n\t * Scope is provided to all container and is a set of shared\n\t * services for container's to integrate with their host environment.\n\t */\n\treadonly scope?: FluidObject | undefined;\n\n\t/**\n\t * The logger that all telemetry should be pushed to.\n\t */\n\treadonly logger?: ITelemetryBaseLogger | undefined;\n\n\t/**\n\t * The configuration provider which may be used to control features.\n\t */\n\treadonly configProvider?: IConfigProviderBase | undefined;\n\n\t/**\n\t * Optional property for allowing the container to use a custom\n\t * protocol implementation for handling the quorum and/or the audience.\n\t */\n\treadonly protocolHandlerBuilder?: ProtocolHandlerBuilder | undefined;\n\n\t/**\n\t * Disables the Container from reconnecting if false, allows reconnect otherwise.\n\t */\n\treadonly allowReconnect?: boolean | undefined;\n\n\t/**\n\t * Client details provided in the override will be merged over the default client.\n\t */\n\treadonly clientDetailsOverride?: IClientDetails | undefined;\n}\n\n/**\n * Props used to load a container.\n * @legacy @beta\n */\nexport interface ILoadExistingContainerProps extends ICreateAndLoadContainerProps {\n\t/**\n\t * The request to resolve the container.\n\t */\n\treadonly request: IRequest;\n\n\t/**\n\t * Pending local state to be applied to the container.\n\t */\n\treadonly pendingLocalState?: string | undefined;\n}\n\n/**\n * Props used to create a detached container.\n * @legacy @beta\n */\nexport interface ICreateDetachedContainerProps extends ICreateAndLoadContainerProps {\n\t/**\n\t * The code details for the container to be created.\n\t */\n\treadonly codeDetails: IFluidCodeDetails;\n}\n\n/**\n * Props used to rehydrate a detached container.\n * @legacy @beta\n */\nexport interface IRehydrateDetachedContainerProps extends ICreateAndLoadContainerProps {\n\t/**\n\t * The serialized state returned by calling serialize on another container\n\t */\n\treadonly serializedState: string;\n}\n\n/**\n * Creates a new container using the specified code details but in an unattached state. While unattached, all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n * @param createDetachedContainerProps - Services and properties necessary for creating detached container.\n * @legacy @beta\n */\nexport async function createDetachedContainer(\n\tcreateDetachedContainerProps: ICreateDetachedContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(createDetachedContainerProps);\n\treturn loader.createDetachedContainer(createDetachedContainerProps.codeDetails, {\n\t\tcanReconnect: createDetachedContainerProps.allowReconnect,\n\t\tclientDetailsOverride: createDetachedContainerProps.clientDetailsOverride,\n\t});\n}\n\n/**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached, all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n * @param rehydrateDetachedContainerProps - Services and properties necessary for rehydrating detached container from a previously serialized container's state.\n * @legacy @beta\n */\nexport async function rehydrateDetachedContainer(\n\trehydrateDetachedContainerProps: IRehydrateDetachedContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(rehydrateDetachedContainerProps);\n\treturn loader.rehydrateDetachedContainerFromSnapshot(\n\t\trehydrateDetachedContainerProps.serializedState,\n\t\t{\n\t\t\tcanReconnect: rehydrateDetachedContainerProps.allowReconnect,\n\t\t\tclientDetailsOverride: rehydrateDetachedContainerProps.clientDetailsOverride,\n\t\t},\n\t);\n}\n\n/**\n * Loads a container with an existing snapshot from the service.\n * @param loadExistingContainerProps - Services and properties necessary for loading an existing container.\n * @legacy @beta\n */\nexport async function loadExistingContainer(\n\tloadExistingContainerProps: ILoadExistingContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(loadExistingContainerProps);\n\treturn loader.resolve(\n\t\tloadExistingContainerProps.request,\n\t\tloadExistingContainerProps.pendingLocalState,\n\t);\n}\n"]}
|
package/dist/debugLogger.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ITelemetryBaseEvent, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { ITelemetryLoggerExt, ITelemetryLoggerPropertyBags } from "@fluidframework/telemetry-utils/internal";
|
|
5
|
+
import type { ITelemetryBaseEvent, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { type ITelemetryLoggerExt, type ITelemetryLoggerPropertyBags } from "@fluidframework/telemetry-utils/internal";
|
|
7
7
|
/**
|
|
8
8
|
* Implementation of debug logger
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugLogger.d.ts","sourceRoot":"","sources":["../src/debugLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"debugLogger.d.ts","sourceRoot":"","sources":["../src/debugLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAoB,EAEpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EAIjC,MAAM,0CAA0C,CAAC;AAOlD;;GAEG;AACH,qBAAa,WAAY,YAAW,oBAAoB;IAwCtD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAxC1B;;;;;;;OAOG;WACW,gBAAgB,CAC7B,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,oBAAoB,EACjC,UAAU,CAAC,EAAE,4BAA4B,GACvC,mBAAmB;IA0BtB,OAAO;IAKP;;;;OAIG;IACI,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;CA4C7C"}
|
package/dist/debugLogger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugLogger.js","sourceRoot":"","sources":["../src/debugLogger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,+DAA8D;AAM9D,uEAMkD;AAClD,0FAA0F;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,CAAC,GAAG,IAAI,IAAI,OAAO,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;IAC/C,CAAC;CACD;AA7FD,kCA6FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"@fluid-internal/client-utils\";\nimport {\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n} from \"@fluidframework/core-interfaces\";\nimport {\n\
|
|
1
|
+
{"version":3,"file":"debugLogger.js","sourceRoot":"","sources":["../src/debugLogger.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,+DAA8D;AAM9D,uEAMkD;AAClD,0FAA0F;AAC1F,kDAA6B;AAG7B,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,eAAQ,CAAC;AAE1C;;GAEG;AACH,MAAa,WAAW;IACvB;;;;;;;OAOG;IACI,MAAM,CAAC,gBAAgB,CAC7B,SAAiB,EACjB,UAAiC,EACjC,UAAyC;QAEzC,uEAAuE;QACvE,MAAM,KAAK,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;QAEvC,+CAA+C;QAC/C,uFAAuF;QACvF,MAAM,QAAQ,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;QAC1C,QAAQ,CAAC,GAAG,GAAG,UAAU,GAAG,IAAe;YAC1C,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;gBAC5B,2DAA2D;gBAC3D,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;YAC5B,CAAC;iBAAM,CAAC;gBACP,4EAA4E;gBAC5E,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YACxB,CAAC;QACF,CAAC,CAAC;QACF,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;QAExB,OAAO,IAAA,gCAAqB,EAAC;YAC5B,SAAS;YACT,OAAO,EAAE,CAAC,UAAU,E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,OAAe,CAAC;QACpB,IAAI,CAAC;YACJ,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACR,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC;YAC3B,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;QAED,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACtB,OAAO,GAAG,EAAE,CAAC;QACd,CAAC;QAED,6CAA6C;QAC7C,IAAI,OAAO,EAAE,CAAC;YACb,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;QACvB,CAAC;QAED,oBAAoB;QACpB,gEAAgE;QAChE,MAAM,CAAC,GAAG,IAAI,IAAI,OAAO,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;IAC/C,CAAC;CACD;AA7FD,kCA6FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"@fluid-internal/client-utils\";\nimport type {\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n\tITelemetryBaseProperties,\n} from \"@fluidframework/core-interfaces\";\nimport {\n\ttype ITelemetryLoggerExt,\n\ttype ITelemetryLoggerPropertyBags,\n\tcreateMultiSinkLogger,\n\teventNamespaceSeparator,\n\tformatTick,\n} from \"@fluidframework/telemetry-utils/internal\";\n// This import style is necessary to ensure the emitted JS code works in both CJS and ESM.\nimport debugPkg from \"debug\";\nimport type { IDebugger } from \"debug\";\n\nconst { debug: registerDebug } = debugPkg;\n\n/**\n * Implementation of debug logger\n */\nexport class DebugLogger implements ITelemetryBaseLogger {\n\t/**\n\t * Mix in debug logger with another logger.\n\t * Returned logger will output events to both newly created debug logger, as well as base logger\n\t * @param namespace - Telemetry event name prefix to add to all events\n\t * @param properties - Base properties to add to all events\n\t * @param propertyGetters - Getters to add additional properties to all events\n\t * @param baseLogger - Base logger to output events (in addition to debug logger being created). Can be undefined.\n\t */\n\tpublic static mixinDebugLogger(\n\t\tnamespace: string,\n\t\tbaseLogger?: ITelemetryBaseLogger,\n\t\tproperties?: ITelemetryLoggerPropertyBags,\n\t): ITelemetryLoggerExt {\n\t\t// Setup base logger upfront, such that host can disable it (if needed)\n\t\tconst debug = registerDebug(namespace);\n\n\t\t// Create one for errors that is always enabled\n\t\t// It can be silenced by replacing console.error if the debug namespace is not enabled.\n\t\tconst debugErr = registerDebug(namespace);\n\t\tdebugErr.log = function (...args: unknown[]): void {\n\t\t\tif (debug.enabled === true) {\n\t\t\t\t// if the namespace is enabled, just use the default logger\n\t\t\t\tregisterDebug.log(...args);\n\t\t\t} else {\n\t\t\t\t// other wise, use the console logger (which could be replaced and silenced)\n\t\t\t\tconsole.error(...args);\n\t\t\t}\n\t\t};\n\t\tdebugErr.enabled = true;\n\n\t\treturn createMultiSinkLogger({\n\t\t\tnamespace,\n\t\t\tloggers: [baseLogger, new DebugLogger(debug, debugErr)],\n\t\t\tproperties,\n\t\t\ttryInheritProperties: true,\n\t\t});\n\t}\n\n\tprivate constructor(\n\t\tprivate readonly debug: IDebugger,\n\t\tprivate readonly debugErr: IDebugger,\n\t) {}\n\n\t/**\n\t * Send an event to debug loggers\n\t *\n\t * @param event - the event to send\n\t */\n\tpublic send(event: ITelemetryBaseEvent): void {\n\t\tconst newEvent: ITelemetryBaseProperties = { ...event };\n\t\tconst isError = newEvent.category === \"error\";\n\t\tlet logger = isError ? this.debugErr : this.debug;\n\n\t\t// Use debug's coloring schema for base of the event\n\t\tconst index = event.eventName.lastIndexOf(eventNamespaceSeparator);\n\t\tconst name = event.eventName.slice(Math.max(0, index + 1));\n\t\tif (index > 0) {\n\t\t\tlogger = logger.extend(event.eventName.slice(0, index));\n\t\t}\n\t\tnewEvent.eventName = undefined;\n\n\t\tlet tick = \"\";\n\t\ttick = `tick=${formatTick(performanceNow())}`;\n\n\t\t// Extract stack to put it last, but also to avoid escaping '\\n' in it by JSON.stringify below\n\t\tconst stack = newEvent.stack ?? \"\";\n\t\tnewEvent.stack = undefined;\n\n\t\t// Watch out for circular references - they can come from two sources\n\t\t// 1) error object - we do not control it and should remove it and retry\n\t\t// 2) properties supplied by telemetry caller - that's a bug that should be addressed!\n\t\tlet payload: string;\n\t\ttry {\n\t\t\tpayload = JSON.stringify(newEvent);\n\t\t} catch {\n\t\t\tnewEvent.error = undefined;\n\t\t\tpayload = JSON.stringify(newEvent);\n\t\t}\n\n\t\tif (payload === \"{}\") {\n\t\t\tpayload = \"\";\n\t\t}\n\n\t\t// Force errors out, to help with diagnostics\n\t\tif (isError) {\n\t\t\tlogger.enabled = true;\n\t\t}\n\n\t\t// Print multi-line.\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\tlogger(`${name} ${payload} ${tick} ${stack}`);\n\t}\n}\n"]}
|
package/dist/deltaManager.d.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
6
|
-
import { IDeltaManagerEvents, IDeltaManagerFull, IDeltaQueue,
|
|
7
|
-
import { IEventProvider, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
8
|
-
import { IThrottlingWarning } from "@fluidframework/core-interfaces/internal";
|
|
9
|
-
import { ConnectionMode } from "@fluidframework/driver-definitions";
|
|
10
|
-
import { IDocumentService, IDocumentMessage, MessageType, ISequencedDocumentMessage, ISignalMessage, type IClientDetails, type IClientConfiguration } from "@fluidframework/driver-definitions/internal";
|
|
11
|
-
import { type ITelemetryErrorEventExt, ITelemetryLoggerExt, EventEmitterWithErrorHandling } from "@fluidframework/telemetry-utils/internal";
|
|
12
|
-
import { IConnectionDetailsInternal, IConnectionManager, IConnectionManagerFactoryArgs, IConnectionStateChangeReason } from "./contracts.js";
|
|
5
|
+
import type { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
6
|
+
import type { IDeltaManagerEvents, IDeltaManagerFull, IDeltaQueue, IDeltaSender, ReadOnlyInfo } from "@fluidframework/container-definitions/internal";
|
|
7
|
+
import type { IEventProvider, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
8
|
+
import type { IThrottlingWarning } from "@fluidframework/core-interfaces/internal";
|
|
9
|
+
import type { ConnectionMode } from "@fluidframework/driver-definitions";
|
|
10
|
+
import { type IDocumentService, type IDocumentMessage, MessageType, type ISequencedDocumentMessage, type ISignalMessage, type IClientDetails, type IClientConfiguration } from "@fluidframework/driver-definitions/internal";
|
|
11
|
+
import { type ITelemetryErrorEventExt, type ITelemetryLoggerExt, EventEmitterWithErrorHandling } from "@fluidframework/telemetry-utils/internal";
|
|
12
|
+
import type { IConnectionDetailsInternal, IConnectionManager, IConnectionManagerFactoryArgs, IConnectionStateChangeReason } from "./contracts.js";
|
|
13
13
|
export interface IConnectionArgs {
|
|
14
14
|
mode?: ConnectionMode;
|
|
15
15
|
fetchOpsFromStorage?: boolean;
|