@fluidframework/container-definitions 2.0.0-internal.3.2.2 → 2.0.0-internal.3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/loader.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IRequest, IResponse, IFluidRouter } from "@fluidframework/core-interfaces";
5
+ import { IRequest, IResponse, IFluidRouter, FluidObject } from "@fluidframework/core-interfaces";
6
6
  import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMessage, ISequencedProposal, ISnapshotTree } from "@fluidframework/protocol-definitions";
7
7
  import { IResolvedUrl } from "@fluidframework/driver-definitions";
8
8
  import { IEvent, IEventProvider } from "@fluidframework/common-definitions";
@@ -399,6 +399,18 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
399
399
  * @alpha
400
400
  */
401
401
  forceReadonly?(readonly: boolean): any;
402
+ /**
403
+ * Exposes the entryPoint for the container.
404
+ * Use this as the primary way of getting access to the user-defined logic within the container.
405
+ * If the method is undefined or the returned promise returns undefined (meaning that exposing the entryPoint
406
+ * hasn't been implemented in a particular scenario) fall back to the current approach of requesting the default
407
+ * object of the container through the request pattern.
408
+ *
409
+ * @remarks The plan is that eventually IContainer will no longer implement IFluidRouter (and thus won't have a
410
+ * request() method), this method will no longer be optional, and it will become the only way to access
411
+ * the entryPoint for the container.
412
+ */
413
+ getEntryPoint?(): Promise<FluidObject | undefined>;
402
414
  }
