@fluidframework/container-definitions 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.204906

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 (75) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/api-extractor.json +1 -1
  3. package/api-report/container-definitions.api.md +538 -0
  4. package/dist/audience.d.ts +2 -0
  5. package/dist/audience.d.ts.map +1 -1
  6. package/dist/audience.js.map +1 -1
  7. package/dist/browserPackage.d.ts +3 -0
  8. package/dist/browserPackage.d.ts.map +1 -1
  9. package/dist/browserPackage.js +1 -0
  10. package/dist/browserPackage.js.map +1 -1
  11. package/dist/container-definitions-alpha.d.ts +1455 -0
  12. package/dist/container-definitions-beta.d.ts +1450 -0
  13. package/dist/container-definitions-public.d.ts +1450 -0
  14. package/dist/container-definitions-untrimmed.d.ts +1455 -0
  15. package/dist/deltas.d.ts +15 -3
  16. package/dist/deltas.d.ts.map +1 -1
  17. package/dist/deltas.js.map +1 -1
  18. package/dist/error.d.ts +9 -2
  19. package/dist/error.d.ts.map +1 -1
  20. package/dist/error.js +3 -1
  21. package/dist/error.js.map +1 -1
  22. package/dist/fluidModule.d.ts +3 -0
  23. package/dist/fluidModule.d.ts.map +1 -1
  24. package/dist/fluidModule.js.map +1 -1
  25. package/dist/fluidPackage.d.ts +16 -0
  26. package/dist/fluidPackage.d.ts.map +1 -1
  27. package/dist/fluidPackage.js +8 -0
  28. package/dist/fluidPackage.js.map +1 -1
  29. package/dist/loader.d.ts +46 -21
  30. package/dist/loader.d.ts.map +1 -1
  31. package/dist/loader.js +2 -1
  32. package/dist/loader.js.map +1 -1
  33. package/dist/runtime.d.ts +16 -7
  34. package/dist/runtime.d.ts.map +1 -1
  35. package/dist/runtime.js +5 -1
  36. package/dist/runtime.js.map +1 -1
  37. package/dist/tsdoc-metadata.json +1 -1
  38. package/lib/audience.d.ts +2 -0
  39. package/lib/audience.d.ts.map +1 -1
  40. package/lib/audience.js.map +1 -1
  41. package/lib/browserPackage.d.ts +3 -0
  42. package/lib/browserPackage.d.ts.map +1 -1
  43. package/lib/browserPackage.js +1 -0
  44. package/lib/browserPackage.js.map +1 -1
  45. package/lib/deltas.d.ts +15 -3
  46. package/lib/deltas.d.ts.map +1 -1
  47. package/lib/deltas.js.map +1 -1
  48. package/lib/error.d.ts +9 -2
  49. package/lib/error.d.ts.map +1 -1
  50. package/lib/error.js +2 -0
  51. package/lib/error.js.map +1 -1
  52. package/lib/fluidModule.d.ts +3 -0
  53. package/lib/fluidModule.d.ts.map +1 -1
  54. package/lib/fluidModule.js.map +1 -1
  55. package/lib/fluidPackage.d.ts +16 -0
  56. package/lib/fluidPackage.d.ts.map +1 -1
  57. package/lib/fluidPackage.js +8 -0
  58. package/lib/fluidPackage.js.map +1 -1
  59. package/lib/loader.d.ts +46 -21
  60. package/lib/loader.d.ts.map +1 -1
  61. package/lib/loader.js +1 -0
  62. package/lib/loader.js.map +1 -1
  63. package/lib/runtime.d.ts +16 -7
  64. package/lib/runtime.d.ts.map +1 -1
  65. package/lib/runtime.js +4 -0
  66. package/lib/runtime.js.map +1 -1
  67. package/package.json +16 -17
  68. package/src/audience.ts +4 -0
  69. package/src/browserPackage.ts +3 -0
  70. package/src/deltas.ts +23 -2
  71. package/src/error.ts +9 -1
  72. package/src/fluidModule.ts +3 -0
  73. package/src/fluidPackage.ts +16 -0
  74. package/src/loader.ts +55 -19
  75. package/src/runtime.ts +16 -7
