@fluidframework/container-definitions 2.70.0-361248 → 2.70.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,31 @@
1
1
  # @fluidframework/container-definitions
2
2
 
3
+ ## 2.70.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Deprecated properties have been removed from IRuntimeStorageService and IContainerStorageService ([#25708](https://github.com/microsoft/FluidFramework/pull/25708)) [82c936ed28](https://github.com/microsoft/FluidFramework/commit/82c936ed285c7e450d5e907a531ce71178f57819)
8
+
9
+ The following deprecated properties have been removed from `IRuntimeStorageService`:
10
+
11
+ - `createBlob`
12
+ - `dispose`
13
+ - `disposed`
14
+ - `downloadSummary`
15
+ - `getSnapshot`
16
+ - `getSnapshotTree`
17
+ - `getVersions`
18
+ - `policies`
19
+ - `uploadSummaryWithContext`
20
+
21
+ The following deprecated properties have been removed from `IContainerStorageService`:
22
+
23
+ - `dispose`
24
+ - `disposed`
25
+ - `downloadSummary`
26
+
27
+ Please see [this Github issue](https://github.com/microsoft/FluidFramework/issues/25069) for more details.
28
+
3
29
  ## 2.63.0
4
30
 
5
31
  Dependency updates only.
@@ -26,6 +26,53 @@ export namespace ConnectionState {
26
26
  // @public
27
27
  export type ConnectionState = ConnectionState.Disconnected | ConnectionState.EstablishingConnection | ConnectionState.CatchingUp | ConnectionState.Connected;
28
28
 
29
+ // @beta @sealed @legacy
30
+ export type ConnectionStatus = ConnectionStatusEstablishingConnection | ConnectionStatusCatchingUp | ConnectionStatusConnected | ConnectionStatusDisconnected;
31
+
32
+ // @beta @sealed @legacy
33
+ export interface ConnectionStatusCatchingUp extends ConnectionStatusTemplate {
34
+ // (undocumented)
35
+ canSendOps: false;
36
+ // (undocumented)
37
+ connectionState: ConnectionState.CatchingUp;
38
+ pendingClientConnectionId: string;
39
+ }
40
+
41
+ // @beta @sealed @legacy
42
+ export interface ConnectionStatusConnected extends ConnectionStatusTemplate {
43
+ // (undocumented)
44
+ canSendOps: boolean;
45
+ clientConnectionId: string;
46
+ // (undocumented)
47
+ connectionState: ConnectionState.Connected;
48
+ }
49
+
50
+ // @beta @sealed @legacy
51
+ export interface ConnectionStatusDisconnected extends ConnectionStatusTemplate {
52
+ // (undocumented)
53
+ canSendOps: false;
54
+ // (undocumented)
55
+ connectionState: ConnectionState.Disconnected;
56
+ priorConnectedClientConnectionId: string | undefined;
57
+ priorPendingClientConnectionId: string | undefined;
58
+ }
59
+
60
+ // @beta @sealed @legacy
61
+ export interface ConnectionStatusEstablishingConnection extends ConnectionStatusTemplate {
62
+ // (undocumented)
63
+ canSendOps: false;
64
+ // (undocumented)
65
+ connectionState: ConnectionState.EstablishingConnection;
66
+ }
67
+
68
+ // @beta @sealed @legacy
69
+ export interface ConnectionStatusTemplate {
70
+ canSendOps: boolean;
71
+ // (undocumented)
72
+ connectionState: ConnectionState;
73
+ readonly: boolean;
74
+ }
75
+
29
76
  // @beta @legacy
30
77
  export const ContainerErrorTypes: {
31
78
  readonly clientSessionExpiredError: "clientSessionExpiredError";
@@ -157,6 +204,8 @@ export interface IContainerContext {
157
204
  // (undocumented)
158
205
  readonly quorum: IQuorumClients;
159
206
  readonly scope: FluidObject;
207
+ // @system
208
+ readonly signalAudience?: IAudience;
160
209
  readonly snapshotWithContents?: ISnapshot;
161
210
  // (undocumented)
162
211
  readonly storage: IContainerStorageService;
@@ -209,12 +258,6 @@ export type IContainerPolicies = {
209
258
  // @beta @legacy
210
259
  export interface IContainerStorageService {
211
260
  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
261
  getSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
219
262
  getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
220
263
  getVersions(versionId: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<IVersion[]>;
@@ -427,6 +470,7 @@ export interface IRuntime extends IDisposable {
427
470
  processSignal(message: any, local: boolean): any;
428
471
  setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
429
472
  setConnectionState(canSendOps: boolean, clientId?: string): any;
473
+ setConnectionStatus?(status: ConnectionStatus): void;
430
474
  }
431
475
 
432
476
  // @beta @legacy (undocumented)
package/dist/index.d.ts CHANGED
@@ -19,7 +19,7 @@ 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
- export type { IBatchMessage, IContainerContext, IProvideRuntimeFactory, IRuntime, IGetPendingLocalStateProps, } from "./runtime.js";
22
+ export type { ConnectionStatus, ConnectionStatusCatchingUp, ConnectionStatusConnected, ConnectionStatusDisconnected, ConnectionStatusEstablishingConnection, ConnectionStatusTemplate, IBatchMessage, IContainerContext, IProvideRuntimeFactory, IRuntime, IGetPendingLocalStateProps, } from "./runtime.js";
23
23
  export { AttachState, IRuntimeFactory, type IContainerStorageService } from "./runtime.js";
24
24
  export type {
25
25
  /**
@@ -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,kBAA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AAE3F,YAAY;AACX;;GAEG;AACH,UAAU;AACV;;GAEG;AACH,kBAAkB,GAClB,MAAM,0CAA0C,CAAC"}
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;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"]}
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;AAenB,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\tConnectionStatus,\n\tConnectionStatusCatchingUp,\n\tConnectionStatusConnected,\n\tConnectionStatusDisconnected,\n\tConnectionStatusEstablishingConnection,\n\tConnectionStatusTemplate,\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
@@ -26,6 +26,12 @@ export {
26
26
  // #endregion
27
27
 
28
28
  // #region @legacyBeta APIs
29
+ ConnectionStatus,
30
+ ConnectionStatusCatchingUp,
31
+ ConnectionStatusConnected,
32
+ ConnectionStatusDisconnected,
33
+ ConnectionStatusEstablishingConnection,
34
+ ConnectionStatusTemplate,
29
35
  ContainerErrorTypes,
30
36
  ContainerWarning,
31
37
  IAudienceOwner,
package/dist/runtime.d.ts CHANGED
@@ -4,7 +4,7 @@
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 { ISnapshot, IDocumentMessage, ISnapshotTree, ISummaryContent, IVersion, MessageType, ISequencedDocumentMessage, ICreateBlobResponse, ISummaryContext, ISnapshotFetchOptions, FetchSource, IDocumentStorageServicePolicies, ISummaryHandle } from "@fluidframework/driver-definitions/internal";
7
+ import type { ISnapshot, IDocumentMessage, ISnapshotTree, ISummaryContent, IVersion, MessageType, ISequencedDocumentMessage, ICreateBlobResponse, ISummaryContext, ISnapshotFetchOptions, FetchSource, IDocumentStorageServicePolicies } 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";
@@ -30,6 +30,86 @@ export declare enum AttachState {
30
30
  */
31
31
  Attached = "Attached"
32
32
  }
33
+ /**
34
+ * Defines the connection status of the container.
35
+ *
36
+ * @legacy @beta
37
+ * @sealed
38
+ */
39
+ export interface ConnectionStatusTemplate {
40
+ connectionState: ConnectionState;
41
+ /**
42
+ * True if the runtime is currently allowed to send ops.
43
+ */
44
+ canSendOps: boolean;
45
+ /**
46
+ * True if the container is in readonly mode.
47
+ */
48
+ readonly: boolean;
49
+ }
50
+ /**
51
+ * Status for an establishing connection.
52
+ *
53
+ * @legacy @beta
54
+ * @sealed
55
+ */
56
+ export interface ConnectionStatusEstablishingConnection extends ConnectionStatusTemplate {
57
+ connectionState: ConnectionState.EstablishingConnection;
58
+ canSendOps: false;
59
+ }
60
+ /**
61
+ * Status for an in-progress connection that is catching up to latest op state.
62
+ *
63
+ * @legacy @beta
64
+ * @sealed
65
+ */
66
+ export interface ConnectionStatusCatchingUp extends ConnectionStatusTemplate {
67
+ connectionState: ConnectionState.CatchingUp;
68
+ /**
69
+ * The ID of the client connection that is connecting.
70
+ */
71
+ pendingClientConnectionId: string;
72
+ canSendOps: false;
73
+ }
74
+ /**
75
+ * Status for a full connection.
76
+ *
77
+ * @legacy @beta
78
+ * @sealed
79
+ */
80
+ export interface ConnectionStatusConnected extends ConnectionStatusTemplate {
81
+ connectionState: ConnectionState.Connected;
82
+ /**
83
+ * The ID of the client connection that is connected.
84
+ */
85
+ clientConnectionId: string;
86
+ canSendOps: boolean;
87
+ }
88
+ /**
89
+ * Status for a disconnected connection.
90
+ *
91
+ * @legacy @beta
92
+ * @sealed
93
+ */
94
+ export interface ConnectionStatusDisconnected extends ConnectionStatusTemplate {
95
+ connectionState: ConnectionState.Disconnected;
96
+ canSendOps: false;
97
+ /**
98
+ * The ID of the client connection that was most recently connecting (catching up).
99
+ */
100
+ priorPendingClientConnectionId: string | undefined;
101
+ /**
102
+ * The ID of the client connection that was most recently connected.
103
+ */
104
+ priorConnectedClientConnectionId: string | undefined;
105
+ }
106
+ /**
107
+ * Connection status of the container.
108
+ *
109
+ * @legacy @beta
110
+ * @sealed
111
+ */
112
+ export type ConnectionStatus = ConnectionStatusEstablishingConnection | ConnectionStatusCatchingUp | ConnectionStatusConnected | ConnectionStatusDisconnected;
33
113
  /**
34
114
  * The IRuntime represents an instantiation of a code package within a Container.
35
115
  * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
@@ -41,8 +121,22 @@ export interface IRuntime extends IDisposable {
41
121
  * Notifies the runtime of a change in the connection state
42
122
  * @param canSendOps - true if the runtime is allowed to send ops
43
123
  * @param clientId - the ID of the client that is connecting or disconnecting
124
+ *
125
+ * @remarks
126
+ * This is deprecated when used with `@fluidframework/container-loader` v2.63
127
+ * and later. Implement {@link IRuntime.setConnectionStatus}. Then this method
128
+ * will not be called, when using newer container-loader.
129
+ *
130
+ * Note: when {@link IRuntime.setConnectionStatus} is implemented, there will
131
+ * not be a call exactly when Container loads as happens currently without it.
44
132
  */
45
133
  setConnectionState(canSendOps: boolean, clientId?: string): any;
134
+ /**
135
+ * Notifies the runtime of a change in the connection state.
136
+ *
137
+ * @remarks This supersedes {@link IRuntime.setConnectionState}.
138
+ */
139
+ setConnectionStatus?(status: ConnectionStatus): void;
46
140
  /**
47
141
  * Processes the given op (message)
48
142
  * @param message - delta message received from the server
@@ -104,23 +198,6 @@ export interface IBatchMessage {
104
198
  * @legacy @beta
105
199
  */
106
200
  export interface IContainerStorageService {
107
- /**
108
- * Whether or not the object has been disposed.
109
- * If true, the object should be considered invalid, and its other state should be disregarded.
110
- *
111
- * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as
112
- * it is unused in the Runtime layer.
113
- */
114
- readonly disposed?: boolean;
115
- /**
116
- * Dispose of the object and its resources.
117
- * @param error - Optional error indicating the reason for the disposal, if the object was
118
- * disposed as the result of an error.
119
- *
120
- * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as
121
- * it is unused in the Runtime layer.
122
- */
123
- dispose?(error?: Error): void;
124
201
  /**
125
202
  * Policies implemented/instructed by driver.
126
203
  *
@@ -173,14 +250,6 @@ export interface IContainerStorageService {
173
250
  * Returns the uploaded summary handle.
174
251
  */
175
252
  uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
176
- /**
177
- * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the
178
- * server has deleted it this call may result in a broken promise.
179
- *
180
- * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as
181
- * it is unused in the Runtime and below layers.
182
- */
183
- downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
184
253
  }
185
254
  /**
186
255
  * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the
@@ -231,6 +300,16 @@ export interface IContainerContext {
231
300
  readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
232
301
  readonly quorum: IQuorumClients;
233
302
  readonly audience: IAudience;
303
+ /**
304
+ * Signal-based audience provides a view of the audience that only relies
305
+ * on system signals which will be updated more quickly than
306
+ * {@link IContainerContext#audience} that relies on ops for write clients.
307
+ * Being signal-based the write members are inherently less reliable than
308
+ * {@link IContainerContext#audience}.
309
+ *
310
+ * @system
311
+ */
312
+ readonly signalAudience?: IAudience;
234
313
  readonly loader: ILoader;
235
314
  readonly taggedLogger: ITelemetryBaseLogger;
236
315
  pendingLocalState?: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,cAAc,EACd,cAAc,EACd,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACX,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,+BA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E,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,CAAC;CAC1C;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,sBAA0C,CAAC;AAE/E;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC1C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC9D;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACrF;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;;OAGG;IACH,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IAExC;;;;;;OAMG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,WAAW,CAAC;IAE/C;;;OAGG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiCH;;;;GAIG;AACH,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACtB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACtB,CAAC,EAjBW,WAAW,2BAAX,WAAW,QAiBtB;AAwSD;;GAEG;AACU,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 type {\n\tFluidObject,\n\tIDisposable,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIClientDetails,\n\tIQuorumClients,\n\tISummaryTree,\n} from \"@fluidframework/driver-definitions\";\nimport type {\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISummaryContent,\n\tIVersion,\n\tMessageType,\n\tISequencedDocumentMessage,\n\tICreateBlobResponse,\n\tISummaryContext,\n\tISnapshotFetchOptions,\n\tFetchSource,\n\tIDocumentStorageServicePolicies,\n\tISummaryHandle,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport type { IAudience } from \"./audience.js\";\nimport type { IDeltaManager } from \"./deltas.js\";\nimport type { ICriticalContainerError } from \"./error.js\";\nimport type { ConnectionState, ILoader } from \"./loader.js\";\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 * @public\n */\nexport enum AttachState {\n\t/**\n\t * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n\t * to the service.\n\t */\n\tDetached = \"Detached\",\n\n\t/**\n\t * In attaching state, the data has started the upload to the service, but has not yet completed.\n\t */\n\tAttaching = \"Attaching\",\n\n\t/**\n\t * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n\t * reaching attached state.\n\t */\n\tAttached = \"Attached\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n *\n * @legacy @beta\n */\nexport interface IRuntime extends IDisposable {\n\t/**\n\t * Notifies the runtime of a change in the connection state\n\t * @param canSendOps - true if the runtime is allowed to send ops\n\t * @param clientId - the ID of the client that is connecting or disconnecting\n\t */\n\tsetConnectionState(canSendOps: boolean, clientId?: string);\n\n\t/**\n\t * Processes the given op (message)\n\t * @param message - delta message received from the server\n\t * @param local - true if the message was originally generated by the client receiving it.\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean);\n\n\t/**\n\t * Processes the given signal\n\t */\n\t// TODO: use `unknown` instead (API breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tprocessSignal(message: any, local: boolean);\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t *\n\t * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n\t * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n\t * new storage IDs so requests can be redirected.\n\t */\n\tcreateSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n\t/**\n\t * Propagate the container state when container is attaching or attached.\n\t * @param attachState - State of the container.\n\t */\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n\t/**\n\t * Get pending local state in a serializable format to be given back to a newly loaded container\n\t */\n\tgetPendingLocalState(props?: IGetPendingLocalStateProps): unknown;\n\n\t/**\n\t * Notify runtime that we have processed a saved message, so that it can do async work (applying\n\t * stashed ops) after having processed it.\n\t */\n\tnotifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;\n\n\t/**\n\t * Exposes the entryPoint for the container runtime.\n\t * Use this as the primary way of getting access to the user-defined logic within the container runtime.\n\t *\n\t * @see {@link IContainer.getEntryPoint}\n\t */\n\tgetEntryPoint(): Promise<FluidObject>;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n * @legacy @beta\n */\nexport interface IBatchMessage {\n\tcontents?: string;\n\tmetadata?: Record<string, unknown>;\n\tcompression?: string;\n\treferenceSequenceNumber?: number;\n}\n\n/**\n * Interface to provide access to snapshots and policies to the Runtime layer. This should follow the Loader / Runtime\n * layer compatibility rules.\n *\n * @remarks It contains a subset of APIs from {@link @fluidframework/driver-definitions#IDocumentStorageService} but\n * allows the Runtime to not support layer compatibility with the Driver layer. Instead, it supports compatibility\n * with the Loader layer which it already does.\n *\n * @legacy @beta\n */\nexport interface IContainerStorageService {\n\t/**\n\t * Whether or not the object has been disposed.\n\t * If true, the object should be considered invalid, and its other state should be disregarded.\n\t *\n\t * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as\n\t * it is unused in the Runtime layer.\n\t */\n\treadonly disposed?: boolean;\n\n\t/**\n\t * Dispose of the object and its resources.\n\t * @param error - Optional error indicating the reason for the disposal, if the object was\n\t * disposed as the result of an error.\n\t *\n\t * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as\n\t * it is unused in the Runtime layer.\n\t */\n\tdispose?(error?: Error): void;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t *\n\t * @deprecated This will be removed in a future release. The Runtime layer only needs `maximumCacheDurationMs`\n\t * policy which is added as a separate property.\n\t */\n\treadonly policies?: IDocumentStorageServicePolicies | undefined;\n\n\t/**\n\t * See {@link @fluidframework/driver-definitions#IDocumentStorageServicePolicies.maximumCacheDurationMs}\n\t */\n\treadonly maximumCacheDurationMs?: IDocumentStorageServicePolicies[\"maximumCacheDurationMs\"];\n\n\t/**\n\t * Returns the snapshot tree.\n\t * @param version - Version of the snapshot to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t */\n\t// TODO: use `undefined` instead.\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tgetSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n\t/**\n\t * Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from\n\t * `getSnapshotTree` api in that, that API only returns the snapshot tree from the snapshot.\n\t * @param snapshotFetchOptions - Options specified by the caller to specify and want certain behavior from the\n\t * driver when fetching the snapshot.\n\t */\n\tgetSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;\n\n\t/**\n\t * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n\t * @param versionId - Version id of the requested version.\n\t * @param count - Number of the versions to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n\t * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n\t * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n\t * from storage.\n\t */\n\tgetVersions(\n\t\t// TODO: use `undefined` instead.\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]>;\n\n\t/**\n\t * Creates a blob out of the given buffer\n\t */\n\tcreateBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n\t/**\n\t * Reads the object with the given ID, returns content in arrayBufferLike\n\t */\n\treadBlob(id: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n\t * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n\t * referencing from the previously acked summary.\n\t * Returns the uploaded summary handle.\n\t */\n\tuploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n\t/**\n\t * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n\t * server has deleted it this call may result in a broken promise.\n\t *\n\t * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as\n\t * it is unused in the Runtime and below layers.\n\t */\n\tdownloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\n/**\n * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the\n * loader layer.\n * It gets passed into the {@link (IRuntimeFactory:interface).instantiateRuntime} call.\n *\n * @privateremarks\n * Only include members on this interface if you intend them to be consumed/called from the runtime layer.\n *\n * TODO: once `@alpha` tag is removed, `unknown` should be removed from submitSignalFn.\n * See {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}\n *\n * @legacy @beta\n */\nexport interface IContainerContext {\n\t/**\n\t * Not recommended for general use, is used in some cases to control various runtime behaviors.\n\t *\n\t * @remarks\n\t * Used to be ILoaderOptions, this is staging for eventual removal.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treadonly options: Record<string | number, any>;\n\treadonly clientId: string | undefined;\n\treadonly clientDetails: IClientDetails;\n\treadonly storage: IContainerStorageService;\n\treadonly connected: boolean;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\n\t/**\n\t * Gets the current connection state of the container.\n\t *\n\t * @remarks\n\t * This provides more detailed connection state information beyond the simple boolean `connected` property.\n\t * Available starting from version 2.52.0. Property is not present in older versions.\n\t */\n\treadonly getConnectionState?: () => ConnectionState;\n\t/**\n\t * @deprecated Please use submitBatchFn & submitSummaryFn\n\t */\n\treadonly submitFn: (\n\t\ttype: MessageType,\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tcontents: any,\n\t\tbatch: boolean,\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tappData?: any,\n\t) => number;\n\t/**\n\t * @returns clientSequenceNumber of last message in a batch\n\t */\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\treadonly submitSignalFn: (contents: unknown, targetClientId?: string) => void;\n\treadonly disposeFn?: (error?: ICriticalContainerError) => void;\n\treadonly closeFn: (error?: ICriticalContainerError) => void;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly quorum: IQuorumClients;\n\treadonly audience: IAudience;\n\treadonly loader: ILoader;\n\t// The logger implementation, which would support tagged events, should be provided by the loader.\n\treadonly taggedLogger: ITelemetryBaseLogger;\n\tpendingLocalState?: unknown;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * @param relativeUrl - A relative request within the container\n\t *\n\t * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n\t */\n\tgetAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\tgetLoadedFromVersion(): IVersion | undefined;\n\n\tupdateDirtyContainerState(dirty: boolean): void;\n\n\t/**\n\t * @deprecated This has been deprecated. It was used internally and there is no replacement.\n\t */\n\treadonly supportedFeatures?: ReadonlyMap<string, unknown>;\n\n\t/**\n\t * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n\t * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n\t * and scenarios which can change in the future.\n\t * @deprecated 2.0.0-internal.5.2.0 - The docId is already logged by the {@link IContainerContext.taggedLogger} for\n\t * telemetry purposes, so this is generally unnecessary for telemetry.\n\t * If the id is needed for other purposes it should be passed to the consumer explicitly.\n\t *\n\t * @privateremarks Tracking in AB#5714\n\t */\n\treadonly id: string;\n\n\t/**\n\t * This contains all parts of a snapshot like blobContents, ops etc.\n\t */\n\treadonly snapshotWithContents?: ISnapshot;\n}\n\n/**\n * @legacy @beta\n */\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\n/**\n * @legacy @beta\n */\nexport interface IProvideRuntimeFactory {\n\treadonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n * @legacy @beta\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n\t/**\n\t * Instantiates a new IRuntime for the given IContainerContext to proxy to\n\t * This is the main entry point to the Container's business logic\n\t *\n\t * @param context - container context to be supplied to the runtime\n\t * @param existing - whether to instantiate for the first time or from an existing context\n\t */\n\tinstantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;\n}\n\n/**\n * Defines list of properties expected for getPendingLocalState\n * @legacy @beta\n */\nexport interface IGetPendingLocalStateProps {\n\t/**\n\t * Indicates the container will close after getting the pending state. Used internally\n\t * to wait for blobs to be attached to a DDS and collect generated ops before closing.\n\t */\n\treadonly notifyImminentClosure: boolean;\n\n\t/**\n\t * Abort signal to stop waiting for blobs to get attached to a DDS. When triggered,\n\t * only blobs attached will be collected in the pending state.\n\t * Intended to be used in the very rare scenario in which getLocalPendingState go stale due\n\t * to a blob failed to be referenced. Such a blob will be lost but the rest of the state will\n\t * be preserved and collected.\n\t */\n\treadonly stopBlobAttachingSignal?: AbortSignal;\n\n\t/**\n\t * Date to be used as the starting time of a session. This date is updated in case we refresh the\n\t * base snapshot since we won't be referencing ops older than the new snapshot.\n\t */\n\treadonly sessionExpiryTimerStarted?: number;\n\n\t/**\n\t * Snapshot sequence number. It will help the runtime to know which ops should still be stashed.\n\t */\n\treadonly snapshotSequenceNumber?: number;\n}\n"]}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgCH;;;;GAIG;AACH,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACtB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACtB,CAAC,EAjBW,WAAW,2BAAX,WAAW,QAiBtB;AA+XD;;GAEG;AACU,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 type {\n\tFluidObject,\n\tIDisposable,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIClientDetails,\n\tIQuorumClients,\n\tISummaryTree,\n} from \"@fluidframework/driver-definitions\";\nimport type {\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISummaryContent,\n\tIVersion,\n\tMessageType,\n\tISequencedDocumentMessage,\n\tICreateBlobResponse,\n\tISummaryContext,\n\tISnapshotFetchOptions,\n\tFetchSource,\n\tIDocumentStorageServicePolicies,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport type { IAudience } from \"./audience.js\";\nimport type { IDeltaManager } from \"./deltas.js\";\nimport type { ICriticalContainerError } from \"./error.js\";\nimport type { ConnectionState, ILoader } from \"./loader.js\";\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 * @public\n */\nexport enum AttachState {\n\t/**\n\t * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n\t * to the service.\n\t */\n\tDetached = \"Detached\",\n\n\t/**\n\t * In attaching state, the data has started the upload to the service, but has not yet completed.\n\t */\n\tAttaching = \"Attaching\",\n\n\t/**\n\t * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n\t * reaching attached state.\n\t */\n\tAttached = \"Attached\",\n}\n\n/**\n * Defines the connection status of the container.\n *\n * @legacy @beta\n * @sealed\n */\nexport interface ConnectionStatusTemplate {\n\tconnectionState: ConnectionState;\n\t/**\n\t * True if the runtime is currently allowed to send ops.\n\t */\n\tcanSendOps: boolean;\n\t/**\n\t * True if the container is in readonly mode.\n\t */\n\treadonly: boolean;\n}\n\n/**\n * Status for an establishing connection.\n *\n * @legacy @beta\n * @sealed\n */\nexport interface ConnectionStatusEstablishingConnection extends ConnectionStatusTemplate {\n\tconnectionState: ConnectionState.EstablishingConnection;\n\tcanSendOps: false;\n}\n\n/**\n * Status for an in-progress connection that is catching up to latest op state.\n *\n * @legacy @beta\n * @sealed\n */\nexport interface ConnectionStatusCatchingUp extends ConnectionStatusTemplate {\n\tconnectionState: ConnectionState.CatchingUp;\n\t/**\n\t * The ID of the client connection that is connecting.\n\t */\n\tpendingClientConnectionId: string;\n\tcanSendOps: false;\n}\n\n/**\n * Status for a full connection.\n *\n * @legacy @beta\n * @sealed\n */\nexport interface ConnectionStatusConnected extends ConnectionStatusTemplate {\n\tconnectionState: ConnectionState.Connected;\n\t/**\n\t * The ID of the client connection that is connected.\n\t */\n\tclientConnectionId: string;\n\tcanSendOps: boolean;\n}\n\n/**\n * Status for a disconnected connection.\n *\n * @legacy @beta\n * @sealed\n */\nexport interface ConnectionStatusDisconnected extends ConnectionStatusTemplate {\n\tconnectionState: ConnectionState.Disconnected;\n\tcanSendOps: false;\n\t/**\n\t * The ID of the client connection that was most recently connecting (catching up).\n\t */\n\tpriorPendingClientConnectionId: string | undefined;\n\t/**\n\t * The ID of the client connection that was most recently connected.\n\t */\n\tpriorConnectedClientConnectionId: string | undefined;\n}\n\n/**\n * Connection status of the container.\n *\n * @legacy @beta\n * @sealed\n */\nexport type ConnectionStatus =\n\t| ConnectionStatusEstablishingConnection\n\t| ConnectionStatusCatchingUp\n\t| ConnectionStatusConnected\n\t| ConnectionStatusDisconnected;\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 *\n * @legacy @beta\n */\nexport interface IRuntime extends IDisposable {\n\t/**\n\t * Notifies the runtime of a change in the connection state\n\t * @param canSendOps - true if the runtime is allowed to send ops\n\t * @param clientId - the ID of the client that is connecting or disconnecting\n\t *\n\t * @remarks\n\t * This is deprecated when used with `@fluidframework/container-loader` v2.63\n\t * and later. Implement {@link IRuntime.setConnectionStatus}. Then this method\n\t * will not be called, when using newer container-loader.\n\t *\n\t * Note: when {@link IRuntime.setConnectionStatus} is implemented, there will\n\t * not be a call exactly when Container loads as happens currently without it.\n\t */\n\tsetConnectionState(canSendOps: boolean, clientId?: string);\n\n\t/**\n\t * Notifies the runtime of a change in the connection state.\n\t *\n\t * @remarks This supersedes {@link IRuntime.setConnectionState}.\n\t */\n\tsetConnectionStatus?(status: ConnectionStatus): void;\n\n\t/**\n\t * Processes the given op (message)\n\t * @param message - delta message received from the server\n\t * @param local - true if the message was originally generated by the client receiving it.\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean);\n\n\t/**\n\t * Processes the given signal\n\t */\n\t// TODO: use `unknown` instead (API breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tprocessSignal(message: any, local: boolean);\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t *\n\t * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n\t * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n\t * new storage IDs so requests can be redirected.\n\t */\n\tcreateSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n\t/**\n\t * Propagate the container state when container is attaching or attached.\n\t * @param attachState - State of the container.\n\t */\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n\t/**\n\t * Get pending local state in a serializable format to be given back to a newly loaded container\n\t */\n\tgetPendingLocalState(props?: IGetPendingLocalStateProps): unknown;\n\n\t/**\n\t * Notify runtime that we have processed a saved message, so that it can do async work (applying\n\t * stashed ops) after having processed it.\n\t */\n\tnotifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;\n\n\t/**\n\t * Exposes the entryPoint for the container runtime.\n\t * Use this as the primary way of getting access to the user-defined logic within the container runtime.\n\t *\n\t * @see {@link IContainer.getEntryPoint}\n\t */\n\tgetEntryPoint(): Promise<FluidObject>;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n * @legacy @beta\n */\nexport interface IBatchMessage {\n\tcontents?: string;\n\tmetadata?: Record<string, unknown>;\n\tcompression?: string;\n\treferenceSequenceNumber?: number;\n}\n\n/**\n * Interface to provide access to snapshots and policies to the Runtime layer. This should follow the Loader / Runtime\n * layer compatibility rules.\n *\n * @remarks It contains a subset of APIs from {@link @fluidframework/driver-definitions#IDocumentStorageService} but\n * allows the Runtime to not support layer compatibility with the Driver layer. Instead, it supports compatibility\n * with the Loader layer which it already does.\n *\n * @legacy @beta\n */\nexport interface IContainerStorageService {\n\t/**\n\t * Policies implemented/instructed by driver.\n\t *\n\t * @deprecated This will be removed in a future release. The Runtime layer only needs `maximumCacheDurationMs`\n\t * policy which is added as a separate property.\n\t */\n\treadonly policies?: IDocumentStorageServicePolicies | undefined;\n\n\t/**\n\t * See {@link @fluidframework/driver-definitions#IDocumentStorageServicePolicies.maximumCacheDurationMs}\n\t */\n\treadonly maximumCacheDurationMs?: IDocumentStorageServicePolicies[\"maximumCacheDurationMs\"];\n\n\t/**\n\t * Returns the snapshot tree.\n\t * @param version - Version of the snapshot to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t */\n\t// TODO: use `undefined` instead.\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tgetSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n\t/**\n\t * Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from\n\t * `getSnapshotTree` api in that, that API only returns the snapshot tree from the snapshot.\n\t * @param snapshotFetchOptions - Options specified by the caller to specify and want certain behavior from the\n\t * driver when fetching the snapshot.\n\t */\n\tgetSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;\n\n\t/**\n\t * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n\t * @param versionId - Version id of the requested version.\n\t * @param count - Number of the versions to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n\t * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n\t * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n\t * from storage.\n\t */\n\tgetVersions(\n\t\t// TODO: use `undefined` instead.\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]>;\n\n\t/**\n\t * Creates a blob out of the given buffer\n\t */\n\tcreateBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n\t/**\n\t * Reads the object with the given ID, returns content in arrayBufferLike\n\t */\n\treadBlob(id: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n\t * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n\t * referencing from the previously acked summary.\n\t * Returns the uploaded summary handle.\n\t */\n\tuploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n}\n\n/**\n * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the\n * loader layer.\n * It gets passed into the {@link (IRuntimeFactory:interface).instantiateRuntime} call.\n *\n * @privateremarks\n * Only include members on this interface if you intend them to be consumed/called from the runtime layer.\n *\n * TODO: once `@alpha` tag is removed, `unknown` should be removed from submitSignalFn.\n * See {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}\n *\n * @legacy @beta\n */\nexport interface IContainerContext {\n\t/**\n\t * Not recommended for general use, is used in some cases to control various runtime behaviors.\n\t *\n\t * @remarks\n\t * Used to be ILoaderOptions, this is staging for eventual removal.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treadonly options: Record<string | number, any>;\n\treadonly clientId: string | undefined;\n\treadonly clientDetails: IClientDetails;\n\treadonly storage: IContainerStorageService;\n\treadonly connected: boolean;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\n\t/**\n\t * Gets the current connection state of the container.\n\t *\n\t * @remarks\n\t * This provides more detailed connection state information beyond the simple boolean `connected` property.\n\t * Available starting from version 2.52.0. Property is not present in older versions.\n\t */\n\treadonly getConnectionState?: () => ConnectionState;\n\t/**\n\t * @deprecated Please use submitBatchFn & submitSummaryFn\n\t */\n\treadonly submitFn: (\n\t\ttype: MessageType,\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tcontents: any,\n\t\tbatch: boolean,\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tappData?: any,\n\t) => number;\n\t/**\n\t * @returns clientSequenceNumber of last message in a batch\n\t */\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\treadonly submitSignalFn: (contents: unknown, targetClientId?: string) => void;\n\treadonly disposeFn?: (error?: ICriticalContainerError) => void;\n\treadonly closeFn: (error?: ICriticalContainerError) => void;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly quorum: IQuorumClients;\n\treadonly audience: IAudience;\n\t/**\n\t * Signal-based audience provides a view of the audience that only relies\n\t * on system signals which will be updated more quickly than\n\t * {@link IContainerContext#audience} that relies on ops for write clients.\n\t * Being signal-based the write members are inherently less reliable than\n\t * {@link IContainerContext#audience}.\n\t *\n\t * @system\n\t */\n\treadonly signalAudience?: IAudience;\n\treadonly loader: ILoader;\n\t// The logger implementation, which would support tagged events, should be provided by the loader.\n\treadonly taggedLogger: ITelemetryBaseLogger;\n\tpendingLocalState?: unknown;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * @param relativeUrl - A relative request within the container\n\t *\n\t * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n\t */\n\tgetAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\tgetLoadedFromVersion(): IVersion | undefined;\n\n\tupdateDirtyContainerState(dirty: boolean): void;\n\n\t/**\n\t * @deprecated This has been deprecated. It was used internally and there is no replacement.\n\t */\n\treadonly supportedFeatures?: ReadonlyMap<string, unknown>;\n\n\t/**\n\t * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n\t * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n\t * and scenarios which can change in the future.\n\t * @deprecated 2.0.0-internal.5.2.0 - The docId is already logged by the {@link IContainerContext.taggedLogger} for\n\t * telemetry purposes, so this is generally unnecessary for telemetry.\n\t * If the id is needed for other purposes it should be passed to the consumer explicitly.\n\t *\n\t * @privateremarks Tracking in AB#5714\n\t */\n\treadonly id: string;\n\n\t/**\n\t * This contains all parts of a snapshot like blobContents, ops etc.\n\t */\n\treadonly snapshotWithContents?: ISnapshot;\n}\n\n/**\n * @legacy @beta\n */\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\n/**\n * @legacy @beta\n */\nexport interface IProvideRuntimeFactory {\n\treadonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n * @legacy @beta\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n\t/**\n\t * Instantiates a new IRuntime for the given IContainerContext to proxy to\n\t * This is the main entry point to the Container's business logic\n\t *\n\t * @param context - container context to be supplied to the runtime\n\t * @param existing - whether to instantiate for the first time or from an existing context\n\t */\n\tinstantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;\n}\n\n/**\n * Defines list of properties expected for getPendingLocalState\n * @legacy @beta\n */\nexport interface IGetPendingLocalStateProps {\n\t/**\n\t * Indicates the container will close after getting the pending state. Used internally\n\t * to wait for blobs to be attached to a DDS and collect generated ops before closing.\n\t */\n\treadonly notifyImminentClosure: boolean;\n\n\t/**\n\t * Abort signal to stop waiting for blobs to get attached to a DDS. When triggered,\n\t * only blobs attached will be collected in the pending state.\n\t * Intended to be used in the very rare scenario in which getLocalPendingState go stale due\n\t * to a blob failed to be referenced. Such a blob will be lost but the rest of the state will\n\t * be preserved and collected.\n\t */\n\treadonly stopBlobAttachingSignal?: AbortSignal;\n\n\t/**\n\t * Date to be used as the starting time of a session. This date is updated in case we refresh the\n\t * base snapshot since we won't be referencing ops older than the new snapshot.\n\t */\n\treadonly sessionExpiryTimerStarted?: number;\n\n\t/**\n\t * Snapshot sequence number. It will help the runtime to know which ops should still be stashed.\n\t */\n\treadonly snapshotSequenceNumber?: number;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -19,7 +19,7 @@ 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
- export type { IBatchMessage, IContainerContext, IProvideRuntimeFactory, IRuntime, IGetPendingLocalStateProps, } from "./runtime.js";
22
+ export type { ConnectionStatus, ConnectionStatusCatchingUp, ConnectionStatusConnected, ConnectionStatusDisconnected, ConnectionStatusEstablishingConnection, ConnectionStatusTemplate, IBatchMessage, IContainerContext, IProvideRuntimeFactory, IRuntime, IGetPendingLocalStateProps, } from "./runtime.js";
23
23
  export { AttachState, IRuntimeFactory, type IContainerStorageService } from "./runtime.js";
24
24
  export type {
25
25
  /**
@@ -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,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,EACl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,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,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EACzB,4BAA4B,EAC5B,sCAAsC,EACtC,wBAAwB,EACxB,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/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAW5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAiBjD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAS5D,OAAO,EACN,yBAAyB,EACzB,cAAc,EACd,kBAAkB,GAClB,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAiC,MAAM,cAAc,CAAC","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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAW5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAiBjD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAS5D,OAAO,EACN,yBAAyB,EACzB,cAAc,EACd,kBAAkB,GAClB,MAAM,mBAAmB,CAAC;AAc3B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAiC,MAAM,cAAc,CAAC","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\tConnectionStatus,\n\tConnectionStatusCatchingUp,\n\tConnectionStatusConnected,\n\tConnectionStatusDisconnected,\n\tConnectionStatusEstablishingConnection,\n\tConnectionStatusTemplate,\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/lib/legacy.d.ts CHANGED
@@ -26,6 +26,12 @@ export {
26
26
  // #endregion
27
27
 
28
28
  // #region @legacyBeta APIs
29
+ ConnectionStatus,
30
+ ConnectionStatusCatchingUp,
31
+ ConnectionStatusConnected,
32
+ ConnectionStatusDisconnected,
33
+ ConnectionStatusEstablishingConnection,
34
+ ConnectionStatusTemplate,
29
35
  ContainerErrorTypes,
30
36
  ContainerWarning,
31
37
  IAudienceOwner,
package/lib/runtime.d.ts CHANGED
@@ -4,7 +4,7 @@
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 { ISnapshot, IDocumentMessage, ISnapshotTree, ISummaryContent, IVersion, MessageType, ISequencedDocumentMessage, ICreateBlobResponse, ISummaryContext, ISnapshotFetchOptions, FetchSource, IDocumentStorageServicePolicies, ISummaryHandle } from "@fluidframework/driver-definitions/internal";
7
+ import type { ISnapshot, IDocumentMessage, ISnapshotTree, ISummaryContent, IVersion, MessageType, ISequencedDocumentMessage, ICreateBlobResponse, ISummaryContext, ISnapshotFetchOptions, FetchSource, IDocumentStorageServicePolicies } 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";
@@ -30,6 +30,86 @@ export declare enum AttachState {
30
30
  */
31
31
  Attached = "Attached"
32
32
  }
33
+ /**
34
+ * Defines the connection status of the container.
35
+ *
36
+ * @legacy @beta
37
+ * @sealed
38
+ */
39
+ export interface ConnectionStatusTemplate {
40
+ connectionState: ConnectionState;
41
+ /**
42
+ * True if the runtime is currently allowed to send ops.
43
+ */
44
+ canSendOps: boolean;
45
+ /**
46
+ * True if the container is in readonly mode.
47
+ */
48
+ readonly: boolean;
49
+ }
50
+ /**
51
+ * Status for an establishing connection.
52
+ *
53
+ * @legacy @beta
54
+ * @sealed
55
+ */
56
+ export interface ConnectionStatusEstablishingConnection extends ConnectionStatusTemplate {
57
+ connectionState: ConnectionState.EstablishingConnection;
58
+ canSendOps: false;
59
+ }
60
+ /**
61
+ * Status for an in-progress connection that is catching up to latest op state.
62
+ *
63
+ * @legacy @beta
64
+ * @sealed
65
+ */
66
+ export interface ConnectionStatusCatchingUp extends ConnectionStatusTemplate {
67
+ connectionState: ConnectionState.CatchingUp;
68
+ /**
69
+ * The ID of the client connection that is connecting.
70
+ */
71
+ pendingClientConnectionId: string;
72
+ canSendOps: false;
73
+ }
74
+ /**
75
+ * Status for a full connection.
76
+ *
77
+ * @legacy @beta
78
+ * @sealed
79
+ */
80
+ export interface ConnectionStatusConnected extends ConnectionStatusTemplate {
81
+ connectionState: ConnectionState.Connected;
82
+ /**
83
+ * The ID of the client connection that is connected.
84
+ */
85
+ clientConnectionId: string;
86
+ canSendOps: boolean;
87
+ }
88
+ /**
89
+ * Status for a disconnected connection.
90
+ *
91
+ * @legacy @beta
92
+ * @sealed
93
+ */
94
+ export interface ConnectionStatusDisconnected extends ConnectionStatusTemplate {
95
+ connectionState: ConnectionState.Disconnected;
96
+ canSendOps: false;
97
+ /**
98
+ * The ID of the client connection that was most recently connecting (catching up).
99
+ */
100
+ priorPendingClientConnectionId: string | undefined;
101
+ /**
102
+ * The ID of the client connection that was most recently connected.
103
+ */
104
+ priorConnectedClientConnectionId: string | undefined;
105
+ }
106
+ /**
107
+ * Connection status of the container.
108
+ *
109
+ * @legacy @beta
110
+ * @sealed
111
+ */
112
+ export type ConnectionStatus = ConnectionStatusEstablishingConnection | ConnectionStatusCatchingUp | ConnectionStatusConnected | ConnectionStatusDisconnected;
33
113
  /**
34
114
  * The IRuntime represents an instantiation of a code package within a Container.
35
115
  * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
@@ -41,8 +121,22 @@ export interface IRuntime extends IDisposable {
41
121
  * Notifies the runtime of a change in the connection state
42
122
  * @param canSendOps - true if the runtime is allowed to send ops
43
123
  * @param clientId - the ID of the client that is connecting or disconnecting
124
+ *
125
+ * @remarks
126
+ * This is deprecated when used with `@fluidframework/container-loader` v2.63
127
+ * and later. Implement {@link IRuntime.setConnectionStatus}. Then this method
128
+ * will not be called, when using newer container-loader.
129
+ *
130
+ * Note: when {@link IRuntime.setConnectionStatus} is implemented, there will
131
+ * not be a call exactly when Container loads as happens currently without it.
44
132
  */
45
133
  setConnectionState(canSendOps: boolean, clientId?: string): any;
134
+ /**
135
+ * Notifies the runtime of a change in the connection state.
136
+ *
137
+ * @remarks This supersedes {@link IRuntime.setConnectionState}.
138
+ */
139
+ setConnectionStatus?(status: ConnectionStatus): void;
46
140
  /**
47
141
  * Processes the given op (message)
48
142
  * @param message - delta message received from the server
@@ -104,23 +198,6 @@ export interface IBatchMessage {
104
198
  * @legacy @beta
105
199
  */
106
200
  export interface IContainerStorageService {
107
- /**
108
- * Whether or not the object has been disposed.
109
- * If true, the object should be considered invalid, and its other state should be disregarded.
110
- *
111
- * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as
112
- * it is unused in the Runtime layer.
113
- */
114
- readonly disposed?: boolean;
115
- /**
116
- * Dispose of the object and its resources.
117
- * @param error - Optional error indicating the reason for the disposal, if the object was
118
- * disposed as the result of an error.
119
- *
120
- * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as
121
- * it is unused in the Runtime layer.
122
- */
123
- dispose?(error?: Error): void;
124
201
  /**
125
202
  * Policies implemented/instructed by driver.
126
203
  *
@@ -173,14 +250,6 @@ export interface IContainerStorageService {
173
250
  * Returns the uploaded summary handle.
174
251
  */
175
252
  uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
176
- /**
177
- * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the
178
- * server has deleted it this call may result in a broken promise.
179
- *
180
- * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as
181
- * it is unused in the Runtime and below layers.
182
- */
183
- downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
184
253
  }
185
254
  /**
186
255
  * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the
@@ -231,6 +300,16 @@ export interface IContainerContext {
231
300
  readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
232
301
  readonly quorum: IQuorumClients;
233
302
  readonly audience: IAudience;
303
+ /**
304
+ * Signal-based audience provides a view of the audience that only relies
305
+ * on system signals which will be updated more quickly than
306
+ * {@link IContainerContext#audience} that relies on ops for write clients.
307
+ * Being signal-based the write members are inherently less reliable than
308
+ * {@link IContainerContext#audience}.
309
+ *
310
+ * @system
311
+ */
312
+ readonly signalAudience?: IAudience;
234
313
  readonly loader: ILoader;
235
314
  readonly taggedLogger: ITelemetryBaseLogger;
236
315
  pendingLocalState?: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,cAAc,EACd,cAAc,EACd,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACX,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,+BAA+B,EAC/B,cAAc,EACd,MAAM,6CAA6C,CAAC;AAErD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;GAIG;AACH,oBAAY,WAAW;IACtB;;;OAGG;IACH,QAAQ,aAAa;IAErB;;OAEG;IACH,SAAS,cAAc;IAEvB;;;OAGG;IAC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AAC,QAAQ,CAAC,CAAC;CACrF;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;;OAGG;IACH,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IAExC;;;;;;OAMG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,WAAW,CAAC;IAE/C;;;OAGG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACtB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACtB,CAAC,EAjBW,WAAW,KAAX,WAAW,QAiBtB;AAwSD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tFluidObject,\n\tIDisposable,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIClientDetails,\n\tIQuorumClients,\n\tISummaryTree,\n} from \"@fluidframework/driver-definitions\";\nimport type {\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISummaryContent,\n\tIVersion,\n\tMessageType,\n\tISequencedDocumentMessage,\n\tICreateBlobResponse,\n\tISummaryContext,\n\tISnapshotFetchOptions,\n\tFetchSource,\n\tIDocumentStorageServicePolicies,\n\tISummaryHandle,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport type { IAudience } from \"./audience.js\";\nimport type { IDeltaManager } from \"./deltas.js\";\nimport type { ICriticalContainerError } from \"./error.js\";\nimport type { ConnectionState, ILoader } from \"./loader.js\";\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 * @public\n */\nexport enum AttachState {\n\t/**\n\t * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n\t * to the service.\n\t */\n\tDetached = \"Detached\",\n\n\t/**\n\t * In attaching state, the data has started the upload to the service, but has not yet completed.\n\t */\n\tAttaching = \"Attaching\",\n\n\t/**\n\t * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n\t * reaching attached state.\n\t */\n\tAttached = \"Attached\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n *\n * @legacy @beta\n */\nexport interface IRuntime extends IDisposable {\n\t/**\n\t * Notifies the runtime of a change in the connection state\n\t * @param canSendOps - true if the runtime is allowed to send ops\n\t * @param clientId - the ID of the client that is connecting or disconnecting\n\t */\n\tsetConnectionState(canSendOps: boolean, clientId?: string);\n\n\t/**\n\t * Processes the given op (message)\n\t * @param message - delta message received from the server\n\t * @param local - true if the message was originally generated by the client receiving it.\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean);\n\n\t/**\n\t * Processes the given signal\n\t */\n\t// TODO: use `unknown` instead (API breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tprocessSignal(message: any, local: boolean);\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t *\n\t * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n\t * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n\t * new storage IDs so requests can be redirected.\n\t */\n\tcreateSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n\t/**\n\t * Propagate the container state when container is attaching or attached.\n\t * @param attachState - State of the container.\n\t */\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n\t/**\n\t * Get pending local state in a serializable format to be given back to a newly loaded container\n\t */\n\tgetPendingLocalState(props?: IGetPendingLocalStateProps): unknown;\n\n\t/**\n\t * Notify runtime that we have processed a saved message, so that it can do async work (applying\n\t * stashed ops) after having processed it.\n\t */\n\tnotifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;\n\n\t/**\n\t * Exposes the entryPoint for the container runtime.\n\t * Use this as the primary way of getting access to the user-defined logic within the container runtime.\n\t *\n\t * @see {@link IContainer.getEntryPoint}\n\t */\n\tgetEntryPoint(): Promise<FluidObject>;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n * @legacy @beta\n */\nexport interface IBatchMessage {\n\tcontents?: string;\n\tmetadata?: Record<string, unknown>;\n\tcompression?: string;\n\treferenceSequenceNumber?: number;\n}\n\n/**\n * Interface to provide access to snapshots and policies to the Runtime layer. This should follow the Loader / Runtime\n * layer compatibility rules.\n *\n * @remarks It contains a subset of APIs from {@link @fluidframework/driver-definitions#IDocumentStorageService} but\n * allows the Runtime to not support layer compatibility with the Driver layer. Instead, it supports compatibility\n * with the Loader layer which it already does.\n *\n * @legacy @beta\n */\nexport interface IContainerStorageService {\n\t/**\n\t * Whether or not the object has been disposed.\n\t * If true, the object should be considered invalid, and its other state should be disregarded.\n\t *\n\t * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as\n\t * it is unused in the Runtime layer.\n\t */\n\treadonly disposed?: boolean;\n\n\t/**\n\t * Dispose of the object and its resources.\n\t * @param error - Optional error indicating the reason for the disposal, if the object was\n\t * disposed as the result of an error.\n\t *\n\t * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as\n\t * it is unused in the Runtime layer.\n\t */\n\tdispose?(error?: Error): void;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t *\n\t * @deprecated This will be removed in a future release. The Runtime layer only needs `maximumCacheDurationMs`\n\t * policy which is added as a separate property.\n\t */\n\treadonly policies?: IDocumentStorageServicePolicies | undefined;\n\n\t/**\n\t * See {@link @fluidframework/driver-definitions#IDocumentStorageServicePolicies.maximumCacheDurationMs}\n\t */\n\treadonly maximumCacheDurationMs?: IDocumentStorageServicePolicies[\"maximumCacheDurationMs\"];\n\n\t/**\n\t * Returns the snapshot tree.\n\t * @param version - Version of the snapshot to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t */\n\t// TODO: use `undefined` instead.\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tgetSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n\t/**\n\t * Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from\n\t * `getSnapshotTree` api in that, that API only returns the snapshot tree from the snapshot.\n\t * @param snapshotFetchOptions - Options specified by the caller to specify and want certain behavior from the\n\t * driver when fetching the snapshot.\n\t */\n\tgetSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;\n\n\t/**\n\t * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n\t * @param versionId - Version id of the requested version.\n\t * @param count - Number of the versions to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n\t * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n\t * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n\t * from storage.\n\t */\n\tgetVersions(\n\t\t// TODO: use `undefined` instead.\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]>;\n\n\t/**\n\t * Creates a blob out of the given buffer\n\t */\n\tcreateBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n\t/**\n\t * Reads the object with the given ID, returns content in arrayBufferLike\n\t */\n\treadBlob(id: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n\t * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n\t * referencing from the previously acked summary.\n\t * Returns the uploaded summary handle.\n\t */\n\tuploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n\t/**\n\t * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n\t * server has deleted it this call may result in a broken promise.\n\t *\n\t * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as\n\t * it is unused in the Runtime and below layers.\n\t */\n\tdownloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\n/**\n * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the\n * loader layer.\n * It gets passed into the {@link (IRuntimeFactory:interface).instantiateRuntime} call.\n *\n * @privateremarks\n * Only include members on this interface if you intend them to be consumed/called from the runtime layer.\n *\n * TODO: once `@alpha` tag is removed, `unknown` should be removed from submitSignalFn.\n * See {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}\n *\n * @legacy @beta\n */\nexport interface IContainerContext {\n\t/**\n\t * Not recommended for general use, is used in some cases to control various runtime behaviors.\n\t *\n\t * @remarks\n\t * Used to be ILoaderOptions, this is staging for eventual removal.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treadonly options: Record<string | number, any>;\n\treadonly clientId: string | undefined;\n\treadonly clientDetails: IClientDetails;\n\treadonly storage: IContainerStorageService;\n\treadonly connected: boolean;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\n\t/**\n\t * Gets the current connection state of the container.\n\t *\n\t * @remarks\n\t * This provides more detailed connection state information beyond the simple boolean `connected` property.\n\t * Available starting from version 2.52.0. Property is not present in older versions.\n\t */\n\treadonly getConnectionState?: () => ConnectionState;\n\t/**\n\t * @deprecated Please use submitBatchFn & submitSummaryFn\n\t */\n\treadonly submitFn: (\n\t\ttype: MessageType,\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tcontents: any,\n\t\tbatch: boolean,\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tappData?: any,\n\t) => number;\n\t/**\n\t * @returns clientSequenceNumber of last message in a batch\n\t */\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\treadonly submitSignalFn: (contents: unknown, targetClientId?: string) => void;\n\treadonly disposeFn?: (error?: ICriticalContainerError) => void;\n\treadonly closeFn: (error?: ICriticalContainerError) => void;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly quorum: IQuorumClients;\n\treadonly audience: IAudience;\n\treadonly loader: ILoader;\n\t// The logger implementation, which would support tagged events, should be provided by the loader.\n\treadonly taggedLogger: ITelemetryBaseLogger;\n\tpendingLocalState?: unknown;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * @param relativeUrl - A relative request within the container\n\t *\n\t * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n\t */\n\tgetAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\tgetLoadedFromVersion(): IVersion | undefined;\n\n\tupdateDirtyContainerState(dirty: boolean): void;\n\n\t/**\n\t * @deprecated This has been deprecated. It was used internally and there is no replacement.\n\t */\n\treadonly supportedFeatures?: ReadonlyMap<string, unknown>;\n\n\t/**\n\t * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n\t * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n\t * and scenarios which can change in the future.\n\t * @deprecated 2.0.0-internal.5.2.0 - The docId is already logged by the {@link IContainerContext.taggedLogger} for\n\t * telemetry purposes, so this is generally unnecessary for telemetry.\n\t * If the id is needed for other purposes it should be passed to the consumer explicitly.\n\t *\n\t * @privateremarks Tracking in AB#5714\n\t */\n\treadonly id: string;\n\n\t/**\n\t * This contains all parts of a snapshot like blobContents, ops etc.\n\t */\n\treadonly snapshotWithContents?: ISnapshot;\n}\n\n/**\n * @legacy @beta\n */\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\n/**\n * @legacy @beta\n */\nexport interface IProvideRuntimeFactory {\n\treadonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n * @legacy @beta\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n\t/**\n\t * Instantiates a new IRuntime for the given IContainerContext to proxy to\n\t * This is the main entry point to the Container's business logic\n\t *\n\t * @param context - container context to be supplied to the runtime\n\t * @param existing - whether to instantiate for the first time or from an existing context\n\t */\n\tinstantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;\n}\n\n/**\n * Defines list of properties expected for getPendingLocalState\n * @legacy @beta\n */\nexport interface IGetPendingLocalStateProps {\n\t/**\n\t * Indicates the container will close after getting the pending state. Used internally\n\t * to wait for blobs to be attached to a DDS and collect generated ops before closing.\n\t */\n\treadonly notifyImminentClosure: boolean;\n\n\t/**\n\t * Abort signal to stop waiting for blobs to get attached to a DDS. When triggered,\n\t * only blobs attached will be collected in the pending state.\n\t * Intended to be used in the very rare scenario in which getLocalPendingState go stale due\n\t * to a blob failed to be referenced. Such a blob will be lost but the rest of the state will\n\t * be preserved and collected.\n\t */\n\treadonly stopBlobAttachingSignal?: AbortSignal;\n\n\t/**\n\t * Date to be used as the starting time of a session. This date is updated in case we refresh the\n\t * base snapshot since we won't be referencing ops older than the new snapshot.\n\t */\n\treadonly sessionExpiryTimerStarted?: number;\n\n\t/**\n\t * Snapshot sequence number. It will help the runtime to know which ops should still be stashed.\n\t */\n\treadonly snapshotSequenceNumber?: number;\n}\n"]}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgCH;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACtB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACtB,CAAC,EAjBW,WAAW,KAAX,WAAW,QAiBtB;AA+XD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tFluidObject,\n\tIDisposable,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIClientDetails,\n\tIQuorumClients,\n\tISummaryTree,\n} from \"@fluidframework/driver-definitions\";\nimport type {\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISummaryContent,\n\tIVersion,\n\tMessageType,\n\tISequencedDocumentMessage,\n\tICreateBlobResponse,\n\tISummaryContext,\n\tISnapshotFetchOptions,\n\tFetchSource,\n\tIDocumentStorageServicePolicies,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport type { IAudience } from \"./audience.js\";\nimport type { IDeltaManager } from \"./deltas.js\";\nimport type { ICriticalContainerError } from \"./error.js\";\nimport type { ConnectionState, ILoader } from \"./loader.js\";\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 * @public\n */\nexport enum AttachState {\n\t/**\n\t * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n\t * to the service.\n\t */\n\tDetached = \"Detached\",\n\n\t/**\n\t * In attaching state, the data has started the upload to the service, but has not yet completed.\n\t */\n\tAttaching = \"Attaching\",\n\n\t/**\n\t * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n\t * reaching attached state.\n\t */\n\tAttached = \"Attached\",\n}\n\n/**\n * Defines the connection status of the container.\n *\n * @legacy @beta\n * @sealed\n */\nexport interface ConnectionStatusTemplate {\n\tconnectionState: ConnectionState;\n\t/**\n\t * True if the runtime is currently allowed to send ops.\n\t */\n\tcanSendOps: boolean;\n\t/**\n\t * True if the container is in readonly mode.\n\t */\n\treadonly: boolean;\n}\n\n/**\n * Status for an establishing connection.\n *\n * @legacy @beta\n * @sealed\n */\nexport interface ConnectionStatusEstablishingConnection extends ConnectionStatusTemplate {\n\tconnectionState: ConnectionState.EstablishingConnection;\n\tcanSendOps: false;\n}\n\n/**\n * Status for an in-progress connection that is catching up to latest op state.\n *\n * @legacy @beta\n * @sealed\n */\nexport interface ConnectionStatusCatchingUp extends ConnectionStatusTemplate {\n\tconnectionState: ConnectionState.CatchingUp;\n\t/**\n\t * The ID of the client connection that is connecting.\n\t */\n\tpendingClientConnectionId: string;\n\tcanSendOps: false;\n}\n\n/**\n * Status for a full connection.\n *\n * @legacy @beta\n * @sealed\n */\nexport interface ConnectionStatusConnected extends ConnectionStatusTemplate {\n\tconnectionState: ConnectionState.Connected;\n\t/**\n\t * The ID of the client connection that is connected.\n\t */\n\tclientConnectionId: string;\n\tcanSendOps: boolean;\n}\n\n/**\n * Status for a disconnected connection.\n *\n * @legacy @beta\n * @sealed\n */\nexport interface ConnectionStatusDisconnected extends ConnectionStatusTemplate {\n\tconnectionState: ConnectionState.Disconnected;\n\tcanSendOps: false;\n\t/**\n\t * The ID of the client connection that was most recently connecting (catching up).\n\t */\n\tpriorPendingClientConnectionId: string | undefined;\n\t/**\n\t * The ID of the client connection that was most recently connected.\n\t */\n\tpriorConnectedClientConnectionId: string | undefined;\n}\n\n/**\n * Connection status of the container.\n *\n * @legacy @beta\n * @sealed\n */\nexport type ConnectionStatus =\n\t| ConnectionStatusEstablishingConnection\n\t| ConnectionStatusCatchingUp\n\t| ConnectionStatusConnected\n\t| ConnectionStatusDisconnected;\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 *\n * @legacy @beta\n */\nexport interface IRuntime extends IDisposable {\n\t/**\n\t * Notifies the runtime of a change in the connection state\n\t * @param canSendOps - true if the runtime is allowed to send ops\n\t * @param clientId - the ID of the client that is connecting or disconnecting\n\t *\n\t * @remarks\n\t * This is deprecated when used with `@fluidframework/container-loader` v2.63\n\t * and later. Implement {@link IRuntime.setConnectionStatus}. Then this method\n\t * will not be called, when using newer container-loader.\n\t *\n\t * Note: when {@link IRuntime.setConnectionStatus} is implemented, there will\n\t * not be a call exactly when Container loads as happens currently without it.\n\t */\n\tsetConnectionState(canSendOps: boolean, clientId?: string);\n\n\t/**\n\t * Notifies the runtime of a change in the connection state.\n\t *\n\t * @remarks This supersedes {@link IRuntime.setConnectionState}.\n\t */\n\tsetConnectionStatus?(status: ConnectionStatus): void;\n\n\t/**\n\t * Processes the given op (message)\n\t * @param message - delta message received from the server\n\t * @param local - true if the message was originally generated by the client receiving it.\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean);\n\n\t/**\n\t * Processes the given signal\n\t */\n\t// TODO: use `unknown` instead (API breaking)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tprocessSignal(message: any, local: boolean);\n\n\t/**\n\t * Create a summary. Used when attaching or serializing a detached container.\n\t *\n\t * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n\t * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n\t * new storage IDs so requests can be redirected.\n\t */\n\tcreateSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n\t/**\n\t * Propagate the container state when container is attaching or attached.\n\t * @param attachState - State of the container.\n\t */\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n\t/**\n\t * Get pending local state in a serializable format to be given back to a newly loaded container\n\t */\n\tgetPendingLocalState(props?: IGetPendingLocalStateProps): unknown;\n\n\t/**\n\t * Notify runtime that we have processed a saved message, so that it can do async work (applying\n\t * stashed ops) after having processed it.\n\t */\n\tnotifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;\n\n\t/**\n\t * Exposes the entryPoint for the container runtime.\n\t * Use this as the primary way of getting access to the user-defined logic within the container runtime.\n\t *\n\t * @see {@link IContainer.getEntryPoint}\n\t */\n\tgetEntryPoint(): Promise<FluidObject>;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n * @legacy @beta\n */\nexport interface IBatchMessage {\n\tcontents?: string;\n\tmetadata?: Record<string, unknown>;\n\tcompression?: string;\n\treferenceSequenceNumber?: number;\n}\n\n/**\n * Interface to provide access to snapshots and policies to the Runtime layer. This should follow the Loader / Runtime\n * layer compatibility rules.\n *\n * @remarks It contains a subset of APIs from {@link @fluidframework/driver-definitions#IDocumentStorageService} but\n * allows the Runtime to not support layer compatibility with the Driver layer. Instead, it supports compatibility\n * with the Loader layer which it already does.\n *\n * @legacy @beta\n */\nexport interface IContainerStorageService {\n\t/**\n\t * Policies implemented/instructed by driver.\n\t *\n\t * @deprecated This will be removed in a future release. The Runtime layer only needs `maximumCacheDurationMs`\n\t * policy which is added as a separate property.\n\t */\n\treadonly policies?: IDocumentStorageServicePolicies | undefined;\n\n\t/**\n\t * See {@link @fluidframework/driver-definitions#IDocumentStorageServicePolicies.maximumCacheDurationMs}\n\t */\n\treadonly maximumCacheDurationMs?: IDocumentStorageServicePolicies[\"maximumCacheDurationMs\"];\n\n\t/**\n\t * Returns the snapshot tree.\n\t * @param version - Version of the snapshot to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t */\n\t// TODO: use `undefined` instead.\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tgetSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n\t/**\n\t * Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from\n\t * `getSnapshotTree` api in that, that API only returns the snapshot tree from the snapshot.\n\t * @param snapshotFetchOptions - Options specified by the caller to specify and want certain behavior from the\n\t * driver when fetching the snapshot.\n\t */\n\tgetSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;\n\n\t/**\n\t * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n\t * @param versionId - Version id of the requested version.\n\t * @param count - Number of the versions to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n\t * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n\t * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n\t * from storage.\n\t */\n\tgetVersions(\n\t\t// TODO: use `undefined` instead.\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]>;\n\n\t/**\n\t * Creates a blob out of the given buffer\n\t */\n\tcreateBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n\t/**\n\t * Reads the object with the given ID, returns content in arrayBufferLike\n\t */\n\treadBlob(id: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n\t * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n\t * referencing from the previously acked summary.\n\t * Returns the uploaded summary handle.\n\t */\n\tuploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n}\n\n/**\n * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the\n * loader layer.\n * It gets passed into the {@link (IRuntimeFactory:interface).instantiateRuntime} call.\n *\n * @privateremarks\n * Only include members on this interface if you intend them to be consumed/called from the runtime layer.\n *\n * TODO: once `@alpha` tag is removed, `unknown` should be removed from submitSignalFn.\n * See {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}\n *\n * @legacy @beta\n */\nexport interface IContainerContext {\n\t/**\n\t * Not recommended for general use, is used in some cases to control various runtime behaviors.\n\t *\n\t * @remarks\n\t * Used to be ILoaderOptions, this is staging for eventual removal.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treadonly options: Record<string | number, any>;\n\treadonly clientId: string | undefined;\n\treadonly clientDetails: IClientDetails;\n\treadonly storage: IContainerStorageService;\n\treadonly connected: boolean;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\n\t/**\n\t * Gets the current connection state of the container.\n\t *\n\t * @remarks\n\t * This provides more detailed connection state information beyond the simple boolean `connected` property.\n\t * Available starting from version 2.52.0. Property is not present in older versions.\n\t */\n\treadonly getConnectionState?: () => ConnectionState;\n\t/**\n\t * @deprecated Please use submitBatchFn & submitSummaryFn\n\t */\n\treadonly submitFn: (\n\t\ttype: MessageType,\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tcontents: any,\n\t\tbatch: boolean,\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tappData?: any,\n\t) => number;\n\t/**\n\t * @returns clientSequenceNumber of last message in a batch\n\t */\n\treadonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;\n\treadonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\treadonly submitSignalFn: (contents: unknown, targetClientId?: string) => void;\n\treadonly disposeFn?: (error?: ICriticalContainerError) => void;\n\treadonly closeFn: (error?: ICriticalContainerError) => void;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly quorum: IQuorumClients;\n\treadonly audience: IAudience;\n\t/**\n\t * Signal-based audience provides a view of the audience that only relies\n\t * on system signals which will be updated more quickly than\n\t * {@link IContainerContext#audience} that relies on ops for write clients.\n\t * Being signal-based the write members are inherently less reliable than\n\t * {@link IContainerContext#audience}.\n\t *\n\t * @system\n\t */\n\treadonly signalAudience?: IAudience;\n\treadonly loader: ILoader;\n\t// The logger implementation, which would support tagged events, should be provided by the loader.\n\treadonly taggedLogger: ITelemetryBaseLogger;\n\tpendingLocalState?: unknown;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * @param relativeUrl - A relative request within the container\n\t *\n\t * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n\t */\n\tgetAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\tgetLoadedFromVersion(): IVersion | undefined;\n\n\tupdateDirtyContainerState(dirty: boolean): void;\n\n\t/**\n\t * @deprecated This has been deprecated. It was used internally and there is no replacement.\n\t */\n\treadonly supportedFeatures?: ReadonlyMap<string, unknown>;\n\n\t/**\n\t * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n\t * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n\t * and scenarios which can change in the future.\n\t * @deprecated 2.0.0-internal.5.2.0 - The docId is already logged by the {@link IContainerContext.taggedLogger} for\n\t * telemetry purposes, so this is generally unnecessary for telemetry.\n\t * If the id is needed for other purposes it should be passed to the consumer explicitly.\n\t *\n\t * @privateremarks Tracking in AB#5714\n\t */\n\treadonly id: string;\n\n\t/**\n\t * This contains all parts of a snapshot like blobContents, ops etc.\n\t */\n\treadonly snapshotWithContents?: ISnapshot;\n}\n\n/**\n * @legacy @beta\n */\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\n/**\n * @legacy @beta\n */\nexport interface IProvideRuntimeFactory {\n\treadonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n * @legacy @beta\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n\t/**\n\t * Instantiates a new IRuntime for the given IContainerContext to proxy to\n\t * This is the main entry point to the Container's business logic\n\t *\n\t * @param context - container context to be supplied to the runtime\n\t * @param existing - whether to instantiate for the first time or from an existing context\n\t */\n\tinstantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;\n}\n\n/**\n * Defines list of properties expected for getPendingLocalState\n * @legacy @beta\n */\nexport interface IGetPendingLocalStateProps {\n\t/**\n\t * Indicates the container will close after getting the pending state. Used internally\n\t * to wait for blobs to be attached to a DDS and collect generated ops before closing.\n\t */\n\treadonly notifyImminentClosure: boolean;\n\n\t/**\n\t * Abort signal to stop waiting for blobs to get attached to a DDS. When triggered,\n\t * only blobs attached will be collected in the pending state.\n\t * Intended to be used in the very rare scenario in which getLocalPendingState go stale due\n\t * to a blob failed to be referenced. Such a blob will be lost but the rest of the state will\n\t * be preserved and collected.\n\t */\n\treadonly stopBlobAttachingSignal?: AbortSignal;\n\n\t/**\n\t * Date to be used as the starting time of a session. This date is updated in case we refresh the\n\t * base snapshot since we won't be referencing ops older than the new snapshot.\n\t */\n\treadonly sessionExpiryTimerStarted?: number;\n\n\t/**\n\t * Snapshot sequence number. It will help the runtime to know which ops should still be stashed.\n\t */\n\treadonly snapshotSequenceNumber?: number;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-definitions",
3
- "version": "2.70.0-361248",
3
+ "version": "2.70.0",
4
4
  "description": "Fluid container definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -47,8 +47,8 @@
47
47
  "main": "lib/index.js",
48
48
  "types": "lib/public.d.ts",
49
49
  "dependencies": {
50
- "@fluidframework/core-interfaces": "2.70.0-361248",
51
- "@fluidframework/driver-definitions": "2.70.0-361248"
50
+ "@fluidframework/core-interfaces": "~2.70.0",
51
+ "@fluidframework/driver-definitions": "~2.70.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@arethetypeswrong/cli": "^0.17.1",
@@ -66,7 +66,14 @@
66
66
  "typescript": "~5.4.5"
67
67
  },
68
68
  "typeValidation": {
69
- "broken": {},
69
+ "broken": {
70
+ "Interface_IContainerContext": {
71
+ "backCompat": false
72
+ },
73
+ "Interface_IContainerStorageService": {
74
+ "backCompat": false
75
+ }
76
+ },
70
77
  "entrypoint": "legacy"
71
78
  },
72
79
  "scripts": {
package/src/index.ts CHANGED
@@ -59,6 +59,12 @@ export {
59
59
  isFluidCodeDetails,
60
60
  } from "./fluidPackage.js";
61
61
  export type {
62
+ ConnectionStatus,
63
+ ConnectionStatusCatchingUp,
64
+ ConnectionStatusConnected,
65
+ ConnectionStatusDisconnected,
66
+ ConnectionStatusEstablishingConnection,
67
+ ConnectionStatusTemplate,
62
68
  IBatchMessage,
63
69
  IContainerContext,
64
70
  IProvideRuntimeFactory,
package/src/runtime.ts CHANGED
@@ -26,7 +26,6 @@ import type {
26
26
  ISnapshotFetchOptions,
27
27
  FetchSource,
28
28
  IDocumentStorageServicePolicies,
29
- ISummaryHandle,
30
29
  } from "@fluidframework/driver-definitions/internal";
31
30
 
32
31
  import type { IAudience } from "./audience.js";
@@ -58,6 +57,96 @@ export enum AttachState {
58
57
  Attached = "Attached",
59
58
  }
60
59
 
60
+ /**
61
+ * Defines the connection status of the container.
62
+ *
63
+ * @legacy @beta
64
+ * @sealed
65
+ */
66
+ export interface ConnectionStatusTemplate {
67
+ connectionState: ConnectionState;
68
+ /**
69
+ * True if the runtime is currently allowed to send ops.
70
+ */
71
+ canSendOps: boolean;
72
+ /**
73
+ * True if the container is in readonly mode.
74
+ */
75
+ readonly: boolean;
76
+ }
77
+
78
+ /**
79
+ * Status for an establishing connection.
80
+ *
81
+ * @legacy @beta
82
+ * @sealed
83
+ */
84
+ export interface ConnectionStatusEstablishingConnection extends ConnectionStatusTemplate {
85
+ connectionState: ConnectionState.EstablishingConnection;
86
+ canSendOps: false;
87
+ }
88
+
89
+ /**
90
+ * Status for an in-progress connection that is catching up to latest op state.
91
+ *
92
+ * @legacy @beta
93
+ * @sealed
94
+ */
95
+ export interface ConnectionStatusCatchingUp extends ConnectionStatusTemplate {
96
+ connectionState: ConnectionState.CatchingUp;
97
+ /**
98
+ * The ID of the client connection that is connecting.
99
+ */
100
+ pendingClientConnectionId: string;
101
+ canSendOps: false;
102
+ }
103
+
104
+ /**
105
+ * Status for a full connection.
106
+ *
107
+ * @legacy @beta
108
+ * @sealed
109
+ */
110
+ export interface ConnectionStatusConnected extends ConnectionStatusTemplate {
111
+ connectionState: ConnectionState.Connected;
112
+ /**
113
+ * The ID of the client connection that is connected.
114
+ */
115
+ clientConnectionId: string;
116
+ canSendOps: boolean;
117
+ }
118
+
119
+ /**
120
+ * Status for a disconnected connection.
121
+ *
122
+ * @legacy @beta
123
+ * @sealed
124
+ */
125
+ export interface ConnectionStatusDisconnected extends ConnectionStatusTemplate {
126
+ connectionState: ConnectionState.Disconnected;
127
+ canSendOps: false;
128
+ /**
129
+ * The ID of the client connection that was most recently connecting (catching up).
130
+ */
131
+ priorPendingClientConnectionId: string | undefined;
132
+ /**
133
+ * The ID of the client connection that was most recently connected.
134
+ */
135
+ priorConnectedClientConnectionId: string | undefined;
136
+ }
137
+
138
+ /**
139
+ * Connection status of the container.
140
+ *
141
+ * @legacy @beta
142
+ * @sealed
143
+ */
144
+ export type ConnectionStatus =
145
+ | ConnectionStatusEstablishingConnection
146
+ | ConnectionStatusCatchingUp
147
+ | ConnectionStatusConnected
148
+ | ConnectionStatusDisconnected;
149
+
61
150
  /**
62
151
  * The IRuntime represents an instantiation of a code package within a Container.
63
152
  * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
@@ -69,9 +158,24 @@ export interface IRuntime extends IDisposable {
69
158
  * Notifies the runtime of a change in the connection state
70
159
  * @param canSendOps - true if the runtime is allowed to send ops
71
160
  * @param clientId - the ID of the client that is connecting or disconnecting
161
+ *
162
+ * @remarks
163
+ * This is deprecated when used with `@fluidframework/container-loader` v2.63
164
+ * and later. Implement {@link IRuntime.setConnectionStatus}. Then this method
165
+ * will not be called, when using newer container-loader.
166
+ *
167
+ * Note: when {@link IRuntime.setConnectionStatus} is implemented, there will
168
+ * not be a call exactly when Container loads as happens currently without it.
72
169
  */
73
170
  setConnectionState(canSendOps: boolean, clientId?: string);
74
171
 
172
+ /**
173
+ * Notifies the runtime of a change in the connection state.
174
+ *
175
+ * @remarks This supersedes {@link IRuntime.setConnectionState}.
176
+ */
177
+ setConnectionStatus?(status: ConnectionStatus): void;
178
+
75
179
  /**
76
180
  * Processes the given op (message)
77
181
  * @param message - delta message received from the server
@@ -143,25 +247,6 @@ export interface IBatchMessage {
143
247
  * @legacy @beta
144
248
  */
145
249
  export interface IContainerStorageService {
146
- /**
147
- * Whether or not the object has been disposed.
148
- * If true, the object should be considered invalid, and its other state should be disregarded.
149
- *
150
- * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as
151
- * it is unused in the Runtime layer.
152
- */
153
- readonly disposed?: boolean;
154
-
155
- /**
156
- * Dispose of the object and its resources.
157
- * @param error - Optional error indicating the reason for the disposal, if the object was
158
- * disposed as the result of an error.
159
- *
160
- * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as
161
- * it is unused in the Runtime layer.
162
- */
163
- dispose?(error?: Error): void;
164
-
165
250
  /**
166
251
  * Policies implemented/instructed by driver.
167
252
  *
@@ -230,15 +315,6 @@ export interface IContainerStorageService {
230
315
  * Returns the uploaded summary handle.
231
316
  */
232
317
  uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
233
-
234
- /**
235
- * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the
236
- * server has deleted it this call may result in a broken promise.
237
- *
238
- * @deprecated This API is deprecated and will be removed in a future release. No replacement is planned as
239
- * it is unused in the Runtime and below layers.
240
- */
241
- downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
242
318
  }
243
319
 
244
320
  /**
@@ -302,6 +378,16 @@ export interface IContainerContext {
302
378
  readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
303
379
  readonly quorum: IQuorumClients;
304
380
  readonly audience: IAudience;
381
+ /**
382
+ * Signal-based audience provides a view of the audience that only relies
383
+ * on system signals which will be updated more quickly than
384
+ * {@link IContainerContext#audience} that relies on ops for write clients.
385
+ * Being signal-based the write members are inherently less reliable than
386
+ * {@link IContainerContext#audience}.
387
+ *
388
+ * @system
389
+ */
390
+ readonly signalAudience?: IAudience;
305
391
  readonly loader: ILoader;
306
392
  // The logger implementation, which would support tagged events, should be provided by the loader.
307
393
  readonly taggedLogger: ITelemetryBaseLogger;