403
415
  /**
404
416
  * The Runtime's view of the Loader, used for loading Containers
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EACN,cAAc,EACd,gBAAgB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
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA2gBH;;GAEG;AACH,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACvB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACpB,CAAC,EAtBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse, IFluidRouter } from \"@fluidframework/core-interfaces\";\nimport {\n\tIClientDetails,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISequencedDocumentMessage,\n\tISequencedProposal,\n\tISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport { IFluidCodeDetails, IFluidPackage, IProvideFluidCodeDetailsComparer } from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n\t/**\n\t * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n\t */\n\tmodule: IFluidModule;\n\n\t/**\n\t * Code details associated with the module. Represents a document schema this module supports.\n\t * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}\n\t * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n\t * quorum.\n\t */\n\tdetails: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {\n\t/**\n\t * Load the code module (package) that can interact with the document.\n\t *\n\t * @param source - Code proposal that articulates the current schema the document is written in.\n\t * @returns - Code module entry point along with the code details associated with it.\n\t */\n\tload(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n\t/**\n\t * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n\t */\n\treadonly resolvedPackage: Readonly<IFluidPackage>;\n\t/**\n\t * If not undefined, this id will be used to cache the entry point for the code package\n\t */\n\treadonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n\t/**\n\t * Resolves a Fluid code details into a form that can be loaded.\n\t * @param details - The Fluid code details to resolve.\n\t * @returns - A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n\t * an optional resolvedPackageCacheId if the loaded package should be cached.\n\t */\n\tresolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n *\n * @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.\n */\nexport interface ICodeAllowList {\n\t/**\n\t * @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.\n\t */\n\ttestSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n */\nexport interface IContainerEvents extends IEvent {\n\t/**\n\t * Emitted when the readonly state of the container changes.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `readonly`: Whether or not the container is now in a readonly state.\n\t *\n\t * @see {@link IContainer.readOnlyInfo}\n\t */\n\t(event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n\t/**\n\t * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.connect}\n\t */\n\t(event: \"connected\", listener: (clientId: string) => void);\n\n\t/**\n\t * Fires when new container code details have been proposed, prior to acceptance.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `codeDetails`: The code details being proposed.\n\t *\n\t * - `proposal`: NOT RECOMMENDED FOR USE.\n\t *\n\t * @see {@link IContainer.proposeCodeDetails}\n\t */\n\t(\n\t\tevent: \"codeDetailsProposed\",\n\t\tlistener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void,\n\t);\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\t(event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.disconnect}\n\t */\n\t(event: \"disconnected\", listener: () => void);\n\n\t/**\n\t * Emitted when a {@link AttachState.Detached | detached} container is\n\t * {@link AttachState.Attached | attached} to the Fluid service.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.attachState}\n\t *\n\t * - {@link IContainer.attach}\n\t */\n\t(event: \"attached\", listener: () => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is closed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.close}\n\t */\n\t(event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is disposed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.dispose}\n\t */\n\t(event: \"disposed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n\t * For now, use of this should be avoided when possible.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `error`: The warning describing the encountered state.\n\t */\n\t(event: \"warning\", listener: (error: ContainerWarning) => void);\n\n\t/**\n\t * Emitted immediately after processing an incoming operation (op).\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n\t * ops directly on the {@link IContainer}.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `message`: The op that was processed.\n\t */\n\t(event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n\t/**\n\t * Emitted upon the first local change while the Container is in the \"saved\" state.\n\t * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"dirty\", listener: (dirty: boolean) => void);\n\n\t/**\n\t * Emitted when all local changes/edits have been acknowledged by the service.\n\t * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"saved\", listener: (dirty: boolean) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n\t/**\n\t * The container is not connected to the delta server.\n\t * Note - When in this state the container may be about to reconnect,\n\t * or may remain disconnected until explicitly told to connect.\n\t */\n\texport type Disconnected = 0;\n\n\t/**\n\t * The container is disconnected but actively trying to establish a new connection.\n\t * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n\t */\n\texport type EstablishingConnection = 3;\n\n\t/**\n\t * The container has an inbound connection only, and is catching up to the latest known state from the service.\n\t */\n\texport type CatchingUp = 1;\n\n\t/**\n\t * The container is fully connected and syncing.\n\t */\n\texport type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n */\nexport type ConnectionState =\n\t| ConnectionState.Disconnected\n\t| ConnectionState.EstablishingConnection\n\t| ConnectionState.CatchingUp\n\t| ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\t/**\n\t * The Delta Manager supporting the op stream for this Container\n\t */\n\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n\t/**\n\t * The collection of write clients which were connected as of the current sequence number.\n\t * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Represents the resolved url to the Container.\n\t * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n\t */\n\tresolvedUrl: IResolvedUrl | undefined;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\t/**\n\t * Get the code details that are currently specified for the container.\n\t * @returns The current code details if any are specified, undefined if none are specified.\n\t */\n\tgetSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Get the code details that were used to load the container.\n\t * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n\t * loaded.\n\t */\n\tgetLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Returns true if the container has been closed, otherwise false.\n\t */\n\treadonly closed: boolean;\n\n\t/**\n\t * Whether or not there are any local changes that have not been saved.\n\t */\n\treadonly isDirty: boolean;\n\n\t/**\n\t * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.\n\t * The container is not expected to be used anymore once it is disposed.\n\t *\n\t * @param error - If the container is being disposed due to error, this provides details about the error that\n\t * resulted in disposing it.\n\t */\n\tdispose?(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container.\n\t *\n\t * @param error - If the container is being closed due to error, this provides details about the error that\n\t * resulted in closing it.\n\t */\n\tclose(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container and returns serialized local state intended to be\n\t * given to a newly loaded container.\n\t * @experimental\n\t * {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}\n\t */\n\tcloseAndGetPendingLocalState(): string;\n\n\t/**\n\t * Propose new code details that define the code to be loaded for this container's runtime.\n\t *\n\t * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n\t */\n\tproposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n\t/**\n\t * Attaches the Container to the Container specified by the given Request.\n\t *\n\t * @privateRemarks\n\t *\n\t * TODO - in the case of failure options should give a retry policy.\n\t * Or some continuation function that allows attachment to a secondary document.\n\t */\n\tattach(request: IRequest): Promise<void>;\n\n\t/**\n\t * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container\n\t * is an error.\n\t */\n\tserialize(): string;\n\n\t/**\n\t * Get an absolute URL for a provided container-relative request URL.\n\t * If the container is not attached, this will return undefined.\n\t *\n\t * @param relativeUrl - A container-relative request URL.\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Issue a request against the container for a resource.\n\t * @param request - The request to be issued against the container\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * Provides the current state of the container's connection to the ordering service.\n\t *\n\t * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n\t */\n\treadonly connectionState: ConnectionState;\n\n\t/**\n\t * Attempts to connect the container to the delta stream and process ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the\n\t * \"connected\" event will be fired if/when connection succeeds.\n\t */\n\tconnect(): void;\n\n\t/**\n\t * Disconnects the container from the delta stream and stops processing ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the\n\t * \"disconnected\" event will be fired when disconnection completes.\n\t */\n\tdisconnect(): void;\n\n\t/**\n\t * The audience information for all clients currently associated with the document in the current session.\n\t */\n\treadonly audience: IAudience;\n\n\t/**\n\t * The server provided ID of the client.\n\t *\n\t * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},\n\t * otherwise will be `undefined`.\n\t */\n\treadonly clientId?: string | undefined;\n\n\t/**\n\t * Tells if container is in read-only mode.\n\t *\n\t * @remarks\n\t *\n\t * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n\t * Readonly state can be because of no storage write permission,\n\t * or due to host forcing readonly mode for container.\n\t *\n\t * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n\t * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n\t *\n\t * It is undefined if we have not yet established websocket connection\n\t * and do not know if user has write access to a file.\n\t */\n\treadonly readOnlyInfo: ReadOnlyInfo;\n\n\t/**\n\t * Allows the host to have the container force to be in read-only mode\n\t * @param readonly - Boolean that toggles if read-only policies will be enforced\n\t * @alpha\n\t */\n\tforceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n\t/**\n\t * Resolves the resource specified by the URL + headers contained in the request object\n\t * to the underlying container that will resolve the request.\n\t *\n\t * @remarks\n\t *\n\t * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n\t * a request against the server found from the resolve step.\n\t */\n\tresolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n\t/**\n\t * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\tcreateDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n\t/**\n\t * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\trehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n\t[key in string | number]: any;\n} & {\n\t/**\n\t * Set caching behavior for the loader. If true, we will load a container from cache if one\n\t * with the same id/version exists or create a new container and cache it if it does not. If\n\t * false, always load a new container and don't cache it. If the container has already been\n\t * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n\t * request will override the Loader's value.\n\t * Defaults to true.\n\t */\n\tcache?: boolean;\n\n\t/**\n\t * Provide the current Loader through the scope object when creating Containers. It is added\n\t * as the `ILoader` property, and will overwrite an existing property of the same name on the\n\t * scope. Useful for when the host wants to provide the current Loader's functionality to\n\t * individual Data Stores, which is typically expected when creating with a Loader.\n\t * Defaults to true.\n\t */\n\tprovideScopeLoader?: boolean;\n\n\t/**\n\t * Max time (in ms) container will wait for a leave message of a disconnected client.\n\t */\n\tmaxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n\t/**\n\t * Override the Loader's default caching behavior for this container.\n\t */\n\tcache = \"fluid-cache\",\n\n\tclientDetails = \"fluid-client-details\",\n\n\t/**\n\t * Start the container in a paused, unconnected state. Defaults to false\n\t */\n\tloadMode = \"loadMode\",\n\treconnect = \"fluid-reconnect\",\n\tsequenceNumber = \"fluid-sequence-number\",\n\n\t/**\n\t * One of the following:\n\t * null or \"null\": use ops, no snapshots\n\t * undefined: fetch latest snapshot\n\t * otherwise, version sha to load snapshot\n\t */\n\tversion = \"version\",\n}\n\nexport interface IContainerLoadMode {\n\topsBeforeReturn?: /*\n\t * No trailing ops are applied before container is returned.\n\t * Default value.\n\t */\n\t| undefined\n\t\t/*\n\t\t * Only cached trailing ops are applied before returning container.\n\t\t * Caching is optional and could be implemented by the driver.\n\t\t * If driver does not implement any kind of local caching strategy, this is same as above.\n\t\t * Driver may cache a lot of ops, so care needs to be exercised (see below).\n\t\t */\n\t\t| \"cached\"\n\t\t/*\n\t\t * All trailing ops in storage are fetched and applied before container is returned\n\t\t * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n\t\t * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n\t\t * recommended to have some progress UX / cancellation built into loading flow when using this option.\n\t\t */\n\t\t| \"all\";\n\n\tdeltaConnection?: /*\n\t * Connection to delta stream is made only when Container.connect() call is made. Op processing\n\t * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n\t */\n\t| \"none\"\n\t\t/*\n\t\t * Connection to delta stream is made only when Container.connect() call is made.\n\t\t * Op fetching from storage is performed and ops are applied as they come in.\n\t\t * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n\t\t * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n\t\t */\n\t\t| \"delayed\"\n\t\t/*\n\t\t * Connection to delta stream is made right away.\n\t\t * Ops processing is enabled and ops are flowing through the system.\n\t\t * Default value.\n\t\t */\n\t\t| undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n\t[LoaderHeader.cache]: boolean;\n\t[LoaderHeader.clientDetails]: IClientDetails;\n\t[LoaderHeader.loadMode]: IContainerLoadMode;\n\t[LoaderHeader.sequenceNumber]: number;\n\t[LoaderHeader.reconnect]: boolean;\n\t[LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n\treadonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.\n */\nexport interface IPendingLocalState {\n\turl: string;\n\tpendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.\n *\n * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n\tblobsContents: { [path: string]: ArrayBufferLike };\n\ttrees: { [path: string]: ISnapshotTreeWithBlobContents };\n}\n"]}
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwhBH;;GAEG;AACH,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACvB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACpB,CAAC,EAtBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse, IFluidRouter, FluidObject } from \"@fluidframework/core-interfaces\";\nimport {\n\tIClientDetails,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISequencedDocumentMessage,\n\tISequencedProposal,\n\tISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport { IFluidCodeDetails, IFluidPackage, IProvideFluidCodeDetailsComparer } from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n\t/**\n\t * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n\t */\n\tmodule: IFluidModule;\n\n\t/**\n\t * Code details associated with the module. Represents a document schema this module supports.\n\t * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}\n\t * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n\t * quorum.\n\t */\n\tdetails: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {\n\t/**\n\t * Load the code module (package) that can interact with the document.\n\t *\n\t * @param source - Code proposal that articulates the current schema the document is written in.\n\t * @returns - Code module entry point along with the code details associated with it.\n\t */\n\tload(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n\t/**\n\t * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n\t */\n\treadonly resolvedPackage: Readonly<IFluidPackage>;\n\t/**\n\t * If not undefined, this id will be used to cache the entry point for the code package\n\t */\n\treadonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n\t/**\n\t * Resolves a Fluid code details into a form that can be loaded.\n\t * @param details - The Fluid code details to resolve.\n\t * @returns - A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n\t * an optional resolvedPackageCacheId if the loaded package should be cached.\n\t */\n\tresolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n *\n * @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.\n */\nexport interface ICodeAllowList {\n\t/**\n\t * @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.\n\t */\n\ttestSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n */\nexport interface IContainerEvents extends IEvent {\n\t/**\n\t * Emitted when the readonly state of the container changes.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `readonly`: Whether or not the container is now in a readonly state.\n\t *\n\t * @see {@link IContainer.readOnlyInfo}\n\t */\n\t(event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n\t/**\n\t * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.connect}\n\t */\n\t(event: \"connected\", listener: (clientId: string) => void);\n\n\t/**\n\t * Fires when new container code details have been proposed, prior to acceptance.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `codeDetails`: The code details being proposed.\n\t *\n\t * - `proposal`: NOT RECOMMENDED FOR USE.\n\t *\n\t * @see {@link IContainer.proposeCodeDetails}\n\t */\n\t(\n\t\tevent: \"codeDetailsProposed\",\n\t\tlistener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void,\n\t);\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\t(event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.disconnect}\n\t */\n\t(event: \"disconnected\", listener: () => void);\n\n\t/**\n\t * Emitted when a {@link AttachState.Detached | detached} container is\n\t * {@link AttachState.Attached | attached} to the Fluid service.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.attachState}\n\t *\n\t * - {@link IContainer.attach}\n\t */\n\t(event: \"attached\", listener: () => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is closed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.close}\n\t */\n\t(event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is disposed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.dispose}\n\t */\n\t(event: \"disposed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n\t * For now, use of this should be avoided when possible.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `error`: The warning describing the encountered state.\n\t */\n\t(event: \"warning\", listener: (error: ContainerWarning) => void);\n\n\t/**\n\t * Emitted immediately after processing an incoming operation (op).\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n\t * ops directly on the {@link IContainer}.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `message`: The op that was processed.\n\t */\n\t(event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n\t/**\n\t * Emitted upon the first local change while the Container is in the \"saved\" state.\n\t * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"dirty\", listener: (dirty: boolean) => void);\n\n\t/**\n\t * Emitted when all local changes/edits have been acknowledged by the service.\n\t * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"saved\", listener: (dirty: boolean) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n\t/**\n\t * The container is not connected to the delta server.\n\t * Note - When in this state the container may be about to reconnect,\n\t * or may remain disconnected until explicitly told to connect.\n\t */\n\texport type Disconnected = 0;\n\n\t/**\n\t * The container is disconnected but actively trying to establish a new connection.\n\t * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n\t */\n\texport type EstablishingConnection = 3;\n\n\t/**\n\t * The container has an inbound connection only, and is catching up to the latest known state from the service.\n\t */\n\texport type CatchingUp = 1;\n\n\t/**\n\t * The container is fully connected and syncing.\n\t */\n\texport type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n */\nexport type ConnectionState =\n\t| ConnectionState.Disconnected\n\t| ConnectionState.EstablishingConnection\n\t| ConnectionState.CatchingUp\n\t| ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\t/**\n\t * The Delta Manager supporting the op stream for this Container\n\t */\n\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n\t/**\n\t * The collection of write clients which were connected as of the current sequence number.\n\t * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Represents the resolved url to the Container.\n\t * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n\t */\n\tresolvedUrl: IResolvedUrl | undefined;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\t/**\n\t * Get the code details that are currently specified for the container.\n\t * @returns The current code details if any are specified, undefined if none are specified.\n\t */\n\tgetSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Get the code details that were used to load the container.\n\t * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n\t * loaded.\n\t */\n\tgetLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Returns true if the container has been closed, otherwise false.\n\t */\n\treadonly closed: boolean;\n\n\t/**\n\t * Whether or not there are any local changes that have not been saved.\n\t */\n\treadonly isDirty: boolean;\n\n\t/**\n\t * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.\n\t * The container is not expected to be used anymore once it is disposed.\n\t *\n\t * @param error - If the container is being disposed due to error, this provides details about the error that\n\t * resulted in disposing it.\n\t */\n\tdispose?(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container.\n\t *\n\t * @param error - If the container is being closed due to error, this provides details about the error that\n\t * resulted in closing it.\n\t */\n\tclose(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container and returns serialized local state intended to be\n\t * given to a newly loaded container.\n\t * @experimental\n\t * {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}\n\t */\n\tcloseAndGetPendingLocalState(): string;\n\n\t/**\n\t * Propose new code details that define the code to be loaded for this container's runtime.\n\t *\n\t * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n\t */\n\tproposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n\t/**\n\t * Attaches the Container to the Container specified by the given Request.\n\t *\n\t * @privateRemarks\n\t *\n\t * TODO - in the case of failure options should give a retry policy.\n\t * Or some continuation function that allows attachment to a secondary document.\n\t */\n\tattach(request: IRequest): Promise<void>;\n\n\t/**\n\t * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container\n\t * is an error.\n\t */\n\tserialize(): string;\n\n\t/**\n\t * Get an absolute URL for a provided container-relative request URL.\n\t * If the container is not attached, this will return undefined.\n\t *\n\t * @param relativeUrl - A container-relative request URL.\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Issue a request against the container for a resource.\n\t * @param request - The request to be issued against the container\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * Provides the current state of the container's connection to the ordering service.\n\t *\n\t * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n\t */\n\treadonly connectionState: ConnectionState;\n\n\t/**\n\t * Attempts to connect the container to the delta stream and process ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the\n\t * \"connected\" event will be fired if/when connection succeeds.\n\t */\n\tconnect(): void;\n\n\t/**\n\t * Disconnects the container from the delta stream and stops processing ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the\n\t * \"disconnected\" event will be fired when disconnection completes.\n\t */\n\tdisconnect(): void;\n\n\t/**\n\t * The audience information for all clients currently associated with the document in the current session.\n\t */\n\treadonly audience: IAudience;\n\n\t/**\n\t * The server provided ID of the client.\n\t *\n\t * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},\n\t * otherwise will be `undefined`.\n\t */\n\treadonly clientId?: string | undefined;\n\n\t/**\n\t * Tells if container is in read-only mode.\n\t *\n\t * @remarks\n\t *\n\t * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n\t * Readonly state can be because of no storage write permission,\n\t * or due to host forcing readonly mode for container.\n\t *\n\t * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n\t * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n\t *\n\t * It is undefined if we have not yet established websocket connection\n\t * and do not know if user has write access to a file.\n\t */\n\treadonly readOnlyInfo: ReadOnlyInfo;\n\n\t/**\n\t * Allows the host to have the container force to be in read-only mode\n\t * @param readonly - Boolean that toggles if read-only policies will be enforced\n\t * @alpha\n\t */\n\tforceReadonly?(readonly: boolean);\n\n\t/**\n\t * Exposes the entryPoint for the container.\n\t * Use this as the primary way of getting access to the user-defined logic within the container.\n\t * If the method is undefined or the returned promise returns undefined (meaning that exposing the entryPoint\n\t * hasn't been implemented in a particular scenario) fall back to the current approach of requesting the default\n\t * object of the container through the request pattern.\n\t *\n\t * @remarks The plan is that eventually IContainer will no longer implement IFluidRouter (and thus won't have a\n\t * request() method), this method will no longer be optional, and it will become the only way to access\n\t * the entryPoint for the container.\n\t */\n\tgetEntryPoint?(): Promise<FluidObject | undefined>;\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n\t/**\n\t * Resolves the resource specified by the URL + headers contained in the request object\n\t * to the underlying container that will resolve the request.\n\t *\n\t * @remarks\n\t *\n\t * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n\t * a request against the server found from the resolve step.\n\t */\n\tresolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n\t/**\n\t * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\tcreateDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n\t/**\n\t * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\trehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n\t[key in string | number]: any;\n} & {\n\t/**\n\t * Set caching behavior for the loader. If true, we will load a container from cache if one\n\t * with the same id/version exists or create a new container and cache it if it does not. If\n\t * false, always load a new container and don't cache it. If the container has already been\n\t * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n\t * request will override the Loader's value.\n\t * Defaults to true.\n\t */\n\tcache?: boolean;\n\n\t/**\n\t * Provide the current Loader through the scope object when creating Containers. It is added\n\t * as the `ILoader` property, and will overwrite an existing property of the same name on the\n\t * scope. Useful for when the host wants to provide the current Loader's functionality to\n\t * individual Data Stores, which is typically expected when creating with a Loader.\n\t * Defaults to true.\n\t */\n\tprovideScopeLoader?: boolean;\n\n\t/**\n\t * Max time (in ms) container will wait for a leave message of a disconnected client.\n\t */\n\tmaxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n\t/**\n\t * Override the Loader's default caching behavior for this container.\n\t */\n\tcache = \"fluid-cache\",\n\n\tclientDetails = \"fluid-client-details\",\n\n\t/**\n\t * Start the container in a paused, unconnected state. Defaults to false\n\t */\n\tloadMode = \"loadMode\",\n\treconnect = \"fluid-reconnect\",\n\tsequenceNumber = \"fluid-sequence-number\",\n\n\t/**\n\t * One of the following:\n\t * null or \"null\": use ops, no snapshots\n\t * undefined: fetch latest snapshot\n\t * otherwise, version sha to load snapshot\n\t */\n\tversion = \"version\",\n}\n\nexport interface IContainerLoadMode {\n\topsBeforeReturn?: /*\n\t * No trailing ops are applied before container is returned.\n\t * Default value.\n\t */\n\t| undefined\n\t\t/*\n\t\t * Only cached trailing ops are applied before returning container.\n\t\t * Caching is optional and could be implemented by the driver.\n\t\t * If driver does not implement any kind of local caching strategy, this is same as above.\n\t\t * Driver may cache a lot of ops, so care needs to be exercised (see below).\n\t\t */\n\t\t| \"cached\"\n\t\t/*\n\t\t * All trailing ops in storage are fetched and applied before container is returned\n\t\t * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n\t\t * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n\t\t * recommended to have some progress UX / cancellation built into loading flow when using this option.\n\t\t */\n\t\t| \"all\";\n\n\tdeltaConnection?: /*\n\t * Connection to delta stream is made only when Container.connect() call is made. Op processing\n\t * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n\t */\n\t| \"none\"\n\t\t/*\n\t\t * Connection to delta stream is made only when Container.connect() call is made.\n\t\t * Op fetching from storage is performed and ops are applied as they come in.\n\t\t * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n\t\t * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n\t\t */\n\t\t| \"delayed\"\n\t\t/*\n\t\t * Connection to delta stream is made right away.\n\t\t * Ops processing is enabled and ops are flowing through the system.\n\t\t * Default value.\n\t\t */\n\t\t| undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n\t[LoaderHeader.cache]: boolean;\n\t[LoaderHeader.clientDetails]: IClientDetails;\n\t[LoaderHeader.loadMode]: IContainerLoadMode;\n\t[LoaderHeader.sequenceNumber]: number;\n\t[LoaderHeader.reconnect]: boolean;\n\t[LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n\treadonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.\n */\nexport interface IPendingLocalState {\n\turl: string;\n\tpendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.\n *\n * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n\tblobsContents: { [path: string]: ArrayBufferLike };\n\ttrees: { [path: string]: ISnapshotTreeWithBlobContents };\n}\n"]}
package/dist/runtime.d.ts CHANGED
@@ -82,6 +82,16 @@ export interface IRuntime extends IDisposable {
82
82
  * stashed ops) after having processed it.
83
83
  */
84
84
  notifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;
85
+ /**
86
+ * Exposes the entryPoint for the container runtime.
87
+ * Use this as the primary way of getting access to the user-defined logic within the container runtime.
88
+ *
89
+ * @see {@link IContainer.getEntryPoint}
90
+ *
91
+ * @remarks The plan is that eventually IRuntime will no longer have a request() method, this method will no
92
+ * longer be optional, and it will become the only way to access the entryPoint for the runtime.
93
+ */
94
+ getEntryPoint?(): Promise<FluidObject | undefined>;
85
95
  }
