@fluidframework/container-definitions 1.2.1 → 2.0.0-internal.1.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.
@@ -5,6 +5,24 @@
5
5
  /// <reference types="node" />
6
6
  import { EventEmitter } from "events";
7
7
  import { IClient } from "@fluidframework/protocol-definitions";
8
+ /**
9
+ * Manages the state and the members for {@link IAudience}
10
+ */
11
+ export interface IAudienceOwner extends IAudience {
12
+ /**
13
+ * Adds a new client to the audience
14
+ */
15
+ addMember(clientId: string, details: IClient): any;
16
+ /**
17
+ * Removes a client from the audience. Only emits an event if a client is actually removed
18
+ * @returns if a client was removed from the audience
19
+ */
20
+ removeMember(clientId: string): boolean;
21
+ /**
22
+ * Clears the audience
23
+ */
24
+ clear(): any;
25
+ }
8
26
  /**
9
27
  * Audience represents all clients connected to the op stream, both read-only and read/write.
10
28
  *
@@ -1 +1 @@
1
- {"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC3C;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,cAAc,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;IAErG;;OAEG;IACH,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACpD"}
1
+ {"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC7C;;OAEG;IACF,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,OAAE;IAE9C;;;MAGE;IACF,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAExC;;OAEG;IACH,KAAK,QAAG;CACZ;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC3C;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,cAAc,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;IAErG;;OAEG;IACH,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"audience.js","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\n\n/**\n * Audience represents all clients connected to the op stream, both read-only and read/write.\n *\n * See {@link https://nodejs.org/api/events.html#class-eventemitter | here} for an overview of the `EventEmitter`\n * class.\n */\nexport interface IAudience extends EventEmitter {\n /**\n * See {@link https://nodejs.dev/learn/the-nodejs-event-emitter | here} for an overview of `EventEmitter.on`.\n */\n on(event: \"addMember\" | \"removeMember\", listener: (clientId: string, client: IClient) => void): this;\n\n /**\n * List all clients connected to the op stream, keyed off their clientId\n */\n getMembers(): Map<string, IClient>;\n\n /**\n * Get details about the connected client with the specified clientId,\n * or undefined if the specified client isn't connected\n */\n getMember(clientId: string): IClient | undefined;\n}\n"]}
1
+ {"version":3,"file":"audience.js","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\n\n/**\n * Manages the state and the members for {@link IAudience}\n */\nexport interface IAudienceOwner extends IAudience {\n /**\n * Adds a new client to the audience\n */\n addMember(clientId: string, details: IClient);\n\n /**\n * Removes a client from the audience. Only emits an event if a client is actually removed\n * @returns if a client was removed from the audience\n */\n removeMember(clientId: string): boolean;\n\n /**\n * Clears the audience\n */\n clear();\n}\n\n/**\n * Audience represents all clients connected to the op stream, both read-only and read/write.\n *\n * See {@link https://nodejs.org/api/events.html#class-eventemitter | here} for an overview of the `EventEmitter`\n * class.\n */\nexport interface IAudience extends EventEmitter {\n /**\n * See {@link https://nodejs.dev/learn/the-nodejs-event-emitter | here} for an overview of `EventEmitter.on`.\n */\n on(event: \"addMember\" | \"removeMember\", listener: (clientId: string, client: IClient) => void): this;\n\n /**\n * List all clients connected to the op stream, keyed off their clientId\n */\n getMembers(): Map<string, IClient>;\n\n /**\n * Get details about the connected client with the specified clientId,\n * or undefined if the specified client isn't connected\n */\n getMember(clientId: string): IClient | undefined;\n}\n"]}
package/dist/deltas.d.ts CHANGED
@@ -142,7 +142,14 @@ export interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, ID
142
142
  * Returns all the items in the queue as an array. Does not remove them from the queue.
143
143
  */
144
144
  toArray(): T[];
145
- waitTillProcessingDone(): Promise<void>;
145
+ /**
146
+ * returns number of ops processed and time it took to process these ops.
147
+ * Zeros if queue did not process anything (had no messages, was paused or had hit an error before)
148
+ */
149
+ waitTillProcessingDone(): Promise<{
150
+ count: number;
151
+ duration: number;
152
+ }>;
146
153
  }
147
154
  export declare type ReadOnlyInfo = {
148
155
  readonly readonly: false | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"deltas.d.ts","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtG,OAAO,EACH,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,YAAY,EACf,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C;;;;;;OAMG;IACH,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAEtD;;OAEG;IACH,aAAa,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACjB;AAED,0CAA0C;AAC1C,MAAM,WAAW,mBAAoB,SAAQ,MAAM;IAC/C,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE,KAAK,IAAI,OAAE;IACjE,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAA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Q,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,OAAE;CACxE;AAED;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW;IACrF;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;IAEf;;OAEG;IACH,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC;IAEtB;;OAEG;IACH,OAAO,IAAI,CAAC,EAAE,CAAC;IAEf;;;OAGG;IACH,sBAAsB,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;KAAE,CAAC,CAAC;CAC3E;AAED,oBAAY,YAAY,GAAG;IACvB,QAAQ,CAAC,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;CACxC,GAAG;IACA,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C,gDAAgD;IAChD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CACjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IEvent, IErrorEvent } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Contract representing the result of a newly established connection to the server for syncing deltas\n */\nexport interface IConnectionDetails {\n clientId: string;\n claims: ITokenClaims;\n existing: boolean;\n mode: ConnectionMode;\n version: string;\n initialClients: ISignalClient[];\n serviceConfiguration: IClientConfiguration;\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber: number | undefined;\n}\n\n/**\n * Interface used to define a strategy for handling incoming delta messages\n */\nexport interface IDeltaHandlerStrategy {\n /**\n * Processes the message.\n */\n process: (message: ISequencedDocumentMessage) => void;\n\n /**\n * Processes the signal.\n */\n processSignal: (message: ISignalMessage) => void;\n}\n\n/**\n * Contract supporting delivery of outbound messages to the server\n */\nexport interface IDeltaSender {\n /**\n * Flush all pending messages through the outbound queue\n */\n flush(): void;\n}\n\n/** Events emitted by the Delta Manager */\nexport interface IDeltaManagerEvents extends IEvent {\n (event: \"prepareSend\", listener: (messageBuffer: any[]) => void);\n (event: \"submitOp\", listener: (message: IDocumentMessage) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage, processingTime: number) => void);\n (event: \"allSentOpsAckd\", listener: () => void);\n (event: \"pong\" | \"processTime\", listener: (latency: number) => void);\n /**\n * The connect event fires once we've received the connect_document_success message from the\n * server. This happens prior to the client's join message (if there is a join message).\n */\n (event: \"connect\", listener: (details: IConnectionDetails, opsBehind?: number) => void);\n (event: \"disconnect\", listener: (reason: string) => void);\n (event: \"readonly\", listener: (readonly: boolean) => void);\n}\n\n/**\n * Manages the transmission of ops between the runtime and storage.\n */\nexport interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {\n /** The queue of inbound delta messages */\n readonly inbound: IDeltaQueue<T>;\n\n /** The queue of outbound delta messages */\n readonly outbound: IDeltaQueue<U[]>;\n\n /** The queue of inbound delta signals */\n readonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n /** The current minimum sequence number */\n readonly minimumSequenceNumber: number;\n\n /** The last sequence number processed by the delta manager */\n readonly lastSequenceNumber: number;\n\n /** The last message processed by the delta manager */\n readonly lastMessage: ISequencedDocumentMessage | undefined;\n\n /** The latest sequence number the delta manager is aware of */\n readonly lastKnownSeqNumber: number;\n\n /** The initial sequence number set when attaching the op handler */\n readonly initialSequenceNumber: number;\n\n /**\n * Tells if current connection has checkpoint information.\n * I.e. we know how far behind the client was at the time of establishing connection\n */\n readonly hasCheckpointSequenceNumber: boolean;\n\n /** Details of client */\n readonly clientDetails: IClientDetails;\n\n /** Protocol version being used to communicate with the service */\n readonly version: string;\n\n /** Max message size allowed to the delta manager */\n readonly maxMessageSize: number;\n\n /** Service configuration provided by the service. */\n readonly serviceConfiguration: IClientConfiguration | undefined;\n\n /** Flag to indicate whether the client can write or not. */\n readonly active: boolean;\n\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */\n submitSignal(content: any): void;\n}\n\n/** Events emitted by a Delta Queue */\nexport interface IDeltaQueueEvents<T> extends IErrorEvent {\n (event: \"push\" | \"op\", listener: (task: T) => void);\n /**\n * @param count - number of events (T) processed before becoming idle\n * @param duration - amount of time it took to process elements (milliseconds).\n */\n (event: \"idle\", listener: (count: number, duration: number) => void);\n}\n\n/**\n * Queue of ops to be sent to or processed from storage\n */\nexport interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {\n /**\n * Flag indicating whether or not the queue was paused\n */\n paused: boolean;\n\n /**\n * The number of messages remaining in the queue\n */\n length: number;\n\n /**\n * Flag indicating whether or not the queue is idle\n */\n idle: boolean;\n\n /**\n * Pauses processing on the queue\n * @returns A promise which resolves when processing has been paused.\n */\n pause(): Promise<void>;\n\n /**\n * Resumes processing on the queue\n */\n resume(): void;\n\n /**\n * Peeks at the next message in the queue\n */\n peek(): T | undefined;\n\n /**\n * Returns all the items in the queue as an array. Does not remove them from the queue.\n */\n toArray(): T[];\n\n waitTillProcessingDone(): Promise<void>;\n}\n\nexport type ReadOnlyInfo = {\n readonly readonly: false | undefined;\n} | {\n readonly readonly: true;\n /** read-only because forceReadOnly() was called */\n readonly forced: boolean;\n /** read-only because client does not have write permissions for document */\n readonly permissions: boolean | undefined;\n /** read-only with no delta stream connection */\n readonly storageOnly: boolean;\n};\n"]}
