@fluidframework/container-definitions 2.0.0-dev.7.4.0.216897 → 2.0.0-dev.7.4.0.217212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/api-report/container-definitions.api.md +35 -35
  2. package/dist/audience.d.ts +2 -2
  3. package/dist/audience.js.map +1 -1
  4. package/dist/container-definitions-alpha.d.ts +1125 -56
  5. package/dist/container-definitions-untrimmed.d.ts +39 -39
  6. package/dist/deltas.d.ts +7 -7
  7. package/dist/deltas.js.map +1 -1
  8. package/dist/error.d.ts +2 -2
  9. package/dist/error.js.map +1 -1
  10. package/dist/fluidModule.d.ts +1 -1
  11. package/dist/fluidModule.js.map +1 -1
  12. package/dist/fluidPackage.d.ts +7 -7
  13. package/dist/fluidPackage.js +1 -1
  14. package/dist/fluidPackage.js.map +1 -1
  15. package/dist/loader.d.ts +12 -12
  16. package/dist/loader.js.map +1 -1
  17. package/dist/runtime.d.ts +8 -8
  18. package/dist/runtime.js +2 -2
  19. package/dist/runtime.js.map +1 -1
  20. package/lib/audience.d.ts +2 -2
  21. package/lib/audience.js.map +1 -1
  22. package/lib/container-definitions-alpha.d.ts +1125 -56
  23. package/lib/container-definitions-untrimmed.d.ts +39 -39
  24. package/lib/deltas.d.ts +7 -7
  25. package/lib/deltas.js.map +1 -1
  26. package/lib/error.d.ts +2 -2
  27. package/lib/error.js.map +1 -1
  28. package/lib/fluidModule.d.ts +1 -1
  29. package/lib/fluidModule.js.map +1 -1
  30. package/lib/fluidPackage.d.ts +7 -7
  31. package/lib/fluidPackage.js +1 -1
  32. package/lib/fluidPackage.js.map +1 -1
  33. package/lib/loader.d.ts +12 -12
  34. package/lib/loader.js.map +1 -1
  35. package/lib/runtime.d.ts +8 -8
  36. package/lib/runtime.js +2 -2
  37. package/lib/runtime.js.map +1 -1
  38. package/package.json +3 -3
  39. package/src/audience.ts +2 -2
  40. package/src/deltas.ts +7 -7
  41. package/src/error.ts +2 -2
  42. package/src/fluidModule.ts +1 -1
  43. package/src/fluidPackage.ts +7 -7
  44. package/src/loader.ts +12 -12
  45. package/src/runtime.ts +8 -8
package/lib/loader.d.ts CHANGED
@@ -76,7 +76,7 @@ export interface IFluidCodeResolver {
76
76
  }
77
77
  /**
78
78
  * Events emitted by the {@link IContainer} "upwards" to the Loader and Host.
79
- * @internal
79
+ * @alpha
80
80
  */
