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