86
96
  /**
87
97
  * Payload type for IContainerContext.submitBatchFn()
@@ -156,6 +166,12 @@ export interface IContainerContext extends IDisposable {
156
166
  * and scenarios which can change in the future.
157
167
  */
158
168
  readonly id: string;
169
+ /**
170
+ * Proxy for {@link IRuntime.getEntryPoint}, the entryPoint defined in the container's runtime.
171
+ *
172
+ * @see {@link IContainer.getEntryPoint}
173
+ */
174
+ getEntryPoint?(): Promise<FluidObject | undefined>;
159
175
  }
160
176
  export declare const IRuntimeFactory: keyof IProvideRuntimeFactory;
161
177
  export interface IProvideRuntimeFactory {
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EACN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ent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable } from \"@fluidframework/common-definitions\";\nimport { FluidObject, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n\tIClientConfiguration,\n\tIClientDetails,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n\tMessageType,\n\tISummaryTree,\n\tIVersion,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISummaryContent,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager } from \"./deltas\";\nimport { ICriticalContainerError } from \"./error\";\nimport { ILoader, ILoaderOptions, ISnapshotTreeWithBlobContents } from \"./loader\";\nimport { IFluidCodeDetails } from \"./fluidPackage\";\n\n/**\n * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the\n * service. The transition from detached to attached state is a one-way transition.\n */\nexport enum AttachState {\n\t/**\n\t * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n\t * to the service.\n\t */\n\tDetached = \"Detached\",\n\n\t/**\n\t * In attaching state, the data has started the upload to the service, but has not yet completed.\n\t */\n\tAttaching = \"Attaching\",\n\n\t/**\n\t * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n\t * reaching attached state.\n\t */\n\tAttached = \"Attached\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n */\nexport interface IRuntime extends IDisposable {\n\t/**\n\t * Executes a request against the runtime\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * Notifies the runtime of a change in the connection state\n\t */\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\t/**\n\t * Processes the given op (message)\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean);\n\n\t/**\n\t * Processes the given signal\n\t */\n\tprocessSignal(message: any, local: boolean);\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t *\n\t * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n\t * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n\t * new storage IDs so requests can be redirected.\n\t */\n\tcreateSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n\t/**\n\t * Propagate the container state when container is attaching or attached.\n\t * @param attachState - State of the container.\n\t */\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n\t/**\n\t * Get pending local state in a serializable format to be given back to a newly loaded container\n\t * @experimental\n\t * {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}\n\t */\n\tgetPendingLocalState(): unknown;\n\n\t/**\n\t * Notify runtime that container is moving to \"Attaching\" state\n\t * @param snapshot - snapshot created at attach time\n\t * @deprecated - not necessary after op replay moved to Container\n\t */\n\tnotifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;\n\n\t/**\n\t * Notify runtime that we have processed a saved message, so that it can do async work (applying\n\t * stashed ops) after having processed it.\n\t */\n\tnotifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n */\nexport interface IBatchMessage {\n\tcontents?: string;\n\tmetadata: Record<string, unknown> | undefined;\n\tcompression?: string;\n\treferenceSequenceNumber?: number;\n}\n\n/**\n * The ContainerContext is a proxy standing between the Container and the Container's IRuntime.\n * This allows the Container to terminate the connection to the IRuntime.\n *\n * Specifically, there is an event on Container, onContextChanged, which mean a new code proposal has been loaded,\n * so the old IRuntime is no longer valid, as its ContainerContext has been revoked,\n * and the Container has created a new ContainerContext.\n */\nexport interface IContainerContext extends IDisposable {\n\t/** @deprecated Please pass in existing directly in instantiateRuntime */\n\treadonly existing: boolean | undefined;\n\treadonly options: ILoaderOptions;\n\treadonly clientId: string | undefined;\n\treadonly clientDetails: IClientDetails;\n\treadonly storage: IDocumentStorageService;\n\treadonly connected: boolean;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\t/** @deprecated Please use submitBatchFn & submitSummaryFn */\n\treadonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n\t/** @returns clientSequenceNumber of last message in a batch */\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\treadonly submitSignalFn: (contents: any) => void;\n\treadonly disposeFn?: (error?: ICriticalContainerError) => void;\n\treadonly closeFn: (error?: ICriticalContainerError) => void;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly quorum: IQuorumClients;\n\t/**\n\t * @deprecated This method is provided as a migration tool for customers currently reading the code details\n\t * from within the Container by directly accessing the Quorum proposals. The code details should not be accessed\n\t * from within the Container as this requires coupling between the container contents and the code loader.\n\t * Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this\n\t * migration tool will be removed.\n\t */\n\tgetSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;\n\treadonly audience: IAudience | undefined;\n\treadonly loader: ILoader;\n\t// The logger implementation, which would support tagged events, should be provided by the loader.\n\treadonly taggedLogger: ITelemetryBaseLogger;\n\treadonly serviceConfiguration: IClientConfiguration | undefined;\n\tpendingLocalState?: unknown;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * @param relativeUrl - A relative request within the container\n\t *\n\t * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n\t */\n\tgetAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\tgetLoadedFromVersion(): IVersion | undefined;\n\n\tupdateDirtyContainerState(dirty: boolean): void;\n\n\treadonly supportedFeatures?: ReadonlyMap<string, unknown>;\n\n\t/**\n\t * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n\t * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n\t * and scenarios which can change in the future.\n\t */\n\treadonly id: string;\n}\n\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\nexport interface IProvideRuntimeFactory {\n\treadonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n\t/**\n\t * Instantiates a new IRuntime for the given IContainerContext to proxy to\n\t * This is the main entry point to the Container's business logic\n\t *\n\t * @param context - container context to be supplied to the runtime\n\t * @param existing - whether to instantiate for the first time or from an existing context\n\t */\n\tinstantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;\n}\n"]}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAuBH;;;GAGG;AACH,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACtB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACtB,CAAC,EAjBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAiBtB;AAwKY,QAAA,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable } from \"@fluidframework/common-definitions\";\nimport { FluidObject, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n\tIClientConfiguration,\n\tIClientDetails,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n\tMessageType,\n\tISummaryTree,\n\tIVersion,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISummaryContent,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager } from \"./deltas\";\nimport { ICriticalContainerError } from \"./error\";\nimport { ILoader, ILoaderOptions, ISnapshotTreeWithBlobContents } from \"./loader\";\nimport { IFluidCodeDetails } from \"./fluidPackage\";\n\n/**\n * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the\n * service. The transition from detached to attached state is a one-way transition.\n */\nexport enum AttachState {\n\t/**\n\t * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n\t * to the service.\n\t */\n\tDetached = \"Detached\",\n\n\t/**\n\t * In attaching state, the data has started the upload to the service, but has not yet completed.\n\t */\n\tAttaching = \"Attaching\",\n\n\t/**\n\t * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n\t * reaching attached state.\n\t */\n\tAttached = \"Attached\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n */\nexport interface IRuntime extends IDisposable {\n\t/**\n\t * Executes a request against the runtime\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * Notifies the runtime of a change in the connection state\n\t */\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\t/**\n\t * Processes the given op (message)\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean);\n\n\t/**\n\t * Processes the given signal\n\t */\n\tprocessSignal(message: any, local: boolean);\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t *\n\t * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n\t * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n\t * new storage IDs so requests can be redirected.\n\t */\n\tcreateSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n\t/**\n\t * Propagate the container state when container is attaching or attached.\n\t * @param attachState - State of the container.\n\t */\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n\t/**\n\t * Get pending local state in a serializable format to be given back to a newly loaded container\n\t * @experimental\n\t * {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}\n\t */\n\tgetPendingLocalState(): unknown;\n\n\t/**\n\t * Notify runtime that container is moving to \"Attaching\" state\n\t * @param snapshot - snapshot created at attach time\n\t * @deprecated - not necessary after op replay moved to Container\n\t */\n\tnotifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;\n\n\t/**\n\t * Notify runtime that we have processed a saved message, so that it can do async work (applying\n\t * stashed ops) after having processed it.\n\t */\n\tnotifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;\n\n\t/**\n\t * Exposes the entryPoint for the container runtime.\n\t * Use this as the primary way of getting access to the user-defined logic within the container runtime.\n\t *\n\t * @see {@link IContainer.getEntryPoint}\n\t *\n\t * @remarks The plan is that eventually IRuntime will no longer have a request() method, this method will no\n\t * longer be optional, and it will become the only way to access the entryPoint for the runtime.\n\t */\n\tgetEntryPoint?(): Promise<FluidObject | undefined>;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n */\nexport interface IBatchMessage {\n\tcontents?: string;\n\tmetadata: Record<string, unknown> | undefined;\n\tcompression?: string;\n\treferenceSequenceNumber?: number;\n}\n\n/**\n * The ContainerContext is a proxy standing between the Container and the Container's IRuntime.\n * This allows the Container to terminate the connection to the IRuntime.\n *\n * Specifically, there is an event on Container, onContextChanged, which mean a new code proposal has been loaded,\n * so the old IRuntime is no longer valid, as its ContainerContext has been revoked,\n * and the Container has created a new ContainerContext.\n */\nexport interface IContainerContext extends IDisposable {\n\t/** @deprecated Please pass in existing directly in instantiateRuntime */\n\treadonly existing: boolean | undefined;\n\treadonly options: ILoaderOptions;\n\treadonly clientId: string | undefined;\n\treadonly clientDetails: IClientDetails;\n\treadonly storage: IDocumentStorageService;\n\treadonly connected: boolean;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\t/** @deprecated Please use submitBatchFn & submitSummaryFn */\n\treadonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n\t/** @returns clientSequenceNumber of last message in a batch */\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\treadonly submitSignalFn: (contents: any) => void;\n\treadonly disposeFn?: (error?: ICriticalContainerError) => void;\n\treadonly closeFn: (error?: ICriticalContainerError) => void;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly quorum: IQuorumClients;\n\t/**\n\t * @deprecated This method is provided as a migration tool for customers currently reading the code details\n\t * from within the Container by directly accessing the Quorum proposals. The code details should not be accessed\n\t * from within the Container as this requires coupling between the container contents and the code loader.\n\t * Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this\n\t * migration tool will be removed.\n\t */\n\tgetSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;\n\treadonly audience: IAudience | undefined;\n\treadonly loader: ILoader;\n\t// The logger implementation, which would support tagged events, should be provided by the loader.\n\treadonly taggedLogger: ITelemetryBaseLogger;\n\treadonly serviceConfiguration: IClientConfiguration | undefined;\n\tpendingLocalState?: unknown;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * @param relativeUrl - A relative request within the container\n\t *\n\t * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n\t */\n\tgetAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\tgetLoadedFromVersion(): IVersion | undefined;\n\n\tupdateDirtyContainerState(dirty: boolean): void;\n\n\treadonly supportedFeatures?: ReadonlyMap<string, unknown>;\n\n\t/**\n\t * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n\t * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n\t * and scenarios which can change in the future.\n\t */\n\treadonly id: string;\n\n\t/**\n\t * Proxy for {@link IRuntime.getEntryPoint}, the entryPoint defined in the container's runtime.\n\t *\n\t * @see {@link IContainer.getEntryPoint}\n\t */\n\tgetEntryPoint?(): Promise<FluidObject | undefined>;\n}\n\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\nexport interface IProvideRuntimeFactory {\n\treadonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n\t/**\n\t * Instantiates a new IRuntime for the given IContainerContext to proxy to\n\t * This is the main entry point to the Container's business logic\n\t *\n\t * @param context - container context to be supplied to the runtime\n\t * @param existing - whether to instantiate for the first time or from an existing context\n\t */\n\tinstantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;\n}\n"]}
package/lib/loader.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IRequest, IResponse, IFluidRouter } from "@fluidframework/core-interfaces";
5
+ import { IRequest, IResponse, IFluidRouter, FluidObject } from "@fluidframework/core-interfaces";
6
6
  import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMessage, ISequencedProposal, ISnapshotTree } from "@fluidframework/protocol-definitions";