1
+ {"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IEvent, IErrorEvent } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Contract representing the result of a newly established connection to the server for syncing deltas\n */\nexport interface IConnectionDetails {\n clientId: string;\n claims: ITokenClaims;\n existing: boolean;\n mode: ConnectionMode;\n version: string;\n initialClients: ISignalClient[];\n serviceConfiguration: IClientConfiguration;\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber: number | undefined;\n}\n\n/**\n * Interface used to define a strategy for handling incoming delta messages\n */\nexport interface IDeltaHandlerStrategy {\n /**\n * Processes the message.\n */\n process: (message: ISequencedDocumentMessage) => void;\n\n /**\n * Processes the signal.\n */\n processSignal: (message: ISignalMessage) => void;\n}\n\n/**\n * Contract supporting delivery of outbound messages to the server\n */\nexport interface IDeltaSender {\n /**\n * Flush all pending messages through the outbound queue\n */\n flush(): void;\n}\n\n/** Events emitted by the Delta Manager */\nexport interface IDeltaManagerEvents extends IEvent {\n (event: \"prepareSend\", listener: (messageBuffer: any[]) => void);\n (event: \"submitOp\", listener: (message: IDocumentMessage) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage, processingTime: number) => void);\n (event: \"allSentOpsAckd\", listener: () => void);\n (event: \"pong\" | \"processTime\", listener: (latency: number) => void);\n /**\n * The connect event fires once we've received the connect_document_success message from the\n * server. This happens prior to the client's join message (if there is a join message).\n */\n (event: \"connect\", listener: (details: IConnectionDetails, opsBehind?: number) => void);\n (event: \"disconnect\", listener: (reason: string) => void);\n (event: \"readonly\", listener: (readonly: boolean) => void);\n}\n\n/**\n * Manages the transmission of ops between the runtime and storage.\n */\nexport interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {\n /** The queue of inbound delta messages */\n readonly inbound: IDeltaQueue<T>;\n\n /** The queue of outbound delta messages */\n readonly outbound: IDeltaQueue<U[]>;\n\n /** The queue of inbound delta signals */\n readonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n /** The current minimum sequence number */\n readonly minimumSequenceNumber: number;\n\n /** The last sequence number processed by the delta manager */\n readonly lastSequenceNumber: number;\n\n /** The last message processed by the delta manager */\n readonly lastMessage: ISequencedDocumentMessage | undefined;\n\n /** The latest sequence number the delta manager is aware of */\n readonly lastKnownSeqNumber: number;\n\n /** The initial sequence number set when attaching the op handler */\n readonly initialSequenceNumber: number;\n\n /**\n * Tells if current connection has checkpoint information.\n * I.e. we know how far behind the client was at the time of establishing connection\n */\n readonly hasCheckpointSequenceNumber: boolean;\n\n /** Details of client */\n readonly clientDetails: IClientDetails;\n\n /** Protocol version being used to communicate with the service */\n readonly version: string;\n\n /** Max message size allowed to the delta manager */\n readonly maxMessageSize: number;\n\n /** Service configuration provided by the service. */\n readonly serviceConfiguration: IClientConfiguration | undefined;\n\n /** Flag to indicate whether the client can write or not. */\n readonly active: boolean;\n\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */\n submitSignal(content: any): void;\n}\n\n/** Events emitted by a Delta Queue */\nexport interface IDeltaQueueEvents<T> extends IErrorEvent {\n (event: \"push\" | \"op\", listener: (task: T) => void);\n /**\n * @param count - number of events (T) processed before becoming idle\n * @param duration - amount of time it took to process elements (milliseconds).\n */\n (event: \"idle\", listener: (count: number, duration: number) => void);\n}\n\n/**\n * Queue of ops to be sent to or processed from storage\n */\nexport interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {\n /**\n * Flag indicating whether or not the queue was paused\n */\n paused: boolean;\n\n /**\n * The number of messages remaining in the queue\n */\n length: number;\n\n /**\n * Flag indicating whether or not the queue is idle\n */\n idle: boolean;\n\n /**\n * Pauses processing on the queue\n * @returns A promise which resolves when processing has been paused.\n */\n pause(): Promise<void>;\n\n /**\n * Resumes processing on the queue\n */\n resume(): void;\n\n /**\n * Peeks at the next message in the queue\n */\n peek(): T | undefined;\n\n /**\n * Returns all the items in the queue as an array. Does not remove them from the queue.\n */\n toArray(): T[];\n\n /**\n * returns number of ops processed and time it took to process these ops.\n * Zeros if queue did not process anything (had no messages, was paused or had hit an error before)\n */\n waitTillProcessingDone(): Promise<{ count: number; duration: number; }>;\n}\n\nexport type ReadOnlyInfo = {\n readonly readonly: false | undefined;\n} | {\n readonly readonly: true;\n /** read-only because forceReadOnly() was called */\n readonly forced: boolean;\n /** read-only because client does not have write permissions for document */\n readonly permissions: boolean | undefined;\n /** read-only with no delta stream connection */\n readonly storageOnly: boolean;\n};\n"]}
package/dist/loader.d.ts CHANGED
@@ -12,17 +12,6 @@ import { ICriticalContainerError, ContainerWarning } from "./error";
12
12
  import { IFluidModule } from "./fluidModule";
13
13
  import { AttachState } from "./runtime";
14
14
  import { IFluidCodeDetails, IFluidPackage, IProvideFluidCodeDetailsComparer } from "./fluidPackage";
15
- /**
16
- * Code loading interface
17
- *
18
- * @deprecated in favor of {@link @fluidframework/container-loader#ICodeDetailsLoader}
19
- */
20
- export interface ICodeLoader extends Partial<IProvideFluidCodeDetailsComparer> {
21
- /**
22
- * Loads the package specified by code details and returns a promise to its entry point exports.
23
- */
24
- load(source: IFluidCodeDetails): Promise<IFluidModule>;
25
- }
26
15
  /**
27
16
  * Encapsulates a module entry point with corresponding code details.
28
17
  */
