@fluidframework/container-definitions 1.2.7 → 2.0.0-dev.1.3.0.96595

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 (51) hide show
  1. package/dist/audience.d.ts +14 -0
  2. package/dist/audience.d.ts.map +1 -1
  3. package/dist/audience.js.map +1 -1
  4. package/dist/browserPackage.d.ts +4 -4
  5. package/dist/browserPackage.js.map +1 -1
  6. package/dist/deltas.d.ts +10 -3
  7. package/dist/deltas.d.ts.map +1 -1
  8. package/dist/deltas.js.map +1 -1
  9. package/dist/fluidPackage.d.ts +12 -8
  10. package/dist/fluidPackage.d.ts.map +1 -1
  11. package/dist/fluidPackage.js.map +1 -1
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/loader.d.ts +16 -31
  16. package/dist/loader.d.ts.map +1 -1
  17. package/dist/loader.js.map +1 -1
  18. package/dist/runtime.d.ts +12 -6
  19. package/dist/runtime.d.ts.map +1 -1
  20. package/dist/runtime.js +1 -8
  21. package/dist/runtime.js.map +1 -1
  22. package/lib/audience.d.ts +14 -0
  23. package/lib/audience.d.ts.map +1 -1
  24. package/lib/audience.js.map +1 -1
  25. package/lib/browserPackage.d.ts +4 -4
  26. package/lib/browserPackage.js.map +1 -1
  27. package/lib/deltas.d.ts +10 -3
  28. package/lib/deltas.d.ts.map +1 -1
  29. package/lib/deltas.js.map +1 -1
  30. package/lib/fluidPackage.d.ts +12 -8
  31. package/lib/fluidPackage.d.ts.map +1 -1
  32. package/lib/fluidPackage.js.map +1 -1
  33. package/lib/index.d.ts +1 -1
  34. package/lib/index.js +1 -1
  35. package/lib/index.js.map +1 -1
  36. package/lib/loader.d.ts +16 -31
  37. package/lib/loader.d.ts.map +1 -1
  38. package/lib/loader.js.map +1 -1
  39. package/lib/runtime.d.ts +12 -6
  40. package/lib/runtime.d.ts.map +1 -1
  41. package/lib/runtime.js +0 -7
  42. package/lib/runtime.js.map +1 -1
  43. package/package.json +34 -11
  44. package/src/audience.ts +16 -0
  45. package/src/browserPackage.ts +4 -4
  46. package/src/deltas.ts +7 -3
  47. package/src/fluidPackage.ts +16 -12
  48. package/src/index.ts +1 -1
  49. package/src/loader.ts +17 -33
  50. package/src/runtime.ts +13 -7
  51. package/BREAKING.md +0 -41
package/lib/runtime.js CHANGED
@@ -23,12 +23,5 @@ export var AttachState;
23
23
  */
24
24
  AttachState["Attached"] = "Attached";
25
25
  })(AttachState || (AttachState = {}));
26
- // Represents the bind state of the entity.
27
- export var BindState;
28
- (function (BindState) {
29
- BindState["NotBound"] = "NotBound";
30
- BindState["Binding"] = "Binding";
31
- BindState["Bound"] = "Bound";
32
- })(BindState || (BindState = {}));
33
26
  export const IRuntimeFactory = "IRuntimeFactory";