7
7
  import { IResolvedUrl } from "@fluidframework/driver-definitions";
8
8
  import { IEvent, IEventProvider } from "@fluidframework/common-definitions";
@@ -399,6 +399,18 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
399
399
  * @alpha
400
400
  */
401
401
  forceReadonly?(readonly: boolean): any;
402
+ /**
403
+ * Exposes the entryPoint for the container.
404
+ * Use this as the primary way of getting access to the user-defined logic within the container.
405
+ * If the method is undefined or the returned promise returns undefined (meaning that exposing the entryPoint
406
+ * hasn't been implemented in a particular scenario) fall back to the current approach of requesting the default
407
+ * object of the container through the request pattern.
408
+ *
409
+ * @remarks The plan is that eventually IContainer will no longer implement IFluidRouter (and thus won't have a
410
+ * request() method), this method will no longer be optional, and it will become the only way to access
411
+ * the entryPoint for the container.
412
+ */
413
+ getEntryPoint?(): Promise<FluidObject | undefined>;
402
414
  }
403
415
  /**
404
416
  * The Runtime's view of the Loader, used for loading Containers
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,EACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAEpG;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IAErB;;;;;OAKG;IACH,OAAO,EAAE,iBAAiB,CAAC;CAC3B;AAED;;;G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CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAClC,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,6BAA8B,SAAQ,aAAa;IACnE,aAAa,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE,CAAC;IACnD,KAAK,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,6BAA6B,CAAA;KAAE,CAAC;CACzD"}
package/lib/loader.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2gBH;;GAEG;AACH,MAAM,CAAN,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACvB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACpB,CAAC,EAtBW,YAAY,KAAZ,YAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse, IFluidRouter } from \"@fluidframework/core-interfaces\";\nimport {\n\tIClientDetails,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISequencedDocumentMessage,\n\tISequencedProposal,\n\tISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport { IFluidCodeDetails, IFluidPackage, IProvideFluidCodeDetailsComparer } from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n\t/**\n\t * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n\t */\n\tmodule: IFluidModule;\n\n\t/**\n\t * Code details associated with the module. Represents a document schema this module supports.\n\t * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}\n\t * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n\t * quorum.\n\t */\n\tdetails: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {\n\t/**\n\t * Load the code module (package) that can interact with the document.\n\t *\n\t * @param source - Code proposal that articulates the current schema the document is written in.\n\t * @returns - Code module entry point along with the code details associated with it.\n\t */\n\tload(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n\t/**\n\t * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n\t */\n\treadonly resolvedPackage: Readonly<IFluidPackage>;\n\t/**\n\t * If not undefined, this id will be used to cache the entry point for the code package\n\t */\n\treadonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n\t/**\n\t * Resolves a Fluid code details into a form that can be loaded.\n\t * @param details - The Fluid code details to resolve.\n\t * @returns - A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n\t * an optional resolvedPackageCacheId if the loaded package should be cached.\n\t */\n\tresolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n *\n * @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.\n */\nexport interface ICodeAllowList {\n\t/**\n\t * @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.\n\t */\n\ttestSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n */\nexport interface IContainerEvents extends IEvent {\n\t/**\n\t * Emitted when the readonly state of the container changes.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `readonly`: Whether or not the container is now in a readonly state.\n\t *\n\t * @see {@link IContainer.readOnlyInfo}\n\t */\n\t(event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n\t/**\n\t * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.connect}\n\t */\n\t(event: \"connected\", listener: (clientId: string) => void);\n\n\t/**\n\t * Fires when new container code details have been proposed, prior to acceptance.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `codeDetails`: The code details being proposed.\n\t *\n\t * - `proposal`: NOT RECOMMENDED FOR USE.\n\t *\n\t * @see {@link IContainer.proposeCodeDetails}\n\t */\n\t(\n\t\tevent: \"codeDetailsProposed\",\n\t\tlistener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void,\n\t);\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\t(event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.disconnect}\n\t */\n\t(event: \"disconnected\", listener: () => void);\n\n\t/**\n\t * Emitted when a {@link AttachState.Detached | detached} container is\n\t * {@link AttachState.Attached | attached} to the Fluid service.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.attachState}\n\t *\n\t * - {@link IContainer.attach}\n\t */\n\t(event: \"attached\", listener: () => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is closed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.close}\n\t */\n\t(event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is disposed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.dispose}\n\t */\n\t(event: \"disposed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n\t * For now, use of this should be avoided when possible.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `error`: The warning describing the encountered state.\n\t */\n\t(event: \"warning\", listener: (error: ContainerWarning) => void);\n\n\t/**\n\t * Emitted immediately after processing an incoming operation (op).\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n\t * ops directly on the {@link IContainer}.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `message`: The op that was processed.\n\t */\n\t(event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n\t/**\n\t * Emitted upon the first local change while the Container is in the \"saved\" state.\n\t * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"dirty\", listener: (dirty: boolean) => void);\n\n\t/**\n\t * Emitted when all local changes/edits have been acknowledged by the service.\n\t * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"saved\", listener: (dirty: boolean) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n\t/**\n\t * The container is not connected to the delta server.\n\t * Note - When in this state the container may be about to reconnect,\n\t * or may remain disconnected until explicitly told to connect.\n\t */\n\texport type Disconnected = 0;\n\n\t/**\n\t * The container is disconnected but actively trying to establish a new connection.\n\t * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n\t */\n\texport type EstablishingConnection = 3;\n\n\t/**\n\t * The container has an inbound connection only, and is catching up to the latest known state from the service.\n\t */\n\texport type CatchingUp = 1;\n\n\t/**\n\t * The container is fully connected and syncing.\n\t */\n\texport type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n */\nexport type ConnectionState =\n\t| ConnectionState.Disconnected\n\t| ConnectionState.EstablishingConnection\n\t| ConnectionState.CatchingUp\n\t| ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\t/**\n\t * The Delta Manager supporting the op stream for this Container\n\t */\n\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n\t/**\n\t * The collection of write clients which were connected as of the current sequence number.\n\t * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Represents the resolved url to the Container.\n\t * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n\t */\n\tresolvedUrl: IResolvedUrl | undefined;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\t/**\n\t * Get the code details that are currently specified for the container.\n\t * @returns The current code details if any are specified, undefined if none are specified.\n\t */\n\tgetSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Get the code details that were used to load the container.\n\t * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n\t * loaded.\n\t */\n\tgetLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Returns true if the container has been closed, otherwise false.\n\t */\n\treadonly closed: boolean;\n\n\t/**\n\t * Whether or not there are any local changes that have not been saved.\n\t */\n\treadonly isDirty: boolean;\n\n\t/**\n\t * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.\n\t * The container is not expected to be used anymore once it is disposed.\n\t *\n\t * @param error - If the container is being disposed due to error, this provides details about the error that\n\t * resulted in disposing it.\n\t */\n\tdispose?(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container.\n\t *\n\t * @param error - If the container is being closed due to error, this provides details about the error that\n\t * resulted in closing it.\n\t */\n\tclose(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container and returns serialized local state intended to be\n\t * given to a newly loaded container.\n\t * @experimental\n\t * {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}\n\t */\n\tcloseAndGetPendingLocalState(): string;\n\n\t/**\n\t * Propose new code details that define the code to be loaded for this container's runtime.\n\t *\n\t * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n\t */\n\tproposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n\t/**\n\t * Attaches the Container to the Container specified by the given Request.\n\t *\n\t * @privateRemarks\n\t *\n\t * TODO - in the case of failure options should give a retry policy.\n\t * Or some continuation function that allows attachment to a secondary document.\n\t */\n\tattach(request: IRequest): Promise<void>;\n\n\t/**\n\t * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container\n\t * is an error.\n\t */\n\tserialize(): string;\n\n\t/**\n\t * Get an absolute URL for a provided container-relative request URL.\n\t * If the container is not attached, this will return undefined.\n\t *\n\t * @param relativeUrl - A container-relative request URL.\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Issue a request against the container for a resource.\n\t * @param request - The request to be issued against the container\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * Provides the current state of the container's connection to the ordering service.\n\t *\n\t * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n\t */\n\treadonly connectionState: ConnectionState;\n\n\t/**\n\t * Attempts to connect the container to the delta stream and process ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the\n\t * \"connected\" event will be fired if/when connection succeeds.\n\t */\n\tconnect(): void;\n\n\t/**\n\t * Disconnects the container from the delta stream and stops processing ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the\n\t * \"disconnected\" event will be fired when disconnection completes.\n\t */\n\tdisconnect(): void;\n\n\t/**\n\t * The audience information for all clients currently associated with the document in the current session.\n\t */\n\treadonly audience: IAudience;\n\n\t/**\n\t * The server provided ID of the client.\n\t *\n\t * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},\n\t * otherwise will be `undefined`.\n\t */\n\treadonly clientId?: string | undefined;\n\n\t/**\n\t * Tells if container is in read-only mode.\n\t *\n\t * @remarks\n\t *\n\t * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n\t * Readonly state can be because of no storage write permission,\n\t * or due to host forcing readonly mode for container.\n\t *\n\t * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n\t * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n\t *\n\t * It is undefined if we have not yet established websocket connection\n\t * and do not know if user has write access to a file.\n\t */\n\treadonly readOnlyInfo: ReadOnlyInfo;\n\n\t/**\n\t * Allows the host to have the container force to be in read-only mode\n\t * @param readonly - Boolean that toggles if read-only policies will be enforced\n\t * @alpha\n\t */\n\tforceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n\t/**\n\t * Resolves the resource specified by the URL + headers contained in the request object\n\t * to the underlying container that will resolve the request.\n\t *\n\t * @remarks\n\t *\n\t * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n\t * a request against the server found from the resolve step.\n\t */\n\tresolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n\t/**\n\t * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\tcreateDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n\t/**\n\t * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\trehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n\t[key in string | number]: any;\n} & {\n\t/**\n\t * Set caching behavior for the loader. If true, we will load a container from cache if one\n\t * with the same id/version exists or create a new container and cache it if it does not. If\n\t * false, always load a new container and don't cache it. If the container has already been\n\t * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n\t * request will override the Loader's value.\n\t * Defaults to true.\n\t */\n\tcache?: boolean;\n\n\t/**\n\t * Provide the current Loader through the scope object when creating Containers. It is added\n\t * as the `ILoader` property, and will overwrite an existing property of the same name on the\n\t * scope. Useful for when the host wants to provide the current Loader's functionality to\n\t * individual Data Stores, which is typically expected when creating with a Loader.\n\t * Defaults to true.\n\t */\n\tprovideScopeLoader?: boolean;\n\n\t/**\n\t * Max time (in ms) container will wait for a leave message of a disconnected client.\n\t */\n\tmaxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n\t/**\n\t * Override the Loader's default caching behavior for this container.\n\t */\n\tcache = \"fluid-cache\",\n\n\tclientDetails = \"fluid-client-details\",\n\n\t/**\n\t * Start the container in a paused, unconnected state. Defaults to false\n\t */\n\tloadMode = \"loadMode\",\n\treconnect = \"fluid-reconnect\",\n\tsequenceNumber = \"fluid-sequence-number\",\n\n\t/**\n\t * One of the following:\n\t * null or \"null\": use ops, no snapshots\n\t * undefined: fetch latest snapshot\n\t * otherwise, version sha to load snapshot\n\t */\n\tversion = \"version\",\n}\n\nexport interface IContainerLoadMode {\n\topsBeforeReturn?: /*\n\t * No trailing ops are applied before container is returned.\n\t * Default value.\n\t */\n\t| undefined\n\t\t/*\n\t\t * Only cached trailing ops are applied before returning container.\n\t\t * Caching is optional and could be implemented by the driver.\n\t\t * If driver does not implement any kind of local caching strategy, this is same as above.\n\t\t * Driver may cache a lot of ops, so care needs to be exercised (see below).\n\t\t */\n\t\t| \"cached\"\n\t\t/*\n\t\t * All trailing ops in storage are fetched and applied before container is returned\n\t\t * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n\t\t * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n\t\t * recommended to have some progress UX / cancellation built into loading flow when using this option.\n\t\t */\n\t\t| \"all\";\n\n\tdeltaConnection?: /*\n\t * Connection to delta stream is made only when Container.connect() call is made. Op processing\n\t * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n\t */\n\t| \"none\"\n\t\t/*\n\t\t * Connection to delta stream is made only when Container.connect() call is made.\n\t\t * Op fetching from storage is performed and ops are applied as they come in.\n\t\t * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n\t\t * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n\t\t */\n\t\t| \"delayed\"\n\t\t/*\n\t\t * Connection to delta stream is made right away.\n\t\t * Ops processing is enabled and ops are flowing through the system.\n\t\t * Default value.\n\t\t */\n\t\t| undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n\t[LoaderHeader.cache]: boolean;\n\t[LoaderHeader.clientDetails]: IClientDetails;\n\t[LoaderHeader.loadMode]: IContainerLoadMode;\n\t[LoaderHeader.sequenceNumber]: number;\n\t[LoaderHeader.reconnect]: boolean;\n\t[LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n\treadonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.\n */\nexport interface IPendingLocalState {\n\turl: string;\n\tpendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.\n *\n * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n\tblobsContents: { [path: string]: ArrayBufferLike };\n\ttrees: { [path: string]: ISnapshotTreeWithBlobContents };\n}\n"]}
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwhBH;;GAEG;AACH,MAAM,CAAN,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACvB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACpB,CAAC,EAtBW,YAAY,KAAZ,YAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse, IFluidRouter, FluidObject } from \"@fluidframework/core-interfaces\";\nimport {\n\tIClientDetails,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISequencedDocumentMessage,\n\tISequencedProposal,\n\tISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport { IFluidCodeDetails, IFluidPackage, IProvideFluidCodeDetailsComparer } from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n\t/**\n\t * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n\t */\n\tmodule: IFluidModule;\n\n\t/**\n\t * Code details associated with the module. Represents a document schema this module supports.\n\t * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}\n\t * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n\t * quorum.\n\t */\n\tdetails: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {\n\t/**\n\t * Load the code module (package) that can interact with the document.\n\t *\n\t * @param source - Code proposal that articulates the current schema the document is written in.\n\t * @returns - Code module entry point along with the code details associated with it.\n\t */\n\tload(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n\t/**\n\t * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n\t */\n\treadonly resolvedPackage: Readonly<IFluidPackage>;\n\t/**\n\t * If not undefined, this id will be used to cache the entry point for the code package\n\t */\n\treadonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n\t/**\n\t * Resolves a Fluid code details into a form that can be loaded.\n\t * @param details - The Fluid code details to resolve.\n\t * @returns - A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n\t * an optional resolvedPackageCacheId if the loaded package should be cached.\n\t */\n\tresolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n *\n * @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.\n */\nexport interface ICodeAllowList {\n\t/**\n\t * @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.\n\t */\n\ttestSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n */\nexport interface IContainerEvents extends IEvent {\n\t/**\n\t * Emitted when the readonly state of the container changes.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `readonly`: Whether or not the container is now in a readonly state.\n\t *\n\t * @see {@link IContainer.readOnlyInfo}\n\t */\n\t(event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n\t/**\n\t * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.connect}\n\t */\n\t(event: \"connected\", listener: (clientId: string) => void);\n\n\t/**\n\t * Fires when new container code details have been proposed, prior to acceptance.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `codeDetails`: The code details being proposed.\n\t *\n\t * - `proposal`: NOT RECOMMENDED FOR USE.\n\t *\n\t * @see {@link IContainer.proposeCodeDetails}\n\t */\n\t(\n\t\tevent: \"codeDetailsProposed\",\n\t\tlistener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void,\n\t);\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\t(event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.disconnect}\n\t */\n\t(event: \"disconnected\", listener: () => void);\n\n\t/**\n\t * Emitted when a {@link AttachState.Detached | detached} container is\n\t * {@link AttachState.Attached | attached} to the Fluid service.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.attachState}\n\t *\n\t * - {@link IContainer.attach}\n\t */\n\t(event: \"attached\", listener: () => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is closed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.close}\n\t */\n\t(event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is disposed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.dispose}\n\t */\n\t(event: \"disposed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n\t * For now, use of this should be avoided when possible.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `error`: The warning describing the encountered state.\n\t */\n\t(event: \"warning\", listener: (error: ContainerWarning) => void);\n\n\t/**\n\t * Emitted immediately after processing an incoming operation (op).\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n\t * ops directly on the {@link IContainer}.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `message`: The op that was processed.\n\t */\n\t(event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n\t/**\n\t * Emitted upon the first local change while the Container is in the \"saved\" state.\n\t * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"dirty\", listener: (dirty: boolean) => void);\n\n\t/**\n\t * Emitted when all local changes/edits have been acknowledged by the service.\n\t * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"saved\", listener: (dirty: boolean) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n\t/**\n\t * The container is not connected to the delta server.\n\t * Note - When in this state the container may be about to reconnect,\n\t * or may remain disconnected until explicitly told to connect.\n\t */\n\texport type Disconnected = 0;\n\n\t/**\n\t * The container is disconnected but actively trying to establish a new connection.\n\t * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n\t */\n\texport type EstablishingConnection = 3;\n\n\t/**\n\t * The container has an inbound connection only, and is catching up to the latest known state from the service.\n\t */\n\texport type CatchingUp = 1;\n\n\t/**\n\t * The container is fully connected and syncing.\n\t */\n\texport type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n */\nexport type ConnectionState =\n\t| ConnectionState.Disconnected\n\t| ConnectionState.EstablishingConnection\n\t| ConnectionState.CatchingUp\n\t| ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\t/**\n\t * The Delta Manager supporting the op stream for this Container\n\t */\n\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n\t/**\n\t * The collection of write clients which were connected as of the current sequence number.\n\t * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Represents the resolved url to the Container.\n\t * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n\t */\n\tresolvedUrl: IResolvedUrl | undefined;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\t/**\n\t * Get the code details that are currently specified for the container.\n\t * @returns The current code details if any are specified, undefined if none are specified.\n\t */\n\tgetSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Get the code details that were used to load the container.\n\t * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n\t * loaded.\n\t */\n\tgetLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Returns true if the container has been closed, otherwise false.\n\t */\n\treadonly closed: boolean;\n\n\t/**\n\t * Whether or not there are any local changes that have not been saved.\n\t */\n\treadonly isDirty: boolean;\n\n\t/**\n\t * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.\n\t * The container is not expected to be used anymore once it is disposed.\n\t *\n\t * @param error - If the container is being disposed due to error, this provides details about the error that\n\t * resulted in disposing it.\n\t */\n\tdispose?(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container.\n\t *\n\t * @param error - If the container is being closed due to error, this provides details about the error that\n\t * resulted in closing it.\n\t */\n\tclose(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container and returns serialized local state intended to be\n\t * given to a newly loaded container.\n\t * @experimental\n\t * {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}\n\t */\n\tcloseAndGetPendingLocalState(): string;\n\n\t/**\n\t * Propose new code details that define the code to be loaded for this container's runtime.\n\t *\n\t * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n\t */\n\tproposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n\t/**\n\t * Attaches the Container to the Container specified by the given Request.\n\t *\n\t * @privateRemarks\n\t *\n\t * TODO - in the case of failure options should give a retry policy.\n\t * Or some continuation function that allows attachment to a secondary document.\n\t */\n\tattach(request: IRequest): Promise<void>;\n\n\t/**\n\t * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container\n\t * is an error.\n\t */\n\tserialize(): string;\n\n\t/**\n\t * Get an absolute URL for a provided container-relative request URL.\n\t * If the container is not attached, this will return undefined.\n\t *\n\t * @param relativeUrl - A container-relative request URL.\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Issue a request against the container for a resource.\n\t * @param request - The request to be issued against the container\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * Provides the current state of the container's connection to the ordering service.\n\t *\n\t * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n\t */\n\treadonly connectionState: ConnectionState;\n\n\t/**\n\t * Attempts to connect the container to the delta stream and process ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the\n\t * \"connected\" event will be fired if/when connection succeeds.\n\t */\n\tconnect(): void;\n\n\t/**\n\t * Disconnects the container from the delta stream and stops processing ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the\n\t * \"disconnected\" event will be fired when disconnection completes.\n\t */\n\tdisconnect(): void;\n\n\t/**\n\t * The audience information for all clients currently associated with the document in the current session.\n\t */\n\treadonly audience: IAudience;\n\n\t/**\n\t * The server provided ID of the client.\n\t *\n\t * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},\n\t * otherwise will be `undefined`.\n\t */\n\treadonly clientId?: string | undefined;\n\n\t/**\n\t * Tells if container is in read-only mode.\n\t *\n\t * @remarks\n\t *\n\t * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n\t * Readonly state can be because of no storage write permission,\n\t * or due to host forcing readonly mode for container.\n\t *\n\t * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n\t * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n\t *\n\t * It is undefined if we have not yet established websocket connection\n\t * and do not know if user has write access to a file.\n\t */\n\treadonly readOnlyInfo: ReadOnlyInfo;\n\n\t/**\n\t * Allows the host to have the container force to be in read-only mode\n\t * @param readonly - Boolean that toggles if read-only policies will be enforced\n\t * @alpha\n\t */\n\tforceReadonly?(readonly: boolean);\n\n\t/**\n\t * Exposes the entryPoint for the container.\n\t * Use this as the primary way of getting access to the user-defined logic within the container.\n\t * If the method is undefined or the returned promise returns undefined (meaning that exposing the entryPoint\n\t * hasn't been implemented in a particular scenario) fall back to the current approach of requesting the default\n\t * object of the container through the request pattern.\n\t *\n\t * @remarks The plan is that eventually IContainer will no longer implement IFluidRouter (and thus won't have a\n\t * request() method), this method will no longer be optional, and it will become the only way to access\n\t * the entryPoint for the container.\n\t */\n\tgetEntryPoint?(): Promise<FluidObject | undefined>;\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n\t/**\n\t * Resolves the resource specified by the URL + headers contained in the request object\n\t * to the underlying container that will resolve the request.\n\t *\n\t * @remarks\n\t *\n\t * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n\t * a request against the server found from the resolve step.\n\t */\n\tresolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n\t/**\n\t * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\tcreateDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n\t/**\n\t * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\trehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n\t[key in string | number]: any;\n} & {\n\t/**\n\t * Set caching behavior for the loader. If true, we will load a container from cache if one\n\t * with the same id/version exists or create a new container and cache it if it does not. If\n\t * false, always load a new container and don't cache it. If the container has already been\n\t * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n\t * request will override the Loader's value.\n\t * Defaults to true.\n\t */\n\tcache?: boolean;\n\n\t/**\n\t * Provide the current Loader through the scope object when creating Containers. It is added\n\t * as the `ILoader` property, and will overwrite an existing property of the same name on the\n\t * scope. Useful for when the host wants to provide the current Loader's functionality to\n\t * individual Data Stores, which is typically expected when creating with a Loader.\n\t * Defaults to true.\n\t */\n\tprovideScopeLoader?: boolean;\n\n\t/**\n\t * Max time (in ms) container will wait for a leave message of a disconnected client.\n\t */\n\tmaxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n\t/**\n\t * Override the Loader's default caching behavior for this container.\n\t */\n\tcache = \"fluid-cache\",\n\n\tclientDetails = \"fluid-client-details\",\n\n\t/**\n\t * Start the container in a paused, unconnected state. Defaults to false\n\t */\n\tloadMode = \"loadMode\",\n\treconnect = \"fluid-reconnect\",\n\tsequenceNumber = \"fluid-sequence-number\",\n\n\t/**\n\t * One of the following:\n\t * null or \"null\": use ops, no snapshots\n\t * undefined: fetch latest snapshot\n\t * otherwise, version sha to load snapshot\n\t */\n\tversion = \"version\",\n}\n\nexport interface IContainerLoadMode {\n\topsBeforeReturn?: /*\n\t * No trailing ops are applied before container is returned.\n\t * Default value.\n\t */\n\t| undefined\n\t\t/*\n\t\t * Only cached trailing ops are applied before returning container.\n\t\t * Caching is optional and could be implemented by the driver.\n\t\t * If driver does not implement any kind of local caching strategy, this is same as above.\n\t\t * Driver may cache a lot of ops, so care needs to be exercised (see below).\n\t\t */\n\t\t| \"cached\"\n\t\t/*\n\t\t * All trailing ops in storage are fetched and applied before container is returned\n\t\t * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n\t\t * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n\t\t * recommended to have some progress UX / cancellation built into loading flow when using this option.\n\t\t */\n\t\t| \"all\";\n\n\tdeltaConnection?: /*\n\t * Connection to delta stream is made only when Container.connect() call is made. Op processing\n\t * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n\t */\n\t| \"none\"\n\t\t/*\n\t\t * Connection to delta stream is made only when Container.connect() call is made.\n\t\t * Op fetching from storage is performed and ops are applied as they come in.\n\t\t * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n\t\t * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n\t\t */\n\t\t| \"delayed\"\n\t\t/*\n\t\t * Connection to delta stream is made right away.\n\t\t * Ops processing is enabled and ops are flowing through the system.\n\t\t * Default value.\n\t\t */\n\t\t| undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n\t[LoaderHeader.cache]: boolean;\n\t[LoaderHeader.clientDetails]: IClientDetails;\n\t[LoaderHeader.loadMode]: IContainerLoadMode;\n\t[LoaderHeader.sequenceNumber]: number;\n\t[LoaderHeader.reconnect]: boolean;\n\t[LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n\treadonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.\n */\nexport interface IPendingLocalState {\n\turl: string;\n\tpendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.\n *\n * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n\tblobsContents: { [path: string]: ArrayBufferLike };\n\ttrees: { [path: string]: ISnapshotTreeWithBlobContents };\n}\n"]}
package/lib/runtime.d.ts CHANGED
@@ -82,6 +82,16 @@ export interface IRuntime extends IDisposable {
82
82
  * stashed ops) after having processed it.
83
83
  */
84
84
  notifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;
85
+ /**
86
+ * Exposes the entryPoint for the container runtime.
87
+ * Use this as the primary way of getting access to the user-defined logic within the container runtime.
88
+ *
89
+ * @see {@link IContainer.getEntryPoint}
90
+ *
91
+ * @remarks The plan is that eventually IRuntime will no longer have a request() method, this method will no
92
+ * longer be optional, and it will become the only way to access the entryPoint for the runtime.
93
+ */
94
+ getEntryPoint?(): Promise<FluidObject | undefined>;
85
95
  }