@@ -121,11 +110,6 @@ export declare namespace ConnectionState {
121
110
  * The container has an inbound connection only, and is catching up to the latest known state from the service.
122
111
  */
123
112
  type CatchingUp = 1;
124
- /**
125
- * See ConnectionState.CatchingUp, which is the new name for this state.
126
- * @deprecated - This state itself is not gone, just being renamed. Please use ConnectionState.CatchingUp.
127
- */
128
- type Connecting = 1;
129
113
  /**
130
114
  * The container is fully connected and syncing
131
115
  */
@@ -134,7 +118,7 @@ export declare namespace ConnectionState {
134
118
  /**
135
119
  * Type defining the different states of connectivity a container can be in
136
120
  */
137
- export declare type ConnectionState = ConnectionState.Disconnected | ConnectionState.EstablishingConnection | ConnectionState.CatchingUp | ConnectionState.Connecting | ConnectionState.Connected;
121
+ export declare type ConnectionState = ConnectionState.Disconnected | ConnectionState.EstablishingConnection | ConnectionState.CatchingUp | ConnectionState.Connected;
138
122
  /**
139
123
  * The Host's view of the Container and its connection to storage
140
124
  */
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,QAAQ,EACR,SAAS,EACT,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM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;CAC7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwXH;;GAEG;AACH,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACpB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACvB,CAAC,EAtBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IRequest,\n IResponse,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IClientDetails,\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISequencedProposal,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport {\n IFluidCodeDetails,\n IFluidPackage,\n IProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n/**\n * Code loading interface\n *\n * @deprecated in favor of {@link @fluidframework/container-loader#ICodeDetailsLoader}\n */\nexport interface ICodeLoader extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Loads the package specified by code details and returns a promise to its entry point exports.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModule>;\n}\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n /** Fluid code module that implements the runtime factory needed to instantiate the container runtime. */\n module: IFluidModule;\n /**\n * Code details associated with the module. Represents a document schema this module supports.\n * If the code loader implements the {@link @fluidframework/core-interfaces#IFluidCodeDetailsComparer} interface,\n * it'll be called to determine whether the module code details satisfy the new code proposal in the quorum.\n */\n details: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader\n extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Load the code module (package) that is capable to interact with the document.\n *\n * @param source - Code proposal that articulates the current schema the document is written in.\n * @returns - Code module entry point along with the code details associated with it.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n* The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n /**\n * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n */\n readonly resolvedPackage: Readonly<IFluidPackage>;\n /**\n * If not undefined, this id will be used to cache the entry point for the code package\n */\n readonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n /**\n * Resolves a Fluid code details into a form that can be loaded\n * @param details - The Fluid code details to resolve\n * @returns - A IResolvedFluidCodeDetails where the\n * resolvedPackage's Fluid file entries are absolute urls, and\n * an optional resolvedPackageCacheId if the loaded package should be\n * cached.\n */\n resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n */\nexport interface ICodeAllowList {\n testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the Container \"upwards\" to the Loader and Host\n */\nexport interface IContainerEvents extends IEvent {\n (event: \"readonly\", listener: (readonly: boolean) => void): void;\n (event: \"connected\", listener: (clientId: string) => void);\n (event: \"codeDetailsProposed\", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void);\n (event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n (event: \"disconnected\" | \"attached\", listener: () => void);\n (event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n (event: \"warning\", listener: (error: ContainerWarning) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n (event: \"dirty\" | \"saved\", listener: (dirty: boolean) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression\n */\nexport namespace ConnectionState {\n /**\n * The container is not connected to the delta server\n * Note - When in this state the container may be about to reconnect,\n * or may remain disconnected until explicitly told to connect.\n */\n export type Disconnected = 0;\n\n /**\n * The container is disconnected but actively trying to establish a new connection\n * PLEASE NOTE that this numerical value falls out of the order you may expect for this state\n */\n export type EstablishingConnection = 3;\n\n /**\n * The container has an inbound connection only, and is catching up to the latest known state from the service.\n */\n export type CatchingUp = 1;\n\n /**\n * See ConnectionState.CatchingUp, which is the new name for this state.\n * @deprecated - This state itself is not gone, just being renamed. Please use ConnectionState.CatchingUp.\n */\n export type Connecting = 1;\n\n /**\n * The container is fully connected and syncing\n */\n export type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a container can be in\n */\nexport type ConnectionState =\n | ConnectionState.Disconnected\n | ConnectionState.EstablishingConnection\n | ConnectionState.CatchingUp\n | ConnectionState.Connecting\n | ConnectionState.Connected;\n\n/**\n * The Host's view of the Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\n /**\n * The Delta Manager supporting the op stream for this Container\n */\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n /**\n * The collection of write clients which were connected as of the current sequence number.\n * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Represents the resolved url to the Container\n * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n */\n resolvedUrl: IResolvedUrl | undefined;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Get the code details that are currently specified for the container.\n * @returns The current code details if any are specified, undefined if none are specified.\n */\n getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Get the code details that were used to load the container.\n * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n * loaded.\n */\n getLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Returns true if the container has been closed, otherwise false\n */\n readonly closed: boolean;\n\n /**\n * Returns true if the container is dirty, i.e. there are user changes that has not been saved\n * Closing container in this state results in data loss for user.\n * Container usually gets into this situation due to loss of connectivity.\n */\n readonly isDirty: boolean;\n\n /**\n * Closes the container\n */\n close(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container and returns serialized local state intended to be\n * given to a newly loaded container\n */\n closeAndGetPendingLocalState(): string;\n\n /**\n * Propose new code details that define the code to be loaded\n * for this container's runtime. The returned promise will\n * be true when the proposal is accepted, and false if\n * the proposal is rejected.\n */\n proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n /**\n * Attaches the Container to the Container specified by the given Request.\n *\n * TODO - in the case of failure options should give a retry policy. Or some continuation function\n * that allows attachment to a secondary document.\n */\n attach(request: IRequest): Promise<void>;\n\n /**\n * Extract the snapshot from the detached container.\n */\n serialize(): string;\n\n /**\n * Get an absolute url for a provided container-relative request url.\n * If the container is not attached, this will return undefined.\n *\n * @param relativeUrl - A container-relative request URL\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Issue a request against the container for a resource.\n * @param request - The request to be issued against the container\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Provides the current state of the container's connection to the ordering service\n */\n readonly connectionState: ConnectionState;\n\n /**\n * Attempts to connect the container to the delta stream and process ops\n */\n connect(): void;\n\n /**\n * Disconnects the container from the delta stream and stops processing ops\n */\n disconnect(): void;\n\n /**\n * The audience information for all clients currently associated with the document in the current session\n */\n readonly audience: IAudience;\n\n /**\n * The server provided ID of the client.\n * Set once this.connectionState === ConnectionState.Connected is true, otherwise undefined\n * @alpha\n */\n readonly clientId?: string | undefined;\n\n /**\n * Tells if container is in read-only mode.\n * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n * Readonly state can be because of no storage write permission,\n * or due to host forcing readonly mode for container.\n *\n * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n *\n * It is undefined if we have not yet established websocket connection\n * and do not know if user has write access to a file.\n */\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /**\n * Allows the host to have the container force to be in read-only mode\n * @param readonly - Boolean that toggles if read-only policies will be enforced\n * @alpha\n */\n forceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n /**\n * Resolves the resource specified by the URL + headers contained in the request object\n * to the underlying container that will resolve the request.\n *\n * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n * a request against the server found from the resolve step.\n */\n resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n /**\n * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n /**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n [key in string | number]: any;\n} & {\n /**\n * Set caching behavior for the loader. If true, we will load a container from cache if one\n * with the same id/version exists or create a new container and cache it if it does not. If\n * false, always load a new container and don't cache it. If the container has already been\n * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n * request will override the Loader's value.\n * Defaults to true.\n */\n cache?: boolean;\n\n /**\n * Provide the current Loader through the scope object when creating Containers. It is added\n * as the `ILoader` property, and will overwrite an existing property of the same name on the\n * scope. Useful for when the host wants to provide the current Loader's functionality to\n * individual Data Stores, which is typically expected when creating with a Loader.\n * Defaults to true.\n */\n provideScopeLoader?: boolean;\n\n /**\n * Max time(in ms) container will wait for a leave message of a disconnected client.\n */\n maxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n /**\n * Override the Loader's default caching behavior for this container.\n */\n cache = \"fluid-cache\",\n\n clientDetails = \"fluid-client-details\",\n\n /**\n * Start the container in a paused, unconnected state. Defaults to false\n */\n loadMode = \"loadMode\",\n reconnect = \"fluid-reconnect\",\n sequenceNumber = \"fluid-sequence-number\",\n\n /**\n * One of the following:\n * null or \"null\": use ops, no snapshots\n * undefined: fetch latest snapshot\n * otherwise, version sha to load snapshot\n */\n version = \"version\",\n}\n\nexport interface IContainerLoadMode {\n opsBeforeReturn?:\n /*\n * No trailing ops are applied before container is returned.\n * Default value.\n */\n | undefined\n /*\n * Only cached trailing ops are applied before returning container.\n * Caching is optional and could be implemented by the driver.\n * If driver does not implement any kind of local caching strategy, this is same as above.\n * Driver may cache a lot of ops, so care needs to be exercised (see below).\n */\n | \"cached\"\n /*\n * All trailing ops in storage are fetched and applied before container is returned\n * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n * recommended to have some progress UX / cancellation built into loading flow when using this option.\n */\n | \"all\";\n deltaConnection?:\n /*\n * Connection to delta stream is made only when Container.connect() call is made. Op processing\n * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n */\n | \"none\"\n /*\n * Connection to delta stream is made only when Container.connect() call is made.\n * Op fetching from storage is performed and ops are applied as they come in.\n * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n */\n | \"delayed\"\n /*\n * Connection to delta stream is made right away.\n * Ops processing is enabled and ops are flowing through the system.\n * Default value.\n */\n | undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n [LoaderHeader.cache]: boolean;\n [LoaderHeader.clientDetails]: IClientDetails;\n [LoaderHeader.loadMode]: IContainerLoadMode;\n [LoaderHeader.sequenceNumber]: number;\n [LoaderHeader.reconnect]: boolean;\n [LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n readonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See https://github.com/microsoft/FluidFramework/issues/9711 for context\n */\nexport interface IPendingLocalState {\n url: string;\n pendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: blobContents. This is used as the ContainerContext's base snapshot\n * when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n blobsContents: { [path: string]: ArrayBufferLike; };\n trees: { [path: string]: ISnapshotTreeWithBlobContents; };\n}\n"]}
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAqWH;;GAEG;AACH,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACpB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACvB,CAAC,EAtBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IRequest,\n IResponse,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IClientDetails,\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISequencedProposal,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport {\n IFluidCodeDetails,\n IFluidPackage,\n IProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n /** Fluid code module that implements the runtime factory needed to instantiate the container runtime. */\n module: IFluidModule;\n /**\n * Code details associated with the module. Represents a document schema this module supports.\n * If the code loader implements the {@link @fluidframework/core-interfaces#IFluidCodeDetailsComparer} interface,\n * it'll be called to determine whether the module code details satisfy the new code proposal in the quorum.\n */\n details: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader\n extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Load the code module (package) that is capable to interact with the document.\n *\n * @param source - Code proposal that articulates the current schema the document is written in.\n * @returns - Code module entry point along with the code details associated with it.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n* The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n /**\n * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n */\n readonly resolvedPackage: Readonly<IFluidPackage>;\n /**\n * If not undefined, this id will be used to cache the entry point for the code package\n */\n readonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n /**\n * Resolves a Fluid code details into a form that can be loaded\n * @param details - The Fluid code details to resolve\n * @returns - A IResolvedFluidCodeDetails where the\n * resolvedPackage's Fluid file entries are absolute urls, and\n * an optional resolvedPackageCacheId if the loaded package should be\n * cached.\n */\n resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n */\nexport interface ICodeAllowList {\n testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the Container \"upwards\" to the Loader and Host\n */\nexport interface IContainerEvents extends IEvent {\n (event: \"readonly\", listener: (readonly: boolean) => void): void;\n (event: \"connected\", listener: (clientId: string) => void);\n (event: \"codeDetailsProposed\", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void);\n (event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n (event: \"disconnected\" | \"attached\", listener: () => void);\n (event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n (event: \"warning\", listener: (error: ContainerWarning) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n (event: \"dirty\" | \"saved\", listener: (dirty: boolean) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression\n */\nexport namespace ConnectionState {\n /**\n * The container is not connected to the delta server\n * Note - When in this state the container may be about to reconnect,\n * or may remain disconnected until explicitly told to connect.\n */\n export type Disconnected = 0;\n\n /**\n * The container is disconnected but actively trying to establish a new connection\n * PLEASE NOTE that this numerical value falls out of the order you may expect for this state\n */\n export type EstablishingConnection = 3;\n\n /**\n * The container has an inbound connection only, and is catching up to the latest known state from the service.\n */\n export type CatchingUp = 1;\n\n /**\n * The container is fully connected and syncing\n */\n export type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a container can be in\n */\nexport type ConnectionState =\n | ConnectionState.Disconnected\n | ConnectionState.EstablishingConnection\n | ConnectionState.CatchingUp\n | ConnectionState.Connected;\n\n/**\n * The Host's view of the Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\n /**\n * The Delta Manager supporting the op stream for this Container\n */\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n /**\n * The collection of write clients which were connected as of the current sequence number.\n * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Represents the resolved url to the Container\n * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n */\n resolvedUrl: IResolvedUrl | undefined;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Get the code details that are currently specified for the container.\n * @returns The current code details if any are specified, undefined if none are specified.\n */\n getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Get the code details that were used to load the container.\n * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n * loaded.\n */\n getLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Returns true if the container has been closed, otherwise false\n */\n readonly closed: boolean;\n\n /**\n * Returns true if the container is dirty, i.e. there are user changes that has not been saved\n * Closing container in this state results in data loss for user.\n * Container usually gets into this situation due to loss of connectivity.\n */\n readonly isDirty: boolean;\n\n /**\n * Closes the container\n */\n close(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container and returns serialized local state intended to be\n * given to a newly loaded container\n */\n closeAndGetPendingLocalState(): string;\n\n /**\n * Propose new code details that define the code to be loaded\n * for this container's runtime. The returned promise will\n * be true when the proposal is accepted, and false if\n * the proposal is rejected.\n */\n proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n /**\n * Attaches the Container to the Container specified by the given Request.\n *\n * TODO - in the case of failure options should give a retry policy. Or some continuation function\n * that allows attachment to a secondary document.\n */\n attach(request: IRequest): Promise<void>;\n\n /**\n * Extract the snapshot from the detached container.\n */\n serialize(): string;\n\n /**\n * Get an absolute url for a provided container-relative request url.\n * If the container is not attached, this will return undefined.\n *\n * @param relativeUrl - A container-relative request URL\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Issue a request against the container for a resource.\n * @param request - The request to be issued against the container\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Provides the current state of the container's connection to the ordering service\n */\n readonly connectionState: ConnectionState;\n\n /**\n * Attempts to connect the container to the delta stream and process ops\n */\n connect(): void;\n\n /**\n * Disconnects the container from the delta stream and stops processing ops\n */\n disconnect(): void;\n\n /**\n * The audience information for all clients currently associated with the document in the current session\n */\n readonly audience: IAudience;\n\n /**\n * The server provided ID of the client.\n * Set once this.connectionState === ConnectionState.Connected is true, otherwise undefined\n * @alpha\n */\n readonly clientId?: string | undefined;\n\n /**\n * Tells if container is in read-only mode.\n * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n * Readonly state can be because of no storage write permission,\n * or due to host forcing readonly mode for container.\n *\n * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n *\n * It is undefined if we have not yet established websocket connection\n * and do not know if user has write access to a file.\n */\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /**\n * Allows the host to have the container force to be in read-only mode\n * @param readonly - Boolean that toggles if read-only policies will be enforced\n * @alpha\n */\n forceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n /**\n * Resolves the resource specified by the URL + headers contained in the request object\n * to the underlying container that will resolve the request.\n *\n * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n * a request against the server found from the resolve step.\n */\n resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n /**\n * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n /**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n [key in string | number]: any;\n} & {\n /**\n * Set caching behavior for the loader. If true, we will load a container from cache if one\n * with the same id/version exists or create a new container and cache it if it does not. If\n * false, always load a new container and don't cache it. If the container has already been\n * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n * request will override the Loader's value.\n * Defaults to true.\n */\n cache?: boolean;\n\n /**\n * Provide the current Loader through the scope object when creating Containers. It is added\n * as the `ILoader` property, and will overwrite an existing property of the same name on the\n * scope. Useful for when the host wants to provide the current Loader's functionality to\n * individual Data Stores, which is typically expected when creating with a Loader.\n * Defaults to true.\n */\n provideScopeLoader?: boolean;\n\n /**\n * Max time(in ms) container will wait for a leave message of a disconnected client.\n */\n maxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n /**\n * Override the Loader's default caching behavior for this container.\n */\n cache = \"fluid-cache\",\n\n clientDetails = \"fluid-client-details\",\n\n /**\n * Start the container in a paused, unconnected state. Defaults to false\n */\n loadMode = \"loadMode\",\n reconnect = \"fluid-reconnect\",\n sequenceNumber = \"fluid-sequence-number\",\n\n /**\n * One of the following:\n * null or \"null\": use ops, no snapshots\n * undefined: fetch latest snapshot\n * otherwise, version sha to load snapshot\n */\n version = \"version\",\n}\n\nexport interface IContainerLoadMode {\n opsBeforeReturn?:\n /*\n * No trailing ops are applied before container is returned.\n * Default value.\n */\n | undefined\n /*\n * Only cached trailing ops are applied before returning container.\n * Caching is optional and could be implemented by the driver.\n * If driver does not implement any kind of local caching strategy, this is same as above.\n * Driver may cache a lot of ops, so care needs to be exercised (see below).\n */\n | \"cached\"\n /*\n * All trailing ops in storage are fetched and applied before container is returned\n * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n * recommended to have some progress UX / cancellation built into loading flow when using this option.\n */\n | \"all\";\n deltaConnection?:\n /*\n * Connection to delta stream is made only when Container.connect() call is made. Op processing\n * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n */\n | \"none\"\n /*\n * Connection to delta stream is made only when Container.connect() call is made.\n * Op fetching from storage is performed and ops are applied as they come in.\n * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n */\n | \"delayed\"\n /*\n * Connection to delta stream is made right away.\n * Ops processing is enabled and ops are flowing through the system.\n * Default value.\n */\n | undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n [LoaderHeader.cache]: boolean;\n [LoaderHeader.clientDetails]: IClientDetails;\n [LoaderHeader.loadMode]: IContainerLoadMode;\n [LoaderHeader.sequenceNumber]: number;\n [LoaderHeader.reconnect]: boolean;\n [LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n readonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See https://github.com/microsoft/FluidFramework/issues/9711 for context\n */\nexport interface IPendingLocalState {\n url: string;\n pendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: blobContents. This is used as the ContainerContext's base snapshot\n * when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n blobsContents: { [path: string]: ArrayBufferLike; };\n trees: { [path: string]: ISnapshotTreeWithBlobContents; };\n}\n"]}
package/dist/runtime.d.ts CHANGED
@@ -31,11 +31,6 @@ export declare enum AttachState {
31
31
  */
32
32
  Attached = "Attached"
33
33
  }
34
- export declare enum BindState {
35
- NotBound = "NotBound",
36
- Binding = "Binding",
37
- Bound = "Bound"
38
- }
39
34
  /**
40
35
  * The IRuntime represents an instantiation of a code package within a Container.
41
36
  * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EACH,WAAW,EACX,QAAQ,EACR,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,yBAAyB,EACzB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;GAGG;AACH,oBAAY,WAAW;IACnB;;;OAGG;IACH,QAAQ,aAAa;IAErB;;OAEG;IACH,SAAS,cAAc;IAEvB;;;OAGG;IACH,QAAQ,aAAa;CACxB;AAGD,oBAAY,SAAS;IACjB,QAAQ,aAAa;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5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.IRuntimeFactory = exports.BindState = exports.AttachState = void 0;
7
+ exports.IRuntimeFactory = exports.AttachState = void 0;
8
8
  /**
9
9
  * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the
10
10
  * service. The transition from detached to attached state is a one-way transition.
@@ -26,12 +26,5 @@ var AttachState;
26
26
  */
27
27
  AttachState["Attached"] = "Attached";
28
28
  })(AttachState = exports.AttachState || (exports.AttachState = {}));
