@fluidframework/presence 2.74.0-365691 → 2.74.0-368706
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/dist/alpha.d.ts +1 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/legacy.alpha.d.ts +1 -4
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/alpha.d.ts +1 -4
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.alpha.d.ts +1 -4
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +17 -19
- package/dist/datastorePresenceManagerFactory.d.ts +0 -51
- package/dist/datastorePresenceManagerFactory.d.ts.map +0 -1
- package/dist/datastorePresenceManagerFactory.js +0 -100
- package/dist/datastorePresenceManagerFactory.js.map +0 -1
- package/dist/datastoreSupport.d.ts +0 -36
- package/dist/datastoreSupport.d.ts.map +0 -1
- package/dist/datastoreSupport.js +0 -84
- package/dist/datastoreSupport.js.map +0 -1
- package/lib/datastorePresenceManagerFactory.d.ts +0 -51
- package/lib/datastorePresenceManagerFactory.d.ts.map +0 -1
- package/lib/datastorePresenceManagerFactory.js +0 -96
- package/lib/datastorePresenceManagerFactory.js.map +0 -1
- package/lib/datastoreSupport.d.ts +0 -36
- package/lib/datastoreSupport.d.ts.map +0 -1
- package/lib/datastoreSupport.js +0 -79
- package/lib/datastoreSupport.js.map +0 -1
package/dist/alpha.d.ts
CHANGED
|
@@ -64,8 +64,6 @@ export {
|
|
|
64
64
|
// #endregion
|
|
65
65
|
|
|
66
66
|
// #region @alpha APIs
|
|
67
|
-
ExperimentalPresenceDO,
|
|
68
|
-
ExperimentalPresenceManager,
|
|
69
67
|
InternalUtilityTypes,
|
|
70
68
|
NotificationEmitter,
|
|
71
69
|
NotificationListenable,
|
|
@@ -76,7 +74,6 @@ export {
|
|
|
76
74
|
NotificationsWorkspace,
|
|
77
75
|
NotificationsWorkspaceSchema,
|
|
78
76
|
PresenceWithNotifications,
|
|
79
|
-
getPresenceAlpha
|
|
80
|
-
getPresenceViaDataObject
|
|
77
|
+
getPresenceAlpha
|
|
81
78
|
// #endregion
|
|
82
79
|
} from "./index.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export type { NotificationsWorkspace, NotificationsWorkspaceSchema, StatesWorksp
|
|
|
14
14
|
export { type Attendee, type AttendeesEvents, type AttendeeId, AttendeeStatus, type Presence, type PresenceEvents, type PresenceWithNotifications, } from "./presence.js";
|
|
15
15
|
export type { BroadcastControls, BroadcastControlSettings, } from "./broadcastControls.js";
|
|
16
16
|
export { getPresence, getPresenceAlpha, getPresenceFromDataStoreContext, } from "./getPresence.js";
|
|
17
|
-
export { getPresenceViaDataObject, type ExperimentalPresenceDO, ExperimentalPresenceManager, } from "./datastorePresenceManagerFactory.js";
|
|
18
17
|
export type { LatestMap, LatestMapArguments, LatestMapArgumentsRaw, LatestMapClientData, LatestMapEvents, LatestMapFactory, LatestMapItemRemovedClientData, LatestMapItemUpdatedClientData, LatestMapRaw, LatestMapRawEvents, StateMap, } from "./latestMapValueManager.js";
|
|
19
18
|
export type { Latest, LatestArguments, LatestArgumentsRaw, LatestEvents, LatestFactory, LatestRaw, LatestRawEvents, } from "./latestValueManager.js";
|
|
20
19
|
export type { Accessor, LatestClientData, LatestData, LatestMetadata, ProxiedValueAccessor, RawValueAccessor, StateSchemaValidator, ValueAccessor, } from "./latestValueTypes.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AA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Z,kBAAkB,EAClB,QAAQ,GACR,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACX,MAAM,EACN,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,eAAe,GACf,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GACb,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,GAC/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,16 +4,13 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.StateFactory = exports.Notifications = exports.
|
|
7
|
+
exports.StateFactory = exports.Notifications = exports.getPresenceFromDataStoreContext = exports.getPresenceAlpha = exports.getPresence = exports.AttendeeStatus = void 0;
|
|
8
8
|
var presence_js_1 = require("./presence.js");
|
|
9
9
|
Object.defineProperty(exports, "AttendeeStatus", { enumerable: true, get: function () { return presence_js_1.AttendeeStatus; } });
|
|
10
10
|
var getPresence_js_1 = require("./getPresence.js");
|
|
11
11
|
Object.defineProperty(exports, "getPresence", { enumerable: true, get: function () { return getPresence_js_1.getPresence; } });
|
|
12
12
|
Object.defineProperty(exports, "getPresenceAlpha", { enumerable: true, get: function () { return getPresence_js_1.getPresenceAlpha; } });
|
|
13
13
|
Object.defineProperty(exports, "getPresenceFromDataStoreContext", { enumerable: true, get: function () { return getPresence_js_1.getPresenceFromDataStoreContext; } });
|
|
14
|
-
var datastorePresenceManagerFactory_js_1 = require("./datastorePresenceManagerFactory.js");
|
|
15
|
-
Object.defineProperty(exports, "getPresenceViaDataObject", { enumerable: true, get: function () { return datastorePresenceManagerFactory_js_1.getPresenceViaDataObject; } });
|
|
16
|
-
Object.defineProperty(exports, "ExperimentalPresenceManager", { enumerable: true, get: function () { return datastorePresenceManagerFactory_js_1.ExperimentalPresenceManager; } });
|
|
17
14
|
var notificationsManager_js_1 = require("./notificationsManager.js");
|
|
18
15
|
Object.defineProperty(exports, "Notifications", { enumerable: true, get: function () { return notificationsManager_js_1.Notifications; } });
|
|
19
16
|
var stateFactory_js_1 = require("./stateFactory.js");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAsBH,6CAQuB;AAJtB,6GAAA,cAAc,OAAA;AAWf,mDAI0B;AAHzB,6GAAA,WAAW,OAAA;AACX,kHAAA,gBAAgB,OAAA;AAChB,iIAAA,+BAA+B,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAsBH,6CAQuB;AAJtB,6GAAA,cAAc,OAAA;AAWf,mDAI0B;AAHzB,6GAAA,WAAW,OAAA;AACX,kHAAA,gBAAgB,OAAA;AAChB,iIAAA,+BAA+B,OAAA;AAoChC,qEAOmC;AAHlC,wHAAA,aAAa,OAAA;AAKd,qDAAiD;AAAxC,+GAAA,YAAY,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Package for client presence within a connected session.\n *\n * See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.\n *\n * @packageDocumentation\n */\n\nexport type { ClientConnectionId } from \"./baseTypes.js\";\n\nexport type {\n\tNotificationsWorkspace,\n\tNotificationsWorkspaceSchema,\n\tStatesWorkspace,\n\tStatesWorkspaceEntries,\n\tStatesWorkspaceSchema,\n\tStatesWorkspaceEntry,\n\tWorkspaceAddress,\n} from \"./types.js\";\n\nexport {\n\ttype Attendee,\n\ttype AttendeesEvents,\n\ttype AttendeeId,\n\tAttendeeStatus,\n\ttype Presence,\n\ttype PresenceEvents,\n\ttype PresenceWithNotifications,\n} from \"./presence.js\";\n\nexport type {\n\tBroadcastControls,\n\tBroadcastControlSettings,\n} from \"./broadcastControls.js\";\n\nexport {\n\tgetPresence,\n\tgetPresenceAlpha,\n\tgetPresenceFromDataStoreContext,\n} from \"./getPresence.js\";\n\nexport type {\n\tLatestMap,\n\tLatestMapArguments,\n\tLatestMapArgumentsRaw,\n\tLatestMapClientData,\n\tLatestMapEvents,\n\tLatestMapFactory,\n\tLatestMapItemRemovedClientData,\n\tLatestMapItemUpdatedClientData,\n\tLatestMapRaw,\n\tLatestMapRawEvents,\n\tStateMap,\n} from \"./latestMapValueManager.js\";\nexport type {\n\tLatest,\n\tLatestArguments,\n\tLatestArgumentsRaw,\n\tLatestEvents,\n\tLatestFactory,\n\tLatestRaw,\n\tLatestRawEvents,\n} from \"./latestValueManager.js\";\nexport type {\n\tAccessor,\n\tLatestClientData,\n\tLatestData,\n\tLatestMetadata,\n\tProxiedValueAccessor,\n\tRawValueAccessor,\n\tStateSchemaValidator,\n\tValueAccessor,\n} from \"./latestValueTypes.js\";\n\nexport {\n\ttype NotificationEmitter,\n\ttype NotificationListenable,\n\ttype NotificationSubscriptions,\n\tNotifications,\n\ttype NotificationsManager,\n\ttype NotificationsManagerEvents,\n} from \"./notificationsManager.js\";\n\nexport { StateFactory } from \"./stateFactory.js\";\n\nexport type { InternalTypes } from \"./exposedInternalTypes.js\";\nexport type { InternalUtilityTypes } from \"./exposedUtilityTypes.js\";\n"]}
|
package/dist/legacy.alpha.d.ts
CHANGED
|
@@ -64,8 +64,6 @@ export {
|
|
|
64
64
|
// #endregion
|
|
65
65
|
|
|
66
66
|
// #region @alpha APIs
|
|
67
|
-
ExperimentalPresenceDO,
|
|
68
|
-
ExperimentalPresenceManager,
|
|
69
67
|
InternalUtilityTypes,
|
|
70
68
|
NotificationEmitter,
|
|
71
69
|
NotificationListenable,
|
|
@@ -76,8 +74,7 @@ export {
|
|
|
76
74
|
NotificationsWorkspace,
|
|
77
75
|
NotificationsWorkspaceSchema,
|
|
78
76
|
PresenceWithNotifications,
|
|
79
|
-
getPresenceAlpha,
|
|
80
|
-
getPresenceViaDataObject,
|
|
77
|
+
getPresenceAlpha,
|
|
81
78
|
// #endregion
|
|
82
79
|
|
|
83
80
|
// #region @legacyAlpha APIs
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/presence";
|
|
8
|
-
export declare const pkgVersion = "2.74.0-
|
|
8
|
+
export declare const pkgVersion = "2.74.0-368706";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/presence";
|
|
11
|
-
exports.pkgVersion = "2.74.0-
|
|
11
|
+
exports.pkgVersion = "2.74.0-368706";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,0BAA0B,CAAC;AACrC,QAAA,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/presence\";\nexport const pkgVersion = \"2.74.0-
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,0BAA0B,CAAC;AACrC,QAAA,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/presence\";\nexport const pkgVersion = \"2.74.0-368706\";\n"]}
|
package/lib/alpha.d.ts
CHANGED
|
@@ -64,8 +64,6 @@ export {
|
|
|
64
64
|
// #endregion
|
|
65
65
|
|
|
66
66
|
// #region @alpha APIs
|
|
67
|
-
ExperimentalPresenceDO,
|
|
68
|
-
ExperimentalPresenceManager,
|
|
69
67
|
InternalUtilityTypes,
|
|
70
68
|
NotificationEmitter,
|
|
71
69
|
NotificationListenable,
|
|
@@ -76,7 +74,6 @@ export {
|
|
|
76
74
|
NotificationsWorkspace,
|
|
77
75
|
NotificationsWorkspaceSchema,
|
|
78
76
|
PresenceWithNotifications,
|
|
79
|
-
getPresenceAlpha
|
|
80
|
-
getPresenceViaDataObject
|
|
77
|
+
getPresenceAlpha
|
|
81
78
|
// #endregion
|
|
82
79
|
} from "./index.js";
|
package/lib/index.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export type { NotificationsWorkspace, NotificationsWorkspaceSchema, StatesWorksp
|
|
|
14
14
|
export { type Attendee, type AttendeesEvents, type AttendeeId, AttendeeStatus, type Presence, type PresenceEvents, type PresenceWithNotifications, } from "./presence.js";
|
|
15
15
|
export type { BroadcastControls, BroadcastControlSettings, } from "./broadcastControls.js";
|
|
16
16
|
export { getPresence, getPresenceAlpha, getPresenceFromDataStoreContext, } from "./getPresence.js";
|
|
17
|
-
export { getPresenceViaDataObject, type ExperimentalPresenceDO, ExperimentalPresenceManager, } from "./datastorePresenceManagerFactory.js";
|
|
18
17
|
export type { LatestMap, LatestMapArguments, LatestMapArgumentsRaw, LatestMapClientData, LatestMapEvents, LatestMapFactory, LatestMapItemRemovedClientData, LatestMapItemUpdatedClientData, LatestMapRaw, LatestMapRawEvents, StateMap, } from "./latestMapValueManager.js";
|
|
19
18
|
export type { Latest, LatestArguments, LatestArgumentsRaw, LatestEvents, LatestFactory, LatestRaw, LatestRawEvents, } from "./latestValueManager.js";
|
|
20
19
|
export type { Accessor, LatestClientData, LatestData, LatestMetadata, ProxiedValueAccessor, RawValueAccessor, StateSchemaValidator, ValueAccessor, } from "./latestValueTypes.js";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,YAAY,EACX,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,yBAAyB,GAC9B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,iBAAiB,EACjB,wBAAwB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,WAAW,EACX,gBAAgB,EAChB,+BAA+B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B,
|
|
1
|
+
{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AC;AAEjD,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { AttendeeStatus, } from "./presence.js";
|
|
6
6
|
export { getPresence, getPresenceAlpha, getPresenceFromDataStoreContext, } from "./getPresence.js";
|
|
7
|
-
export { getPresenceViaDataObject, ExperimentalPresenceManager, } from "./datastorePresenceManagerFactory.js";
|
|
8
7
|
export { Notifications, } from "./notificationsManager.js";
|
|
9
8
|
export { StateFactory } from "./stateFactory.js";
|
|
10
9
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,OAAO,EAIN,cAAc,GAId,MAAM,eAAe,CAAC;AAOvB,OAAO,EACN,WAAW,EACX,gBAAgB,EAChB,+BAA+B,GAC/B,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,OAAO,EAIN,cAAc,GAId,MAAM,eAAe,CAAC;AAOvB,OAAO,EACN,WAAW,EACX,gBAAgB,EAChB,+BAA+B,GAC/B,MAAM,kBAAkB,CAAC;AAmC1B,OAAO,EAIN,aAAa,GAGb,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Package for client presence within a connected session.\n *\n * See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.\n *\n * @packageDocumentation\n */\n\nexport type { ClientConnectionId } from \"./baseTypes.js\";\n\nexport type {\n\tNotificationsWorkspace,\n\tNotificationsWorkspaceSchema,\n\tStatesWorkspace,\n\tStatesWorkspaceEntries,\n\tStatesWorkspaceSchema,\n\tStatesWorkspaceEntry,\n\tWorkspaceAddress,\n} from \"./types.js\";\n\nexport {\n\ttype Attendee,\n\ttype AttendeesEvents,\n\ttype AttendeeId,\n\tAttendeeStatus,\n\ttype Presence,\n\ttype PresenceEvents,\n\ttype PresenceWithNotifications,\n} from \"./presence.js\";\n\nexport type {\n\tBroadcastControls,\n\tBroadcastControlSettings,\n} from \"./broadcastControls.js\";\n\nexport {\n\tgetPresence,\n\tgetPresenceAlpha,\n\tgetPresenceFromDataStoreContext,\n} from \"./getPresence.js\";\n\nexport type {\n\tLatestMap,\n\tLatestMapArguments,\n\tLatestMapArgumentsRaw,\n\tLatestMapClientData,\n\tLatestMapEvents,\n\tLatestMapFactory,\n\tLatestMapItemRemovedClientData,\n\tLatestMapItemUpdatedClientData,\n\tLatestMapRaw,\n\tLatestMapRawEvents,\n\tStateMap,\n} from \"./latestMapValueManager.js\";\nexport type {\n\tLatest,\n\tLatestArguments,\n\tLatestArgumentsRaw,\n\tLatestEvents,\n\tLatestFactory,\n\tLatestRaw,\n\tLatestRawEvents,\n} from \"./latestValueManager.js\";\nexport type {\n\tAccessor,\n\tLatestClientData,\n\tLatestData,\n\tLatestMetadata,\n\tProxiedValueAccessor,\n\tRawValueAccessor,\n\tStateSchemaValidator,\n\tValueAccessor,\n} from \"./latestValueTypes.js\";\n\nexport {\n\ttype NotificationEmitter,\n\ttype NotificationListenable,\n\ttype NotificationSubscriptions,\n\tNotifications,\n\ttype NotificationsManager,\n\ttype NotificationsManagerEvents,\n} from \"./notificationsManager.js\";\n\nexport { StateFactory } from \"./stateFactory.js\";\n\nexport type { InternalTypes } from \"./exposedInternalTypes.js\";\nexport type { InternalUtilityTypes } from \"./exposedUtilityTypes.js\";\n"]}
|
package/lib/legacy.alpha.d.ts
CHANGED
|
@@ -64,8 +64,6 @@ export {
|
|
|
64
64
|
// #endregion
|
|
65
65
|
|
|
66
66
|
// #region @alpha APIs
|
|
67
|
-
ExperimentalPresenceDO,
|
|
68
|
-
ExperimentalPresenceManager,
|
|
69
67
|
InternalUtilityTypes,
|
|
70
68
|
NotificationEmitter,
|
|
71
69
|
NotificationListenable,
|
|
@@ -76,8 +74,7 @@ export {
|
|
|
76
74
|
NotificationsWorkspace,
|
|
77
75
|
NotificationsWorkspaceSchema,
|
|
78
76
|
PresenceWithNotifications,
|
|
79
|
-
getPresenceAlpha,
|
|
80
|
-
getPresenceViaDataObject,
|
|
77
|
+
getPresenceAlpha,
|
|
81
78
|
// #endregion
|
|
82
79
|
|
|
83
80
|
// #region @legacyAlpha APIs
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/presence";
|
|
8
|
-
export declare const pkgVersion = "2.74.0-
|
|
8
|
+
export declare const pkgVersion = "2.74.0-368706";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,0BAA0B,CAAC;AAClD,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/presence\";\nexport const pkgVersion = \"2.74.0-
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,0BAA0B,CAAC;AAClD,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/presence\";\nexport const pkgVersion = \"2.74.0-368706\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/presence",
|
|
3
|
-
"version": "2.74.0-
|
|
3
|
+
"version": "2.74.0-368706",
|
|
4
4
|
"description": "A component for lightweight data sharing within a single session",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -73,31 +73,29 @@
|
|
|
73
73
|
"temp-directory": "nyc/.nyc_output"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@fluid-internal/client-utils": "2.74.0-
|
|
77
|
-
"@fluidframework/container-definitions": "2.74.0-
|
|
78
|
-
"@fluidframework/container-runtime-definitions": "2.74.0-
|
|
79
|
-
"@fluidframework/core-interfaces": "2.74.0-
|
|
80
|
-
"@fluidframework/core-utils": "2.74.0-
|
|
81
|
-
"@fluidframework/datastore": "2.74.0-
|
|
82
|
-
"@fluidframework/datastore-definitions": "2.74.0-
|
|
83
|
-
"@fluidframework/fluid-static": "2.74.0-
|
|
84
|
-
"@fluidframework/id-compressor": "2.74.0-
|
|
85
|
-
"@fluidframework/runtime-definitions": "2.74.0-
|
|
86
|
-
"@fluidframework/
|
|
87
|
-
"@fluidframework/shared-object-base": "2.74.0-365691",
|
|
88
|
-
"@fluidframework/telemetry-utils": "2.74.0-365691"
|
|
76
|
+
"@fluid-internal/client-utils": "2.74.0-368706",
|
|
77
|
+
"@fluidframework/container-definitions": "2.74.0-368706",
|
|
78
|
+
"@fluidframework/container-runtime-definitions": "2.74.0-368706",
|
|
79
|
+
"@fluidframework/core-interfaces": "2.74.0-368706",
|
|
80
|
+
"@fluidframework/core-utils": "2.74.0-368706",
|
|
81
|
+
"@fluidframework/datastore": "2.74.0-368706",
|
|
82
|
+
"@fluidframework/datastore-definitions": "2.74.0-368706",
|
|
83
|
+
"@fluidframework/fluid-static": "2.74.0-368706",
|
|
84
|
+
"@fluidframework/id-compressor": "2.74.0-368706",
|
|
85
|
+
"@fluidframework/runtime-definitions": "2.74.0-368706",
|
|
86
|
+
"@fluidframework/telemetry-utils": "2.74.0-368706"
|
|
89
87
|
},
|
|
90
88
|
"devDependencies": {
|
|
91
89
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
92
90
|
"@biomejs/biome": "~1.9.3",
|
|
93
|
-
"@fluid-internal/mocha-test-setup": "2.74.0-
|
|
91
|
+
"@fluid-internal/mocha-test-setup": "2.74.0-368706",
|
|
94
92
|
"@fluid-tools/build-cli": "^0.60.0",
|
|
95
93
|
"@fluidframework/build-common": "^2.0.3",
|
|
96
94
|
"@fluidframework/build-tools": "^0.60.0",
|
|
97
|
-
"@fluidframework/driver-definitions": "2.74.0-
|
|
98
|
-
"@fluidframework/eslint-config-fluid": "2.74.0-
|
|
99
|
-
"@fluidframework/test-runtime-utils": "2.74.0-
|
|
100
|
-
"@fluidframework/test-utils": "2.74.0-
|
|
95
|
+
"@fluidframework/driver-definitions": "2.74.0-368706",
|
|
96
|
+
"@fluidframework/eslint-config-fluid": "2.74.0-368706",
|
|
97
|
+
"@fluidframework/test-runtime-utils": "2.74.0-368706",
|
|
98
|
+
"@fluidframework/test-utils": "2.74.0-368706",
|
|
101
99
|
"@microsoft/api-extractor": "7.52.11",
|
|
102
100
|
"@types/mocha": "^10.0.10",
|
|
103
101
|
"@types/node": "^18.19.0",
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
6
|
-
import type { SharedObjectKind } from "@fluidframework/shared-object-base";
|
|
7
|
-
import type { PresenceWithNotifications as Presence } from "./presence.js";
|
|
8
|
-
/**
|
|
9
|
-
* Brand for Experimental Presence Data Object.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* See {@link getPresenceViaDataObject} for example usage.
|
|
13
|
-
*
|
|
14
|
-
* @deprecated Use {@link getPresence} instead.
|
|
15
|
-
* @sealed
|
|
16
|
-
* @alpha
|
|
17
|
-
*/
|
|
18
|
-
export declare class ExperimentalPresenceDO {
|
|
19
|
-
private readonly _self;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* DataStore based Presence Manager that is used as fallback for preferred Container
|
|
23
|
-
* Extension based version requires registration. Export SharedObjectKind for registration.
|
|
24
|
-
*
|
|
25
|
-
* @deprecated Use {@link getPresence} instead.
|
|
26
|
-
* @alpha
|
|
27
|
-
*/
|
|
28
|
-
export declare const ExperimentalPresenceManager: SharedObjectKind<IFluidLoadable & ExperimentalPresenceDO>;
|
|
29
|
-
/**
|
|
30
|
-
* Acquire Presence from a DataStore based Presence Manager
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const containerSchema = {
|
|
35
|
-
* initialObjects: {
|
|
36
|
-
* experimentalPresence: ExperimentalPresenceDO,
|
|
37
|
-
* },
|
|
38
|
-
* } satisfies ContainerSchema;
|
|
39
|
-
* ```
|
|
40
|
-
* then
|
|
41
|
-
* ```typescript
|
|
42
|
-
* const presence = getPresenceViaDataObject(
|
|
43
|
-
* container.initialObjects.experimentalPresence,
|
|
44
|
-
* );
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @deprecated Use {@link getPresence} instead.
|
|
48
|
-
* @alpha
|
|
49
|
-
*/
|
|
50
|
-
export declare function getPresenceViaDataObject(fluidLoadable: ExperimentalPresenceDO): Presence;
|
|
51
|
-
//# sourceMappingURL=datastorePresenceManagerFactory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAqE3E;;;;;;;;;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"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getPresenceViaDataObject = exports.ExperimentalPresenceManager = void 0;
|
|
8
|
-
/*
|
|
9
|
-
* Hacky support for internal datastore based usages.
|
|
10
|
-
*/
|
|
11
|
-
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
12
|
-
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
13
|
-
const datastoreSupport_js_1 = require("./datastoreSupport.js");
|
|
14
|
-
const presenceManager_js_1 = require("./presenceManager.js");
|
|
15
|
-
/**
|
|
16
|
-
* This provides faux validation of the signal message.
|
|
17
|
-
*/
|
|
18
|
-
function assertSignalMessageIsValid(message) {
|
|
19
|
-
(0, internal_1.assert)(message.clientId !== null, 0xa58 /* Signal must have a client ID */);
|
|
20
|
-
// The other difference between messages is that `content` for
|
|
21
|
-
// RawInboundExtensionMessage is JsonDeserialized and we are fine assuming that.
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Simple FluidObject holding Presence Manager.
|
|
25
|
-
*/
|
|
26
|
-
class PresenceManagerDataObject extends datastoreSupport_js_1.LoadableFluidObject {
|
|
27
|
-
presenceManager() {
|
|
28
|
-
if (!this._presenceManager) {
|
|
29
|
-
// TODO: investigate if ContainerExtensionStore (path-based address routing for
|
|
30
|
-
// Signals) is readily detectable here and use that presence manager directly.
|
|
31
|
-
const runtime = this.runtime;
|
|
32
|
-
const events = (0, client_utils_1.createEmitter)();
|
|
33
|
-
runtime.on("connected", (clientId) => events.emit("joined", { clientId, canWrite: true }));
|
|
34
|
-
runtime.on("disconnected", () => events.emit("disconnected"));
|
|
35
|
-
const manager = (0, presenceManager_js_1.createPresenceManager)({
|
|
36
|
-
getJoinedStatus: () => (runtime.connected ? "joinedForWriting" : "disconnected"),
|
|
37
|
-
getClientId: () => runtime.clientId,
|
|
38
|
-
events,
|
|
39
|
-
getQuorum: runtime.getQuorum.bind(runtime),
|
|
40
|
-
getAudience: runtime.getAudience.bind(runtime),
|
|
41
|
-
submitSignal: (message) => runtime.submitSignal(message.type, message.content, message.targetClientId),
|
|
42
|
-
supportedFeatures: new Set() /* We do not implement feature detection here since this is a deprecated path */,
|
|
43
|
-
});
|
|
44
|
-
this.runtime.on("signal", (message, local) => {
|
|
45
|
-
assertSignalMessageIsValid(message);
|
|
46
|
-
manager.processSignal([], message, local);
|
|
47
|
-
});
|
|
48
|
-
this._presenceManager = manager;
|
|
49
|
-
}
|
|
50
|
-
return this._presenceManager;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Factory class to create {@link Presence} in own data store.
|
|
55
|
-
*/
|
|
56
|
-
class PresenceManagerFactory {
|
|
57
|
-
constructor() {
|
|
58
|
-
this.factory = new datastoreSupport_js_1.BasicDataStoreFactory("@fluidframework/presence", PresenceManagerDataObject);
|
|
59
|
-
}
|
|
60
|
-
is(value) {
|
|
61
|
-
return value instanceof PresenceManagerDataObject;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* DataStore based Presence Manager that is used as fallback for preferred Container
|
|
66
|
-
* Extension based version requires registration. Export SharedObjectKind for registration.
|
|
67
|
-
*
|
|
68
|
-
* @deprecated Use {@link getPresence} instead.
|
|
69
|
-
* @alpha
|
|
70
|
-
*/
|
|
71
|
-
exports.ExperimentalPresenceManager = new PresenceManagerFactory();
|
|
72
|
-
/**
|
|
73
|
-
* Acquire Presence from a DataStore based Presence Manager
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* ```typescript
|
|
77
|
-
* const containerSchema = {
|
|
78
|
-
* initialObjects: {
|
|
79
|
-
* experimentalPresence: ExperimentalPresenceDO,
|
|
80
|
-
* },
|
|
81
|
-
* } satisfies ContainerSchema;
|
|
82
|
-
* ```
|
|
83
|
-
* then
|
|
84
|
-
* ```typescript
|
|
85
|
-
* const presence = getPresenceViaDataObject(
|
|
86
|
-
* container.initialObjects.experimentalPresence,
|
|
87
|
-
* );
|
|
88
|
-
* ```
|
|
89
|
-
*
|
|
90
|
-
* @deprecated Use {@link getPresence} instead.
|
|
91
|
-
* @alpha
|
|
92
|
-
*/
|
|
93
|
-
function getPresenceViaDataObject(fluidLoadable) {
|
|
94
|
-
if (fluidLoadable instanceof PresenceManagerDataObject) {
|
|
95
|
-
return fluidLoadable.presenceManager();
|
|
96
|
-
}
|
|
97
|
-
throw new Error("Incompatible loadable; make sure to use ExperimentalPresenceManager");
|
|
98
|
-
}
|
|
99
|
-
exports.getPresenceViaDataObject = getPresenceViaDataObject;
|
|
100
|
-
//# sourceMappingURL=datastorePresen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AAC;gBAC1C,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC9C,YAAY,EAAE,CAAC,OAAgC,EAAE,EAAE,CAClD,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC;gBAC5E,iBAAiB,EAChB,IAAI,GAAG,EAAE,CAAC,gFAAgF;aAC3F,CAAC,CAAC;YACH,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,OAA8B,EAAE,KAAc,EAAE,EAAE;gBAC5E,0BAA0B,CAAC,OAAO,CAAC,CAAC;gBACpC,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC;QACjC,CAAC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC9B,CAAC;CACD;AAED;;GAEG;AACH,MAAM,sBAAsB;IAA5B;QAKiB,YAAO,GAAG,IAAI,2CAAqB,CAClD,0BAA0B,EAC1B,yBAAyB,CACzB,CAAC;IACH,CAAC;IARO,EAAE,CAAC,KAA8C;QACvD,OAAO,KAAK,YAAY,yBAAyB,CAAC;IACnD,CAAC;CAMD;AAgBD;;;;;;GAMG;AACU,QAAA,2BAA2B,GACvC,IAAI,sBAAsB,EAEzB,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,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;AAND,4DAMC","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) =>\n\t\t\t\tevents.emit(\"joined\", { clientId, canWrite: true }),\n\t\t\t);\n\t\t\truntime.on(\"disconnected\", () => events.emit(\"disconnected\"));\n\n\t\t\tconst manager = createPresenceManager({\n\t\t\t\tgetJoinedStatus: () => (runtime.connected ? \"joinedForWriting\" : \"disconnected\"),\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"]}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* This module provided collection of minimal (slim) helpers to support
|
|
7
|
-
* DataObject creation for temporary {@link ExperimentalPresenceManager}.
|
|
8
|
-
*/
|
|
9
|
-
import type { FluidObject, IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
10
|
-
import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
|
|
11
|
-
import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal";
|
|
12
|
-
import type { IFluidDataStoreContext, IFluidDataStoreFactory } from "@fluidframework/runtime-definitions/internal";
|
|
13
|
-
/**
|
|
14
|
-
* `BasicDataStoreFactory` is the factory for creating a {@link BasicFluidDataStoreRuntime}.
|
|
15
|
-
*/
|
|
16
|
-
export declare class BasicDataStoreFactory<Type extends string> implements IFluidDataStoreFactory {
|
|
17
|
-
readonly type: Type;
|
|
18
|
-
private readonly instanceCtor;
|
|
19
|
-
get IFluidDataStoreFactory(): IFluidDataStoreFactory;
|
|
20
|
-
constructor(type: Type, instanceCtor: new (runtime: FluidDataStoreRuntime) => LoadableFluidObject);
|
|
21
|
-
instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<FluidDataStoreRuntime>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* `LoadableFluidObject` is helper to build a DataObject handling the {@link FluidObject}
|
|
25
|
-
* and {@link IFluidLoadable} requirements.
|
|
26
|
-
*/
|
|
27
|
-
export declare abstract class LoadableFluidObject implements FluidObject, IFluidLoadable {
|
|
28
|
-
protected readonly runtime: FluidDataStoreRuntime;
|
|
29
|
-
constructor(runtime: FluidDataStoreRuntime);
|
|
30
|
-
get IFluidLoadable(): this;
|
|
31
|
-
/**
|
|
32
|
-
* Handle to the this Fluid object.
|
|
33
|
-
*/
|
|
34
|
-
get handle(): IFluidHandleInternal<FluidObject>;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=datastoreSupport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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/dist/datastoreSupport.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.LoadableFluidObject = exports.BasicDataStoreFactory = void 0;
|
|
8
|
-
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
|
-
const internal_2 = require("@fluidframework/datastore/internal");
|
|
10
|
-
const internal_3 = require("@fluidframework/runtime-utils/internal");
|
|
11
|
-
/**
|
|
12
|
-
* `BasicFluidDataStoreRuntime` extends the FluidDataStoreRuntime to provide a request
|
|
13
|
-
* method that routes requests to the entrypoint Fluid object that is expected to be a
|
|
14
|
-
* {@link LoadableFluidObject}.
|
|
15
|
-
*/
|
|
16
|
-
class BasicFluidDataStoreRuntime extends internal_2.FluidDataStoreRuntime {
|
|
17
|
-
async request(request) {
|
|
18
|
-
const response = await super.request(request);
|
|
19
|
-
if (response.status !== 404) {
|
|
20
|
-
return response;
|
|
21
|
-
}
|
|
22
|
-
// Return entrypoint object if someone requests it directly.
|
|
23
|
-
// Direct requests exist from two scenarios:
|
|
24
|
-
// 1. the request url is a "/"
|
|
25
|
-
// 2. the request url is empty
|
|
26
|
-
if (request.url === "" || request.url === "/" || request.url.startsWith("/?")) {
|
|
27
|
-
// The provideEntryPoint callback below always returns an instance of
|
|
28
|
-
// LoadableFluidObject. Make sure that is the case.
|
|
29
|
-
const dataObject = await this.entryPoint.get();
|
|
30
|
-
(0, internal_1.assert)(dataObject instanceof LoadableFluidObject, 0xa36 /* Data store runtime entryPoint is not expected type */);
|
|
31
|
-
return { mimeType: "fluid/object", status: 200, value: dataObject };
|
|
32
|
-
}
|
|
33
|
-
return (0, internal_3.create404Response)(request);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* `BasicDataStoreFactory` is the factory for creating a {@link BasicFluidDataStoreRuntime}.
|
|
38
|
-
*/
|
|
39
|
-
class BasicDataStoreFactory {
|
|
40
|
-
get IFluidDataStoreFactory() {
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
constructor(type, instanceCtor) {
|
|
44
|
-
this.type = type;
|
|
45
|
-
this.instanceCtor = instanceCtor;
|
|
46
|
-
}
|
|
47
|
-
async instantiateDataStore(context, existing) {
|
|
48
|
-
// Create a new runtime for our data store.
|
|
49
|
-
// The runtime is what Fluid uses to route to our data store.
|
|
50
|
-
const runtime = new BasicFluidDataStoreRuntime(context,
|
|
51
|
-
/* ISharedObjectRegistry */ new Map(), existing,
|
|
52
|
-
/* provideEntryPoint */ async () => {
|
|
53
|
-
(0, internal_1.assert)(instance !== undefined, 0xa37 /* Intended entryPoint is undefined */);
|
|
54
|
-
return instance;
|
|
55
|
-
});
|
|
56
|
-
const instance = new this.instanceCtor(runtime);
|
|
57
|
-
return runtime;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.BasicDataStoreFactory = BasicDataStoreFactory;
|
|
61
|
-
/**
|
|
62
|
-
* `LoadableFluidObject` is helper to build a DataObject handling the {@link FluidObject}
|
|
63
|
-
* and {@link IFluidLoadable} requirements.
|
|
64
|
-
*/
|
|
65
|
-
class LoadableFluidObject {
|
|
66
|
-
constructor(runtime) {
|
|
67
|
-
this.runtime = runtime;
|
|
68
|
-
}
|
|
69
|
-
get IFluidLoadable() {
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Handle to the this Fluid object.
|
|
74
|
-
*/
|
|
75
|
-
get handle() {
|
|
76
|
-
// BasicDataStoreFactory provides an entryPoint initialization function
|
|
77
|
-
// to the data store runtime; so, this object should always have access to a
|
|
78
|
-
// non-null entryPoint.
|
|
79
|
-
(0, internal_1.assert)(this.runtime.entryPoint !== undefined, 0xa38 /* EntryPoint was undefined */);
|
|
80
|
-
return this.runtime.entryPoint;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.LoadableFluidObject = LoadableFluidObject;
|
|
84
|
-
//# sourceMappingURL=datastoreSupport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datastoreSupport.js","sourceRoot":"","sources":["../src/datastoreSupport.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH,kEAA6D;AAC7D,iEAA2E;AAK3E,qEAA2E;AAE3E;;;;GAIG;AACH,MAAM,0BAA2B,SAAQ,gCAAqB;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,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;YAC/C,IAAA,iBAAM,EACL,UAAU,YAAY,mBAAmB,EACzC,KAAK,CAAC,wDAAwD,CAC9D,CAAC;YACF,OAAO,EAAE,QAAQ,EAAE,cAAc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","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"]}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
6
|
-
import type { SharedObjectKind } from "@fluidframework/shared-object-base";
|
|
7
|
-
import type { PresenceWithNotifications as Presence } from "./presence.js";
|
|
8
|
-
/**
|
|
9
|
-
* Brand for Experimental Presence Data Object.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* See {@link getPresenceViaDataObject} for example usage.
|
|
13
|
-
*
|
|
14
|
-
* @deprecated Use {@link getPresence} instead.
|
|
15
|
-
* @sealed
|
|
16
|
-
* @alpha
|
|
17
|
-
*/
|
|
18
|
-
export declare class ExperimentalPresenceDO {
|
|
19
|
-
private readonly _self;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* DataStore based Presence Manager that is used as fallback for preferred Container
|
|
23
|
-
* Extension based version requires registration. Export SharedObjectKind for registration.
|
|
24
|
-
*
|
|
25
|
-
* @deprecated Use {@link getPresence} instead.
|
|
26
|
-
* @alpha
|
|
27
|
-
*/
|
|
28
|
-
export declare const ExperimentalPresenceManager: SharedObjectKind<IFluidLoadable & ExperimentalPresenceDO>;
|
|
29
|
-
/**
|
|
30
|
-
* Acquire Presence from a DataStore based Presence Manager
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const containerSchema = {
|
|
35
|
-
* initialObjects: {
|
|
36
|
-
* experimentalPresence: ExperimentalPresenceDO,
|
|
37
|
-
* },
|
|
38
|
-
* } satisfies ContainerSchema;
|
|
39
|
-
* ```
|
|
40
|
-
* then
|
|
41
|
-
* ```typescript
|
|
42
|
-
* const presence = getPresenceViaDataObject(
|
|
43
|
-
* container.initialObjects.experimentalPresence,
|
|
44
|
-
* );
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @deprecated Use {@link getPresence} instead.
|
|
48
|
-
* @alpha
|
|
49
|
-
*/
|
|
50
|
-
export declare function getPresenceViaDataObject(fluidLoadable: ExperimentalPresenceDO): Presence;
|
|
51
|
-
//# sourceMappingURL=datastorePresenceManagerFactory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAqE3E;;;;;;;;;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"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/*
|
|
6
|
-
* Hacky support for internal datastore based usages.
|
|
7
|
-
*/
|
|
8
|
-
import { createEmitter } from "@fluid-internal/client-utils";
|
|
9
|
-
import { assert } from "@fluidframework/core-utils/internal";
|
|
10
|
-
import { BasicDataStoreFactory, LoadableFluidObject } from "./datastoreSupport.js";
|
|
11
|
-
import { createPresenceManager } from "./presenceManager.js";
|
|
12
|
-
/**
|
|
13
|
-
* This provides faux validation of the signal message.
|
|
14
|
-
*/
|
|
15
|
-
function assertSignalMessageIsValid(message) {
|
|
16
|
-
assert(message.clientId !== null, 0xa58 /* Signal must have a client ID */);
|
|
17
|
-
// The other difference between messages is that `content` for
|
|
18
|
-
// RawInboundExtensionMessage is JsonDeserialized and we are fine assuming that.
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Simple FluidObject holding Presence Manager.
|
|
22
|
-
*/
|
|
23
|
-
class PresenceManagerDataObject extends LoadableFluidObject {
|
|
24
|
-
presenceManager() {
|
|
25
|
-
if (!this._presenceManager) {
|
|
26
|
-
// TODO: investigate if ContainerExtensionStore (path-based address routing for
|
|
27
|
-
// Signals) is readily detectable here and use that presence manager directly.
|
|
28
|
-
const runtime = this.runtime;
|
|
29
|
-
const events = createEmitter();
|
|
30
|
-
runtime.on("connected", (clientId) => events.emit("joined", { clientId, canWrite: true }));
|
|
31
|
-
runtime.on("disconnected", () => events.emit("disconnected"));
|
|
32
|
-
const manager = createPresenceManager({
|
|
33
|
-
getJoinedStatus: () => (runtime.connected ? "joinedForWriting" : "disconnected"),
|
|
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
|
-
});
|
|
41
|
-
this.runtime.on("signal", (message, local) => {
|
|
42
|
-
assertSignalMessageIsValid(message);
|
|
43
|
-
manager.processSignal([], message, local);
|
|
44
|
-
});
|
|
45
|
-
this._presenceManager = manager;
|
|
46
|
-
}
|
|
47
|
-
return this._presenceManager;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Factory class to create {@link Presence} in own data store.
|
|
52
|
-
*/
|
|
53
|
-
class PresenceManagerFactory {
|
|
54
|
-
constructor() {
|
|
55
|
-
this.factory = new BasicDataStoreFactory("@fluidframework/presence", PresenceManagerDataObject);
|
|
56
|
-
}
|
|
57
|
-
is(value) {
|
|
58
|
-
return value instanceof PresenceManagerDataObject;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* DataStore based Presence Manager that is used as fallback for preferred Container
|
|
63
|
-
* Extension based version requires registration. Export SharedObjectKind for registration.
|
|
64
|
-
*
|
|
65
|
-
* @deprecated Use {@link getPresence} instead.
|
|
66
|
-
* @alpha
|
|
67
|
-
*/
|
|
68
|
-
export const ExperimentalPresenceManager = new PresenceManagerFactory();
|
|
69
|
-
/**
|
|
70
|
-
* Acquire Presence from a DataStore based Presence Manager
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* ```typescript
|
|
74
|
-
* const containerSchema = {
|
|
75
|
-
* initialObjects: {
|
|
76
|
-
* experimentalPresence: ExperimentalPresenceDO,
|
|
77
|
-
* },
|
|
78
|
-
* } satisfies ContainerSchema;
|
|
79
|
-
* ```
|
|
80
|
-
* then
|
|
81
|
-
* ```typescript
|
|
82
|
-
* const presence = getPresenceViaDataObject(
|
|
83
|
-
* container.initialObjects.experimentalPresence,
|
|
84
|
-
* );
|
|
85
|
-
* ```
|
|
86
|
-
*
|
|
87
|
-
* @deprecated Use {@link getPresence} instead.
|
|
88
|
-
* @alpha
|
|
89
|
-
*/
|
|
90
|
-
export function getPresenceViaDataObject(fluidLoadable) {
|
|
91
|
-
if (fluidLoadable instanceof PresenceManagerDataObject) {
|
|
92
|
-
return fluidLoadable.presenceManager();
|
|
93
|
-
}
|
|
94
|
-
throw new Error("Incompatible loadable; make sure to use ExperimentalPresenceManager");
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=datastorePresenceManagerFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,qBA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,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC;gBAC5E,iBAAiB,EAChB,IAAI,GAAG,EAAE,CAAC,gFAAgF;aAC3F,CAAC,CAAC;YACH,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,OAA8B,EAAE,KAAc,EAAE,EAAE;gBAC5E,0BAA0B,CAAC,OAAO,CAAC,CAAC;gBACpC,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC;QACjC,CAAC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC9B,CAAC;CACD;AAED;;GAEG;AACH,MAAM,sBAAsB;IAA5B;QAKiB,YAAO,GAAG,IAAI,qBAAqB,CAClD,0BAA0B,EAC1B,yBAAyB,CACzB,CAAC;IACH,CAAC;IARO,EAAE,CAAC,KAA8C;QACvD,OAAO,KAAK,YAAY,yBAAyB,CAAC;IACnD,CAAC;CAMD;AAgBD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,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) =>\n\t\t\t\tevents.emit(\"joined\", { clientId, canWrite: true }),\n\t\t\t);\n\t\t\truntime.on(\"disconnected\", () => events.emit(\"disconnected\"));\n\n\t\t\tconst manager = createPresenceManager({\n\t\t\t\tgetJoinedStatus: () => (runtime.connected ? \"joinedForWriting\" : \"disconnected\"),\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"]}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* This module provided collection of minimal (slim) helpers to support
|
|
7
|
-
* DataObject creation for temporary {@link ExperimentalPresenceManager}.
|
|
8
|
-
*/
|
|
9
|
-
import type { FluidObject, IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
10
|
-
import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
|
|
11
|
-
import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal";
|
|
12
|
-
import type { IFluidDataStoreContext, IFluidDataStoreFactory } from "@fluidframework/runtime-definitions/internal";
|
|
13
|
-
/**
|
|
14
|
-
* `BasicDataStoreFactory` is the factory for creating a {@link BasicFluidDataStoreRuntime}.
|
|
15
|
-
*/
|
|
16
|
-
export declare class BasicDataStoreFactory<Type extends string> implements IFluidDataStoreFactory {
|
|
17
|
-
readonly type: Type;
|
|
18
|
-
private readonly instanceCtor;
|
|
19
|
-
get IFluidDataStoreFactory(): IFluidDataStoreFactory;
|
|
20
|
-
constructor(type: Type, instanceCtor: new (runtime: FluidDataStoreRuntime) => LoadableFluidObject);
|
|
21
|
-
instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<FluidDataStoreRuntime>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* `LoadableFluidObject` is helper to build a DataObject handling the {@link FluidObject}
|
|
25
|
-
* and {@link IFluidLoadable} requirements.
|
|
26
|
-
*/
|
|
27
|
-
export declare abstract class LoadableFluidObject implements FluidObject, IFluidLoadable {
|
|
28
|
-
protected readonly runtime: FluidDataStoreRuntime;
|
|
29
|
-
constructor(runtime: FluidDataStoreRuntime);
|
|
30
|
-
get IFluidLoadable(): this;
|
|
31
|
-
/**
|
|
32
|
-
* Handle to the this Fluid object.
|
|
33
|
-
*/
|
|
34
|
-
get handle(): IFluidHandleInternal<FluidObject>;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=datastoreSupport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
|
-
import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal";
|
|
7
|
-
import { create404Response } from "@fluidframework/runtime-utils/internal";
|
|
8
|
-
/**
|
|
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}.
|
|
12
|
-
*/
|
|
13
|
-
class BasicFluidDataStoreRuntime extends FluidDataStoreRuntime {
|
|
14
|
-
async request(request) {
|
|
15
|
-
const response = await super.request(request);
|
|
16
|
-
if (response.status !== 404) {
|
|
17
|
-
return response;
|
|
18
|
-
}
|
|
19
|
-
// Return entrypoint object if someone requests it directly.
|
|
20
|
-
// Direct requests exist from two scenarios:
|
|
21
|
-
// 1. the request url is a "/"
|
|
22
|
-
// 2. the request url is empty
|
|
23
|
-
if (request.url === "" || request.url === "/" || request.url.startsWith("/?")) {
|
|
24
|
-
// The provideEntryPoint callback below always returns an instance of
|
|
25
|
-
// LoadableFluidObject. Make sure that is the case.
|
|
26
|
-
const dataObject = await this.entryPoint.get();
|
|
27
|
-
assert(dataObject instanceof LoadableFluidObject, 0xa36 /* Data store runtime entryPoint is not expected type */);
|
|
28
|
-
return { mimeType: "fluid/object", status: 200, value: dataObject };
|
|
29
|
-
}
|
|
30
|
-
return create404Response(request);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* `BasicDataStoreFactory` is the factory for creating a {@link BasicFluidDataStoreRuntime}.
|
|
35
|
-
*/
|
|
36
|
-
export class BasicDataStoreFactory {
|
|
37
|
-
get IFluidDataStoreFactory() {
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
constructor(type, instanceCtor) {
|
|
41
|
-
this.type = type;
|
|
42
|
-
this.instanceCtor = instanceCtor;
|
|
43
|
-
}
|
|
44
|
-
async instantiateDataStore(context, existing) {
|
|
45
|
-
// Create a new runtime for our data store.
|
|
46
|
-
// The runtime is what Fluid uses to route to our data store.
|
|
47
|
-
const runtime = new BasicFluidDataStoreRuntime(context,
|
|
48
|
-
/* ISharedObjectRegistry */ new Map(), existing,
|
|
49
|
-
/* provideEntryPoint */ async () => {
|
|
50
|
-
assert(instance !== undefined, 0xa37 /* Intended entryPoint is undefined */);
|
|
51
|
-
return instance;
|
|
52
|
-
});
|
|
53
|
-
const instance = new this.instanceCtor(runtime);
|
|
54
|
-
return runtime;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* `LoadableFluidObject` is helper to build a DataObject handling the {@link FluidObject}
|
|
59
|
-
* and {@link IFluidLoadable} requirements.
|
|
60
|
-
*/
|
|
61
|
-
export class LoadableFluidObject {
|
|
62
|
-
constructor(runtime) {
|
|
63
|
-
this.runtime = runtime;
|
|
64
|
-
}
|
|
65
|
-
get IFluidLoadable() {
|
|
66
|
-
return this;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Handle to the this Fluid object.
|
|
70
|
-
*/
|
|
71
|
-
get handle() {
|
|
72
|
-
// BasicDataStoreFactory provides an entryPoint initialization function
|
|
73
|
-
// to the data store runtime; so, this object should always have access to a
|
|
74
|
-
// non-null entryPoint.
|
|
75
|
-
assert(this.runtime.entryPoint !== undefined, 0xa38 /* EntryPoint was undefined */);
|
|
76
|
-
return this.runtime.entryPoint;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=datastoreSupport.js.map
|
|
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AI,CAAM;QACT,iBAAY,GAAZ,YAAY,CAA6D;IACxF,CAAC;IAEG,KAAK,CAAC,oBAAoB,CAChC,OAA+B,EAC/B,QAAiB;QAEjB,2CAA2C;QAC3C,6DAA6D;QAC7D,MAAM,OAAO,GAA0B,IAAI,0BAA0B,CACpE,OAAO;QACP,2BAA2B,CAAC,IAAI,GAAG,EAAE,EACrC,QAAQ;QACR,uBAAuB,CAAC,KAAK,IAAI,EAAE;YAClC,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAC;YAC7E,OAAO,QAAQ,CAAC;QACjB,CAAC,CACD,CAAC;QAEF,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAEhD,OAAO,OAAO,CAAC;IAChB,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,OAAgB,mBAAmB;IACxC,YAAsC,OAA8B;QAA9B,YAAO,GAAP,OAAO,CAAuB;IAAG,CAAC;IAExE,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QAChB,uEAAuE;QACvE,4EAA4E;QAC5E,uBAAuB;QACvB,MAAM,CAAC,IAAI,CAAC,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"]}
|