86
96
  /**
87
97
  * Payload type for IContainerContext.submitBatchFn()
@@ -156,6 +166,12 @@ export interface IContainerContext extends IDisposable {
156
166
  * and scenarios which can change in the future.
157
167
  */
158
168
  readonly id: string;
169
+ /**
170
+ * Proxy for {@link IRuntime.getEntryPoint}, the entryPoint defined in the container's runtime.
171
+ *
172
+ * @see {@link IContainer.getEntryPoint}
173
+ */
174
+ getEntryPoint?(): Promise<FluidObject | undefined>;
159
175
  }
160
176
  export declare const IRuntimeFactory: keyof IProvideRuntimeFactory;
161
177
  export interface IProvideRuntimeFactory {
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EACN,oBAAoB,EACpB,cAAc,EACd,yBAAyB,EACzB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;GAGG;AACH,oBAAY,WAAW;IACtB;;;OAGG;IACH,QAAQ,aAAa;IAErB;;OAEG;IACH,SAAS,cAAc;IAEvB;;;OAGG;IACH,QAAQ,aAAa;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAS,SAAQ,WAAW;IAC5C;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CA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;CAC1C;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC9D;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACrF"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH;;;GAGG;AACH,MAAM,CAAN,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACtB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACtB,CAAC,EAjBW,WAAW,KAAX,WAAW,QAiBtB;AAsJD,MAAM,CAAC,MAAM,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable } from \"@fluidframework/common-definitions\";\nimport { FluidObject, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n\tIClientConfiguration,\n\tIClientDetails,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n\tMessageType,\n\tISummaryTree,\n\tIVersion,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISummaryContent,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager } from \"./deltas\";\nimport { ICriticalContainerError } from \"./error\";\nimport { ILoader, ILoaderOptions, ISnapshotTreeWithBlobContents } from \"./loader\";\nimport { IFluidCodeDetails } from \"./fluidPackage\";\n\n/**\n * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the\n * service. The transition from detached to attached state is a one-way transition.\n */\nexport enum AttachState {\n\t/**\n\t * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n\t * to the service.\n\t */\n\tDetached = \"Detached\",\n\n\t/**\n\t * In attaching state, the data has started the upload to the service, but has not yet completed.\n\t */\n\tAttaching = \"Attaching\",\n\n\t/**\n\t * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n\t * reaching attached state.\n\t */\n\tAttached = \"Attached\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n */\nexport interface IRuntime extends IDisposable {\n\t/**\n\t * Executes a request against the runtime\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * Notifies the runtime of a change in the connection state\n\t */\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\t/**\n\t * Processes the given op (message)\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean);\n\n\t/**\n\t * Processes the given signal\n\t */\n\tprocessSignal(message: any, local: boolean);\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t *\n\t * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n\t * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n\t * new storage IDs so requests can be redirected.\n\t */\n\tcreateSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n\t/**\n\t * Propagate the container state when container is attaching or attached.\n\t * @param attachState - State of the container.\n\t */\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n\t/**\n\t * Get pending local state in a serializable format to be given back to a newly loaded container\n\t * @experimental\n\t * {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}\n\t */\n\tgetPendingLocalState(): unknown;\n\n\t/**\n\t * Notify runtime that container is moving to \"Attaching\" state\n\t * @param snapshot - snapshot created at attach time\n\t * @deprecated - not necessary after op replay moved to Container\n\t */\n\tnotifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;\n\n\t/**\n\t * Notify runtime that we have processed a saved message, so that it can do async work (applying\n\t * stashed ops) after having processed it.\n\t */\n\tnotifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n */\nexport interface IBatchMessage {\n\tcontents?: string;\n\tmetadata: Record<string, unknown> | undefined;\n\tcompression?: string;\n\treferenceSequenceNumber?: number;\n}\n\n/**\n * The ContainerContext is a proxy standing between the Container and the Container's IRuntime.\n * This allows the Container to terminate the connection to the IRuntime.\n *\n * Specifically, there is an event on Container, onContextChanged, which mean a new code proposal has been loaded,\n * so the old IRuntime is no longer valid, as its ContainerContext has been revoked,\n * and the Container has created a new ContainerContext.\n */\nexport interface IContainerContext extends IDisposable {\n\t/** @deprecated Please pass in existing directly in instantiateRuntime */\n\treadonly existing: boolean | undefined;\n\treadonly options: ILoaderOptions;\n\treadonly clientId: string | undefined;\n\treadonly clientDetails: IClientDetails;\n\treadonly storage: IDocumentStorageService;\n\treadonly connected: boolean;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\t/** @deprecated Please use submitBatchFn & submitSummaryFn */\n\treadonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n\t/** @returns clientSequenceNumber of last message in a batch */\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\treadonly submitSignalFn: (contents: any) => void;\n\treadonly disposeFn?: (error?: ICriticalContainerError) => void;\n\treadonly closeFn: (error?: ICriticalContainerError) => void;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly quorum: IQuorumClients;\n\t/**\n\t * @deprecated This method is provided as a migration tool for customers currently reading the code details\n\t * from within the Container by directly accessing the Quorum proposals. The code details should not be accessed\n\t * from within the Container as this requires coupling between the container contents and the code loader.\n\t * Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this\n\t * migration tool will be removed.\n\t */\n\tgetSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;\n\treadonly audience: IAudience | undefined;\n\treadonly loader: ILoader;\n\t// The logger implementation, which would support tagged events, should be provided by the loader.\n\treadonly taggedLogger: ITelemetryBaseLogger;\n\treadonly serviceConfiguration: IClientConfiguration | undefined;\n\tpendingLocalState?: unknown;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * @param relativeUrl - A relative request within the container\n\t *\n\t * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n\t */\n\tgetAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\tgetLoadedFromVersion(): IVersion | undefined;\n\n\tupdateDirtyContainerState(dirty: boolean): void;\n\n\treadonly supportedFeatures?: ReadonlyMap<string, unknown>;\n\n\t/**\n\t * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n\t * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n\t * and scenarios which can change in the future.\n\t */\n\treadonly id: string;\n}\n\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\nexport interface IProvideRuntimeFactory {\n\treadonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n\t/**\n\t * Instantiates a new IRuntime for the given IContainerContext to proxy to\n\t * This is the main entry point to the Container's business logic\n\t *\n\t * @param context - container context to be supplied to the runtime\n\t * @param existing - whether to instantiate for the first time or from an existing context\n\t */\n\tinstantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;\n}\n"]}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH;;;GAGG;AACH,MAAM,CAAN,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACtB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACtB,CAAC,EAjBW,WAAW,KAAX,WAAW,QAiBtB;AAwKD,MAAM,CAAC,MAAM,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable } from \"@fluidframework/common-definitions\";\nimport { FluidObject, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n\tIClientConfiguration,\n\tIClientDetails,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n\tMessageType,\n\tISummaryTree,\n\tIVersion,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISummaryContent,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager } from \"./deltas\";\nimport { ICriticalContainerError } from \"./error\";\nimport { ILoader, ILoaderOptions, ISnapshotTreeWithBlobContents } from \"./loader\";\nimport { IFluidCodeDetails } from \"./fluidPackage\";\n\n/**\n * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the\n * service. The transition from detached to attached state is a one-way transition.\n */\nexport enum AttachState {\n\t/**\n\t * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n\t * to the service.\n\t */\n\tDetached = \"Detached\",\n\n\t/**\n\t * In attaching state, the data has started the upload to the service, but has not yet completed.\n\t */\n\tAttaching = \"Attaching\",\n\n\t/**\n\t * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n\t * reaching attached state.\n\t */\n\tAttached = \"Attached\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n */\nexport interface IRuntime extends IDisposable {\n\t/**\n\t * Executes a request against the runtime\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * Notifies the runtime of a change in the connection state\n\t */\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\t/**\n\t * Processes the given op (message)\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean);\n\n\t/**\n\t * Processes the given signal\n\t */\n\tprocessSignal(message: any, local: boolean);\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t *\n\t * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n\t * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n\t * new storage IDs so requests can be redirected.\n\t */\n\tcreateSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n\t/**\n\t * Propagate the container state when container is attaching or attached.\n\t * @param attachState - State of the container.\n\t */\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n\t/**\n\t * Get pending local state in a serializable format to be given back to a newly loaded container\n\t * @experimental\n\t * {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}\n\t */\n\tgetPendingLocalState(): unknown;\n\n\t/**\n\t * Notify runtime that container is moving to \"Attaching\" state\n\t * @param snapshot - snapshot created at attach time\n\t * @deprecated - not necessary after op replay moved to Container\n\t */\n\tnotifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;\n\n\t/**\n\t * Notify runtime that we have processed a saved message, so that it can do async work (applying\n\t * stashed ops) after having processed it.\n\t */\n\tnotifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;\n\n\t/**\n\t * Exposes the entryPoint for the container runtime.\n\t * Use this as the primary way of getting access to the user-defined logic within the container runtime.\n\t *\n\t * @see {@link IContainer.getEntryPoint}\n\t *\n\t * @remarks The plan is that eventually IRuntime will no longer have a request() method, this method will no\n\t * longer be optional, and it will become the only way to access the entryPoint for the runtime.\n\t */\n\tgetEntryPoint?(): Promise<FluidObject | undefined>;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n */\nexport interface IBatchMessage {\n\tcontents?: string;\n\tmetadata: Record<string, unknown> | undefined;\n\tcompression?: string;\n\treferenceSequenceNumber?: number;\n}\n\n/**\n * The ContainerContext is a proxy standing between the Container and the Container's IRuntime.\n * This allows the Container to terminate the connection to the IRuntime.\n *\n * Specifically, there is an event on Container, onContextChanged, which mean a new code proposal has been loaded,\n * so the old IRuntime is no longer valid, as its ContainerContext has been revoked,\n * and the Container has created a new ContainerContext.\n */\nexport interface IContainerContext extends IDisposable {\n\t/** @deprecated Please pass in existing directly in instantiateRuntime */\n\treadonly existing: boolean | undefined;\n\treadonly options: ILoaderOptions;\n\treadonly clientId: string | undefined;\n\treadonly clientDetails: IClientDetails;\n\treadonly storage: IDocumentStorageService;\n\treadonly connected: boolean;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\t/** @deprecated Please use submitBatchFn & submitSummaryFn */\n\treadonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n\t/** @returns clientSequenceNumber of last message in a batch */\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\treadonly submitSignalFn: (contents: any) => void;\n\treadonly disposeFn?: (error?: ICriticalContainerError) => void;\n\treadonly closeFn: (error?: ICriticalContainerError) => void;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly quorum: IQuorumClients;\n\t/**\n\t * @deprecated This method is provided as a migration tool for customers currently reading the code details\n\t * from within the Container by directly accessing the Quorum proposals. The code details should not be accessed\n\t * from within the Container as this requires coupling between the container contents and the code loader.\n\t * Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this\n\t * migration tool will be removed.\n\t */\n\tgetSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;\n\treadonly audience: IAudience | undefined;\n\treadonly loader: ILoader;\n\t// The logger implementation, which would support tagged events, should be provided by the loader.\n\treadonly taggedLogger: ITelemetryBaseLogger;\n\treadonly serviceConfiguration: IClientConfiguration | undefined;\n\tpendingLocalState?: unknown;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * @param relativeUrl - A relative request within the container\n\t *\n\t * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n\t */\n\tgetAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\tgetLoadedFromVersion(): IVersion | undefined;\n\n\tupdateDirtyContainerState(dirty: boolean): void;\n\n\treadonly supportedFeatures?: ReadonlyMap<string, unknown>;\n\n\t/**\n\t * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n\t * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n\t * and scenarios which can change in the future.\n\t */\n\treadonly id: string;\n\n\t/**\n\t * Proxy for {@link IRuntime.getEntryPoint}, the entryPoint defined in the container's runtime.\n\t *\n\t * @see {@link IContainer.getEntryPoint}\n\t */\n\tgetEntryPoint?(): Promise<FluidObject | undefined>;\n}\n\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\nexport interface IProvideRuntimeFactory {\n\treadonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n\t/**\n\t * Instantiates a new IRuntime for the given IContainerContext to proxy to\n\t * This is the main entry point to the Container's business logic\n\t *\n\t * @param context - container context to be supplied to the runtime\n\t * @param existing - whether to instantiate for the first time or from an existing context\n\t */\n\tinstantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-definitions",
3
- "version": "2.0.0-internal.3.2.2",
3
+ "version": "2.0.0-internal.3.3.0",
4
4
  "description": "Fluid container definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -16,16 +16,16 @@
