@fluidframework/container-definitions 2.0.0-internal.2.2.0 → 2.0.0-internal.2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.js CHANGED
@@ -4,12 +4,24 @@
4
4
  */
5
5
 
6
6
  module.exports = {
7
- "extends": [
8
- require.resolve("@fluidframework/eslint-config-fluid"),
9
- "prettier"
10
- ],
11
- "parserOptions": {
12
- "project": ["./tsconfig.json", "./src/test/types/tsconfig.json"]
7
+ extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
8
+
9
+ parserOptions: {
10
+ project: ["./tsconfig.json", "./src/test/types/tsconfig.json"],
11
+ },
12
+ rules: {
13
+ // This library is used in the browser, so we don't want dependencies on most node libraries.
14
+ "import/no-nodejs-modules": ["error", { allow: ["events"] }],
13
15
  },
14
- "rules": {}
15
- }
16
+ overrides: [
17
+ {
18
+ // Rules only for test files
19
+ files: ["*.spec.ts", "src/test/**"],
20
+ rules: {
21
+ // Test files are run in node only so additional node libraries can be used.
22
+ "import/no-nodejs-modules": ["error", { allow: ["assert", "events"] }],
23
+
24
+ },
25
+ },
26
+ ],
27
+ };
@@ -2,7 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- /// <reference types="node" />
6
5
  import { EventEmitter } from "events";
7
6
  import { IClient } from "@fluidframework/protocol-definitions";