81
81
  export interface IContainerEvents extends IEvent {
82
82
  /**
@@ -221,41 +221,41 @@ export interface IContainerEvents extends IEvent {
221
221
  /**
222
222
  * Namespace for the different connection states a container can be in.
223
223
  * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.
224
- * @internal
224
+ * @alpha
225
225
  */
226
226
  export declare namespace ConnectionState {
227
227
  /**
228
228
  * The container is not connected to the delta server.
229
229
  * Note - When in this state the container may be about to reconnect,
230
230
  * or may remain disconnected until explicitly told to connect.
231
- * @internal
231
+ * @alpha
232
232
  */
233
233
  type Disconnected = 0;
234
234
  /**
235
235
  * The container is disconnected but actively trying to establish a new connection.
236
236
  * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.
237
- * @internal
237
+ * @alpha
238
238
  */
239
239
  type EstablishingConnection = 3;
240
240
  /**
241
241
  * The container has an inbound connection only, and is catching up to the latest known state from the service.
242
- * @internal
242
+ * @alpha
243
243
  */
244
244
  type CatchingUp = 1;
245
245
  /**
246
246
  * The container is fully connected and syncing.
247
- * @internal
247
+ * @alpha
248
248
  */
249
249
  type Connected = 2;
250
250
  }
251
251
  /**
252
252
  * Type defining the different states of connectivity a Container can be in.
253
- * @internal
253
+ * @alpha
254
254
  */
255
255
  export type ConnectionState = ConnectionState.Disconnected | ConnectionState.EstablishingConnection | ConnectionState.CatchingUp | ConnectionState.Connected;
256
256
  /**
257
257
  * The Host's view of a Container and its connection to storage
258
- * @internal
258
+ * @alpha
259
259
  */
260
260
  export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {
261
261
  /**
@@ -440,7 +440,7 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
440
440
  }
441
441
  /**
442
442
  * The Runtime's view of the Loader, used for loading Containers
443
- * @internal
443
+ * @alpha
444
444
  */
445
445
  export interface ILoader extends Partial<IProvideLoader> {
446
446
  /**
@@ -485,7 +485,7 @@ export interface IHostLoader extends ILoader {
485
485
  }): Promise<IContainer>;
486
486
  }
487
487
  /**
488
- * @internal
488
+ * @alpha
489
489
  */
490
490
  export type ILoaderOptions = {
491
491
  [key in string | number]: any;
@@ -573,7 +573,7 @@ export interface ILoaderHeader {
573
573
  [LoaderHeader.version]: string | undefined;
574
574
  }
575
575
  /**
576
- * @internal
576
+ * @alpha
577
577
  */
578
578
  export interface IProvideLoader {
579
579
  readonly ILoader: ILoader;
@@ -593,7 +593,7 @@ export interface IPendingLocalState {
593
593
  * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.
594
594
  *
595
595
  * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.
596
- * @internal
596
+ * @alpha
597
597
  */
598
598
  export interface ISnapshotTreeWithBlobContents extends ISnapshotTree {
599
599
  blobsContents: {
package/lib/loader.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAylBH;;;GAGG;AACH,MAAM,CAAN,IAAY,YA2BX;AA3BD,WAAY,YAAY;IACvB;;;OAGG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B;;;OAGG;IACH,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACpB,CAAC,EA3BW,YAAY,KAAZ,YAAY,QA2BvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIRequest,\n\tIResponse,\n\t// eslint-disable-next-line import/no-deprecated\n\tIFluidRouter,\n\tFluidObject,\n\tIEvent,\n\tIEventProvider,\n} 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 { 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 * @internal\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 * @internal\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 * @internal\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 * @internal\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 * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n * @internal\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 * 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 begins the process of\n\t * {@link AttachState.Attaching | 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: \"attaching\", listener: () => void);\n\n\t/**\n\t * Emitted when the {@link AttachState.Attaching | attaching} process is complete and the 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 * @internal\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 * @internal\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 * @internal\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 * @internal\n\t */\n\texport type CatchingUp = 1;\n\n\t/**\n\t * The container is fully connected and syncing.\n\t * @internal\n\t */\n\texport type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n * @internal\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 * @internal\n */\n// eslint-disable-next-line import/no-deprecated\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 and/or disposed, otherwise false.\n\t */\n\treadonly closed: boolean;\n\n\t/**\n\t * Returns true if the container has been disposed, otherwise false.\n\t */\n\treadonly disposed?: 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 * 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(\n\t\trequest: IRequest,\n\t\tattachProps?: { deltaConnection?: \"none\" | \"delayed\" },\n\t): 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 * @deprecated Requesting will not be supported in a future major release.\n\t * Instead, access the objects in a Fluid Container using entryPoint, and then navigate from there using\n\t * app-specific logic (e.g. retrieving handles from the entryPoint's DDSes, or a container's entryPoint object\n\t * could implement a request paradigm itself)\n\t *\n\t * IMPORTANT: This overload is provided for back-compat where IContainer.request(\\{ url: \"/\" \\}) is already implemented and used.\n\t * The functionality it can provide (if the Container implementation is built for it) is redundant with @see {@link IContainer.getEntryPoint}.\n\t *\n\t * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.\n\t *\n\t * @param request - Only requesting \\{ url: \"/\" \\} is supported, requesting arbitrary URLs is deprecated.\n\t */\n\trequest(request: { url: \"/\"; headers?: undefined }): Promise<IResponse>;\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\t * @deprecated Requesting an arbitrary URL with headers will not be supported in a future major release.\n\t * Instead, access the objects in a Fluid Container using entryPoint, and then navigate from there using\n\t * app-specific logic (e.g. retrieving handles from the entryPoint's DDSes, or a container's entryPoint object\n\t * could implement a request paradigm itself)\n\t *\n\t * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly IFluidRouter: IFluidRouter;\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 */\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 */\n\tgetEntryPoint(): Promise<FluidObject | undefined>;\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n * @internal\n */\nexport interface ILoader extends 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\t/**\n\t * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly IFluidRouter: IFluidRouter;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n * @internal\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(\n\t\tcodeDetails: IFluidCodeDetails,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): 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(\n\t\tsnapshot: string,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): Promise<IContainer>;\n}\n\n/**\n * @internal\n */\nexport type ILoaderOptions = {\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[key in string | number]: any;\n} & {\n\t/**\n\t * @deprecated This option has been deprecated and will be removed in a future release\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 false.\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 * @internal\n */\nexport enum LoaderHeader {\n\t/**\n\t * @deprecated This header has been deprecated and will be removed in a future release\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\t/**\n\t * Loads the container to at least the specified sequence number.\n\t * If not defined, behavior will fall back to `IContainerLoadMode.opsBeforeReturn`.\n\t */\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\n/**\n * @internal\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 fetch and apply trailing ops up until (and including) the specified sequence number.\n\t\t * Requires `ILoaderHeader[\"fluid-sequence-number\"]` to also be defined.\n\t\t */\n\t\t| \"sequenceNumber\"\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\t/**\n\t * If set to true, will indefinitely pause all incoming and outgoing after the container is loaded.\n\t */\n\tpauseAfterLoad?: boolean;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n * @internal\n */\nexport interface ILoaderHeader {\n\t/**\n\t * @deprecated This header has been deprecated and will be removed in a future release\n\t */\n\t[LoaderHeader.cache]: boolean;\n\t[LoaderHeader.clientDetails]: IClientDetails;\n\t[LoaderHeader.loadMode]: IContainerLoadMode;\n\t/**\n\t * Loads the container to at least the specified sequence number.\n\t * If not defined, behavior will fall back to `IContainerLoadMode.opsBeforeReturn`.\n\t */\n\t[LoaderHeader.sequenceNumber]: number;\n\t[LoaderHeader.reconnect]: boolean;\n\t[LoaderHeader.version]: string | undefined;\n}\n\n/**\n * @internal\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 * @internal\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 * @internal\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;AAylBH;;;GAGG;AACH,MAAM,CAAN,IAAY,YA2BX;AA3BD,WAAY,YAAY;IACvB;;;OAGG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B;;;OAGG;IACH,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACpB,CAAC,EA3BW,YAAY,KAAZ,YAAY,QA2BvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIRequest,\n\tIResponse,\n\t// eslint-disable-next-line import/no-deprecated\n\tIFluidRouter,\n\tFluidObject,\n\tIEvent,\n\tIEventProvider,\n} 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 { 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 * @internal\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 * @internal\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 * @internal\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 * @internal\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 * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n * @alpha\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 * 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 begins the process of\n\t * {@link AttachState.Attaching | 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: \"attaching\", listener: () => void);\n\n\t/**\n\t * Emitted when the {@link AttachState.Attaching | attaching} process is complete and the 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 * @alpha\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 * @alpha\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 * @alpha\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 * @alpha\n\t */\n\texport type CatchingUp = 1;\n\n\t/**\n\t * The container is fully connected and syncing.\n\t * @alpha\n\t */\n\texport type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n * @alpha\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 * @alpha\n */\n// eslint-disable-next-line import/no-deprecated\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 and/or disposed, otherwise false.\n\t */\n\treadonly closed: boolean;\n\n\t/**\n\t * Returns true if the container has been disposed, otherwise false.\n\t */\n\treadonly disposed?: 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 * 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(\n\t\trequest: IRequest,\n\t\tattachProps?: { deltaConnection?: \"none\" | \"delayed\" },\n\t): 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 * @deprecated Requesting will not be supported in a future major release.\n\t * Instead, access the objects in a Fluid Container using entryPoint, and then navigate from there using\n\t * app-specific logic (e.g. retrieving handles from the entryPoint's DDSes, or a container's entryPoint object\n\t * could implement a request paradigm itself)\n\t *\n\t * IMPORTANT: This overload is provided for back-compat where IContainer.request(\\{ url: \"/\" \\}) is already implemented and used.\n\t * The functionality it can provide (if the Container implementation is built for it) is redundant with @see {@link IContainer.getEntryPoint}.\n\t *\n\t * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.\n\t *\n\t * @param request - Only requesting \\{ url: \"/\" \\} is supported, requesting arbitrary URLs is deprecated.\n\t */\n\trequest(request: { url: \"/\"; headers?: undefined }): Promise<IResponse>;\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\t * @deprecated Requesting an arbitrary URL with headers will not be supported in a future major release.\n\t * Instead, access the objects in a Fluid Container using entryPoint, and then navigate from there using\n\t * app-specific logic (e.g. retrieving handles from the entryPoint's DDSes, or a container's entryPoint object\n\t * could implement a request paradigm itself)\n\t *\n\t * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly IFluidRouter: IFluidRouter;\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 */\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 */\n\tgetEntryPoint(): Promise<FluidObject | undefined>;\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n * @alpha\n */\nexport interface ILoader extends 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\t/**\n\t * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly IFluidRouter: IFluidRouter;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n * @internal\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(\n\t\tcodeDetails: IFluidCodeDetails,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): 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(\n\t\tsnapshot: string,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): Promise<IContainer>;\n}\n\n/**\n * @alpha\n */\nexport type ILoaderOptions = {\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[key in string | number]: any;\n} & {\n\t/**\n\t * @deprecated This option has been deprecated and will be removed in a future release\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 false.\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 * @internal\n */\nexport enum LoaderHeader {\n\t/**\n\t * @deprecated This header has been deprecated and will be removed in a future release\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\t/**\n\t * Loads the container to at least the specified sequence number.\n\t * If not defined, behavior will fall back to `IContainerLoadMode.opsBeforeReturn`.\n\t */\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\n/**\n * @internal\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 fetch and apply trailing ops up until (and including) the specified sequence number.\n\t\t * Requires `ILoaderHeader[\"fluid-sequence-number\"]` to also be defined.\n\t\t */\n\t\t| \"sequenceNumber\"\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\t/**\n\t * If set to true, will indefinitely pause all incoming and outgoing after the container is loaded.\n\t */\n\tpauseAfterLoad?: boolean;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n * @internal\n */\nexport interface ILoaderHeader {\n\t/**\n\t * @deprecated This header has been deprecated and will be removed in a future release\n\t */\n\t[LoaderHeader.cache]: boolean;\n\t[LoaderHeader.clientDetails]: IClientDetails;\n\t[LoaderHeader.loadMode]: IContainerLoadMode;\n\t/**\n\t * Loads the container to at least the specified sequence number.\n\t * If not defined, behavior will fall back to `IContainerLoadMode.opsBeforeReturn`.\n\t */\n\t[LoaderHeader.sequenceNumber]: number;\n\t[LoaderHeader.reconnect]: boolean;\n\t[LoaderHeader.version]: string | undefined;\n}\n\n/**\n * @alpha\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 * @internal\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 * @alpha\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n\tblobsContents: { [path: string]: ArrayBufferLike };\n\ttrees: { [path: string]: ISnapshotTreeWithBlobContents };\n}\n"]}
package/lib/runtime.d.ts CHANGED
@@ -13,7 +13,7 @@ import { IFluidCodeDetails } from "./fluidPackage";
13
13
  /**
14
14
  * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the
15
15
  * service. The transition from detached to attached state is a one-way transition.
16
- * @internal
16
+ * @alpha
17
17
  */
18
18
  export declare enum AttachState {
19
19
  /**
@@ -34,7 +34,7 @@ export declare enum AttachState {
34
34
  /**
35
35
  * The IRuntime represents an instantiation of a code package within a Container.
36
36
  * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
37
- * @internal
37
+ * @alpha
38
38
  */
39
39
  export interface IRuntime extends IDisposable {
40
40
  /**
@@ -92,7 +92,7 @@ export interface IRuntime extends IDisposable {
92
92
  }
93
93
  /**
94
94
  * Payload type for IContainerContext.submitBatchFn()
95
- * @internal
95
+ * @alpha
96
96
  */
97
97
  export interface IBatchMessage {
98
98
  contents?: string;
@@ -104,7 +104,7 @@ export interface IBatchMessage {
104
104
  * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the
105
105
  * loader layer. It gets passed into the IRuntimeFactory.instantiateRuntime call. Only include members on this interface
106
106
  * if you intend them to be consumed/called from the runtime layer.
107
- * @internal
107
+ * @alpha
108
108
  */
109
109
  export interface IContainerContext {
110
110
  readonly options: ILoaderOptions;
@@ -170,11 +170,11 @@ export interface IContainerContext {
170
170
  readonly id: string;
171
171
  }
172
172
  /**
173
- * @internal
173
+ * @alpha
174
174
  */
175
175
  export declare const IRuntimeFactory: keyof IProvideRuntimeFactory;
176
176
  /**
177
- * @internal
177
+ * @alpha
178
178
  */
179
179
  export interface IProvideRuntimeFactory {
180
180
  readonly IRuntimeFactory: IRuntimeFactory;
@@ -184,7 +184,7 @@ export interface IProvideRuntimeFactory {
184
184
  *
185
185
  * Provides the entry point for the ContainerContext to load the proper IRuntime
186
186
  * to start up the running instance of the Container.
187
- * @internal
187
+ * @alpha
188
188
  */
189
189
  export interface IRuntimeFactory extends IProvideRuntimeFactory {
190
190
  /**
@@ -198,7 +198,7 @@ export interface IRuntimeFactory extends IProvideRuntimeFactory {
198
198
  }
199
199
  /**
200
200
  * Defines list of properties expected for getPendingLocalState
201
- * @internal
201
+ * @alpha
202
202
  */
203
203
  export interface IGetPendingLocalStateProps {
204
204
  /**
package/lib/runtime.js CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the
7
7
  * service. The transition from detached to attached state is a one-way transition.
8
- * @internal
8
+ * @alpha
9
9
  */
10
10
  export var AttachState;
11
11
  (function (AttachState) {
@@ -25,7 +25,7 @@ export var AttachState;
25
25
  AttachState["Attached"] = "Attached";
26
26
  })(AttachState || (AttachState = {}));
27
27
  /**
28
- * @internal
28
+ * @alpha
29
29
  */
30
30
  export const IRuntimeFactory = "IRuntimeFactory";
31
31
  //# sourceMappingURL=runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA4BH;;;;GAIG;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;;GAEG;AACH,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 {\n\tITelemetryBaseLogger,\n\tIDisposable,\n\tFluidObject,\n\tIRequest,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\n\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\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 * @internal\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 * @internal\n */\nexport interface IRuntime extends IDisposable {\n\t/**\n\t * Executes a request against the runtime\n\t * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\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\t// TODO: use `unknown` instead (API breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\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 */\n\tgetPendingLocalState(props?: IGetPendingLocalStateProps): 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\tgetEntryPoint(): Promise<FluidObject | undefined>;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n * @internal\n */\nexport interface IBatchMessage {\n\tcontents?: string;\n\tmetadata: Record<string, unknown> | undefined;\n\tcompression?: string;\n\treferenceSequenceNumber?: number;\n}\n\n/**\n * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the\n * loader layer. It gets passed into the IRuntimeFactory.instantiateRuntime call. Only include members on this interface\n * if you intend them to be consumed/called from the runtime layer.\n * @internal\n */\nexport interface IContainerContext {\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/**\n\t * @deprecated Please use submitBatchFn & submitSummaryFn\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treadonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n\t/**\n\t * @returns clientSequenceNumber of last message in a batch\n\t */\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t// TODO: use `unknown` instead (API breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treadonly submitSignalFn: (contents: any, targetClientId?: string) => 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\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 * @deprecated 2.0.0-internal.5.2.0 - The docId is already logged by the {@link IContainerContext.taggedLogger} for\n\t * telemetry purposes, so this is generally unnecessary for telemetry.\n\t * If the id is needed for other purposes it should be passed to the consumer explicitly.\n\t *\n\t * @privateremarks Tracking in AB#5714\n\t */\n\treadonly id: string;\n}\n\n/**\n * @internal\n */\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\n/**\n * @internal\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 * @internal\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\n/**\n * Defines list of properties expected for getPendingLocalState\n * @internal\n */\nexport interface IGetPendingLocalStateProps {\n\t/**\n\t * Indicates the container will close after getting the pending state. Used internally\n\t * to wait for blobs to be attached to a DDS and collect generated ops before closing.\n\t */\n\treadonly notifyImminentClosure: boolean;\n\n\t/**\n\t * Abort signal to stop waiting for blobs to get attached to a DDS. When triggered,\n\t * only blobs attached will be collected in the pending state.\n\t * Intended to be used in the very rare scenario in which getLocalPendingState go stale due\n\t * to a blob failed to be referenced. Such a blob will be lost but the rest of the state will\n\t * be preserved and collected.\n\t */\n\treadonly stopBlobAttachingSignal?: AbortSignal;\n}\n"]}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA4BH;;;;GAIG;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;;GAEG;AACH,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 {\n\tITelemetryBaseLogger,\n\tIDisposable,\n\tFluidObject,\n\tIRequest,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\n\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\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 * @alpha\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 * @alpha\n */\nexport interface IRuntime extends IDisposable {\n\t/**\n\t * Executes a request against the runtime\n\t * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\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\t// TODO: use `unknown` instead (API breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\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 */\n\tgetPendingLocalState(props?: IGetPendingLocalStateProps): 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\tgetEntryPoint(): Promise<FluidObject | undefined>;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n * @alpha\n */\nexport interface IBatchMessage {\n\tcontents?: string;\n\tmetadata: Record<string, unknown> | undefined;\n\tcompression?: string;\n\treferenceSequenceNumber?: number;\n}\n\n/**\n * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the\n * loader layer. It gets passed into the IRuntimeFactory.instantiateRuntime call. Only include members on this interface\n * if you intend them to be consumed/called from the runtime layer.\n * @alpha\n */\nexport interface IContainerContext {\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/**\n\t * @deprecated Please use submitBatchFn & submitSummaryFn\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treadonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n\t/**\n\t * @returns clientSequenceNumber of last message in a batch\n\t */\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t// TODO: use `unknown` instead (API breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treadonly submitSignalFn: (contents: any, targetClientId?: string) => 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\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 * @deprecated 2.0.0-internal.5.2.0 - The docId is already logged by the {@link IContainerContext.taggedLogger} for\n\t * telemetry purposes, so this is generally unnecessary for telemetry.\n\t * If the id is needed for other purposes it should be passed to the consumer explicitly.\n\t *\n\t * @privateremarks Tracking in AB#5714\n\t */\n\treadonly id: string;\n}\n\n/**\n * @alpha\n */\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\n/**\n * @alpha\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 * @alpha\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\n/**\n * Defines list of properties expected for getPendingLocalState\n * @alpha\n */\nexport interface IGetPendingLocalStateProps {\n\t/**\n\t * Indicates the container will close after getting the pending state. Used internally\n\t * to wait for blobs to be attached to a DDS and collect generated ops before closing.\n\t */\n\treadonly notifyImminentClosure: boolean;\n\n\t/**\n\t * Abort signal to stop waiting for blobs to get attached to a DDS. When triggered,\n\t * only blobs attached will be collected in the pending state.\n\t * Intended to be used in the very rare scenario in which getLocalPendingState go stale due\n\t * to a blob failed to be referenced. Such a blob will be lost but the rest of the state will\n\t * be preserved and collected.\n\t */\n\treadonly stopBlobAttachingSignal?: AbortSignal;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-definitions",
3
- "version": "2.0.0-dev.7.4.0.216897",
3
+ "version": "2.0.0-dev.7.4.0.217212",
4
4
  "description": "Fluid container definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -15,8 +15,8 @@
15
15
  "module": "lib/index.js",
16
16
  "types": "dist/index.d.ts",
17
17
  "dependencies": {
18
- "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.216897",
19
- "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.216897",
18
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.217212",
19
+ "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.217212",
20
20
  "@fluidframework/protocol-definitions": "^3.0.0",
21
21
  "events": "^3.1.0"
22
22
  },
package/src/audience.ts CHANGED
@@ -10,7 +10,7 @@ import { IClient } from "@fluidframework/protocol-definitions";
10
10
 
11
11
  /**
12
12
  * Manages the state and the members for {@link IAudience}
13
- * @internal
13
+ * @alpha
14
14
  */
15
15
  export interface IAudienceOwner extends IAudience {
16
16
  /**
@@ -30,7 +30,7 @@ export interface IAudienceOwner extends IAudience {
30
30
  *
31
31
  * See {@link https://nodejs.org/api/events.html#class-eventemitter | here} for an overview of the `EventEmitter`
32
32
  * class.
33
- * @internal
33
+ * @alpha
34
34
  */
35
35
  export interface IAudience extends EventEmitter {
36
36
  /**
package/src/deltas.ts CHANGED
@@ -22,7 +22,7 @@ import {
22
22
 
23
23
  /**
24
24
  * Contract representing the result of a newly established connection to the server for syncing deltas.
25
- * @internal
25
+ * @alpha
26
26
  */
27
27
  export interface IConnectionDetails {
28
28
  clientId: string;
@@ -44,7 +44,7 @@ export interface IConnectionDetails {
44
44
 
45
45
  /**
46
46
  * Contract supporting delivery of outbound messages to the server
47
- * @internal
47
+ * @alpha
48
48
  */
49
49
  export interface IDeltaSender {
50
50
  /**
@@ -55,7 +55,7 @@ export interface IDeltaSender {
55
55
 
56
56
  /**
57
57
  * Events emitted by {@link IDeltaManager}.
58
- * @internal
58
+ * @alpha
59
59
  */
60
60
  export interface IDeltaManagerEvents extends IEvent {
61
61
  /**
@@ -135,7 +135,7 @@ export interface IDeltaManagerEvents extends IEvent {
135
135
 
136
136
  /**
137
137
  * Manages the transmission of ops between the runtime and storage.
138
- * @internal
138
+ * @alpha
139
139
  */
140
140
  export interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender {
141
141
  /**
@@ -221,7 +221,7 @@ export interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>
221
221
 
222
222
  /**
223
223
  * Events emitted by {@link IDeltaQueue}.
224
- * @internal
224
+ * @alpha
225
225
  */
226
226
  export interface IDeltaQueueEvents<T> extends IErrorEvent {
227
227
  /**
@@ -264,7 +264,7 @@ export interface IDeltaQueueEvents<T> extends IErrorEvent {
264
264
 
265
265
  /**
266
266
  * Queue of ops to be sent to or processed from storage
267
- * @internal
267
+ * @alpha
268
268
  */
269
269
  export interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {
270
270
  /**
@@ -313,7 +313,7 @@ export interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, ID
313
313
  }
314
314
 
315
315
  /**
316
- * @internal
316
+ * @alpha
317
317
  */
318
318
  export type ReadOnlyInfo =
319
319
  | {
package/src/error.ts CHANGED
@@ -64,7 +64,7 @@ export enum ContainerErrorType {
64
64
 
65
65
  /**
66
66
  * Represents warnings raised on container.
67
- * @internal
67
+ * @alpha
68
68
  */
69
69
  export interface ContainerWarning extends IErrorBase {
70
70
  /**
@@ -89,6 +89,6 @@ export interface ContainerWarning extends IErrorBase {
89
89
  * - {@link @fluidframework/odsp-driver-definitions#OdspErrorType}
90
90
  *
91
91
  * - {@link @fluidframework/routerlicious-driver#RouterliciousErrorType}
92
- * @internal
92
+ * @alpha
93
93
  */
94
94
  export type ICriticalContainerError = IErrorBase;
@@ -8,7 +8,7 @@ import { IProvideFluidCodeDetailsComparer } from "./fluidPackage";
8
8
  import { IRuntimeFactory } from "./runtime";
9
9
 
10
10
  /**
11
- * @internal
11
+ * @alpha
12
12
  */
13
13
  export interface IFluidModule {
14
14
  fluidExport: FluidObject<IRuntimeFactory & IProvideFluidCodeDetailsComparer>;
@@ -5,7 +5,7 @@
5
5
 
6
6
  /**
7
7
  * Specifies an environment on Fluid property of a IFluidPackage.
8
- * @internal
8
+ * @alpha
9
9
  */
10
10
  export interface IFluidPackageEnvironment {
11
11
  /**
@@ -36,7 +36,7 @@ export interface IFluidPackageEnvironment {
36
36
  * While compatible with the npm package format it is not necessary that that package is an
37
37
  * npm package:
38
38
  * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}
39
- * @internal
39
+ * @alpha
40
40
  */
41
41
  export interface IFluidPackage {
42
42
  /**
@@ -73,7 +73,7 @@ export const isFluidPackage = (pkg: unknown): pkg is Readonly<IFluidPackage> =>
73
73
 
74
74
  /**
75
75
  * Package manager configuration. Provides a key value mapping of config values
76
- * @internal
76
+ * @alpha
77
77
  */
78
78
  export interface IFluidCodeDetailsConfig {
79
79
  readonly [key: string]: string;
@@ -81,7 +81,7 @@ export interface IFluidCodeDetailsConfig {
81
81
 
82
82
  /**
83
83
  * Data structure used to describe the code to load on the Fluid document
84
- * @internal
84
+ * @alpha
85
85
  */
86
86
  export interface IFluidCodeDetails {
87
87
  /**
@@ -114,13 +114,13 @@ export const isFluidCodeDetails = (details: unknown): details is Readonly<IFluid
114
114
  };
115
115
 
116
116
  /**
117
- * @internal
117
+ * @alpha
118
118
  */
119
119
  export const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer =
120
120
  "IFluidCodeDetailsComparer";
121
121
 
122
122
  /**
123
- * @internal
123
+ * @alpha
124
124
  */
125
125
  export interface IProvideFluidCodeDetailsComparer {
126
126
  readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
@@ -128,7 +128,7 @@ export interface IProvideFluidCodeDetailsComparer {
128
128
 
129
129
  /**
130
130
  * Provides capability to compare Fluid code details.
131
- * @internal
131
+ * @alpha
132
132
  */
133
133
  export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {
134
134
  /**
package/src/loader.ts CHANGED
@@ -98,7 +98,7 @@ export interface IFluidCodeResolver {
98
98
 
99
99
  /**
100
100
  * Events emitted by the {@link IContainer} "upwards" to the Loader and Host.
101
- * @internal
101
+ * @alpha
102
102
  */
103
103
  export interface IContainerEvents extends IEvent {
104
104
  /**
@@ -258,7 +258,7 @@ export interface IContainerEvents extends IEvent {
258
258
  /**
259
259
  * Namespace for the different connection states a container can be in.
260
260
  * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.
261
- * @internal
261
+ * @alpha
262
262
  */
263
263
  // eslint-disable-next-line @typescript-eslint/no-namespace
264
264
  export namespace ConnectionState {
@@ -266,33 +266,33 @@ export namespace ConnectionState {
266
266
  * The container is not connected to the delta server.
267
267
  * Note - When in this state the container may be about to reconnect,
268
268
  * or may remain disconnected until explicitly told to connect.
269
- * @internal
269
+ * @alpha
270
270
  */
271
271
  export type Disconnected = 0;
272
272
 
273
273
  /**
274
274
  * The container is disconnected but actively trying to establish a new connection.
275
275
  * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.
276
- * @internal
276
+ * @alpha
277
277
  */
278
278
  export type EstablishingConnection = 3;
279
279
 
280
280
  /**
281
281
  * The container has an inbound connection only, and is catching up to the latest known state from the service.
282
- * @internal
282
+ * @alpha
283
283
  */
284
284
  export type CatchingUp = 1;
285
285
 
286
286
  /**
287
287
  * The container is fully connected and syncing.
288
- * @internal
288
+ * @alpha
289
289
  */
290
290
  export type Connected = 2;
291
291
  }
292
292
 
293
293
  /**
294
294
  * Type defining the different states of connectivity a Container can be in.
295
- * @internal
295
+ * @alpha
296
296
  */
297
297
  export type ConnectionState =
298
298
  | ConnectionState.Disconnected
@@ -302,7 +302,7 @@ export type ConnectionState =
302
302
 
303
303
  /**
304
304
  * The Host's view of a Container and its connection to storage
305
- * @internal
305
+ * @alpha
306
306
  */
307
307
  // eslint-disable-next-line import/no-deprecated
308
308
  export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {
@@ -513,7 +513,7 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
513
513
 
514
514
  /**
515
515
  * The Runtime's view of the Loader, used for loading Containers
516
- * @internal
516
+ * @alpha
517
517
  */
518
518
  export interface ILoader extends Partial<IProvideLoader> {
519
519
  /**
@@ -570,7 +570,7 @@ export interface IHostLoader extends ILoader {
570
570
  }
571
571
 
572
572
  /**
573
- * @internal
573
+ * @alpha
574
574
  */
575
575
  export type ILoaderOptions = {
576
576
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -710,7 +710,7 @@ export interface ILoaderHeader {
710
710
  }
711
711
 
712
712
  /**
713
- * @internal
713
+ * @alpha
714
714
  */
715
715
  export interface IProvideLoader {
716
716
  readonly ILoader: ILoader;
@@ -732,7 +732,7 @@ export interface IPendingLocalState {
732
732
  * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.
733
733
  *
734
734
  * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.
735
- * @internal
735
+ * @alpha
736
736
  */
737
737
  export interface ISnapshotTreeWithBlobContents extends ISnapshotTree {
738
738
  blobsContents: { [path: string]: ArrayBufferLike };