@fluidframework/container-loader 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.217212
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/api-extractor-lint.json +13 -0
- package/api-extractor.json +0 -4
- package/api-report/container-loader.api.md +17 -17
- package/dist/connectionState.cjs +3 -0
- package/dist/connectionState.cjs.map +1 -1
- package/dist/connectionState.d.ts +3 -0
- package/dist/connectionState.d.ts.map +1 -1
- package/dist/container-loader-alpha.d.ts +25 -294
- package/dist/container-loader-beta.d.ts +67 -301
- package/dist/container-loader-public.d.ts +67 -301
- package/dist/container-loader-untrimmed.d.ts +23 -5
- package/dist/container.cjs +11 -8
- package/dist/container.cjs.map +1 -1
- package/dist/container.d.ts +4 -6
- package/dist/container.d.ts.map +1 -1
- package/dist/deltaManager.cjs +18 -1
- package/dist/deltaManager.cjs.map +1 -1
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/loader.cjs +2 -0
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.d.ts +10 -0
- package/dist/loader.d.ts.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.cjs +2 -0
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.cjs.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts +2 -0
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/dist/packageVersion.cjs +1 -1
- package/dist/packageVersion.cjs.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.d.ts +4 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/utils.cjs +1 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -1
- package/lib/connectionState.d.ts +3 -0
- package/lib/connectionState.d.ts.map +1 -1
- package/lib/connectionState.mjs +3 -0
- package/lib/connectionState.mjs.map +1 -1
- package/lib/container-loader-alpha.d.ts +25 -294
- package/lib/container-loader-beta.d.ts +67 -301
- package/lib/container-loader-public.d.ts +67 -301
- package/lib/container-loader-untrimmed.d.ts +23 -5
- package/lib/container.d.ts +4 -6
- package/lib/container.d.ts.map +1 -1
- package/lib/container.mjs +11 -8
- package/lib/container.mjs.map +1 -1
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.mjs +18 -1
- package/lib/deltaManager.mjs.map +1 -1
- package/lib/loader.d.ts +10 -0
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.mjs +2 -0
- package/lib/loader.mjs.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts +2 -0
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.mjs +2 -0
- package/lib/location-redirection-utilities/resolveWithLocationRedirection.mjs.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.mjs +1 -1
- package/lib/packageVersion.mjs.map +1 -1
- package/lib/protocol.d.ts +4 -0
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.mjs.map +1 -1
- package/lib/utils.d.ts +2 -0
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.mjs +1 -0
- package/lib/utils.mjs.map +1 -1
- package/package.json +12 -11
- package/src/connectionState.ts +3 -0
- package/src/container.ts +24 -13
- package/src/deltaManager.ts +25 -1
- package/src/loader.ts +10 -0
- package/src/location-redirection-utilities/resolveWithLocationRedirection.ts +2 -0
- package/src/packageVersion.ts +1 -1
- package/src/protocol.ts +4 -0
- package/src/utils.ts +2 -0
|
@@ -1,312 +1,78 @@
|
|
|
1
|
-
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
2
|
-
import { IAudienceOwner } from '@fluidframework/container-definitions';
|
|
3
1
|
import { IClientDetails } from '@fluidframework/protocol-definitions';
|
|
4
|
-
import { IConfigProviderBase } from '@fluidframework/telemetry-utils';
|
|
5
|
-
import { IContainer } from '@fluidframework/container-definitions';
|
|
6
2
|
import { IDocumentAttributes } from '@fluidframework/protocol-definitions';
|
|
7
|
-
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
8
|
-
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
9
|
-
import { IFluidCodeDetails } from '@fluidframework/container-definitions';
|
|
10
|
-
import { IFluidModule } from '@fluidframework/container-definitions';
|
|
11
|
-
import { IFluidRouter } from '@fluidframework/core-interfaces';
|
|
12
|
-
import { IHostLoader } from '@fluidframework/container-definitions';
|
|
13
|
-
import { ILoaderOptions as ILoaderOptions_2 } from '@fluidframework/container-definitions';
|
|
14
|
-
import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
|
|
15
3
|
import { IProtocolHandler as IProtocolHandler_2 } from '@fluidframework/protocol-base';
|
|
16
|
-
import { IProvideFluidCodeDetailsComparer } from '@fluidframework/container-definitions';
|
|
17
4
|
import { IQuorumSnapshot } from '@fluidframework/protocol-base';
|
|
18
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
19
5
|
import { IRequestHeader } from '@fluidframework/core-interfaces';
|
|
20
|
-
import { IResponse } from '@fluidframework/core-interfaces';
|
|
21
6
|
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* The container is disconnected but actively trying to establish a new connection
|
|
35
|
-
* PLEASE NOTE that this numerical value falls out of the order you may expect for this state
|
|
36
|
-
*/
|
|
37
|
-
EstablishingConnection = 3,
|
|
38
|
-
/**
|
|
39
|
-
* The container has an inbound connection only, and is catching up to the latest known state from the service.
|
|
40
|
-
*/
|
|
41
|
-
CatchingUp = 1,
|
|
42
|
-
/**
|
|
43
|
-
* The container is fully connected and syncing
|
|
44
|
-
*/
|
|
45
|
-
Connected = 2
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated ICodeDetailsLoader interface is moved to {@link @fluidframework/container-definition#ICodeDetailsLoader}
|
|
50
|
-
* to have code loading modules in one package. #8193
|
|
51
|
-
* Fluid code loader resolves a code module matching the document schema, i.e. code details, such as
|
|
52
|
-
* a package name and package version range.
|
|
53
|
-
*/
|
|
54
|
-
export declare interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {
|
|
55
|
-
/**
|
|
56
|
-
* Load the code module (package) that is capable to interact with the document.
|
|
57
|
-
*
|
|
58
|
-
* @param source - Code proposal that articulates the current schema the document is written in.
|
|
59
|
-
* @returns Code module entry point along with the code details associated with it.
|
|
60
|
-
*/
|
|
61
|
-
load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;
|
|
62
|
-
}
|
|
7
|
+
|
|
8
|
+
/* Excluded from this release type: ConnectionState */
|
|
9
|
+
|
|
10
|
+
/* Excluded from this release type: FluidObject */
|
|
11
|
+
|
|
12
|
+
/* Excluded from this release type: IAudienceOwner */
|
|
13
|
+
|
|
14
|
+
/* Excluded from this release type: ICodeDetailsLoader */
|
|
15
|
+
|
|
16
|
+
/* Excluded from this release type: IConfigProviderBase */
|
|
17
|
+
|
|
18
|
+
/* Excluded from this release type: IContainer */
|
|
63
19
|
|
|
64
20
|
/* Excluded from this release type: IContainerExperimental */
|
|
65
21
|
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
* A property bag of options used by various layers
|
|
122
|
-
* to control features
|
|
123
|
-
*/
|
|
124
|
-
readonly options?: ILoaderOptions;
|
|
125
|
-
/**
|
|
126
|
-
* Scope is provided to all container and is a set of shared
|
|
127
|
-
* services for container's to integrate with their host environment.
|
|
128
|
-
*/
|
|
129
|
-
readonly scope?: FluidObject;
|
|
130
|
-
/**
|
|
131
|
-
* The logger that all telemetry should be pushed to.
|
|
132
|
-
*/
|
|
133
|
-
readonly logger?: ITelemetryBaseLogger;
|
|
134
|
-
/**
|
|
135
|
-
* Blobs storage for detached containers.
|
|
136
|
-
*/
|
|
137
|
-
readonly detachedBlobStorage?: IDetachedBlobStorage;
|
|
138
|
-
/**
|
|
139
|
-
* The configuration provider which may be used to control features.
|
|
140
|
-
*/
|
|
141
|
-
readonly configProvider?: IConfigProviderBase;
|
|
142
|
-
/**
|
|
143
|
-
* Optional property for allowing the container to use a custom
|
|
144
|
-
* protocol implementation for handling the quorum and/or the audience.
|
|
145
|
-
*/
|
|
146
|
-
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Services and properties used by and exposed by the loader
|
|
151
|
-
*/
|
|
152
|
-
export declare interface ILoaderServices {
|
|
153
|
-
/**
|
|
154
|
-
* The url resolver used by the loader for resolving external urls
|
|
155
|
-
* into Fluid urls such that the container specified by the
|
|
156
|
-
* external url can be loaded.
|
|
157
|
-
*/
|
|
158
|
-
readonly urlResolver: IUrlResolver;
|
|
159
|
-
/**
|
|
160
|
-
* The document service factory take the Fluid url provided
|
|
161
|
-
* by the resolved url and constructs all the necessary services
|
|
162
|
-
* for communication with the container's server.
|
|
163
|
-
*/
|
|
164
|
-
readonly documentServiceFactory: IDocumentServiceFactory;
|
|
165
|
-
/**
|
|
166
|
-
* The code loader handles loading the necessary code
|
|
167
|
-
* for running a container once it is loaded.
|
|
168
|
-
*/
|
|
169
|
-
readonly codeLoader: ICodeDetailsLoader;
|
|
170
|
-
/**
|
|
171
|
-
* A property bag of options used by various layers
|
|
172
|
-
* to control features
|
|
173
|
-
*/
|
|
174
|
-
readonly options: ILoaderOptions;
|
|
175
|
-
/**
|
|
176
|
-
* Scope is provided to all container and is a set of shared
|
|
177
|
-
* services for container's to integrate with their host environment.
|
|
178
|
-
*/
|
|
179
|
-
readonly scope: FluidObject;
|
|
180
|
-
/**
|
|
181
|
-
* The logger downstream consumers should construct their loggers from
|
|
182
|
-
*/
|
|
183
|
-
readonly subLogger: ITelemetryLoggerExt;
|
|
184
|
-
/**
|
|
185
|
-
* Blobs storage for detached containers.
|
|
186
|
-
*/
|
|
187
|
-
readonly detachedBlobStorage?: IDetachedBlobStorage;
|
|
188
|
-
/**
|
|
189
|
-
* Optional property for allowing the container to use a custom
|
|
190
|
-
* protocol implementation for handling the quorum and/or the audience.
|
|
191
|
-
*/
|
|
192
|
-
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Interface to represent the parsed parts of IResolvedUrl.url to help
|
|
197
|
-
* in getting info about different parts of the url.
|
|
198
|
-
* May not be compatible or relevant for any Url Resolver
|
|
199
|
-
*/
|
|
200
|
-
export declare interface IParsedUrl {
|
|
201
|
-
/**
|
|
202
|
-
* It is combination of tenantid/docId part of the url.
|
|
203
|
-
*/
|
|
204
|
-
id: string;
|
|
205
|
-
/**
|
|
206
|
-
* It is the deep link path in the url.
|
|
207
|
-
*/
|
|
208
|
-
path: string;
|
|
209
|
-
/**
|
|
210
|
-
* Query string part of the url.
|
|
211
|
-
*/
|
|
212
|
-
query: string;
|
|
213
|
-
/**
|
|
214
|
-
* Null means do not use snapshots, undefined means load latest snapshot
|
|
215
|
-
* otherwise it's version ID passed to IDocumentStorageService.getVersions() to figure out what snapshot to use.
|
|
216
|
-
* If needed, can add undefined which is treated by Container.load() as load latest snapshot.
|
|
217
|
-
*/
|
|
218
|
-
version: string | null | undefined;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export declare interface IProtocolHandler extends IProtocolHandler_2 {
|
|
222
|
-
readonly audience: IAudienceOwner;
|
|
223
|
-
processSignal(message: ISignalMessage): any;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Checks if the error is location redirection error.
|
|
228
|
-
* @param error - error whose type is to be determined.
|
|
229
|
-
* @returns `true` is the error is location redirection error, otherwise `false`.
|
|
230
|
-
*/
|
|
231
|
-
export declare function isLocationRedirectionError(error: any): error is ILocationRedirectionError;
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Manages Fluid resource loading
|
|
235
|
-
*/
|
|
236
|
-
export declare class Loader implements IHostLoader {
|
|
237
|
-
readonly services: ILoaderServices;
|
|
238
|
-
private readonly mc;
|
|
239
|
-
constructor(loaderProps: ILoaderProps);
|
|
240
|
-
/**
|
|
241
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
|
|
242
|
-
*/
|
|
243
|
-
get IFluidRouter(): IFluidRouter;
|
|
244
|
-
createDetachedContainer(codeDetails: IFluidCodeDetails, createDetachedProps?: {
|
|
245
|
-
canReconnect?: boolean;
|
|
246
|
-
clientDetailsOverride?: IClientDetails;
|
|
247
|
-
}): Promise<IContainer>;
|
|
248
|
-
rehydrateDetachedContainerFromSnapshot(snapshot: string, createDetachedProps?: {
|
|
249
|
-
canReconnect?: boolean;
|
|
250
|
-
clientDetailsOverride?: IClientDetails;
|
|
251
|
-
}): Promise<IContainer>;
|
|
252
|
-
resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;
|
|
253
|
-
/**
|
|
254
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
|
|
255
|
-
*/
|
|
256
|
-
request(request: IRequest): Promise<IResponse>;
|
|
257
|
-
private resolveCore;
|
|
258
|
-
private loadContainer;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Function to be used for creating a protocol handler.
|
|
263
|
-
*/
|
|
264
|
-
export declare type ProtocolHandlerBuilder = (attributes: IDocumentAttributes, snapshot: IQuorumSnapshot, sendProposal: (key: string, value: any) => number) => IProtocolHandler;
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* With an already-resolved container, we can request a component directly, without loading the container again
|
|
268
|
-
* @param container - a resolved container
|
|
269
|
-
* @returns component on the container
|
|
270
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
271
|
-
*/
|
|
272
|
-
export declare function requestResolvedObjectFromContainer(container: IContainer, headers?: IRequestHeader): Promise<IResponse>;
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Handles location redirection while fulfilling the loader request.
|
|
276
|
-
* @param api - Callback in which user can wrap the loader.resolve or loader.request call.
|
|
277
|
-
* @param request - request to be resolved.
|
|
278
|
-
* @param urlResolver - resolver used to resolve the url.
|
|
279
|
-
* @param logger - logger to send events.
|
|
280
|
-
* @returns Response from the API call.
|
|
281
|
-
*/
|
|
282
|
-
export declare function resolveWithLocationRedirectionHandling<T>(api: (request: IRequest) => Promise<T>, request: IRequest, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger): Promise<T>;
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Utility api to parse the IResolvedUrl.url into specific parts like querystring, path to get
|
|
286
|
-
* deep link info etc.
|
|
287
|
-
* Warning - This function may not be compatible with any Url Resolver's resolved url. It works
|
|
288
|
-
* with urls of type: protocol://<string>/.../..?<querystring>
|
|
289
|
-
* @param url - This is the IResolvedUrl.url part of the resolved url.
|
|
290
|
-
* @returns The IParsedUrl representing the input URL, or undefined if the format was not supported
|
|
291
|
-
*/
|
|
292
|
-
export declare function tryParseCompatibleResolvedUrl(url: string): IParsedUrl | undefined;
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Waits until container connects to delta storage and gets up-to-date.
|
|
296
|
-
*
|
|
297
|
-
* Useful when resolving URIs and hitting 404, due to container being loaded from (stale) snapshot and not being
|
|
298
|
-
* up to date. Host may chose to wait in such case and retry resolving URI.
|
|
299
|
-
*
|
|
300
|
-
* Warning: Will wait infinitely for connection to establish if there is no connection.
|
|
301
|
-
* May result in deadlock if Container.disconnect() is called and never followed by a call to Container.connect().
|
|
302
|
-
*
|
|
303
|
-
* @returns `true`: container is up to date, it processed all the ops that were know at the time of first connection.
|
|
304
|
-
*
|
|
305
|
-
* `false`: storage does not provide indication of how far the client is. Container processed all the ops known to it,
|
|
306
|
-
* but it maybe still behind.
|
|
307
|
-
*
|
|
308
|
-
* @throws an error beginning with `"Container closed"` if the container is closed before it catches up.
|
|
309
|
-
*/
|
|
310
|
-
export declare function waitContainerToCatchUp(container: IContainer): Promise<boolean>;
|
|
22
|
+
/* Excluded from this release type: IDetachedBlobStorage */
|
|
23
|
+
|
|
24
|
+
/* Excluded from this release type: IDocumentServiceFactory */
|
|
25
|
+
|
|
26
|
+
/* Excluded from this release type: IDocumentStorageService */
|
|
27
|
+
|
|
28
|
+
/* Excluded from this release type: IFluidCodeDetails */
|
|
29
|
+
|
|
30
|
+
/* Excluded from this release type: IFluidModule */
|
|
31
|
+
|
|
32
|
+
/* Excluded from this release type: IFluidModuleWithDetails */
|
|
33
|
+
|
|
34
|
+
/* Excluded from this release type: IFluidRouter */
|
|
35
|
+
|
|
36
|
+
/* Excluded from this release type: IHostLoader */
|
|
37
|
+
|
|
38
|
+
/* Excluded from this release type: ILoaderOptions */
|
|
39
|
+
|
|
40
|
+
/* Excluded from this release type: ILoaderOptions_2 */
|
|
41
|
+
|
|
42
|
+
/* Excluded from this release type: ILoaderProps */
|
|
43
|
+
|
|
44
|
+
/* Excluded from this release type: ILoaderServices */
|
|
45
|
+
|
|
46
|
+
/* Excluded from this release type: ILocationRedirectionError */
|
|
47
|
+
|
|
48
|
+
/* Excluded from this release type: IParsedUrl */
|
|
49
|
+
|
|
50
|
+
/* Excluded from this release type: IProtocolHandler */
|
|
51
|
+
|
|
52
|
+
/* Excluded from this release type: IProvideFluidCodeDetailsComparer */
|
|
53
|
+
|
|
54
|
+
/* Excluded from this release type: IRequest */
|
|
55
|
+
|
|
56
|
+
/* Excluded from this release type: IResponse */
|
|
57
|
+
|
|
58
|
+
/* Excluded from this release type: isLocationRedirectionError */
|
|
59
|
+
|
|
60
|
+
/* Excluded from this release type: ITelemetryBaseLogger */
|
|
61
|
+
|
|
62
|
+
/* Excluded from this release type: ITelemetryLoggerExt */
|
|
63
|
+
|
|
64
|
+
/* Excluded from this release type: IUrlResolver */
|
|
65
|
+
|
|
66
|
+
/* Excluded from this release type: Loader */
|
|
67
|
+
|
|
68
|
+
/* Excluded from this release type: ProtocolHandlerBuilder */
|
|
69
|
+
|
|
70
|
+
/* Excluded from this release type: requestResolvedObjectFromContainer */
|
|
71
|
+
|
|
72
|
+
/* Excluded from this release type: resolveWithLocationRedirectionHandling */
|
|
73
|
+
|
|
74
|
+
/* Excluded from this release type: tryParseCompatibleResolvedUrl */
|
|
75
|
+
|
|
76
|
+
/* Excluded from this release type: waitContainerToCatchUp */
|
|
311
77
|
|
|
312
78
|
export { }
|
|
@@ -23,6 +23,9 @@ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
|
23
23
|
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
24
24
|
import { IUrlResolver } from '@fluidframework/driver-definitions';
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
26
29
|
export declare enum ConnectionState {
|
|
27
30
|
/**
|
|
28
31
|
* The container is not connected to the ordering service
|
|
@@ -50,6 +53,7 @@ export declare enum ConnectionState {
|
|
|
50
53
|
* to have code loading modules in one package. #8193
|
|
51
54
|
* Fluid code loader resolves a code module matching the document schema, i.e. code details, such as
|
|
52
55
|
* a package name and package version range.
|
|
56
|
+
* @internal
|
|
53
57
|
*/
|
|
54
58
|
export declare interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {
|
|
55
59
|
/**
|
|
@@ -63,7 +67,7 @@ export declare interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDet
|
|
|
63
67
|
|
|
64
68
|
/**
|
|
65
69
|
* IContainer interface that includes experimental features still under development.
|
|
66
|
-
* @
|
|
70
|
+
* @internal
|
|
67
71
|
*/
|
|
68
72
|
export declare interface IContainerExperimental extends IContainer {
|
|
69
73
|
/**
|
|
@@ -71,15 +75,11 @@ export declare interface IContainerExperimental extends IContainer {
|
|
|
71
75
|
* submission and potential document corruption. The blob returned MUST be deleted if and when this
|
|
72
76
|
* container emits a "connected" event.
|
|
73
77
|
* @returns serialized blob that can be passed to Loader.resolve()
|
|
74
|
-
* @alpha misuse of this API can result in duplicate op submission and potential document corruption
|
|
75
|
-
* {@link https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-loader/closeAndGetPendingLocalState.md}
|
|
76
78
|
*/
|
|
77
79
|
getPendingLocalState?(): Promise<string>;
|
|
78
80
|
/**
|
|
79
81
|
* Closes the container and returns serialized local state intended to be
|
|
80
82
|
* given to a newly loaded container.
|
|
81
|
-
* @alpha
|
|
82
|
-
* {@link https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-loader/closeAndGetPendingLocalState.md}
|
|
83
83
|
*/
|
|
84
84
|
closeAndGetPendingLocalState?(stopBlobAttachingSignal?: AbortSignal): Promise<string>;
|
|
85
85
|
}
|
|
@@ -87,6 +87,7 @@ export declare interface IContainerExperimental extends IContainer {
|
|
|
87
87
|
/**
|
|
88
88
|
* Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support
|
|
89
89
|
* blobs in detached containers.
|
|
90
|
+
* @internal
|
|
90
91
|
*/
|
|
91
92
|
export declare type IDetachedBlobStorage = Pick<IDocumentStorageService, "createBlob" | "readBlob"> & {
|
|
92
93
|
size: number;
|
|
@@ -101,6 +102,7 @@ export declare type IDetachedBlobStorage = Pick<IDocumentStorageService, "create
|
|
|
101
102
|
* {@link @fluidframework/container-definitions#IFluidModuleWithDetails}
|
|
102
103
|
* to have all the code loading modules in one package. #8193
|
|
103
104
|
* Encapsulates a module entry point with corresponding code details.
|
|
105
|
+
* @internal
|
|
104
106
|
*/
|
|
105
107
|
export declare interface IFluidModuleWithDetails {
|
|
106
108
|
/** Fluid code module that implements the runtime factory needed to instantiate the container runtime. */
|
|
@@ -113,12 +115,16 @@ export declare interface IFluidModuleWithDetails {
|
|
|
113
115
|
details: IFluidCodeDetails;
|
|
114
116
|
}
|
|
115
117
|
|
|
118
|
+
/**
|
|
119
|
+
* @internal
|
|
120
|
+
*/
|
|
116
121
|
export declare interface ILoaderOptions extends ILoaderOptions_2 {
|
|
117
122
|
summarizeProtocolTree?: boolean;
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
/**
|
|
121
126
|
* Services and properties necessary for creating a loader
|
|
127
|
+
* @internal
|
|
122
128
|
*/
|
|
123
129
|
export declare interface ILoaderProps {
|
|
124
130
|
/**
|
|
@@ -169,6 +175,7 @@ export declare interface ILoaderProps {
|
|
|
169
175
|
|
|
170
176
|
/**
|
|
171
177
|
* Services and properties used by and exposed by the loader
|
|
178
|
+
* @internal
|
|
172
179
|
*/
|
|
173
180
|
export declare interface ILoaderServices {
|
|
174
181
|
/**
|
|
@@ -217,6 +224,7 @@ export declare interface ILoaderServices {
|
|
|
217
224
|
* Interface to represent the parsed parts of IResolvedUrl.url to help
|
|
218
225
|
* in getting info about different parts of the url.
|
|
219
226
|
* May not be compatible or relevant for any Url Resolver
|
|
227
|
+
* @internal
|
|
220
228
|
*/
|
|
221
229
|
export declare interface IParsedUrl {
|
|
222
230
|
/**
|
|
@@ -239,6 +247,9 @@ export declare interface IParsedUrl {
|
|
|
239
247
|
version: string | null | undefined;
|
|
240
248
|
}
|
|
241
249
|
|
|
250
|
+
/**
|
|
251
|
+
* @internal
|
|
252
|
+
*/
|
|
242
253
|
export declare interface IProtocolHandler extends IProtocolHandler_2 {
|
|
243
254
|
readonly audience: IAudienceOwner;
|
|
244
255
|
processSignal(message: ISignalMessage): any;
|
|
@@ -248,11 +259,13 @@ export declare interface IProtocolHandler extends IProtocolHandler_2 {
|
|
|
248
259
|
* Checks if the error is location redirection error.
|
|
249
260
|
* @param error - error whose type is to be determined.
|
|
250
261
|
* @returns `true` is the error is location redirection error, otherwise `false`.
|
|
262
|
+
* @internal
|
|
251
263
|
*/
|
|
252
264
|
export declare function isLocationRedirectionError(error: any): error is ILocationRedirectionError;
|
|
253
265
|
|
|
254
266
|
/**
|
|
255
267
|
* Manages Fluid resource loading
|
|
268
|
+
* @internal
|
|
256
269
|
*/
|
|
257
270
|
export declare class Loader implements IHostLoader {
|
|
258
271
|
readonly services: ILoaderServices;
|
|
@@ -281,6 +294,7 @@ export declare class Loader implements IHostLoader {
|
|
|
281
294
|
|
|
282
295
|
/**
|
|
283
296
|
* Function to be used for creating a protocol handler.
|
|
297
|
+
* @internal
|
|
284
298
|
*/
|
|
285
299
|
export declare type ProtocolHandlerBuilder = (attributes: IDocumentAttributes, snapshot: IQuorumSnapshot, sendProposal: (key: string, value: any) => number) => IProtocolHandler;
|
|
286
300
|
|
|
@@ -289,6 +303,7 @@ export declare type ProtocolHandlerBuilder = (attributes: IDocumentAttributes, s
|
|
|
289
303
|
* @param container - a resolved container
|
|
290
304
|
* @returns component on the container
|
|
291
305
|
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
306
|
+
* @internal
|
|
292
307
|
*/
|
|
293
308
|
export declare function requestResolvedObjectFromContainer(container: IContainer, headers?: IRequestHeader): Promise<IResponse>;
|
|
294
309
|
|
|
@@ -299,6 +314,7 @@ export declare function requestResolvedObjectFromContainer(container: IContainer
|
|
|
299
314
|
* @param urlResolver - resolver used to resolve the url.
|
|
300
315
|
* @param logger - logger to send events.
|
|
301
316
|
* @returns Response from the API call.
|
|
317
|
+
* @internal
|
|
302
318
|
*/
|
|
303
319
|
export declare function resolveWithLocationRedirectionHandling<T>(api: (request: IRequest) => Promise<T>, request: IRequest, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger): Promise<T>;
|
|
304
320
|
|
|
@@ -309,6 +325,7 @@ export declare function resolveWithLocationRedirectionHandling<T>(api: (request:
|
|
|
309
325
|
* with urls of type: protocol://<string>/.../..?<querystring>
|
|
310
326
|
* @param url - This is the IResolvedUrl.url part of the resolved url.
|
|
311
327
|
* @returns The IParsedUrl representing the input URL, or undefined if the format was not supported
|
|
328
|
+
* @internal
|
|
312
329
|
*/
|
|
313
330
|
export declare function tryParseCompatibleResolvedUrl(url: string): IParsedUrl | undefined;
|
|
314
331
|
|
|
@@ -327,6 +344,7 @@ export declare function tryParseCompatibleResolvedUrl(url: string): IParsedUrl |
|
|
|
327
344
|
* but it maybe still behind.
|
|
328
345
|
*
|
|
329
346
|
* @throws an error beginning with `"Container closed"` if the container is closed before it catches up.
|
|
347
|
+
* @internal
|
|
330
348
|
*/
|
|
331
349
|
export declare function waitContainerToCatchUp(container: IContainer): Promise<boolean>;
|
|
332
350
|
|
package/dist/container.cjs
CHANGED
|
@@ -47,6 +47,7 @@ const hasBlobsSummaryTree = ".hasAttachmentBlobs";
|
|
|
47
47
|
* but it maybe still behind.
|
|
48
48
|
*
|
|
49
49
|
* @throws an error beginning with `"Container closed"` if the container is closed before it catches up.
|
|
50
|
+
* @internal
|
|
50
51
|
*/
|
|
51
52
|
async function waitContainerToCatchUp(container) {
|
|
52
53
|
// Make sure we stop waiting if container is closed.
|
|
@@ -417,11 +418,12 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
417
418
|
...createParamOverrides,
|
|
418
419
|
});
|
|
419
420
|
};
|
|
421
|
+
this._containerId = (0, uuid_1.v4)();
|
|
422
|
+
this.client = Container.setupClient(this._containerId, this.options, this.clientDetailsOverride);
|
|
420
423
|
// Create logger for data stores to use
|
|
421
424
|
const type = this.client.details.type;
|
|
422
425
|
const interactive = this.client.details.capabilities.interactive;
|
|
423
426
|
const clientType = `${interactive ? "interactive" : "noninteractive"}${type !== undefined && type !== "" ? `/${type}` : ""}`;
|
|
424
|
-
this._containerId = (0, uuid_1.v4)();
|
|
425
427
|
// Need to use the property getter for docId because for detached flow we don't have the docId initially.
|
|
426
428
|
// We assign the id later so property getter is used.
|
|
427
429
|
this.subLogger = (0, telemetry_utils_1.createChildLogger)({
|
|
@@ -1253,9 +1255,10 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1253
1255
|
const pkg = getCodeProposal(quorum);
|
|
1254
1256
|
return pkg;
|
|
1255
1257
|
}
|
|
1256
|
-
|
|
1257
|
-
const
|
|
1258
|
-
|
|
1258
|
+
static setupClient(containerId, options, clientDetailsOverride) {
|
|
1259
|
+
const loaderOptionsClient = structuredClone(options?.client);
|
|
1260
|
+
const client = loaderOptionsClient !== undefined
|
|
1261
|
+
? loaderOptionsClient
|
|
1259
1262
|
: {
|
|
1260
1263
|
details: {
|
|
1261
1264
|
capabilities: { interactive: true },
|
|
@@ -1265,20 +1268,20 @@ class Container extends telemetry_utils_1.EventEmitterWithErrorHandling {
|
|
|
1265
1268
|
scopes: [],
|
|
1266
1269
|
user: { id: "" },
|
|
1267
1270
|
};
|
|
1268
|
-
if (
|
|
1271
|
+
if (clientDetailsOverride !== undefined) {
|
|
1269
1272
|
client.details = {
|
|
1270
1273
|
...client.details,
|
|
1271
|
-
...
|
|
1274
|
+
...clientDetailsOverride,
|
|
1272
1275
|
capabilities: {
|
|
1273
1276
|
...client.details.capabilities,
|
|
1274
|
-
...
|
|
1277
|
+
...clientDetailsOverride?.capabilities,
|
|
1275
1278
|
},
|
|
1276
1279
|
};
|
|
1277
1280
|
}
|
|
1278
1281
|
client.details.environment = [
|
|
1279
1282
|
client.details.environment,
|
|
1280
1283
|
` loaderVersion:${packageVersion_1.pkgVersion}`,
|
|
1281
|
-
` containerId:${
|
|
1284
|
+
` containerId:${containerId}`,
|
|
1282
1285
|
].join(";");
|
|
1283
1286
|
return client;
|
|
1284
1287
|
}
|