34
27
  //# sourceMappingURL=runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0BH;;;GAGG;AACH,MAAM,CAAN,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACnB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACzB,CAAC,EAjBW,WAAW,KAAX,WAAW,QAiBtB;AAED,2CAA2C;AAC3C,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,kCAAqB,CAAA;IACrB,gCAAmB,CAAA;IACnB,4BAAe,CAAA;AACnB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAwHD,MAAM,CAAC,MAAM,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n FluidObject,\n IRequest,\n IResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n IClientConfiguration,\n IClientDetails,\n ISequencedDocumentMessage,\n ISnapshotTree,\n MessageType,\n ISummaryTree,\n IVersion,\n IDocumentMessage,\n IQuorumClients,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager } from \"./deltas\";\nimport { ICriticalContainerError } from \"./error\";\nimport { ILoader, ILoaderOptions, ISnapshotTreeWithBlobContents } from \"./loader\";\nimport { IFluidCodeDetails } from \"./fluidPackage\";\n\n/**\n * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the\n * service. The transition from detached to attached state is a one-way transition.\n */\nexport enum AttachState {\n /**\n * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n * to the service.\n */\n Detached = \"Detached\",\n\n /**\n * In attaching state, the data has started the upload to the service, but has not yet completed.\n */\n Attaching = \"Attaching\",\n\n /**\n * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n * reaching attached state.\n */\n Attached = \"Attached\",\n}\n\n// Represents the bind state of the entity.\nexport enum BindState {\n NotBound = \"NotBound\",\n Binding = \"Binding\",\n Bound = \"Bound\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n */\nexport interface IRuntime extends IDisposable {\n\n /**\n * Executes a request against the runtime\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Notifies the runtime of a change in the connection state\n */\n setConnectionState(connected: boolean, clientId?: string);\n\n /**\n * Processes the given op (message)\n */\n process(message: ISequencedDocumentMessage, local: boolean, context: any);\n\n /**\n * Processes the given signal\n */\n processSignal(message: any, local: boolean);\n\n /**\n * Create a summary. Used when attaching or serializing a detached container.\n *\n * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n * new storage IDs so requests can be redirected.\n */\n createSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n /**\n * Propagate the container state when container is attaching or attached.\n * @param attachState - State of the container.\n */\n setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n /**\n * Get pending local state in a serializable format to be given back to a newly loaded container\n */\n getPendingLocalState(): unknown;\n\n /**\n * Notify runtime that container is moving to \"Attaching\" state\n * @param snapshot - snapshot created at attach time\n */\n notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;\n}\n\n/**\n * The ContainerContext is a proxy standing between the Container and the Container's IRuntime.\n * This allows the Container to terminate the connection to the IRuntime.\n *\n * Specifically, there is an event on Container, onContextChanged, which mean a new code proposal has been loaded,\n * so the old IRuntime is no longer valid, as its ContainerContext has been revoked,\n * and the Container has created a new ContainerContext.\n */\nexport interface IContainerContext extends IDisposable {\n readonly existing: boolean | undefined;\n readonly options: ILoaderOptions;\n readonly clientId: string | undefined;\n readonly clientDetails: IClientDetails;\n readonly storage: IDocumentStorageService;\n readonly connected: boolean;\n readonly baseSnapshot: ISnapshotTree | undefined;\n readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n readonly submitSignalFn: (contents: any) => void;\n readonly closeFn: (error?: ICriticalContainerError) => void;\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n readonly quorum: IQuorumClients;\n /**\n * @deprecated This method is provided as a migration tool for customers currently reading the code details\n * from within the Container by directly accessing the Quorum proposals. The code details should not be accessed\n * from within the Container as this requires coupling between the container contents and the code loader.\n * Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this\n * migration tool will be removed.\n */\n getSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;\n readonly audience: IAudience | undefined;\n readonly loader: ILoader;\n // The logger implementation, which would support tagged events, should be provided by the loader.\n readonly taggedLogger: ITelemetryBaseLogger;\n readonly serviceConfiguration: IClientConfiguration | undefined;\n pendingLocalState?: unknown;\n\n /**\n * Ambient services provided with the context\n */\n readonly scope: FluidObject;\n\n /**\n * Get an absolute url for a provided container-relative request.\n * @param relativeUrl - A relative request within the container\n *\n * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n */\n getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n getLoadedFromVersion(): IVersion | undefined;\n\n updateDirtyContainerState(dirty: boolean): void;\n /**\n * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n * and scenarios which can change in the future.\n */\n readonly id: string;\n}\n\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\nexport interface IProvideRuntimeFactory {\n readonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n /**\n * Instantiates a new IRuntime for the given IContainerContext to proxy to\n * This is the main entry point to the Container's business logic\n *\n * @param context - container context to be supplied to the runtime\n * @param existing - whether to instantiate for the first time or from an existing context\n */\n instantiateRuntime(context: IContainerContext, existing?: boolean): Promise<IRuntime>;\n}\n"]}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH;;;GAGG;AACH,MAAM,CAAN,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACnB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACzB,CAAC,EAjBW,WAAW,KAAX,WAAW,QAiBtB;AAoID,MAAM,CAAC,MAAM,eAAe,GAAiC,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n FluidObject,\n IRequest,\n IResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n IClientConfiguration,\n IClientDetails,\n ISequencedDocumentMessage,\n ISnapshotTree,\n MessageType,\n ISummaryTree,\n IVersion,\n IDocumentMessage,\n IQuorumClients,\n ISummaryContent,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager } from \"./deltas\";\nimport { ICriticalContainerError } from \"./error\";\nimport { ILoader, ILoaderOptions, ISnapshotTreeWithBlobContents } from \"./loader\";\nimport { IFluidCodeDetails } from \"./fluidPackage\";\n\n/**\n * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the\n * service. The transition from detached to attached state is a one-way transition.\n */\nexport enum AttachState {\n /**\n * In detached state, the data is only present on the local client's machine. It has not yet been uploaded\n * to the service.\n */\n Detached = \"Detached\",\n\n /**\n * In attaching state, the data has started the upload to the service, but has not yet completed.\n */\n Attaching = \"Attaching\",\n\n /**\n * In attached state, the data has completed upload to the service. It can be accessed by other clients after\n * reaching attached state.\n */\n Attached = \"Attached\",\n}\n\n/**\n * The IRuntime represents an instantiation of a code package within a Container.\n * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.\n */\nexport interface IRuntime extends IDisposable {\n\n /**\n * Executes a request against the runtime\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Notifies the runtime of a change in the connection state\n */\n setConnectionState(connected: boolean, clientId?: string);\n\n /**\n * Processes the given op (message)\n */\n process(message: ISequencedDocumentMessage, local: boolean, context: any);\n\n /**\n * Processes the given signal\n */\n processSignal(message: any, local: boolean);\n\n /**\n * Create a summary. Used when attaching or serializing a detached container.\n *\n * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n * new storage IDs so requests can be redirected.\n */\n createSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;\n\n /**\n * Propagate the container state when container is attaching or attached.\n * @param attachState - State of the container.\n */\n setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n\n /**\n * Get pending local state in a serializable format to be given back to a newly loaded container\n */\n getPendingLocalState(): unknown;\n\n /**\n * Notify runtime that container is moving to \"Attaching\" state\n * @param snapshot - snapshot created at attach time\n */\n notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;\n}\n\n/**\n * Payload type for IContainerContext.submitBatchFn()\n */\nexport interface IBatchMessage {\n contents: string;\n metadata: Record<string, unknown> | undefined;\n}\n\n/**\n * The ContainerContext is a proxy standing between the Container and the Container's IRuntime.\n * This allows the Container to terminate the connection to the IRuntime.\n *\n * Specifically, there is an event on Container, onContextChanged, which mean a new code proposal has been loaded,\n * so the old IRuntime is no longer valid, as its ContainerContext has been revoked,\n * and the Container has created a new ContainerContext.\n */\nexport interface IContainerContext extends IDisposable {\n readonly existing: boolean | undefined;\n readonly options: ILoaderOptions;\n readonly clientId: string | undefined;\n readonly clientDetails: IClientDetails;\n readonly storage: IDocumentStorageService;\n readonly connected: boolean;\n readonly baseSnapshot: ISnapshotTree | undefined;\n /** @deprecated Please use submitBatchFn & submitSummaryFn */\n readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;\n /** @returns clientSequenceNumber of last message in a batch */\n readonly submitBatchFn: (batch: IBatchMessage[]) => number;\n readonly submitSummaryFn: (summaryOp: ISummaryContent) => number;\n readonly submitSignalFn: (contents: any) => void;\n readonly closeFn: (error?: ICriticalContainerError) => void;\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n readonly quorum: IQuorumClients;\n /**\n * @deprecated This method is provided as a migration tool for customers currently reading the code details\n * from within the Container by directly accessing the Quorum proposals. The code details should not be accessed\n * from within the Container as this requires coupling between the container contents and the code loader.\n * Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this\n * migration tool will be removed.\n */\n getSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;\n readonly audience: IAudience | undefined;\n readonly loader: ILoader;\n // The logger implementation, which would support tagged events, should be provided by the loader.\n readonly taggedLogger: ITelemetryBaseLogger;\n readonly serviceConfiguration: IClientConfiguration | undefined;\n pendingLocalState?: unknown;\n\n /**\n * Ambient services provided with the context\n */\n readonly scope: FluidObject;\n\n /**\n * Get an absolute url for a provided container-relative request.\n * @param relativeUrl - A relative request within the container\n *\n * TODO: Optional for backwards compatibility. Make non-optional in version 0.19\n */\n getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n getLoadedFromVersion(): IVersion | undefined;\n\n updateDirtyContainerState(dirty: boolean): void;\n /**\n * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption\n * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers\n * and scenarios which can change in the future.\n */\n readonly id: string;\n}\n\nexport const IRuntimeFactory: keyof IProvideRuntimeFactory = \"IRuntimeFactory\";\n\nexport interface IProvideRuntimeFactory {\n readonly IRuntimeFactory: IRuntimeFactory;\n}\n\n/**\n * Exported module definition\n *\n * Provides the entry point for the ContainerContext to load the proper IRuntime\n * to start up the running instance of the Container.\n */\nexport interface IRuntimeFactory extends IProvideRuntimeFactory {\n /**\n * Instantiates a new IRuntime for the given IContainerContext to proxy to\n * This is the main entry point to the Container's business logic\n *\n * @param context - container context to be supplied to the runtime\n * @param existing - whether to instantiate for the first time or from an existing context\n */\n instantiateRuntime(context: IContainerContext, existing?: boolean): Promise<IRuntime>;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-definitions",