29
- // Represents the bind state of the entity.
30
- var BindState;
31
- (function (BindState) {
32
- BindState["NotBound"] = "NotBound";
33
- BindState["Binding"] = "Binding";
34
- BindState["Bound"] = "Bound";
35
- })(BindState = exports.BindState || (exports.BindState = {}));
36
29
  exports.IRuntimeFactory = "IRuntimeFactory";
37
30
  //# sourceMappingURL=runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA0BH;;;GAGG;AACH,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACnB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACzB,CAAC,EAjBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAiBtB;AAED,2CAA2C;AAC3C,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,kCAAqB,CAAA;IACrB,gCAAmB,CAAA;IACnB,4BAAe,CAAA;AACnB,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AAwHY,QAAA,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;;;AA0BH;;;GAGG;AACH,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACnB;;;OAGG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,oCAAqB,CAAA;AACzB,CAAC,EAjBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAiBtB;AAwHY,QAAA,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/**\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"]}
package/lib/audience.d.ts CHANGED
@@ -5,6 +5,24 @@
5
5
  /// <reference types="node" />
6
6
  import { EventEmitter } from "events";
7
7
  import { IClient } from "@fluidframework/protocol-definitions";
8
+ /**
9
+ * Manages the state and the members for {@link IAudience}
10
+ */
11
+ export interface IAudienceOwner extends IAudience {
12
+ /**
13
+ * Adds a new client to the audience
14
+ */
15
+ addMember(clientId: string, details: IClient): any;
16
+ /**
17
+ * Removes a client from the audience. Only emits an event if a client is actually removed
18
+ * @returns if a client was removed from the audience
19
+ */
20
+ removeMember(clientId: string): boolean;
21
+ /**
22
+ * Clears the audience
23
+ */
24
+ clear(): any;
25
+ }
8
26
  /**
9
27
  * Audience represents all clients connected to the op stream, both read-only and read/write.
10
28
  *
@@ -1 +1 @@
1
- {"version":3,"file":"audience.d.ts","sourceRoot":"","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;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"audience.js","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\n\n/**\n * Audience represents all clients connected to the op stream, both read-only and read/write.\n *\n * See {@link https://nodejs.org/api/events.html#class-eventemitter | here} for an overview of the `EventEmitter`\n * class.\n */\nexport interface IAudience extends EventEmitter {\n /**\n * See {@link https://nodejs.dev/learn/the-nodejs-event-emitter | here} for an overview of `EventEmitter.on`.\n */\n on(event: \"addMember\" | \"removeMember\", listener: (clientId: string, client: IClient) => void): this;\n\n /**\n * List all clients connected to the op stream, keyed off their clientId\n */\n getMembers(): Map<string, IClient>;\n\n /**\n * Get details about the connected client with the specified clientId,\n * or undefined if the specified client isn't connected\n */\n getMember(clientId: string): IClient | undefined;\n}\n"]}
1
+ {"version":3,"file":"audience.js","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\n\n/**\n * Manages the state and the members for {@link IAudience}\n */\nexport interface IAudienceOwner extends IAudience {\n /**\n * Adds a new client to the audience\n */\n addMember(clientId: string, details: IClient);\n\n /**\n * Removes a client from the audience. Only emits an event if a client is actually removed\n * @returns if a client was removed from the audience\n */\n removeMember(clientId: string): boolean;\n\n /**\n * Clears the audience\n */\n clear();\n}\n\n/**\n * Audience represents all clients connected to the op stream, both read-only and read/write.\n *\n * See {@link https://nodejs.org/api/events.html#class-eventemitter | here} for an overview of the `EventEmitter`\n * class.\n */\nexport interface IAudience extends EventEmitter {\n /**\n * See {@link https://nodejs.dev/learn/the-nodejs-event-emitter | here} for an overview of `EventEmitter.on`.\n */\n on(event: \"addMember\" | \"removeMember\", listener: (clientId: string, client: IClient) => void): this;\n\n /**\n * List all clients connected to the op stream, keyed off their clientId\n */\n getMembers(): Map<string, IClient>;\n\n /**\n * Get details about the connected client with the specified clientId,\n * or undefined if the specified client isn't connected\n */\n getMember(clientId: string): IClient | undefined;\n}\n"]}
package/lib/deltas.d.ts CHANGED
@@ -142,7 +142,14 @@ export interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, ID
142
142
  * Returns all the items in the queue as an array. Does not remove them from the queue.