8
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC7C;;OAEG;IACF,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EA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AAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,SAAS,IAAI,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAA,KAAK,QAAQ,CAAC,CAAC;AACpG,CAAC,CAAC;AALW,QAAA,kBAAkB,sBAK7B;AAEW,QAAA,yBAAyB,GAA2C,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Specifies an environment on Fluid property of a IFluidPackage.\n */\nexport interface IFluidPackageEnvironment {\n\n /**\n * The name of the target. For a browser environment, this could be umd for scripts\n * or css for styles.\n */\n [target: string]: undefined | {\n /**\n * List of files for the target. These can be relative or absolute.\n * The code loader should resolve relative paths, and validate all\n * full urls.\n */\n files: string[];\n\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition\n * of Library, the entrypoint for umd packages.\n */\n [key: string]: unknown;\n };\n}\n\n/**\n * Fluid-specific properties expected on a package to be loaded by the code loader.\n * While compatible with the npm package format it is not necessary that that package is an\n * npm package:\n * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}\n */\nexport interface IFluidPackage {\n /**\n * The name of the package that this code represnets\n */\n name: string;\n /**\n * This object represents the Fluid specific properties of the package\n */\n fluid: {\n /**\n * The name of the of the environment. This should be something like browser, or node\n * and contain the necessary targets for loading this code in that environment.\n */\n [environment: string]: undefined | IFluidPackageEnvironment;\n };\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition of\n * compatible versions, or deployment information like rings or rollouts.\n */\n [key: string]: unknown;\n}\n\n/**\n * Check if the package.json defines a Fluid package\n * @param pkg - the package json data to check if it is a Fluid package.\n */\nexport const isFluidPackage = (pkg: any): pkg is Readonly<IFluidPackage> =>\n typeof pkg === \"object\"\n && typeof pkg?.name === \"string\"\n && typeof pkg?.fluid === \"object\";\n\n/**\n * Package manager configuration. Provides a key value mapping of config values\n */\nexport interface IFluidCodeDetailsConfig {\n readonly [key: string]: string;\n}\n\n/**\n * Data structure used to describe the code to load on the Fluid document\n */\nexport interface IFluidCodeDetails {\n /**\n * The code package to be used on the Fluid document. This is either the package name which will be loaded\n * from a package manager. Or the expanded Fluid package.\n */\n readonly package: string | Readonly<IFluidPackage>;\n\n /**\n * Configuration details. This includes links to the package manager and base CDNs.\n *\n * @remarks This is strictly consumer-defined data.\n * Its contents and semantics (including whether or not this data is present) are completely up to the consumer.\n */\n readonly config?: IFluidCodeDetailsConfig;\n}\n\nexport const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> => {\n const maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;\n return typeof maybeCodeDetails === \"object\"\n && (typeof maybeCodeDetails?.package === \"string\" || isFluidPackage(maybeCodeDetails?.package))\n && (maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === \"object\");\n};\n\nexport const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer = \"IFluidCodeDetailsComparer\";\n\nexport interface IProvideFluidCodeDetailsComparer {\n readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer ;\n}\n\n/**\n * Provides capability to compare Fluid code details.\n */\nexport interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {\n\n /**\n * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.\n *\n * Similar semantics to:\n * {@link https://github.com/npm/node-semver#usage}\n */\n satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;\n\n /* eslint-disable max-len */\n /**\n * Return a number representing the ascending sort order of the `a` and `b` code details:\n *\n * - `< 0` if `a < b`.\n *\n * - `= 0` if `a === b`.\n *\n * - `> 0` if `a > b`.\n *\n * - `undefined` if `a` is not comparable to `b`.\n *\n * Similar semantics to:\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}\n */\n compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;\n /* eslint-enable max-len */\n}\n"]}
1
+ {"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyDH;;;GAGG;AACI,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAkC,EAAE,CACvE,OAAO,GAAG,KAAK,QAAQ;OACpB,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAA,KAAK,QAAQ;OAC7B,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,CAAA,KAAK,QAAQ,CAAC;AAHzB,QAAA,cAAc,kBAGW;AA4B/B,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAA0C,EAAE;IAC3F,MAAM,gBAAgB,GAAG,OAAiD,CAAC;IAC3E,OAAO,OAAO,gBAAgB,KAAK,QAAQ;WACpC,CAAC,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAA,KAAK,QAAQ,IAAI,IAAA,sBAAc,EAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAC,CAAC;WAC5F,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,SAAS,IAAI,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAA,KAAK,QAAQ,CAAC,CAAC;AACpG,CAAC,CAAC;AALW,QAAA,kBAAkB,sBAK7B;AAEW,QAAA,yBAAyB,GAA2C,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Specifies an environment on Fluid property of a IFluidPackage.\n */\nexport interface IFluidPackageEnvironment {\n\n /**\n * The name of the target. For a browser environment, this could be umd for scripts\n * or css for styles.\n */\n [target: string]: undefined | {\n /**\n * List of files for the target. These can be relative or absolute.\n * The code loader should resolve relative paths, and validate all\n * full urls.\n */\n files: string[];\n\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition\n * of Library, the entrypoint for umd packages.\n */\n [key: string]: unknown;\n };\n}\n\n/**\n * Fluid-specific properties expected on a package to be loaded by the code loader.\n * While compatible with the npm package format it is not necessary that that package is an\n * npm package:\n * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}\n */\nexport interface IFluidPackage {\n /**\n * The name of the package that this code represnets\n */\n name: string;\n /**\n * This object represents the Fluid specific properties of the package\n */\n fluid: {\n /**\n * The name of the of the environment. This should be something like browser, or node\n * and contain the necessary targets for loading this code in that environment.\n */\n [environment: string]: undefined | IFluidPackageEnvironment;\n };\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition of\n * compatible versions, or deployment information like rings or rollouts.\n */\n [key: string]: unknown;\n}\n\n/**\n * Check if the package.json defines a Fluid package\n * @param pkg - the package json data to check if it is a Fluid package.\n */\nexport const isFluidPackage = (pkg: any): pkg is Readonly<IFluidPackage> =>\n typeof pkg === \"object\"\n && typeof pkg?.name === \"string\"\n && typeof pkg?.fluid === \"object\";\n\n/**\n * Package manager configuration. Provides a key value mapping of config values\n */\nexport interface IFluidCodeDetailsConfig {\n readonly [key: string]: string;\n}\n\n/**\n * Data structure used to describe the code to load on the Fluid document\n */\nexport interface IFluidCodeDetails {\n /**\n * The code package to be used on the Fluid document. This is either the package name which will be loaded\n * from a package manager. Or the expanded Fluid package.\n */\n readonly package: string | Readonly<IFluidPackage>;\n\n /**\n * Configuration details. This includes links to the package manager and base CDNs.\n *\n * @remarks This is strictly consumer-defined data.\n * Its contents and semantics (including whether or not this data is present) are completely up to the consumer.\n */\n readonly config?: IFluidCodeDetailsConfig;\n}\n\nexport const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> => {\n const maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;\n return typeof maybeCodeDetails === \"object\"\n && (typeof maybeCodeDetails?.package === \"string\" || isFluidPackage(maybeCodeDetails?.package))\n && (maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === \"object\");\n};\n\nexport const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer = \"IFluidCodeDetailsComparer\";\n\nexport interface IProvideFluidCodeDetailsComparer {\n readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer ;\n}\n\n/**\n * Provides capability to compare Fluid code details.\n */\nexport interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {\n\n /**\n * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.\n *\n * Similar semantics to:\n * {@link https://github.com/npm/node-semver#usage}\n */\n satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;\n\n /**\n * Return a number representing the ascending sort order of the `a` and `b` code details:\n *\n * - `< 0` if `a < b`.\n *\n * - `= 0` if `a === b`.\n *\n * - `> 0` if `a > b`.\n *\n * - `undefined` if `a` is not comparable to `b`.\n *\n * Similar semantics to:\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}\n */\n compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;\n}\n"]}
package/dist/loader.d.ts CHANGED
@@ -152,6 +152,16 @@ export interface IContainerEvents extends IEvent {
152
152
  * @see {@link IContainer.close}
153
153
  */
154
154
  (event: "closed", listener: (error?: ICriticalContainerError) => void): any;
155
+ /**
156
+ * Emitted when the {@link IContainer} is disposed, which permanently disables it.
157
+ *
158
+ * @remarks Listener parameters:
159
+ *
160
+ * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.
161
+ *
162
+ * @see {@link IContainer.dispose}
163
+ */
164
+ (event: "disposed", listener: (error?: ICriticalContainerError) => void): any;
155
165
  /**
156
166
  * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.
157
167
  *
@@ -273,6 +283,14 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
273
283
  * Whether or not there are any local changes that have not been saved.
274
284
  */
275
285
  readonly isDirty: boolean;
286
+ /**
287
+ * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.
288
+ * The container is not expected to be used anymore once it is disposed.
289
+ *
290
+ * @param error - If the container is being disposed due to error, this provides details about the error that
291
+ * resulted in disposing it.
292
+ */
293
+ dispose?(error?: ICriticalContainerError): void;
276
294
  /**
277
295
  * Closes the container.
278
296
  *
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,QAAQ,EACR,SAAS,EACT,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACH,iBAAiB,EACjB,aAAa,EACb,gCAAgC,EACnC,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IAErB;;;;;OAKG;IACH,OAAO,EAAE,iBAAiB,CAAC;CAC9B;AA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6BAA8B,SAAQ,aAAa;IAChE,aAAa,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC;KAAE,CAAC;IACpD,KAAK,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,6BAA6B,CAAC;KAAE,CAAC;CAC7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyfH;;GAEG;AACH,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACpB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACvB,CAAC,EAtBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IRequest,\n IResponse,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IClientDetails,\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISequencedProposal,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport {\n IFluidCodeDetails,\n IFluidPackage,\n IProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n /**\n * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n */\n module: IFluidModule;\n\n /**\n * Code details associated with the module. Represents a document schema this module supports.\n * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}\n * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n * quorum.\n */\n details: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader\n extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Load the code module (package) that can interact with the document.\n *\n * @param source - Code proposal that articulates the current schema the document is written in.\n * @returns - Code module entry point along with the code details associated with it.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n /**\n * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n */\n readonly resolvedPackage: Readonly<IFluidPackage>;\n /**\n * If not undefined, this id will be used to cache the entry point for the code package\n */\n readonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n /**\n * Resolves a Fluid code details into a form that can be loaded.\n * @param details - The Fluid code details to resolve.\n * @returns - A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n * an optional resolvedPackageCacheId if the loaded package should be cached.\n */\n resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n */\nexport interface ICodeAllowList {\n testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n */\n/* eslint-disable @typescript-eslint/unified-signatures */\nexport interface IContainerEvents extends IEvent {\n /**\n * Emitted when the readonly state of the container changes.\n *\n * @remarks Listener parameters:\n *\n * - `readonly`: Whether or not the container is now in a readonly state.\n *\n * @see {@link IContainer.readOnlyInfo}\n */\n (event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n /**\n * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n *\n * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n *\n * @see\n *\n * - {@link IContainer.connectionState}\n *\n * - {@link IContainer.connect}\n */\n (event: \"connected\", listener: (clientId: string) => void);\n\n /**\n * Fires when new container code details have been proposed, prior to acceptance.\n *\n * @remarks Listener parameters:\n *\n * - `codeDetails`: The code details being proposed.\n *\n * - `proposal`: NOT RECOMMENDED FOR USE.\n *\n * @see {@link IContainer.proposeCodeDetails}\n */\n (event: \"codeDetailsProposed\", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n\n /**\n * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n *\n * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n *\n * @see\n *\n * - {@link IContainer.connectionState}\n *\n * - {@link IContainer.disconnect}\n */\n (event: \"disconnected\", listener: () => void);\n\n /**\n * Emitted when a {@link AttachState.Detached | detached} container is\n * {@link AttachState.Attached | attached} to the Fluid service.\n *\n * @see\n *\n * - {@link IContainer.attachState}\n *\n * - {@link IContainer.attach}\n */\n (event: \"attached\", listener: () => void);\n\n /**\n * Emitted when the {@link IContainer} is closed, which permanently disables it.\n *\n * @remarks Listener parameters:\n *\n * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n *\n * @see {@link IContainer.close}\n */\n (event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n /**\n * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n * For now, use of this should be avoided when possible.\n *\n * Listener parameters:\n *\n * - `error`: The warning describing the encountered state.\n */\n (event: \"warning\", listener: (error: ContainerWarning) => void);\n\n /**\n * Emitted immediately after processing an incoming operation (op).\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n * ops directly on the {@link IContainer}.\n *\n * Listener parameters:\n *\n * - `message`: The op that was processed.\n */\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n /**\n * Emitted upon the first local change while the Container is in the \"saved\" state.\n * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n *\n * @remarks Listener parameters:\n *\n * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n *\n * @see {@link IContainer.isDirty}\n */\n (event: \"dirty\", listener: (dirty: boolean) => void);\n\n /**\n * Emitted when all local changes/edits have been acknowledged by the service.\n * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n *\n * @remarks Listener parameters:\n *\n * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n *\n * @see {@link IContainer.isDirty}\n */\n (event: \"saved\", listener: (dirty: boolean) => void);\n}\n/* eslint-enable @typescript-eslint/unified-signatures */\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n /**\n * The container is not connected to the delta server.\n * Note - When in this state the container may be about to reconnect,\n * or may remain disconnected until explicitly told to connect.\n */\n export type Disconnected = 0;\n\n /**\n * The container is disconnected but actively trying to establish a new connection.\n * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n */\n export type EstablishingConnection = 3;\n\n /**\n * The container has an inbound connection only, and is catching up to the latest known state from the service.\n */\n export type CatchingUp = 1;\n\n /**\n * The container is fully connected and syncing.\n */\n export type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n */\nexport type ConnectionState =\n | ConnectionState.Disconnected\n | ConnectionState.EstablishingConnection\n | ConnectionState.CatchingUp\n | ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\n /**\n * The Delta Manager supporting the op stream for this Container\n */\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n /**\n * The collection of write clients which were connected as of the current sequence number.\n * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Represents the resolved url to the Container.\n * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n */\n resolvedUrl: IResolvedUrl | undefined;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Get the code details that are currently specified for the container.\n * @returns The current code details if any are specified, undefined if none are specified.\n */\n getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Get the code details that were used to load the container.\n * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n * loaded.\n */\n getLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Returns true if the container has been closed, otherwise false.\n */\n readonly closed: boolean;\n\n /**\n * Whether or not there are any local changes that have not been saved.\n */\n readonly isDirty: boolean;\n\n /**\n * Closes the container.\n *\n * @param error - If the container is being closed due to error, this provides details about the error that\n * resulted in closing it.\n */\n close(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container and returns serialized local state intended to be\n * given to a newly loaded container.\n */\n closeAndGetPendingLocalState(): string;\n\n /**\n * Propose new code details that define the code to be loaded for this container's runtime.\n *\n * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n */\n proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n /**\n * Attaches the Container to the Container specified by the given Request.\n *\n * @privateRemarks\n *\n * TODO - in the case of failure options should give a retry policy.\n * Or some continuation function that allows attachment to a secondary document.\n */\n attach(request: IRequest): Promise<void>;\n\n /**\n * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container\n * is an error.\n */\n serialize(): string;\n\n /**\n * Get an absolute URL for a provided container-relative request URL.\n * If the container is not attached, this will return undefined.\n *\n * @param relativeUrl - A container-relative request URL.\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Issue a request against the container for a resource.\n * @param request - The request to be issued against the container\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Provides the current state of the container's connection to the ordering service.\n *\n * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n */\n readonly connectionState: ConnectionState;\n\n /**\n * Attempts to connect the container to the delta stream and process ops.\n *\n * @remarks\n *\n * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the\n * \"connected\" event will be fired if/when connection succeeds.\n */\n connect(): void;\n\n /**\n * Disconnects the container from the delta stream and stops processing ops.\n *\n * @remarks\n *\n * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the\n * \"disconnected\" event will be fired when disconnection completes.\n */\n disconnect(): void;\n\n /**\n * The audience information for all clients currently associated with the document in the current session.\n */\n readonly audience: IAudience;\n\n /**\n * The server provided ID of the client.\n *\n * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},\n * otherwise will be `undefined`.\n */\n readonly clientId?: string | undefined;\n\n /**\n * Tells if container is in read-only mode.\n *\n * @remarks\n *\n * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n * Readonly state can be because of no storage write permission,\n * or due to host forcing readonly mode for container.\n *\n * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n *\n * It is undefined if we have not yet established websocket connection\n * and do not know if user has write access to a file.\n */\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /**\n * Allows the host to have the container force to be in read-only mode\n * @param readonly - Boolean that toggles if read-only policies will be enforced\n * @alpha\n */\n forceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n /**\n * Resolves the resource specified by the URL + headers contained in the request object\n * to the underlying container that will resolve the request.\n *\n * @remarks\n *\n * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n * a request against the server found from the resolve step.\n */\n resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n /**\n * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n /**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n [key in string | number]: any;\n} & {\n /**\n * Set caching behavior for the loader. If true, we will load a container from cache if one\n * with the same id/version exists or create a new container and cache it if it does not. If\n * false, always load a new container and don't cache it. If the container has already been\n * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n * request will override the Loader's value.\n * Defaults to true.\n */\n cache?: boolean;\n\n /**\n * Provide the current Loader through the scope object when creating Containers. It is added\n * as the `ILoader` property, and will overwrite an existing property of the same name on the\n * scope. Useful for when the host wants to provide the current Loader's functionality to\n * individual Data Stores, which is typically expected when creating with a Loader.\n * Defaults to true.\n */\n provideScopeLoader?: boolean;\n\n /**\n * Max time (in ms) container will wait for a leave message of a disconnected client.\n */\n maxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n /**\n * Override the Loader's default caching behavior for this container.\n */\n cache = \"fluid-cache\",\n\n clientDetails = \"fluid-client-details\",\n\n /**\n * Start the container in a paused, unconnected state. Defaults to false\n */\n loadMode = \"loadMode\",\n reconnect = \"fluid-reconnect\",\n sequenceNumber = \"fluid-sequence-number\",\n\n /**\n * One of the following:\n * null or \"null\": use ops, no snapshots\n * undefined: fetch latest snapshot\n * otherwise, version sha to load snapshot\n */\n version = \"version\",\n}\n\nexport interface IContainerLoadMode {\n opsBeforeReturn?:\n /*\n * No trailing ops are applied before container is returned.\n * Default value.\n */\n | undefined\n /*\n * Only cached trailing ops are applied before returning container.\n * Caching is optional and could be implemented by the driver.\n * If driver does not implement any kind of local caching strategy, this is same as above.\n * Driver may cache a lot of ops, so care needs to be exercised (see below).\n */\n | \"cached\"\n /*\n * All trailing ops in storage are fetched and applied before container is returned\n * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n * recommended to have some progress UX / cancellation built into loading flow when using this option.\n */\n | \"all\";\n\n deltaConnection?:\n /*\n * Connection to delta stream is made only when Container.connect() call is made. Op processing\n * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n */\n | \"none\"\n /*\n * Connection to delta stream is made only when Container.connect() call is made.\n * Op fetching from storage is performed and ops are applied as they come in.\n * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n */\n | \"delayed\"\n /*\n * Connection to delta stream is made right away.\n * Ops processing is enabled and ops are flowing through the system.\n * Default value.\n */\n | undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n [LoaderHeader.cache]: boolean;\n [LoaderHeader.clientDetails]: IClientDetails;\n [LoaderHeader.loadMode]: IContainerLoadMode;\n [LoaderHeader.sequenceNumber]: number;\n [LoaderHeader.reconnect]: boolean;\n [LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n readonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.\n */\nexport interface IPendingLocalState {\n url: string;\n pendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.\n *\n * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n blobsContents: { [path: string]: ArrayBufferLike; };\n trees: { [path: string]: ISnapshotTreeWithBlobContents; };\n}\n"]}
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6gBH;;GAEG;AACH,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACpB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACvB,CAAC,EAtBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IRequest,\n IResponse,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IClientDetails,\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISequencedProposal,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport {\n IFluidCodeDetails,\n IFluidPackage,\n IProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n /**\n * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n */\n module: IFluidModule;\n\n /**\n * Code details associated with the module. Represents a document schema this module supports.\n * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}\n * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n * quorum.\n */\n details: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader\n extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Load the code module (package) that can interact with the document.\n *\n * @param source - Code proposal that articulates the current schema the document is written in.\n * @returns - Code module entry point along with the code details associated with it.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n /**\n * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n */\n readonly resolvedPackage: Readonly<IFluidPackage>;\n /**\n * If not undefined, this id will be used to cache the entry point for the code package\n */\n readonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n /**\n * Resolves a Fluid code details into a form that can be loaded.\n * @param details - The Fluid code details to resolve.\n * @returns - A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n * an optional resolvedPackageCacheId if the loaded package should be cached.\n */\n resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n */\nexport interface ICodeAllowList {\n testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n */\n/* eslint-disable @typescript-eslint/unified-signatures */\nexport interface IContainerEvents extends IEvent {\n /**\n * Emitted when the readonly state of the container changes.\n *\n * @remarks Listener parameters:\n *\n * - `readonly`: Whether or not the container is now in a readonly state.\n *\n * @see {@link IContainer.readOnlyInfo}\n */\n (event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n /**\n * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n *\n * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n *\n * @see\n *\n * - {@link IContainer.connectionState}\n *\n * - {@link IContainer.connect}\n */\n (event: \"connected\", listener: (clientId: string) => void);\n\n /**\n * Fires when new container code details have been proposed, prior to acceptance.\n *\n * @remarks Listener parameters:\n *\n * - `codeDetails`: The code details being proposed.\n *\n * - `proposal`: NOT RECOMMENDED FOR USE.\n *\n * @see {@link IContainer.proposeCodeDetails}\n */\n (event: \"codeDetailsProposed\", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n\n /**\n * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n *\n * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n *\n * @see\n *\n * - {@link IContainer.connectionState}\n *\n * - {@link IContainer.disconnect}\n */\n (event: \"disconnected\", listener: () => void);\n\n /**\n * Emitted when a {@link AttachState.Detached | detached} container is\n * {@link AttachState.Attached | attached} to the Fluid service.\n *\n * @see\n *\n * - {@link IContainer.attachState}\n *\n * - {@link IContainer.attach}\n */\n (event: \"attached\", listener: () => void);\n\n /**\n * Emitted when the {@link IContainer} is closed, which permanently disables it.\n *\n * @remarks Listener parameters:\n *\n * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n *\n * @see {@link IContainer.close}\n */\n (event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n /**\n * Emitted when the {@link IContainer} is disposed, which permanently disables it.\n *\n * @remarks Listener parameters:\n *\n * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.\n *\n * @see {@link IContainer.dispose}\n */\n (event: \"disposed\", listener: (error?: ICriticalContainerError) => void);\n\n /**\n * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n * For now, use of this should be avoided when possible.\n *\n * Listener parameters:\n *\n * - `error`: The warning describing the encountered state.\n */\n (event: \"warning\", listener: (error: ContainerWarning) => void);\n\n /**\n * Emitted immediately after processing an incoming operation (op).\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n * ops directly on the {@link IContainer}.\n *\n * Listener parameters:\n *\n * - `message`: The op that was processed.\n */\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n /**\n * Emitted upon the first local change while the Container is in the \"saved\" state.\n * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n *\n * @remarks Listener parameters:\n *\n * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n *\n * @see {@link IContainer.isDirty}\n */\n (event: \"dirty\", listener: (dirty: boolean) => void);\n\n /**\n * Emitted when all local changes/edits have been acknowledged by the service.\n * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n *\n * @remarks Listener parameters:\n *\n * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n *\n * @see {@link IContainer.isDirty}\n */\n (event: \"saved\", listener: (dirty: boolean) => void);\n}\n/* eslint-enable @typescript-eslint/unified-signatures */\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n /**\n * The container is not connected to the delta server.\n * Note - When in this state the container may be about to reconnect,\n * or may remain disconnected until explicitly told to connect.\n */\n export type Disconnected = 0;\n\n /**\n * The container is disconnected but actively trying to establish a new connection.\n * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n */\n export type EstablishingConnection = 3;\n\n /**\n * The container has an inbound connection only, and is catching up to the latest known state from the service.\n */\n export type CatchingUp = 1;\n\n /**\n * The container is fully connected and syncing.\n */\n export type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n */\nexport type ConnectionState =\n | ConnectionState.Disconnected\n | ConnectionState.EstablishingConnection\n | ConnectionState.CatchingUp\n | ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\n /**\n * The Delta Manager supporting the op stream for this Container\n */\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n /**\n * The collection of write clients which were connected as of the current sequence number.\n * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Represents the resolved url to the Container.\n * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n */\n resolvedUrl: IResolvedUrl | undefined;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Get the code details that are currently specified for the container.\n * @returns The current code details if any are specified, undefined if none are specified.\n */\n getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Get the code details that were used to load the container.\n * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n * loaded.\n */\n getLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Returns true if the container has been closed, otherwise false.\n */\n readonly closed: boolean;\n\n /**\n * Whether or not there are any local changes that have not been saved.\n */\n readonly isDirty: boolean;\n\n /**\n * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.\n * The container is not expected to be used anymore once it is disposed.\n *\n * @param error - If the container is being disposed due to error, this provides details about the error that\n * resulted in disposing it.\n */\n dispose?(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container.\n *\n * @param error - If the container is being closed due to error, this provides details about the error that\n * resulted in closing it.\n */\n close(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container and returns serialized local state intended to be\n * given to a newly loaded container.\n */\n closeAndGetPendingLocalState(): string;\n\n /**\n * Propose new code details that define the code to be loaded for this container's runtime.\n *\n * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n */\n proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n /**\n * Attaches the Container to the Container specified by the given Request.\n *\n * @privateRemarks\n *\n * TODO - in the case of failure options should give a retry policy.\n * Or some continuation function that allows attachment to a secondary document.\n */\n attach(request: IRequest): Promise<void>;\n\n /**\n * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container\n * is an error.\n */\n serialize(): string;\n\n /**\n * Get an absolute URL for a provided container-relative request URL.\n * If the container is not attached, this will return undefined.\n *\n * @param relativeUrl - A container-relative request URL.\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Issue a request against the container for a resource.\n * @param request - The request to be issued against the container\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Provides the current state of the container's connection to the ordering service.\n *\n * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n */\n readonly connectionState: ConnectionState;\n\n /**\n * Attempts to connect the container to the delta stream and process ops.\n *\n * @remarks\n *\n * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the\n * \"connected\" event will be fired if/when connection succeeds.\n */\n connect(): void;\n\n /**\n * Disconnects the container from the delta stream and stops processing ops.\n *\n * @remarks\n *\n * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the\n * \"disconnected\" event will be fired when disconnection completes.\n */\n disconnect(): void;\n\n /**\n * The audience information for all clients currently associated with the document in the current session.\n */\n readonly audience: IAudience;\n\n /**\n * The server provided ID of the client.\n *\n * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},\n * otherwise will be `undefined`.\n */\n readonly clientId?: string | undefined;\n\n /**\n * Tells if container is in read-only mode.\n *\n * @remarks\n *\n * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n * Readonly state can be because of no storage write permission,\n * or due to host forcing readonly mode for container.\n *\n * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n *\n * It is undefined if we have not yet established websocket connection\n * and do not know if user has write access to a file.\n */\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /**\n * Allows the host to have the container force to be in read-only mode\n * @param readonly - Boolean that toggles if read-only policies will be enforced\n * @alpha\n */\n forceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n /**\n * Resolves the resource specified by the URL + headers contained in the request object\n * to the underlying container that will resolve the request.\n *\n * @remarks\n *\n * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n * a request against the server found from the resolve step.\n */\n resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n /**\n * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n /**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n [key in string | number]: any;\n} & {\n /**\n * Set caching behavior for the loader. If true, we will load a container from cache if one\n * with the same id/version exists or create a new container and cache it if it does not. If\n * false, always load a new container and don't cache it. If the container has already been\n * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n * request will override the Loader's value.\n * Defaults to true.\n */\n cache?: boolean;\n\n /**\n * Provide the current Loader through the scope object when creating Containers. It is added\n * as the `ILoader` property, and will overwrite an existing property of the same name on the\n * scope. Useful for when the host wants to provide the current Loader's functionality to\n * individual Data Stores, which is typically expected when creating with a Loader.\n * Defaults to true.\n */\n provideScopeLoader?: boolean;\n\n /**\n * Max time (in ms) container will wait for a leave message of a disconnected client.\n */\n maxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n /**\n * Override the Loader's default caching behavior for this container.\n */\n cache = \"fluid-cache\",\n\n clientDetails = \"fluid-client-details\",\n\n /**\n * Start the container in a paused, unconnected state. Defaults to false\n */\n loadMode = \"loadMode\",\n reconnect = \"fluid-reconnect\",\n sequenceNumber = \"fluid-sequence-number\",\n\n /**\n * One of the following:\n * null or \"null\": use ops, no snapshots\n * undefined: fetch latest snapshot\n * otherwise, version sha to load snapshot\n */\n version = \"version\",\n}\n\nexport interface IContainerLoadMode {\n opsBeforeReturn?:\n /*\n * No trailing ops are applied before container is returned.\n * Default value.\n */\n | undefined\n /*\n * Only cached trailing ops are applied before returning container.\n * Caching is optional and could be implemented by the driver.\n * If driver does not implement any kind of local caching strategy, this is same as above.\n * Driver may cache a lot of ops, so care needs to be exercised (see below).\n */\n | \"cached\"\n /*\n * All trailing ops in storage are fetched and applied before container is returned\n * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n * recommended to have some progress UX / cancellation built into loading flow when using this option.\n */\n | \"all\";\n\n deltaConnection?:\n /*\n * Connection to delta stream is made only when Container.connect() call is made. Op processing\n * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n */\n | \"none\"\n /*\n * Connection to delta stream is made only when Container.connect() call is made.\n * Op fetching from storage is performed and ops are applied as they come in.\n * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n */\n | \"delayed\"\n /*\n * Connection to delta stream is made right away.\n * Ops processing is enabled and ops are flowing through the system.\n * Default value.\n */\n | undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n [LoaderHeader.cache]: boolean;\n [LoaderHeader.clientDetails]: IClientDetails;\n [LoaderHeader.loadMode]: IContainerLoadMode;\n [LoaderHeader.sequenceNumber]: number;\n [LoaderHeader.reconnect]: boolean;\n [LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n readonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.\n */\nexport interface IPendingLocalState {\n url: string;\n pendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.\n *\n * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n blobsContents: { [path: string]: ArrayBufferLike; };\n trees: { [path: string]: ISnapshotTreeWithBlobContents; };\n}\n"]}
package/dist/runtime.d.ts CHANGED
@@ -106,6 +106,7 @@ export interface IContainerContext extends IDisposable {
106
106
  readonly submitBatchFn: (batch: IBatchMessage[]) => number;
107
107
  readonly submitSummaryFn: (summaryOp: ISummaryContent) => number;
108
108
  readonly submitSignalFn: (contents: any) => void;
109
+ readonly disposeFn?: (error?: ICriticalContainerError) => void;
109
110
  readonly closeFn: (error?: ICriticalContainerError) => void;
110
111
  readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
111
112
  readonly quorum: IQuorumClients;
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAo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AQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC7C;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC3D;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACzF"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA2BH;;;GAGG;AACH,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACnB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACzB,CAAC,EAjBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAiBtB;AAsIY,QAAA,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n FluidObject,\n IRequest,\n IResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n IClientConfiguration,\n IClientDetails,\n ISequencedDocumentMessage,\n ISnapshotTree,\n MessageType,\n ISummaryTree,\n IVersion,\n IDocumentMessage,\n IQuorumClients,\n ISummaryContent,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager } from \"./deltas\";\nimport { ICriticalContainerError } from \"./error\";\nimport { ILoader, ILoaderOptions, ISnapshotTreeWithBlobContents } from \"./loader\";\nimport { IFluidCodeDetails } from \"./fluidPackage\";\n\n/**\n * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the\n * service. The transition from detached to attached state is a one-way transition.\n */\nexport enum AttachState {\n /**\n * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n * to the service.\n */\n Detached = \"Detached\",\n\n /**\n * In attaching state, the data has started the upload to the service, but has not yet completed.\n */\n Attaching = \"Attaching\",\n\n /**\n * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n * reaching attached state.\n */\n Attached = \"Attached\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n */\nexport interface IRuntime extends IDisposable {\n\n /**\n * Executes a request against the runtime\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Notifies the runtime of a change in the connection state\n */\n setConnectionState(connected: boolean, clientId?: string);\n\n /**\n * Processes the given op (message)\n */\n process(message: ISequencedDocumentMessage, local: boolean);\n\n /**\n * Processes the given signal\n */\n processSignal(message: any, local: boolean);\n\n /**\n * Create a summary. Used when attaching or serializing a detached container.\n *\n * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n * new storage IDs so requests can be redirected.\n */\n createSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n /**\n * Propagate the container state when container is attaching or attached.\n * @param attachState - State of the container.\n */\n setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n /**\n * Get pending local state in a serializable format to be given back to a newly loaded container\n */\n getPendingLocalState(): unknown;\n\n /**\n * Notify runtime that container is moving to \"Attaching\" state\n * @param snapshot - snapshot created at attach time\n */\n notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n */\nexport interface IBatchMessage {\n contents?: string;\n metadata: Record<string, unknown> | undefined;\n compression?: string;\n}\n\n/**\n * The ContainerContext is a proxy standing between the Container and the Container's IRuntime.\n * This allows the Container to terminate the connection to the IRuntime.\n *\n * Specifically, there is an event on Container, onContextChanged, which mean a new code proposal has been loaded,\n * so the old IRuntime is no longer valid, as its ContainerContext has been revoked,\n * and the Container has created a new ContainerContext.\n */\nexport interface IContainerContext extends IDisposable {\n /** @deprecated Please pass in existing directly in instantiateRuntime */\n readonly existing: boolean | undefined;\n readonly options: ILoaderOptions;\n readonly clientId: string | undefined;\n readonly clientDetails: IClientDetails;\n readonly storage: IDocumentStorageService;\n readonly connected: boolean;\n readonly baseSnapshot: ISnapshotTree | undefined;\n /** @deprecated Please use submitBatchFn & submitSummaryFn */\n readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n /** @returns clientSequenceNumber of last message in a batch */\n readonly submitBatchFn: (batch: IBatchMessage[]) => number;\n readonly submitSummaryFn: (summaryOp: ISummaryContent) => number;\n readonly submitSignalFn: (contents: any) => void;\n readonly closeFn: (error?: ICriticalContainerError) => void;\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n readonly quorum: IQuorumClients;\n /**\n * @deprecated This method is provided as a migration tool for customers currently reading the code details\n * from within the Container by directly accessing the Quorum proposals. The code details should not be accessed\n * from within the Container as this requires coupling between the container contents and the code loader.\n * Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this\n * migration tool will be removed.\n */\n getSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;\n readonly audience: IAudience | undefined;\n readonly loader: ILoader;\n // The logger implementation, which would support tagged events, should be provided by the loader.\n readonly taggedLogger: ITelemetryBaseLogger;\n readonly serviceConfiguration: IClientConfiguration | undefined;\n pendingLocalState?: unknown;\n\n /**\n * Ambient services provided with the context\n */\n readonly scope: FluidObject;\n\n /**\n * Get an absolute url for a provided container-relative request.\n * @param relativeUrl - A relative request within the container\n *\n * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n */\n getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n getLoadedFromVersion(): IVersion | undefined;\n\n updateDirtyContainerState(dirty: boolean): void;\n /**\n * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n * and scenarios which can change in the future.\n */\n readonly id: string;\n}\n\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\nexport interface IProvideRuntimeFactory {\n readonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n /**\n * Instantiates a new IRuntime for the given IContainerContext to proxy to\n * This is the main entry point to the Container's business logic\n *\n * @param context - container context to be supplied to the runtime\n * @param existing - whether to instantiate for the first time or from an existing context\n */\n instantiateRuntime(context: IContainerContext, existing?: boolean): Promise<IRuntime>;\n}\n"]}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA2BH;;;GAGG;AACH,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACnB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACzB,CAAC,EAjBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAiBtB;AAuIY,QAAA,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n FluidObject,\n IRequest,\n IResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n IClientConfiguration,\n IClientDetails,\n ISequencedDocumentMessage,\n ISnapshotTree,\n MessageType,\n ISummaryTree,\n IVersion,\n IDocumentMessage,\n IQuorumClients,\n ISummaryContent,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager } from \"./deltas\";\nimport { ICriticalContainerError } from \"./error\";\nimport { ILoader, ILoaderOptions, ISnapshotTreeWithBlobContents } from \"./loader\";\nimport { IFluidCodeDetails } from \"./fluidPackage\";\n\n/**\n * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the\n * service. The transition from detached to attached state is a one-way transition.\n */\nexport enum AttachState {\n /**\n * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n * to the service.\n */\n Detached = \"Detached\",\n\n /**\n * In attaching state, the data has started the upload to the service, but has not yet completed.\n */\n Attaching = \"Attaching\",\n\n /**\n * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n * reaching attached state.\n */\n Attached = \"Attached\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n */\nexport interface IRuntime extends IDisposable {\n\n /**\n * Executes a request against the runtime\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Notifies the runtime of a change in the connection state\n */\n setConnectionState(connected: boolean, clientId?: string);\n\n /**\n * Processes the given op (message)\n */\n process(message: ISequencedDocumentMessage, local: boolean);\n\n /**\n * Processes the given signal\n */\n processSignal(message: any, local: boolean);\n\n /**\n * Create a summary. Used when attaching or serializing a detached container.\n *\n * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n * new storage IDs so requests can be redirected.\n */\n createSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n /**\n * Propagate the container state when container is attaching or attached.\n * @param attachState - State of the container.\n */\n setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n /**\n * Get pending local state in a serializable format to be given back to a newly loaded container\n */\n getPendingLocalState(): unknown;\n\n /**\n * Notify runtime that container is moving to \"Attaching\" state\n * @param snapshot - snapshot created at attach time\n */\n notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n */\nexport interface IBatchMessage {\n contents?: string;\n metadata: Record<string, unknown> | undefined;\n compression?: string;\n}\n\n/**\n * The ContainerContext is a proxy standing between the Container and the Container's IRuntime.\n * This allows the Container to terminate the connection to the IRuntime.\n *\n * Specifically, there is an event on Container, onContextChanged, which mean a new code proposal has been loaded,\n * so the old IRuntime is no longer valid, as its ContainerContext has been revoked,\n * and the Container has created a new ContainerContext.\n */\nexport interface IContainerContext extends IDisposable {\n /** @deprecated Please pass in existing directly in instantiateRuntime */\n readonly existing: boolean | undefined;\n readonly options: ILoaderOptions;\n readonly clientId: string | undefined;\n readonly clientDetails: IClientDetails;\n readonly storage: IDocumentStorageService;\n readonly connected: boolean;\n readonly baseSnapshot: ISnapshotTree | undefined;\n /** @deprecated Please use submitBatchFn & submitSummaryFn */\n readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n /** @returns clientSequenceNumber of last message in a batch */\n readonly submitBatchFn: (batch: IBatchMessage[]) => number;\n readonly submitSummaryFn: (summaryOp: ISummaryContent) => number;\n readonly submitSignalFn: (contents: any) => void;\n readonly disposeFn?: (error?: ICriticalContainerError) => void;\n readonly closeFn: (error?: ICriticalContainerError) => void;\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n readonly quorum: IQuorumClients;\n /**\n * @deprecated This method is provided as a migration tool for customers currently reading the code details\n * from within the Container by directly accessing the Quorum proposals. The code details should not be accessed\n * from within the Container as this requires coupling between the container contents and the code loader.\n * Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this\n * migration tool will be removed.\n */\n getSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;\n readonly audience: IAudience | undefined;\n readonly loader: ILoader;\n // The logger implementation, which would support tagged events, should be provided by the loader.\n readonly taggedLogger: ITelemetryBaseLogger;\n readonly serviceConfiguration: IClientConfiguration | undefined;\n pendingLocalState?: unknown;\n\n /**\n * Ambient services provided with the context\n */\n readonly scope: FluidObject;\n\n /**\n * Get an absolute url for a provided container-relative request.\n * @param relativeUrl - A relative request within the container\n *\n * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n */\n getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n getLoadedFromVersion(): IVersion | undefined;\n\n updateDirtyContainerState(dirty: boolean): void;\n /**\n * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n * and scenarios which can change in the future.\n */\n readonly id: string;\n}\n\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\nexport interface IProvideRuntimeFactory {\n readonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n /**\n * Instantiates a new IRuntime for the given IContainerContext to proxy to\n * This is the main entry point to the Container's business logic\n *\n * @param context - container context to be supplied to the runtime\n * @param existing - whether to instantiate for the first time or from an existing context\n */\n instantiateRuntime(context: IContainerContext, existing?: boolean): Promise<IRuntime>;\n}\n"]}
package/lib/audience.d.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- /// <reference types="node" />
6
5
  import { EventEmitter } from "events";
7
6
  import { IClient } from "@fluidframework/protocol-definitions";
8
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC7C;;OAEG;IACF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E,OAAO,CAAC,CAAC;WAC5F,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,SAAS,IAAI,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAA,KAAK,QAAQ,CAAC,CAAC;AACpG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAA2C,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Specifies an environment on Fluid property of a IFluidPackage.\n */\nexport interface IFluidPackageEnvironment {\n\n /**\n * The name of the target. For a browser environment, this could be umd for scripts\n * or css for styles.\n */\n [target: string]: undefined | {\n /**\n * List of files for the target. These can be relative or absolute.\n * The code loader should resolve relative paths, and validate all\n * full urls.\n */\n files: string[];\n\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition\n * of Library, the entrypoint for umd packages.\n */\n [key: string]: unknown;\n };\n}\n\n/**\n * Fluid-specific properties expected on a package to be loaded by the code loader.\n * While compatible with the npm package format it is not necessary that that package is an\n * npm package:\n * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}\n */\nexport interface IFluidPackage {\n /**\n * The name of the package that this code represnets\n */\n name: string;\n /**\n * This object represents the Fluid specific properties of the package\n */\n fluid: {\n /**\n * The name of the of the environment. This should be something like browser, or node\n * and contain the necessary targets for loading this code in that environment.\n */\n [environment: string]: undefined | IFluidPackageEnvironment;\n };\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition of\n * compatible versions, or deployment information like rings or rollouts.\n */\n [key: string]: unknown;\n}\n\n/**\n * Check if the package.json defines a Fluid package\n * @param pkg - the package json data to check if it is a Fluid package.\n */\nexport const isFluidPackage = (pkg: any): pkg is Readonly<IFluidPackage> =>\n typeof pkg === \"object\"\n && typeof pkg?.name === \"string\"\n && typeof pkg?.fluid === \"object\";\n\n/**\n * Package manager configuration. Provides a key value mapping of config values\n */\nexport interface IFluidCodeDetailsConfig {\n readonly [key: string]: string;\n}\n\n/**\n * Data structure used to describe the code to load on the Fluid document\n */\nexport interface IFluidCodeDetails {\n /**\n * The code package to be used on the Fluid document. This is either the package name which will be loaded\n * from a package manager. Or the expanded Fluid package.\n */\n readonly package: string | Readonly<IFluidPackage>;\n\n /**\n * Configuration details. This includes links to the package manager and base CDNs.\n *\n * @remarks This is strictly consumer-defined data.\n * Its contents and semantics (including whether or not this data is present) are completely up to the consumer.\n */\n readonly config?: IFluidCodeDetailsConfig;\n}\n\nexport const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> => {\n const maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;\n return typeof maybeCodeDetails === \"object\"\n && (typeof maybeCodeDetails?.package === \"string\" || isFluidPackage(maybeCodeDetails?.package))\n && (maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === \"object\");\n};\n\nexport const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer = \"IFluidCodeDetailsComparer\";\n\nexport interface IProvideFluidCodeDetailsComparer {\n readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer ;\n}\n\n/**\n * Provides capability to compare Fluid code details.\n */\nexport interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {\n\n /**\n * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.\n *\n * Similar semantics to:\n * {@link https://github.com/npm/node-semver#usage}\n */\n satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;\n\n /* eslint-disable max-len */\n /**\n * Return a number representing the ascending sort order of the `a` and `b` code details:\n *\n * - `< 0` if `a < b`.\n *\n * - `= 0` if `a === b`.\n *\n * - `> 0` if `a > b`.\n *\n * - `undefined` if `a` is not comparable to `b`.\n *\n * Similar semantics to:\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}\n */\n compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;\n /* eslint-enable max-len */\n}\n"]}
1
+ {"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyDH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAkC,EAAE,CACvE,OAAO,GAAG,KAAK,QAAQ;OACpB,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAA,KAAK,QAAQ;OAC7B,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,CAAA,KAAK,QAAQ,CAAC;AA4BtC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAA0C,EAAE;IAC3F,MAAM,gBAAgB,GAAG,OAAiD,CAAC;IAC3E,OAAO,OAAO,gBAAgB,KAAK,QAAQ;WACpC,CAAC,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAA,KAAK,QAAQ,IAAI,cAAc,CAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAC,CAAC;WAC5F,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,SAAS,IAAI,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAA,KAAK,QAAQ,CAAC,CAAC;AACpG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAA2C,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Specifies an environment on Fluid property of a IFluidPackage.\n */\nexport interface IFluidPackageEnvironment {\n\n /**\n * The name of the target. For a browser environment, this could be umd for scripts\n * or css for styles.\n */\n [target: string]: undefined | {\n /**\n * List of files for the target. These can be relative or absolute.\n * The code loader should resolve relative paths, and validate all\n * full urls.\n */\n files: string[];\n\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition\n * of Library, the entrypoint for umd packages.\n */\n [key: string]: unknown;\n };\n}\n\n/**\n * Fluid-specific properties expected on a package to be loaded by the code loader.\n * While compatible with the npm package format it is not necessary that that package is an\n * npm package:\n * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}\n */\nexport interface IFluidPackage {\n /**\n * The name of the package that this code represnets\n */\n name: string;\n /**\n * This object represents the Fluid specific properties of the package\n */\n fluid: {\n /**\n * The name of the of the environment. This should be something like browser, or node\n * and contain the necessary targets for loading this code in that environment.\n */\n [environment: string]: undefined | IFluidPackageEnvironment;\n };\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition of\n * compatible versions, or deployment information like rings or rollouts.\n */\n [key: string]: unknown;\n}\n\n/**\n * Check if the package.json defines a Fluid package\n * @param pkg - the package json data to check if it is a Fluid package.\n */\nexport const isFluidPackage = (pkg: any): pkg is Readonly<IFluidPackage> =>\n typeof pkg === \"object\"\n && typeof pkg?.name === \"string\"\n && typeof pkg?.fluid === \"object\";\n\n/**\n * Package manager configuration. Provides a key value mapping of config values\n */\nexport interface IFluidCodeDetailsConfig {\n readonly [key: string]: string;\n}\n\n/**\n * Data structure used to describe the code to load on the Fluid document\n */\nexport interface IFluidCodeDetails {\n /**\n * The code package to be used on the Fluid document. This is either the package name which will be loaded\n * from a package manager. Or the expanded Fluid package.\n */\n readonly package: string | Readonly<IFluidPackage>;\n\n /**\n * Configuration details. This includes links to the package manager and base CDNs.\n *\n * @remarks This is strictly consumer-defined data.\n * Its contents and semantics (including whether or not this data is present) are completely up to the consumer.\n */\n readonly config?: IFluidCodeDetailsConfig;\n}\n\nexport const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> => {\n const maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;\n return typeof maybeCodeDetails === \"object\"\n && (typeof maybeCodeDetails?.package === \"string\" || isFluidPackage(maybeCodeDetails?.package))\n && (maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === \"object\");\n};\n\nexport const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer = \"IFluidCodeDetailsComparer\";\n\nexport interface IProvideFluidCodeDetailsComparer {\n readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer ;\n}\n\n/**\n * Provides capability to compare Fluid code details.\n */\nexport interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {\n\n /**\n * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.\n *\n * Similar semantics to:\n * {@link https://github.com/npm/node-semver#usage}\n */\n satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;\n\n /**\n * Return a number representing the ascending sort order of the `a` and `b` code details:\n *\n * - `< 0` if `a < b`.\n *\n * - `= 0` if `a === b`.\n *\n * - `> 0` if `a > b`.\n *\n * - `undefined` if `a` is not comparable to `b`.\n *\n * Similar semantics to:\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}\n */\n compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;\n}\n"]}
package/lib/loader.d.ts CHANGED
@@ -152,6 +152,16 @@ export interface IContainerEvents extends IEvent {
152
152
  * @see {@link IContainer.close}
153
153
  */
154
154
  (event: "closed", listener: (error?: ICriticalContainerError) => void): any;
155
+ /**
156
+ * Emitted when the {@link IContainer} is disposed, which permanently disables it.
157
+ *
158
+ * @remarks Listener parameters:
159
+ *
160
+ * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.
161
+ *
162
+ * @see {@link IContainer.dispose}
163
+ */
164
+ (event: "disposed", listener: (error?: ICriticalContainerError) => void): any;
155
165
  /**
156
166
  * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.
157
167
  *
@@ -273,6 +283,14 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
273
283
  * Whether or not there are any local changes that have not been saved.
274
284
  */
275
285
  readonly isDirty: boolean;
286
+ /**
287
+ * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.
288
+ * The container is not expected to be used anymore once it is disposed.
289
+ *
290
+ * @param error - If the container is being disposed due to error, this provides details about the error that
291
+ * resulted in disposing it.
292
+ */
293
+ dispose?(error?: ICriticalContainerError): void;
276
294
  /**
277
295
  * Closes the container.
278
296
  *
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,QAAQ,EACR,SAAS,EACT,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACH,iBAAiB,EACjB,aAAa,EACb,gCAAgC,EACnC,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IAErB;;;;;OAKG;IACH,OAAO,EAAE,iBAAiB,CAAC;CAC9B;AAED;;;GAG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SAAQ,aAAa;IAChE,aAAa,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC;KAAE,CAAC;IACpD,KAAK,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,6BAA6B,CAAC;KAAE,CAAC;CAC7D"}
package/lib/loader.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyfH;;GAEG;AACH,MAAM,CAAN,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACpB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACvB,CAAC,EAtBW,YAAY,KAAZ,YAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IRequest,\n IResponse,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IClientDetails,\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISequencedProposal,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport {\n IFluidCodeDetails,\n IFluidPackage,\n IProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n /**\n * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n */\n module: IFluidModule;\n\n /**\n * Code details associated with the module. Represents a document schema this module supports.\n * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}\n * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n * quorum.\n */\n details: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader\n extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Load the code module (package) that can interact with the document.\n *\n * @param source - Code proposal that articulates the current schema the document is written in.\n * @returns - Code module entry point along with the code details associated with it.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n /**\n * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n */\n readonly resolvedPackage: Readonly<IFluidPackage>;\n /**\n * If not undefined, this id will be used to cache the entry point for the code package\n */\n readonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n /**\n * Resolves a Fluid code details into a form that can be loaded.\n * @param details - The Fluid code details to resolve.\n * @returns - A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n * an optional resolvedPackageCacheId if the loaded package should be cached.\n */\n resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n */\nexport interface ICodeAllowList {\n testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n */\n/* eslint-disable @typescript-eslint/unified-signatures */\nexport interface IContainerEvents extends IEvent {\n /**\n * Emitted when the readonly state of the container changes.\n *\n * @remarks Listener parameters:\n *\n * - `readonly`: Whether or not the container is now in a readonly state.\n *\n * @see {@link IContainer.readOnlyInfo}\n */\n (event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n /**\n * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n *\n * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n *\n * @see\n *\n * - {@link IContainer.connectionState}\n *\n * - {@link IContainer.connect}\n */\n (event: \"connected\", listener: (clientId: string) => void);\n\n /**\n * Fires when new container code details have been proposed, prior to acceptance.\n *\n * @remarks Listener parameters:\n *\n * - `codeDetails`: The code details being proposed.\n *\n * - `proposal`: NOT RECOMMENDED FOR USE.\n *\n * @see {@link IContainer.proposeCodeDetails}\n */\n (event: \"codeDetailsProposed\", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n\n /**\n * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n *\n * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n *\n * @see\n *\n * - {@link IContainer.connectionState}\n *\n * - {@link IContainer.disconnect}\n */\n (event: \"disconnected\", listener: () => void);\n\n /**\n * Emitted when a {@link AttachState.Detached | detached} container is\n * {@link AttachState.Attached | attached} to the Fluid service.\n *\n * @see\n *\n * - {@link IContainer.attachState}\n *\n * - {@link IContainer.attach}\n */\n (event: \"attached\", listener: () => void);\n\n /**\n * Emitted when the {@link IContainer} is closed, which permanently disables it.\n *\n * @remarks Listener parameters:\n *\n * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n *\n * @see {@link IContainer.close}\n */\n (event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n /**\n * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n * For now, use of this should be avoided when possible.\n *\n * Listener parameters:\n *\n * - `error`: The warning describing the encountered state.\n */\n (event: \"warning\", listener: (error: ContainerWarning) => void);\n\n /**\n * Emitted immediately after processing an incoming operation (op).\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n * ops directly on the {@link IContainer}.\n *\n * Listener parameters:\n *\n * - `message`: The op that was processed.\n */\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n /**\n * Emitted upon the first local change while the Container is in the \"saved\" state.\n * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n *\n * @remarks Listener parameters:\n *\n * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n *\n * @see {@link IContainer.isDirty}\n */\n (event: \"dirty\", listener: (dirty: boolean) => void);\n\n /**\n * Emitted when all local changes/edits have been acknowledged by the service.\n * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n *\n * @remarks Listener parameters:\n *\n * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n *\n * @see {@link IContainer.isDirty}\n */\n (event: \"saved\", listener: (dirty: boolean) => void);\n}\n/* eslint-enable @typescript-eslint/unified-signatures */\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n /**\n * The container is not connected to the delta server.\n * Note - When in this state the container may be about to reconnect,\n * or may remain disconnected until explicitly told to connect.\n */\n export type Disconnected = 0;\n\n /**\n * The container is disconnected but actively trying to establish a new connection.\n * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n */\n export type EstablishingConnection = 3;\n\n /**\n * The container has an inbound connection only, and is catching up to the latest known state from the service.\n */\n export type CatchingUp = 1;\n\n /**\n * The container is fully connected and syncing.\n */\n export type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n */\nexport type ConnectionState =\n | ConnectionState.Disconnected\n | ConnectionState.EstablishingConnection\n | ConnectionState.CatchingUp\n | ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\n /**\n * The Delta Manager supporting the op stream for this Container\n */\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n /**\n * The collection of write clients which were connected as of the current sequence number.\n * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Represents the resolved url to the Container.\n * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n */\n resolvedUrl: IResolvedUrl | undefined;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Get the code details that are currently specified for the container.\n * @returns The current code details if any are specified, undefined if none are specified.\n */\n getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Get the code details that were used to load the container.\n * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n * loaded.\n */\n getLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Returns true if the container has been closed, otherwise false.\n */\n readonly closed: boolean;\n\n /**\n * Whether or not there are any local changes that have not been saved.\n */\n readonly isDirty: boolean;\n\n /**\n * Closes the container.\n *\n * @param error - If the container is being closed due to error, this provides details about the error that\n * resulted in closing it.\n */\n close(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container and returns serialized local state intended to be\n * given to a newly loaded container.\n */\n closeAndGetPendingLocalState(): string;\n\n /**\n * Propose new code details that define the code to be loaded for this container's runtime.\n *\n * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n */\n proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n /**\n * Attaches the Container to the Container specified by the given Request.\n *\n * @privateRemarks\n *\n * TODO - in the case of failure options should give a retry policy.\n * Or some continuation function that allows attachment to a secondary document.\n */\n attach(request: IRequest): Promise<void>;\n\n /**\n * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container\n * is an error.\n */\n serialize(): string;\n\n /**\n * Get an absolute URL for a provided container-relative request URL.\n * If the container is not attached, this will return undefined.\n *\n * @param relativeUrl - A container-relative request URL.\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Issue a request against the container for a resource.\n * @param request - The request to be issued against the container\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Provides the current state of the container's connection to the ordering service.\n *\n * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n */\n readonly connectionState: ConnectionState;\n\n /**\n * Attempts to connect the container to the delta stream and process ops.\n *\n * @remarks\n *\n * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the\n * \"connected\" event will be fired if/when connection succeeds.\n */\n connect(): void;\n\n /**\n * Disconnects the container from the delta stream and stops processing ops.\n *\n * @remarks\n *\n * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the\n * \"disconnected\" event will be fired when disconnection completes.\n */\n disconnect(): void;\n\n /**\n * The audience information for all clients currently associated with the document in the current session.\n */\n readonly audience: IAudience;\n\n /**\n * The server provided ID of the client.\n *\n * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},\n * otherwise will be `undefined`.\n */\n readonly clientId?: string | undefined;\n\n /**\n * Tells if container is in read-only mode.\n *\n * @remarks\n *\n * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n * Readonly state can be because of no storage write permission,\n * or due to host forcing readonly mode for container.\n *\n * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n *\n * It is undefined if we have not yet established websocket connection\n * and do not know if user has write access to a file.\n */\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /**\n * Allows the host to have the container force to be in read-only mode\n * @param readonly - Boolean that toggles if read-only policies will be enforced\n * @alpha\n */\n forceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n /**\n * Resolves the resource specified by the URL + headers contained in the request object\n * to the underlying container that will resolve the request.\n *\n * @remarks\n *\n * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n * a request against the server found from the resolve step.\n */\n resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n /**\n * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n /**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n [key in string | number]: any;\n} & {\n /**\n * Set caching behavior for the loader. If true, we will load a container from cache if one\n * with the same id/version exists or create a new container and cache it if it does not. If\n * false, always load a new container and don't cache it. If the container has already been\n * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n * request will override the Loader's value.\n * Defaults to true.\n */\n cache?: boolean;\n\n /**\n * Provide the current Loader through the scope object when creating Containers. It is added\n * as the `ILoader` property, and will overwrite an existing property of the same name on the\n * scope. Useful for when the host wants to provide the current Loader's functionality to\n * individual Data Stores, which is typically expected when creating with a Loader.\n * Defaults to true.\n */\n provideScopeLoader?: boolean;\n\n /**\n * Max time (in ms) container will wait for a leave message of a disconnected client.\n */\n maxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n /**\n * Override the Loader's default caching behavior for this container.\n */\n cache = \"fluid-cache\",\n\n clientDetails = \"fluid-client-details\",\n\n /**\n * Start the container in a paused, unconnected state. Defaults to false\n */\n loadMode = \"loadMode\",\n reconnect = \"fluid-reconnect\",\n sequenceNumber = \"fluid-sequence-number\",\n\n /**\n * One of the following:\n * null or \"null\": use ops, no snapshots\n * undefined: fetch latest snapshot\n * otherwise, version sha to load snapshot\n */\n version = \"version\",\n}\n\nexport interface IContainerLoadMode {\n opsBeforeReturn?:\n /*\n * No trailing ops are applied before container is returned.\n * Default value.\n */\n | undefined\n /*\n * Only cached trailing ops are applied before returning container.\n * Caching is optional and could be implemented by the driver.\n * If driver does not implement any kind of local caching strategy, this is same as above.\n * Driver may cache a lot of ops, so care needs to be exercised (see below).\n */\n | \"cached\"\n /*\n * All trailing ops in storage are fetched and applied before container is returned\n * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n * recommended to have some progress UX / cancellation built into loading flow when using this option.\n */\n | \"all\";\n\n deltaConnection?:\n /*\n * Connection to delta stream is made only when Container.connect() call is made. Op processing\n * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n */\n | \"none\"\n /*\n * Connection to delta stream is made only when Container.connect() call is made.\n * Op fetching from storage is performed and ops are applied as they come in.\n * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n */\n | \"delayed\"\n /*\n * Connection to delta stream is made right away.\n * Ops processing is enabled and ops are flowing through the system.\n * Default value.\n */\n | undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n [LoaderHeader.cache]: boolean;\n [LoaderHeader.clientDetails]: IClientDetails;\n [LoaderHeader.loadMode]: IContainerLoadMode;\n [LoaderHeader.sequenceNumber]: number;\n [LoaderHeader.reconnect]: boolean;\n [LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n readonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.\n */\nexport interface IPendingLocalState {\n url: string;\n pendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.\n *\n * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n blobsContents: { [path: string]: ArrayBufferLike; };\n trees: { [path: string]: ISnapshotTreeWithBlobContents; };\n}\n"]}
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6gBH;;GAEG;AACH,MAAM,CAAN,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACpB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACvB,CAAC,EAtBW,YAAY,KAAZ,YAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IRequest,\n IResponse,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IClientDetails,\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISequencedProposal,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport {\n IFluidCodeDetails,\n IFluidPackage,\n IProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n /**\n * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n */\n module: IFluidModule;\n\n /**\n * Code details associated with the module. Represents a document schema this module supports.\n * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}\n * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n * quorum.\n */\n details: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader\n extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Load the code module (package) that can interact with the document.\n *\n * @param source - Code proposal that articulates the current schema the document is written in.\n * @returns - Code module entry point along with the code details associated with it.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n /**\n * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n */\n readonly resolvedPackage: Readonly<IFluidPackage>;\n /**\n * If not undefined, this id will be used to cache the entry point for the code package\n */\n readonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n /**\n * Resolves a Fluid code details into a form that can be loaded.\n * @param details - The Fluid code details to resolve.\n * @returns - A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n * an optional resolvedPackageCacheId if the loaded package should be cached.\n */\n resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n */\nexport interface ICodeAllowList {\n testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n */\n/* eslint-disable @typescript-eslint/unified-signatures */\nexport interface IContainerEvents extends IEvent {\n /**\n * Emitted when the readonly state of the container changes.\n *\n * @remarks Listener parameters:\n *\n * - `readonly`: Whether or not the container is now in a readonly state.\n *\n * @see {@link IContainer.readOnlyInfo}\n */\n (event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n /**\n * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n *\n * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n *\n * @see\n *\n * - {@link IContainer.connectionState}\n *\n * - {@link IContainer.connect}\n */\n (event: \"connected\", listener: (clientId: string) => void);\n\n /**\n * Fires when new container code details have been proposed, prior to acceptance.\n *\n * @remarks Listener parameters:\n *\n * - `codeDetails`: The code details being proposed.\n *\n * - `proposal`: NOT RECOMMENDED FOR USE.\n *\n * @see {@link IContainer.proposeCodeDetails}\n */\n (event: \"codeDetailsProposed\", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n\n /**\n * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n *\n * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n *\n * @see\n *\n * - {@link IContainer.connectionState}\n *\n * - {@link IContainer.disconnect}\n */\n (event: \"disconnected\", listener: () => void);\n\n /**\n * Emitted when a {@link AttachState.Detached | detached} container is\n * {@link AttachState.Attached | attached} to the Fluid service.\n *\n * @see\n *\n * - {@link IContainer.attachState}\n *\n * - {@link IContainer.attach}\n */\n (event: \"attached\", listener: () => void);\n\n /**\n * Emitted when the {@link IContainer} is closed, which permanently disables it.\n *\n * @remarks Listener parameters:\n *\n * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n *\n * @see {@link IContainer.close}\n */\n (event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n /**\n * Emitted when the {@link IContainer} is disposed, which permanently disables it.\n *\n * @remarks Listener parameters:\n *\n * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.\n *\n * @see {@link IContainer.dispose}\n */\n (event: \"disposed\", listener: (error?: ICriticalContainerError) => void);\n\n /**\n * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n * For now, use of this should be avoided when possible.\n *\n * Listener parameters:\n *\n * - `error`: The warning describing the encountered state.\n */\n (event: \"warning\", listener: (error: ContainerWarning) => void);\n\n /**\n * Emitted immediately after processing an incoming operation (op).\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n * ops directly on the {@link IContainer}.\n *\n * Listener parameters:\n *\n * - `message`: The op that was processed.\n */\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n /**\n * Emitted upon the first local change while the Container is in the \"saved\" state.\n * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n *\n * @remarks Listener parameters:\n *\n * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n *\n * @see {@link IContainer.isDirty}\n */\n (event: \"dirty\", listener: (dirty: boolean) => void);\n\n /**\n * Emitted when all local changes/edits have been acknowledged by the service.\n * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n *\n * @remarks Listener parameters:\n *\n * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n *\n * @see {@link IContainer.isDirty}\n */\n (event: \"saved\", listener: (dirty: boolean) => void);\n}\n/* eslint-enable @typescript-eslint/unified-signatures */\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n /**\n * The container is not connected to the delta server.\n * Note - When in this state the container may be about to reconnect,\n * or may remain disconnected until explicitly told to connect.\n */\n export type Disconnected = 0;\n\n /**\n * The container is disconnected but actively trying to establish a new connection.\n * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n */\n export type EstablishingConnection = 3;\n\n /**\n * The container has an inbound connection only, and is catching up to the latest known state from the service.\n */\n export type CatchingUp = 1;\n\n /**\n * The container is fully connected and syncing.\n */\n export type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n */\nexport type ConnectionState =\n | ConnectionState.Disconnected\n | ConnectionState.EstablishingConnection\n | ConnectionState.CatchingUp\n | ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\n /**\n * The Delta Manager supporting the op stream for this Container\n */\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n /**\n * The collection of write clients which were connected as of the current sequence number.\n * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Represents the resolved url to the Container.\n * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n */\n resolvedUrl: IResolvedUrl | undefined;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Get the code details that are currently specified for the container.\n * @returns The current code details if any are specified, undefined if none are specified.\n */\n getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Get the code details that were used to load the container.\n * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n * loaded.\n */\n getLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Returns true if the container has been closed, otherwise false.\n */\n readonly closed: boolean;\n\n /**\n * Whether or not there are any local changes that have not been saved.\n */\n readonly isDirty: boolean;\n\n /**\n * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.\n * The container is not expected to be used anymore once it is disposed.\n *\n * @param error - If the container is being disposed due to error, this provides details about the error that\n * resulted in disposing it.\n */\n dispose?(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container.\n *\n * @param error - If the container is being closed due to error, this provides details about the error that\n * resulted in closing it.\n */\n close(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container and returns serialized local state intended to be\n * given to a newly loaded container.\n */\n closeAndGetPendingLocalState(): string;\n\n /**\n * Propose new code details that define the code to be loaded for this container's runtime.\n *\n * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n */\n proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n /**\n * Attaches the Container to the Container specified by the given Request.\n *\n * @privateRemarks\n *\n * TODO - in the case of failure options should give a retry policy.\n * Or some continuation function that allows attachment to a secondary document.\n */\n attach(request: IRequest): Promise<void>;\n\n /**\n * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container\n * is an error.\n */\n serialize(): string;\n\n /**\n * Get an absolute URL for a provided container-relative request URL.\n * If the container is not attached, this will return undefined.\n *\n * @param relativeUrl - A container-relative request URL.\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Issue a request against the container for a resource.\n * @param request - The request to be issued against the container\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Provides the current state of the container's connection to the ordering service.\n *\n * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n */\n readonly connectionState: ConnectionState;\n\n /**\n * Attempts to connect the container to the delta stream and process ops.\n *\n * @remarks\n *\n * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the\n * \"connected\" event will be fired if/when connection succeeds.\n */\n connect(): void;\n\n /**\n * Disconnects the container from the delta stream and stops processing ops.\n *\n * @remarks\n *\n * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the\n * \"disconnected\" event will be fired when disconnection completes.\n */\n disconnect(): void;\n\n /**\n * The audience information for all clients currently associated with the document in the current session.\n */\n readonly audience: IAudience;\n\n /**\n * The server provided ID of the client.\n *\n * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},\n * otherwise will be `undefined`.\n */\n readonly clientId?: string | undefined;\n\n /**\n * Tells if container is in read-only mode.\n *\n * @remarks\n *\n * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n * Readonly state can be because of no storage write permission,\n * or due to host forcing readonly mode for container.\n *\n * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n *\n * It is undefined if we have not yet established websocket connection\n * and do not know if user has write access to a file.\n */\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /**\n * Allows the host to have the container force to be in read-only mode\n * @param readonly - Boolean that toggles if read-only policies will be enforced\n * @alpha\n */\n forceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n /**\n * Resolves the resource specified by the URL + headers contained in the request object\n * to the underlying container that will resolve the request.\n *\n * @remarks\n *\n * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n * a request against the server found from the resolve step.\n */\n resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n /**\n * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n /**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n [key in string | number]: any;\n} & {\n /**\n * Set caching behavior for the loader. If true, we will load a container from cache if one\n * with the same id/version exists or create a new container and cache it if it does not. If\n * false, always load a new container and don't cache it. If the container has already been\n * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n * request will override the Loader's value.\n * Defaults to true.\n */\n cache?: boolean;\n\n /**\n * Provide the current Loader through the scope object when creating Containers. It is added\n * as the `ILoader` property, and will overwrite an existing property of the same name on the\n * scope. Useful for when the host wants to provide the current Loader's functionality to\n * individual Data Stores, which is typically expected when creating with a Loader.\n * Defaults to true.\n */\n provideScopeLoader?: boolean;\n\n /**\n * Max time (in ms) container will wait for a leave message of a disconnected client.\n */\n maxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n /**\n * Override the Loader's default caching behavior for this container.\n */\n cache = \"fluid-cache\",\n\n clientDetails = \"fluid-client-details\",\n\n /**\n * Start the container in a paused, unconnected state. Defaults to false\n */\n loadMode = \"loadMode\",\n reconnect = \"fluid-reconnect\",\n sequenceNumber = \"fluid-sequence-number\",\n\n /**\n * One of the following:\n * null or \"null\": use ops, no snapshots\n * undefined: fetch latest snapshot\n * otherwise, version sha to load snapshot\n */\n version = \"version\",\n}\n\nexport interface IContainerLoadMode {\n opsBeforeReturn?:\n /*\n * No trailing ops are applied before container is returned.\n * Default value.\n */\n | undefined\n /*\n * Only cached trailing ops are applied before returning container.\n * Caching is optional and could be implemented by the driver.\n * If driver does not implement any kind of local caching strategy, this is same as above.\n * Driver may cache a lot of ops, so care needs to be exercised (see below).\n */\n | \"cached\"\n /*\n * All trailing ops in storage are fetched and applied before container is returned\n * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n * recommended to have some progress UX / cancellation built into loading flow when using this option.\n */\n | \"all\";\n\n deltaConnection?:\n /*\n * Connection to delta stream is made only when Container.connect() call is made. Op processing\n * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n */\n | \"none\"\n /*\n * Connection to delta stream is made only when Container.connect() call is made.\n * Op fetching from storage is performed and ops are applied as they come in.\n * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n */\n | \"delayed\"\n /*\n * Connection to delta stream is made right away.\n * Ops processing is enabled and ops are flowing through the system.\n * Default value.\n */\n | undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n [LoaderHeader.cache]: boolean;\n [LoaderHeader.clientDetails]: IClientDetails;\n [LoaderHeader.loadMode]: IContainerLoadMode;\n [LoaderHeader.sequenceNumber]: number;\n [LoaderHeader.reconnect]: boolean;\n [LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n readonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.\n */\nexport interface IPendingLocalState {\n url: string;\n pendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.\n *\n * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n blobsContents: { [path: string]: ArrayBufferLike; };\n trees: { [path: string]: ISnapshotTreeWithBlobContents; };\n}\n"]}
package/lib/runtime.d.ts CHANGED
@@ -106,6 +106,7 @@ export interface IContainerContext extends IDisposable {
106
106
  readonly submitBatchFn: (batch: IBatchMessage[]) => number;
107
107
  readonly submitSummaryFn: (summaryOp: ISummaryContent) => number;
108
108
  readonly submitSignalFn: (contents: any) => void;
109
+ readonly disposeFn?: (error?: ICriticalContainerError) => void;
109
110
  readonly closeFn: (error?: ICriticalContainerError) => void;
110
111
  readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
111
112
  readonly quorum: IQuorumClients;
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAo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AQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC7C;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC3D;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACzF"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH;;;GAGG;AACH,MAAM,CAAN,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACnB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACzB,CAAC,EAjBW,WAAW,KAAX,WAAW,QAiBtB;AAsID,MAAM,CAAC,MAAM,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n FluidObject,\n IRequest,\n IResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n IClientConfiguration,\n IClientDetails,\n ISequencedDocumentMessage,\n ISnapshotTree,\n MessageType,\n ISummaryTree,\n IVersion,\n IDocumentMessage,\n IQuorumClients,\n ISummaryContent,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager } from \"./deltas\";\nimport { ICriticalContainerError } from \"./error\";\nimport { ILoader, ILoaderOptions, ISnapshotTreeWithBlobContents } from \"./loader\";\nimport { IFluidCodeDetails } from \"./fluidPackage\";\n\n/**\n * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the\n * service. The transition from detached to attached state is a one-way transition.\n */\nexport enum AttachState {\n /**\n * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n * to the service.\n */\n Detached = \"Detached\",\n\n /**\n * In attaching state, the data has started the upload to the service, but has not yet completed.\n */\n Attaching = \"Attaching\",\n\n /**\n * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n * reaching attached state.\n */\n Attached = \"Attached\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n */\nexport interface IRuntime extends IDisposable {\n\n /**\n * Executes a request against the runtime\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Notifies the runtime of a change in the connection state\n */\n setConnectionState(connected: boolean, clientId?: string);\n\n /**\n * Processes the given op (message)\n */\n process(message: ISequencedDocumentMessage, local: boolean);\n\n /**\n * Processes the given signal\n */\n processSignal(message: any, local: boolean);\n\n /**\n * Create a summary. Used when attaching or serializing a detached container.\n *\n * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n * new storage IDs so requests can be redirected.\n */\n createSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n /**\n * Propagate the container state when container is attaching or attached.\n * @param attachState - State of the container.\n */\n setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n /**\n * Get pending local state in a serializable format to be given back to a newly loaded container\n */\n getPendingLocalState(): unknown;\n\n /**\n * Notify runtime that container is moving to \"Attaching\" state\n * @param snapshot - snapshot created at attach time\n */\n notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n */\nexport interface IBatchMessage {\n contents?: string;\n metadata: Record<string, unknown> | undefined;\n compression?: string;\n}\n\n/**\n * The ContainerContext is a proxy standing between the Container and the Container's IRuntime.\n * This allows the Container to terminate the connection to the IRuntime.\n *\n * Specifically, there is an event on Container, onContextChanged, which mean a new code proposal has been loaded,\n * so the old IRuntime is no longer valid, as its ContainerContext has been revoked,\n * and the Container has created a new ContainerContext.\n */\nexport interface IContainerContext extends IDisposable {\n /** @deprecated Please pass in existing directly in instantiateRuntime */\n readonly existing: boolean | undefined;\n readonly options: ILoaderOptions;\n readonly clientId: string | undefined;\n readonly clientDetails: IClientDetails;\n readonly storage: IDocumentStorageService;\n readonly connected: boolean;\n readonly baseSnapshot: ISnapshotTree | undefined;\n /** @deprecated Please use submitBatchFn & submitSummaryFn */\n readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n /** @returns clientSequenceNumber of last message in a batch */\n readonly submitBatchFn: (batch: IBatchMessage[]) => number;\n readonly submitSummaryFn: (summaryOp: ISummaryContent) => number;\n readonly submitSignalFn: (contents: any) => void;\n readonly closeFn: (error?: ICriticalContainerError) => void;\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n readonly quorum: IQuorumClients;\n /**\n * @deprecated This method is provided as a migration tool for customers currently reading the code details\n * from within the Container by directly accessing the Quorum proposals. The code details should not be accessed\n * from within the Container as this requires coupling between the container contents and the code loader.\n * Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this\n * migration tool will be removed.\n */\n getSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;\n readonly audience: IAudience | undefined;\n readonly loader: ILoader;\n // The logger implementation, which would support tagged events, should be provided by the loader.\n readonly taggedLogger: ITelemetryBaseLogger;\n readonly serviceConfiguration: IClientConfiguration | undefined;\n pendingLocalState?: unknown;\n\n /**\n * Ambient services provided with the context\n */\n readonly scope: FluidObject;\n\n /**\n * Get an absolute url for a provided container-relative request.\n * @param relativeUrl - A relative request within the container\n *\n * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n */\n getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n getLoadedFromVersion(): IVersion | undefined;\n\n updateDirtyContainerState(dirty: boolean): void;\n /**\n * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n * and scenarios which can change in the future.\n */\n readonly id: string;\n}\n\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\nexport interface IProvideRuntimeFactory {\n readonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n /**\n * Instantiates a new IRuntime for the given IContainerContext to proxy to\n * This is the main entry point to the Container's business logic\n *\n * @param context - container context to be supplied to the runtime\n * @param existing - whether to instantiate for the first time or from an existing context\n */\n instantiateRuntime(context: IContainerContext, existing?: boolean): Promise<IRuntime>;\n}\n"]}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH;;;GAGG;AACH,MAAM,CAAN,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACnB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACzB,CAAC,EAjBW,WAAW,KAAX,WAAW,QAiBtB;AAuID,MAAM,CAAC,MAAM,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n FluidObject,\n IRequest,\n IResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n IClientConfiguration,\n IClientDetails,\n ISequencedDocumentMessage,\n ISnapshotTree,\n MessageType,\n ISummaryTree,\n IVersion,\n IDocumentMessage,\n IQuorumClients,\n ISummaryContent,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager } from \"./deltas\";\nimport { ICriticalContainerError } from \"./error\";\nimport { ILoader, ILoaderOptions, ISnapshotTreeWithBlobContents } from \"./loader\";\nimport { IFluidCodeDetails } from \"./fluidPackage\";\n\n/**\n * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the\n * service. The transition from detached to attached state is a one-way transition.\n */\nexport enum AttachState {\n /**\n * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n * to the service.\n */\n Detached = \"Detached\",\n\n /**\n * In attaching state, the data has started the upload to the service, but has not yet completed.\n */\n Attaching = \"Attaching\",\n\n /**\n * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n * reaching attached state.\n */\n Attached = \"Attached\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n */\nexport interface IRuntime extends IDisposable {\n\n /**\n * Executes a request against the runtime\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Notifies the runtime of a change in the connection state\n */\n setConnectionState(connected: boolean, clientId?: string);\n\n /**\n * Processes the given op (message)\n */\n process(message: ISequencedDocumentMessage, local: boolean);\n\n /**\n * Processes the given signal\n */\n processSignal(message: any, local: boolean);\n\n /**\n * Create a summary. Used when attaching or serializing a detached container.\n *\n * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n * new storage IDs so requests can be redirected.\n */\n createSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n /**\n * Propagate the container state when container is attaching or attached.\n * @param attachState - State of the container.\n */\n setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n /**\n * Get pending local state in a serializable format to be given back to a newly loaded container\n */\n getPendingLocalState(): unknown;\n\n /**\n * Notify runtime that container is moving to \"Attaching\" state\n * @param snapshot - snapshot created at attach time\n */\n notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n */\nexport interface IBatchMessage {\n contents?: string;\n metadata: Record<string, unknown> | undefined;\n compression?: string;\n}\n\n/**\n * The ContainerContext is a proxy standing between the Container and the Container's IRuntime.\n * This allows the Container to terminate the connection to the IRuntime.\n *\n * Specifically, there is an event on Container, onContextChanged, which mean a new code proposal has been loaded,\n * so the old IRuntime is no longer valid, as its ContainerContext has been revoked,\n * and the Container has created a new ContainerContext.\n */\nexport interface IContainerContext extends IDisposable {\n /** @deprecated Please pass in existing directly in instantiateRuntime */\n readonly existing: boolean | undefined;\n readonly options: ILoaderOptions;\n readonly clientId: string | undefined;\n readonly clientDetails: IClientDetails;\n readonly storage: IDocumentStorageService;\n readonly connected: boolean;\n readonly baseSnapshot: ISnapshotTree | undefined;\n /** @deprecated Please use submitBatchFn & submitSummaryFn */\n readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n /** @returns clientSequenceNumber of last message in a batch */\n readonly submitBatchFn: (batch: IBatchMessage[]) => number;\n readonly submitSummaryFn: (summaryOp: ISummaryContent) => number;\n readonly submitSignalFn: (contents: any) => void;\n readonly disposeFn?: (error?: ICriticalContainerError) => void;\n readonly closeFn: (error?: ICriticalContainerError) => void;\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n readonly quorum: IQuorumClients;\n /**\n * @deprecated This method is provided as a migration tool for customers currently reading the code details\n * from within the Container by directly accessing the Quorum proposals. The code details should not be accessed\n * from within the Container as this requires coupling between the container contents and the code loader.\n * Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this\n * migration tool will be removed.\n */\n getSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;\n readonly audience: IAudience | undefined;\n readonly loader: ILoader;\n // The logger implementation, which would support tagged events, should be provided by the loader.\n readonly taggedLogger: ITelemetryBaseLogger;\n readonly serviceConfiguration: IClientConfiguration | undefined;\n pendingLocalState?: unknown;\n\n /**\n * Ambient services provided with the context\n */\n readonly scope: FluidObject;\n\n /**\n * Get an absolute url for a provided container-relative request.\n * @param relativeUrl - A relative request within the container\n *\n * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n */\n getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n getLoadedFromVersion(): IVersion | undefined;\n\n updateDirtyContainerState(dirty: boolean): void;\n /**\n * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n * and scenarios which can change in the future.\n */\n readonly id: string;\n}\n\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\nexport interface IProvideRuntimeFactory {\n readonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n /**\n * Instantiates a new IRuntime for the given IContainerContext to proxy to\n * This is the main entry point to the Container's business logic\n *\n * @param context - container context to be supplied to the runtime\n * @param existing - whether to instantiate for the first time or from an existing context\n */\n instantiateRuntime(context: IContainerContext, existing?: boolean): Promise<IRuntime>;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-definitions",
3
- "version": "2.0.0-internal.2.2.0",
3
+ "version": "2.0.0-internal.2.3.0",
4
4
  "description": "Fluid container definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -41,19 +41,20 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@fluidframework/common-definitions": "^0.20.1",
44
- "@fluidframework/core-interfaces": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
45
- "@fluidframework/driver-definitions": ">=2.0.0-internal.2.2.0 <2.0.0-internal.3.0.0",
46
- "@fluidframework/protocol-definitions": "^1.1.0"
44
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
45
+ "@fluidframework/driver-definitions": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
46
+ "@fluidframework/protocol-definitions": "^1.1.0",
47
+ "events": "^3.1.0"
47
48
  },
48
49
  "devDependencies": {
49
50
  "@fluid-tools/build-cli": "^0.7.0",
50
51
  "@fluidframework/build-common": "^1.1.0",
51
52
  "@fluidframework/build-tools": "^0.7.0",
52
- "@fluidframework/container-definitions-previous": "npm:@fluidframework/container-definitions@2.0.0-internal.2.1.0",
53
- "@fluidframework/eslint-config-fluid": "^1.2.0",
53
+ "@fluidframework/container-definitions-previous": "npm:@fluidframework/container-definitions@2.0.0-internal.2.2.0",
54
+ "@fluidframework/eslint-config-fluid": "^2.0.0",
54
55
  "@microsoft/api-extractor": "^7.22.2",
55
56
  "@rushstack/eslint-config": "^2.5.1",
56
- "@types/node": "^14.18.0",
57
+ "@types/events": "^3.0.0",
57
58
  "concurrently": "^6.2.0",
58
59
  "copyfiles": "^2.4.1",
59
60
  "eslint": "~8.6.0",
@@ -62,13 +63,9 @@
62
63
  "typescript": "~4.5.5"
63
64
  },
64
65
  "typeValidation": {
65
- "version": "2.0.0-internal.2.2.0",
66
- "baselineRange": ">=2.0.0-internal.2.1.0 <2.0.0-internal.2.2.0",
67
- "baselineVersion": "2.0.0-internal.2.1.0",
68
- "broken": {
69
- "InterfaceDeclaration_IBatchMessage": {
70
- "backCompat": false
71
- }
72
- }
66
+ "version": "2.0.0-internal.2.3.0",
67
+ "baselineRange": ">=2.0.0-internal.2.2.0 <2.0.0-internal.2.3.0",
68
+ "baselineVersion": "2.0.0-internal.2.2.0",
69
+ "broken": {}
73
70
  }
74
71
  }
@@ -119,7 +119,6 @@ export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsCompa
119
119
  */
120
120
  satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;
121
121
 
122
- /* eslint-disable max-len */
123
122
  /**
124
123
  * Return a number representing the ascending sort order of the `a` and `b` code details:
125
124
  *
@@ -135,5 +134,4 @@ export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsCompa
135
134
  * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}
136
135
  */
137
136
  compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;
138
- /* eslint-enable max-len */
139
137
  }
package/src/loader.ts CHANGED
@@ -184,6 +184,17 @@ export interface IContainerEvents extends IEvent {
184
184
  */
185
185
  (event: "closed", listener: (error?: ICriticalContainerError) => void);
186
186
 
187
+ /**
188
+ * Emitted when the {@link IContainer} is disposed, which permanently disables it.
189
+ *
190
+ * @remarks Listener parameters:
191
+ *
192
+ * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.
193
+ *
194
+ * @see {@link IContainer.dispose}
195
+ */
196
+ (event: "disposed", listener: (error?: ICriticalContainerError) => void);
197
+
187
198
  /**
188
199
  * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.
189
200
  *
@@ -329,6 +340,15 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
329
340
  */
330
341
  readonly isDirty: boolean;
331
342
 
343
+ /**
344
+ * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.
345
+ * The container is not expected to be used anymore once it is disposed.
346
+ *
347
+ * @param error - If the container is being disposed due to error, this provides details about the error that
348
+ * resulted in disposing it.
349
+ */
350
+ dispose?(error?: ICriticalContainerError): void;
351
+
332
352
  /**
333
353
  * Closes the container.
334
354
  *
package/src/runtime.ts CHANGED
@@ -136,6 +136,7 @@ export interface IContainerContext extends IDisposable {
136
136
  readonly submitBatchFn: (batch: IBatchMessage[]) => number;
137
137
  readonly submitSummaryFn: (summaryOp: ISummaryContent) => number;
138
138
  readonly submitSignalFn: (contents: any) => void;
139
+ readonly disposeFn?: (error?: ICriticalContainerError) => void;
139
140
  readonly closeFn: (error?: ICriticalContainerError) => void;
140
141
  readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
141
142
  readonly quorum: IQuorumClients;
package/tsconfig.json CHANGED
@@ -7,9 +7,6 @@
7
7
  "rootDir": "./src",
8
8
  "outDir": "./dist",
9
9
  "composite": true,
10
- "types": [
11
- "node"
12
- ]
13
10
  },
14
11
  "include": [
15
12
  "src/**/*"