3
- "version": "1.2.7",
3
+ "version": "2.0.0-dev.1.3.0.96595",
4
4
  "description": "Fluid container definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -40,27 +40,50 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@fluidframework/common-definitions": "^0.20.1",
43
- "@fluidframework/core-interfaces": "^1.2.7",
44
- "@fluidframework/driver-definitions": "^1.2.7",
45
- "@fluidframework/protocol-definitions": "^0.1028.2000"
43
+ "@fluidframework/core-interfaces": "2.0.0-dev.1.3.0.96595",
44
+ "@fluidframework/driver-definitions": "2.0.0-dev.1.3.0.96595",
45
+ "@fluidframework/protocol-definitions": "^1.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@fluidframework/build-common": "^0.24.0",
49
- "@fluidframework/build-tools": "^0.2.74327",
50
- "@fluidframework/container-definitions-previous": "npm:@fluidframework/container-definitions@1.2.1",
51
- "@fluidframework/eslint-config-fluid": "^0.28.2000",
48
+ "@fluidframework/build-common": "^1.0.0",
49
+ "@fluidframework/build-tools": "^0.4.6000",
50
+ "@fluidframework/container-definitions-previous": "npm:@fluidframework/container-definitions@^1.1.0",
51
+ "@fluidframework/eslint-config-fluid": "^1.0.0",
52
52
  "@microsoft/api-extractor": "^7.22.2",