package/src/loader.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  import {
7
7
  IRequest,
8
8
  IResponse,
9
+ // eslint-disable-next-line import/no-deprecated
9
10
  IFluidRouter,
10
11
  FluidObject,
11
12
  IEvent,
@@ -29,6 +30,7 @@ import { IFluidCodeDetails, IFluidPackage, IProvideFluidCodeDetailsComparer } fr
29
30
 
30
31
  /**
31
32
  * Encapsulates a module entry point with corresponding code details.
33
+ * @public
32
34
  */
33
35
  export interface IFluidModuleWithDetails {
34
36
  /**
@@ -48,6 +50,7 @@ export interface IFluidModuleWithDetails {
48
50
  /**
49
51
  * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as
50
52
  * a package name and package version range.
53
+ * @public
51
54
  */
52
55
  export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {
53
56
  /**
@@ -62,6 +65,7 @@ export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComp
62
65
  /**
63
66
  * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails
64
67
  * that have been resolved and are ready to load
68
+ * @public
65
69
  */
66
70
  export interface IResolvedFluidCodeDetails extends IFluidCodeDetails {
67
71
  /**
@@ -80,6 +84,7 @@ export interface IResolvedFluidCodeDetails extends IFluidCodeDetails {
80
84
  * The Fluid code resolver is coupled to a specific cdn and knows how to resolve
81
85
  * the code detail for loading from that cdn. This include resolving to the most recent
82
86
  * version of package that supports the provided code details.
87
+ * @public
83
88
  */
84
89
  export interface IFluidCodeResolver {
85
90
  /**
@@ -93,6 +98,7 @@ export interface IFluidCodeResolver {
93
98
 
94
99
  /**
95
100
  * Events emitted by the {@link IContainer} "upwards" to the Loader and Host.
101
+ * @public
96
102
  */
97
103
  export interface IContainerEvents extends IEvent {
98
104
  /**
@@ -252,6 +258,7 @@ export interface IContainerEvents extends IEvent {
252
258
  /**
253
259
  * Namespace for the different connection states a container can be in.
254
260
  * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.
261
+ * @public
255
262
  */
256
263
  // eslint-disable-next-line @typescript-eslint/no-namespace
257
264
  export namespace ConnectionState {
@@ -281,6 +288,7 @@ export namespace ConnectionState {
281
288
 
282
289
  /**
283
290
  * Type defining the different states of connectivity a Container can be in.
291
+ * @public
284
292
  */
285
293
  export type ConnectionState =
286
294
  | ConnectionState.Disconnected
@@ -290,7 +298,9 @@ export type ConnectionState =
290
298
 
291
299
  /**
292
300
  * The Host's view of a Container and its connection to storage
301
+ * @public
293
302
  */
303
+ // eslint-disable-next-line import/no-deprecated
294
304
  export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {
295
305
  /**
296
306
  * The Delta Manager supporting the op stream for this Container
@@ -374,7 +384,10 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
374
384
  * TODO - in the case of failure options should give a retry policy.
375
385
  * Or some continuation function that allows attachment to a secondary document.
376
386
  */
377
- attach(request: IRequest): Promise<void>;
387
+ attach(
388
+ request: IRequest,
389
+ attachProps?: { deltaConnection?: "none" | "delayed" },
390
+ ): Promise<void>;
378
391
 
379
392
  /**
380
393
  * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container
@@ -391,9 +404,13 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
391
404
  getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
392
405
 
393
406
  /**
407
+ * @deprecated Requesting will not be supported in a future major release.
408
+ * Instead, access the objects in a Fluid Container using entryPoint, and then navigate from there using
409
+ * app-specific logic (e.g. retrieving handles from the entryPoint's DDSes, or a container's entryPoint object
410
+ * could implement a request paradigm itself)
411
+ *
394
412
  * IMPORTANT: This overload is provided for back-compat where IContainer.request(\{ url: "/" \}) is already implemented and used.
395
413
  * The functionality it can provide (if the Container implementation is built for it) is redundant with @see {@link IContainer.getEntryPoint}.
396
- * Once that API is mandatory on IContainer, this overload will be deprecated.
397
414
  *
398
415
  * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.
399
416
  *
@@ -405,21 +422,19 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
405
422
  * Issue a request against the container for a resource.
406
423
  * @param request - The request to be issued against the container
407
424
  *
408
- * @deprecated - Requesting an arbitrary URL with headers will not be supported in a future major release.
425
+ * @deprecated Requesting an arbitrary URL with headers will not be supported in a future major release.
409
426
  * Instead, access the objects in a Fluid Container using entryPoint, and then navigate from there using
410
427
  * app-specific logic (e.g. retrieving handles from the entryPoint's DDSes, or a container's entryPoint object
411
428
  * could implement a request paradigm itself)
412
429
  *
413
- * NOTE: IContainer.request(\{url: "/"\}) is not yet deprecated. If and only if the Container implementation supports it,
414
- * that overload may be used as a proxy for getting the entryPoint until {@link IContainer.getEntryPoint} is mandatory.
415
- *
416
430
  * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.
417
431
  */
418
432
  request(request: IRequest): Promise<IResponse>;
419
433
 
420
434
  /**
421
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
435
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
422
436
  */
437
+ // eslint-disable-next-line import/no-deprecated
423
438
  readonly IFluidRouter: IFluidRouter;
424
439
 
425
440
  /**
@@ -489,19 +504,13 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
489
504
  /**
490
505
  * Exposes the entryPoint for the container.
491
506
  * Use this as the primary way of getting access to the user-defined logic within the container.
492
- * If the method is undefined or the returned promise returns undefined (meaning that exposing the entryPoint
493
- * hasn't been implemented in a particular scenario) fall back to the current approach of requesting the default
494
- * object of the container through the request pattern.
495
- *
496
- * @remarks The plan is that eventually IContainer will no longer implement IFluidRouter (and thus won't have a
497
- * request() method), this method will no longer be optional, and it will become the only way to access
498
- * the entryPoint for the container.
499
507
  */
500
- getEntryPoint?(): Promise<FluidObject | undefined>;
508
+ getEntryPoint(): Promise<FluidObject | undefined>;
501
509
  }
502
510
 
503
511
  /**
504
512
  * The Runtime's view of the Loader, used for loading Containers
513
+ * @public
505
514
  */
506
515
  export interface ILoader extends Partial<IProvideLoader> {
507
516
  /**
@@ -516,33 +525,50 @@ export interface ILoader extends Partial<IProvideLoader> {
516
525
  resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;
517
526
 
518
527
  /**
519
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
528
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
520
529
  */
521
530
  request(request: IRequest): Promise<IResponse>;
522
531
 
523
532
  /**
524
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
533
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
525
534
  */
535
+ // eslint-disable-next-line import/no-deprecated
526
536
  readonly IFluidRouter: IFluidRouter;
527
537
  }
528
538
 
529
539
  /**
530
540
  * The Host's view of the Loader, used for loading Containers
541
+ * @public
531
542
  */
532
543
  export interface IHostLoader extends ILoader {
533
544
  /**
534
545
  * Creates a new container using the specified chaincode but in an unattached state. While unattached all
535
546
  * updates will only be local until the user explicitly attaches the container to a service provider.
536
547
  */
537
- createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;
548
+ createDetachedContainer(
549
+ codeDetails: IFluidCodeDetails,
550
+ createDetachedProps?: {
551
+ canReconnect?: boolean;
552
+ clientDetailsOverride?: IClientDetails;
553
+ },
554
+ ): Promise<IContainer>;
538
555
 
539
556
  /**
540
557
  * Creates a new container using the specified snapshot but in an unattached state. While unattached all
541
558
  * updates will only be local until the user explicitly attaches the container to a service provider.
542
559
  */
543
- rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;
560
+ rehydrateDetachedContainerFromSnapshot(
561
+ snapshot: string,
562
+ createDetachedProps?: {
563
+ canReconnect?: boolean;
564
+ clientDetailsOverride?: IClientDetails;
565
+ },
566
+ ): Promise<IContainer>;
544
567
  }
545
568
 
569
+ /**
570
+ * @public
571
+ */
546
572
  export type ILoaderOptions = {
547
573
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
548
574
  [key in string | number]: any;
@@ -575,6 +601,7 @@ export type ILoaderOptions = {
575
601
 
576
602
  /**
577
603
  * Accepted header keys for requests coming to the Loader
604
+ * @public
578
605
  */
579
606
  export enum LoaderHeader {
580
607
  /**
@@ -605,6 +632,9 @@ export enum LoaderHeader {
605
632
  version = "version",
606
633
  }
607
634
 
635
+ /**
636
+ * @public
637
+ */
608
638
  export interface IContainerLoadMode {
609
639
  opsBeforeReturn?: /*
610
640
  * No trailing ops are applied before container is returned.
@@ -658,6 +688,7 @@ export interface IContainerLoadMode {
658
688
 
659
689
  /**
660
690
  * Set of Request Headers that the Loader understands and may inspect or modify
691
+ * @public
661
692
  */
662
693
  export interface ILoaderHeader {
663
694
  /**
@@ -675,6 +706,9 @@ export interface ILoaderHeader {
675
706
  [LoaderHeader.version]: string | undefined;
676
707
  }
677
708
 
709
+ /**
710
+ * @public
711
+ */
678
712
  export interface IProvideLoader {
679
713
  readonly ILoader: ILoader;
680
714
  }
@@ -683,6 +717,7 @@ export interface IProvideLoader {
683
717
  * @deprecated 0.48, This API will be removed in 0.50
684
718
  * No replacement since it is not expected anyone will depend on this outside container-loader
685
719
  * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.
720
+ * @public
686
721
  */
687
722
  export interface IPendingLocalState {
688
723
  url: string;
@@ -694,6 +729,7 @@ export interface IPendingLocalState {
694
729
  * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.
695
730
  *
696
731
  * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.
732
+ * @public
697
733
  */
698
734
  export interface ISnapshotTreeWithBlobContents extends ISnapshotTree {
699
735
  blobsContents: { [path: string]: ArrayBufferLike };
package/src/runtime.ts CHANGED
@@ -32,6 +32,7 @@ import { IFluidCodeDetails } from "./fluidPackage";
32
32
  /**
33
33
  * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the
34
34
  * service. The transition from detached to attached state is a one-way transition.
35
+ * @public
35
36
  */
36
37
  export enum AttachState {
37
38
  /**
@@ -55,11 +56,12 @@ export enum AttachState {
55
56
  /**
56
57
  * The IRuntime represents an instantiation of a code package within a Container.
57
58
  * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
59
+ * @public
58
60
  */
59
61
  export interface IRuntime extends IDisposable {
60
62
  /**
61
63
  * Executes a request against the runtime
62
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
64
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
63
65
  */
64
66
  request(request: IRequest): Promise<IResponse>;
65
67
 
@@ -105,7 +107,7 @@ export interface IRuntime extends IDisposable {
105
107
  /**
106
108
  * Notify runtime that container is moving to "Attaching" state
107
109
  * @param snapshot - snapshot created at attach time
108
- * @deprecated - not necessary after op replay moved to Container
110
+ * @deprecated not necessary after op replay moved to Container
109
111
  */
110
112
  notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;
111
113
 
@@ -120,15 +122,13 @@ export interface IRuntime extends IDisposable {
120
122
  * Use this as the primary way of getting access to the user-defined logic within the container runtime.
121
123
  *
122
124
  * @see {@link IContainer.getEntryPoint}
123
- *
124
- * @remarks The plan is that eventually IRuntime will no longer have a request() method, this method will no
125
- * longer be optional, and it will become the only way to access the entryPoint for the runtime.
126
125
  */
127
- getEntryPoint?(): Promise<FluidObject | undefined>;
126
+ getEntryPoint(): Promise<FluidObject | undefined>;
128
127
  }
129
128
 
130
129
  /**
131
130
  * Payload type for IContainerContext.submitBatchFn()
131
+ * @public
132
132
  */
133
133
  export interface IBatchMessage {
134
134
  contents?: string;
@@ -141,6 +141,7 @@ export interface IBatchMessage {
141
141
  * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the
142
142
  * loader layer. It gets passed into the IRuntimeFactory.instantiateRuntime call. Only include members on this interface
143
143
  * if you intend them to be consumed/called from the runtime layer.
144
+ * @public
144
145
  */
145
146
  export interface IContainerContext {
146
147
  readonly options: ILoaderOptions;
@@ -214,13 +215,20 @@ export interface IContainerContext {
214
215
  * @deprecated 2.0.0-internal.5.2.0 - The docId is already logged by the {@link IContainerContext.taggedLogger} for
215
216
  * telemetry purposes, so this is generally unnecessary for telemetry.
216
217
  * If the id is needed for other purposes it should be passed to the consumer explicitly.
217
- * This member will be removed in the 2.0.0-internal.7.0.0 release.
218
+ *
219
+ * @privateremarks Tracking in AB#5714
218
220
  */
219
221
  readonly id: string;
220
222
  }
221
223
 
224
+ /**
225
+ * @public
226
+ */
222
227
  export const IRuntimeFactory: keyof IProvideRuntimeFactory = "IRuntimeFactory";
223
228
 
229
+ /**
230
+ * @public
231
+ */
224
232
  export interface IProvideRuntimeFactory {
225
233
  readonly IRuntimeFactory: IRuntimeFactory;
226
234
  }
@@ -230,6 +238,7 @@ export interface IProvideRuntimeFactory {
230
238
  *
231
239
  * Provides the entry point for the ContainerContext to load the proper IRuntime
232
240
  * to start up the running instance of the Container.
241
+ * @public
233
242
  */
234
243
  export interface IRuntimeFactory extends IProvideRuntimeFactory {
235
244
  /**