@fluidframework/container-loader 2.0.0-dev.7.2.0.204906 → 2.0.0-dev.7.3.0.206769

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 (55) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-report/container-loader.api.md +2 -2
  3. package/dist/connectionManager.d.ts +1 -1
  4. package/dist/connectionManager.d.ts.map +1 -1
  5. package/dist/connectionManager.js +6 -2
  6. package/dist/connectionManager.js.map +1 -1
  7. package/dist/container.d.ts +5 -5
  8. package/dist/container.d.ts.map +1 -1
  9. package/dist/container.js +8 -5
  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/contracts.d.ts +1 -1
  15. package/dist/contracts.d.ts.map +1 -1
  16. package/dist/contracts.js.map +1 -1
  17. package/dist/deltaManager.d.ts +1 -1
  18. package/dist/deltaManager.d.ts.map +1 -1
  19. package/dist/deltaManager.js +2 -2
  20. package/dist/deltaManager.js.map +1 -1
  21. package/dist/packageVersion.d.ts +1 -1
  22. package/dist/packageVersion.js +1 -1
  23. package/dist/packageVersion.js.map +1 -1
  24. package/lib/connectionManager.d.ts +1 -1
  25. package/lib/connectionManager.d.ts.map +1 -1
  26. package/lib/connectionManager.js +6 -2
  27. package/lib/connectionManager.js.map +1 -1
  28. package/lib/container.d.ts +5 -5
  29. package/lib/container.d.ts.map +1 -1
  30. package/lib/container.js +8 -5
  31. package/lib/container.js.map +1 -1
  32. package/lib/containerContext.d.ts +2 -2
  33. package/lib/containerContext.d.ts.map +1 -1
  34. package/lib/containerContext.js.map +1 -1
  35. package/lib/contracts.d.ts +1 -1
  36. package/lib/contracts.d.ts.map +1 -1
  37. package/lib/contracts.js.map +1 -1
  38. package/lib/deltaManager.d.ts +1 -1
  39. package/lib/deltaManager.d.ts.map +1 -1
  40. package/lib/deltaManager.js +2 -2
  41. package/lib/deltaManager.js.map +1 -1
  42. package/lib/packageVersion.d.ts +1 -1
  43. package/lib/packageVersion.js +1 -1
  44. package/lib/packageVersion.js.map +1 -1
  45. package/package.json +14 -14
  46. package/src/connectionManager.ts +10 -2
  47. package/src/container.ts +16 -10
  48. package/src/containerContext.ts +1 -1
  49. package/src/contracts.ts +1 -1
  50. package/src/deltaManager.ts +2 -2
  51. package/src/packageVersion.ts +1 -1
  52. package/dist/container-loader-alpha.d.ts +0 -333
  53. package/dist/container-loader-beta.d.ts +0 -333
  54. package/dist/container-loader-public.d.ts +0 -333
  55. package/dist/container-loader-untrimmed.d.ts +0 -333
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-loader",
3
- "version": "2.0.0-dev.7.2.0.204906",
3
+ "version": "2.0.0-dev.7.3.0.206769",
4
4
  "description": "Fluid container loader",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,15 +35,15 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluid-internal/client-utils": "2.0.0-dev.7.2.0.204906",
39
- "@fluidframework/container-definitions": "2.0.0-dev.7.2.0.204906",
40
- "@fluidframework/core-interfaces": "2.0.0-dev.7.2.0.204906",
41
- "@fluidframework/core-utils": "2.0.0-dev.7.2.0.204906",
42
- "@fluidframework/driver-definitions": "2.0.0-dev.7.2.0.204906",
43
- "@fluidframework/driver-utils": "2.0.0-dev.7.2.0.204906",
38
+ "@fluid-internal/client-utils": "2.0.0-dev.7.3.0.206769",
39
+ "@fluidframework/container-definitions": "2.0.0-dev.7.3.0.206769",
40
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.3.0.206769",
41
+ "@fluidframework/core-utils": "2.0.0-dev.7.3.0.206769",
42
+ "@fluidframework/driver-definitions": "2.0.0-dev.7.3.0.206769",
43
+ "@fluidframework/driver-utils": "2.0.0-dev.7.3.0.206769",
44
44
  "@fluidframework/protocol-base": "^2.0.1",
45
45
  "@fluidframework/protocol-definitions": "^3.0.0",
46
- "@fluidframework/telemetry-utils": "2.0.0-dev.7.2.0.204906",
46
+ "@fluidframework/telemetry-utils": "2.0.0-dev.7.3.0.206769",
47
47
  "debug": "^4.3.4",
48
48
  "double-ended-queue": "^2.1.0-0",
49
49
  "events": "^3.1.0",
