@fluidframework/container-loader 2.0.0-internal.7.1.0 → 2.0.0-internal.7.2.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-report/container-loader.api.md +13 -2
  3. package/dist/connectionManager.d.ts +1 -1
  4. package/dist/connectionManager.d.ts.map +1 -1
  5. package/dist/connectionManager.js +9 -4
  6. package/dist/connectionManager.js.map +1 -1
  7. package/dist/container.d.ts +6 -5
  8. package/dist/container.d.ts.map +1 -1
  9. package/dist/container.js +21 -19
  10. package/dist/container.js.map +1 -1
  11. package/dist/containerContext.d.ts +2 -2
  12. package/dist/containerContext.d.ts.map +1 -1
  13. package/dist/containerContext.js.map +1 -1
  14. package/dist/containerStorageAdapter.d.ts +1 -1
  15. package/dist/containerStorageAdapter.d.ts.map +1 -1
  16. package/dist/containerStorageAdapter.js +3 -3
  17. package/dist/containerStorageAdapter.js.map +1 -1
  18. package/dist/contracts.d.ts +1 -1
  19. package/dist/contracts.d.ts.map +1 -1
  20. package/dist/contracts.js.map +1 -1
  21. package/dist/deltaManager.d.ts +1 -1
  22. package/dist/deltaManager.d.ts.map +1 -1
  23. package/dist/deltaManager.js +3 -8
  24. package/dist/deltaManager.js.map +1 -1
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +3 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/loader.d.ts +4 -4
  30. package/dist/loader.js +7 -7
  31. package/dist/loader.js.map +1 -1
  32. package/dist/packageVersion.d.ts +1 -1
  33. package/dist/packageVersion.js +1 -1
  34. package/dist/packageVersion.js.map +1 -1
  35. package/dist/retriableDocumentStorageService.d.ts +3 -2
  36. package/dist/retriableDocumentStorageService.d.ts.map +1 -1
  37. package/dist/retriableDocumentStorageService.js +18 -11
  38. package/dist/retriableDocumentStorageService.js.map +1 -1
  39. package/dist/utils.d.ts +23 -1
  40. package/dist/utils.d.ts.map +1 -1
  41. package/dist/utils.js +11 -3
  42. package/dist/utils.js.map +1 -1
  43. package/lib/connectionManager.d.ts +1 -1
  44. package/lib/connectionManager.d.ts.map +1 -1
  45. package/lib/connectionManager.js +9 -4
  46. package/lib/connectionManager.js.map +1 -1
  47. package/lib/container.d.ts +6 -5
  48. package/lib/container.d.ts.map +1 -1
  49. package/lib/container.js +21 -19
  50. package/lib/container.js.map +1 -1
  51. package/lib/containerContext.d.ts +2 -2
  52. package/lib/containerContext.d.ts.map +1 -1
  53. package/lib/containerContext.js.map +1 -1
  54. package/lib/containerStorageAdapter.d.ts +1 -1
  55. package/lib/containerStorageAdapter.d.ts.map +1 -1
  56. package/lib/containerStorageAdapter.js +3 -3
  57. package/lib/containerStorageAdapter.js.map +1 -1
  58. package/lib/contracts.d.ts +1 -1
  59. package/lib/contracts.d.ts.map +1 -1
  60. package/lib/contracts.js.map +1 -1
  61. package/lib/deltaManager.d.ts +1 -1
  62. package/lib/deltaManager.d.ts.map +1 -1
  63. package/lib/deltaManager.js +3 -8
  64. package/lib/deltaManager.js.map +1 -1
  65. package/lib/index.d.ts +1 -0
  66. package/lib/index.d.ts.map +1 -1
  67. package/lib/index.js +1 -0
  68. package/lib/index.js.map +1 -1
  69. package/lib/loader.d.ts +4 -4
  70. package/lib/loader.js +8 -8
  71. package/lib/loader.js.map +1 -1
  72. package/lib/packageVersion.d.ts +1 -1
  73. package/lib/packageVersion.js +1 -1
  74. package/lib/packageVersion.js.map +1 -1
  75. package/lib/retriableDocumentStorageService.d.ts +3 -2
  76. package/lib/retriableDocumentStorageService.d.ts.map +1 -1
  77. package/lib/retriableDocumentStorageService.js +18 -11
  78. package/lib/retriableDocumentStorageService.js.map +1 -1
  79. package/lib/utils.d.ts +23 -1
  80. package/lib/utils.d.ts.map +1 -1
  81. package/lib/utils.js +9 -1
  82. package/lib/utils.js.map +1 -1
  83. package/package.json +16 -17
  84. package/src/connectionManager.ts +13 -5
  85. package/src/container.ts +34 -24
  86. package/src/containerContext.ts +1 -1
  87. package/src/containerStorageAdapter.ts +3 -3
  88. package/src/contracts.ts +1 -1
  89. package/src/deltaManager.ts +6 -23
  90. package/src/index.ts +1 -0
  91. package/src/loader.ts +8 -8
  92. package/src/packageVersion.ts +1 -1
  93. package/src/retriableDocumentStorageService.ts +29 -15
  94. package/src/utils.ts +23 -1
  95. package/dist/container-loader-alpha.d.ts +0 -297
  96. package/dist/container-loader-beta.d.ts +0 -297
  97. package/dist/container-loader-public.d.ts +0 -297
  98. package/dist/container-loader.d.ts +0 -297