16
16
  "types": "dist/index.d.ts",
17
17
  "dependencies": {
18
18
  "@fluidframework/common-definitions": "^0.20.1",
19
- "@fluidframework/core-interfaces": ">=2.0.0-internal.3.2.2 <2.0.0-internal.4.0.0",
20
- "@fluidframework/driver-definitions": ">=2.0.0-internal.3.2.2 <2.0.0-internal.4.0.0",
19
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.3.3.0 <2.0.0-internal.4.0.0",
20
+ "@fluidframework/driver-definitions": ">=2.0.0-internal.3.3.0 <2.0.0-internal.4.0.0",
21
21
  "@fluidframework/protocol-definitions": "^1.1.0",
22
22
  "events": "^3.1.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@fluid-tools/build-cli": "^0.10.0",
25
+ "@fluid-tools/build-cli": "^0.12.0",
26
26
  "@fluidframework/build-common": "^1.1.0",
27
- "@fluidframework/build-tools": "^0.10.0",
28
- "@fluidframework/container-definitions-previous": "npm:@fluidframework/container-definitions@2.0.0-internal.3.1.0",
27
+ "@fluidframework/build-tools": "^0.12.0",
28
+ "@fluidframework/container-definitions-previous": "npm:@fluidframework/container-definitions@2.0.0-internal.3.2.0",
29
29
  "@fluidframework/eslint-config-fluid": "^2.0.0",
30
30
  "@microsoft/api-extractor": "^7.22.2",
31
31
  "@rushstack/eslint-config": "^2.5.1",
@@ -38,10 +38,6 @@
38
38
  "typescript": "~4.5.5"
39
39
  },