143
143
  */
144
144
  toArray(): T[];
145
- waitTillProcessingDone(): Promise<void>;
145
+ /**
146
+ * returns number of ops processed and time it took to process these ops.
147
+ * Zeros if queue did not process anything (had no messages, was paused or had hit an error before)
148
+ */
149
+ waitTillProcessingDone(): Promise<{
150
+ count: number;
151
+ duration: number;
152
+ }>;
146
153
  }
147
154
  export declare type ReadOnlyInfo = {
148
155
  readonly readonly: false | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"deltas.d.ts","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtG,OAAO,EACH,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,YAAY,EACf,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,aAAa,EA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AAC,QAAQ,EAAE,MAAM,CAAC;KAAE,CAAC,CAAC;CAC3E;AAED,oBAAY,YAAY,GAAG;IACvB,QAAQ,CAAC,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;CACxC,GAAG;IACA,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C,gDAAgD;IAChD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CACjC,CAAC"}
package/lib/deltas.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IEvent, IErrorEvent } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Contract representing the result of a newly established connection to the server for syncing deltas\n */\nexport interface IConnectionDetails {\n clientId: string;\n claims: ITokenClaims;\n existing: boolean;\n mode: ConnectionMode;\n version: string;\n initialClients: ISignalClient[];\n serviceConfiguration: IClientConfiguration;\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber: number | undefined;\n}\n\n/**\n * Interface used to define a strategy for handling incoming delta messages\n */\nexport interface IDeltaHandlerStrategy {\n /**\n * Processes the message.\n */\n process: (message: ISequencedDocumentMessage) => void;\n\n /**\n * Processes the signal.\n */\n processSignal: (message: ISignalMessage) => void;\n}\n\n/**\n * Contract supporting delivery of outbound messages to the server\n */\nexport interface IDeltaSender {\n /**\n * Flush all pending messages through the outbound queue\n */\n flush(): void;\n}\n\n/** Events emitted by the Delta Manager */\nexport interface IDeltaManagerEvents extends IEvent {\n (event: \"prepareSend\", listener: (messageBuffer: any[]) => void);\n (event: \"submitOp\", listener: (message: IDocumentMessage) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage, processingTime: number) => void);\n (event: \"allSentOpsAckd\", listener: () => void);\n (event: \"pong\" | \"processTime\", listener: (latency: number) => void);\n /**\n * The connect event fires once we've received the connect_document_success message from the\n * server. This happens prior to the client's join message (if there is a join message).\n */\n (event: \"connect\", listener: (details: IConnectionDetails, opsBehind?: number) => void);\n (event: \"disconnect\", listener: (reason: string) => void);\n (event: \"readonly\", listener: (readonly: boolean) => void);\n}\n\n/**\n * Manages the transmission of ops between the runtime and storage.\n */\nexport interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {\n /** The queue of inbound delta messages */\n readonly inbound: IDeltaQueue<T>;\n\n /** The queue of outbound delta messages */\n readonly outbound: IDeltaQueue<U[]>;\n\n /** The queue of inbound delta signals */\n readonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n /** The current minimum sequence number */\n readonly minimumSequenceNumber: number;\n\n /** The last sequence number processed by the delta manager */\n readonly lastSequenceNumber: number;\n\n /** The last message processed by the delta manager */\n readonly lastMessage: ISequencedDocumentMessage | undefined;\n\n /** The latest sequence number the delta manager is aware of */\n readonly lastKnownSeqNumber: number;\n\n /** The initial sequence number set when attaching the op handler */\n readonly initialSequenceNumber: number;\n\n /**\n * Tells if current connection has checkpoint information.\n * I.e. we know how far behind the client was at the time of establishing connection\n */\n readonly hasCheckpointSequenceNumber: boolean;\n\n /** Details of client */\n readonly clientDetails: IClientDetails;\n\n /** Protocol version being used to communicate with the service */\n readonly version: string;\n\n /** Max message size allowed to the delta manager */\n readonly maxMessageSize: number;\n\n /** Service configuration provided by the service. */\n readonly serviceConfiguration: IClientConfiguration | undefined;\n\n /** Flag to indicate whether the client can write or not. */\n readonly active: boolean;\n\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */\n submitSignal(content: any): void;\n}\n\n/** Events emitted by a Delta Queue */\nexport interface IDeltaQueueEvents<T> extends IErrorEvent {\n (event: \"push\" | \"op\", listener: (task: T) => void);\n /**\n * @param count - number of events (T) processed before becoming idle\n * @param duration - amount of time it took to process elements (milliseconds).\n */\n (event: \"idle\", listener: (count: number, duration: number) => void);\n}\n\n/**\n * Queue of ops to be sent to or processed from storage\n */\nexport interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {\n /**\n * Flag indicating whether or not the queue was paused\n */\n paused: boolean;\n\n /**\n * The number of messages remaining in the queue\n */\n length: number;\n\n /**\n * Flag indicating whether or not the queue is idle\n */\n idle: boolean;\n\n /**\n * Pauses processing on the queue\n * @returns A promise which resolves when processing has been paused.\n */\n pause(): Promise<void>;\n\n /**\n * Resumes processing on the queue\n */\n resume(): void;\n\n /**\n * Peeks at the next message in the queue\n */\n peek(): T | undefined;\n\n /**\n * Returns all the items in the queue as an array. Does not remove them from the queue.\n */\n toArray(): T[];\n\n waitTillProcessingDone(): Promise<void>;\n}\n\nexport type ReadOnlyInfo = {\n readonly readonly: false | undefined;\n} | {\n readonly readonly: true;\n /** read-only because forceReadOnly() was called */\n readonly forced: boolean;\n /** read-only because client does not have write permissions for document */\n readonly permissions: boolean | undefined;\n /** read-only with no delta stream connection */\n readonly storageOnly: boolean;\n};\n"]}
1
+ {"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IEvent, IErrorEvent } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Contract representing the result of a newly established connection to the server for syncing deltas\n */\nexport interface IConnectionDetails {\n clientId: string;\n claims: ITokenClaims;\n existing: boolean;\n mode: ConnectionMode;\n version: string;\n initialClients: ISignalClient[];\n serviceConfiguration: IClientConfiguration;\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber: number | undefined;\n}\n\n/**\n * Interface used to define a strategy for handling incoming delta messages\n */\nexport interface IDeltaHandlerStrategy {\n /**\n * Processes the message.\n */\n process: (message: ISequencedDocumentMessage) => void;\n\n /**\n * Processes the signal.\n */\n processSignal: (message: ISignalMessage) => void;\n}\n\n/**\n * Contract supporting delivery of outbound messages to the server\n */\nexport interface IDeltaSender {\n /**\n * Flush all pending messages through the outbound queue\n */\n flush(): void;\n}\n\n/** Events emitted by the Delta Manager */\nexport interface IDeltaManagerEvents extends IEvent {\n (event: \"prepareSend\", listener: (messageBuffer: any[]) => void);\n (event: \"submitOp\", listener: (message: IDocumentMessage) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage, processingTime: number) => void);\n (event: \"allSentOpsAckd\", listener: () => void);\n (event: \"pong\" | \"processTime\", listener: (latency: number) => void);\n /**\n * The connect event fires once we've received the connect_document_success message from the\n * server. This happens prior to the client's join message (if there is a join message).\n */\n (event: \"connect\", listener: (details: IConnectionDetails, opsBehind?: number) => void);\n (event: \"disconnect\", listener: (reason: string) => void);\n (event: \"readonly\", listener: (readonly: boolean) => void);\n}\n\n/**\n * Manages the transmission of ops between the runtime and storage.\n */\nexport interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {\n /** The queue of inbound delta messages */\n readonly inbound: IDeltaQueue<T>;\n\n /** The queue of outbound delta messages */\n readonly outbound: IDeltaQueue<U[]>;\n\n /** The queue of inbound delta signals */\n readonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n /** The current minimum sequence number */\n readonly minimumSequenceNumber: number;\n\n /** The last sequence number processed by the delta manager */\n readonly lastSequenceNumber: number;\n\n /** The last message processed by the delta manager */\n readonly lastMessage: ISequencedDocumentMessage | undefined;\n\n /** The latest sequence number the delta manager is aware of */\n readonly lastKnownSeqNumber: number;\n\n /** The initial sequence number set when attaching the op handler */\n readonly initialSequenceNumber: number;\n\n /**\n * Tells if current connection has checkpoint information.\n * I.e. we know how far behind the client was at the time of establishing connection\n */\n readonly hasCheckpointSequenceNumber: boolean;\n\n /** Details of client */\n readonly clientDetails: IClientDetails;\n\n /** Protocol version being used to communicate with the service */\n readonly version: string;\n\n /** Max message size allowed to the delta manager */\n readonly maxMessageSize: number;\n\n /** Service configuration provided by the service. */\n readonly serviceConfiguration: IClientConfiguration | undefined;\n\n /** Flag to indicate whether the client can write or not. */\n readonly active: boolean;\n\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */\n submitSignal(content: any): void;\n}\n\n/** Events emitted by a Delta Queue */\nexport interface IDeltaQueueEvents<T> extends IErrorEvent {\n (event: \"push\" | \"op\", listener: (task: T) => void);\n /**\n * @param count - number of events (T) processed before becoming idle\n * @param duration - amount of time it took to process elements (milliseconds).\n */\n (event: \"idle\", listener: (count: number, duration: number) => void);\n}\n\n/**\n * Queue of ops to be sent to or processed from storage\n */\nexport interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {\n /**\n * Flag indicating whether or not the queue was paused\n */\n paused: boolean;\n\n /**\n * The number of messages remaining in the queue\n */\n length: number;\n\n /**\n * Flag indicating whether or not the queue is idle\n */\n idle: boolean;\n\n /**\n * Pauses processing on the queue\n * @returns A promise which resolves when processing has been paused.\n */\n pause(): Promise<void>;\n\n /**\n * Resumes processing on the queue\n */\n resume(): void;\n\n /**\n * Peeks at the next message in the queue\n */\n peek(): T | undefined;\n\n /**\n * Returns all the items in the queue as an array. Does not remove them from the queue.\n */\n toArray(): T[];\n\n /**\n * returns number of ops processed and time it took to process these ops.\n * Zeros if queue did not process anything (had no messages, was paused or had hit an error before)\n */\n waitTillProcessingDone(): Promise<{ count: number; duration: number; }>;\n}\n\nexport type ReadOnlyInfo = {\n readonly readonly: false | undefined;\n} | {\n readonly readonly: true;\n /** read-only because forceReadOnly() was called */\n readonly forced: boolean;\n /** read-only because client does not have write permissions for document */\n readonly permissions: boolean | undefined;\n /** read-only with no delta stream connection */\n readonly storageOnly: boolean;\n};\n"]}
package/lib/loader.d.ts CHANGED
@@ -12,17 +12,6 @@ import { ICriticalContainerError, ContainerWarning } from "./error";
12
12
  import { IFluidModule } from "./fluidModule";
