@fluidframework/container-definitions 2.0.0-dev.5.3.2.178189 → 2.0.0-dev.6.4.0.191457
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -2
- package/CHANGELOG.md +227 -0
- package/README.md +4 -3
- package/dist/browserPackage.d.ts +1 -1
- package/dist/browserPackage.d.ts.map +1 -1
- package/dist/browserPackage.js +3 -6
- package/dist/browserPackage.js.map +1 -1
- package/dist/deltas.d.ts +57 -77
- package/dist/deltas.d.ts.map +1 -1
- package/dist/deltas.js.map +1 -1
- package/dist/error.d.ts +21 -50
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +16 -2
- package/dist/error.js.map +1 -1
- package/dist/fluidPackage.d.ts +1 -1
- package/dist/fluidPackage.d.ts.map +1 -1
- package/dist/fluidPackage.js +6 -4
- package/dist/fluidPackage.js.map +1 -1
- package/dist/index.d.ts +20 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +61 -34
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +5 -1
- package/dist/loader.js.map +1 -1
- package/dist/runtime.d.ts +15 -24
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js.map +1 -1
- package/lib/browserPackage.d.ts +1 -1
- package/lib/browserPackage.d.ts.map +1 -1
- package/lib/browserPackage.js +3 -6
- package/lib/browserPackage.js.map +1 -1
- package/lib/deltas.d.ts +57 -77
- package/lib/deltas.d.ts.map +1 -1
- package/lib/deltas.js.map +1 -1
- package/lib/error.d.ts +21 -50
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +15 -1
- package/lib/error.js.map +1 -1
- package/lib/fluidPackage.d.ts +1 -1
- package/lib/fluidPackage.d.ts.map +1 -1
- package/lib/fluidPackage.js +6 -4
- package/lib/fluidPackage.js.map +1 -1
- package/lib/index.d.ts +20 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/loader.d.ts +61 -34
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +5 -1
- package/lib/loader.js.map +1 -1
- package/lib/runtime.d.ts +15 -24
- package/lib/runtime.d.ts.map +1 -1
- package/lib/runtime.js.map +1 -1
- package/package.json +10 -11
- package/src/browserPackage.ts +3 -1
- package/src/deltas.ts +63 -85
- package/src/error.ts +18 -55
- package/src/fluidPackage.ts +4 -2
- package/src/index.ts +21 -8
- package/src/loader.ts +76 -36
- package/src/runtime.ts +17 -25
package/src/error.ts
CHANGED
|
@@ -3,10 +3,25 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { FluidErrorTypes, IErrorBase } from "@fluidframework/core-interfaces";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Different error types the
|
|
9
|
+
* Different error types the ClientSession may report out to the Host.
|
|
10
|
+
*/
|
|
11
|
+
export const ContainerErrorTypes = {
|
|
12
|
+
...FluidErrorTypes,
|
|
13
|
+
/**
|
|
14
|
+
* Error indicating an client session has expired. Currently this only happens when GC is allowed on a document and
|
|
15
|
+
* aids in safely deleting unused objects.
|
|
16
|
+
*/
|
|
17
|
+
clientSessionExpiredError: "clientSessionExpiredError",
|
|
18
|
+
} as const;
|
|
19
|
+
export type ContainerErrorTypes = typeof ContainerErrorTypes[keyof typeof ContainerErrorTypes];
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Different error types the Container may report out to the Host.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated ContainerErrorType is being deprecated as a public export. Please use {@link ContainerErrorTypes#clientSessionExpiredError} instead.
|
|
10
25
|
*/
|
|
11
26
|
export enum ContainerErrorType {
|
|
12
27
|
/**
|
|
@@ -41,35 +56,6 @@ export enum ContainerErrorType {
|
|
|
41
56
|
clientSessionExpiredError = "clientSessionExpiredError",
|
|
42
57
|
}
|
|
43
58
|
|
|
44
|
-
/**
|
|
45
|
-
* Base interface for all errors and warnings at container level
|
|
46
|
-
*/
|
|
47
|
-
export interface IErrorBase extends Partial<Error> {
|
|
48
|
-
/** errorType is a union of error types from
|
|
49
|
-
* - container
|
|
50
|
-
* - runtime
|
|
51
|
-
* - drivers
|
|
52
|
-
*/
|
|
53
|
-
readonly errorType: string;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* See Error.message
|
|
57
|
-
* Privacy Note - This is a freeform string that we may not control in all cases (e.g. a dependency throws an error)
|
|
58
|
-
* If there are known cases where this contains privacy-sensitive data it will be tagged and included in the result
|
|
59
|
-
* of getTelemetryProperties. When logging, consider fetching it that way rather than straight from this field.
|
|
60
|
-
*/
|
|
61
|
-
readonly message: string;
|
|
62
|
-
/** See Error.name */
|
|
63
|
-
readonly name?: string;
|
|
64
|
-
/** See Error.stack */
|
|
65
|
-
readonly stack?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Returns all properties of this error object that are either safe to log
|
|
68
|
-
* or explicitly tagged as containing privacy-sensitive data.
|
|
69
|
-
*/
|
|
70
|
-
getTelemetryProperties?(): ITelemetryProperties;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
59
|
/**
|
|
74
60
|
* Represents warnings raised on container.
|
|
75
61
|
*/
|
|
@@ -89,7 +75,7 @@ export interface ContainerWarning extends IErrorBase {
|
|
|
89
75
|
*
|
|
90
76
|
* The following are commonly thrown error types, but `errorType` could be any string.
|
|
91
77
|
*
|
|
92
|
-
* - {@link @fluidframework/
|
|
78
|
+
* - {@link @fluidframework/core-interfaces#ContainerErrorType}
|
|
93
79
|
*
|
|
94
80
|
* - {@link @fluidframework/driver-definitions#DriverErrorType}
|
|
95
81
|
*
|
|
@@ -99,26 +85,3 @@ export interface ContainerWarning extends IErrorBase {
|
|
|
99
85
|
*
|
|
100
86
|
*/
|
|
101
87
|
export type ICriticalContainerError = IErrorBase;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Generic wrapper for an unrecognized/uncategorized error object
|
|
105
|
-
*/
|
|
106
|
-
export interface IGenericError extends IErrorBase {
|
|
107
|
-
readonly errorType: ContainerErrorType.genericError;
|
|
108
|
-
error?: any;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
113
|
-
*/
|
|
114
|
-
export interface IUsageError extends IErrorBase {
|
|
115
|
-
readonly errorType: ContainerErrorType.usageError;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Warning emitted when requests to storage are being throttled
|
|
120
|
-
*/
|
|
121
|
-
export interface IThrottlingWarning extends IErrorBase {
|
|
122
|
-
readonly errorType: ContainerErrorType.throttlingError;
|
|
123
|
-
readonly retryAfterSeconds: number;
|
|
124
|
-
}
|
package/src/fluidPackage.ts
CHANGED
|
@@ -63,8 +63,10 @@ export interface IFluidPackage {
|
|
|
63
63
|
* Check if the package.json defines a Fluid package
|
|
64
64
|
* @param pkg - the package json data to check if it is a Fluid package.
|
|
65
65
|
*/
|
|
66
|
-
export const isFluidPackage = (pkg:
|
|
67
|
-
typeof pkg === "object" &&
|
|
66
|
+
export const isFluidPackage = (pkg: unknown): pkg is Readonly<IFluidPackage> =>
|
|
67
|
+
typeof pkg === "object" &&
|
|
68
|
+
typeof (pkg as Partial<IFluidPackage>)?.name === "string" &&
|
|
69
|
+
typeof (pkg as Partial<IFluidPackage>)?.fluid === "object";
|
|
68
70
|
|
|
69
71
|
/**
|
|
70
72
|
* Package manager configuration. Provides a key value mapping of config values
|
package/src/index.ts
CHANGED
|
@@ -17,27 +17,21 @@ export {
|
|
|
17
17
|
} from "./browserPackage";
|
|
18
18
|
export {
|
|
19
19
|
IConnectionDetails,
|
|
20
|
-
IConnectionDetailsInternal,
|
|
21
|
-
IDeltaHandlerStrategy,
|
|
22
20
|
IDeltaManager,
|
|
23
21
|
IDeltaManagerEvents,
|
|
24
|
-
IDeltaSender,
|
|
25
22
|
IDeltaQueue,
|
|
26
23
|
IDeltaQueueEvents,
|
|
24
|
+
IDeltaSender,
|
|
27
25
|
ReadOnlyInfo,
|
|
28
26
|
} from "./deltas";
|
|
29
27
|
export {
|
|
28
|
+
ContainerErrorTypes,
|
|
30
29
|
ContainerErrorType,
|
|
31
30
|
ContainerWarning,
|
|
32
31
|
ICriticalContainerError,
|
|
33
|
-
IErrorBase,
|
|
34
|
-
IGenericError,
|
|
35
|
-
IUsageError,
|
|
36
|
-
IThrottlingWarning,
|
|
37
32
|
} from "./error";
|
|
38
33
|
export {
|
|
39
34
|
ConnectionState,
|
|
40
|
-
ICodeAllowList,
|
|
41
35
|
ICodeDetailsLoader,
|
|
42
36
|
IContainer,
|
|
43
37
|
IContainerEvents,
|
|
@@ -73,3 +67,22 @@ export {
|
|
|
73
67
|
IRuntime,
|
|
74
68
|
IRuntimeFactory,
|
|
75
69
|
} from "./runtime";
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated IErrorBase is being deprecated as a public export is moving to "core-interfaces".
|
|
74
|
+
*/
|
|
75
|
+
IErrorBase,
|
|
76
|
+
/**
|
|
77
|
+
* @deprecated IGenericError is being deprecated as a public export is moving to "core-interfaces".
|
|
78
|
+
*/
|
|
79
|
+
IGenericError,
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated IThrottlingWarning is being deprecated as a public export is moving to "core-interfaces".
|
|
82
|
+
*/
|
|
83
|
+
IThrottlingWarning,
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated IUsageError is being deprecated as a public export is moving to "core-interfaces".
|
|
86
|
+
*/
|
|
87
|
+
IUsageError,
|
|
88
|
+
} from "@fluidframework/core-interfaces";
|
package/src/loader.ts
CHANGED
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
IRequest,
|
|
8
|
+
IResponse,
|
|
9
|
+
IFluidRouter,
|
|
10
|
+
FluidObject,
|
|
11
|
+
IEvent,
|
|
12
|
+
IEventProvider,
|
|
13
|
+
} from "@fluidframework/core-interfaces";
|
|
7
14
|
import {
|
|
8
15
|
IClientDetails,
|
|
9
16
|
IDocumentMessage,
|
|
@@ -13,7 +20,6 @@ import {
|
|
|
13
20
|
ISnapshotTree,
|
|
14
21
|
} from "@fluidframework/protocol-definitions";
|
|
15
22
|
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
16
|
-
import { IEvent, IEventProvider } from "@fluidframework/common-definitions";
|
|
17
23
|
import { IAudience } from "./audience";
|
|
18
24
|
import { IDeltaManager, ReadOnlyInfo } from "./deltas";
|
|
19
25
|
import { ICriticalContainerError, ContainerWarning } from "./error";
|
|
@@ -48,7 +54,7 @@ export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComp
|
|
|
48
54
|
* Load the code module (package) that can interact with the document.
|
|
49
55
|
*
|
|
50
56
|
* @param source - Code proposal that articulates the current schema the document is written in.
|
|
51
|
-
* @returns
|
|
57
|
+
* @returns Code module entry point along with the code details associated with it.
|
|
52
58
|
*/
|
|
53
59
|
load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;
|
|
54
60
|
}
|
|
@@ -79,24 +85,12 @@ export interface IFluidCodeResolver {
|
|
|
79
85
|
/**
|
|
80
86
|
* Resolves a Fluid code details into a form that can be loaded.
|
|
81
87
|
* @param details - The Fluid code details to resolve.
|
|
82
|
-
* @returns
|
|
88
|
+
* @returns A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and
|
|
83
89
|
* an optional resolvedPackageCacheId if the loaded package should be cached.
|
|
84
90
|
*/
|
|
85
91
|
resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;
|
|
86
92
|
}
|
|
87
93
|
|
|
88
|
-
/**
|
|
89
|
-
* Code AllowListing Interface
|
|
90
|
-
*
|
|
91
|
-
* @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.
|
|
92
|
-
*/
|
|
93
|
-
export interface ICodeAllowList {
|
|
94
|
-
/**
|
|
95
|
-
* @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.
|
|
96
|
-
*/
|
|
97
|
-
testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
94
|
/**
|
|
101
95
|
* Events emitted by the {@link IContainer} "upwards" to the Loader and Host.
|
|
102
96
|
*/
|
|
@@ -141,11 +135,6 @@ export interface IContainerEvents extends IEvent {
|
|
|
141
135
|
listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void,
|
|
142
136
|
);
|
|
143
137
|
|
|
144
|
-
/**
|
|
145
|
-
* @deprecated No replacement API recommended.
|
|
146
|
-
*/
|
|
147
|
-
(event: "contextChanged", listener: (codeDetails: IFluidCodeDetails) => void);
|
|
148
|
-
|
|
149
138
|
/**
|
|
150
139
|
* Emitted when the {@link IContainer} becomes disconnected from the Fluid service.
|
|
151
140
|
*
|
|
@@ -339,10 +328,15 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
|
|
|
339
328
|
getLoadedCodeDetails(): IFluidCodeDetails | undefined;
|
|
340
329
|
|
|
341
330
|
/**
|
|
342
|
-
* Returns true if the container has been closed, otherwise false.
|
|
331
|
+
* Returns true if the container has been closed and/or disposed, otherwise false.
|
|
343
332
|
*/
|
|
344
333
|
readonly closed: boolean;
|
|
345
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Returns true if the container has been disposed, otherwise false.
|
|
337
|
+
*/
|
|
338
|
+
readonly disposed?: boolean;
|
|
339
|
+
|
|
346
340
|
/**
|
|
347
341
|
* Whether or not there are any local changes that have not been saved.
|
|
348
342
|
*/
|
|
@@ -365,16 +359,6 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
|
|
|
365
359
|
*/
|
|
366
360
|
close(error?: ICriticalContainerError): void;
|
|
367
361
|
|
|
368
|
-
/**
|
|
369
|
-
* @deprecated - This is moved to the IContainerExperimental interface. To access you should cast IContainerExperimental before attempting to use
|
|
370
|
-
*
|
|
371
|
-
* Closes the container and returns serialized local state intended to be
|
|
372
|
-
* given to a newly loaded container.
|
|
373
|
-
* @experimental
|
|
374
|
-
* {@link https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-loader/closeAndGetPendingLocalState.md}
|
|
375
|
-
*/
|
|
376
|
-
closeAndGetPendingLocalState(): string;
|
|
377
|
-
|
|
378
362
|
/**
|
|
379
363
|
* Propose new code details that define the code to be loaded for this container's runtime.
|
|
380
364
|
*
|
|
@@ -406,12 +390,38 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
|
|
|
406
390
|
*/
|
|
407
391
|
getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
|
|
408
392
|
|
|
393
|
+
/**
|
|
394
|
+
* IMPORTANT: This overload is provided for back-compat where IContainer.request(\{ url: "/" \}) is already implemented and used.
|
|
395
|
+
* The functionality it can provide (if the Container implementation is built for it) is redundant with @see {@link IContainer.getEntryPoint}.
|
|
396
|
+
* Once that API is mandatory on IContainer, this overload will be deprecated.
|
|
397
|
+
*
|
|
398
|
+
* Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.
|
|
399
|
+
*
|
|
400
|
+
* @param request - Only requesting \{ url: "/" \} is supported, requesting arbitrary URLs is deprecated.
|
|
401
|
+
*/
|
|
402
|
+
request(request: { url: "/"; headers?: undefined }): Promise<IResponse>;
|
|
403
|
+
|
|
409
404
|
/**
|
|
410
405
|
* Issue a request against the container for a resource.
|
|
411
406
|
* @param request - The request to be issued against the container
|
|
407
|
+
*
|
|
408
|
+
* @deprecated - Requesting an arbitrary URL with headers will not be supported in a future major release.
|
|
409
|
+
* Instead, access the objects in a Fluid Container using entryPoint, and then navigate from there using
|
|
410
|
+
* app-specific logic (e.g. retrieving handles from the entryPoint's DDSes, or a container's entryPoint object
|
|
411
|
+
* could implement a request paradigm itself)
|
|
412
|
+
*
|
|
413
|
+
* NOTE: IContainer.request(\{url: "/"\}) is not yet deprecated. If and only if the Container implementation supports it,
|
|
414
|
+
* that overload may be used as a proxy for getting the entryPoint until {@link IContainer.getEntryPoint} is mandatory.
|
|
415
|
+
*
|
|
416
|
+
* Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.
|
|
412
417
|
*/
|
|
413
418
|
request(request: IRequest): Promise<IResponse>;
|
|
414
419
|
|
|
420
|
+
/**
|
|
421
|
+
* @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
422
|
+
*/
|
|
423
|
+
readonly IFluidRouter: IFluidRouter;
|
|
424
|
+
|
|
415
425
|
/**
|
|
416
426
|
* Provides the current state of the container's connection to the ordering service.
|
|
417
427
|
*
|
|
@@ -493,7 +503,7 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
|
|
|
493
503
|
/**
|
|
494
504
|
* The Runtime's view of the Loader, used for loading Containers
|
|
495
505
|
*/
|
|
496
|
-
export interface ILoader extends
|
|
506
|
+
export interface ILoader extends Partial<IProvideLoader> {
|
|
497
507
|
/**
|
|
498
508
|
* Resolves the resource specified by the URL + headers contained in the request object
|
|
499
509
|
* to the underlying container that will resolve the request.
|
|
@@ -504,6 +514,16 @@ export interface ILoader extends IFluidRouter, Partial<IProvideLoader> {
|
|
|
504
514
|
* a request against the server found from the resolve step.
|
|
505
515
|
*/
|
|
506
516
|
resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
|
|
520
|
+
*/
|
|
521
|
+
request(request: IRequest): Promise<IResponse>;
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
|
|
525
|
+
*/
|
|
526
|
+
readonly IFluidRouter: IFluidRouter;
|
|
507
527
|
}
|
|
508
528
|
|
|
509
529
|
/**
|
|
@@ -524,15 +544,17 @@ export interface IHostLoader extends ILoader {
|
|
|
524
544
|
}
|
|
525
545
|
|
|
526
546
|
export type ILoaderOptions = {
|
|
547
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
527
548
|
[key in string | number]: any;
|
|
528
549
|
} & {
|
|
529
550
|
/**
|
|
551
|
+
* @deprecated This option has been deprecated and will be removed in a future release
|
|
530
552
|
* Set caching behavior for the loader. If true, we will load a container from cache if one
|
|
531
553
|
* with the same id/version exists or create a new container and cache it if it does not. If
|
|
532
554
|
* false, always load a new container and don't cache it. If the container has already been
|
|
533
555
|
* closed, it will not be cached. A cache option in the LoaderHeader for an individual
|
|
534
556
|
* request will override the Loader's value.
|
|
535
|
-
* Defaults to
|
|
557
|
+
* Defaults to false.
|
|
536
558
|
*/
|
|
537
559
|
cache?: boolean;
|
|
538
560
|
|
|
@@ -556,7 +578,7 @@ export type ILoaderOptions = {
|
|
|
556
578
|
*/
|
|
557
579
|
export enum LoaderHeader {
|
|
558
580
|
/**
|
|
559
|
-
* @deprecated
|
|
581
|
+
* @deprecated This header has been deprecated and will be removed in a future release
|
|
560
582
|
* Override the Loader's default caching behavior for this container.
|
|
561
583
|
*/
|
|
562
584
|
cache = "fluid-cache",
|
|
@@ -568,6 +590,10 @@ export enum LoaderHeader {
|
|
|
568
590
|
*/
|
|
569
591
|
loadMode = "loadMode",
|
|
570
592
|
reconnect = "fluid-reconnect",
|
|
593
|
+
/**
|
|
594
|
+
* Loads the container to at least the specified sequence number.
|
|
595
|
+
* If not defined, behavior will fall back to `IContainerLoadMode.opsBeforeReturn`.
|
|
596
|
+
*/
|
|
571
597
|
sequenceNumber = "fluid-sequence-number",
|
|
572
598
|
|
|
573
599
|
/**
|
|
@@ -585,6 +611,11 @@ export interface IContainerLoadMode {
|
|
|
585
611
|
* Default value.
|
|
586
612
|
*/
|
|
587
613
|
| undefined
|
|
614
|
+
/*
|
|
615
|
+
* Only fetch and apply trailing ops up until (and including) the specified sequence number.
|
|
616
|
+
* Requires `ILoaderHeader["fluid-sequence-number"]` to also be defined.
|
|
617
|
+
*/
|
|
618
|
+
| "sequenceNumber"
|
|
588
619
|
/*
|
|
589
620
|
* Only cached trailing ops are applied before returning container.
|
|
590
621
|
* Caching is optional and could be implemented by the driver.
|
|
@@ -618,6 +649,11 @@ export interface IContainerLoadMode {
|
|
|
618
649
|
* Default value.
|
|
619
650
|
*/
|
|
620
651
|
| undefined;
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* If set to true, will indefinitely pause all incoming and outgoing after the container is loaded.
|
|
655
|
+
*/
|
|
656
|
+
pauseAfterLoad?: boolean;
|
|
621
657
|
}
|
|
622
658
|
|
|
623
659
|
/**
|
|
@@ -625,11 +661,15 @@ export interface IContainerLoadMode {
|
|
|
625
661
|
*/
|
|
626
662
|
export interface ILoaderHeader {
|
|
627
663
|
/**
|
|
628
|
-
* @deprecated
|
|
664
|
+
* @deprecated This header has been deprecated and will be removed in a future release
|
|
629
665
|
*/
|
|
630
666
|
[LoaderHeader.cache]: boolean;
|
|
631
667
|
[LoaderHeader.clientDetails]: IClientDetails;
|
|
632
668
|
[LoaderHeader.loadMode]: IContainerLoadMode;
|
|
669
|
+
/**
|
|
670
|
+
* Loads the container to at least the specified sequence number.
|
|
671
|
+
* If not defined, behavior will fall back to `IContainerLoadMode.opsBeforeReturn`.
|
|
672
|
+
*/
|
|
633
673
|
[LoaderHeader.sequenceNumber]: number;
|
|
634
674
|
[LoaderHeader.reconnect]: boolean;
|
|
635
675
|
[LoaderHeader.version]: string | undefined;
|
package/src/runtime.ts
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
|
|
14
14
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
15
15
|
import {
|
|
16
|
-
IClientConfiguration,
|
|
17
16
|
IClientDetails,
|
|
18
17
|
ISequencedDocumentMessage,
|
|
19
18
|
ISnapshotTree,
|
|
@@ -60,6 +59,7 @@ export enum AttachState {
|
|
|
60
59
|
export interface IRuntime extends IDisposable {
|
|
61
60
|
/**
|
|
62
61
|
* Executes a request against the runtime
|
|
62
|
+
* @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
63
63
|
*/
|
|
64
64
|
request(request: IRequest): Promise<IResponse>;
|
|
65
65
|
|
|
@@ -76,6 +76,8 @@ export interface IRuntime extends IDisposable {
|
|
|
76
76
|
/**
|
|
77
77
|
* Processes the given signal
|
|
78
78
|
*/
|
|
79
|
+
// TODO: use `unknown` instead (API breaking)
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
79
81
|
processSignal(message: any, local: boolean);
|
|
80
82
|
|
|
81
83
|
/**
|
|
@@ -98,7 +100,7 @@ export interface IRuntime extends IDisposable {
|
|
|
98
100
|
* @experimental
|
|
99
101
|
* {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}
|
|
100
102
|
*/
|
|
101
|
-
getPendingLocalState(): unknown;
|
|
103
|
+
getPendingLocalState(props?: { notifyImminentClosure?: boolean }): unknown;
|
|
102
104
|
|
|
103
105
|
/**
|
|
104
106
|
* Notify runtime that container is moving to "Attaching" state
|
|
@@ -141,22 +143,27 @@ export interface IBatchMessage {
|
|
|
141
143
|
* if you intend them to be consumed/called from the runtime layer.
|
|
142
144
|
*/
|
|
143
145
|
export interface IContainerContext {
|
|
144
|
-
/** @deprecated Please pass in existing directly in instantiateRuntime */
|
|
145
|
-
readonly existing: boolean | undefined;
|
|
146
146
|
readonly options: ILoaderOptions;
|
|
147
147
|
readonly clientId: string | undefined;
|
|
148
148
|
readonly clientDetails: IClientDetails;
|
|
149
149
|
readonly storage: IDocumentStorageService;
|
|
150
150
|
readonly connected: boolean;
|
|
151
151
|
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
152
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* @deprecated Please use submitBatchFn & submitSummaryFn
|
|
154
|
+
*/
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
153
156
|
readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;
|
|
154
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* @returns clientSequenceNumber of last message in a batch
|
|
159
|
+
*/
|
|
155
160
|
readonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;
|
|
156
161
|
readonly submitSummaryFn: (
|
|
157
162
|
summaryOp: ISummaryContent,
|
|
158
163
|
referenceSequenceNumber?: number,
|
|
159
164
|
) => number;
|
|
165
|
+
// TODO: use `unknown` instead (API breaking)
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
160
167
|
readonly submitSignalFn: (contents: any) => void;
|
|
161
168
|
readonly disposeFn?: (error?: ICriticalContainerError) => void;
|
|
162
169
|
readonly closeFn: (error?: ICriticalContainerError) => void;
|
|
@@ -174,11 +181,6 @@ export interface IContainerContext {
|
|
|
174
181
|
readonly loader: ILoader;
|
|
175
182
|
// The logger implementation, which would support tagged events, should be provided by the loader.
|
|
176
183
|
readonly taggedLogger: ITelemetryBaseLogger;
|
|
177
|
-
/**
|
|
178
|
-
* @deprecated - 2.0.0-internal.5.2.0 - This property is redundant, and is unused by the runtime. The same information can be found via
|
|
179
|
-
* deltaManager.serviceConfiguration on this object if it is necessary.
|
|
180
|
-
*/
|
|
181
|
-
readonly serviceConfiguration: IClientConfiguration | undefined;
|
|
182
184
|
pendingLocalState?: unknown;
|
|
183
185
|
|
|
184
186
|
/**
|
|
@@ -209,22 +211,12 @@ export interface IContainerContext {
|
|
|
209
211
|
* WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption
|
|
210
212
|
* This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers
|
|
211
213
|
* and scenarios which can change in the future.
|
|
212
|
-
* @deprecated
|
|
213
|
-
* telemetry purposes, so this is generally unnecessary for telemetry.
|
|
214
|
-
*
|
|
214
|
+
* @deprecated 2.0.0-internal.5.2.0 - The docId is already logged by the {@link IContainerContext.taggedLogger} for
|
|
215
|
+
* telemetry purposes, so this is generally unnecessary for telemetry.
|
|
216
|
+
* If the id is needed for other purposes it should be passed to the consumer explicitly.
|
|
217
|
+
* This member will be removed in the 2.0.0-internal.7.0.0 release.
|
|
215
218
|
*/
|
|
216
219
|
readonly id: string;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @deprecated - 2.0.0-internal.5.2.0 - The disposed state on the IContainerContext is not meaningful to the runtime.
|
|
220
|
-
* This member will be removed in an upcoming release.
|
|
221
|
-
*/
|
|
222
|
-
readonly disposed: boolean;
|
|
223
|
-
/**
|
|
224
|
-
* @deprecated - 2.0.0-internal.5.2.0 - The runtime is not permitted to dispose the IContainerContext, this results
|
|
225
|
-
* in an inconsistent system state. This member will be removed in an upcoming release.
|
|
226
|
-
*/
|
|
227
|
-
dispose(error?: Error): void;
|
|
228
220
|
}
|
|
229
221
|
|
|
230
222
|
export const IRuntimeFactory: keyof IProvideRuntimeFactory = "IRuntimeFactory";
|