@fluidframework/container-definitions 2.70.0-361788 → 2.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +3 -0
- package/CHANGELOG.md +30 -0
- package/api-report/container-definitions.legacy.beta.api.md +50 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +6 -0
- package/dist/runtime.d.ts +104 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +6 -0
- package/lib/runtime.d.ts +104 -0
- package/lib/runtime.d.ts.map +1 -1
- package/lib/runtime.js.map +1 -1
- package/package.json +8 -15
- package/src/index.ts +6 -0
- package/src/runtime.ts +115 -0
package/.eslintrc.cjs
CHANGED
|
@@ -11,6 +11,9 @@ module.exports = {
|
|
|
11
11
|
rules: {
|
|
12
12
|
// TODO: Enabling this may require breaking changes.
|
|
13
13
|
"@typescript-eslint/consistent-indexed-object-style": "off",
|
|
14
|
+
|
|
15
|
+
// Disabled because the rule is crashing on this package - AB#51780
|
|
16
|
+
"@typescript-eslint/unbound-method": "off",
|
|
14
17
|
},
|
|
15
18
|
overrides: [
|
|
16
19
|
{
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @fluidframework/container-definitions
|
|
2
2
|
|
|
3
|
+
## 2.71.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.70.0
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 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)
|
|
12
|
+
|
|
13
|
+
The following deprecated properties have been removed from `IRuntimeStorageService`:
|
|
14
|
+
|
|
15
|
+
- `createBlob`
|
|
16
|
+
- `dispose`
|
|
17
|
+
- `disposed`
|
|
18
|
+
- `downloadSummary`
|
|
19
|
+
- `getSnapshot`
|
|
20
|
+
- `getSnapshotTree`
|
|
21
|
+
- `getVersions`
|
|
22
|
+
- `policies`
|
|
23
|
+
- `uploadSummaryWithContext`
|
|
24
|
+
|
|
25
|
+
The following deprecated properties have been removed from `IContainerStorageService`:
|
|
26
|
+
|
|
27
|
+
- `dispose`
|
|
28
|
+
- `disposed`
|
|
29
|
+
- `downloadSummary`
|
|
30
|
+
|
|
31
|
+
Please see [this Github issue](https://github.com/microsoft/FluidFramework/issues/25069) for more details.
|
|
32
|
+
|
|
3
33
|
## 2.63.0
|
|
4
34
|
|
|
5
35
|
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;
|
|
@@ -421,6 +470,7 @@ export interface IRuntime extends IDisposable {
|
|
|
421
470
|
processSignal(message: any, local: boolean): any;
|
|
422
471
|
setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
|
|
423
472
|
setConnectionState(canSendOps: boolean, clientId?: string): any;
|
|
473
|
+
setConnectionStatus?(status: ConnectionStatus): void;
|
|
424
474
|
}
|
|
425
475
|
|
|
426
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
|
/**
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,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H,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;
|
|
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
|
@@ -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
|
|
@@ -206,6 +300,16 @@ export interface IContainerContext {
|
|
|
206
300
|
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
207
301
|
readonly quorum: IQuorumClients;
|
|
208
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;
|
|
209
313
|
readonly loader: ILoader;
|
|
210
314
|
readonly taggedLogger: ITelemetryBaseLogger;
|
|
211
315
|
pendingLocalState?: unknown;
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -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,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;IACH,QAAQ,aAAa;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAS,SAAQ,WAAW;IAC5C
|
|
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,cA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AAC;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"}
|
package/dist/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;AA4QD;;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 * 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 * 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\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
|
/**
|
package/lib/index.d.ts.map
CHANGED
|
@@ -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,Y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AAM,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;
|
|
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
|
@@ -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
|
|
@@ -206,6 +300,16 @@ export interface IContainerContext {
|
|
|
206
300
|
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
207
301
|
readonly quorum: IQuorumClients;
|
|
208
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;
|
|
209
313
|
readonly loader: ILoader;
|
|
210
314
|
readonly taggedLogger: ITelemetryBaseLogger;
|
|
211
315
|
pendingLocalState?: unknown;
|
package/lib/runtime.d.ts.map
CHANGED
|
@@ -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,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;IACH,QAAQ,aAAa;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAS,SAAQ,WAAW;IAC5C
|
|
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,O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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"}
|
package/lib/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;AA4QD;;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 * 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 * 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\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.
|
|
3
|
+
"version": "2.71.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.
|
|
51
|
-
"@fluidframework/driver-definitions": "2.
|
|
50
|
+
"@fluidframework/core-interfaces": "~2.71.0",
|
|
51
|
+
"@fluidframework/driver-definitions": "~2.71.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"@fluid-tools/build-cli": "^0.58.3",
|
|
57
57
|
"@fluidframework/build-common": "^2.0.3",
|
|
58
58
|
"@fluidframework/build-tools": "^0.58.3",
|
|
59
|
-
"@fluidframework/container-definitions-previous": "npm:@fluidframework/container-definitions@2.
|
|
60
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
59
|
+
"@fluidframework/container-definitions-previous": "npm:@fluidframework/container-definitions@2.70.0",
|
|
60
|
+
"@fluidframework/eslint-config-fluid": "^7.0.0",
|
|
61
61
|
"@microsoft/api-extractor": "7.52.11",
|
|
62
62
|
"concurrently": "^8.2.1",
|
|
63
63
|
"copyfiles": "^2.4.1",
|
|
@@ -66,14 +66,7 @@
|
|
|
66
66
|
"typescript": "~5.4.5"
|
|
67
67
|
},
|
|
68
68
|
"typeValidation": {
|
|
69
|
-
"broken": {
|
|
70
|
-
"Interface_IContainerContext": {
|
|
71
|
-
"backCompat": false
|
|
72
|
-
},
|
|
73
|
-
"Interface_IContainerStorageService": {
|
|
74
|
-
"backCompat": false
|
|
75
|
-
}
|
|
76
|
-
},
|
|
69
|
+
"broken": {},
|
|
77
70
|
"entrypoint": "legacy"
|
|
78
71
|
},
|
|
79
72
|
"scripts": {
|
|
@@ -108,8 +101,8 @@
|
|
|
108
101
|
"ci:test": "echo No test for this package",
|
|
109
102
|
"ci:test:coverage": "echo No test for this package",
|
|
110
103
|
"clean": "rimraf --glob dist lib {alpha,beta,internal,legacy}.d.ts \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp",
|
|
111
|
-
"eslint": "eslint --format stylish src",
|
|
112
|
-
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
104
|
+
"eslint": "eslint --quiet --format stylish src",
|
|
105
|
+
"eslint:fix": "eslint --quiet --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
113
106
|
"format": "npm run format:biome",
|
|
114
107
|
"format:biome": "biome check . --write",
|
|
115
108
|
"lint": "fluid-build . --task lint",
|
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
|
@@ -57,6 +57,96 @@ export enum AttachState {
|
|
|
57
57
|
Attached = "Attached",
|
|
58
58
|
}
|
|
59
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
|
+
|
|
60
150
|
/**
|
|
61
151
|
* The IRuntime represents an instantiation of a code package within a Container.
|
|
62
152
|
* Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
|
|
@@ -68,9 +158,24 @@ export interface IRuntime extends IDisposable {
|
|
|
68
158
|
* Notifies the runtime of a change in the connection state
|
|
69
159
|
* @param canSendOps - true if the runtime is allowed to send ops
|
|
70
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.
|
|
71
169
|
*/
|
|
72
170
|
setConnectionState(canSendOps: boolean, clientId?: string);
|
|
73
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
|
+
|
|
74
179
|
/**
|
|
75
180
|
* Processes the given op (message)
|
|
76
181
|
* @param message - delta message received from the server
|
|
@@ -273,6 +378,16 @@ export interface IContainerContext {
|
|
|
273
378
|
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
274
379
|
readonly quorum: IQuorumClients;
|
|
275
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;
|
|
276
391
|
readonly loader: ILoader;
|
|
277
392
|
// The logger implementation, which would support tagged events, should be provided by the loader.
|
|
278
393
|
readonly taggedLogger: ITelemetryBaseLogger;
|