40
40
  "typeValidation": {
41
- "version": "2.0.0-internal.3.2.0",
42
- "previousVersionStyle": "~previousMinor",
43
- "baselineRange": ">=2.0.0-internal.3.1.0 <2.0.0-internal.3.2.0",
44
- "baselineVersion": "2.0.0-internal.3.1.0",
45
41
  "broken": {}
46
42
  },
47
43
  "scripts": {
@@ -67,7 +63,7 @@
67
63
  "prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
68
64
  "tsc": "tsc",
69
65
  "tsc:watch": "tsc --watch",
70
- "typetests:gen": "flub generate typetests --generate --dir .",
66
+ "typetests:gen": "fluid-type-test-generator",
71
67
  "typetests:prepare": "flub generate typetests --prepare --dir . --pin"
72
68
  }
73
69
  }
package/src/loader.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IRequest, IResponse, IFluidRouter } from "@fluidframework/core-interfaces";
6
+ import { IRequest, IResponse, IFluidRouter, FluidObject } from "@fluidframework/core-interfaces";
7
7
  import {
8
8
  IClientDetails,
9
9
  IDocumentMessage,
@@ -461,6 +461,19 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
461
461
  * @alpha
462
462
  */
463
463
  forceReadonly?(readonly: boolean);
464
+
465
+ /**
466
+ * Exposes the entryPoint for the container.
467
+ * Use this as the primary way of getting access to the user-defined logic within the container.
468
+ * If the method is undefined or the returned promise returns undefined (meaning that exposing the entryPoint
469
+ * hasn't been implemented in a particular scenario) fall back to the current approach of requesting the default
470
+ * object of the container through the request pattern.
471
+ *
472
+ * @remarks The plan is that eventually IContainer will no longer implement IFluidRouter (and thus won't have a
473
+ * request() method), this method will no longer be optional, and it will become the only way to access
474
+ * the entryPoint for the container.
475
+ */
476
+ getEntryPoint?(): Promise<FluidObject | undefined>;
464
477
  }