53
53
  "@rushstack/eslint-config": "^2.5.1",
54
54
  "@types/node": "^14.18.0",
55
55
  "concurrently": "^6.2.0",
56
- "copyfiles": "^2.1.0",
56
+ "copyfiles": "^2.4.1",
57
57
  "eslint": "~8.6.0",
58
58
  "rimraf": "^2.6.2",
59
59
  "typescript": "~4.5.5",
60
60
  "typescript-formatter": "7.1.0"
61
61
  },
62
62
  "typeValidation": {
63
- "version": "1.2.2",
64
- "broken": {}
63
+ "version": "2.0.0",
64
+ "broken": {
65
+ "InterfaceDeclaration_IConnectionDetails": {
66
+ "backCompat": false
67
+ },
68
+ "RemovedInterfaceDeclaration_ICodeLoader": {
69
+ "forwardCompat": false,
70
+ "backCompat": false
71
+ },
72
+ "RemovedTypeAliasDeclaration_ConnectionState.Connecting": {
73
+ "forwardCompat": false,
74
+ "backCompat": false
75
+ },
76
+ "TypeAliasDeclaration_ConnectionState.Connecting": {
77
+ "forwardCompat": false,
78
+ "backCompat": false
79
+ },
80
+ "RemovedEnumDeclaration_BindState": {
81
+ "forwardCompat": false,
82
+ "backCompat": false
83
+ },
84
+ "InterfaceDeclaration_IContainerContext": {
85
+ "forwardCompat": false
86
+ }
87
+ }
65
88
  }