@@ -52,13 +52,13 @@
52
52
  "uuid": "^9.0.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@fluid-internal/test-loader-utils": "2.0.0-dev.7.2.0.204906",
56
- "@fluid-tools/build-cli": "0.26.0-203096",
57
- "@fluidframework/build-common": "^2.0.2",
58
- "@fluidframework/build-tools": "0.26.0-203096",
55
+ "@fluid-internal/test-loader-utils": "2.0.0-dev.7.3.0.206769",
56
+ "@fluid-tools/build-cli": "^0.26.1",
57
+ "@fluidframework/build-common": "^2.0.3",
58
+ "@fluidframework/build-tools": "^0.26.1",
59
59
  "@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.0.0-internal.7.1.0",
60
60
  "@fluidframework/eslint-config-fluid": "^3.0.0",
61
- "@fluidframework/mocha-test-setup": "2.0.0-dev.7.2.0.204906",
61
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.3.0.206769",
62
62
  "@microsoft/api-extractor": "^7.37.0",
63
63
  "@types/double-ended-queue": "^2.1.0",
64
64
  "@types/events": "^3.0.0",
@@ -90,7 +90,7 @@
90
90
  "build:genver": "gen-version",
91
91
  "build:test": "tsc --project ./src/test/tsconfig.json",
92
92
  "ci:build:docs": "api-extractor run",
93
- "clean": "rimraf --glob 'dist' 'lib' '*.tsbuildinfo' '*.build.log' '_api-extractor-temp' 'nyc'",
93
+ "clean": "rimraf --glob dist lib \"*.tsbuildinfo\" \"*.build.log\" _api-extractor-temp nyc",
94
94
  "eslint": "eslint --format stylish src",
95
95
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
96
96
  "format": "npm run prettier:fix",
@@ -594,6 +594,14 @@ export class ConnectionManager implements IConnectionManager {
594
594
  LogLevel.verbose,
595
595
  );
