@fluidframework/presence 2.41.0-338401 → 2.42.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/README.md +6 -10
- package/dist/alpha.d.ts +18 -14
- package/dist/baseTypes.d.ts +1 -1
- package/dist/baseTypes.js.map +1 -1
- package/dist/beta.d.ts +53 -0
- package/dist/broadcastControls.d.ts +4 -5
- package/dist/broadcastControls.d.ts.map +1 -1
- package/dist/broadcastControls.js +2 -3
- package/dist/broadcastControls.js.map +1 -1
- package/dist/datastorePresenceManagerFactory.d.ts +4 -1
- package/dist/datastorePresenceManagerFactory.d.ts.map +1 -1
- package/dist/datastorePresenceManagerFactory.js +24 -3
- package/dist/datastorePresenceManagerFactory.js.map +1 -1
- package/dist/datastoreSupport.d.ts +7 -2
- package/dist/datastoreSupport.d.ts.map +1 -1
- package/dist/datastoreSupport.js +6 -4
- package/dist/datastoreSupport.js.map +1 -1
- package/dist/experimentalAccess.d.ts +12 -4
- package/dist/experimentalAccess.d.ts.map +1 -1
- package/dist/experimentalAccess.js +24 -17
- package/dist/experimentalAccess.js.map +1 -1
- package/dist/exposedInternalTypes.d.ts +23 -5
- package/dist/exposedInternalTypes.d.ts.map +1 -1
- package/dist/exposedInternalTypes.js +1 -1
- package/dist/exposedInternalTypes.js.map +1 -1
- package/dist/exposedUtilityTypes.d.ts +6 -5
- package/dist/exposedUtilityTypes.d.ts.map +1 -1
- package/dist/exposedUtilityTypes.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +32 -11
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/internalUtils.d.ts +34 -11
- package/dist/internalUtils.d.ts.map +1 -1
- package/dist/internalUtils.js +39 -7
- package/dist/internalUtils.js.map +1 -1
- package/dist/latestMapValueManager.d.ts +36 -15
- package/dist/latestMapValueManager.d.ts.map +1 -1
- package/dist/latestMapValueManager.js +11 -10
- package/dist/latestMapValueManager.js.map +1 -1
- package/dist/latestValueManager.d.ts +21 -7
- package/dist/latestValueManager.d.ts.map +1 -1
- package/dist/latestValueManager.js +21 -10
- package/dist/latestValueManager.js.map +1 -1
- package/dist/latestValueTypes.d.ts +14 -4
- package/dist/latestValueTypes.d.ts.map +1 -1
- package/dist/latestValueTypes.js.map +1 -1
- package/dist/notificationsManager.d.ts +3 -3
- package/dist/notificationsManager.d.ts.map +1 -1
- package/dist/notificationsManager.js +14 -7
- package/dist/notificationsManager.js.map +1 -1
- package/dist/package.json +5 -4
- package/dist/presence.d.ts +26 -13
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js +1 -1
- package/dist/presence.js.map +1 -1
- package/dist/presenceDatastoreManager.d.ts +9 -41
- package/dist/presenceDatastoreManager.d.ts.map +1 -1
- package/dist/presenceDatastoreManager.js +50 -36
- package/dist/presenceDatastoreManager.js.map +1 -1
- package/dist/presenceManager.d.ts +5 -9
- package/dist/presenceManager.d.ts.map +1 -1
- package/dist/presenceManager.js +13 -13
- package/dist/presenceManager.js.map +1 -1
- package/dist/presenceStates.d.ts +9 -14
- package/dist/presenceStates.d.ts.map +1 -1
- package/dist/presenceStates.js +1 -8
- package/dist/presenceStates.js.map +1 -1
- package/dist/protocol.d.ts +99 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +20 -0
- package/dist/protocol.js.map +1 -0
- package/dist/stateDatastore.d.ts +9 -8
- package/dist/stateDatastore.d.ts.map +1 -1
- package/dist/stateDatastore.js +0 -4
- package/dist/stateDatastore.js.map +1 -1
- package/dist/stateFactory.d.ts +1 -1
- package/dist/stateFactory.js +1 -1
- package/dist/stateFactory.js.map +1 -1
- package/dist/systemWorkspace.d.ts +12 -6
- package/dist/systemWorkspace.d.ts.map +1 -1
- package/dist/systemWorkspace.js +14 -4
- package/dist/systemWorkspace.js.map +1 -1
- package/dist/types.d.ts +12 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/valueManager.d.ts +0 -4
- package/dist/valueManager.d.ts.map +1 -1
- package/dist/valueManager.js +0 -4
- package/dist/valueManager.js.map +1 -1
- package/lib/alpha.d.ts +18 -14
- package/lib/baseTypes.d.ts +1 -1
- package/lib/baseTypes.js.map +1 -1
- package/lib/beta.d.ts +53 -0
- package/lib/broadcastControls.d.ts +4 -5
- package/lib/broadcastControls.d.ts.map +1 -1
- package/lib/broadcastControls.js +2 -3
- package/lib/broadcastControls.js.map +1 -1
- package/lib/datastorePresenceManagerFactory.d.ts +4 -1
- package/lib/datastorePresenceManagerFactory.d.ts.map +1 -1
- package/lib/datastorePresenceManagerFactory.js +24 -3
- package/lib/datastorePresenceManagerFactory.js.map +1 -1
- package/lib/datastoreSupport.d.ts +7 -2
- package/lib/datastoreSupport.d.ts.map +1 -1
- package/lib/datastoreSupport.js +6 -4
- package/lib/datastoreSupport.js.map +1 -1
- package/lib/experimentalAccess.d.ts +12 -4
- package/lib/experimentalAccess.d.ts.map +1 -1
- package/lib/experimentalAccess.js +22 -15
- package/lib/experimentalAccess.js.map +1 -1
- package/lib/exposedInternalTypes.d.ts +23 -5
- package/lib/exposedInternalTypes.d.ts.map +1 -1
- package/lib/exposedInternalTypes.js +1 -1
- package/lib/exposedInternalTypes.js.map +1 -1
- package/lib/exposedUtilityTypes.d.ts +6 -5
- package/lib/exposedUtilityTypes.d.ts.map +1 -1
- package/lib/exposedUtilityTypes.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +32 -11
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/internalUtils.d.ts +34 -11
- package/lib/internalUtils.d.ts.map +1 -1
- package/lib/internalUtils.js +35 -6
- package/lib/internalUtils.js.map +1 -1
- package/lib/latestMapValueManager.d.ts +36 -15
- package/lib/latestMapValueManager.d.ts.map +1 -1
- package/lib/latestMapValueManager.js +12 -11
- package/lib/latestMapValueManager.js.map +1 -1
- package/lib/latestValueManager.d.ts +21 -7
- package/lib/latestValueManager.d.ts.map +1 -1
- package/lib/latestValueManager.js +20 -10
- package/lib/latestValueManager.js.map +1 -1
- package/lib/latestValueTypes.d.ts +14 -4
- package/lib/latestValueTypes.d.ts.map +1 -1
- package/lib/latestValueTypes.js.map +1 -1
- package/lib/notificationsManager.d.ts +3 -3
- package/lib/notificationsManager.d.ts.map +1 -1
- package/lib/notificationsManager.js +14 -7
- package/lib/notificationsManager.js.map +1 -1
- package/lib/presence.d.ts +26 -13
- package/lib/presence.d.ts.map +1 -1
- package/lib/presence.js +1 -1
- package/lib/presence.js.map +1 -1
- package/lib/presenceDatastoreManager.d.ts +9 -41
- package/lib/presenceDatastoreManager.d.ts.map +1 -1
- package/lib/presenceDatastoreManager.js +49 -35
- package/lib/presenceDatastoreManager.js.map +1 -1
- package/lib/presenceManager.d.ts +5 -9
- package/lib/presenceManager.d.ts.map +1 -1
- package/lib/presenceManager.js +13 -13
- package/lib/presenceManager.js.map +1 -1
- package/lib/presenceStates.d.ts +9 -14
- package/lib/presenceStates.d.ts.map +1 -1
- package/lib/presenceStates.js +1 -8
- package/lib/presenceStates.js.map +1 -1
- package/lib/protocol.d.ts +99 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +17 -0
- package/lib/protocol.js.map +1 -0
- package/lib/stateDatastore.d.ts +9 -8
- package/lib/stateDatastore.d.ts.map +1 -1
- package/lib/stateDatastore.js +0 -4
- package/lib/stateDatastore.js.map +1 -1
- package/lib/stateFactory.d.ts +1 -1
- package/lib/stateFactory.js +1 -1
- package/lib/stateFactory.js.map +1 -1
- package/lib/systemWorkspace.d.ts +12 -6
- package/lib/systemWorkspace.d.ts.map +1 -1
- package/lib/systemWorkspace.js +14 -4
- package/lib/systemWorkspace.js.map +1 -1
- package/lib/types.d.ts +12 -10
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/lib/valueManager.d.ts +0 -4
- package/lib/valueManager.d.ts.map +1 -1
- package/lib/valueManager.js +0 -4
- package/lib/valueManager.js.map +1 -1
- package/package.json +30 -23
- package/dist/container-definitions/containerExtensions.d.ts +0 -137
- package/dist/container-definitions/containerExtensions.d.ts.map +0 -1
- package/dist/container-definitions/containerExtensions.js +0 -7
- package/dist/container-definitions/containerExtensions.js.map +0 -1
- package/dist/container-definitions/index.d.ts +0 -7
- package/dist/container-definitions/index.d.ts.map +0 -1
- package/dist/container-definitions/index.js +0 -7
- package/dist/container-definitions/index.js.map +0 -1
- package/dist/container-definitions/runtime.d.ts +0 -12
- package/dist/container-definitions/runtime.d.ts.map +0 -1
- package/dist/container-definitions/runtime.js +0 -7
- package/dist/container-definitions/runtime.js.map +0 -1
- package/lib/container-definitions/containerExtensions.d.ts +0 -137
- package/lib/container-definitions/containerExtensions.d.ts.map +0 -1
- package/lib/container-definitions/containerExtensions.js +0 -6
- package/lib/container-definitions/containerExtensions.js.map +0 -1
- package/lib/container-definitions/index.d.ts +0 -7
- package/lib/container-definitions/index.d.ts.map +0 -1
- package/lib/container-definitions/index.js +0 -6
- package/lib/container-definitions/index.js.map +0 -1
- package/lib/container-definitions/runtime.d.ts +0 -12
- package/lib/container-definitions/runtime.d.ts.map +0 -1
- package/lib/container-definitions/runtime.js +0 -6
- package/lib/container-definitions/runtime.js.map +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { BroadcastControls } from "./broadcastControls.js";
|
|
6
6
|
import type { InternalTypes } from "./exposedInternalTypes.js";
|
|
7
7
|
import type { NotificationsManager } from "./notificationsManager.js";
|
|
8
|
-
import type { Presence } from "./presence.js";
|
|
8
|
+
import type { Presence, PresenceWithNotifications } from "./presence.js";
|
|
9
9
|
/**
|
|
10
10
|
* Unique address within a session.
|
|
11
11
|
*
|
|
@@ -20,13 +20,13 @@ import type { Presence } from "./presence.js";
|
|
|
20
20
|
* "address:object0/sub-object2:pointers"
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
23
|
-
* @
|
|
23
|
+
* @beta
|
|
24
24
|
*/
|
|
25
25
|
export type WorkspaceAddress = `${string}:${string}`;
|
|
26
26
|
/**
|
|
27
27
|
* Single entry in {@link StatesWorkspaceSchema} or {@link NotificationsWorkspaceSchema}.
|
|
28
28
|
*
|
|
29
|
-
* @
|
|
29
|
+
* @beta
|
|
30
30
|
*/
|
|
31
31
|
export type StatesWorkspaceEntry<TKey extends string, TValue extends InternalTypes.ValueDirectoryOrState<unknown>, TManager = unknown> = InternalTypes.ManagerFactory<TKey, TValue, TManager>;
|
|
32
32
|
/**
|
|
@@ -34,16 +34,19 @@ export type StatesWorkspaceEntry<TKey extends string, TValue extends InternalTyp
|
|
|
34
34
|
*
|
|
35
35
|
* Keys of schema are the keys of the {@link StatesWorkspace} providing access to State objects.
|
|
36
36
|
*
|
|
37
|
-
* @
|
|
37
|
+
* @beta
|
|
38
38
|
*/
|
|
39
39
|
export interface StatesWorkspaceSchema {
|
|
40
|
+
/**
|
|
41
|
+
* Key-value pairs of State objects registered with the {@link StatesWorkspace}.
|
|
42
|
+
*/
|
|
40
43
|
[key: string]: StatesWorkspaceEntry<typeof key, InternalTypes.ValueDirectoryOrState<any>>;
|
|
41
44
|
}
|
|
42
45
|
/**
|
|
43
46
|
* Map of State objects registered with {@link StatesWorkspace}.
|
|
44
47
|
*
|
|
45
48
|
* @sealed
|
|
46
|
-
* @
|
|
49
|
+
* @beta
|
|
47
50
|
*/
|
|
48
51
|
export type StatesWorkspaceEntries<TSchema extends StatesWorkspaceSchema> = {
|
|
49
52
|
/**
|
|
@@ -59,7 +62,7 @@ export type StatesWorkspaceEntries<TSchema extends StatesWorkspaceSchema> = {
|
|
|
59
62
|
* each client's state is independent and may only be updated by originating client.
|
|
60
63
|
*
|
|
61
64
|
* @sealed
|
|
62
|
-
* @
|
|
65
|
+
* @beta
|
|
63
66
|
*/
|
|
64
67
|
export interface StatesWorkspace<TSchema extends StatesWorkspaceSchema, TManagerConstraints = unknown> {
|
|
65
68
|
/**
|
|
@@ -116,16 +119,15 @@ export interface NotificationsWorkspace<TSchema extends NotificationsWorkspaceSc
|
|
|
116
119
|
*/
|
|
117
120
|
readonly notifications: StatesWorkspaceEntries<TSchema>;
|
|
118
121
|
/**
|
|
119
|
-
* Containing {@link
|
|
122
|
+
* Containing {@link PresenceWithNotifications}
|
|
120
123
|
*/
|
|
121
|
-
readonly presence:
|
|
124
|
+
readonly presence: PresenceWithNotifications;
|
|
122
125
|
}
|
|
123
126
|
/**
|
|
124
127
|
* `AnyWorkspace` is a superset of {@link StatesWorkspace} and {@link NotificationsWorkspace}.
|
|
125
|
-
*
|
|
126
|
-
* @internal
|
|
127
128
|
*/
|
|
128
129
|
export interface AnyWorkspace<TSchema extends StatesWorkspaceSchema, TManagerConstraints = unknown> extends StatesWorkspace<TSchema, TManagerConstraints> {
|
|
129
130
|
readonly notifications: StatesWorkspaceEntries<TSchema>;
|
|
131
|
+
readonly presence: PresenceWithNotifications;
|
|
130
132
|
}
|
|
131
133
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAA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E,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAExD;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;CAC7C;AAID;;GAEG;AACH,MAAM,WAAW,YAAY,CAC5B,OAAO,SAAS,qBAAqB,EACrC,mBAAmB,GAAG,OAAO,CAC5B,SAAQ,eAAe,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtD,QAAQ,CAAC,aAAa,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAExD,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;CAC7C"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.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 { BroadcastControls } from \"./broadcastControls.js\";\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { NotificationsManager } from \"./notificationsManager.js\";\nimport type { Presence } from \"./presence.js\";\n\n/**\n * Unique address within a session.\n *\n * @remarks\n * A string known to all clients working with a certain Workspace and unique\n * among Workspaces. Recommend using specifying concatenation of: type of\n * unique identifier, `:` (required), and unique identifier.\n *\n * @example Examples\n * ```typescript\n * \"guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1\"\n * \"address:object0/sub-object2:pointers\"\n * ```\n *\n * @
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.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 { BroadcastControls } from \"./broadcastControls.js\";\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { NotificationsManager } from \"./notificationsManager.js\";\nimport type { Presence, PresenceWithNotifications } from \"./presence.js\";\n\n/**\n * Unique address within a session.\n *\n * @remarks\n * A string known to all clients working with a certain Workspace and unique\n * among Workspaces. Recommend using specifying concatenation of: type of\n * unique identifier, `:` (required), and unique identifier.\n *\n * @example Examples\n * ```typescript\n * \"guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1\"\n * \"address:object0/sub-object2:pointers\"\n * ```\n *\n * @beta\n */\nexport type WorkspaceAddress = `${string}:${string}`;\n\n/**\n * Single entry in {@link StatesWorkspaceSchema} or {@link NotificationsWorkspaceSchema}.\n *\n * @beta\n */\nexport type StatesWorkspaceEntry<\n\tTKey extends string,\n\tTValue extends InternalTypes.ValueDirectoryOrState<unknown>,\n\tTManager = unknown,\n> = InternalTypes.ManagerFactory<TKey, TValue, TManager>;\n\n// #region StatesWorkspace\n\n/**\n * Schema for a {@link StatesWorkspace} workspace.\n *\n * Keys of schema are the keys of the {@link StatesWorkspace} providing access to State objects.\n *\n * @beta\n */\nexport interface StatesWorkspaceSchema {\n\t/**\n\t * Key-value pairs of State objects registered with the {@link StatesWorkspace}.\n\t */\n\t[key: string]: StatesWorkspaceEntry<typeof key, InternalTypes.ValueDirectoryOrState<any>>;\n}\n\n/**\n * Map of State objects registered with {@link StatesWorkspace}.\n *\n * @sealed\n * @beta\n */\nexport type StatesWorkspaceEntries<TSchema extends StatesWorkspaceSchema> = {\n\t/**\n\t * Registered State objects.\n\t */\n\treadonly [Key in keyof TSchema]: ReturnType<\n\t\tTSchema[Key]\n\t>[\"manager\"] extends InternalTypes.StateValue<infer TManager>\n\t\t? TManager\n\t\t: never;\n};\n\n/**\n * `StatesWorkspace` maintains a registry of State objects that all share and provide access to\n * presence state values across client members in a session.\n *\n * State objects offer variations on how to manage states, but all share same principle that\n * each client's state is independent and may only be updated by originating client.\n *\n * @sealed\n * @beta\n */\nexport interface StatesWorkspace<\n\tTSchema extends StatesWorkspaceSchema,\n\tTManagerConstraints = unknown,\n> {\n\t/**\n\t * Registers a new State object with the {@link StatesWorkspace}.\n\t * @param key - new unique key for the State object within the workspace\n\t * @param manager - factory for creating a State object\n\t */\n\tadd<\n\t\tTKey extends string,\n\t\tTValue extends InternalTypes.ValueDirectoryOrState<any>,\n\t\tTManager extends TManagerConstraints,\n\t>(\n\t\tkey: TKey,\n\t\tmanager: InternalTypes.ManagerFactory<TKey, TValue, TManager>,\n\t): asserts this is StatesWorkspace<\n\t\tTSchema & Record<TKey, InternalTypes.ManagerFactory<TKey, TValue, TManager>>,\n\t\tTManagerConstraints\n\t>;\n\n\t/**\n\t * Registry of State objects.\n\t */\n\treadonly states: StatesWorkspaceEntries<TSchema>;\n\n\t/**\n\t * Default controls for management of broadcast updates.\n\t */\n\treadonly controls: BroadcastControls;\n\n\t/**\n\t * Containing {@link Presence}\n\t */\n\treadonly presence: Presence;\n}\n\n// #endregion StatesWorkspace\n\n// #region NotificationsWorkspace\n\n/**\n * Schema for a {@link NotificationsWorkspace} workspace.\n *\n * Keys of schema are the keys of the {@link NotificationsWorkspace} providing access to {@link NotificationsManager}s.\n *\n * @alpha\n */\nexport interface NotificationsWorkspaceSchema {\n\t[key: string]: InternalTypes.ManagerFactory<\n\t\ttypeof key,\n\t\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>,\n\t\tNotificationsManager<any>\n\t>;\n}\n\n/**\n * `NotificationsWorkspace` maintains a registry of {@link NotificationsManager}s\n * that facilitate messages across client members in a session.\n *\n * @privateRemarks\n * This should be kept mostly in sync with {@link StatesWorkspace}. Notably the\n * return type of `add` is limited here and the `controls` property is omitted.\n * The `PresenceStatesImpl` class implements `AnyWorkspace` and therefore\n * `NotificationsWorkspace`, so long as this is proper subset.\n *\n * @sealed\n * @alpha\n */\nexport interface NotificationsWorkspace<TSchema extends NotificationsWorkspaceSchema> {\n\t/**\n\t * Registers a new `NotificationsManager` with the {@link NotificationsWorkspace}.\n\t * @param key - new unique key for the `NotificationsManager` within the workspace\n\t * @param manager - factory for creating a `NotificationsManager`\n\t */\n\tadd<\n\t\tTKey extends string,\n\t\tTValue extends InternalTypes.ValueDirectoryOrState<any>,\n\t\tTManager extends NotificationsManager<any>,\n\t>(\n\t\tkey: TKey,\n\t\tmanager: InternalTypes.ManagerFactory<TKey, TValue, TManager>,\n\t): asserts this is NotificationsWorkspace<\n\t\tTSchema & Record<TKey, InternalTypes.ManagerFactory<TKey, TValue, TManager>>\n\t>;\n\n\t/**\n\t * Registry of `NotificationsManager`s.\n\t */\n\treadonly notifications: StatesWorkspaceEntries<TSchema>;\n\n\t/**\n\t * Containing {@link PresenceWithNotifications}\n\t */\n\treadonly presence: PresenceWithNotifications;\n}\n\n// #endregion NotificationsWorkspace\n\n/**\n * `AnyWorkspace` is a superset of {@link StatesWorkspace} and {@link NotificationsWorkspace}.\n */\nexport interface AnyWorkspace<\n\tTSchema extends StatesWorkspaceSchema,\n\tTManagerConstraints = unknown,\n> extends StatesWorkspace<TSchema, TManagerConstraints> {\n\treadonly notifications: StatesWorkspaceEntries<TSchema>;\n\t// TO be removed if/when notifications are fully supported\n\treadonly presence: PresenceWithNotifications;\n}\n"]}
|
package/dist/valueManager.d.ts
CHANGED
|
@@ -6,14 +6,10 @@ import type { InternalTypes } from "./exposedInternalTypes.js";
|
|
|
6
6
|
import type { ValueManager } from "./internalTypes.js";
|
|
7
7
|
/**
|
|
8
8
|
* Given a value manager, return opaque InternalTypes.StateValue.
|
|
9
|
-
*
|
|
10
|
-
* @internal
|
|
11
9
|
*/
|
|
12
10
|
export declare function brandIVM<TManagerInterface, TValue, TValueState extends InternalTypes.ValueDirectoryOrState<TValue>>(manager: TManagerInterface & ValueManager<TValue, TValueState>): InternalTypes.StateValue<TManagerInterface>;
|
|
13
11
|
/**
|
|
14
12
|
* Extract the value manager from an opaque InternalTypes.StateValue.
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
13
|
*/
|
|
18
14
|
export declare function unbrandIVM<TManagerInterface, TValue, TValueState extends InternalTypes.ValueDirectoryOrState<TValue>>(branded: InternalTypes.StateValue<TManagerInterface>): ValueManager<TValue, TValueState>;
|
|
19
15
|
//# sourceMappingURL=valueManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueManager.d.ts","sourceRoot":"","sources":["../src/valueManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"valueManager.d.ts","sourceRoot":"","sources":["../src/valueManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,QAAQ,CACvB,iBAAiB,EACjB,MAAM,EACN,WAAW,SAAS,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAE/D,OAAO,EAAE,iBAAiB,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,GAC5D,aAAa,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAE7C;AAED;;GAEG;AACH,wBAAgB,UAAU,CACzB,iBAAiB,EACjB,MAAM,EACN,WAAW,SAAS,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAC9D,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,CAEzF"}
|
package/dist/valueManager.js
CHANGED
|
@@ -7,8 +7,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.unbrandIVM = exports.brandIVM = void 0;
|
|
8
8
|
/**
|
|
9
9
|
* Given a value manager, return opaque InternalTypes.StateValue.
|
|
10
|
-
*
|
|
11
|
-
* @internal
|
|
12
10
|
*/
|
|
13
11
|
function brandIVM(manager) {
|
|
14
12
|
return manager;
|
|
@@ -16,8 +14,6 @@ function brandIVM(manager) {
|
|
|
16
14
|
exports.brandIVM = brandIVM;
|
|
17
15
|
/**
|
|
18
16
|
* Extract the value manager from an opaque InternalTypes.StateValue.
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
21
17
|
*/
|
|
22
18
|
function unbrandIVM(branded) {
|
|
23
19
|
return branded;
|
package/dist/valueManager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueManager.js","sourceRoot":"","sources":["../src/valueManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH
|
|
1
|
+
{"version":3,"file":"valueManager.js","sourceRoot":"","sources":["../src/valueManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH;;GAEG;AACH,SAAgB,QAAQ,CAKvB,OAA8D;IAE9D,OAAO,OAA2E,CAAC;AACpF,CAAC;AARD,4BAQC;AAED;;GAEG;AACH,SAAgB,UAAU,CAIxB,OAAoD;IACrD,OAAO,OAAuD,CAAC;AAChE,CAAC;AAND,gCAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { ValueManager } from \"./internalTypes.js\";\n\n/**\n * Given a value manager, return opaque InternalTypes.StateValue.\n */\nexport function brandIVM<\n\tTManagerInterface,\n\tTValue,\n\tTValueState extends InternalTypes.ValueDirectoryOrState<TValue>,\n>(\n\tmanager: TManagerInterface & ValueManager<TValue, TValueState>,\n): InternalTypes.StateValue<TManagerInterface> {\n\treturn manager as TManagerInterface as InternalTypes.StateValue<TManagerInterface>;\n}\n\n/**\n * Extract the value manager from an opaque InternalTypes.StateValue.\n */\nexport function unbrandIVM<\n\tTManagerInterface,\n\tTValue,\n\tTValueState extends InternalTypes.ValueDirectoryOrState<TValue>,\n>(branded: InternalTypes.StateValue<TManagerInterface>): ValueManager<TValue, TValueState> {\n\treturn branded as unknown as ValueManager<TValue, TValueState>;\n}\n"]}
|
package/lib/alpha.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
export {
|
|
20
|
-
// @
|
|
20
|
+
// @beta APIs
|
|
21
21
|
Attendee,
|
|
22
22
|
AttendeeId,
|
|
23
23
|
AttendeeStatus,
|
|
@@ -25,10 +25,7 @@ export {
|
|
|
25
25
|
BroadcastControlSettings,
|
|
26
26
|
BroadcastControls,
|
|
27
27
|
ClientConnectionId,
|
|
28
|
-
ExperimentalPresenceDO,
|
|
29
|
-
ExperimentalPresenceManager,
|
|
30
28
|
InternalTypes,
|
|
31
|
-
InternalUtilityTypes,
|
|
32
29
|
LatestArguments,
|
|
33
30
|
LatestClientData,
|
|
34
31
|
LatestData,
|
|
@@ -41,14 +38,6 @@ export {
|
|
|
41
38
|
LatestMetadata,
|
|
42
39
|
LatestRaw,
|
|
43
40
|
LatestRawEvents,
|
|
44
|
-
NotificationEmitter,
|
|
45
|
-
NotificationListenable,
|
|
46
|
-
NotificationSubscriptions,
|
|
47
|
-
Notifications,
|
|
48
|
-
NotificationsManager,
|
|
49
|
-
NotificationsManagerEvents,
|
|
50
|
-
NotificationsWorkspace,
|
|
51
|
-
NotificationsWorkspaceSchema,
|
|
52
41
|
Presence,
|
|
53
42
|
PresenceEvents,
|
|
54
43
|
StateFactory,
|
|
@@ -59,7 +48,22 @@ export {
|
|
|
59
48
|
StatesWorkspaceSchema,
|
|
60
49
|
WorkspaceAddress,
|
|
61
50
|
getPresence,
|
|
62
|
-
getPresenceViaDataObject,
|
|
63
51
|
latest,
|
|
64
|
-
latestMap
|
|
52
|
+
latestMap,
|
|
53
|
+
|
|
54
|
+
// @alpha APIs
|
|
55
|
+
ExperimentalPresenceDO,
|
|
56
|
+
ExperimentalPresenceManager,
|
|
57
|
+
InternalUtilityTypes,
|
|
58
|
+
NotificationEmitter,
|
|
59
|
+
NotificationListenable,
|
|
60
|
+
NotificationSubscriptions,
|
|
61
|
+
Notifications,
|
|
62
|
+
NotificationsManager,
|
|
63
|
+
NotificationsManagerEvents,
|
|
64
|
+
NotificationsWorkspace,
|
|
65
|
+
NotificationsWorkspaceSchema,
|
|
66
|
+
PresenceWithNotifications,
|
|
67
|
+
getPresenceAlpha,
|
|
68
|
+
getPresenceViaDataObject
|
|
65
69
|
} from "./index.js";
|
package/lib/baseTypes.d.ts
CHANGED
package/lib/baseTypes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseTypes.js","sourceRoot":"","sources":["../src/baseTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * A Fluid client connection identifier.\n *\n * @remarks\n * Each client connection is given a unique identifier for the duration of the\n * connection. If a client disconnects and reconnects, it will be given a new\n * identifier. Prefer use of {@link Attendee} as a way to identify clients\n * in a session. {@link Attendee.getConnectionId} will provide the current\n * connection identifier for a logical attendee.\n *\n * @privateRemarks\n * This represents what is commonly `clientId` in Fluid code. Ideally this is\n * moved somewhere more central and we brand it to avoid confusion with other\n * strings. Branding broadly is likely a breaking change and may take decent\n * effort to manage.\n *\n * @
|
|
1
|
+
{"version":3,"file":"baseTypes.js","sourceRoot":"","sources":["../src/baseTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * A Fluid client connection identifier.\n *\n * @remarks\n * Each client connection is given a unique identifier for the duration of the\n * connection. If a client disconnects and reconnects, it will be given a new\n * identifier. Prefer use of {@link Attendee} as a way to identify clients\n * in a session. {@link Attendee.getConnectionId} will provide the current\n * connection identifier for a logical attendee.\n *\n * @privateRemarks\n * This represents what is commonly `clientId` in Fluid code. Ideally this is\n * moved somewhere more central and we brand it to avoid confusion with other\n * strings. Branding broadly is likely a breaking change and may take decent\n * effort to manage.\n *\n * @beta\n */\nexport type ClientConnectionId = string;\n"]}
|
package/lib/beta.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Package for client presence within a connected session.
|
|
13
|
+
*
|
|
14
|
+
* See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.
|
|
15
|
+
*
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
// @beta APIs
|
|
21
|
+
Attendee,
|
|
22
|
+
AttendeeId,
|
|
23
|
+
AttendeeStatus,
|
|
24
|
+
AttendeesEvents,
|
|
25
|
+
BroadcastControlSettings,
|
|
26
|
+
BroadcastControls,
|
|
27
|
+
ClientConnectionId,
|
|
28
|
+
InternalTypes,
|
|
29
|
+
LatestArguments,
|
|
30
|
+
LatestClientData,
|
|
31
|
+
LatestData,
|
|
32
|
+
LatestMapArguments,
|
|
33
|
+
LatestMapClientData,
|
|
34
|
+
LatestMapItemRemovedClientData,
|
|
35
|
+
LatestMapItemUpdatedClientData,
|
|
36
|
+
LatestMapRaw,
|
|
37
|
+
LatestMapRawEvents,
|
|
38
|
+
LatestMetadata,
|
|
39
|
+
LatestRaw,
|
|
40
|
+
LatestRawEvents,
|
|
41
|
+
Presence,
|
|
42
|
+
PresenceEvents,
|
|
43
|
+
StateFactory,
|
|
44
|
+
StateMap,
|
|
45
|
+
StatesWorkspace,
|
|
46
|
+
StatesWorkspaceEntries,
|
|
47
|
+
StatesWorkspaceEntry,
|
|
48
|
+
StatesWorkspaceSchema,
|
|
49
|
+
WorkspaceAddress,
|
|
50
|
+
getPresence,
|
|
51
|
+
latest,
|
|
52
|
+
latestMap
|
|
53
|
+
} from "./index.js";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Common controls for States objects.
|
|
7
7
|
*
|
|
8
8
|
* @sealed
|
|
9
|
-
* @
|
|
9
|
+
* @beta
|
|
10
10
|
*/
|
|
11
11
|
export interface BroadcastControls {
|
|
12
12
|
/**
|
|
@@ -25,7 +25,7 @@ export interface BroadcastControls {
|
|
|
25
25
|
/**
|
|
26
26
|
* Value set to configure {@link BroadcastControls}.
|
|
27
27
|
*
|
|
28
|
-
* @
|
|
28
|
+
* @beta
|
|
29
29
|
*/
|
|
30
30
|
export interface BroadcastControlSettings {
|
|
31
31
|
/**
|
|
@@ -44,7 +44,8 @@ declare class ForcedRefreshControl implements Pick<BroadcastControls & {
|
|
|
44
44
|
set forcedRefreshIntervalMs(value: number | undefined);
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* @
|
|
47
|
+
* Implements {@link BroadcastControls} for States Managers
|
|
48
|
+
* where returning `undefined` settings are allowed.
|
|
48
49
|
*/
|
|
49
50
|
export declare class OptionalBroadcastControl extends ForcedRefreshControl implements BroadcastControls {
|
|
50
51
|
allowableUpdateLatencyMs: number | undefined;
|
|
@@ -56,8 +57,6 @@ export declare class OptionalBroadcastControl extends ForcedRefreshControl imple
|
|
|
56
57
|
*
|
|
57
58
|
* If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}
|
|
58
59
|
* is set to `undefined`, the default will be restored.
|
|
59
|
-
*
|
|
60
|
-
* @internal
|
|
61
60
|
*/
|
|
62
61
|
export declare class RequiredBroadcastControl extends ForcedRefreshControl implements BroadcastControls {
|
|
63
62
|
private readonly defaultAllowableUpdateLatencyMs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broadcastControls.d.ts","sourceRoot":"","sources":["../src/broadcastControls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;;;;;;OAUG;IACH,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;CAc7C;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CAS3C;AAED,cAAM,oBACL,YACC,IAAI,CACH,iBAAiB,GAAG;IAAE,uBAAuB,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EACnE,yBAAyB,CACzB;IAEF,OAAO,CAAC,sBAAsB,CAAqB;gBAEhC,QAAQ,CAAC,EAAE,wBAAwB;IAItD,IAAW,uBAAuB,IAAI,MAAM,GAAG,SAAS,CAEvD;IACD,IAAW,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAU3D;CACD;AAED
|
|
1
|
+
{"version":3,"file":"broadcastControls.d.ts","sourceRoot":"","sources":["../src/broadcastControls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;;;;;;OAUG;IACH,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;CAc7C;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CAS3C;AAED,cAAM,oBACL,YACC,IAAI,CACH,iBAAiB,GAAG;IAAE,uBAAuB,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EACnE,yBAAyB,CACzB;IAEF,OAAO,CAAC,sBAAsB,CAAqB;gBAEhC,QAAQ,CAAC,EAAE,wBAAwB;IAItD,IAAW,uBAAuB,IAAI,MAAM,GAAG,SAAS,CAEvD;IACD,IAAW,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAU3D;CACD;AAED;;;GAGG;AACH,qBAAa,wBACZ,SAAQ,oBACR,YAAW,iBAAiB;IAErB,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEjC,QAAQ,CAAC,EAAE,wBAAwB;CAItD;AAED;;;;;;GAMG;AACH,qBAAa,wBACZ,SAAQ,oBACR,YAAW,iBAAiB;IAIT,OAAO,CAAC,QAAQ,CAAC,+BAA+B;IAFnE,OAAO,CAAC,yBAAyB,CAAS;gBAEN,+BAA+B,EAAE,MAAM;IAK3E,IAAW,wBAAwB,IAAI,MAAM,CAE5C;IACD,IAAW,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAE5D;CACD"}
|
package/lib/broadcastControls.js
CHANGED
|
@@ -23,7 +23,8 @@ class ForcedRefreshControl {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* @
|
|
26
|
+
* Implements {@link BroadcastControls} for States Managers
|
|
27
|
+
* where returning `undefined` settings are allowed.
|
|
27
28
|
*/
|
|
28
29
|
export class OptionalBroadcastControl extends ForcedRefreshControl {
|
|
29
30
|
constructor(settings) {
|
|
@@ -37,8 +38,6 @@ export class OptionalBroadcastControl extends ForcedRefreshControl {
|
|
|
37
38
|
*
|
|
38
39
|
* If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}
|
|
39
40
|
* is set to `undefined`, the default will be restored.
|
|
40
|
-
*
|
|
41
|
-
* @internal
|
|
42
41
|
*/
|
|
43
42
|
export class RequiredBroadcastControl extends ForcedRefreshControl {
|
|
44
43
|
constructor(defaultAllowableUpdateLatencyMs) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broadcastControls.js","sourceRoot":"","sources":["../src/broadcastControls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0DH,MAAM,oBAAoB;IASzB,YAAmB,QAAmC;QACrD,mEAAmE;IACpE,CAAC;IAED,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,sBAAsB,CAA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;CACD;AAED;;;;;;GAMG;AACH,MAAM,OAAO,wBACZ,SAAQ,oBAAoB;IAK5B,YAAoC,+BAAuC;QAC1E,KAAK,EAAE,CAAC;QAD2B,oCAA+B,GAA/B,+BAA+B,CAAQ;QAE1E,IAAI,CAAC,yBAAyB,GAAG,+BAA+B,CAAC;IAClE,CAAC;IAED,IAAW,wBAAwB;QAClC,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACvC,CAAC;IACD,IAAW,wBAAwB,CAAC,KAAyB;QAC5D,IAAI,CAAC,yBAAyB,GAAG,KAAK,IAAI,IAAI,CAAC,+BAA+B,CAAC;IAChF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Common controls for States objects.\n *\n * @sealed\n * @beta\n */\nexport interface BroadcastControls {\n\t/**\n\t * Maximum time in milliseconds that a local value update is allowed\n\t * to remain pending before it must be broadcast.\n\t *\n\t * @remarks\n\t * There is no guarantee of broadcast within time allowed\n\t * as other conditions such as disconnect or service throttling may\n\t * cause a delay.\n\t *\n\t * Setting to `undefined` will restore to a system default.\n\t */\n\tallowableUpdateLatencyMs: number | undefined;\n\n\t/**\n\t * Target time in milliseconds between oldest changed local state\n\t * has been broadcast and forced rebroadcast of all local values.\n\t * A value of less than 10 disables forced refresh.\n\t *\n\t * @privateRemarks\n\t * Any time less than 10 milliseconds is likely to generate too\n\t * many signals. Ideally this feature becomes obsolete as\n\t * we understand the system better and account for holes.\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// forcedRefreshIntervalMs: number | undefined;\n}\n\n/**\n * Value set to configure {@link BroadcastControls}.\n *\n * @beta\n */\nexport interface BroadcastControlSettings {\n\t/**\n\t * {@inheritdoc BroadcastControls.allowableUpdateLatencyMs}\n\t *\n\t * @defaultValue 60 [milliseconds]\n\t */\n\treadonly allowableUpdateLatencyMs?: number;\n\n\t/**\n\t * {@inheritdoc BroadcastControls.forcedRefreshIntervalMs}\n\t *\n\t * @defaultValue 0 (disabled)\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// readonly forcedRefreshIntervalMs?: number;\n}\n\nclass ForcedRefreshControl\n\timplements\n\t\tPick<\n\t\t\tBroadcastControls & { forcedRefreshIntervalMs: number | undefined },\n\t\t\t\"forcedRefreshIntervalMs\"\n\t\t>\n{\n\tprivate _forcedRefreshInterval: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\t// this._forcedRefreshInterval = settings?.forcedRefreshIntervalMs;\n\t}\n\n\tpublic get forcedRefreshIntervalMs(): number | undefined {\n\t\treturn this._forcedRefreshInterval;\n\t}\n\tpublic set forcedRefreshIntervalMs(value: number | undefined) {\n\t\tif (value === undefined) {\n\t\t\tthis._forcedRefreshInterval = undefined;\n\t\t} else {\n\t\t\tthis._forcedRefreshInterval = value >= 10 ? value : undefined;\n\t\t\tif (value >= 10) {\n\t\t\t\t// TODO: enable periodic forced refresh\n\t\t\t\tthrow new Error(\"Forced Refresh feature is not implemented\");\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Implements {@link BroadcastControls} for States Managers\n * where returning `undefined` settings are allowed.\n */\nexport class OptionalBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tpublic allowableUpdateLatencyMs: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\tsuper(settings);\n\t\tthis.allowableUpdateLatencyMs = settings?.allowableUpdateLatencyMs;\n\t}\n}\n\n/**\n * Implements {@link BroadcastControls} but always provides defined value for\n * {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}.\n *\n * If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}\n * is set to `undefined`, the default will be restored.\n */\nexport class RequiredBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tprivate _allowableUpdateLatencyMs: number;\n\n\tpublic constructor(private readonly defaultAllowableUpdateLatencyMs: number) {\n\t\tsuper();\n\t\tthis._allowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;\n\t}\n\n\tpublic get allowableUpdateLatencyMs(): number {\n\t\treturn this._allowableUpdateLatencyMs;\n\t}\n\tpublic set allowableUpdateLatencyMs(value: number | undefined) {\n\t\tthis._allowableUpdateLatencyMs = value ?? this.defaultAllowableUpdateLatencyMs;\n\t}\n}\n"]}
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
6
6
|
import type { SharedObjectKind } from "@fluidframework/shared-object-base";
|
|
7
|
-
import type { Presence } from "./presence.js";
|
|
7
|
+
import type { PresenceWithNotifications as Presence } from "./presence.js";
|
|
8
8
|
/**
|
|
9
9
|
* Brand for Experimental Presence Data Object.
|
|
10
10
|
*
|
|
11
11
|
* @remarks
|
|
12
12
|
* See {@link getPresenceViaDataObject} for example usage.
|
|
13
13
|
*
|
|
14
|
+
* @deprecated Use {@link getPresence} instead.
|
|
14
15
|
* @sealed
|
|
15
16
|
* @alpha
|
|
16
17
|
*/
|
|
@@ -21,6 +22,7 @@ export declare class ExperimentalPresenceDO {
|
|
|
21
22
|
* DataStore based Presence Manager that is used as fallback for preferred Container
|
|
22
23
|
* Extension based version requires registration. Export SharedObjectKind for registration.
|
|
23
24
|
*
|
|
25
|
+
* @deprecated Use {@link getPresence} instead.
|
|
24
26
|
* @alpha
|
|
25
27
|
*/
|
|
26
28
|
export declare const ExperimentalPresenceManager: SharedObjectKind<IFluidLoadable & ExperimentalPresenceDO>;
|
|
@@ -42,6 +44,7 @@ export declare const ExperimentalPresenceManager: SharedObjectKind<IFluidLoadabl
|
|
|
42
44
|
* );
|
|
43
45
|
* ```
|
|
44
46
|
*
|
|
47
|
+
* @deprecated Use {@link getPresence} instead.
|
|
45
48
|
* @alpha
|
|
46
49
|
*/
|
|
47
50
|
export declare function getPresenceViaDataObject(fluidLoadable: ExperimentalPresenceDO): Presence;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastorePresenceManagerFactory.d.ts","sourceRoot":"","sources":["../src/datastorePresenceManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"datastorePresenceManagerFactory.d.ts","sourceRoot":"","sources":["../src/datastorePresenceManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,KAAK,EAAE,yBAAyB,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAmE3E;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IAC1C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;CAC/C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,2DAGtC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,sBAAsB,GAAG,QAAQ,CAMxF"}
|
|
@@ -2,13 +2,20 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
/*
|
|
6
|
+
* Hacky support for internal datastore based usages.
|
|
7
|
+
*/
|
|
8
|
+
import { createEmitter } from "@fluid-internal/client-utils";
|
|
5
9
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
10
|
import { BasicDataStoreFactory, LoadableFluidObject } from "./datastoreSupport.js";
|
|
7
11
|
import { createPresenceManager } from "./presenceManager.js";
|
|
12
|
+
/**
|
|
13
|
+
* This provides faux validation of the signal message.
|
|
14
|
+
*/
|
|
8
15
|
function assertSignalMessageIsValid(message) {
|
|
9
16
|
assert(message.clientId !== null, 0xa58 /* Signal must have a client ID */);
|
|
10
17
|
// The other difference between messages is that `content` for
|
|
11
|
-
//
|
|
18
|
+
// RawInboundExtensionMessage is JsonDeserialized and we are fine assuming that.
|
|
12
19
|
}
|
|
13
20
|
/**
|
|
14
21
|
* Simple FluidObject holding Presence Manager.
|
|
@@ -18,10 +25,22 @@ class PresenceManagerDataObject extends LoadableFluidObject {
|
|
|
18
25
|
if (!this._presenceManager) {
|
|
19
26
|
// TODO: investigate if ContainerExtensionStore (path-based address routing for
|
|
20
27
|
// Signals) is readily detectable here and use that presence manager directly.
|
|
21
|
-
const
|
|
28
|
+
const runtime = this.runtime;
|
|
29
|
+
const events = createEmitter();
|
|
30
|
+
runtime.on("connected", (clientId) => events.emit("connected", clientId));
|
|
31
|
+
runtime.on("disconnected", () => events.emit("disconnected"));
|
|
32
|
+
const manager = createPresenceManager({
|
|
33
|
+
isConnected: () => runtime.connected,
|
|
34
|
+
getClientId: () => runtime.clientId,
|
|
35
|
+
events,
|
|
36
|
+
getQuorum: runtime.getQuorum.bind(runtime),
|
|
37
|
+
getAudience: runtime.getAudience.bind(runtime),
|
|
38
|
+
submitSignal: (message) => runtime.submitSignal(message.type, message.content, message.targetClientId),
|
|
39
|
+
supportedFeatures: new Set() /* We do not implement feature detection here since this is a deprecated path */,
|
|
40
|
+
});
|
|
22
41
|
this.runtime.on("signal", (message, local) => {
|
|
23
42
|
assertSignalMessageIsValid(message);
|
|
24
|
-
manager.processSignal(
|
|
43
|
+
manager.processSignal([], message, local);
|
|
25
44
|
});
|
|
26
45
|
this._presenceManager = manager;
|
|
27
46
|
}
|
|
@@ -43,6 +62,7 @@ class PresenceManagerFactory {
|
|
|
43
62
|
* DataStore based Presence Manager that is used as fallback for preferred Container
|
|
44
63
|
* Extension based version requires registration. Export SharedObjectKind for registration.
|
|
45
64
|
*
|
|
65
|
+
* @deprecated Use {@link getPresence} instead.
|
|
46
66
|
* @alpha
|
|
47
67
|
*/
|
|
48
68
|
export const ExperimentalPresenceManager = new PresenceManagerFactory();
|
|
@@ -64,6 +84,7 @@ export const ExperimentalPresenceManager = new PresenceManagerFactory();
|
|
|
64
84
|
* );
|
|
65
85
|
* ```
|
|
66
86
|
*
|
|
87
|
+
* @deprecated Use {@link getPresence} instead.
|
|
67
88
|
* @alpha
|
|
68
89
|
*/
|
|
69
90
|
export function getPresenceViaDataObject(fluidLoadable) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastorePresenceManagerFactory.js","sourceRoot":"","sources":["../src/datastorePresenceManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"datastorePresenceManagerFactory.js","sourceRoot":"","sources":["../src/datastorePresenceManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAM7D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAI7D,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG7D;;GAEG;AACH,SAAS,0BAA0B,CAClC,OAA2E;IAE3E,MAAM,CAAC,OAAO,CAAC,QAAQ,KAAK,IAAI,EAAE,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC5E,8DAA8D;IAC9D,gFAAgF;AACjF,CAAC;AAED;;GAEG;AACH,MAAM,yBAA0B,SAAQ,mBAAmB;IAKnD,eAAe;QACrB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC5B,+EAA+E;YAC/E,8EAA8E;YAC9E,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAC7B,MAAM,MAAM,GAAG,aAAa,EAAuB,CAAC;YACpD,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,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,2BAA2B,GACvC,IAAI,sBAAsB,EAEzB,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,wBAAwB,CAAC,aAAqC;IAC7E,IAAI,aAAa,YAAY,yBAAyB,EAAE,CAAC;QACxD,OAAO,aAAa,CAAC,eAAe,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;AACxF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/*\n * Hacky support for internal datastore based usages.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tExtensionHostEvents,\n\tRawInboundExtensionMessage,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IInboundSignalMessage } from \"@fluidframework/runtime-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\n\nimport { BasicDataStoreFactory, LoadableFluidObject } from \"./datastoreSupport.js\";\nimport type { PresenceWithNotifications as Presence } from \"./presence.js\";\nimport { createPresenceManager } from \"./presenceManager.js\";\nimport type { OutboundPresenceMessage, SignalMessages } from \"./protocol.js\";\n\n/**\n * This provides faux validation of the signal message.\n */\nfunction assertSignalMessageIsValid(\n\tmessage: IInboundSignalMessage | RawInboundExtensionMessage<SignalMessages>,\n): asserts message is RawInboundExtensionMessage<SignalMessages> {\n\tassert(message.clientId !== null, 0xa58 /* Signal must have a client ID */);\n\t// The other difference between messages is that `content` for\n\t// RawInboundExtensionMessage is JsonDeserialized and we are fine assuming that.\n}\n\n/**\n * Simple FluidObject holding Presence Manager.\n */\nclass PresenceManagerDataObject extends LoadableFluidObject {\n\t// Creation of presence manager is deferred until first acquisition to avoid\n\t// instantiations and stand-up by Summarizer that has no actual use.\n\tprivate _presenceManager: Presence | undefined;\n\n\tpublic presenceManager(): Presence {\n\t\tif (!this._presenceManager) {\n\t\t\t// TODO: investigate if ContainerExtensionStore (path-based address routing for\n\t\t\t// Signals) is readily detectable here and use that presence manager directly.\n\t\t\tconst runtime = this.runtime;\n\t\t\tconst events = createEmitter<ExtensionHostEvents>();\n\t\t\truntime.on(\"connected\", (clientId) => events.emit(\"connected\", clientId));\n\t\t\truntime.on(\"disconnected\", () => events.emit(\"disconnected\"));\n\n\t\t\tconst manager = createPresenceManager({\n\t\t\t\tisConnected: () => runtime.connected,\n\t\t\t\tgetClientId: () => runtime.clientId,\n\t\t\t\tevents,\n\t\t\t\tgetQuorum: runtime.getQuorum.bind(runtime),\n\t\t\t\tgetAudience: runtime.getAudience.bind(runtime),\n\t\t\t\tsubmitSignal: (message: OutboundPresenceMessage) =>\n\t\t\t\t\truntime.submitSignal(message.type, message.content, message.targetClientId),\n\t\t\t\tsupportedFeatures:\n\t\t\t\t\tnew Set() /* We do not implement feature detection here since this is a deprecated path */,\n\t\t\t});\n\t\t\tthis.runtime.on(\"signal\", (message: IInboundSignalMessage, local: boolean) => {\n\t\t\t\tassertSignalMessageIsValid(message);\n\t\t\t\tmanager.processSignal([], message, local);\n\t\t\t});\n\t\t\tthis._presenceManager = manager;\n\t\t}\n\t\treturn this._presenceManager;\n\t}\n}\n\n/**\n * Factory class to create {@link Presence} in own data store.\n */\nclass PresenceManagerFactory {\n\tpublic is(value: IFluidLoadable | ExperimentalPresenceDO): value is ExperimentalPresenceDO {\n\t\treturn value instanceof PresenceManagerDataObject;\n\t}\n\n\tpublic readonly factory = new BasicDataStoreFactory(\n\t\t\"@fluidframework/presence\",\n\t\tPresenceManagerDataObject,\n\t);\n}\n\n/**\n * Brand for Experimental Presence Data Object.\n *\n * @remarks\n * See {@link getPresenceViaDataObject} for example usage.\n *\n * @deprecated Use {@link getPresence} instead.\n * @sealed\n * @alpha\n */\nexport declare class ExperimentalPresenceDO {\n\tprivate readonly _self: ExperimentalPresenceDO;\n}\n\n/**\n * DataStore based Presence Manager that is used as fallback for preferred Container\n * Extension based version requires registration. Export SharedObjectKind for registration.\n *\n * @deprecated Use {@link getPresence} instead.\n * @alpha\n */\nexport const ExperimentalPresenceManager =\n\tnew PresenceManagerFactory() as unknown as SharedObjectKind<\n\t\tIFluidLoadable & ExperimentalPresenceDO\n\t>;\n\n/**\n * Acquire Presence from a DataStore based Presence Manager\n *\n * @example\n * ```typescript\n * const containerSchema = {\n * \tinitialObjects: {\n * \t\texperimentalPresence: ExperimentalPresenceDO,\n * \t},\n * } satisfies ContainerSchema;\n * ```\n * then\n * ```typescript\n * const presence = getPresenceViaDataObject(\n * \tcontainer.initialObjects.experimentalPresence,\n * \t);\n * ```\n *\n * @deprecated Use {@link getPresence} instead.\n * @alpha\n */\nexport function getPresenceViaDataObject(fluidLoadable: ExperimentalPresenceDO): Presence {\n\tif (fluidLoadable instanceof PresenceManagerDataObject) {\n\t\treturn fluidLoadable.presenceManager();\n\t}\n\n\tthrow new Error(\"Incompatible loadable; make sure to use ExperimentalPresenceManager\");\n}\n"]}
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* This module provided collection of minimal (slim) helpers to support
|
|
7
|
+
* DataObject creation for temporary {@link ExperimentalPresenceManager}.
|
|
8
|
+
*/
|
|
5
9
|
import type { FluidObject, IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
6
10
|
import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
|
|
7
11
|
import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal";
|
|
8
12
|
import type { IFluidDataStoreContext, IFluidDataStoreFactory } from "@fluidframework/runtime-definitions/internal";
|
|
9
13
|
/**
|
|
10
|
-
* @
|
|
14
|
+
* `BasicDataStoreFactory` is the factory for creating a {@link BasicFluidDataStoreRuntime}.
|
|
11
15
|
*/
|
|
12
16
|
export declare class BasicDataStoreFactory<Type extends string> implements IFluidDataStoreFactory {
|
|
13
17
|
readonly type: Type;
|
|
@@ -17,7 +21,8 @@ export declare class BasicDataStoreFactory<Type extends string> implements IFlui
|
|
|
17
21
|
instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<FluidDataStoreRuntime>;
|
|
18
22
|
}
|
|
19
23
|
/**
|
|
20
|
-
* @
|
|
24
|
+
* `LoadableFluidObject` is helper to build a DataObject handling the {@link FluidObject}
|
|
25
|
+
* and {@link IFluidLoadable} requirements.
|
|
21
26
|
*/
|
|
22
27
|
export declare abstract class LoadableFluidObject implements FluidObject, IFluidLoadable {
|
|
23
28
|
protected readonly runtime: FluidDataStoreRuntime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastoreSupport.d.ts","sourceRoot":"","sources":["../src/datastoreSupport.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,cAAc,EAGd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAErF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EACX,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"datastoreSupport.d.ts","sourceRoot":"","sources":["../src/datastoreSupport.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,cAAc,EAGd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAErF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EACX,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,8CAA8C,CAAC;AAgCtD;;GAEG;AACH,qBAAa,qBAAqB,CAAC,IAAI,SAAS,MAAM,CAAE,YAAW,sBAAsB;aAMvE,IAAI,EAAE,IAAI;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAN9B,IAAW,sBAAsB,IAAI,sBAAsB,CAE1D;gBAGgB,IAAI,EAAE,IAAI,EACT,YAAY,EAAE,KAAK,OAAO,EAAE,qBAAqB,KAAK,mBAAmB;IAG9E,oBAAoB,CAChC,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,qBAAqB,CAAC;CAiBjC;AAED;;;GAGG;AACH,8BAAsB,mBAAoB,YAAW,WAAW,EAAE,cAAc;IAC5D,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,qBAAqB;gBAA9B,OAAO,EAAE,qBAAqB;IAEpE,IAAW,cAAc,IAAI,IAAI,CAEhC;IAED;;OAEG;IACH,IAAW,MAAM,IAAI,oBAAoB,CAAC,WAAW,CAAC,CAMrD;CACD"}
|
package/lib/datastoreSupport.js
CHANGED
|
@@ -6,8 +6,9 @@ import { assert } from "@fluidframework/core-utils/internal";
|
|
|
6
6
|
import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal";
|
|
7
7
|
import { create404Response } from "@fluidframework/runtime-utils/internal";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* the entrypoint Fluid object that is expected to be a
|
|
9
|
+
* `BasicFluidDataStoreRuntime` extends the FluidDataStoreRuntime to provide a request
|
|
10
|
+
* method that routes requests to the entrypoint Fluid object that is expected to be a
|
|
11
|
+
* {@link LoadableFluidObject}.
|
|
11
12
|
*/
|
|
12
13
|
class BasicFluidDataStoreRuntime extends FluidDataStoreRuntime {
|
|
13
14
|
async request(request) {
|
|
@@ -30,7 +31,7 @@ class BasicFluidDataStoreRuntime extends FluidDataStoreRuntime {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
|
-
* @
|
|
34
|
+
* `BasicDataStoreFactory` is the factory for creating a {@link BasicFluidDataStoreRuntime}.
|
|
34
35
|
*/
|
|
35
36
|
export class BasicDataStoreFactory {
|
|
36
37
|
get IFluidDataStoreFactory() {
|
|
@@ -54,7 +55,8 @@ export class BasicDataStoreFactory {
|
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
/**
|
|
57
|
-
* @
|
|
58
|
+
* `LoadableFluidObject` is helper to build a DataObject handling the {@link FluidObject}
|
|
59
|
+
* and {@link IFluidLoadable} requirements.
|
|
58
60
|
*/
|
|
59
61
|
export class LoadableFluidObject {
|
|
60
62
|
constructor(runtime) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastoreSupport.js","sourceRoot":"","sources":["../src/datastoreSupport.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"datastoreSupport.js","sourceRoot":"","sources":["../src/datastoreSupport.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAK3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E;;;;GAIG;AACH,MAAM,0BAA2B,SAAQ,qBAAqB;IAC7C,KAAK,CAAC,OAAO,CAAC,OAAiB;QAC9C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC7B,OAAO,QAAQ,CAAC;QACjB,CAAC;QACD,4DAA4D;QAC5D,4CAA4C;QAC5C,gCAAgC;QAChC,gCAAgC;QAChC,IAAI,OAAO,CAAC,GAAG,KAAK,EAAE,IAAI,OAAO,CAAC,GAAG,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/E,qEAAqE;YACrE,mDAAmD;YACnD,MAAM,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,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;IAChC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * This module provided collection of minimal (slim) helpers to support\n * DataObject creation for temporary {@link ExperimentalPresenceManager}.\n */\n\nimport type {\n\tFluidObject,\n\tIFluidLoadable,\n\tIRequest,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\nimport type { IFluidHandleInternal } from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { FluidDataStoreRuntime } from \"@fluidframework/datastore/internal\";\nimport type {\n\tIFluidDataStoreContext,\n\tIFluidDataStoreFactory,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { create404Response } from \"@fluidframework/runtime-utils/internal\";\n\n/**\n * `BasicFluidDataStoreRuntime` extends the FluidDataStoreRuntime to provide a request\n * method that routes requests to the entrypoint Fluid object that is expected to be a\n * {@link LoadableFluidObject}.\n */\nclass BasicFluidDataStoreRuntime extends FluidDataStoreRuntime {\n\tpublic override async request(request: IRequest): Promise<IResponse> {\n\t\tconst response = await super.request(request);\n\t\tif (response.status !== 404) {\n\t\t\treturn response;\n\t\t}\n\t\t// Return entrypoint object if someone requests it directly.\n\t\t// Direct requests exist from two scenarios:\n\t\t// 1. the request url is a \"/\"\n\t\t// 2. the request url is empty\n\t\tif (request.url === \"\" || request.url === \"/\" || request.url.startsWith(\"/?\")) {\n\t\t\t// The provideEntryPoint callback below always returns an instance of\n\t\t\t// LoadableFluidObject. Make sure that is the case.\n\t\t\tconst dataObject = await this.entryPoint.get();\n\t\t\tassert(\n\t\t\t\tdataObject instanceof LoadableFluidObject,\n\t\t\t\t0xa36 /* Data store runtime entryPoint is not expected type */,\n\t\t\t);\n\t\t\treturn { mimeType: \"fluid/object\", status: 200, value: dataObject };\n\t\t}\n\t\treturn create404Response(request);\n\t}\n}\n\n/**\n * `BasicDataStoreFactory` is the factory for creating a {@link BasicFluidDataStoreRuntime}.\n */\nexport class BasicDataStoreFactory<Type extends string> implements IFluidDataStoreFactory {\n\tpublic get IFluidDataStoreFactory(): IFluidDataStoreFactory {\n\t\treturn this;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly type: Type,\n\t\tprivate readonly instanceCtor: new (runtime: FluidDataStoreRuntime) => LoadableFluidObject,\n\t) {}\n\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<FluidDataStoreRuntime> {\n\t\t// Create a new runtime for our data store.\n\t\t// The runtime is what Fluid uses to route to our data store.\n\t\tconst runtime: FluidDataStoreRuntime = new BasicFluidDataStoreRuntime(\n\t\t\tcontext,\n\t\t\t/* ISharedObjectRegistry */ new Map(),\n\t\t\texisting,\n\t\t\t/* provideEntryPoint */ async () => {\n\t\t\t\tassert(instance !== undefined, 0xa37 /* Intended entryPoint is undefined */);\n\t\t\t\treturn instance;\n\t\t\t},\n\t\t);\n\n\t\tconst instance = new this.instanceCtor(runtime);\n\n\t\treturn runtime;\n\t}\n}\n\n/**\n * `LoadableFluidObject` is helper to build a DataObject handling the {@link FluidObject}\n * and {@link IFluidLoadable} requirements.\n */\nexport abstract class LoadableFluidObject implements FluidObject, IFluidLoadable {\n\tpublic constructor(protected readonly runtime: FluidDataStoreRuntime) {}\n\n\tpublic get IFluidLoadable(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Handle to the this Fluid object.\n\t */\n\tpublic get handle(): IFluidHandleInternal<FluidObject> {\n\t\t// BasicDataStoreFactory provides an entryPoint initialization function\n\t\t// to the data store runtime; so, this object should always have access to a\n\t\t// non-null entryPoint.\n\t\tassert(this.runtime.entryPoint !== undefined, 0xa38 /* EntryPoint was undefined */);\n\t\treturn this.runtime.entryPoint;\n\t}\n}\n"]}
|