@fluidframework/container-definitions 2.51.0 → 2.52.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @fluidframework/container-definitions
2
2
 
3
+ ## 2.52.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Introduced new interface "IContainerStorageService" to replace "IDocumentStorageService" between Loader and Runtime layers ([#25057](https://github.com/microsoft/FluidFramework/pull/25057)) [92012de557](https://github.com/microsoft/FluidFramework/commit/92012de5571d4d87cc14bae2f391431764558735)
8
+
9
+ Added an interface `IContainerStorageService` which will replace `IDocumentStorageService` in the `Runtime` layer. This is exposed by the `Loader` layer to the `Runtime` layer via `ContainerContext`. This will help remove `Runtime` layer's dependency on the `Driver` layer and replace it with the `Loader` layer that it already maintains. This new interface will only contain properties that are needed and used by the `Runtime` layer.
10
+
11
+ The following properties from `IContainerStorageService` are deprecated as they are not needed by the `DataStore` layer. These be removed in a future release:
12
+
13
+ - `policies` - The Runtime only needs `maximumCacheDurationMs` property from it which is added directly on `IContainerStorageService`.
14
+ - `downloadSummary`
15
+ - `disposed`
16
+ - `dispose`
17
+
3
18
  ## 2.51.0
4
19
 
5
20
  Dependency updates only.