@@ -1,297 +0,0 @@
1
- import { FluidObject } from '@fluidframework/core-interfaces';
2
- import { IAudienceOwner } from '@fluidframework/container-definitions';
3
- import { IClientDetails } from '@fluidframework/protocol-definitions';
4
- import { IConfigProviderBase } from '@fluidframework/telemetry-utils';
5
- import { IContainer } from '@fluidframework/container-definitions';
6
- 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
- import { IProtocolHandler as IProtocolHandler_2 } from '@fluidframework/protocol-base';
16
- import { IProvideFluidCodeDetailsComparer } from '@fluidframework/container-definitions';
17
- import { IQuorumSnapshot } from '@fluidframework/protocol-base';
18
- import { IRequest } from '@fluidframework/core-interfaces';
19
- import { IRequestHeader } from '@fluidframework/core-interfaces';
20
- import { IResponse } from '@fluidframework/core-interfaces';
21
- import { ISignalMessage } from '@fluidframework/protocol-definitions';
22
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
23
- import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
24
- import { IUrlResolver } from '@fluidframework/driver-definitions';
25
-
26
- export declare enum ConnectionState {
27
- /**
28
- * The container is not connected to the ordering service
29
- * Note - When in this state the container may be about to reconnect,
30
- * or may remain disconnected until explicitly told to connect.
31
- */
32
- Disconnected = 0,
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
- }
63
-
64
- /**
65
- * IContainer interface that includes experimental features still under development.
66
- * @experimental
67
- */
68
- export declare interface IContainerExperimental extends IContainer {
69
- /**
70
- * Get pending state from container. WARNING: misuse of this API can result in duplicate op
71
- * submission and potential document corruption. The blob returned MUST be deleted if and when this
72
- * container emits a "connected" event.
73
- * @returns serialized blob that can be passed to Loader.resolve()
74
- * @experimental 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
- */
77
- getPendingLocalState?(): Promise<string>;
78
- /**
79
- * Closes the container and returns serialized local state intended to be
80
- * given to a newly loaded container.
81
- * @experimental
82
- * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-loader/closeAndGetPendingLocalState.md}
83
- */
84
- closeAndGetPendingLocalState?(): Promise<string>;
85
- }
86
-
87
- /**
88
- * Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support
89
- * blobs in detached containers.
90
- */
91
- export declare type IDetachedBlobStorage = Pick<IDocumentStorageService, "createBlob" | "readBlob"> & {
92
- size: number;
93
- /**
94
- * Return an array of all blob IDs present in storage
95
- */
96
- getBlobIds(): string[];
97
- };
98
-
99
- /**
100
- * @deprecated IFluidModuleWithDetails interface is moved to
101
- * {@link @fluidframework/container-definitions#IFluidModuleWithDetails}
102
- * to have all the code loading modules in one package. #8193
103
- * Encapsulates a module entry point with corresponding code details.
104
- */
105
- export declare interface IFluidModuleWithDetails {
106
- /** Fluid code module that implements the runtime factory needed to instantiate the container runtime. */
107
- module: IFluidModule;
108
- /**
109
- * Code details associated with the module. Represents a document schema this module supports.
110
- * If the code loader implements the {@link @fluidframework/core-interfaces#IFluidCodeDetailsComparer} interface,
111
- * it'll be called to determine whether the module code details satisfy the new code proposal in the quorum.
112
- */
113
- details: IFluidCodeDetails;
114
- }
115
-
116
- export declare interface ILoaderOptions extends ILoaderOptions_2 {
117
- summarizeProtocolTree?: boolean;
118
- }
119
-
120
- /**
121
- * Services and properties necessary for creating a loader
122
- */
123
- export declare interface ILoaderProps {
124
- /**
125
- * The url resolver used by the loader for resolving external urls
126
- * into Fluid urls such that the container specified by the
127
- * external url can be loaded.
128
- */
129
- readonly urlResolver: IUrlResolver;
130
- /**
131
- * The document service factory take the Fluid url provided
132
- * by the resolved url and constructs all the necessary services
133
- * for communication with the container's server.
134
- */
135
- readonly documentServiceFactory: IDocumentServiceFactory;
136
- /**
137
- * The code loader handles loading the necessary code
138
- * for running a container once it is loaded.
139
- */
140
- readonly codeLoader: ICodeDetailsLoader;
141
- /**
142
- * A property bag of options used by various layers
143
- * to control features
144
- */
145
- readonly options?: ILoaderOptions;
146
- /**
147
- * Scope is provided to all container and is a set of shared
148
- * services for container's to integrate with their host environment.
149
- */
150
- readonly scope?: FluidObject;
151
- /**
152
- * The logger that all telemetry should be pushed to.
153
- */
154
- readonly logger?: ITelemetryBaseLogger;
155
- /**
156
- * Blobs storage for detached containers.
157
- */
158
- readonly detachedBlobStorage?: IDetachedBlobStorage;
159
- /**
160
- * The configuration provider which may be used to control features.
161
- */
162
- readonly configProvider?: IConfigProviderBase;
163
- /**
164
- * Optional property for allowing the container to use a custom
165
- * protocol implementation for handling the quorum and/or the audience.
166
- */
167
- readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
168
- }
169
-
170
- /**
171
- * Services and properties used by and exposed by the loader
172
- */
173
- export declare interface ILoaderServices {
174
- /**
175
- * The url resolver used by the loader for resolving external urls
176
- * into Fluid urls such that the container specified by the
177
- * external url can be loaded.
178
- */
179
- readonly urlResolver: IUrlResolver;
180
- /**
181
- * The document service factory take the Fluid url provided
182
- * by the resolved url and constructs all the necessary services
183
- * for communication with the container's server.
184
- */
185
- readonly documentServiceFactory: IDocumentServiceFactory;
186
- /**
187
- * The code loader handles loading the necessary code
188
- * for running a container once it is loaded.
189
- */
190
- readonly codeLoader: ICodeDetailsLoader;
191
- /**
192
- * A property bag of options used by various layers
193
- * to control features
194
- */
195
- readonly options: ILoaderOptions;
196
- /**
197
- * Scope is provided to all container and is a set of shared
198
- * services for container's to integrate with their host environment.
199
- */
200
- readonly scope: FluidObject;
201
- /**
202
- * The logger downstream consumers should construct their loggers from
203
- */
204
- readonly subLogger: ITelemetryLoggerExt;
205
- /**
206
- * Blobs storage for detached containers.
207
- */
208
- readonly detachedBlobStorage?: IDetachedBlobStorage;
209
- /**
210
- * Optional property for allowing the container to use a custom
211
- * protocol implementation for handling the quorum and/or the audience.
212
- */
213
- readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
214
- }
215
-
216
- export declare interface IProtocolHandler extends IProtocolHandler_2 {
217
- readonly audience: IAudienceOwner;
218
- processSignal(message: ISignalMessage): any;
219
- }
220
-
221
- /**
222
- * Checks if the error is location redirection error.
223
- * @param error - error whose type is to be determined.
224
- * @returns `true` is the error is location redirection error, otherwise `false`.
225
- */
226
- export declare function isLocationRedirectionError(error: any): error is ILocationRedirectionError;
227
-
228
- /**
229
- * Manages Fluid resource loading
230
- */
231
- export declare class Loader implements IHostLoader {
232
- readonly services: ILoaderServices;
233
- private readonly mc;
234
- constructor(loaderProps: ILoaderProps);
235
- /**
236
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
237
- */
238
- get IFluidRouter(): IFluidRouter;
239
- createDetachedContainer(codeDetails: IFluidCodeDetails, createDetachedProps?: {
240
- canReconnect?: boolean;
241
- clientDetailsOverride?: IClientDetails;
242
- }): Promise<IContainer>;
243
- rehydrateDetachedContainerFromSnapshot(snapshot: string, createDetachedProps?: {
244
- canReconnect?: boolean;
245
- clientDetailsOverride?: IClientDetails;
246
- }): Promise<IContainer>;
247
- resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;
248
- /**
249
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
250
- */
251
- request(request: IRequest): Promise<IResponse>;
252
- private resolveCore;
253
- private loadContainer;
254
- }
255
-
256
- /**
257
- * Function to be used for creating a protocol handler.
258
- */
259
- export declare type ProtocolHandlerBuilder = (attributes: IDocumentAttributes, snapshot: IQuorumSnapshot, sendProposal: (key: string, value: any) => number) => IProtocolHandler;
260
-
261
- /**
262
- * With an already-resolved container, we can request a component directly, without loading the container again
263
- * @param container - a resolved container
264
- * @returns component on the container
265
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
266
- */
267
- export declare function requestResolvedObjectFromContainer(container: IContainer, headers?: IRequestHeader): Promise<IResponse>;
268
-
269
- /**
270
- * Handles location redirection while fulfilling the loader request.
271
- * @param api - Callback in which user can wrap the loader.resolve or loader.request call.
272
- * @param request - request to be resolved.
273
- * @param urlResolver - resolver used to resolve the url.
274
- * @param logger - logger to send events.
275
- * @returns Response from the API call.
276
- */
277
- export declare function resolveWithLocationRedirectionHandling<T>(api: (request: IRequest) => Promise<T>, request: IRequest, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger): Promise<T>;
278
-
279
- /**
280
- * Waits until container connects to delta storage and gets up-to-date.
281
- *
282
- * Useful when resolving URIs and hitting 404, due to container being loaded from (stale) snapshot and not being
283
- * up to date. Host may chose to wait in such case and retry resolving URI.
284
- *
285
- * Warning: Will wait infinitely for connection to establish if there is no connection.
286
- * May result in deadlock if Container.disconnect() is called and never followed by a call to Container.connect().
287
- *
288
- * @returns `true`: container is up to date, it processed all the ops that were know at the time of first connection.
289
- *
290
- * `false`: storage does not provide indication of how far the client is. Container processed all the ops known to it,
291
- * but it maybe still behind.
292
- *
293
- * @throws an error beginning with `"Container closed"` if the container is closed before it catches up.
294
- */
295
- export declare function waitContainerToCatchUp(container: IContainer): Promise<boolean>;
296
-
297
- export { }