66
89
  }
package/src/audience.ts CHANGED
@@ -6,6 +6,22 @@
6
6
  import { EventEmitter } from "events";
7
7
  import { IClient } from "@fluidframework/protocol-definitions";
8
8
 
9
+ /**
10
+ * Manages the state and the members for {@link IAudience}
11
+ */
12
+ export interface IAudienceOwner extends IAudience {
13
+ /**
14
+ * Adds a new client to the audience
15
+ */
16
+ addMember(clientId: string, details: IClient): void;
17
+
18
+ /**
19
+ * Removes a client from the audience. Only emits an event if a client is actually removed
20
+ * @returns if a client was removed from the audience
21
+ */
22
+ removeMember(clientId: string): boolean;
23
+ }
24
+
9
25
  /**
10
26
  * Audience represents all clients connected to the op stream, both read-only and read/write.
11
27
  *
@@ -11,18 +11,18 @@ import { IFluidPackage, isFluidPackage, IFluidPackageEnvironment } from "./fluid
11
11
  export interface IFluidBrowserPackageEnvironment extends IFluidPackageEnvironment{
12
12
  /**
13
13
  * The Universal Module Definition (umd) target specifics the scripts necessary for
14
- * loading a packages in a browser environment and finding its entry point
14
+ * loading a packages in a browser environment and finding its entry point.
15
15
  */
