@fluidframework/container-definitions 2.5.0-302463 → 2.5.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/container-definitions
2
2
 
3
+ ## 2.5.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.4.0
4
8
 
5
9
  Dependency updates only.
@@ -31,7 +31,10 @@ export interface IAudience extends IEventProvider<IAudienceEvents> {
31
31
 
32
32
  // @public
33
33
  export interface IAudienceEvents extends IEvent {
34
- (event: "addMember" | "removeMember", listener: (clientId: string, client: IClient) => void): void;
34
+ // @eventProperty
35
+ (event: "addMember", listener: (clientId: string, client: IClient) => void): void;
36
+ // @eventProperty
37
+ (event: "removeMember", listener: (clientId: string, client: IClient) => void): void;
35
38
  (event: "selfChanged", listener: (oldValue: ISelf | undefined, newValue: ISelf) => void): void;
36
39
  }
37
40
 
@@ -49,7 +49,10 @@ export interface IAudience extends IEventProvider<IAudienceEvents> {
49
49
 
50
50
  // @public
51
51
  export interface IAudienceEvents extends IEvent {
52
- (event: "addMember" | "removeMember", listener: (clientId: string, client: IClient) => void): void;
52
+ // @eventProperty
53
+ (event: "addMember", listener: (clientId: string, client: IClient) => void): void;
54
+ // @eventProperty
55
+ (event: "removeMember", listener: (clientId: string, client: IClient) => void): void;
53
56
  (event: "selfChanged", listener: (oldValue: ISelf | undefined, newValue: ISelf) => void): void;
54
57
  }
55
58
 
@@ -31,7 +31,10 @@ export interface IAudience extends IEventProvider<IAudienceEvents> {
31
31
 
32
32
  // @public
33
33
  export interface IAudienceEvents extends IEvent {
34
- (event: "addMember" | "removeMember", listener: (clientId: string, client: IClient) => void): void;
34
+ // @eventProperty
35
+ (event: "addMember", listener: (clientId: string, client: IClient) => void): void;
36
+ // @eventProperty
37
+ (event: "removeMember", listener: (clientId: string, client: IClient) => void): void;
35
38
  (event: "selfChanged", listener: (oldValue: ISelf | undefined, newValue: ISelf) => void): void;
36
39
  }
37
40
 
@@ -31,7 +31,10 @@ export interface IAudience extends IEventProvider<IAudienceEvents> {
31
31
 
32
32
  // @public
33
33
  export interface IAudienceEvents extends IEvent {
34
- (event: "addMember" | "removeMember", listener: (clientId: string, client: IClient) => void): void;
34
+ // @eventProperty
35
+ (event: "addMember", listener: (clientId: string, client: IClient) => void): void;
36
+ // @eventProperty
37
+ (event: "removeMember", listener: (clientId: string, client: IClient) => void): void;
35
38
  (event: "selfChanged", listener: (oldValue: ISelf | undefined, newValue: ISelf) => void): void;
36
39
  }
37
40
 
@@ -31,10 +31,23 @@ export interface IAudienceOwner extends IAudience {
31
31
  */
32
32
  export interface IAudienceEvents extends IEvent {
33
33
  /**
34
- * "addMember" event is raised when a new user joins collaborative session.
35
- * "removeMember" event is raised when a user leaves collaborative session.
34
+ * Raised when a new user joins collaborative session.
35
+ *
36
+ * @param clientId - clientId of the new user that joined.
37
+ * @param client - Information about the new user that joined (including user identity, connection properties).
38
+ *
39
+ * @eventProperty
40
+ */
41
+ (event: "addMember", listener: (clientId: string, client: IClient) => void): void;
42
+ /**
43
+ * Raised when a user leaves collaborative session.
44
+ *
45
+ * @param clientId - clientId of the user that left.
46
+ * @param client - Information about the user that left (including user identity, connection properties).
47
+ *
48
+ * @eventProperty
36
49
  */
37
- (event: "addMember" | "removeMember", listener: (clientId: string, client: IClient) => void): void;
50
+ (event: "removeMember", listener: (clientId: string, client: IClient) => void): void;
38
51
  /**
39
52
  * Notifies that client established new connection and caught-up on ops.
40
53
  * @param oldValue - represents old connection. Please note that oldValue.client in almost all cases will be undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAClE;;;;GAI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AAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,OAAO,IAAI,KAAK,GAAG,SAAS,CAAC;CAC7B"}
@@ -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 type { IEvent, IEventProvider } from \"@fluidframework/core-interfaces\";\nimport type { IClient } from \"@fluidframework/driver-definitions\";\n/**\n * Manages the state and the members for {@link IAudience}\n * @legacy\n * @alpha\n */\nexport interface IAudienceOwner extends IAudience {\n\t/**\n\t * Adds a new client to the audience\n\t */\n\taddMember(clientId: string, details: IClient): void;\n\n\t/**\n\t * Removes a client from the audience. Only emits an event if a client is actually removed\n\t * @returns if a client was removed from the audience\n\t */\n\tremoveMember(clientId: string): boolean;\n\n\t/**\n\t * Notifies Audience that current clientId has changed.\n\t * See {@link IAudience.getSelf} and {@link IAudienceEvents}'s \"selfChanged\" event for more details.\n\t */\n\tsetCurrentClientId(clientId: string): void;\n}\n\n/**\n * Interface describing Audience events\n * @public\n */\nexport interface IAudienceEvents extends IEvent {\n\t/**\n\t * \"addMember\" event is raised when a new user joins collaborative session.\n\t * \"removeMember\" event is raised when a user leaves collaborative session.\n\t */\n\t(\n\t\tevent: \"addMember\" | \"removeMember\",\n\t\tlistener: (clientId: string, client: IClient) => void,\n\t): void;\n\t/**\n\t * Notifies that client established new connection and caught-up on ops.\n\t * @param oldValue - represents old connection. Please note that oldValue.client in almost all cases will be undefined,\n\t * due to specifics how Audience refreshes on reconnect. In the future we could improve it and always provide client information.\n\t * @param newValue - represents newly established connection. While {@link IAudience.getSelf} is experimental, it's not guaranteed that\n\t * newValue.client is present. Same is true if you are consuming audience from container runtime layer and running against old version of loader.\n\t */\n\t(\n\t\tevent: \"selfChanged\",\n\t\tlistener: (oldValue: ISelf | undefined, newValue: ISelf) => void,\n\t): void;\n}\n\n/**\n * Return type of {@link IAudience.getSelf}. Please see remarks for {@link IAudience.getSelf} to learn more details on promises.\n * @public\n */\nexport interface ISelf {\n\t/**\n\t * clientId of current or previous connection (if client is in disconnected or reconnecting / catching up state)\n\t * It changes only when client has reconnected, caught up with latest ops.\n\t */\n\treadonly clientId: string;\n\n\t/**\n\t * Information about current client (including user identity, connection properties), supplied by ordering service when\n\t * client connected to it and received {@link ISelf.clientId}.\n\t * If present (not undefined), it's same value as calling IAudience.getMember(clientId).\n\t * This property could be undefined even if there is non-undefined clientId.\n\t * This could happen in the following cases:\n\t * 1) Container was loaded from stash, by providing IPendingContainerState state to Container.load().\n\t * 2) Container is in the process of establishing new connection. Information about old connection is already reset\n\t * (old clientId is no longer in list of members), but clientId has not yet changed to a new value.\n\t */\n\treadonly client?: IClient;\n}\n\n/**\n * Represents all clients connected to the op stream, both read-only and read/write.\n *\n * @remarks Access to the Audience when a container is disconnected is a tricky subject.\n * See the remarks on specific methods for more details.\n *\n * @public\n */\nexport interface IAudience extends IEventProvider<IAudienceEvents> {\n\t/**\n\t * List all clients connected to the op stream, keyed off their clientId.\n\t *\n\t * @remarks When the container is disconnected, there are no guarantees about the correctness of what this method returns.\n\t * The default implementation in Fluid Framework continues to return the list of members as it last saw it before the\n\t * container disconnected, but this could change in the future. Other implementations could decide to return an empty\n\t * list, or a list that only includes the local client.\n\t *\n\t * Note that the clientId that a disconnected container might see for itself is an old one. A disconnected container\n\t * does not technically have a clientId tied to an active connection to the service.\n\t */\n\tgetMembers(): Map<string, IClient>;\n\n\t/**\n\t * Get details about the connected client with the specified clientId, or undefined if the specified client isn't connected.\n\t *\n\t * @remarks When the container is disconnected, there are no guarantees about the correctness of what this method returns.\n\t * The default implementation in Fluid Framework continues to return members that were part of the audience when the\n\t * container disconnected, but this could change in the future. Other implementations could decide to always return\n\t * undefined, or only return an IClient when the local client is requested.\n\t *\n\t * Note that the clientId that a disconnected container might see for itself is an old one. A disconnected container\n\t * does not technically have a clientId tied to an active connection to the service.\n\t */\n\tgetMember(clientId: string): IClient | undefined;\n\n\t/**\n\t * Returns information about client's connection. Please see {@link ISelf} member descriptions for more details.\n\t * undefined if this client has never connected to the ordering service.\n\t * Please see {@link ISelf.clientId} for more details on when values returned by this function change over time.\n\t *\n\t * @experimental\n\t *\n\t * @remarks\n\t * This API is experimental.\n\t *\n\t * Reconnection process will have these phases:\n\t * 1. Establishing connection phase:\n\t * - new connection clientId is added to member's list. That said, self.clientId still reflects old information.\n\t * - The old client's information is removed from members' list. getMember(self.clientId) will return undefined.\n\t * 2. Catch-up phase. Client catches up on latest ops and becomes current.\n\t * 3. \"connect\" phase - the following happens synchronously:\n\t * - getSelf() information changes to reflect new connection\n\t * - \"selfChanged\" event on this object fires\n\t * - Various API surfaces may expose \"connected\" event. This event fires at the same time as self changes. That said, \"connected\" event will not fire at IContainerRuntime layer if container is read-only.\n\t *\n\t * That said, at the moment this is an experimental API. It depends on some experimental settings that might change in the future.\n\t * Events described in phase #3 may not happen at the same time if kill-bit feature gates are engaged due to a bug discovered in new logic\n\t * that delivers this functionality. Once it's proven (at scale) that everything works well, experimental tag will be removed.\n\t * Also application that deploy loader & container runtime bundles independently will see new (synchronized) behavior only when loader changes are deployed.\n\t * Newer runtimes will continue to observe old (non-synchronized) behavior when paired with older loader code.\n\t *\n\t * When promises in phase #3 are broken (due to conditions described above), consumers could experience current clientId being changed\n\t * (and \"selfChanged\" event fired) while\n\t * 1. Such clientId is not present in Audience\n\t * 2. Client is not fully caught up\n\t */\n\tgetSelf(): ISelf | 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 type { IEvent, IEventProvider } from \"@fluidframework/core-interfaces\";\nimport type { IClient } from \"@fluidframework/driver-definitions\";\n/**\n * Manages the state and the members for {@link IAudience}\n * @legacy\n * @alpha\n */\nexport interface IAudienceOwner extends IAudience {\n\t/**\n\t * Adds a new client to the audience\n\t */\n\taddMember(clientId: string, details: IClient): void;\n\n\t/**\n\t * Removes a client from the audience. Only emits an event if a client is actually removed\n\t * @returns if a client was removed from the audience\n\t */\n\tremoveMember(clientId: string): boolean;\n\n\t/**\n\t * Notifies Audience that current clientId has changed.\n\t * See {@link IAudience.getSelf} and {@link IAudienceEvents}'s \"selfChanged\" event for more details.\n\t */\n\tsetCurrentClientId(clientId: string): void;\n}\n\n/**\n * Interface describing Audience events\n * @public\n */\nexport interface IAudienceEvents extends IEvent {\n\t/**\n\t * Raised when a new user joins collaborative session.\n\t *\n\t * @param clientId - clientId of the new user that joined.\n\t * @param client - Information about the new user that joined (including user identity, connection properties).\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"addMember\", listener: (clientId: string, client: IClient) => void): void;\n\n\t/**\n\t * Raised when a user leaves collaborative session.\n\t *\n\t * @param clientId - clientId of the user that left.\n\t * @param client - Information about the user that left (including user identity, connection properties).\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"removeMember\", listener: (clientId: string, client: IClient) => void): void;\n\t/**\n\t * Notifies that client established new connection and caught-up on ops.\n\t * @param oldValue - represents old connection. Please note that oldValue.client in almost all cases will be undefined,\n\t * due to specifics how Audience refreshes on reconnect. In the future we could improve it and always provide client information.\n\t * @param newValue - represents newly established connection. While {@link IAudience.getSelf} is experimental, it's not guaranteed that\n\t * newValue.client is present. Same is true if you are consuming audience from container runtime layer and running against old version of loader.\n\t */\n\t(\n\t\tevent: \"selfChanged\",\n\t\tlistener: (oldValue: ISelf | undefined, newValue: ISelf) => void,\n\t): void;\n}\n\n/**\n * Return type of {@link IAudience.getSelf}. Please see remarks for {@link IAudience.getSelf} to learn more details on promises.\n * @public\n */\nexport interface ISelf {\n\t/**\n\t * clientId of current or previous connection (if client is in disconnected or reconnecting / catching up state)\n\t * It changes only when client has reconnected, caught up with latest ops.\n\t */\n\treadonly clientId: string;\n\n\t/**\n\t * Information about current client (including user identity, connection properties), supplied by ordering service when\n\t * client connected to it and received {@link ISelf.clientId}.\n\t * If present (not undefined), it's same value as calling IAudience.getMember(clientId).\n\t * This property could be undefined even if there is non-undefined clientId.\n\t * This could happen in the following cases:\n\t * 1) Container was loaded from stash, by providing IPendingContainerState state to Container.load().\n\t * 2) Container is in the process of establishing new connection. Information about old connection is already reset\n\t * (old clientId is no longer in list of members), but clientId has not yet changed to a new value.\n\t */\n\treadonly client?: IClient;\n}\n\n/**\n * Represents all clients connected to the op stream, both read-only and read/write.\n *\n * @remarks Access to the Audience when a container is disconnected is a tricky subject.\n * See the remarks on specific methods for more details.\n *\n * @public\n */\nexport interface IAudience extends IEventProvider<IAudienceEvents> {\n\t/**\n\t * List all clients connected to the op stream, keyed off their clientId.\n\t *\n\t * @remarks When the container is disconnected, there are no guarantees about the correctness of what this method returns.\n\t * The default implementation in Fluid Framework continues to return the list of members as it last saw it before the\n\t * container disconnected, but this could change in the future. Other implementations could decide to return an empty\n\t * list, or a list that only includes the local client.\n\t *\n\t * Note that the clientId that a disconnected container might see for itself is an old one. A disconnected container\n\t * does not technically have a clientId tied to an active connection to the service.\n\t */\n\tgetMembers(): Map<string, IClient>;\n\n\t/**\n\t * Get details about the connected client with the specified clientId, or undefined if the specified client isn't connected.\n\t *\n\t * @remarks When the container is disconnected, there are no guarantees about the correctness of what this method returns.\n\t * The default implementation in Fluid Framework continues to return members that were part of the audience when the\n\t * container disconnected, but this could change in the future. Other implementations could decide to always return\n\t * undefined, or only return an IClient when the local client is requested.\n\t *\n\t * Note that the clientId that a disconnected container might see for itself is an old one. A disconnected container\n\t * does not technically have a clientId tied to an active connection to the service.\n\t */\n\tgetMember(clientId: string): IClient | undefined;\n\n\t/**\n\t * Returns information about client's connection. Please see {@link ISelf} member descriptions for more details.\n\t * undefined if this client has never connected to the ordering service.\n\t * Please see {@link ISelf.clientId} for more details on when values returned by this function change over time.\n\t *\n\t * @experimental\n\t *\n\t * @remarks\n\t * This API is experimental.\n\t *\n\t * Reconnection process will have these phases:\n\t * 1. Establishing connection phase:\n\t * - new connection clientId is added to member's list. That said, self.clientId still reflects old information.\n\t * - The old client's information is removed from members' list. getMember(self.clientId) will return undefined.\n\t * 2. Catch-up phase. Client catches up on latest ops and becomes current.\n\t * 3. \"connect\" phase - the following happens synchronously:\n\t * - getSelf() information changes to reflect new connection\n\t * - \"selfChanged\" event on this object fires\n\t * - Various API surfaces may expose \"connected\" event. This event fires at the same time as self changes. That said, \"connected\" event will not fire at IContainerRuntime layer if container is read-only.\n\t *\n\t * That said, at the moment this is an experimental API. It depends on some experimental settings that might change in the future.\n\t * Events described in phase #3 may not happen at the same time if kill-bit feature gates are engaged due to a bug discovered in new logic\n\t * that delivers this functionality. Once it's proven (at scale) that everything works well, experimental tag will be removed.\n\t * Also application that deploy loader & container runtime bundles independently will see new (synchronized) behavior only when loader changes are deployed.\n\t * Newer runtimes will continue to observe old (non-synchronized) behavior when paired with older loader code.\n\t *\n\t * When promises in phase #3 are broken (due to conditions described above), consumers could experience current clientId being changed\n\t * (and \"selfChanged\" event fired) while\n\t * 1. Such clientId is not present in Audience\n\t * 2. Client is not fully caught up\n\t */\n\tgetSelf(): ISelf | undefined;\n}\n"]}
package/lib/audience.d.ts CHANGED
@@ -31,10 +31,23 @@ export interface IAudienceOwner extends IAudience {
31
31
  */
32
32
  export interface IAudienceEvents extends IEvent {
33
33
  /**
34
- * "addMember" event is raised when a new user joins collaborative session.
35
- * "removeMember" event is raised when a user leaves collaborative session.
34
+ * Raised when a new user joins collaborative session.
35
+ *
36
+ * @param clientId - clientId of the new user that joined.
37
+ * @param client - Information about the new user that joined (including user identity, connection properties).
38
+ *
39
+ * @eventProperty
40
+ */
41
+ (event: "addMember", listener: (clientId: string, client: IClient) => void): void;
42
+ /**
43
+ * Raised when a user leaves collaborative session.
44
+ *
45
+ * @param clientId - clientId of the user that left.
46
+ * @param client - Information about the user that left (including user identity, connection properties).
47
+ *
48
+ * @eventProperty
36
49
  */
37
- (event: "addMember" | "removeMember", listener: (clientId: string, client: IClient) => void): void;
50
+ (event: "removeMember", listener: (clientId: string, client: IClient) => void): void;
38
51
  /**
39
52
  * Notifies that client established new connection and caught-up on ops.
40
53
  * @param oldValue - represents old connection. Please note that oldValue.client in almost all cases will be undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAClE;;;;GAIG;AACH,MAAM,WAAW,cAAe,SAAQ,SAAS;IAChD;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAEpD;;;OAGG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAExC;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,MAAM;IAC9C;;;OAGG;IACH,CACC,KAAK,EAAE,WAAW,GAAG,cAAc,EACnC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,GACnD,IAAI,CAAC;IACR;;;;;;OAMG;IACH,CACC,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,SAAS,EAAE,QAAQ,EAAE,KAAK,KAAK,IAAI,GAC9D,IAAI,CAAC;CACR;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;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AAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;IACrF;;;;;;OAMG;IACH,CACC,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,SAAS,EAAE,QAAQ,EAAE,KAAK,KAAK,IAAI,GAC9D,IAAI,CAAC;CACR;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACrB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,eAAe,CAAC;IACjE;;;;;;;;;;OAUG;IACH,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,OAAO,IAAI,KAAK,GAAG,SAAS,CAAC;CAC7B"}
@@ -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 type { IEvent, IEventProvider } from \"@fluidframework/core-interfaces\";\nimport type { IClient } from \"@fluidframework/driver-definitions\";\n/**\n * Manages the state and the members for {@link IAudience}\n * @legacy\n * @alpha\n */\nexport interface IAudienceOwner extends IAudience {\n\t/**\n\t * Adds a new client to the audience\n\t */\n\taddMember(clientId: string, details: IClient): void;\n\n\t/**\n\t * Removes a client from the audience. Only emits an event if a client is actually removed\n\t * @returns if a client was removed from the audience\n\t */\n\tremoveMember(clientId: string): boolean;\n\n\t/**\n\t * Notifies Audience that current clientId has changed.\n\t * See {@link IAudience.getSelf} and {@link IAudienceEvents}'s \"selfChanged\" event for more details.\n\t */\n\tsetCurrentClientId(clientId: string): void;\n}\n\n/**\n * Interface describing Audience events\n * @public\n */\nexport interface IAudienceEvents extends IEvent {\n\t/**\n\t * \"addMember\" event is raised when a new user joins collaborative session.\n\t * \"removeMember\" event is raised when a user leaves collaborative session.\n\t */\n\t(\n\t\tevent: \"addMember\" | \"removeMember\",\n\t\tlistener: (clientId: string, client: IClient) => void,\n\t): void;\n\t/**\n\t * Notifies that client established new connection and caught-up on ops.\n\t * @param oldValue - represents old connection. Please note that oldValue.client in almost all cases will be undefined,\n\t * due to specifics how Audience refreshes on reconnect. In the future we could improve it and always provide client information.\n\t * @param newValue - represents newly established connection. While {@link IAudience.getSelf} is experimental, it's not guaranteed that\n\t * newValue.client is present. Same is true if you are consuming audience from container runtime layer and running against old version of loader.\n\t */\n\t(\n\t\tevent: \"selfChanged\",\n\t\tlistener: (oldValue: ISelf | undefined, newValue: ISelf) => void,\n\t): void;\n}\n\n/**\n * Return type of {@link IAudience.getSelf}. Please see remarks for {@link IAudience.getSelf} to learn more details on promises.\n * @public\n */\nexport interface ISelf {\n\t/**\n\t * clientId of current or previous connection (if client is in disconnected or reconnecting / catching up state)\n\t * It changes only when client has reconnected, caught up with latest ops.\n\t */\n\treadonly clientId: string;\n\n\t/**\n\t * Information about current client (including user identity, connection properties), supplied by ordering service when\n\t * client connected to it and received {@link ISelf.clientId}.\n\t * If present (not undefined), it's same value as calling IAudience.getMember(clientId).\n\t * This property could be undefined even if there is non-undefined clientId.\n\t * This could happen in the following cases:\n\t * 1) Container was loaded from stash, by providing IPendingContainerState state to Container.load().\n\t * 2) Container is in the process of establishing new connection. Information about old connection is already reset\n\t * (old clientId is no longer in list of members), but clientId has not yet changed to a new value.\n\t */\n\treadonly client?: IClient;\n}\n\n/**\n * Represents all clients connected to the op stream, both read-only and read/write.\n *\n * @remarks Access to the Audience when a container is disconnected is a tricky subject.\n * See the remarks on specific methods for more details.\n *\n * @public\n */\nexport interface IAudience extends IEventProvider<IAudienceEvents> {\n\t/**\n\t * List all clients connected to the op stream, keyed off their clientId.\n\t *\n\t * @remarks When the container is disconnected, there are no guarantees about the correctness of what this method returns.\n\t * The default implementation in Fluid Framework continues to return the list of members as it last saw it before the\n\t * container disconnected, but this could change in the future. Other implementations could decide to return an empty\n\t * list, or a list that only includes the local client.\n\t *\n\t * Note that the clientId that a disconnected container might see for itself is an old one. A disconnected container\n\t * does not technically have a clientId tied to an active connection to the service.\n\t */\n\tgetMembers(): Map<string, IClient>;\n\n\t/**\n\t * Get details about the connected client with the specified clientId, or undefined if the specified client isn't connected.\n\t *\n\t * @remarks When the container is disconnected, there are no guarantees about the correctness of what this method returns.\n\t * The default implementation in Fluid Framework continues to return members that were part of the audience when the\n\t * container disconnected, but this could change in the future. Other implementations could decide to always return\n\t * undefined, or only return an IClient when the local client is requested.\n\t *\n\t * Note that the clientId that a disconnected container might see for itself is an old one. A disconnected container\n\t * does not technically have a clientId tied to an active connection to the service.\n\t */\n\tgetMember(clientId: string): IClient | undefined;\n\n\t/**\n\t * Returns information about client's connection. Please see {@link ISelf} member descriptions for more details.\n\t * undefined if this client has never connected to the ordering service.\n\t * Please see {@link ISelf.clientId} for more details on when values returned by this function change over time.\n\t *\n\t * @experimental\n\t *\n\t * @remarks\n\t * This API is experimental.\n\t *\n\t * Reconnection process will have these phases:\n\t * 1. Establishing connection phase:\n\t * - new connection clientId is added to member's list. That said, self.clientId still reflects old information.\n\t * - The old client's information is removed from members' list. getMember(self.clientId) will return undefined.\n\t * 2. Catch-up phase. Client catches up on latest ops and becomes current.\n\t * 3. \"connect\" phase - the following happens synchronously:\n\t * - getSelf() information changes to reflect new connection\n\t * - \"selfChanged\" event on this object fires\n\t * - Various API surfaces may expose \"connected\" event. This event fires at the same time as self changes. That said, \"connected\" event will not fire at IContainerRuntime layer if container is read-only.\n\t *\n\t * That said, at the moment this is an experimental API. It depends on some experimental settings that might change in the future.\n\t * Events described in phase #3 may not happen at the same time if kill-bit feature gates are engaged due to a bug discovered in new logic\n\t * that delivers this functionality. Once it's proven (at scale) that everything works well, experimental tag will be removed.\n\t * Also application that deploy loader & container runtime bundles independently will see new (synchronized) behavior only when loader changes are deployed.\n\t * Newer runtimes will continue to observe old (non-synchronized) behavior when paired with older loader code.\n\t *\n\t * When promises in phase #3 are broken (due to conditions described above), consumers could experience current clientId being changed\n\t * (and \"selfChanged\" event fired) while\n\t * 1. Such clientId is not present in Audience\n\t * 2. Client is not fully caught up\n\t */\n\tgetSelf(): ISelf | 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 type { IEvent, IEventProvider } from \"@fluidframework/core-interfaces\";\nimport type { IClient } from \"@fluidframework/driver-definitions\";\n/**\n * Manages the state and the members for {@link IAudience}\n * @legacy\n * @alpha\n */\nexport interface IAudienceOwner extends IAudience {\n\t/**\n\t * Adds a new client to the audience\n\t */\n\taddMember(clientId: string, details: IClient): void;\n\n\t/**\n\t * Removes a client from the audience. Only emits an event if a client is actually removed\n\t * @returns if a client was removed from the audience\n\t */\n\tremoveMember(clientId: string): boolean;\n\n\t/**\n\t * Notifies Audience that current clientId has changed.\n\t * See {@link IAudience.getSelf} and {@link IAudienceEvents}'s \"selfChanged\" event for more details.\n\t */\n\tsetCurrentClientId(clientId: string): void;\n}\n\n/**\n * Interface describing Audience events\n * @public\n */\nexport interface IAudienceEvents extends IEvent {\n\t/**\n\t * Raised when a new user joins collaborative session.\n\t *\n\t * @param clientId - clientId of the new user that joined.\n\t * @param client - Information about the new user that joined (including user identity, connection properties).\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"addMember\", listener: (clientId: string, client: IClient) => void): void;\n\n\t/**\n\t * Raised when a user leaves collaborative session.\n\t *\n\t * @param clientId - clientId of the user that left.\n\t * @param client - Information about the user that left (including user identity, connection properties).\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"removeMember\", listener: (clientId: string, client: IClient) => void): void;\n\t/**\n\t * Notifies that client established new connection and caught-up on ops.\n\t * @param oldValue - represents old connection. Please note that oldValue.client in almost all cases will be undefined,\n\t * due to specifics how Audience refreshes on reconnect. In the future we could improve it and always provide client information.\n\t * @param newValue - represents newly established connection. While {@link IAudience.getSelf} is experimental, it's not guaranteed that\n\t * newValue.client is present. Same is true if you are consuming audience from container runtime layer and running against old version of loader.\n\t */\n\t(\n\t\tevent: \"selfChanged\",\n\t\tlistener: (oldValue: ISelf | undefined, newValue: ISelf) => void,\n\t): void;\n}\n\n/**\n * Return type of {@link IAudience.getSelf}. Please see remarks for {@link IAudience.getSelf} to learn more details on promises.\n * @public\n */\nexport interface ISelf {\n\t/**\n\t * clientId of current or previous connection (if client is in disconnected or reconnecting / catching up state)\n\t * It changes only when client has reconnected, caught up with latest ops.\n\t */\n\treadonly clientId: string;\n\n\t/**\n\t * Information about current client (including user identity, connection properties), supplied by ordering service when\n\t * client connected to it and received {@link ISelf.clientId}.\n\t * If present (not undefined), it's same value as calling IAudience.getMember(clientId).\n\t * This property could be undefined even if there is non-undefined clientId.\n\t * This could happen in the following cases:\n\t * 1) Container was loaded from stash, by providing IPendingContainerState state to Container.load().\n\t * 2) Container is in the process of establishing new connection. Information about old connection is already reset\n\t * (old clientId is no longer in list of members), but clientId has not yet changed to a new value.\n\t */\n\treadonly client?: IClient;\n}\n\n/**\n * Represents all clients connected to the op stream, both read-only and read/write.\n *\n * @remarks Access to the Audience when a container is disconnected is a tricky subject.\n * See the remarks on specific methods for more details.\n *\n * @public\n */\nexport interface IAudience extends IEventProvider<IAudienceEvents> {\n\t/**\n\t * List all clients connected to the op stream, keyed off their clientId.\n\t *\n\t * @remarks When the container is disconnected, there are no guarantees about the correctness of what this method returns.\n\t * The default implementation in Fluid Framework continues to return the list of members as it last saw it before the\n\t * container disconnected, but this could change in the future. Other implementations could decide to return an empty\n\t * list, or a list that only includes the local client.\n\t *\n\t * Note that the clientId that a disconnected container might see for itself is an old one. A disconnected container\n\t * does not technically have a clientId tied to an active connection to the service.\n\t */\n\tgetMembers(): Map<string, IClient>;\n\n\t/**\n\t * Get details about the connected client with the specified clientId, or undefined if the specified client isn't connected.\n\t *\n\t * @remarks When the container is disconnected, there are no guarantees about the correctness of what this method returns.\n\t * The default implementation in Fluid Framework continues to return members that were part of the audience when the\n\t * container disconnected, but this could change in the future. Other implementations could decide to always return\n\t * undefined, or only return an IClient when the local client is requested.\n\t *\n\t * Note that the clientId that a disconnected container might see for itself is an old one. A disconnected container\n\t * does not technically have a clientId tied to an active connection to the service.\n\t */\n\tgetMember(clientId: string): IClient | undefined;\n\n\t/**\n\t * Returns information about client's connection. Please see {@link ISelf} member descriptions for more details.\n\t * undefined if this client has never connected to the ordering service.\n\t * Please see {@link ISelf.clientId} for more details on when values returned by this function change over time.\n\t *\n\t * @experimental\n\t *\n\t * @remarks\n\t * This API is experimental.\n\t *\n\t * Reconnection process will have these phases:\n\t * 1. Establishing connection phase:\n\t * - new connection clientId is added to member's list. That said, self.clientId still reflects old information.\n\t * - The old client's information is removed from members' list. getMember(self.clientId) will return undefined.\n\t * 2. Catch-up phase. Client catches up on latest ops and becomes current.\n\t * 3. \"connect\" phase - the following happens synchronously:\n\t * - getSelf() information changes to reflect new connection\n\t * - \"selfChanged\" event on this object fires\n\t * - Various API surfaces may expose \"connected\" event. This event fires at the same time as self changes. That said, \"connected\" event will not fire at IContainerRuntime layer if container is read-only.\n\t *\n\t * That said, at the moment this is an experimental API. It depends on some experimental settings that might change in the future.\n\t * Events described in phase #3 may not happen at the same time if kill-bit feature gates are engaged due to a bug discovered in new logic\n\t * that delivers this functionality. Once it's proven (at scale) that everything works well, experimental tag will be removed.\n\t * Also application that deploy loader & container runtime bundles independently will see new (synchronized) behavior only when loader changes are deployed.\n\t * Newer runtimes will continue to observe old (non-synchronized) behavior when paired with older loader code.\n\t *\n\t * When promises in phase #3 are broken (due to conditions described above), consumers could experience current clientId being changed\n\t * (and \"selfChanged\" event fired) while\n\t * 1. Such clientId is not present in Audience\n\t * 2. Client is not fully caught up\n\t */\n\tgetSelf(): ISelf | undefined;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-definitions",
3
- "version": "2.5.0-302463",
3
+ "version": "2.5.0",
4
4
  "description": "Fluid container definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -47,8 +47,8 @@
47
47
  "main": "lib/index.js",
48
48
  "types": "lib/public.d.ts",
49
49
  "dependencies": {
50
- "@fluidframework/core-interfaces": "2.5.0-302463",
51
- "@fluidframework/driver-definitions": "2.5.0-302463"
50
+ "@fluidframework/core-interfaces": "~2.5.0",
51
+ "@fluidframework/driver-definitions": "~2.5.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@arethetypeswrong/cli": "^0.16.4",
package/src/audience.ts CHANGED
@@ -35,13 +35,24 @@ export interface IAudienceOwner extends IAudience {
35
35
  */
36
36
  export interface IAudienceEvents extends IEvent {
37
37
  /**
38
- * "addMember" event is raised when a new user joins collaborative session.
39
- * "removeMember" event is raised when a user leaves collaborative session.
38
+ * Raised when a new user joins collaborative session.
39
+ *
40
+ * @param clientId - clientId of the new user that joined.
41
+ * @param client - Information about the new user that joined (including user identity, connection properties).
42
+ *
43
+ * @eventProperty
40
44
  */
41
- (
42
- event: "addMember" | "removeMember",
43
- listener: (clientId: string, client: IClient) => void,
44
- ): void;
45
+ (event: "addMember", listener: (clientId: string, client: IClient) => void): void;
46
+
47
+ /**
48
+ * Raised when a user leaves collaborative session.
49
+ *
50
+ * @param clientId - clientId of the user that left.
51
+ * @param client - Information about the user that left (including user identity, connection properties).
52
+ *
53
+ * @eventProperty
54
+ */
55
+ (event: "removeMember", listener: (clientId: string, client: IClient) => void): void;
45
56
  /**
46
57
  * Notifies that client established new connection and caught-up on ops.
47
58
  * @param oldValue - represents old connection. Please note that oldValue.client in almost all cases will be undefined,