@@ -13,10 +13,14 @@ export enum AttachState {
13
13
 
14
14
  // @public
15
15
  export namespace ConnectionState {
16
- export type CatchingUp = 1;
17
- export type Connected = 2;
18
- export type Disconnected = 0;
19
- export type EstablishingConnection = 3;
16
+ const Disconnected = 0;
17
+ export type CatchingUp = typeof CatchingUp;
18
+ const EstablishingConnection = 3;
19
+ export type Connected = typeof Connected;
20
+ const CatchingUp = 1;
21
+ export type Disconnected = typeof Disconnected;
22
+ const Connected = 2;
23
+ export type EstablishingConnection = typeof EstablishingConnection;
20
24
  }
21
25
 
22
26
  // @public
@@ -13,10 +13,14 @@ export enum AttachState {
13
13
 
14
14
  // @public
15
15
  export namespace ConnectionState {
16
- export type CatchingUp = 1;
17
- export type Connected = 2;
18
- export type Disconnected = 0;
19
- export type EstablishingConnection = 3;
16
+ const Disconnected = 0;
17
+ export type CatchingUp = typeof CatchingUp;
18
+ const EstablishingConnection = 3;
19
+ export type Connected = typeof Connected;
20
+ const CatchingUp = 1;
21
+ export type Disconnected = typeof Disconnected;
22
+ const Connected = 2;
23
+ export type EstablishingConnection = typeof EstablishingConnection;
20
24
  }
21
25
 
22
26
  // @public
@@ -140,6 +144,7 @@ export interface IContainerContext {
140
144
  // (undocumented)
141
145
  readonly disposeFn?: (error?: ICriticalContainerError) => void;
142
146
  getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;
147
+ readonly getConnectionState?: () => ConnectionState;
143
148
  // (undocumented)
144
149
  getLoadedFromVersion(): IVersion | undefined;
145
150
  // @deprecated
@@ -154,7 +159,7 @@ export interface IContainerContext {
154
159
  readonly scope: FluidObject;
155
160
  readonly snapshotWithContents?: ISnapshot;
156
161
  // (undocumented)
157
- readonly storage: IDocumentStorageService;
162
+ readonly storage: IContainerStorageService;
158
163
  // (undocumented)
159
164
  readonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;
160
165
  // @deprecated (undocumented)
@@ -201,6 +206,25 @@ export type IContainerPolicies = {
201
206
  maxClientLeaveWaitTime?: number;
202
207
  };
203
208
 
209
+ // @alpha @legacy
210
+ export interface IContainerStorageService {
211
+ createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
212
+ // @deprecated
213
+ dispose?(error?: Error): void;
214
+ // @deprecated
215
+ readonly disposed?: boolean;
216
+ // @deprecated
217
+ downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
218
+ getSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
219
+ getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
220
+ getVersions(versionId: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<IVersion[]>;
221
+ readonly maximumCacheDurationMs?: IDocumentStorageServicePolicies["maximumCacheDurationMs"];
222
+ // @deprecated
223
+ readonly policies?: IDocumentStorageServicePolicies | undefined;
224
+ readBlob(id: string): Promise<ArrayBufferLike>;
225
+ uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
226
+ }
227
+
204
228
  // @public
205
229
  export type ICriticalContainerError = IErrorBase_2;
206
230
 
@@ -13,10 +13,14 @@ export enum AttachState {
13
13
 
14
14
  // @public
15
15
  export namespace ConnectionState {
16
- export type CatchingUp = 1;
17
- export type Connected = 2;
18
- export type Disconnected = 0;
19
- export type EstablishingConnection = 3;
16
+ const Disconnected = 0;
17
+ export type CatchingUp = typeof CatchingUp;
18
+ const EstablishingConnection = 3;
19
+ export type Connected = typeof Connected;
20
+ const CatchingUp = 1;
21
+ export type Disconnected = typeof Disconnected;
22
+ const Connected = 2;
23
+ export type EstablishingConnection = typeof EstablishingConnection;
20
24
  }
21
25
 
22
26
  // @public
@@ -13,10 +13,14 @@ export enum AttachState {
13
13
 
14
14
  // @public
15
15
  export namespace ConnectionState {
16
- export type CatchingUp = 1;
17
- export type Connected = 2;
18
- export type Disconnected = 0;
19
- export type EstablishingConnection = 3;
16
+ const Disconnected = 0;
17
+ export type CatchingUp = typeof CatchingUp;
18
+ const EstablishingConnection = 3;
19
+ export type Connected = typeof Connected;
20
+ const CatchingUp = 1;
21
+ export type Disconnected = typeof Disconnected;
22
+ const Connected = 2;
23
+ export type EstablishingConnection = typeof EstablishingConnection;
20
24
  }
21
25
 
22
26
  // @public
package/dist/index.d.ts CHANGED
@@ -14,13 +14,13 @@ export type { IConnectionDetails, IDeltaManager, IDeltaManagerEvents, IDeltaMana
14
14
  export { isIDeltaManagerFull } from "./deltas.js";
15
15
  export type { ContainerWarning, ICriticalContainerError } from "./error.js";
16
16
  export { ContainerErrorTypes } from "./error.js";
17
- export type { ConnectionState, ICodeDetailsLoader, IContainer, IContainerEvents, IContainerLoadMode, IContainerPolicies, IFluidCodeResolver, IFluidModuleWithDetails, IHostLoader, ILoader, ILoaderHeader, ILoaderOptions, IProvideLoader, IResolvedFluidCodeDetails, ISnapshotTreeWithBlobContents, } from "./loader.js";
18
- export { LoaderHeader } from "./loader.js";
17
+ export type { ICodeDetailsLoader, IContainer, IContainerEvents, IContainerLoadMode, IContainerPolicies, IFluidCodeResolver, IFluidModuleWithDetails, IHostLoader, ILoader, ILoaderHeader, ILoaderOptions, IProvideLoader, IResolvedFluidCodeDetails, ISnapshotTreeWithBlobContents, } from "./loader.js";
18
+ export { ConnectionState, LoaderHeader } from "./loader.js";
19
19
  export type { IFluidModule } from "./fluidModule.js";
20
20
  export type { IFluidPackage, IFluidPackageEnvironment, IFluidCodeDetails, IFluidCodeDetailsConfig, IProvideFluidCodeDetailsComparer, } from "./fluidPackage.js";
21
21
  export { IFluidCodeDetailsComparer, isFluidPackage, isFluidCodeDetails, } from "./fluidPackage.js";
22
22
  export type { IBatchMessage, IContainerContext, IProvideRuntimeFactory, IRuntime, IGetPendingLocalStateProps, } from "./runtime.js";
23
- export { AttachState, IRuntimeFactory } from "./runtime.js";
23
+ export { AttachState, IRuntimeFactory, type IContainerStorageService } from "./runtime.js";
24
24
  export type {
25
25
  /**
26
26
  * @deprecated IErrorBase is being deprecated as a public export is moving to "core-interfaces".
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvF,YAAY,EACX,oBAAoB,EACpB,+BAA+B,GAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EACX,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,YAAY,GACZ,MAA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,qBAAqB,CAAC;AAC5D,YAAY,EACX,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EACX,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,OAAO,EACP,aAAa,EACb,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,6BAA6B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,YAAY,EACX,aAAa,EACb,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,gCAAgC,GAChC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,yBAAyB,EACzB,cAAc,EACd,kBAAkB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACX,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,QAAQ,EACR,0BAA0B,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE3F,YAAY;AACX;;GAEG;AACH,UAAU;AACV;;GAEG;AACH,kBAAkB,GAClB,MAAM,0CAA0C,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.IRuntimeFactory = exports.AttachState = exports.isFluidCodeDetails = exports.isFluidPackage = exports.IFluidCodeDetailsComparer = exports.LoaderHeader = exports.ContainerErrorTypes = exports.isIDeltaManagerFull = exports.isFluidBrowserPackage = void 0;
7
+ exports.IRuntimeFactory = exports.AttachState = exports.isFluidCodeDetails = exports.isFluidPackage = exports.IFluidCodeDetailsComparer = exports.LoaderHeader = exports.ConnectionState = exports.ContainerErrorTypes = exports.isIDeltaManagerFull = exports.isFluidBrowserPackage = void 0;
8
8
  var browserPackage_js_1 = require("./browserPackage.js");
9
9
  Object.defineProperty(exports, "isFluidBrowserPackage", { enumerable: true, get: function () { return browserPackage_js_1.isFluidBrowserPackage; } });
10
10
  var deltas_js_1 = require("./deltas.js");
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "isIDeltaManagerFull", { enumerable: true, get: f
12
12
  var error_js_1 = require("./error.js");
13
13
  Object.defineProperty(exports, "ContainerErrorTypes", { enumerable: true, get: function () { return error_js_1.ContainerErrorTypes; } });
14
14
  var loader_js_1 = require("./loader.js");
15
+ Object.defineProperty(exports, "ConnectionState", { enumerable: true, get: function () { return loader_js_1.ConnectionState; } });
15
16
  Object.defineProperty(exports, "LoaderHeader", { enumerable: true, get: function () { return loader_js_1.LoaderHeader; } });
16
17
  var fluidPackage_js_1 = require("./fluidPackage.js");
17
18
  Object.defineProperty(exports, "IFluidCodeDetailsComparer", { enumerable: true, get: function () { return fluidPackage_js_1.IFluidCodeDetailsComparer; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH,yDAA4D;AAAnD,0HAAA,qBAAqB,OAAA;AAW9B,yCAAkD;AAAzC,gHAAA,mBAAmB,OAAA;AAE5B,uCAAiD;AAAxC,+GAAA,mBAAmB,OAAA;AAkB5B,yCAA2C;AAAlC,yGAAA,YAAY,OAAA;AASrB,qDAI2B;AAH1B,4HAAA,yBAAyB,OAAA;AACzB,iHAAA,cAAc,OAAA;AACd,qHAAA,kBAAkB,OAAA;AASnB,2CAA4D;AAAnD,yGAAA,WAAW,OAAA;AAAE,6GAAA,eAAe,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * This library contains the interfaces and types concerning the `Loader` and loading the `Container`.\n *\n * @packageDocumentation\n */\n\nexport type { IAudience, IAudienceOwner, IAudienceEvents, ISelf } from \"./audience.js\";\nexport type {\n\tIFluidBrowserPackage,\n\tIFluidBrowserPackageEnvironment,\n} from \"./browserPackage.js\";\nexport { isFluidBrowserPackage } from \"./browserPackage.js\";\nexport type {\n\tIConnectionDetails,\n\tIDeltaManager,\n\tIDeltaManagerEvents,\n\tIDeltaManagerFull,\n\tIDeltaQueue,\n\tIDeltaQueueEvents,\n\tIDeltaSender,\n\tReadOnlyInfo,\n} from \"./deltas.js\";\nexport { isIDeltaManagerFull } from \"./deltas.js\";\nexport type { ContainerWarning, ICriticalContainerError } from \"./error.js\";\nexport { ContainerErrorTypes } from \"./error.js\";\nexport type {\n\tConnectionState,\n\tICodeDetailsLoader,\n\tIContainer,\n\tIContainerEvents,\n\tIContainerLoadMode,\n\tIContainerPolicies,\n\tIFluidCodeResolver,\n\tIFluidModuleWithDetails,\n\tIHostLoader,\n\tILoader,\n\tILoaderHeader,\n\tILoaderOptions,\n\tIProvideLoader,\n\tIResolvedFluidCodeDetails,\n\tISnapshotTreeWithBlobContents,\n} from \"./loader.js\";\nexport { LoaderHeader } from \"./loader.js\";\nexport type { IFluidModule } from \"./fluidModule.js\";\nexport type {\n\tIFluidPackage,\n\tIFluidPackageEnvironment,\n\tIFluidCodeDetails,\n\tIFluidCodeDetailsConfig,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage.js\";\nexport {\n\tIFluidCodeDetailsComparer,\n\tisFluidPackage,\n\tisFluidCodeDetails,\n} from \"./fluidPackage.js\";\nexport type {\n\tIBatchMessage,\n\tIContainerContext,\n\tIProvideRuntimeFactory,\n\tIRuntime,\n\tIGetPendingLocalStateProps,\n} from \"./runtime.js\";\nexport { AttachState, IRuntimeFactory } from \"./runtime.js\";\n\nexport type {\n\t/**\n\t * @deprecated IErrorBase is being deprecated as a public export is moving to \"core-interfaces\".\n\t */\n\tIErrorBase,\n\t/**\n\t * @deprecated IThrottlingWarning is being deprecated as a public export is moving to \"core-interfaces\".\n\t */\n\tIThrottlingWarning,\n} from \"@fluidframework/core-interfaces/internal\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH,yDAA4D;AAAnD,0HAAA,qBAAqB,OAAA;AAW9B,yCAAkD;AAAzC,gHAAA,mBAAmB,OAAA;AAE5B,uCAAiD;AAAxC,+GAAA,mBAAmB,OAAA;AAiB5B,yCAA4D;AAAnD,4GAAA,eAAe,OAAA;AAAE,yGAAA,YAAY,OAAA;AAStC,qDAI2B;AAH1B,4HAAA,yBAAyB,OAAA;AACzB,iHAAA,cAAc,OAAA;AACd,qHAAA,kBAAkB,OAAA;AASnB,2CAA2F;AAAlF,yGAAA,WAAW,OAAA;AAAE,6GAAA,eAAe,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * This library contains the interfaces and types concerning the `Loader` and loading the `Container`.\n *\n * @packageDocumentation\n */\n\nexport type { IAudience, IAudienceOwner, IAudienceEvents, ISelf } from \"./audience.js\";\nexport type {\n\tIFluidBrowserPackage,\n\tIFluidBrowserPackageEnvironment,\n} from \"./browserPackage.js\";\nexport { isFluidBrowserPackage } from \"./browserPackage.js\";\nexport type {\n\tIConnectionDetails,\n\tIDeltaManager,\n\tIDeltaManagerEvents,\n\tIDeltaManagerFull,\n\tIDeltaQueue,\n\tIDeltaQueueEvents,\n\tIDeltaSender,\n\tReadOnlyInfo,\n} from \"./deltas.js\";\nexport { isIDeltaManagerFull } from \"./deltas.js\";\nexport type { ContainerWarning, ICriticalContainerError } from \"./error.js\";\nexport { ContainerErrorTypes } from \"./error.js\";\nexport type {\n\tICodeDetailsLoader,\n\tIContainer,\n\tIContainerEvents,\n\tIContainerLoadMode,\n\tIContainerPolicies,\n\tIFluidCodeResolver,\n\tIFluidModuleWithDetails,\n\tIHostLoader,\n\tILoader,\n\tILoaderHeader,\n\tILoaderOptions,\n\tIProvideLoader,\n\tIResolvedFluidCodeDetails,\n\tISnapshotTreeWithBlobContents,\n} from \"./loader.js\";\nexport { ConnectionState, LoaderHeader } from \"./loader.js\";\nexport type { IFluidModule } from \"./fluidModule.js\";\nexport type {\n\tIFluidPackage,\n\tIFluidPackageEnvironment,\n\tIFluidCodeDetails,\n\tIFluidCodeDetailsConfig,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage.js\";\nexport {\n\tIFluidCodeDetailsComparer,\n\tisFluidPackage,\n\tisFluidCodeDetails,\n} from \"./fluidPackage.js\";\nexport type {\n\tIBatchMessage,\n\tIContainerContext,\n\tIProvideRuntimeFactory,\n\tIRuntime,\n\tIGetPendingLocalStateProps,\n} from \"./runtime.js\";\nexport { AttachState, IRuntimeFactory, type IContainerStorageService } from \"./runtime.js\";\n\nexport type {\n\t/**\n\t * @deprecated IErrorBase is being deprecated as a public export is moving to \"core-interfaces\".\n\t */\n\tIErrorBase,\n\t/**\n\t * @deprecated IThrottlingWarning is being deprecated as a public export is moving to \"core-interfaces\".\n\t */\n\tIThrottlingWarning,\n} from \"@fluidframework/core-interfaces/internal\";\n"]}
package/dist/legacy.d.ts CHANGED
@@ -36,6 +36,7 @@ export {
36
36
  IContainerEvents,
37
37
  IContainerLoadMode,
38
38
  IContainerPolicies,
39
+ IContainerStorageService,
39
40
  IDeltaManager,
40
41
  IDeltaManagerEvents,
41
42
  IDeltaQueue,
package/dist/loader.d.ts CHANGED
@@ -239,23 +239,39 @@ export declare namespace ConnectionState {
239
239
  * or may remain disconnected until explicitly told to connect.
240
240
  * @public
241
241
  */
242
- type Disconnected = 0;
242
+ const Disconnected = 0;
243
+ /**
244
+ * {@inheritdoc @fluidframework/container-definitions#(ConnectionState:namespace).(Disconnected:variable)}
245
+ */
246
+ type Disconnected = typeof Disconnected;
243
247
  /**
244
248
  * The container is disconnected but actively trying to establish a new connection.
245
249
  * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.
246
250
  * @public
247
251
  */
248
- type EstablishingConnection = 3;
252
+ const EstablishingConnection = 3;
253
+ /**
254
+ * {@inheritdoc @fluidframework/container-definitions#(ConnectionState:namespace).(EstablishingConnection:variable)}
255
+ */
256
+ type EstablishingConnection = typeof EstablishingConnection;
249
257
  /**
250
258
  * The container has an inbound connection only, and is catching up to the latest known state from the service.
251
259
  * @public
252
260
  */
253
- type CatchingUp = 1;
261
+ const CatchingUp = 1;
262
+ /**
263
+ * {@inheritdoc @fluidframework/container-definitions#(ConnectionState:namespace).(CatchingUp:variable)}
264
+ */
265
+ type CatchingUp = typeof CatchingUp;
254
266
  /**
255
267
  * The container is fully connected and syncing.
256
268
  * @public
257
269
  */
258
- type Connected = 2;
270
+ const Connected = 2;
271
+ /**
272
+ * {@inheritdoc @fluidframework/container-definitions#(ConnectionState:namespace).(Connected:variable)}
273
+ */
274
+ type Connected = typeof Connected;
259
275
  }
260
276
  /**
261
277
  * Type defining the different states of connectivity a Container can be in.
@@ -392,7 +408,7 @@ export interface IContainer extends IEventProvider<IContainerEvents> {
392
408
  *
393
409
  * @remarks
394
410
  *
395
- * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the
411
+ * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).(Connected:variable)}, and the
396
412
  * "connected" event will be fired if/when connection succeeds.
397
413
  */
398
414
  connect(): void;
@@ -401,7 +417,7 @@ export interface IContainer extends IEventProvider<IContainerEvents> {
401
417
  *
402
418
  * @remarks
403
419
  *
404
- * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the
420
+ * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).(Disconnected:variable)}, and the
405
421
  * "disconnected" event will be fired when disconnection completes.
406
422
  */
407
423
  disconnect(): void;
@@ -412,7 +428,7 @@ export interface IContainer extends IEventProvider<IContainerEvents> {
412
428
  /**
413
429
  * The server provided ID of the client.
414
430
  *
415
- * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},
431
+ * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).(Connected:variable)},
416
432
  * otherwise will be `undefined`.
417
433
  */
418
434
  readonly clientId?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,QAAQ,EACR,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,OAAO,EACP,cAAc,EACd,cAAc,EACd,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AAErD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EACX,iBAAiB,EACjB,aAAa,EACb,gCAAgC,EAChC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IAErB;;;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;;;;;;GAOG;AACH,MAAM,WAAW,6BAA8B,SAAQ,aAAa;IACnE,aAAa,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE,CAAC;IACpD,KAAK,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,6BAA6B,CAAA;KAAE,CAAC;CACzD"}
package/dist/loader.js CHANGED
@@ -4,7 +4,39 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.LoaderHeader = void 0;
7
+ exports.LoaderHeader = exports.ConnectionState = void 0;
8
+ /**
9
+ * Namespace for the different connection states a container can be in.
10
+ * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.
11
+ * @public
12
+ */
13
+ // eslint-disable-next-line @typescript-eslint/no-namespace
14
+ var ConnectionState;
15
+ (function (ConnectionState) {
16
+ /**
17
+ * The container is not connected to the delta server.
18
+ * Note - When in this state the container may be about to reconnect,
19
+ * or may remain disconnected until explicitly told to connect.
20
+ * @public
21
+ */
22
+ ConnectionState.Disconnected = 0;
23
+ /**
24
+ * The container is disconnected but actively trying to establish a new connection.
25
+ * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.
26
+ * @public
27
+ */
28
+ ConnectionState.EstablishingConnection = 3;
29
+ /**
30
+ * The container has an inbound connection only, and is catching up to the latest known state from the service.
31
+ * @public
32
+ */
33
+ ConnectionState.CatchingUp = 1;
34
+ /**
35
+ * The container is fully connected and syncing.
36
+ * @public
37
+ */
38
+ ConnectionState.Connected = 2;
39
+ })(ConnectionState || (exports.ConnectionState = ConnectionState = {}));
8
40
  /**
9
41
  * Accepted header keys for requests coming to the Loader
10
42
  * @legacy
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAunBH;;;;GAIG;AACH,IAAY,YA2BX;AA3BD,WAAY,YAAY;IACvB;;;OAGG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B;;;OAGG;IACH,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACpB,CAAC,EA3BW,YAAY,4BAAZ,YAAY,QA2BvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tFluidObject,\n\tIEvent,\n\tIEventProvider,\n\tIRequest,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIClient,\n\tIClientDetails,\n\tIQuorumClients,\n} from \"@fluidframework/driver-definitions\";\nimport type {\n\tIResolvedUrl,\n\tIDocumentMessage,\n\tISequencedProposal,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport type { IAudience } from \"./audience.js\";\nimport type { IDeltaManager, ReadOnlyInfo } from \"./deltas.js\";\nimport type { ContainerWarning, ICriticalContainerError } from \"./error.js\";\nimport type { IFluidModule } from \"./fluidModule.js\";\nimport type {\n\tIFluidCodeDetails,\n\tIFluidPackage,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage.js\";\nimport type { AttachState } from \"./runtime.js\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n * @legacy\n * @alpha\n */\nexport interface IFluidModuleWithDetails {\n\t/**\n\t * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n\t */\n\tmodule: IFluidModule;\n\n\t/**\n\t * Code details associated with the module. Represents a document schema this module supports.\n\t * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}\n\t * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n\t * quorum.\n\t */\n\tdetails: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n * @legacy\n * @alpha\n */\nexport interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {\n\t/**\n\t * Load the code module (package) that can interact with the document.\n\t *\n\t * @param source - Code proposal that articulates the current schema the document is written in.\n\t * @returns Code module entry point along with the code details associated with it.\n\t */\n\tload(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n * @internal\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n\t/**\n\t * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n\t */\n\treadonly resolvedPackage: Readonly<IFluidPackage>;\n\t/**\n\t * If not undefined, this id will be used to cache the entry point for the code package\n\t */\n\treadonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n * @internal\n */\nexport interface IFluidCodeResolver {\n\t/**\n\t * Resolves a Fluid code details into a form that can be loaded.\n\t * @param details - The Fluid code details to resolve.\n\t * @returns A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n\t * an optional resolvedPackageCacheId if the loaded package should be cached.\n\t */\n\tresolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n * @legacy\n * @alpha\n */\nexport interface IContainerEvents extends IEvent {\n\t/**\n\t * Emitted when the readonly state of the container changes.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `readonly`: Whether or not the container is now in a readonly state.\n\t *\n\t * @see {@link IContainer.readOnlyInfo}\n\t */\n\t(event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n\t/**\n\t * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.connect}\n\t */\n\t(event: \"connected\", listener: (clientId: string) => void);\n\n\t/**\n\t * Fires when new container code details have been proposed, prior to acceptance.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `codeDetails`: The code details being proposed.\n\t *\n\t * - `proposal`: NOT RECOMMENDED FOR USE.\n\t *\n\t * @see {@link IContainer.proposeCodeDetails}\n\t */\n\t(\n\t\tevent: \"codeDetailsProposed\",\n\t\tlistener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void,\n\t);\n\n\t/**\n\t * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.disconnect}\n\t */\n\t(event: \"disconnected\", listener: () => void);\n\n\t/**\n\t * Emitted when a {@link AttachState.Detached | detached} container begins the process of\n\t * {@link AttachState.Attaching | attached} to the Fluid service.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.attachState}\n\t *\n\t * - {@link IContainer.attach}\n\t */\n\t(event: \"attaching\", listener: () => void);\n\n\t/**\n\t * Emitted when the {@link AttachState.Attaching | attaching} process is complete and the container is\n\t * {@link AttachState.Attached | attached} to the Fluid service.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.attachState}\n\t *\n\t * - {@link IContainer.attach}\n\t */\n\t(event: \"attached\", listener: () => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is closed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.close}\n\t */\n\t(event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is disposed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.dispose}\n\t */\n\t(event: \"disposed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n\t * For now, use of this should be avoided when possible.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `error`: The warning describing the encountered state.\n\t */\n\t(event: \"warning\", listener: (error: ContainerWarning) => void);\n\n\t/**\n\t * Emitted immediately after processing an incoming operation (op).\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n\t * ops directly on the {@link IContainer}.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `message`: The op that was processed.\n\t */\n\t(event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n\t/**\n\t * Emitted upon the first local change while the Container is in the \"saved\" state.\n\t * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"dirty\", listener: (dirty: boolean) => void);\n\n\t/**\n\t * Emitted when all local changes/edits have been acknowledged by the service.\n\t * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"saved\", listener: (dirty: boolean) => void);\n\n\t/**\n\t * Emitted when the some of the properties related to the container are initialized or updated.\n\t * This emitted metadata will the props which are updated. If consumer wants to read full set of\n\t * metadata then they can read it off the container from {@link IContainer.containerMetadata} prop.\n\t */\n\t(event: \"metadataUpdate\", listener: (metadata: Record<string, string>) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n\t/**\n\t * The container is not connected to the delta server.\n\t * Note - When in this state the container may be about to reconnect,\n\t * or may remain disconnected until explicitly told to connect.\n\t * @public\n\t */\n\texport type Disconnected = 0;\n\n\t/**\n\t * The container is disconnected but actively trying to establish a new connection.\n\t * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n\t * @public\n\t */\n\texport type EstablishingConnection = 3;\n\n\t/**\n\t * The container has an inbound connection only, and is catching up to the latest known state from the service.\n\t * @public\n\t */\n\texport type CatchingUp = 1;\n\n\t/**\n\t * The container is fully connected and syncing.\n\t * @public\n\t */\n\texport type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n * @public\n */\nexport type ConnectionState =\n\t| ConnectionState.Disconnected\n\t| ConnectionState.EstablishingConnection\n\t| ConnectionState.CatchingUp\n\t| ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n * @legacy\n * @alpha\n */\nexport interface IContainer extends IEventProvider<IContainerEvents> {\n\t/**\n\t * The Delta Manager supporting the op stream for this Container\n\t */\n\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n\t/**\n\t * The collection of write clients which were connected as of the current sequence number.\n\t * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Represents the resolved url to the Container.\n\t * Will be undefined only when the container is in the {@link AttachState.Detached | detached} state.\n\t */\n\tresolvedUrl: IResolvedUrl | undefined;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\t/**\n\t * Get the code details that are currently specified for the container.\n\t * @returns The current code details if any are specified, undefined if none are specified.\n\t */\n\tgetSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Get the code details that were used to load the container.\n\t * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n\t * loaded.\n\t */\n\tgetLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Returns true if the container has been closed and/or disposed, otherwise false.\n\t */\n\treadonly closed: boolean;\n\n\t/**\n\t * Returns true if the container has been disposed, otherwise false.\n\t */\n\treadonly disposed?: boolean;\n\n\t/**\n\t * Whether or not there are any local changes that have not been saved.\n\t */\n\treadonly isDirty: boolean;\n\n\t/**\n\t * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.\n\t * The container is not expected to be used anymore once it is disposed.\n\t *\n\t * @param error - If the container is being disposed due to error, this provides details about the error that\n\t * resulted in disposing it.\n\t */\n\tdispose(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container.\n\t *\n\t * @param error - If the container is being closed due to error, this provides details about the error that\n\t * resulted in closing it.\n\t */\n\tclose(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Propose new code details that define the code to be loaded for this container's runtime.\n\t *\n\t * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n\t */\n\tproposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n\t/**\n\t * When a container is created in Fluid it starts in detached state,\n\t * which means it is not yet uploaded to server storage and unavailable for other users to open or collaborate with.\n\t * A detached container can be serialized, stored, and rehydrated by the application.\n\t *\n\t * To finish the creation of a container and make it available for other users to open and collaborate with it must be attached,\n\t * which means it is uploaded to server storage. This function accomplishes that.\n\t *\n\t * Use the functionality provided by the driver to craft the IRequest parameter.\n\t * This is usually a free function called createCreateNewRequest, which takes\n\t * strongly typed arguments related to your driver and server.\n\t *\n\t * By default, the container will close if attach fails.\n\t * However, closure can now be avoided in most cased by setting:\n\t * Fluid.Container.RetryOnAttachFailure to true\n\t * via the config provider passed to the loader.\n\t *\n\t * If attach fails, check the closed property to discover if retry is possible.\n\t * If the container is not closed, it is safe to continue editing the container, calling serialize to capture the container's state,\n\t * or try calling attach again.\n\t *\n\t */\n\tattach(\n\t\trequest: IRequest,\n\t\tattachProps?: { deltaConnection?: \"none\" | \"delayed\" },\n\t): Promise<void>;\n\n\t/**\n\t * Capture the state of a container that is not attached or closed.\n\t * This is useful in draft-like scenarios. For example, think of an email draft, where a user can make changes over time,\n\t * but no other users can see or have access to that draft.\n\t *\n\t * This method can only be called when\n\t * the container's closed property is false, and the attachState is not AttachState.Attached.\n\t *\n\t * This method will return a string that includes the full serialized state of the\n\t * container. This string must not be inspected or modified, as the format of the content is not guaranteed.\n\t * @remarks\n\t * Fluid supports rehydrating from strings generated by previous versions, but does not support the content itself being leveraged.\n\t *\n\t * Consider storing this string somewhere durable (e.g. localStorage or IndexedDB) to enable your application to recover it after tab close.\n\t *\n\t * To reload a container from a string your application previously stored, use the Loader method rehydrateDetachedContainerFromSnapshot.\n\t * That method will create a new detached container which matches the state of the previously serialized container.\n\t */\n\tserialize(): string;\n\n\t/**\n\t * Get an absolute URL for a provided container-relative request URL.\n\t * If the container is not attached, this will return undefined.\n\t *\n\t * @param relativeUrl - A container-relative request URL.\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Provides the current state of the container's connection to the ordering service.\n\t *\n\t * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n\t */\n\treadonly connectionState: ConnectionState;\n\n\t/**\n\t * Attempts to connect the container to the delta stream and process ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the\n\t * \"connected\" event will be fired if/when connection succeeds.\n\t */\n\tconnect(): void;\n\n\t/**\n\t * Disconnects the container from the delta stream and stops processing ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the\n\t * \"disconnected\" event will be fired when disconnection completes.\n\t */\n\tdisconnect(): void;\n\n\t/**\n\t * The audience information for all clients currently associated with the document in the current session.\n\t */\n\treadonly audience: IAudience;\n\n\t/**\n\t * The server provided ID of the client.\n\t *\n\t * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},\n\t * otherwise will be `undefined`.\n\t */\n\treadonly clientId?: string | undefined;\n\n\t/**\n\t * Tells if container is in read-only mode.\n\t *\n\t * @remarks\n\t *\n\t * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n\t * Readonly state can be because of no storage write permission,\n\t * or due to host forcing readonly mode for container.\n\t *\n\t * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n\t * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n\t *\n\t * It is undefined if we have not yet established websocket connection\n\t * and do not know if user has write access to a file.\n\t */\n\treadonly readOnlyInfo: ReadOnlyInfo;\n\n\t/**\n\t * Allows the host to have the container force to be in read-only mode\n\t * @param readonly - Boolean that toggles if read-only policies will be enforced\n\t */\n\tforceReadonly?(readonly: boolean);\n\n\t/**\n\t * Exposes the entryPoint for the container.\n\t * Use this as the primary way of getting access to the user-defined logic within the container.\n\t */\n\tgetEntryPoint(): Promise<FluidObject>;\n\n\t/**\n\t * Exposes any metadata/props related to the container. This is full set of metadata props which the container wants to\n\t * expose. Whenever container receives updates from `IContainerEvents.metadataUpdate` event, we overwrite only those\n\t * updated props in the update and rest remains the same.\n\t */\n\tcontainerMetadata: Record<string, string>;\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n * @legacy\n * @alpha\n */\nexport interface ILoader extends Partial<IProvideLoader> {\n\t/**\n\t * Resolves the resource specified by the URL + headers contained in the request object\n\t * to the underlying container that will resolve the request.\n\t *\n\t * @remarks\n\t *\n\t * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n\t * a request against the server found from the resolve step.\n\t */\n\tresolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n * @legacy\n * @alpha\n */\nexport interface IHostLoader extends ILoader {\n\t/**\n\t * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\tcreateDetachedContainer(\n\t\tcodeDetails: IFluidCodeDetails,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): Promise<IContainer>;\n\n\t/**\n\t * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\trehydrateDetachedContainerFromSnapshot(\n\t\tsnapshot: string,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): Promise<IContainer>;\n}\n\n/**\n * Options to configure various behaviors of the ILoader.\n * @legacy\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type ILoaderOptions = {\n\t/**\n\t * @deprecated This option has been deprecated and will be removed in a future release\n\t * Set caching behavior for the loader. If true, we will load a container from cache if one\n\t * with the same id/version exists or create a new container and cache it if it does not. If\n\t * false, always load a new container and don't cache it. If the container has already been\n\t * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n\t * request will override the Loader's value.\n\t * Defaults to false.\n\t */\n\tcache?: boolean;\n\n\t/**\n\t * @deprecated Do not use.\n\t */\n\tclient?: IClient;\n\n\t/**\n\t * @deprecated Do not use.\n\t */\n\tenableOfflineLoad?: boolean;\n\n\t/**\n\t * Provide the current Loader through the scope object when creating Containers. It is added\n\t * as the `ILoader` property, and will overwrite an existing property of the same name on the\n\t * scope. Useful for when the host wants to provide the current Loader's functionality to\n\t * individual Data Stores, which is typically expected when creating with a Loader.\n\t * Defaults to true.\n\t */\n\tprovideScopeLoader?: boolean;\n\n\t/**\n\t * Max time (in ms) container will wait for a leave message of a disconnected client.\n\t */\n\tmaxClientLeaveWaitTime?: number;\n};\n\n/**\n * Policies to have various behaviors during container create and load.\n * @legacy\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type IContainerPolicies = {\n\t/**\n\t * Max time (in ms) container will wait for a leave message of a disconnected client.\n\t */\n\tmaxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n * @legacy\n * @alpha\n */\nexport enum LoaderHeader {\n\t/**\n\t * @deprecated This header has been deprecated and will be removed in a future release\n\t * Override the Loader's default caching behavior for this container.\n\t */\n\tcache = \"fluid-cache\",\n\n\tclientDetails = \"fluid-client-details\",\n\n\t/**\n\t * Start the container in a paused, unconnected state. Defaults to false\n\t */\n\tloadMode = \"loadMode\",\n\treconnect = \"fluid-reconnect\",\n\t/**\n\t * Loads the container to at least the specified sequence number.\n\t * If not defined, behavior will fall back to `IContainerLoadMode.opsBeforeReturn`.\n\t */\n\tsequenceNumber = \"fluid-sequence-number\",\n\n\t/**\n\t * One of the following:\n\t * null or \"null\": use ops, no snapshots\n\t * undefined: fetch latest snapshot\n\t * otherwise, version sha to load snapshot\n\t */\n\tversion = \"version\",\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IContainerLoadMode {\n\topsBeforeReturn?: /*\n\t * No trailing ops are applied before container is returned.\n\t * Default value.\n\t */\n\t\t| undefined\n\t\t/*\n\t\t * Only cached trailing ops are applied before returning container.\n\t\t * Caching is optional and could be implemented by the driver.\n\t\t * If driver does not implement any kind of local caching strategy, this is same as above.\n\t\t * Driver may cache a lot of ops, so care needs to be exercised (see below).\n\t\t */\n\t\t| \"cached\"\n\t\t/*\n\t\t * All trailing ops in storage are fetched and applied before container is returned\n\t\t * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n\t\t * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n\t\t * recommended to have some progress UX / cancellation built into loading flow when using this option.\n\t\t * WARNING: This is the only option that may result in unbound wait. If machine is offline or hits some other\n\t\t * errors (like 429s), it may get into inifinite retry loop, with no ability to observe or cancel that process.\n\t\t */\n\t\t| \"all\";\n\n\tdeltaConnection?: /*\n\t * Connection to delta stream is made only when Container.connect() call is made. Op processing\n\t * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n\t */\n\t\t| \"none\"\n\t\t/*\n\t\t * Connection to delta stream is made only when Container.connect() call is made.\n\t\t * Op fetching from storage is performed and ops are applied as they come in.\n\t\t * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n\t\t * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n\t\t */\n\t\t| \"delayed\"\n\t\t/*\n\t\t * Connection to delta stream is made right away.\n\t\t * Ops processing is enabled and ops are flowing through the system.\n\t\t * Default value.\n\t\t */\n\t\t| undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n * @internal\n */\nexport interface ILoaderHeader {\n\t[LoaderHeader.clientDetails]: IClientDetails;\n\t[LoaderHeader.loadMode]: IContainerLoadMode;\n\t[LoaderHeader.reconnect]: boolean;\n\t[LoaderHeader.version]: string | undefined;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideLoader {\n\treadonly ILoader: ILoader;\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 * @legacy\n * @alpha\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n\tblobsContents?: { [path: string]: ArrayBufferLike };\n\ttrees: { [path: string]: ISnapshotTreeWithBlobContents };\n}\n"]}
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6QH;;;;GAIG;AACH,2DAA2D;AAC3D,IAAiB,eAAe,CA2C/B;AA3CD,WAAiB,eAAe;IAC/B;;;;;OAKG;IACU,4BAAY,GAAG,CAAC,CAAC;IAM9B;;;;OAIG;IACU,sCAAsB,GAAG,CAAC,CAAC;IAMxC;;;OAGG;IACU,0BAAU,GAAG,CAAC,CAAC;IAM5B;;;OAGG;IACU,yBAAS,GAAG,CAAC,CAAC;AAK5B,CAAC,EA3CgB,eAAe,+BAAf,eAAe,QA2C/B;AAyUD;;;;GAIG;AACH,IAAY,YA2BX;AA3BD,WAAY,YAAY;IACvB;;;OAGG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B;;;OAGG;IACH,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACpB,CAAC,EA3BW,YAAY,4BAAZ,YAAY,QA2BvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tFluidObject,\n\tIEvent,\n\tIEventProvider,\n\tIRequest,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIClient,\n\tIClientDetails,\n\tIQuorumClients,\n} from \"@fluidframework/driver-definitions\";\nimport type {\n\tIResolvedUrl,\n\tIDocumentMessage,\n\tISequencedProposal,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport type { IAudience } from \"./audience.js\";\nimport type { IDeltaManager, ReadOnlyInfo } from \"./deltas.js\";\nimport type { ContainerWarning, ICriticalContainerError } from \"./error.js\";\nimport type { IFluidModule } from \"./fluidModule.js\";\nimport type {\n\tIFluidCodeDetails,\n\tIFluidPackage,\n\tIProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage.js\";\nimport type { AttachState } from \"./runtime.js\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n * @legacy\n * @alpha\n */\nexport interface IFluidModuleWithDetails {\n\t/**\n\t * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n\t */\n\tmodule: IFluidModule;\n\n\t/**\n\t * Code details associated with the module. Represents a document schema this module supports.\n\t * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}\n\t * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n\t * quorum.\n\t */\n\tdetails: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n * @legacy\n * @alpha\n */\nexport interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {\n\t/**\n\t * Load the code module (package) that can interact with the document.\n\t *\n\t * @param source - Code proposal that articulates the current schema the document is written in.\n\t * @returns Code module entry point along with the code details associated with it.\n\t */\n\tload(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n * @internal\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n\t/**\n\t * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n\t */\n\treadonly resolvedPackage: Readonly<IFluidPackage>;\n\t/**\n\t * If not undefined, this id will be used to cache the entry point for the code package\n\t */\n\treadonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n * @internal\n */\nexport interface IFluidCodeResolver {\n\t/**\n\t * Resolves a Fluid code details into a form that can be loaded.\n\t * @param details - The Fluid code details to resolve.\n\t * @returns A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n\t * an optional resolvedPackageCacheId if the loaded package should be cached.\n\t */\n\tresolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n * @legacy\n * @alpha\n */\nexport interface IContainerEvents extends IEvent {\n\t/**\n\t * Emitted when the readonly state of the container changes.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `readonly`: Whether or not the container is now in a readonly state.\n\t *\n\t * @see {@link IContainer.readOnlyInfo}\n\t */\n\t(event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n\t/**\n\t * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.connect}\n\t */\n\t(event: \"connected\", listener: (clientId: string) => void);\n\n\t/**\n\t * Fires when new container code details have been proposed, prior to acceptance.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `codeDetails`: The code details being proposed.\n\t *\n\t * - `proposal`: NOT RECOMMENDED FOR USE.\n\t *\n\t * @see {@link IContainer.proposeCodeDetails}\n\t */\n\t(\n\t\tevent: \"codeDetailsProposed\",\n\t\tlistener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void,\n\t);\n\n\t/**\n\t * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.disconnect}\n\t */\n\t(event: \"disconnected\", listener: () => void);\n\n\t/**\n\t * Emitted when a {@link AttachState.Detached | detached} container begins the process of\n\t * {@link AttachState.Attaching | attached} to the Fluid service.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.attachState}\n\t *\n\t * - {@link IContainer.attach}\n\t */\n\t(event: \"attaching\", listener: () => void);\n\n\t/**\n\t * Emitted when the {@link AttachState.Attaching | attaching} process is complete and the container is\n\t * {@link AttachState.Attached | attached} to the Fluid service.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.attachState}\n\t *\n\t * - {@link IContainer.attach}\n\t */\n\t(event: \"attached\", listener: () => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is closed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.close}\n\t */\n\t(event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is disposed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.dispose}\n\t */\n\t(event: \"disposed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n\t * For now, use of this should be avoided when possible.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `error`: The warning describing the encountered state.\n\t */\n\t(event: \"warning\", listener: (error: ContainerWarning) => void);\n\n\t/**\n\t * Emitted immediately after processing an incoming operation (op).\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n\t * ops directly on the {@link IContainer}.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `message`: The op that was processed.\n\t */\n\t(event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n\t/**\n\t * Emitted upon the first local change while the Container is in the \"saved\" state.\n\t * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"dirty\", listener: (dirty: boolean) => void);\n\n\t/**\n\t * Emitted when all local changes/edits have been acknowledged by the service.\n\t * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"saved\", listener: (dirty: boolean) => void);\n\n\t/**\n\t * Emitted when the some of the properties related to the container are initialized or updated.\n\t * This emitted metadata will the props which are updated. If consumer wants to read full set of\n\t * metadata then they can read it off the container from {@link IContainer.containerMetadata} prop.\n\t */\n\t(event: \"metadataUpdate\", listener: (metadata: Record<string, string>) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n\t/**\n\t * The container is not connected to the delta server.\n\t * Note - When in this state the container may be about to reconnect,\n\t * or may remain disconnected until explicitly told to connect.\n\t * @public\n\t */\n\texport const Disconnected = 0;\n\t/**\n\t * {@inheritdoc @fluidframework/container-definitions#(ConnectionState:namespace).(Disconnected:variable)}\n\t */\n\texport type Disconnected = typeof Disconnected;\n\n\t/**\n\t * The container is disconnected but actively trying to establish a new connection.\n\t * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n\t * @public\n\t */\n\texport const EstablishingConnection = 3;\n\t/**\n\t * {@inheritdoc @fluidframework/container-definitions#(ConnectionState:namespace).(EstablishingConnection:variable)}\n\t */\n\texport type EstablishingConnection = typeof EstablishingConnection;\n\n\t/**\n\t * The container has an inbound connection only, and is catching up to the latest known state from the service.\n\t * @public\n\t */\n\texport const CatchingUp = 1;\n\t/**\n\t * {@inheritdoc @fluidframework/container-definitions#(ConnectionState:namespace).(CatchingUp:variable)}\n\t */\n\texport type CatchingUp = typeof CatchingUp;\n\n\t/**\n\t * The container is fully connected and syncing.\n\t * @public\n\t */\n\texport const Connected = 2;\n\t/**\n\t * {@inheritdoc @fluidframework/container-definitions#(ConnectionState:namespace).(Connected:variable)}\n\t */\n\texport type Connected = typeof Connected;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n * @public\n */\nexport type ConnectionState =\n\t| ConnectionState.Disconnected\n\t| ConnectionState.EstablishingConnection\n\t| ConnectionState.CatchingUp\n\t| ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n * @legacy\n * @alpha\n */\nexport interface IContainer extends IEventProvider<IContainerEvents> {\n\t/**\n\t * The Delta Manager supporting the op stream for this Container\n\t */\n\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n\t/**\n\t * The collection of write clients which were connected as of the current sequence number.\n\t * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Represents the resolved url to the Container.\n\t * Will be undefined only when the container is in the {@link AttachState.Detached | detached} state.\n\t */\n\tresolvedUrl: IResolvedUrl | undefined;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\t/**\n\t * Get the code details that are currently specified for the container.\n\t * @returns The current code details if any are specified, undefined if none are specified.\n\t */\n\tgetSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Get the code details that were used to load the container.\n\t * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n\t * loaded.\n\t */\n\tgetLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Returns true if the container has been closed and/or disposed, otherwise false.\n\t */\n\treadonly closed: boolean;\n\n\t/**\n\t * Returns true if the container has been disposed, otherwise false.\n\t */\n\treadonly disposed?: boolean;\n\n\t/**\n\t * Whether or not there are any local changes that have not been saved.\n\t */\n\treadonly isDirty: boolean;\n\n\t/**\n\t * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.\n\t * The container is not expected to be used anymore once it is disposed.\n\t *\n\t * @param error - If the container is being disposed due to error, this provides details about the error that\n\t * resulted in disposing it.\n\t */\n\tdispose(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container.\n\t *\n\t * @param error - If the container is being closed due to error, this provides details about the error that\n\t * resulted in closing it.\n\t */\n\tclose(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Propose new code details that define the code to be loaded for this container's runtime.\n\t *\n\t * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n\t */\n\tproposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n\t/**\n\t * When a container is created in Fluid it starts in detached state,\n\t * which means it is not yet uploaded to server storage and unavailable for other users to open or collaborate with.\n\t * A detached container can be serialized, stored, and rehydrated by the application.\n\t *\n\t * To finish the creation of a container and make it available for other users to open and collaborate with it must be attached,\n\t * which means it is uploaded to server storage. This function accomplishes that.\n\t *\n\t * Use the functionality provided by the driver to craft the IRequest parameter.\n\t * This is usually a free function called createCreateNewRequest, which takes\n\t * strongly typed arguments related to your driver and server.\n\t *\n\t * By default, the container will close if attach fails.\n\t * However, closure can now be avoided in most cased by setting:\n\t * Fluid.Container.RetryOnAttachFailure to true\n\t * via the config provider passed to the loader.\n\t *\n\t * If attach fails, check the closed property to discover if retry is possible.\n\t * If the container is not closed, it is safe to continue editing the container, calling serialize to capture the container's state,\n\t * or try calling attach again.\n\t *\n\t */\n\tattach(\n\t\trequest: IRequest,\n\t\tattachProps?: { deltaConnection?: \"none\" | \"delayed\" },\n\t): Promise<void>;\n\n\t/**\n\t * Capture the state of a container that is not attached or closed.\n\t * This is useful in draft-like scenarios. For example, think of an email draft, where a user can make changes over time,\n\t * but no other users can see or have access to that draft.\n\t *\n\t * This method can only be called when\n\t * the container's closed property is false, and the attachState is not AttachState.Attached.\n\t *\n\t * This method will return a string that includes the full serialized state of the\n\t * container. This string must not be inspected or modified, as the format of the content is not guaranteed.\n\t * @remarks\n\t * Fluid supports rehydrating from strings generated by previous versions, but does not support the content itself being leveraged.\n\t *\n\t * Consider storing this string somewhere durable (e.g. localStorage or IndexedDB) to enable your application to recover it after tab close.\n\t *\n\t * To reload a container from a string your application previously stored, use the Loader method rehydrateDetachedContainerFromSnapshot.\n\t * That method will create a new detached container which matches the state of the previously serialized container.\n\t */\n\tserialize(): string;\n\n\t/**\n\t * Get an absolute URL for a provided container-relative request URL.\n\t * If the container is not attached, this will return undefined.\n\t *\n\t * @param relativeUrl - A container-relative request URL.\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Provides the current state of the container's connection to the ordering service.\n\t *\n\t * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n\t */\n\treadonly connectionState: ConnectionState;\n\n\t/**\n\t * Attempts to connect the container to the delta stream and process ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).(Connected:variable)}, and the\n\t * \"connected\" event will be fired if/when connection succeeds.\n\t */\n\tconnect(): void;\n\n\t/**\n\t * Disconnects the container from the delta stream and stops processing ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).(Disconnected:variable)}, and the\n\t * \"disconnected\" event will be fired when disconnection completes.\n\t */\n\tdisconnect(): void;\n\n\t/**\n\t * The audience information for all clients currently associated with the document in the current session.\n\t */\n\treadonly audience: IAudience;\n\n\t/**\n\t * The server provided ID of the client.\n\t *\n\t * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).(Connected:variable)},\n\t * otherwise will be `undefined`.\n\t */\n\treadonly clientId?: string | undefined;\n\n\t/**\n\t * Tells if container is in read-only mode.\n\t *\n\t * @remarks\n\t *\n\t * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n\t * Readonly state can be because of no storage write permission,\n\t * or due to host forcing readonly mode for container.\n\t *\n\t * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n\t * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n\t *\n\t * It is undefined if we have not yet established websocket connection\n\t * and do not know if user has write access to a file.\n\t */\n\treadonly readOnlyInfo: ReadOnlyInfo;\n\n\t/**\n\t * Allows the host to have the container force to be in read-only mode\n\t * @param readonly - Boolean that toggles if read-only policies will be enforced\n\t */\n\tforceReadonly?(readonly: boolean);\n\n\t/**\n\t * Exposes the entryPoint for the container.\n\t * Use this as the primary way of getting access to the user-defined logic within the container.\n\t */\n\tgetEntryPoint(): Promise<FluidObject>;\n\n\t/**\n\t * Exposes any metadata/props related to the container. This is full set of metadata props which the container wants to\n\t * expose. Whenever container receives updates from `IContainerEvents.metadataUpdate` event, we overwrite only those\n\t * updated props in the update and rest remains the same.\n\t */\n\tcontainerMetadata: Record<string, string>;\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n * @legacy\n * @alpha\n */\nexport interface ILoader extends Partial<IProvideLoader> {\n\t/**\n\t * Resolves the resource specified by the URL + headers contained in the request object\n\t * to the underlying container that will resolve the request.\n\t *\n\t * @remarks\n\t *\n\t * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n\t * a request against the server found from the resolve step.\n\t */\n\tresolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n * @legacy\n * @alpha\n */\nexport interface IHostLoader extends ILoader {\n\t/**\n\t * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\tcreateDetachedContainer(\n\t\tcodeDetails: IFluidCodeDetails,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): Promise<IContainer>;\n\n\t/**\n\t * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\trehydrateDetachedContainerFromSnapshot(\n\t\tsnapshot: string,\n\t\tcreateDetachedProps?: {\n\t\t\tcanReconnect?: boolean;\n\t\t\tclientDetailsOverride?: IClientDetails;\n\t\t},\n\t): Promise<IContainer>;\n}\n\n/**\n * Options to configure various behaviors of the ILoader.\n * @legacy\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type ILoaderOptions = {\n\t/**\n\t * @deprecated This option has been deprecated and will be removed in a future release\n\t * Set caching behavior for the loader. If true, we will load a container from cache if one\n\t * with the same id/version exists or create a new container and cache it if it does not. If\n\t * false, always load a new container and don't cache it. If the container has already been\n\t * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n\t * request will override the Loader's value.\n\t * Defaults to false.\n\t */\n\tcache?: boolean;\n\n\t/**\n\t * @deprecated Do not use.\n\t */\n\tclient?: IClient;\n\n\t/**\n\t * @deprecated Do not use.\n\t */\n\tenableOfflineLoad?: boolean;\n\n\t/**\n\t * Provide the current Loader through the scope object when creating Containers. It is added\n\t * as the `ILoader` property, and will overwrite an existing property of the same name on the\n\t * scope. Useful for when the host wants to provide the current Loader's functionality to\n\t * individual Data Stores, which is typically expected when creating with a Loader.\n\t * Defaults to true.\n\t */\n\tprovideScopeLoader?: boolean;\n\n\t/**\n\t * Max time (in ms) container will wait for a leave message of a disconnected client.\n\t */\n\tmaxClientLeaveWaitTime?: number;\n};\n\n/**\n * Policies to have various behaviors during container create and load.\n * @legacy\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type IContainerPolicies = {\n\t/**\n\t * Max time (in ms) container will wait for a leave message of a disconnected client.\n\t */\n\tmaxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n * @legacy\n * @alpha\n */\nexport enum LoaderHeader {\n\t/**\n\t * @deprecated This header has been deprecated and will be removed in a future release\n\t * Override the Loader's default caching behavior for this container.\n\t */\n\tcache = \"fluid-cache\",\n\n\tclientDetails = \"fluid-client-details\",\n\n\t/**\n\t * Start the container in a paused, unconnected state. Defaults to false\n\t */\n\tloadMode = \"loadMode\",\n\treconnect = \"fluid-reconnect\",\n\t/**\n\t * Loads the container to at least the specified sequence number.\n\t * If not defined, behavior will fall back to `IContainerLoadMode.opsBeforeReturn`.\n\t */\n\tsequenceNumber = \"fluid-sequence-number\",\n\n\t/**\n\t * One of the following:\n\t * null or \"null\": use ops, no snapshots\n\t * undefined: fetch latest snapshot\n\t * otherwise, version sha to load snapshot\n\t */\n\tversion = \"version\",\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IContainerLoadMode {\n\topsBeforeReturn?: /*\n\t * No trailing ops are applied before container is returned.\n\t * Default value.\n\t */\n\t\t| undefined\n\t\t/*\n\t\t * Only cached trailing ops are applied before returning container.\n\t\t * Caching is optional and could be implemented by the driver.\n\t\t * If driver does not implement any kind of local caching strategy, this is same as above.\n\t\t * Driver may cache a lot of ops, so care needs to be exercised (see below).\n\t\t */\n\t\t| \"cached\"\n\t\t/*\n\t\t * All trailing ops in storage are fetched and applied before container is returned\n\t\t * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n\t\t * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n\t\t * recommended to have some progress UX / cancellation built into loading flow when using this option.\n\t\t * WARNING: This is the only option that may result in unbound wait. If machine is offline or hits some other\n\t\t * errors (like 429s), it may get into inifinite retry loop, with no ability to observe or cancel that process.\n\t\t */\n\t\t| \"all\";\n\n\tdeltaConnection?: /*\n\t * Connection to delta stream is made only when Container.connect() call is made. Op processing\n\t * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n\t */\n\t\t| \"none\"\n\t\t/*\n\t\t * Connection to delta stream is made only when Container.connect() call is made.\n\t\t * Op fetching from storage is performed and ops are applied as they come in.\n\t\t * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n\t\t * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n\t\t */\n\t\t| \"delayed\"\n\t\t/*\n\t\t * Connection to delta stream is made right away.\n\t\t * Ops processing is enabled and ops are flowing through the system.\n\t\t * Default value.\n\t\t */\n\t\t| undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n * @internal\n */\nexport interface ILoaderHeader {\n\t[LoaderHeader.clientDetails]: IClientDetails;\n\t[LoaderHeader.loadMode]: IContainerLoadMode;\n\t[LoaderHeader.reconnect]: boolean;\n\t[LoaderHeader.version]: string | undefined;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideLoader {\n\treadonly ILoader: ILoader;\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 * @legacy\n * @alpha\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n\tblobsContents?: { [path: string]: ArrayBufferLike };\n\ttrees: { [path: string]: ISnapshotTreeWithBlobContents };\n}\n"]}
package/dist/runtime.d.ts CHANGED
@@ -4,11 +4,11 @@
4
4
  */
5
5
  import type { FluidObject, IDisposable, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
6
  import type { IClientDetails, IQuorumClients, ISummaryTree } from "@fluidframework/driver-definitions";
7
- import type { IDocumentStorageService, ISnapshot, IDocumentMessage, ISnapshotTree, ISummaryContent, IVersion, MessageType, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
7
+ import type { ISnapshot, IDocumentMessage, ISnapshotTree, ISummaryContent, IVersion, MessageType, ISequencedDocumentMessage, ICreateBlobResponse, ISummaryContext, ISnapshotFetchOptions, FetchSource, IDocumentStorageServicePolicies, ISummaryHandle } from "@fluidframework/driver-definitions/internal";
8
8
  import type { IAudience } from "./audience.js";
9
9
  import type { IDeltaManager } from "./deltas.js";
10
10
  import type { ICriticalContainerError } from "./error.js";
11
- import type { ILoader } from "./loader.js";
11
+ import type { ConnectionState, ILoader } from "./loader.js";
12
12
  /**
13
13
  * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the
14
14
  * service. The transition from detached to attached state is a one-way transition.
@@ -95,6 +95,96 @@ export interface IBatchMessage {
95
95
  compression?: string;
96
96
  referenceSequenceNumber?: number;
97
97
  }
98
+ /**
99
+ * Interface to provide access to snapshots and policies to the Runtime layer. This should follow the Loader / Runtime
100
+ * layer compatibility rules.
101
+ *
102
+ * @remarks It contains a subset of APIs from {@link @fluidframework/driver-definitions#IDocumentStorageService} but
103
+ * allows the Runtime to not support layer compatibility with the Driver layer. Instead, it supports compatibility
104
+ * with the Loader layer which it already does.
105
+ *
106
+ * @legacy
107
+ * @alpha
108
+ */
109
+ export interface IContainerStorageService {
110
+ /**
111
+ * Whether or not the object has been disposed.
112
+ * If true, the object should be considered invalid, and its other state should be disregarded.
113
+ *
114
+ * @deprecated - This API is deprecated and will be removed in a future release. No replacement is planned as
115
+ * it is unused in the Runtime layer.
116
+ */
117
+ readonly disposed?: boolean;
118
+ /**
119
+ * Dispose of the object and its resources.
120
+ * @param error - Optional error indicating the reason for the disposal, if the object was
121
+ * disposed as the result of an error.
122
+ *
123
+ * @deprecated - This API is deprecated and will be removed in a future release. No replacement is planned as
124
+ * it is unused in the Runtime layer.
125
+ */
126
+ dispose?(error?: Error): void;
127
+ /**
128
+ * Policies implemented/instructed by driver.
129
+ *
130
+ * @deprecated - This will be removed in a future release. The Runtime layer only needs `maximumCacheDurationMs`
131
+ * policy which is added as a separate property.
132
+ */
133
+ readonly policies?: IDocumentStorageServicePolicies | undefined;
134
+ /**
135
+ * See {@link @fluidframework/driver-definitions#IDocumentStorageServicePolicies.maximumCacheDurationMs}
136
+ */
137
+ readonly maximumCacheDurationMs?: IDocumentStorageServicePolicies["maximumCacheDurationMs"];
138
+ /**
139
+ * Returns the snapshot tree.
140
+ * @param version - Version of the snapshot to be fetched.
141
+ * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help
142
+ * in debugging purposes to see why this call was made.
143
+ */
144
+ getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
145
+ /**
146
+ * Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from
147
+ * `getSnapshotTree` api in that, that API only returns the snapshot tree from the snapshot.
148
+ * @param snapshotFetchOptions - Options specified by the caller to specify and want certain behavior from the
149
+ * driver when fetching the snapshot.
150
+ */
151
+ getSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
152
+ /**
153
+ * Retrieves all versions of the document starting at the specified versionId - or null if from the head
154
+ * @param versionId - Version id of the requested version.
155
+ * @param count - Number of the versions to be fetched.
156
+ * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help
157
+ * in debugging purposes to see why this call was made.
158
+ * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache
159
+ * requests and serve data from cache. That will result in stale info returned. Callers can disable this
160
+ * functionality by passing fetchSource = noCache and ensuring that driver will return latest information
161
+ * from storage.
162
+ */
163
+ getVersions(versionId: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<IVersion[]>;
164
+ /**
165
+ * Creates a blob out of the given buffer
166
+ */
167
+ createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
168
+ /**
169
+ * Reads the object with the given ID, returns content in arrayBufferLike
170
+ */
171
+ readBlob(id: string): Promise<ArrayBufferLike>;
172
+ /**
173
+ * Uploads a summary tree to storage using the given context for reference of previous summary handle.
174
+ * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are
175
+ * referencing from the previously acked summary.
176
+ * Returns the uploaded summary handle.
177
+ */
178
+ uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
179
+ /**
180
+ * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the
181
+ * server has deleted it this call may result in a broken promise.
182
+ *
183
+ * @deprecated - This API is deprecated and will be removed in a future release. No replacement is planned as
184
+ * it is unused in the Runtime and below layers.
185
+ */
186
+ downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
187
+ }
98
188
  /**
99
189
  * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the
100
190
  * loader layer.
@@ -119,9 +209,17 @@ export interface IContainerContext {
119
209
  readonly options: Record<string | number, any>;
120
210
  readonly clientId: string | undefined;
121
211
  readonly clientDetails: IClientDetails;
122
- readonly storage: IDocumentStorageService;
212
+ readonly storage: IContainerStorageService;
123
213
  readonly connected: boolean;
124
214
  readonly baseSnapshot: ISnapshotTree | undefined;
215
+ /**
216
+ * Gets the current connection state of the container.
217
+ *
218
+ * @remarks
219
+ * This provides more detailed connection state information beyond the simple boolean `connected` property.
220
+ * Available starting from version 2.52.0. Property is not present in older versions.
221
+ */
222
+ readonly getConnectionState?: () => ConnectionState;
125
223
  /**
126
224
  * @deprecated Please use submitBatchFn & submitSummaryFn
127
225
  */