13
13
  import { AttachState } from "./runtime";
14
14
  import { IFluidCodeDetails, IFluidPackage, IProvideFluidCodeDetailsComparer } from "./fluidPackage";
15
- /**
16
- * Code loading interface
17
- *
18
- * @deprecated in favor of {@link @fluidframework/container-loader#ICodeDetailsLoader}
19
- */
20
- export interface ICodeLoader extends Partial<IProvideFluidCodeDetailsComparer> {
21
- /**
22
- * Loads the package specified by code details and returns a promise to its entry point exports.
23
- */
24
- load(source: IFluidCodeDetails): Promise<IFluidModule>;
25
- }
26
15
  /**
27
16
  * Encapsulates a module entry point with corresponding code details.
28
17
  */
@@ -121,11 +110,6 @@ export declare namespace ConnectionState {
121
110
  * The container has an inbound connection only, and is catching up to the latest known state from the service.
122
111
  */
123
112
  type CatchingUp = 1;
124
- /**
125
- * See ConnectionState.CatchingUp, which is the new name for this state.
126
- * @deprecated - This state itself is not gone, just being renamed. Please use ConnectionState.CatchingUp.
127
- */
128
- type Connecting = 1;
129
113
  /**
130
114
  * The container is fully connected and syncing
131
115
  */
@@ -134,7 +118,7 @@ export declare namespace ConnectionState {
134
118
  /**
135
119
  * Type defining the different states of connectivity a container can be in
136
120
  */
137
- export declare type ConnectionState = ConnectionState.Disconnected | ConnectionState.EstablishingConnection | ConnectionState.CatchingUp | ConnectionState.Connecting | ConnectionState.Connected;
121
+ export declare type ConnectionState = ConnectionState.Disconnected | ConnectionState.EstablishingConnection | ConnectionState.CatchingUp | ConnectionState.Connected;
138
122
  /**
139
123
  * The Host's view of the Container and its connection to storage
140
124
  */
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,QAAQ,EACR,SAAS,EACT,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACH,iBAAiB,EACjB,aAAa,EACb,gCAAgC,EACnC,MAAM,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,gCAAgC,CAAC;IAC1E;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC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AAC;IAC7C,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC5C,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACtC,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAClC,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9C;AAED,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB,EAAE,OAAO,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,aAAa;IAChE,aAAa,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC;KAAE,CAAC;IACpD,KAAK,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,6BAA6B,CAAC;KAAE,CAAC;CAC7D"}
package/lib/loader.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwXH;;GAEG;AACH,MAAM,CAAN,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACpB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACvB,CAAC,EAtBW,YAAY,KAAZ,YAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IRequest,\n IResponse,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IClientDetails,\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISequencedProposal,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport {\n IFluidCodeDetails,\n IFluidPackage,\n IProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n/**\n * Code loading interface\n *\n * @deprecated in favor of {@link @fluidframework/container-loader#ICodeDetailsLoader}\n */\nexport interface ICodeLoader extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Loads the package specified by code details and returns a promise to its entry point exports.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModule>;\n}\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n /** Fluid code module that implements the runtime factory needed to instantiate the container runtime. */\n module: IFluidModule;\n /**\n * Code details associated with the module. Represents a document schema this module supports.\n * If the code loader implements the {@link @fluidframework/core-interfaces#IFluidCodeDetailsComparer} interface,\n * it'll be called to determine whether the module code details satisfy the new code proposal in the quorum.\n */\n details: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader\n extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Load the code module (package) that is capable to interact with the document.\n *\n * @param source - Code proposal that articulates the current schema the document is written in.\n * @returns - Code module entry point along with the code details associated with it.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n* The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n /**\n * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n */\n readonly resolvedPackage: Readonly<IFluidPackage>;\n /**\n * If not undefined, this id will be used to cache the entry point for the code package\n */\n readonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n /**\n * Resolves a Fluid code details into a form that can be loaded\n * @param details - The Fluid code details to resolve\n * @returns - A IResolvedFluidCodeDetails where the\n * resolvedPackage's Fluid file entries are absolute urls, and\n * an optional resolvedPackageCacheId if the loaded package should be\n * cached.\n */\n resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n */\nexport interface ICodeAllowList {\n testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the Container \"upwards\" to the Loader and Host\n */\nexport interface IContainerEvents extends IEvent {\n (event: \"readonly\", listener: (readonly: boolean) => void): void;\n (event: \"connected\", listener: (clientId: string) => void);\n (event: \"codeDetailsProposed\", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void);\n (event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n (event: \"disconnected\" | \"attached\", listener: () => void);\n (event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n (event: \"warning\", listener: (error: ContainerWarning) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n (event: \"dirty\" | \"saved\", listener: (dirty: boolean) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression\n */\nexport namespace ConnectionState {\n /**\n * The container is not connected to the delta server\n * Note - When in this state the container may be about to reconnect,\n * or may remain disconnected until explicitly told to connect.\n */\n export type Disconnected = 0;\n\n /**\n * The container is disconnected but actively trying to establish a new connection\n * PLEASE NOTE that this numerical value falls out of the order you may expect for this state\n */\n export type EstablishingConnection = 3;\n\n /**\n * The container has an inbound connection only, and is catching up to the latest known state from the service.\n */\n export type CatchingUp = 1;\n\n /**\n * See ConnectionState.CatchingUp, which is the new name for this state.\n * @deprecated - This state itself is not gone, just being renamed. Please use ConnectionState.CatchingUp.\n */\n export type Connecting = 1;\n\n /**\n * The container is fully connected and syncing\n */\n export type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a container can be in\n */\nexport type ConnectionState =\n | ConnectionState.Disconnected\n | ConnectionState.EstablishingConnection\n | ConnectionState.CatchingUp\n | ConnectionState.Connecting\n | ConnectionState.Connected;\n\n/**\n * The Host's view of the Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\n /**\n * The Delta Manager supporting the op stream for this Container\n */\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n /**\n * The collection of write clients which were connected as of the current sequence number.\n * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Represents the resolved url to the Container\n * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n */\n resolvedUrl: IResolvedUrl | undefined;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Get the code details that are currently specified for the container.\n * @returns The current code details if any are specified, undefined if none are specified.\n */\n getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Get the code details that were used to load the container.\n * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n * loaded.\n */\n getLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Returns true if the container has been closed, otherwise false\n */\n readonly closed: boolean;\n\n /**\n * Returns true if the container is dirty, i.e. there are user changes that has not been saved\n * Closing container in this state results in data loss for user.\n * Container usually gets into this situation due to loss of connectivity.\n */\n readonly isDirty: boolean;\n\n /**\n * Closes the container\n */\n close(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container and returns serialized local state intended to be\n * given to a newly loaded container\n */\n closeAndGetPendingLocalState(): string;\n\n /**\n * Propose new code details that define the code to be loaded\n * for this container's runtime. The returned promise will\n * be true when the proposal is accepted, and false if\n * the proposal is rejected.\n */\n proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n /**\n * Attaches the Container to the Container specified by the given Request.\n *\n * TODO - in the case of failure options should give a retry policy. Or some continuation function\n * that allows attachment to a secondary document.\n */\n attach(request: IRequest): Promise<void>;\n\n /**\n * Extract the snapshot from the detached container.\n */\n serialize(): string;\n\n /**\n * Get an absolute url for a provided container-relative request url.\n * If the container is not attached, this will return undefined.\n *\n * @param relativeUrl - A container-relative request URL\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Issue a request against the container for a resource.\n * @param request - The request to be issued against the container\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Provides the current state of the container's connection to the ordering service\n */\n readonly connectionState: ConnectionState;\n\n /**\n * Attempts to connect the container to the delta stream and process ops\n */\n connect(): void;\n\n /**\n * Disconnects the container from the delta stream and stops processing ops\n */\n disconnect(): void;\n\n /**\n * The audience information for all clients currently associated with the document in the current session\n */\n readonly audience: IAudience;\n\n /**\n * The server provided ID of the client.\n * Set once this.connectionState === ConnectionState.Connected is true, otherwise undefined\n * @alpha\n */\n readonly clientId?: string | undefined;\n\n /**\n * Tells if container is in read-only mode.\n * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n * Readonly state can be because of no storage write permission,\n * or due to host forcing readonly mode for container.\n *\n * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n *\n * It is undefined if we have not yet established websocket connection\n * and do not know if user has write access to a file.\n */\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /**\n * Allows the host to have the container force to be in read-only mode\n * @param readonly - Boolean that toggles if read-only policies will be enforced\n * @alpha\n */\n forceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n /**\n * Resolves the resource specified by the URL + headers contained in the request object\n * to the underlying container that will resolve the request.\n *\n * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n * a request against the server found from the resolve step.\n */\n resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n /**\n * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n /**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n [key in string | number]: any;\n} & {\n /**\n * Set caching behavior for the loader. If true, we will load a container from cache if one\n * with the same id/version exists or create a new container and cache it if it does not. If\n * false, always load a new container and don't cache it. If the container has already been\n * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n * request will override the Loader's value.\n * Defaults to true.\n */\n cache?: boolean;\n\n /**\n * Provide the current Loader through the scope object when creating Containers. It is added\n * as the `ILoader` property, and will overwrite an existing property of the same name on the\n * scope. Useful for when the host wants to provide the current Loader's functionality to\n * individual Data Stores, which is typically expected when creating with a Loader.\n * Defaults to true.\n */\n provideScopeLoader?: boolean;\n\n /**\n * Max time(in ms) container will wait for a leave message of a disconnected client.\n */\n maxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n /**\n * Override the Loader's default caching behavior for this container.\n */\n cache = \"fluid-cache\",\n\n clientDetails = \"fluid-client-details\",\n\n /**\n * Start the container in a paused, unconnected state. Defaults to false\n */\n loadMode = \"loadMode\",\n reconnect = \"fluid-reconnect\",\n sequenceNumber = \"fluid-sequence-number\",\n\n /**\n * One of the following:\n * null or \"null\": use ops, no snapshots\n * undefined: fetch latest snapshot\n * otherwise, version sha to load snapshot\n */\n version = \"version\",\n}\n\nexport interface IContainerLoadMode {\n opsBeforeReturn?:\n /*\n * No trailing ops are applied before container is returned.\n * Default value.\n */\n | undefined\n /*\n * Only cached trailing ops are applied before returning container.\n * Caching is optional and could be implemented by the driver.\n * If driver does not implement any kind of local caching strategy, this is same as above.\n * Driver may cache a lot of ops, so care needs to be exercised (see below).\n */\n | \"cached\"\n /*\n * All trailing ops in storage are fetched and applied before container is returned\n * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n * recommended to have some progress UX / cancellation built into loading flow when using this option.\n */\n | \"all\";\n deltaConnection?:\n /*\n * Connection to delta stream is made only when Container.connect() call is made. Op processing\n * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n */\n | \"none\"\n /*\n * Connection to delta stream is made only when Container.connect() call is made.\n * Op fetching from storage is performed and ops are applied as they come in.\n * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n */\n | \"delayed\"\n /*\n * Connection to delta stream is made right away.\n * Ops processing is enabled and ops are flowing through the system.\n * Default value.\n */\n | undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n [LoaderHeader.cache]: boolean;\n [LoaderHeader.clientDetails]: IClientDetails;\n [LoaderHeader.loadMode]: IContainerLoadMode;\n [LoaderHeader.sequenceNumber]: number;\n [LoaderHeader.reconnect]: boolean;\n [LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n readonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See https://github.com/microsoft/FluidFramework/issues/9711 for context\n */\nexport interface IPendingLocalState {\n url: string;\n pendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: blobContents. This is used as the ContainerContext's base snapshot\n * when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n blobsContents: { [path: string]: ArrayBufferLike; };\n trees: { [path: string]: ISnapshotTreeWithBlobContents; };\n}\n"]}
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqWH;;GAEG;AACH,MAAM,CAAN,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACpB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACvB,CAAC,EAtBW,YAAY,KAAZ,YAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IRequest,\n IResponse,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IClientDetails,\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISequencedProposal,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport {\n IFluidCodeDetails,\n IFluidPackage,\n IProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n /** Fluid code module that implements the runtime factory needed to instantiate the container runtime. */\n module: IFluidModule;\n /**\n * Code details associated with the module. Represents a document schema this module supports.\n * If the code loader implements the {@link @fluidframework/core-interfaces#IFluidCodeDetailsComparer} interface,\n * it'll be called to determine whether the module code details satisfy the new code proposal in the quorum.\n */\n details: IFluidCodeDetails;\n}\n\n/**\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader\n extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Load the code module (package) that is capable to interact with the document.\n *\n * @param source - Code proposal that articulates the current schema the document is written in.\n * @returns - Code module entry point along with the code details associated with it.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n* The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n /**\n * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n */\n readonly resolvedPackage: Readonly<IFluidPackage>;\n /**\n * If not undefined, this id will be used to cache the entry point for the code package\n */\n readonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n /**\n * Resolves a Fluid code details into a form that can be loaded\n * @param details - The Fluid code details to resolve\n * @returns - A IResolvedFluidCodeDetails where the\n * resolvedPackage's Fluid file entries are absolute urls, and\n * an optional resolvedPackageCacheId if the loaded package should be\n * cached.\n */\n resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n */\nexport interface ICodeAllowList {\n testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the Container \"upwards\" to the Loader and Host\n */\nexport interface IContainerEvents extends IEvent {\n (event: \"readonly\", listener: (readonly: boolean) => void): void;\n (event: \"connected\", listener: (clientId: string) => void);\n (event: \"codeDetailsProposed\", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void);\n (event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n (event: \"disconnected\" | \"attached\", listener: () => void);\n (event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n (event: \"warning\", listener: (error: ContainerWarning) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n (event: \"dirty\" | \"saved\", listener: (dirty: boolean) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression\n */\nexport namespace ConnectionState {\n /**\n * The container is not connected to the delta server\n * Note - When in this state the container may be about to reconnect,\n * or may remain disconnected until explicitly told to connect.\n */\n export type Disconnected = 0;\n\n /**\n * The container is disconnected but actively trying to establish a new connection\n * PLEASE NOTE that this numerical value falls out of the order you may expect for this state\n */\n export type EstablishingConnection = 3;\n\n /**\n * The container has an inbound connection only, and is catching up to the latest known state from the service.\n */\n export type CatchingUp = 1;\n\n /**\n * The container is fully connected and syncing\n */\n export type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a container can be in\n */\nexport type ConnectionState =\n | ConnectionState.Disconnected\n | ConnectionState.EstablishingConnection\n | ConnectionState.CatchingUp\n | ConnectionState.Connected;\n\n/**\n * The Host's view of the Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\n /**\n * The Delta Manager supporting the op stream for this Container\n */\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n /**\n * The collection of write clients which were connected as of the current sequence number.\n * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Represents the resolved url to the Container\n * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n */\n resolvedUrl: IResolvedUrl | undefined;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Get the code details that are currently specified for the container.\n * @returns The current code details if any are specified, undefined if none are specified.\n */\n getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Get the code details that were used to load the container.\n * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n * loaded.\n */\n getLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Returns true if the container has been closed, otherwise false\n */\n readonly closed: boolean;\n\n /**\n * Returns true if the container is dirty, i.e. there are user changes that has not been saved\n * Closing container in this state results in data loss for user.\n * Container usually gets into this situation due to loss of connectivity.\n */\n readonly isDirty: boolean;\n\n /**\n * Closes the container\n */\n close(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container and returns serialized local state intended to be\n * given to a newly loaded container\n */\n closeAndGetPendingLocalState(): string;\n\n /**\n * Propose new code details that define the code to be loaded\n * for this container's runtime. The returned promise will\n * be true when the proposal is accepted, and false if\n * the proposal is rejected.\n */\n proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n /**\n * Attaches the Container to the Container specified by the given Request.\n *\n * TODO - in the case of failure options should give a retry policy. Or some continuation function\n * that allows attachment to a secondary document.\n */\n attach(request: IRequest): Promise<void>;\n\n /**\n * Extract the snapshot from the detached container.\n */\n serialize(): string;\n\n /**\n * Get an absolute url for a provided container-relative request url.\n * If the container is not attached, this will return undefined.\n *\n * @param relativeUrl - A container-relative request URL\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Issue a request against the container for a resource.\n * @param request - The request to be issued against the container\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Provides the current state of the container's connection to the ordering service\n */\n readonly connectionState: ConnectionState;\n\n /**\n * Attempts to connect the container to the delta stream and process ops\n */\n connect(): void;\n\n /**\n * Disconnects the container from the delta stream and stops processing ops\n */\n disconnect(): void;\n\n /**\n * The audience information for all clients currently associated with the document in the current session\n */\n readonly audience: IAudience;\n\n /**\n * The server provided ID of the client.\n * Set once this.connectionState === ConnectionState.Connected is true, otherwise undefined\n * @alpha\n */\n readonly clientId?: string | undefined;\n\n /**\n * Tells if container is in read-only mode.\n * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n * Readonly state can be because of no storage write permission,\n * or due to host forcing readonly mode for container.\n *\n * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n *\n * It is undefined if we have not yet established websocket connection\n * and do not know if user has write access to a file.\n */\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /**\n * Allows the host to have the container force to be in read-only mode\n * @param readonly - Boolean that toggles if read-only policies will be enforced\n * @alpha\n */\n forceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n /**\n * Resolves the resource specified by the URL + headers contained in the request object\n * to the underlying container that will resolve the request.\n *\n * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n * a request against the server found from the resolve step.\n */\n resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n /**\n * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n /**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n */\n rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n [key in string | number]: any;\n} & {\n /**\n * Set caching behavior for the loader. If true, we will load a container from cache if one\n * with the same id/version exists or create a new container and cache it if it does not. If\n * false, always load a new container and don't cache it. If the container has already been\n * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n * request will override the Loader's value.\n * Defaults to true.\n */\n cache?: boolean;\n\n /**\n * Provide the current Loader through the scope object when creating Containers. It is added\n * as the `ILoader` property, and will overwrite an existing property of the same name on the\n * scope. Useful for when the host wants to provide the current Loader's functionality to\n * individual Data Stores, which is typically expected when creating with a Loader.\n * Defaults to true.\n */\n provideScopeLoader?: boolean;\n\n /**\n * Max time(in ms) container will wait for a leave message of a disconnected client.\n */\n maxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n /**\n * Override the Loader's default caching behavior for this container.\n */\n cache = \"fluid-cache\",\n\n clientDetails = \"fluid-client-details\",\n\n /**\n * Start the container in a paused, unconnected state. Defaults to false\n */\n loadMode = \"loadMode\",\n reconnect = \"fluid-reconnect\",\n sequenceNumber = \"fluid-sequence-number\",\n\n /**\n * One of the following:\n * null or \"null\": use ops, no snapshots\n * undefined: fetch latest snapshot\n * otherwise, version sha to load snapshot\n */\n version = \"version\",\n}\n\nexport interface IContainerLoadMode {\n opsBeforeReturn?:\n /*\n * No trailing ops are applied before container is returned.\n * Default value.\n */\n | undefined\n /*\n * Only cached trailing ops are applied before returning container.\n * Caching is optional and could be implemented by the driver.\n * If driver does not implement any kind of local caching strategy, this is same as above.\n * Driver may cache a lot of ops, so care needs to be exercised (see below).\n */\n | \"cached\"\n /*\n * All trailing ops in storage are fetched and applied before container is returned\n * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n * recommended to have some progress UX / cancellation built into loading flow when using this option.\n */\n | \"all\";\n deltaConnection?:\n /*\n * Connection to delta stream is made only when Container.connect() call is made. Op processing\n * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n */\n | \"none\"\n /*\n * Connection to delta stream is made only when Container.connect() call is made.\n * Op fetching from storage is performed and ops are applied as they come in.\n * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n */\n | \"delayed\"\n /*\n * Connection to delta stream is made right away.\n * Ops processing is enabled and ops are flowing through the system.\n * Default value.\n */\n | undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n [LoaderHeader.cache]: boolean;\n [LoaderHeader.clientDetails]: IClientDetails;\n [LoaderHeader.loadMode]: IContainerLoadMode;\n [LoaderHeader.sequenceNumber]: number;\n [LoaderHeader.reconnect]: boolean;\n [LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n readonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See https://github.com/microsoft/FluidFramework/issues/9711 for context\n */\nexport interface IPendingLocalState {\n url: string;\n pendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: blobContents. This is used as the ContainerContext's base snapshot\n * when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n blobsContents: { [path: string]: ArrayBufferLike; };\n trees: { [path: string]: ISnapshotTreeWithBlobContents; };\n}\n"]}
package/lib/runtime.d.ts CHANGED
@@ -31,11 +31,6 @@ export declare enum AttachState {
31
31
  */
32
32
  Attached = "Attached"
33
33
  }