596
596
  } catch (origError: any) {
597
+ this.logger.sendTelemetryEvent(
598
+ {
599
+ eventName: "ConnectToDeltaStreamException",
600
+ connected: connection !== undefined && connection.disposed === false,
601
+ },
602
+ undefined,
603
+ LogLevel.verbose,
604
+ );
597
605
  if (isDeltaStreamConnectionForbiddenError(origError)) {
598
606
  connection = new NoDeltaStream(origError.storageOnlyReason, {
599
607
  text: origError.message,
@@ -1059,9 +1067,9 @@ export class ConnectionManager implements IConnectionManager {
1059
1067
  };
1060
1068
  }
1061
1069
 
1062
- public submitSignal(content: any) {
1070
+ public submitSignal(content: any, targetClientId?: string) {
1063
1071
  if (this.connection !== undefined) {
1064
- this.connection.submitSignal(content);
1072
+ this.connection.submitSignal(content, targetClientId);
1065
1073
  } else {
1066
1074
  this.logger.sendErrorEvent({ eventName: "submitSignalDisconnected" });
1067
1075
  }
package/src/container.ts CHANGED
@@ -40,6 +40,7 @@ import {
40
40
  IRuntime,
41
41
  ReadOnlyInfo,
42
42
  isFluidCodeDetails,
43
+ IGetPendingLocalStateProps,
43
44
  } from "@fluidframework/container-definitions";
44
45
  import {
45
46
  IDocumentService,
@@ -1112,12 +1113,17 @@ export class Container
1112
1113
  }
1113
1114
  }
1114
1115
 
1115
- public async closeAndGetPendingLocalState(): Promise<string> {
1116
+ public async closeAndGetPendingLocalState(
1117
+ stopBlobAttachingSignal?: AbortSignal,
1118
+ ): Promise<string> {
1116
1119
  // runtime matches pending ops to successful ones by clientId and client seq num, so we need to close the
1117
1120
  // container at the same time we get pending state, otherwise this container could reconnect and resubmit with
1118
1121
  // a new clientId and a future container using stale pending state without the new clientId would resubmit them
1119
1122
  this.disconnectInternal({ text: "closeAndGetPendingLocalState" }); // TODO https://dev.azure.com/fluidframework/internal/_workitems/edit/5127
1120
- const pendingState = await this.getPendingLocalStateCore({ notifyImminentClosure: true });
1123
+ const pendingState = await this.getPendingLocalStateCore({
1124
+ notifyImminentClosure: true,
1125
+ stopBlobAttachingSignal,
1126
+ });
1121
1127
  this.close();
1122
1128
  return pendingState;
1123
1129
  }
@@ -1126,7 +1132,7 @@ export class Container
1126
1132
  return this.getPendingLocalStateCore({ notifyImminentClosure: false });
1127
1133
  }
1128
1134
 
1129
- private async getPendingLocalStateCore(props: { notifyImminentClosure: boolean }) {
1135
+ private async getPendingLocalStateCore(props: IGetPendingLocalStateProps) {
1130
1136
  return PerformanceEvent.timedExecAsync(
1131
1137
  this.mc.logger,
1132
1138
  {
@@ -2339,8 +2345,8 @@ export class Container
2339
2345
  this.emit("op", message);
2340
2346
  }
2341
2347
 
2342
- private submitSignal(message: any) {
2343
- this._deltaManager.submitSignal(JSON.stringify(message));
2348
+ private submitSignal(content: any, targetClientId?: string) {
2349
+ this._deltaManager.submitSignal(JSON.stringify(content), targetClientId);
2344
2350
  }
2345
2351
 
2346
2352
  private processSignal(message: ISignalMessage) {
@@ -2434,7 +2440,7 @@ export class Container
2434
2440
  this.submitSummaryMessage(summaryOp, referenceSequenceNumber),
2435
2441
  (batch: IBatchMessage[], referenceSequenceNumber?: number) =>
2436
2442
  this.submitBatch(batch, referenceSequenceNumber),
2437
- (message) => this.submitSignal(message),
2443
+ (content, targetClientId) => this.submitSignal(content, targetClientId),
2438
2444
  (error?: ICriticalContainerError) => this.dispose(error),
2439
2445
  (error?: ICriticalContainerError) => this.close(error),
2440
2446
  this.updateDirtyContainerState,
@@ -2517,7 +2523,7 @@ export class Container
2517
2523
 
2518
2524
  /**
2519
2525
  * IContainer interface that includes experimental features still under development.
2520
- * @experimental
2526
+ * @alpha
2521
2527
  */
2522
2528
  export interface IContainerExperimental extends IContainer {
2523
2529
  /**
@@ -2525,7 +2531,7 @@ export interface IContainerExperimental extends IContainer {
2525
2531
  * submission and potential document corruption. The blob returned MUST be deleted if and when this
2526
2532
  * container emits a "connected" event.
2527
2533
  * @returns serialized blob that can be passed to Loader.resolve()
2528
- * @experimental misuse of this API can result in duplicate op submission and potential document corruption
2534
+ * @alpha misuse of this API can result in duplicate op submission and potential document corruption
2529
2535
  * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-loader/closeAndGetPendingLocalState.md}
2530
2536
  */
2531
2537
  getPendingLocalState?(): Promise<string>;
@@ -2533,8 +2539,8 @@ export interface IContainerExperimental extends IContainer {
2533
2539
  /**
2534
2540
  * Closes the container and returns serialized local state intended to be
2535
2541
  * given to a newly loaded container.
2536
- * @experimental
2542
+ * @alpha
2537
2543
  * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-loader/closeAndGetPendingLocalState.md}
2538
2544
  */
2539
- closeAndGetPendingLocalState?(): Promise<string>;
2545
+ closeAndGetPendingLocalState?(stopBlobAttachingSignal?: AbortSignal): Promise<string>;
2540
2546
  }
@@ -85,7 +85,7 @@ export class ContainerContext implements IContainerContext {
85
85
  batch: IBatchMessage[],
86
86
  referenceSequenceNumber?: number,
87
87
  ) => number,
88
- public readonly submitSignalFn: (contents: any) => void,
88
+ public readonly submitSignalFn: (content: any, targetClientId?: string) => void,
89
89
  public readonly disposeFn: (error?: ICriticalContainerError) => void,
90
90
  public readonly closeFn: (error?: ICriticalContainerError) => void,
91
91
  public readonly updateDirtyContainerState: (dirty: boolean) => void,
package/src/contracts.ts CHANGED
@@ -100,7 +100,7 @@ export interface IConnectionManager {
100
100
  * Submits signal to relay service.
101
101
  * Called only when active connection is present.
102
102
  */
103
- submitSignal(content: any): void;
103
+ submitSignal(content: any, targetClientId?: string): void;
104
104
 
105
105
  /**
106
106
  * Submits messages to relay service.
@@ -301,8 +301,8 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
301
301
  return message.clientSequenceNumber;
302
302
  }
303
303
 
304
- public submitSignal(content: any) {
305
- return this.connectionManager.submitSignal(content);
304
+ public submitSignal(content: any, targetClientId?: string) {
305
+ return this.connectionManager.submitSignal(content, targetClientId);
306
306
  }
307
307
 
308
308
  public flush() {
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-loader";
9
- export const pkgVersion = "2.0.0-dev.7.2.0.204906";
9
+ export const pkgVersion = "2.0.0-dev.7.3.0.206769";
@@ -1,333 +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
- /**
217
- * Interface to represent the parsed parts of IResolvedUrl.url to help
218
- * in getting info about different parts of the url.
219
- * May not be compatible or relevant for any Url Resolver
220
- */
221
- export declare interface IParsedUrl {
222
- /**
223
- * It is combination of tenantid/docId part of the url.
224
- */
225
- id: string;
226
- /**
227
- * It is the deep link path in the url.
228
- */
229
- path: string;
230
- /**
231
- * Query string part of the url.
232
- */
233
- query: string;
234
- /**
235
- * Null means do not use snapshots, undefined means load latest snapshot
236
- * otherwise it's version ID passed to IDocumentStorageService.getVersions() to figure out what snapshot to use.
237
- * If needed, can add undefined which is treated by Container.load() as load latest snapshot.
238
- */
239
- version: string | null | undefined;
240
- }
241
-
242
- export declare interface IProtocolHandler extends IProtocolHandler_2 {
243
- readonly audience: IAudienceOwner;
244
- processSignal(message: ISignalMessage): any;
245
- }
246
-
247
- /**
248
- * Checks if the error is location redirection error.
249
- * @param error - error whose type is to be determined.
250
- * @returns `true` is the error is location redirection error, otherwise `false`.
251
- */
252
- export declare function isLocationRedirectionError(error: any): error is ILocationRedirectionError;
253
-
254
- /**
255
- * Manages Fluid resource loading
256
- */
257
- export declare class Loader implements IHostLoader {
258
- readonly services: ILoaderServices;
259
- private readonly mc;
260
- constructor(loaderProps: ILoaderProps);
261
- /**
262
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
263
- */
264
- get IFluidRouter(): IFluidRouter;
265
- createDetachedContainer(codeDetails: IFluidCodeDetails, createDetachedProps?: {
266
- canReconnect?: boolean;
267
- clientDetailsOverride?: IClientDetails;
268
- }): Promise<IContainer>;
269
- rehydrateDetachedContainerFromSnapshot(snapshot: string, createDetachedProps?: {
270
- canReconnect?: boolean;
271
- clientDetailsOverride?: IClientDetails;
272
- }): Promise<IContainer>;
273
- resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;
274
- /**
275
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
276
- */
277
- request(request: IRequest): Promise<IResponse>;
278
- private resolveCore;
279
- private loadContainer;
280
- }
281
-
282
- /**
283
- * Function to be used for creating a protocol handler.
284
- */
285
- export declare type ProtocolHandlerBuilder = (attributes: IDocumentAttributes, snapshot: IQuorumSnapshot, sendProposal: (key: string, value: any) => number) => IProtocolHandler;
286
-
287
- /**
288
- * With an already-resolved container, we can request a component directly, without loading the container again
289
- * @param container - a resolved container
290
- * @returns component on the container
291
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
292
- */
293
- export declare function requestResolvedObjectFromContainer(container: IContainer, headers?: IRequestHeader): Promise<IResponse>;
294
-
295
- /**
296
- * Handles location redirection while fulfilling the loader request.
297
- * @param api - Callback in which user can wrap the loader.resolve or loader.request call.
298
- * @param request - request to be resolved.
299
- * @param urlResolver - resolver used to resolve the url.
300
- * @param logger - logger to send events.
301
- * @returns Response from the API call.
302
- */
303
- export declare function resolveWithLocationRedirectionHandling<T>(api: (request: IRequest) => Promise<T>, request: IRequest, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger): Promise<T>;
304
-
305
- /**
306
- * Utility api to parse the IResolvedUrl.url into specific parts like querystring, path to get
307
- * deep link info etc.
308
- * Warning - This function may not be compatible with any Url Resolver's resolved url. It works
309
- * with urls of type: protocol://<string>/.../..?<querystring>
310
- * @param url - This is the IResolvedUrl.url part of the resolved url.
311
- * @returns The IParsedUrl representing the input URL, or undefined if the format was not supported
312
- */
313
- export declare function tryParseCompatibleResolvedUrl(url: string): IParsedUrl | undefined;
314
-
315
- /**
316
- * Waits until container connects to delta storage and gets up-to-date.
317
- *
318
- * Useful when resolving URIs and hitting 404, due to container being loaded from (stale) snapshot and not being
319
- * up to date. Host may chose to wait in such case and retry resolving URI.
320
- *
321
- * Warning: Will wait infinitely for connection to establish if there is no connection.
322
- * May result in deadlock if Container.disconnect() is called and never followed by a call to Container.connect().
323
- *
324
- * @returns `true`: container is up to date, it processed all the ops that were know at the time of first connection.
325
- *
326
- * `false`: storage does not provide indication of how far the client is. Container processed all the ops known to it,
327
- * but it maybe still behind.
328
- *
329
- * @throws an error beginning with `"Container closed"` if the container is closed before it catches up.
330
- */
331
- export declare function waitContainerToCatchUp(container: IContainer): Promise<boolean>;
332
-
333
- export { }