465
478
 
466
479
  /**
package/src/runtime.ts CHANGED
@@ -106,6 +106,17 @@ export interface IRuntime extends IDisposable {
106
106
  * stashed ops) after having processed it.
107
107
  */
108
108
  notifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;
109
+
110
+ /**
111
+ * Exposes the entryPoint for the container runtime.
112
+ * Use this as the primary way of getting access to the user-defined logic within the container runtime.
113
+ *
114
+ * @see {@link IContainer.getEntryPoint}
115
+ *
116
+ * @remarks The plan is that eventually IRuntime will no longer have a request() method, this method will no
117
+ * longer be optional, and it will become the only way to access the entryPoint for the runtime.
118
+ */
119
+ getEntryPoint?(): Promise<FluidObject | undefined>;
109
120
  }
110
121
 
111
122
  /**
@@ -193,6 +204,13 @@ export interface IContainerContext extends IDisposable {
193
204
  * and scenarios which can change in the future.
194
205
  */
195
206
  readonly id: string;
207
+
208
+ /**
209
+ * Proxy for {@link IRuntime.getEntryPoint}, the entryPoint defined in the container's runtime.
210
+ *
211
+ * @see {@link IContainer.getEntryPoint}
212
+ */
213
+ getEntryPoint?(): Promise<FluidObject | undefined>;
196
214
  }
197
215
 
198
216
  export const IRuntimeFactory: keyof IProvideRuntimeFactory = "IRuntimeFactory";