34
- export declare enum BindState {
35
- NotBound = "NotBound",
36
- Binding = "Binding",
37
- Bound = "Bound"
38
- }
39
34
  /**
40
35
  * The IRuntime represents an instantiation of a code package within a Container.
41
36
  * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EACH,WAAW,EACX,QAAQ,EACR,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACz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AG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAElE;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAElC,oBAAoB,IAAI,QAAQ,GAAG,SAAS,CAAC;IAE7C,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAChD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,sBAA0C,CAAC;AAE/E,MAAM,WAAW,sBAAsB;IACnC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC7C;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC3D;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACzF"}
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;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;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/**\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-definitions",
3
- "version": "1.2.1",
3
+ "version": "2.0.0-internal.1.0.0",
4
4
  "description": "Fluid container definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -40,14 +40,14 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@fluidframework/common-definitions": "^0.20.1",
43
- "@fluidframework/core-interfaces": "^1.2.1",
44
- "@fluidframework/driver-definitions": "^1.2.1",
45
- "@fluidframework/protocol-definitions": "^0.1028.2000"
43
+ "@fluidframework/core-interfaces": "^2.0.0-internal.1.0.0",
44
+ "@fluidframework/driver-definitions": "^2.0.0-internal.1.0.0",
45
+ "@fluidframework/protocol-definitions": "^1.0.0"
46
46
  },
47
47
  "devDependencies": {
48
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.0",
49
+ "@fluidframework/build-tools": "^0.3.1000",
50
+ "@fluidframework/container-definitions-previous": "npm:@fluidframework/container-definitions@^1.1.0",
51
51
  "@fluidframework/eslint-config-fluid": "^0.28.2000",
52
52
  "@microsoft/api-extractor": "^7.22.2",
53
53
  "@rushstack/eslint-config": "^2.5.1",
@@ -60,7 +60,27 @@
60
60
  "typescript-formatter": "7.1.0"
61
61
  },
62
62
  "typeValidation": {
63
- "version": "1.2.1",
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
+ }
65
85
  }
66
86
  }
package/src/audience.ts CHANGED
@@ -6,6 +6,27 @@
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);
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
+ /**
25
+ * Clears the audience
26
+ */
27
+ clear();
28
+ }
29
+
9
30
  /**
10
31
  * Audience represents all clients connected to the op stream, both read-only and read/write.
11
32
  *
package/src/deltas.ts CHANGED
@@ -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 = {
package/src/loader.ts CHANGED
@@ -29,18 +29,6 @@ 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
  */
@@ -149,12 +137,6 @@ export namespace ConnectionState {
149
137
  */
150
138
  export type CatchingUp = 1;
151
139
 
152
- /**
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
140
  /**
159
141
  * The container is fully connected and syncing
160
142
  */
@@ -168,7 +150,6 @@ export type ConnectionState =
168
150
  | ConnectionState.Disconnected
169
151
  | ConnectionState.EstablishingConnection
170
152
  | ConnectionState.CatchingUp
171
- | ConnectionState.Connecting
172
153
  | ConnectionState.Connected;
173
154
 
174
155
  /**
package/src/runtime.ts CHANGED
@@ -50,13 +50,6 @@ export enum AttachState {
50
50
  Attached = "Attached",
51
51
  }
52
52
 
53
- // Represents the bind state of the entity.
54
- export enum BindState {
55
- NotBound = "NotBound",
56
- Binding = "Binding",
57
- Bound = "Bound",
58
- }
59
-
60
53
  /**
61
54
  * The IRuntime represents an instantiation of a code package within a Container.
62
55
  * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
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.