@fluidframework/container-definitions 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.3.1.0.125672
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 +20 -9
- package/README.md +5 -5
- package/api-extractor.json +2 -2
- package/dist/audience.d.ts +3 -4
- package/dist/audience.d.ts.map +1 -1
- package/dist/audience.js.map +1 -1
- package/dist/browserPackage.d.ts.map +1 -1
- package/dist/browserPackage.js +3 -3
- package/dist/browserPackage.js.map +1 -1
- package/dist/deltas.d.ts +12 -0
- package/dist/deltas.d.ts.map +1 -1
- package/dist/deltas.js.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/fluidModule.d.ts.map +1 -1
- package/dist/fluidModule.js.map +1 -1
- package/dist/fluidPackage.d.ts.map +1 -1
- package/dist/fluidPackage.js +5 -6
- package/dist/fluidPackage.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +20 -2
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js.map +1 -1
- package/dist/runtime.d.ts +2 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js.map +1 -1
- package/dist/tokenProvider.d.ts.map +1 -1
- package/dist/tokenProvider.js.map +1 -1
- package/lib/audience.d.ts +3 -4
- package/lib/audience.d.ts.map +1 -1
- package/lib/audience.js.map +1 -1
- package/lib/browserPackage.d.ts.map +1 -1
- package/lib/browserPackage.js +3 -3
- package/lib/browserPackage.js.map +1 -1
- package/lib/deltas.d.ts +12 -0
- package/lib/deltas.d.ts.map +1 -1
- package/lib/deltas.js.map +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/fluidModule.d.ts.map +1 -1
- package/lib/fluidModule.js.map +1 -1
- package/lib/fluidPackage.d.ts.map +1 -1
- package/lib/fluidPackage.js +5 -6
- package/lib/fluidPackage.js.map +1 -1
- package/lib/index.d.ts +1 -1
- 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 +20 -2
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js.map +1 -1
- package/lib/runtime.d.ts +2 -1
- package/lib/runtime.d.ts.map +1 -1
- package/lib/runtime.js.map +1 -1
- package/lib/tokenProvider.d.ts.map +1 -1
- package/lib/tokenProvider.js.map +1 -1
- package/package.json +17 -14
- package/prettier.config.cjs +1 -1
- package/src/audience.ts +25 -22
- package/src/browserPackage.ts +33 -34
- package/src/deltas.ts +267 -245
- package/src/error.ts +58 -58
- package/src/fluidModule.ts +1 -1
- package/src/fluidPackage.ts +86 -86
- package/src/index.ts +51 -47
- package/src/loader.ts +498 -489
- package/src/runtime.ts +144 -148
- package/src/tokenProvider.ts +2 -2
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +8 -15
package/src/runtime.ts
CHANGED
|
@@ -4,23 +4,19 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ITelemetryBaseLogger, IDisposable } from "@fluidframework/common-definitions";
|
|
7
|
-
import {
|
|
8
|
-
FluidObject,
|
|
9
|
-
IRequest,
|
|
10
|
-
IResponse,
|
|
11
|
-
} from "@fluidframework/core-interfaces";
|
|
7
|
+
import { FluidObject, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
12
8
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
13
9
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
IClientConfiguration,
|
|
11
|
+
IClientDetails,
|
|
12
|
+
ISequencedDocumentMessage,
|
|
13
|
+
ISnapshotTree,
|
|
14
|
+
MessageType,
|
|
15
|
+
ISummaryTree,
|
|
16
|
+
IVersion,
|
|
17
|
+
IDocumentMessage,
|
|
18
|
+
IQuorumClients,
|
|
19
|
+
ISummaryContent,
|
|
24
20
|
} from "@fluidframework/protocol-definitions";
|
|
25
21
|
import { IAudience } from "./audience";
|
|
26
22
|
import { IDeltaManager } from "./deltas";
|
|
@@ -33,22 +29,22 @@ import { IFluidCodeDetails } from "./fluidPackage";
|
|
|
33
29
|
* service. The transition from detached to attached state is a one-way transition.
|
|
34
30
|
*/
|
|
35
31
|
export enum AttachState {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
32
|
+
/**
|
|
33
|
+
* In detached state, the data is only present on the local client's machine. It has not yet been uploaded
|
|
34
|
+
* to the service.
|
|
35
|
+
*/
|
|
36
|
+
Detached = "Detached",
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* In attaching state, the data has started the upload to the service, but has not yet completed.
|
|
40
|
+
*/
|
|
41
|
+
Attaching = "Attaching",
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* In attached state, the data has completed upload to the service. It can be accessed by other clients after
|
|
45
|
+
* reaching attached state.
|
|
46
|
+
*/
|
|
47
|
+
Attached = "Attached",
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
/**
|
|
@@ -56,61 +52,60 @@ export enum AttachState {
|
|
|
56
52
|
* Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
|
|
57
53
|
*/
|
|
58
54
|
export interface IRuntime extends IDisposable {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;
|
|
55
|
+
/**
|
|
56
|
+
* Executes a request against the runtime
|
|
57
|
+
*/
|
|
58
|
+
request(request: IRequest): Promise<IResponse>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Notifies the runtime of a change in the connection state
|
|
62
|
+
*/
|
|
63
|
+
setConnectionState(connected: boolean, clientId?: string);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Processes the given op (message)
|
|
67
|
+
*/
|
|
68
|
+
process(message: ISequencedDocumentMessage, local: boolean);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Processes the given signal
|
|
72
|
+
*/
|
|
73
|
+
processSignal(message: any, local: boolean);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Create a summary. Used when attaching or serializing a detached container.
|
|
77
|
+
*
|
|
78
|
+
* @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported
|
|
79
|
+
* using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the
|
|
80
|
+
* new storage IDs so requests can be redirected.
|
|
81
|
+
*/
|
|
82
|
+
createSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Propagate the container state when container is attaching or attached.
|
|
86
|
+
* @param attachState - State of the container.
|
|
87
|
+
*/
|
|
88
|
+
setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get pending local state in a serializable format to be given back to a newly loaded container
|
|
92
|
+
*/
|
|
93
|
+
getPendingLocalState(): unknown;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Notify runtime that container is moving to "Attaching" state
|
|
97
|
+
* @param snapshot - snapshot created at attach time
|
|
98
|
+
*/
|
|
99
|
+
notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;
|
|
105
100
|
}
|
|
106
101
|
|
|
107
102
|
/**
|
|
108
103
|
* Payload type for IContainerContext.submitBatchFn()
|
|
109
104
|
*/
|
|
110
105
|
export interface IBatchMessage {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
contents?: string;
|
|
107
|
+
metadata: Record<string, unknown> | undefined;
|
|
108
|
+
compression?: string;
|
|
114
109
|
}
|
|
115
110
|
|
|
116
111
|
/**
|
|
@@ -122,71 +117,72 @@ export interface IBatchMessage {
|
|
|
122
117
|
* and the Container has created a new ContainerContext.
|
|
123
118
|
*/
|
|
124
119
|
export interface IContainerContext extends IDisposable {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
120
|
+
/** @deprecated Please pass in existing directly in instantiateRuntime */
|
|
121
|
+
readonly existing: boolean | undefined;
|
|
122
|
+
readonly options: ILoaderOptions;
|
|
123
|
+
readonly clientId: string | undefined;
|
|
124
|
+
readonly clientDetails: IClientDetails;
|
|
125
|
+
readonly storage: IDocumentStorageService;
|
|
126
|
+
readonly connected: boolean;
|
|
127
|
+
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
128
|
+
/** @deprecated Please use submitBatchFn & submitSummaryFn */
|
|
129
|
+
readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;
|
|
130
|
+
/** @returns clientSequenceNumber of last message in a batch */
|
|
131
|
+
readonly submitBatchFn: (batch: IBatchMessage[]) => number;
|
|
132
|
+
readonly submitSummaryFn: (summaryOp: ISummaryContent) => number;
|
|
133
|
+
readonly submitSignalFn: (contents: any) => void;
|
|
134
|
+
readonly disposeFn?: (error?: ICriticalContainerError) => void;
|
|
135
|
+
readonly closeFn: (error?: ICriticalContainerError) => void;
|
|
136
|
+
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
137
|
+
readonly quorum: IQuorumClients;
|
|
138
|
+
/**
|
|
139
|
+
* @deprecated This method is provided as a migration tool for customers currently reading the code details
|
|
140
|
+
* from within the Container by directly accessing the Quorum proposals. The code details should not be accessed
|
|
141
|
+
* from within the Container as this requires coupling between the container contents and the code loader.
|
|
142
|
+
* Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this
|
|
143
|
+
* migration tool will be removed.
|
|
144
|
+
*/
|
|
145
|
+
getSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;
|
|
146
|
+
readonly audience: IAudience | undefined;
|
|
147
|
+
readonly loader: ILoader;
|
|
148
|
+
// The logger implementation, which would support tagged events, should be provided by the loader.
|
|
149
|
+
readonly taggedLogger: ITelemetryBaseLogger;
|
|
150
|
+
readonly serviceConfiguration: IClientConfiguration | undefined;
|
|
151
|
+
pendingLocalState?: unknown;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Ambient services provided with the context
|
|
155
|
+
*/
|
|
156
|
+
readonly scope: FluidObject;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Get an absolute url for a provided container-relative request.
|
|
160
|
+
* @param relativeUrl - A relative request within the container
|
|
161
|
+
*
|
|
162
|
+
* TODO: Optional for backwards compatibility. Make non-optional in version 0.19
|
|
163
|
+
*/
|
|
164
|
+
getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Indicates the attachment state of the container to a host service.
|
|
168
|
+
*/
|
|
169
|
+
readonly attachState: AttachState;
|
|
170
|
+
|
|
171
|
+
getLoadedFromVersion(): IVersion | undefined;
|
|
172
|
+
|
|
173
|
+
updateDirtyContainerState(dirty: boolean): void;
|
|
174
|
+
/**
|
|
175
|
+
* WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption
|
|
176
|
+
* This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers
|
|
177
|
+
* and scenarios which can change in the future.
|
|
178
|
+
*/
|
|
179
|
+
readonly id: string;
|
|
184
180
|
}
|
|
185
181
|
|
|
186
182
|
export const IRuntimeFactory: keyof IProvideRuntimeFactory = "IRuntimeFactory";
|
|
187
183
|
|
|
188
184
|
export interface IProvideRuntimeFactory {
|
|
189
|
-
|
|
185
|
+
readonly IRuntimeFactory: IRuntimeFactory;
|
|
190
186
|
}
|
|
191
187
|
|
|
192
188
|
/**
|
|
@@ -196,12 +192,12 @@ export interface IProvideRuntimeFactory {
|
|
|
196
192
|
* to start up the running instance of the Container.
|
|
197
193
|
*/
|
|
198
194
|
export interface IRuntimeFactory extends IProvideRuntimeFactory {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Instantiates a new IRuntime for the given IContainerContext to proxy to
|
|
197
|
+
* This is the main entry point to the Container's business logic
|
|
198
|
+
*
|
|
199
|
+
* @param context - container context to be supplied to the runtime
|
|
200
|
+
* @param existing - whether to instantiate for the first time or from an existing context
|
|
201
|
+
*/
|
|
202
|
+
instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
|
|
207
203
|
}
|
package/src/tokenProvider.ts
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
export const IFluidTokenProvider: keyof IProvideFluidTokenProvider = "IFluidTokenProvider";
|
|
7
7
|
|
|
8
8
|
export interface IProvideFluidTokenProvider {
|
|
9
|
-
|
|
9
|
+
readonly IFluidTokenProvider: IFluidTokenProvider;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export interface IFluidTokenProvider extends IProvideFluidTokenProvider {
|
|
13
|
-
|
|
13
|
+
intelligence: { [service: string]: any };
|
|
14
14
|
}
|
package/tsconfig.esnext.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "./lib",
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
},
|
|
7
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"types": [
|
|
11
|
-
"node"
|
|
12
|
-
]
|
|
13
|
-
},
|
|
14
|
-
"include": [
|
|
15
|
-
"src/**/*"
|
|
16
|
-
]
|
|
2
|
+
"extends": "@fluidframework/build-common/ts-common-config.json",
|
|
3
|
+
"exclude": ["src/test/**/*"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"composite": true,
|
|
8
|
+
},
|
|
9
|
+
"include": ["src/**/*"],
|
|
17
10
|
}
|