16
16
  umd: {
17
17
  /**
18
- * The bundled js files for loading this package. These files will be loaded
19
- * and executed in order
18
+ * The bundled js files for loading this package.
19
+ * These files will be loaded and executed in order.
20
20
  */
21
21
  files: string[];
22
22
 
23
23
  /**
24
24
  * The global name that the script entry points will be exposed.
25
- * This entry point should be an IFluidModule
25
+ * This entry point should be an {@link @fluidframework/container-definitions#IFluidModule}.
26
26
  */
27
27
  library: string;
28
28
 
package/src/deltas.ts CHANGED
@@ -29,7 +29,7 @@ export interface IConnectionDetails {
29
29
  /**
30
30
  * Last known sequence number to ordering service at the time of connection
31
31
  * It may lap actual last sequence number (quite a bit, if container is very active).
32
- * But it's best information for client to figure out how far it is behind, at least
32
+ * But it's the best information for client to figure out how far it is behind, at least
33
33
  * for "read" connections. "write" connections may use own "join" op to similar information,
34
34
  * that is likely to be more up-to-date.
35
35
  */
@@ -106,7 +106,7 @@ export interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>
106
106
  readonly initialSequenceNumber: number;
107
107
 
108
108
  /**
109
- * Tells if current connection has checkpoint information.
109
+ * Tells if current connection has checkpoint information.
110
110
  * I.e. we know how far behind the client was at the time of establishing connection
111
111
  */
112
112
  readonly hasCheckpointSequenceNumber: boolean;
@@ -182,7 +182,11 @@ export interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, ID
182
182
  */
183
183
  toArray(): T[];
184
184
 
185
- waitTillProcessingDone(): Promise<void>;
185
+ /**
186
+ * returns number of ops processed and time it took to process these ops.
187
+ * Zeros if queue did not process anything (had no messages, was paused or had hit an error before)
188
+ */
189
+ waitTillProcessingDone(): Promise<{ count: number; duration: number; }>;
186
190
  }
187
191
 
188
192
  export type ReadOnlyInfo = {
@@ -3,9 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- /**
7
- * Specifies an environment on Fluid property of a IFluidPackage
8
- */
6
+ /**
7
+ * Specifies an environment on Fluid property of a IFluidPackage.
8
+ */
9
9
  export interface IFluidPackageEnvironment {
10
10
 
11
11
  /**
@@ -23,7 +23,7 @@ export interface IFluidPackageEnvironment {
23
23
  /**
24
24
  * General access for extended fields as specific usages will
25
25
  * likely have additional infornamation like a definition
26
- * of Library, the entrypoint for umd packages
26
+ * of Library, the entrypoint for umd packages.
27
27
  */
28
28
  [key: string]: unknown;
29
29
  };
@@ -119,17 +119,21 @@ export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsCompa
119
119
  */
120
120
  satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;
121
121
 
122
- /* eslint-disable max-len */
122
+ /* eslint-disable max-len */
123
123
  /**
124
- * Return a number representing the ascending sort order of the `a` and `b` code details;
125
- * `< 0` if `a < b`.
126
- * `= 0` if `a === b`.
127
- * `> 0` if `a > b`.
128
- * `undefined` if `a` is not comparable to `b`.
124
+ * Return a number representing the ascending sort order of the `a` and `b` code details:
125
+ *
126
+ * - `< 0` if `a < b`.
127
+ *
128
+ * - `= 0` if `a === b`.
129
+ *
130
+ * - `> 0` if `a > b`.
131
+ *
132
+ * - `undefined` if `a` is not comparable to `b`.
129
133
  *
130
134
  * Similar semantics to:
131
- * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description | Array.sort}
135
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}
132
136
  */
133
137
  compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;
134
- /* eslint-enable max-len */
138
+ /* eslint-enable max-len */
135
139
  }
package/src/index.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  /**
7
- * This package contains the interfaces and types concerning the `Loader` and loading the `Container`.
7
+ * This library contains the interfaces and types concerning the `Loader` and loading the `Container`.
8
8
  *
9
9
  * @packageDocumentation
10
10
  */
package/src/loader.ts CHANGED
@@ -29,28 +29,20 @@ import {
29
29
  IProvideFluidCodeDetailsComparer,
30
30
  } from "./fluidPackage";
31
31
 
32
- /**
33
- * Code loading interface
34
- *
35
- * @deprecated in favor of {@link @fluidframework/container-loader#ICodeDetailsLoader}
36
- */
37
- export interface ICodeLoader extends Partial<IProvideFluidCodeDetailsComparer> {
38
- /**
39
- * Loads the package specified by code details and returns a promise to its entry point exports.
40
- */
41
- load(source: IFluidCodeDetails): Promise<IFluidModule>;
42
- }
43
-
44
32
  /**
45
33
  * Encapsulates a module entry point with corresponding code details.
46
34
  */
47
35
  export interface IFluidModuleWithDetails {
48
- /** Fluid code module that implements the runtime factory needed to instantiate the container runtime. */
36
+ /**
37
+ * Fluid code module that implements the runtime factory needed to instantiate the container runtime.
38
+ */
49
39
  module: IFluidModule;
40
+
50
41
  /**
51
42
  * Code details associated with the module. Represents a document schema this module supports.
52
- * If the code loader implements the {@link @fluidframework/core-interfaces#IFluidCodeDetailsComparer} interface,
53
- * it'll be called to determine whether the module code details satisfy the new code proposal in the quorum.
43
+ * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}
44
+ * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the
45
+ * quorum.
54
46
  */
55
47
  details: IFluidCodeDetails;
56
48
  }
@@ -94,12 +86,10 @@ export interface IResolvedFluidCodeDetails extends IFluidCodeDetails {
94
86
  */
95
87
  export interface IFluidCodeResolver {
96
88
  /**
97
- * Resolves a Fluid code details into a form that can be loaded
98
- * @param details - The Fluid code details to resolve
99
- * @returns - A IResolvedFluidCodeDetails where the
100
- * resolvedPackage's Fluid file entries are absolute urls, and
101
- * an optional resolvedPackageCacheId if the loaded package should be
102
- * cached.
89
+ * Resolves a Fluid code details into a form that can be loaded.
90
+ * @param details - The Fluid code details to resolve.
91
+ * @returns - A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and
92
+ * an optional resolvedPackageCacheId if the loaded package should be cached.
103
93
  */
104
94
  resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;
105
95
  }
@@ -130,17 +120,18 @@ export interface IContainerEvents extends IEvent {
130
120
  * Namespace for the different connection states a container can be in
131
121
  * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression
132
122
  */
123
+ // eslint-disable-next-line @typescript-eslint/no-namespace
133
124
  export namespace ConnectionState {
134
125
  /**
135
- * The container is not connected to the delta server
126
+ * The container is not connected to the delta server.
136
127
  * Note - When in this state the container may be about to reconnect,
137
128
  * or may remain disconnected until explicitly told to connect.
138
129
  */
139
130
  export type Disconnected = 0;
140
131
 
141
132
  /**
142
- * The container is disconnected but actively trying to establish a new connection
143
- * PLEASE NOTE that this numerical value falls out of the order you may expect for this state
133
+ * The container is disconnected but actively trying to establish a new connection.
134
+ * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.
144
135
  */
145
136
  export type EstablishingConnection = 3;
146
137
 
@@ -150,25 +141,18 @@ export namespace ConnectionState {
150
141
  export type CatchingUp = 1;
151
142
 
152
143
  /**
153
- * See ConnectionState.CatchingUp, which is the new name for this state.
154
- * @deprecated - This state itself is not gone, just being renamed. Please use ConnectionState.CatchingUp.
155
- */
156
- export type Connecting = 1;
157
-
158
- /**
159
- * The container is fully connected and syncing
144
+ * The container is fully connected and syncing.
160
145
  */
161
146
  export type Connected = 2;
162
147
  }
163
148
 
164
149
  /**
165
- * Type defining the different states of connectivity a container can be in
150
+ * Type defining the different states of connectivity a container can be in.
166
151
  */
167
152
  export type ConnectionState =
168
153
  | ConnectionState.Disconnected
169
154
  | ConnectionState.EstablishingConnection
170
155
  | ConnectionState.CatchingUp
171
- | ConnectionState.Connecting
172
156
  | ConnectionState.Connected;
173
157
 
174
158
  /**
package/src/runtime.ts CHANGED
@@ -20,6 +20,7 @@ import {
20
20
  IVersion,
21
21
  IDocumentMessage,
22
22
  IQuorumClients,
23
+ ISummaryContent,
23
24
  } from "@fluidframework/protocol-definitions";
24
25
  import { IAudience } from "./audience";
25
26
  import { IDeltaManager } from "./deltas";
@@ -50,13 +51,6 @@ export enum AttachState {
50
51
  Attached = "Attached",
51
52
  }
52
53
 
53
- // Represents the bind state of the entity.
54
- export enum BindState {
55
- NotBound = "NotBound",
56
- Binding = "Binding",
57
- Bound = "Bound",
58
- }
59
-
60
54
  /**
61
55
  * The IRuntime represents an instantiation of a code package within a Container.
62
56
  * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
@@ -110,6 +104,14 @@ export interface IRuntime extends IDisposable {
110
104
  notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;
111
105
  }
112
106
 
107
+ /**
108
+ * Payload type for IContainerContext.submitBatchFn()
109
+ */
110
+ export interface IBatchMessage {
111
+ contents: string;
112
+ metadata: Record<string, unknown> | undefined;
113
+ }
114
+
113
115
  /**
114
116
  * The ContainerContext is a proxy standing between the Container and the Container's IRuntime.
115
117
  * This allows the Container to terminate the connection to the IRuntime.
@@ -126,7 +128,11 @@ export interface IContainerContext extends IDisposable {
126
128
  readonly storage: IDocumentStorageService;
127
129
  readonly connected: boolean;
128
130
  readonly baseSnapshot: ISnapshotTree | undefined;
131
+ /** @deprecated Please use submitBatchFn & submitSummaryFn */
129
132
  readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;
133
+ /** @returns clientSequenceNumber of last message in a batch */
134
+ readonly submitBatchFn: (batch: IBatchMessage[]) => number;
135
+ readonly submitSummaryFn: (summaryOp: ISummaryContent) => number;
130
136
  readonly submitSignalFn: (contents: any) => void;
131
137
  readonly closeFn: (error?: ICriticalContainerError) => void;
132
138
  readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
package/BREAKING.md DELETED
@@ -1,41 +0,0 @@
1
- ## 0.48 Upcoming changes
2
- - [IProxyLoader interface to be removed](#IProxyLoader-interface-to-be-removed)
3
-
4
- ### IProxyLoader interface to be removed
5
- The `IProxyLoader` interface has been deprecated in 0.48 and will be removed in an upcoming release.
6
-
7
- ## 0.49.1000 Breaking changes
8
- - [IContainer.connectionState yields finer-grained ConnectionState values](#icontainerconnectionstate-yields-finer-grained-connectionstate-values)
9
-
10
- ### IContainer.connectionState yields finer-grained ConnectionState values
11
- The `ConnectionState` types have been updated to include a new state which previously was
12
- encompassed by the `Disconnected` state. The new state is `EstablishingConnection` and indicates that the container is
13
- attempting to connect to the ordering service, but is not yet connected.
14
-
15
- Any logic based on the `Disconnected` state (e.g. checking the value of `IContainer.connectionState`)
16
- should be updated depending on how you want to treat this new `EstablishingConnection` state.
17
-
18
- Additionally, please note that the `Connecting` state is being renamed to `CatchingUp`.
19
- `ConnectionState.Connecting` is marked as deprecated, please use `ConnectionState.CatchingUp` instead.
20
- `ConnectionState.Connecting` will be removed in the following major release.
21
-
22
- ## 0.45 Breaking changes
23
- - [ContainerErrorType.clientSessionExpiredError added](#ContainerErrorType.clientSessionExpiredError-added)
24
-
25
- ### ContainerErrorType.clientSessionExpiredError added
26
- We have session expiry for GC purposes. Once the session has expired, we want to throw this new clientSessionExpiredError to clear out any stale in-memory data that may still be on the container.
27
-
28
- ## 0.40 Breaking changes
29
-
30
- - [IErrorBase.sequenceNumber removed](#IErrorBase.sequenceNumber-removed)
31
- - [IContainerContext.logger deprecated](#IContainerContext.logger-deprecated)
32
-
33
- ### IErrorBase.sequenceNumber removed
34
- This field was used for logging and this was probably not the right abstraction for it to live in.
35
- But practically speaking, the only places it was set have been updated to log not just sequenceNumber
36
- but a large number of useful properties off the offending message, via `CreateProcessingError`.
37
-
38
- ### IContainerContext.logger deprecated
39
- Use `IContainerContext.taggedLogger` instead if present. If it's missing and you must use `logger`,
40
- be sure to handle tagged data before sending events to it.
41
- `logger` won't be removed for a very long time since old loaders could remain in production for quite some time.