@fluidframework/map 0.59.3002 → 0.59.4000-71130
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/directory.d.ts.map +1 -1
- package/dist/directory.js +28 -8
- package/dist/directory.js.map +1 -1
- package/dist/interfaces.d.ts +64 -5
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +0 -1
- package/dist/map.js.map +1 -1
- package/dist/mapKernel.js +1 -1
- package/dist/mapKernel.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/directory.d.ts.map +1 -1
- package/lib/directory.js +28 -8
- package/lib/directory.js.map +1 -1
- package/lib/interfaces.d.ts +64 -5
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js.map +1 -1
- package/lib/map.d.ts.map +1 -1
- package/lib/map.js +0 -1
- package/lib/map.js.map +1 -1
- package/lib/mapKernel.js +1 -1
- package/lib/mapKernel.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +17 -15
- package/src/directory.ts +35 -15
- package/src/interfaces.ts +82 -5
- package/src/map.ts +0 -1
- package/src/mapKernel.ts +1 -1
- package/src/packageVersion.ts +1 -1
package/dist/interfaces.d.ts
CHANGED
|
@@ -98,7 +98,6 @@ export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryE
|
|
|
98
98
|
* (
|
|
99
99
|
* changed: IDirectoryValueChanged,
|
|
100
100
|
* local: boolean,
|
|
101
|
-
* op: ISequencedDocumentMessage | null,
|
|
102
101
|
* target: IEventThisPlaceHolder,
|
|
103
102
|
* ) => void
|
|
104
103
|
* ```
|
|
@@ -107,8 +106,6 @@ export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryE
|
|
|
107
106
|
*
|
|
108
107
|
* - `local` - Whether the change originated from the this client.
|
|
109
108
|
*
|
|
110
|
-
* - `op` - The op that caused the change in value.
|
|
111
|
-
*
|
|
112
109
|
* - `target` - The ISharedDirectory itself.
|
|
113
110
|
*
|
|
114
111
|
* ### "clear"
|
|
@@ -118,17 +115,47 @@ export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryE
|
|
|
118
115
|
* #### Listener signature
|
|
119
116
|
*
|
|
120
117
|
* ```typescript
|
|
121
|
-
* (local: boolean,
|
|
118
|
+
* (local: boolean, target: IEventThisPlaceHolder) => void
|
|
122
119
|
* ```
|
|
123
120
|
* - `local` - Whether the clear originated from the this client.
|
|
124
121
|
*
|
|
125
|
-
* - `
|
|
122
|
+
* - `target` - The ISharedDirectory itself.
|
|
123
|
+
*
|
|
124
|
+
* ### "subDirectoryCreated"
|
|
125
|
+
*
|
|
126
|
+
* The subDirectoryCreated event is emitted when a subdirectory is created.
|
|
127
|
+
*
|
|
128
|
+
* #### Listener signature
|
|
129
|
+
*
|
|
130
|
+
* ```typescript
|
|
131
|
+
* (path: string, local: boolean, target: IEventThisPlaceHolder) => void
|
|
132
|
+
* ```
|
|
133
|
+
* - `path` - The relative path to the key that is created.It is relative from the object which raises the event.
|
|
134
|
+
*
|
|
135
|
+
* - `local` - Whether the clear originated from the this client.
|
|
136
|
+
*
|
|
137
|
+
* - `target` - The ISharedDirectory itself.
|
|
138
|
+
*
|
|
139
|
+
* * ### "subDirectoryDeleted"
|
|
140
|
+
*
|
|
141
|
+
* The subDirectoryDeleted event is emitted when a subdirectory is deleted.
|
|
142
|
+
*
|
|
143
|
+
* #### Listener signature
|
|
144
|
+
*
|
|
145
|
+
* ```typescript
|
|
146
|
+
* (path: string, local: boolean, target: IEventThisPlaceHolder) => void
|
|
147
|
+
* ```
|
|
148
|
+
* - `path` - The relative path to the key that is deleted.It is relative from the object which raises the event.
|
|
149
|
+
*
|
|
150
|
+
* - `local` - Whether the clear originated from the this client.
|
|
126
151
|
*
|
|
127
152
|
* - `target` - The ISharedDirectory itself.
|
|
128
153
|
*/
|
|
129
154
|
export interface ISharedDirectoryEvents extends ISharedObjectEvents {
|
|
130
155
|
(event: "valueChanged", listener: (changed: IDirectoryValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
131
156
|
(event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
157
|
+
(event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
158
|
+
(event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
132
159
|
}
|
|
133
160
|
/**
|
|
134
161
|
* Events emitted in response to changes to the directory data.
|
|
@@ -147,7 +174,37 @@ export interface ISharedDirectoryEvents extends ISharedObjectEvents {
|
|
|
147
174
|
*
|
|
148
175
|
* - `local` - Whether the change originated from the this client.
|
|
149
176
|
*
|
|
177
|
+
*
|
|
150
178
|
* - `target` - The IDirectory itself.
|
|
179
|
+
* ### "subDirectoryCreated"
|
|
180
|
+
*
|
|
181
|
+
* The subDirectoryCreated event is emitted when a subdirectory is created.
|
|
182
|
+
*
|
|
183
|
+
* #### Listener signature
|
|
184
|
+
*
|
|
185
|
+
* ```typescript
|
|
186
|
+
* (path: string, local: boolean, target: IEventThisPlaceHolder) => void
|
|
187
|
+
* ```
|
|
188
|
+
* - `path` - The relative path to the key that is created. It is relative from the object which raises the event.
|
|
189
|
+
*
|
|
190
|
+
* - `local` - Whether the clear originated from the this client.
|
|
191
|
+
*
|
|
192
|
+
* - `target` - The ISharedDirectory itself.
|
|
193
|
+
*
|
|
194
|
+
* * ### "subDirectoryDeleted"
|
|
195
|
+
*
|
|
196
|
+
* The subDirectoryDeleted event is emitted when a subdirectory is deleted.
|
|
197
|
+
*
|
|
198
|
+
* #### Listener signature
|
|
199
|
+
*
|
|
200
|
+
* ```typescript
|
|
201
|
+
* (path: string, local: boolean, target: IEventThisPlaceHolder) => void
|
|
202
|
+
* ```
|
|
203
|
+
* - `path` - The relative path to the key that is deleted. It is relative from the object which raises the event.
|
|
204
|
+
*
|
|
205
|
+
* - `local` - Whether the clear originated from the this client.
|
|
206
|
+
*
|
|
207
|
+
* - `target` - The ISharedDirectory itself.
|
|
151
208
|
*
|
|
152
209
|
* ### "disposed"
|
|
153
210
|
*
|
|
@@ -163,6 +220,8 @@ export interface ISharedDirectoryEvents extends ISharedObjectEvents {
|
|
|
163
220
|
*/
|
|
164
221
|
export interface IDirectoryEvents extends IEvent {
|
|
165
222
|
(event: "containedValueChanged", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
223
|
+
(event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
224
|
+
(event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
166
225
|
(event: "disposed", listener: (target: IEventThisPlaceHolder) => void): any;
|
|
167
226
|
}
|
|
168
227
|
/**
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAEhH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,aAAa,EAAE,GAAG,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAW,SAAQ,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,EAAE,OAAO,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js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.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 { ISharedObject, ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\nimport { IDisposable, IEvent, IEventProvider, IEventThisPlaceHolder } from \"@fluidframework/common-definitions\";\n\n/**\n * Type of \"valueChanged\" event parameter.\n */\nexport interface IValueChanged {\n /**\n * The key storing the value that changed.\n */\n key: string;\n\n /**\n * The value that was stored at the key prior to the change.\n */\n previousValue: any;\n}\n\n/**\n * Interface describing actions on a directory.\n *\n * @remarks\n * When used as a Map, operates on its keys.\n */\nexport interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {\n /**\n * The absolute path of the directory.\n */\n readonly absolutePath: string;\n\n /**\n * Retrieves the value stored at the given key from the directory.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set at\n * @param value - Value to set\n * @returns The IDirectory itself\n */\n set<T = any>(key: string, value: T): this;\n\n /**\n * Get the number of sub directory within the directory.\n * @returns The number of sub directory within a directory.\n */\n countSubDirectory?(): number;\n\n /**\n * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the\n * same name already exists.\n * @param subdirName - Name of the new child directory to create\n * @returns The IDirectory child that was created or retrieved\n */\n createSubDirectory(subdirName: string): IDirectory;\n\n /**\n * Gets an IDirectory child of this IDirectory, if it exists.\n * @param subdirName - Name of the child directory to get\n * @returns The requested IDirectory\n */\n getSubDirectory(subdirName: string): IDirectory | undefined;\n\n /**\n * Checks whether this directory has a child directory with the given name.\n * @param subdirName - Name of the child directory to check\n * @returns True if it exists, false otherwise\n */\n hasSubDirectory(subdirName: string): boolean;\n\n /**\n * Deletes an IDirectory child of this IDirectory, if it exists, along with all descendent keys and directories.\n * @param subdirName - Name of the child directory to delete\n * @returns True if the IDirectory existed and was deleted, false if it did not exist\n */\n deleteSubDirectory(subdirName: string): boolean;\n\n /**\n * Gets an iterator over the IDirectory children of this IDirectory.\n * @returns The IDirectory iterator\n */\n subdirectories(): IterableIterator<[string, IDirectory]>;\n\n /**\n * Get an IDirectory within the directory, in order to use relative paths from that location.\n * @param relativePath - Path of the IDirectory to get, relative to this IDirectory\n * @returns The requested IDirectory\n */\n getWorkingDirectory(relativePath: string): IDirectory | undefined;\n}\n\n/**\n * Events emitted in response to changes to the directory data. These events only emit on the ISharedDirectory itself,\n * and not on subdirectories.\n *\n * ### \"valueChanged\"\n *\n * The valueChanged event is emitted when a key is set or deleted. This is emitted for any key in the ISharedDirectory\n * or any subdirectory.\n *\n * #### Listener signature\n *\n * ```typescript\n * (\n * changed: IDirectoryValueChanged,\n * local: boolean,\n * op: ISequencedDocumentMessage | null,\n * target: IEventThisPlaceHolder,\n * ) => void\n * ```\n * - `changed` - Information on the key that changed, its value prior to the change, and the path to the key that\n * changed.\n *\n * - `local` - Whether the change originated from the this client.\n *\n * - `op` - The op that caused the change in value.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"clear\"\n *\n * The clear event is emitted when the ISharedDirectory is cleared.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, op: ISequencedDocumentMessage | null, target: IEventThisPlaceHolder) => void\n * ```\n * - `local` - Whether the clear originated from the this client.\n *\n * - `op` - The op that caused the clear.\n *\n * - `target` - The ISharedDirectory itself.\n */\nexport interface ISharedDirectoryEvents extends ISharedObjectEvents {\n (event: \"valueChanged\", listener: (\n changed: IDirectoryValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n *\n * ### \"containedValueChanged\"\n *\n * The containedValueChanged event is emitted when a key is set or deleted. As opposed to the SharedDirectory's\n * valueChanged event, this is emitted only on the IDirectory that directly contains the key.\n *\n * #### Listener signature\n *\n * ```typescript\n * (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from the this client.\n *\n * - `target` - The IDirectory itself.\n *\n * ### \"disposed\"\n *\n * The dispose event is emitted when this sub directory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n *\n * - `target` - The IDirectory itself.\n */\nexport interface IDirectoryEvents extends IEvent {\n (event: \"containedValueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"disposed\", listener: (\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Interface describing a shared directory.\n */\nexport interface ISharedDirectory extends\n ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,\n Omit<IDirectory, \"on\" | \"once\" | \"off\"> {\n // The Omit type excludes symbols, which we don't want to exclude. Adding them back here manually.\n // https://github.com/microsoft/TypeScript/issues/31671\n [Symbol.iterator](): IterableIterator<[string, any]>;\n readonly [Symbol.toStringTag]: string;\n}\n\n/**\n * Type of \"valueChanged\" event parameter for SharedDirectory\n */\nexport interface IDirectoryValueChanged extends IValueChanged {\n /**\n * The absolute path to the IDirectory storing the key which changed.\n */\n path: string;\n}\n\n/**\n * Events emitted in response to changes to the map data.\n *\n * ### \"valueChanged\"\n *\n * The valueChanged event is emitted when a key is set or deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (\n * changed: IValueChanged,\n * local: boolean,\n * op: ISequencedDocumentMessage | null,\n * target: IEventThisPlaceHolder,\n * ) => void\n * ```\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from the this client.\n *\n * - `op` - The op that caused the change in value.\n *\n * - `target` - The map itself.\n *\n * ### \"clear\"\n *\n * The clear event is emitted when the map is cleared.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, op: ISequencedDocumentMessage | null, target: IEventThisPlaceHolder) => void\n * ```\n * - `local` - Whether the clear originated from the this client.\n *\n * - `op` - The op that caused the clear.\n *\n * - `target` - The map itself.\n */\nexport interface ISharedMapEvents extends ISharedObjectEvents {\n (event: \"valueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder\n ) => void);\n}\n\n/**\n * Shared map interface\n */\nexport interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {\n /**\n * Retrieves the given key from the map.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set at\n * @param value - Value to set\n * @returns The ISharedMap itself\n */\n set<T = any>(key: string, value: T): this;\n}\n\n/**\n * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use\n * ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.\n * Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with\n * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to\n * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)\n * and ops (set).\n * If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will\n * just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members\n * that are ISerializedHandle (the serialized form of a handle).\n * If type is a value type then it must be amongst the types registered via registerValueType or we won't know how\n * to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent.\n * If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a\n * channel ID. This type is legacy and deprecated.\n */\nexport interface ISerializableValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * The JSONable representation of the value.\n */\n value: any;\n}\n\nexport interface ISerializedValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * String representation of the value.\n */\n value: string | undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.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 { ISharedObject, ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\nimport { IDisposable, IEvent, IEventProvider, IEventThisPlaceHolder } from \"@fluidframework/common-definitions\";\n\n/**\n * Type of \"valueChanged\" event parameter.\n */\nexport interface IValueChanged {\n /**\n * The key storing the value that changed.\n */\n key: string;\n\n /**\n * The value that was stored at the key prior to the change.\n */\n previousValue: any;\n}\n\n/**\n * Interface describing actions on a directory.\n *\n * @remarks\n * When used as a Map, operates on its keys.\n */\nexport interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {\n /**\n * The absolute path of the directory.\n */\n readonly absolutePath: string;\n\n /**\n * Retrieves the value stored at the given key from the directory.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set at\n * @param value - Value to set\n * @returns The IDirectory itself\n */\n set<T = any>(key: string, value: T): this;\n\n /**\n * Get the number of sub directory within the directory.\n * @returns The number of sub directory within a directory.\n */\n countSubDirectory?(): number;\n\n /**\n * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the\n * same name already exists.\n * @param subdirName - Name of the new child directory to create\n * @returns The IDirectory child that was created or retrieved\n */\n createSubDirectory(subdirName: string): IDirectory;\n\n /**\n * Gets an IDirectory child of this IDirectory, if it exists.\n * @param subdirName - Name of the child directory to get\n * @returns The requested IDirectory\n */\n getSubDirectory(subdirName: string): IDirectory | undefined;\n\n /**\n * Checks whether this directory has a child directory with the given name.\n * @param subdirName - Name of the child directory to check\n * @returns True if it exists, false otherwise\n */\n hasSubDirectory(subdirName: string): boolean;\n\n /**\n * Deletes an IDirectory child of this IDirectory, if it exists, along with all descendent keys and directories.\n * @param subdirName - Name of the child directory to delete\n * @returns True if the IDirectory existed and was deleted, false if it did not exist\n */\n deleteSubDirectory(subdirName: string): boolean;\n\n /**\n * Gets an iterator over the IDirectory children of this IDirectory.\n * @returns The IDirectory iterator\n */\n subdirectories(): IterableIterator<[string, IDirectory]>;\n\n /**\n * Get an IDirectory within the directory, in order to use relative paths from that location.\n * @param relativePath - Path of the IDirectory to get, relative to this IDirectory\n * @returns The requested IDirectory\n */\n getWorkingDirectory(relativePath: string): IDirectory | undefined;\n}\n\n/**\n * Events emitted in response to changes to the directory data. These events only emit on the ISharedDirectory itself,\n * and not on subdirectories.\n *\n * ### \"valueChanged\"\n *\n * The valueChanged event is emitted when a key is set or deleted. This is emitted for any key in the ISharedDirectory\n * or any subdirectory.\n *\n * #### Listener signature\n *\n * ```typescript\n * (\n * changed: IDirectoryValueChanged,\n * local: boolean,\n * target: IEventThisPlaceHolder,\n * ) => void\n * ```\n * - `changed` - Information on the key that changed, its value prior to the change, and the path to the key that\n * changed.\n *\n * - `local` - Whether the change originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"clear\"\n *\n * The clear event is emitted when the ISharedDirectory is cleared.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"subDirectoryCreated\"\n *\n * The subDirectoryCreated event is emitted when a subdirectory is created.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the key that is created.It is relative from the object which raises the event.\n *\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * * ### \"subDirectoryDeleted\"\n *\n * The subDirectoryDeleted event is emitted when a subdirectory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the key that is deleted.It is relative from the object which raises the event.\n *\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n */\nexport interface ISharedDirectoryEvents extends ISharedObjectEvents {\n (event: \"valueChanged\", listener: (\n changed: IDirectoryValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n (event: \"subDirectoryDeleted\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n *\n * ### \"containedValueChanged\"\n *\n * The containedValueChanged event is emitted when a key is set or deleted. As opposed to the SharedDirectory's\n * valueChanged event, this is emitted only on the IDirectory that directly contains the key.\n *\n * #### Listener signature\n *\n * ```typescript\n * (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from the this client.\n *\n *\n * - `target` - The IDirectory itself.\n * ### \"subDirectoryCreated\"\n *\n * The subDirectoryCreated event is emitted when a subdirectory is created.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the key that is created. It is relative from the object which raises the event.\n *\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * * ### \"subDirectoryDeleted\"\n *\n * The subDirectoryDeleted event is emitted when a subdirectory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the key that is deleted. It is relative from the object which raises the event.\n *\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"disposed\"\n *\n * The dispose event is emitted when this sub directory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n *\n * - `target` - The IDirectory itself.\n */\nexport interface IDirectoryEvents extends IEvent {\n (event: \"containedValueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n (event: \"subDirectoryDeleted\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"disposed\", listener: (\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Interface describing a shared directory.\n */\nexport interface ISharedDirectory extends\n ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,\n Omit<IDirectory, \"on\" | \"once\" | \"off\"> {\n // The Omit type excludes symbols, which we don't want to exclude. Adding them back here manually.\n // https://github.com/microsoft/TypeScript/issues/31671\n [Symbol.iterator](): IterableIterator<[string, any]>;\n readonly [Symbol.toStringTag]: string;\n}\n\n/**\n * Type of \"valueChanged\" event parameter for SharedDirectory\n */\nexport interface IDirectoryValueChanged extends IValueChanged {\n /**\n * The absolute path to the IDirectory storing the key which changed.\n */\n path: string;\n}\n\n/**\n * Events emitted in response to changes to the map data.\n *\n * ### \"valueChanged\"\n *\n * The valueChanged event is emitted when a key is set or deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (\n * changed: IValueChanged,\n * local: boolean,\n * op: ISequencedDocumentMessage | null,\n * target: IEventThisPlaceHolder,\n * ) => void\n * ```\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from the this client.\n *\n * - `op` - The op that caused the change in value.\n *\n * - `target` - The map itself.\n *\n * ### \"clear\"\n *\n * The clear event is emitted when the map is cleared.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, op: ISequencedDocumentMessage | null, target: IEventThisPlaceHolder) => void\n * ```\n * - `local` - Whether the clear originated from the this client.\n *\n * - `op` - The op that caused the clear.\n *\n * - `target` - The map itself.\n */\nexport interface ISharedMapEvents extends ISharedObjectEvents {\n (event: \"valueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder\n ) => void);\n}\n\n/**\n * Shared map interface\n */\nexport interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {\n /**\n * Retrieves the given key from the map.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set at\n * @param value - Value to set\n * @returns The ISharedMap itself\n */\n set<T = any>(key: string, value: T): this;\n}\n\n/**\n * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use\n * ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.\n * Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with\n * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to\n * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)\n * and ops (set).\n * If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will\n * just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members\n * that are ISerializedHandle (the serialized form of a handle).\n * If type is a value type then it must be amongst the types registered via registerValueType or we won't know how\n * to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent.\n * If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a\n * channel ID. This type is legacy and deprecated.\n */\nexport interface ISerializableValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * The JSONable representation of the value.\n */\n value: any;\n}\n\nexport interface ISerializedValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * String representation of the value.\n */\n value: string | undefined;\n}\n"]}
|
package/dist/map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAe,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EACH,gBAAgB,EAChB,YAAY,EACf,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACH,UAAU,EACV,gBAAgB,EACnB,MAAM,cAAc,CAAC;AAWtB;;;GAGG;AACH,qBAAa,UAAW,YAAW,eAAe;IAC9C;;OAEG;IACH,gBAAuB,IAAI,2CAA2C;IAEtE;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,WAEd;IAED;;OAEG;IACH,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CACb,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC;IAOxD;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU;CAMzE;AAED;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,YAAY,CAAC,gBAAgB,CAAE,YAAW,UAAU;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,EAAE,sBAAsB;IAcxD;;;OAGG;IACH,SAAS,CAAC,YAAY;IAEtB;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAI7D;;;OAGG;IACH,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAK/C;;;OAGG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO;CAKrG"}
|
package/dist/map.js
CHANGED
|
@@ -252,7 +252,6 @@ class SharedMap extends shared_object_base_1.SharedObject {
|
|
|
252
252
|
* @internal
|
|
253
253
|
*/
|
|
254
254
|
async loadCore(storage) {
|
|
255
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
256
255
|
const json = await (0, driver_utils_1.readAndParse)(storage, snapshotFileName);
|
|
257
256
|
const newFormat = json;
|
|
258
257
|
if (Array.isArray(newFormat.blobs)) {
|
package/dist/map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,+EAA8F;AAS9F,+DAA4D;AAC5D,2EAG4C;AAC5C,iEAAmE;AAKnE,2CAAoE;AACpE,qDAA8C;AAO9C,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;;GAGG;AACH,MAAa,UAAU;IAenB;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,UAAU,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACjB,OAAO,UAAU,CAAC,UAAU,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CACb,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAC9B,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU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C,MAAM,CAAC,wBAAwB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACxD,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;gBAClD,MAAM,OAAO,GAAG,MAAM,IAAA,2BAAY,EAA6B,OAAO,EAAE,KAAK,CAAC,CAAC;gBAC/E,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;YAClD,CAAC,CAAC,CAAC,CAAC;SACP;aAAM;YACH,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAkC,CAAC,CAAC;SAC5E;IACL,CAAC;IAED;;;OAGG;IACO,YAAY,KAAI,CAAC;IAE3B;;;OAGG;IACO,YAAY,CAAC,OAAY,EAAE,eAAwB;QACzD,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACO,cAAc,CAAC,OAAY;QACjC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc,EAAE,eAAwB;QAC9F,IAAI,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,SAAS,EAAE;YACxC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;SAC3E;IACL,CAAC;CACJ;AA9QD,8BA8QC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelStorageService,\n IChannelServices,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n IFluidSerializer,\n SharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils\";\nimport {\n ISharedMap,\n ISharedMapEvents,\n} from \"./interfaces\";\nimport { IMapDataObjectSerializable, MapKernel } from \"./mapKernel\";\nimport { pkgVersion } from \"./packageVersion\";\n\ninterface IMapSerializationFormat {\n blobs?: string[];\n content: IMapDataObjectSerializable;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * The factory that defines the map.\n * @sealed\n */\nexport class MapFactory implements IChannelFactory {\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public static readonly Type = \"https://graph.microsoft.com/types/map\";\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public static readonly Attributes: IChannelAttributes = {\n type: MapFactory.Type,\n snapshotFormatVersion: \"0.2\",\n packageVersion: pkgVersion,\n };\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public get type() {\n return MapFactory.Type;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public get attributes() {\n return MapFactory.Attributes;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n */\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes): Promise<ISharedMap> {\n const map = new SharedMap(id, runtime, attributes);\n await map.load(services);\n\n return map;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n */\n public create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap {\n const map = new SharedMap(id, runtime, MapFactory.Attributes);\n map.initializeLocal();\n\n return map;\n }\n}\n\n/**\n * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting\n * and retrieving values that JavaScript developers are accustomed to with the\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.\n * However, the keys of a SharedMap must be strings.\n */\nexport class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {\n /**\n * Create a new shared map.\n * @param runtime - The data store runtime that the new shared map belongs to.\n * @param id - Optional name of the shared map.\n * @returns Newly created shared map.\n *\n * @example\n * To create a `SharedMap`, call the static create method:\n *\n * ```typescript\n * const myMap = SharedMap.create(this.runtime, id);\n * ```\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string): SharedMap {\n return runtime.createChannel(id, MapFactory.Type) as SharedMap;\n }\n\n /**\n * Get a factory for SharedMap to register with the data store.\n * @returns A factory that creates SharedMaps and loads them from storage.\n */\n public static getFactory(): IChannelFactory {\n return new MapFactory();\n }\n\n /**\n * String representation for the class.\n */\n public readonly [Symbol.toStringTag]: string = \"SharedMap\";\n\n /**\n * MapKernel which manages actual map operations.\n */\n private readonly kernel: MapKernel;\n\n /**\n * Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}.\n *\n * @param id - String identifier.\n * @param runtime - Data store runtime.\n * @param attributes - The attributes for the map.\n */\n constructor(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n ) {\n super(id, runtime, attributes);\n this.kernel = new MapKernel(\n this.serializer,\n this.handle,\n (op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata),\n () => this.isAttached(),\n this,\n );\n }\n\n /**\n * Get an iterator over the keys in this map.\n * @returns The iterator\n */\n public keys(): IterableIterator<string> {\n return this.kernel.keys();\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public entries(): IterableIterator<[string, any]> {\n return this.kernel.entries();\n }\n\n /**\n * Get an iterator over the values in this map.\n * @returns The iterator\n */\n public values(): IterableIterator<any> {\n return this.kernel.values();\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public [Symbol.iterator](): IterableIterator<[string, any]> {\n return this.kernel.entries();\n }\n\n /**\n * The number of key/value pairs stored in the map.\n */\n public get size() {\n return this.kernel.size;\n }\n\n /**\n * Executes the given callback on each entry in the map.\n * @param callbackFn - Callback function\n */\n public forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void {\n this.kernel.forEach(callbackFn);\n }\n\n /**\n * {@inheritDoc ISharedMap.get}\n */\n public get<T = any>(key: string): T | undefined {\n return this.kernel.get<T>(key);\n }\n\n /**\n * Check if a key exists in the map.\n * @param key - The key to check\n * @returns True if the key exists, false otherwise\n */\n public has(key: string): boolean {\n return this.kernel.has(key);\n }\n\n /**\n * {@inheritDoc ISharedMap.set}\n */\n public set(key: string, value: any): this {\n this.kernel.set(key, value);\n return this;\n }\n\n /**\n * Delete a key from the map.\n * @param key - Key to delete\n * @returns True if the key existed and was deleted, false if it did not exist\n */\n public delete(key: string): boolean {\n return this.kernel.delete(key);\n }\n\n /**\n * Clear all data from the map.\n */\n public clear(): void {\n this.kernel.clear();\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n * @internal\n */\n protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n let currentSize = 0;\n let counter = 0;\n let headerBlob: IMapDataObjectSerializable = {};\n const blobs: string[] = [];\n\n const builder = new SummaryTreeBuilder();\n\n const data = this.kernel.getSerializedStorage(serializer);\n\n // If single property exceeds this size, it goes into its own blob\n const MinValueSizeSeparateSnapshotBlob = 8 * 1024;\n\n // Maximum blob size for multiple map properties\n // Should be bigger than MinValueSizeSeparateSnapshotBlob\n const MaxSnapshotBlobSize = 16 * 1024;\n\n // Partitioning algorithm:\n // 1) Split large (over MinValueSizeSeparateSnapshotBlob = 8K) properties into their own blobs.\n // Naming (across snapshots) of such blob does not have to be stable across snapshots,\n // As de-duping process (in driver) should not care about paths, only content.\n // 2) Split remaining properties into blobs of MaxSnapshotBlobSize (16K) size.\n // This process does not produce stable partitioning. This means\n // modification (including addition / deletion) of property can shift properties across blobs\n // and result in non-incremental snapshot.\n // This can be improved in the future, without being format breaking change, as loading sequence\n // loads all blobs at once and partitioning schema has no impact on that process.\n for (const key of Object.keys(data)) {\n const value = data[key];\n if (value.value && value.value.length >= MinValueSizeSeparateSnapshotBlob) {\n const blobName = `blob${counter}`;\n counter++;\n blobs.push(blobName);\n const content: IMapDataObjectSerializable = {\n [key]: {\n type: value.type,\n value: JSON.parse(value.value),\n },\n };\n builder.addBlob(blobName, JSON.stringify(content));\n } else {\n currentSize += value.type.length + 21; // Approximation cost of property header\n if (value.value) {\n currentSize += value.value.length;\n }\n\n if (currentSize > MaxSnapshotBlobSize) {\n const blobName = `blob${counter}`;\n counter++;\n blobs.push(blobName);\n builder.addBlob(blobName, JSON.stringify(headerBlob));\n headerBlob = {};\n currentSize = 0;\n }\n headerBlob[key] = {\n type: value.type,\n value: value.value === undefined ? undefined : JSON.parse(value.value),\n };\n }\n }\n\n const header: IMapSerializationFormat = {\n blobs,\n content: headerBlob,\n };\n builder.addBlob(snapshotFileName, JSON.stringify(header));\n\n return builder.getSummaryTree();\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n * @internal\n */\n protected async loadCore(storage: IChannelStorageService) {\n // eslint-disable-next-line @typescript-eslint/ban-types\n const json = await readAndParse<object>(storage, snapshotFileName);\n const newFormat = json as IMapSerializationFormat;\n if (Array.isArray(newFormat.blobs)) {\n this.kernel.populateFromSerializable(newFormat.content);\n await Promise.all(newFormat.blobs.map(async (value) => {\n const content = await readAndParse<IMapDataObjectSerializable>(storage, value);\n this.kernel.populateFromSerializable(content);\n }));\n } else {\n this.kernel.populateFromSerializable(json as IMapDataObjectSerializable);\n }\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n * @internal\n */\n protected onDisconnect() {}\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}\n * @internal\n */\n protected reSubmitCore(content: any, localOpMetadata: unknown) {\n this.kernel.trySubmitMessage(content, localOpMetadata);\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}\n * @internal\n */\n protected applyStashedOp(content: any): unknown {\n this.kernel.tryProcessMessage(content, false, undefined);\n return this.kernel.tryGetStashedOpLocalMetadata(content);\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n * @internal\n */\n protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) {\n if (message.type === MessageType.Operation) {\n this.kernel.tryProcessMessage(message.contents, local, localOpMetadata);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,+EAA8F;AAS9F,+DAA4D;AAC5D,2EAG4C;AAC5C,iEAAmE;AAKnE,2CAAoE;AACpE,qDAA8C;AAO9C,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;;GAGG;AACH,MAAa,UAAU;IAenB;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,UAAU,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACjB,OAAO,UAAU,CAAC,UAAU,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CACb,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAC9B,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEzB,OAAO,GAAG,CAAC;IACf,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACrD,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,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6B,OAAO,EAAE,KAAK,CAAC,CAAC;gBAC/E,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;YAClD,CAAC,CAAC,CAAC,CAAC;SACP;aAAM;YACH,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAkC,CAAC,CAAC;SAC5E;IACL,CAAC;IAED;;;OAGG;IACO,YAAY,KAAI,CAAC;IAE3B;;;OAGG;IACO,YAAY,CAAC,OAAY,EAAE,eAAwB;QACzD,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACO,cAAc,CAAC,OAAY;QACjC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc,EAAE,eAAwB;QAC9F,IAAI,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,SAAS,EAAE;YACxC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;SAC3E;IACL,CAAC;CACJ;AA7QD,8BA6QC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelStorageService,\n IChannelServices,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n IFluidSerializer,\n SharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils\";\nimport {\n ISharedMap,\n ISharedMapEvents,\n} from \"./interfaces\";\nimport { IMapDataObjectSerializable, MapKernel } from \"./mapKernel\";\nimport { pkgVersion } from \"./packageVersion\";\n\ninterface IMapSerializationFormat {\n blobs?: string[];\n content: IMapDataObjectSerializable;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * The factory that defines the map.\n * @sealed\n */\nexport class MapFactory implements IChannelFactory {\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public static readonly Type = \"https://graph.microsoft.com/types/map\";\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public static readonly Attributes: IChannelAttributes = {\n type: MapFactory.Type,\n snapshotFormatVersion: \"0.2\",\n packageVersion: pkgVersion,\n };\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public get type() {\n return MapFactory.Type;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public get attributes() {\n return MapFactory.Attributes;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n */\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes): Promise<ISharedMap> {\n const map = new SharedMap(id, runtime, attributes);\n await map.load(services);\n\n return map;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n */\n public create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap {\n const map = new SharedMap(id, runtime, MapFactory.Attributes);\n map.initializeLocal();\n\n return map;\n }\n}\n\n/**\n * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting\n * and retrieving values that JavaScript developers are accustomed to with the\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.\n * However, the keys of a SharedMap must be strings.\n */\nexport class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {\n /**\n * Create a new shared map.\n * @param runtime - The data store runtime that the new shared map belongs to.\n * @param id - Optional name of the shared map.\n * @returns Newly created shared map.\n *\n * @example\n * To create a `SharedMap`, call the static create method:\n *\n * ```typescript\n * const myMap = SharedMap.create(this.runtime, id);\n * ```\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string): SharedMap {\n return runtime.createChannel(id, MapFactory.Type) as SharedMap;\n }\n\n /**\n * Get a factory for SharedMap to register with the data store.\n * @returns A factory that creates SharedMaps and loads them from storage.\n */\n public static getFactory(): IChannelFactory {\n return new MapFactory();\n }\n\n /**\n * String representation for the class.\n */\n public readonly [Symbol.toStringTag]: string = \"SharedMap\";\n\n /**\n * MapKernel which manages actual map operations.\n */\n private readonly kernel: MapKernel;\n\n /**\n * Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}.\n *\n * @param id - String identifier.\n * @param runtime - Data store runtime.\n * @param attributes - The attributes for the map.\n */\n constructor(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n ) {\n super(id, runtime, attributes);\n this.kernel = new MapKernel(\n this.serializer,\n this.handle,\n (op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata),\n () => this.isAttached(),\n this,\n );\n }\n\n /**\n * Get an iterator over the keys in this map.\n * @returns The iterator\n */\n public keys(): IterableIterator<string> {\n return this.kernel.keys();\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public entries(): IterableIterator<[string, any]> {\n return this.kernel.entries();\n }\n\n /**\n * Get an iterator over the values in this map.\n * @returns The iterator\n */\n public values(): IterableIterator<any> {\n return this.kernel.values();\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public [Symbol.iterator](): IterableIterator<[string, any]> {\n return this.kernel.entries();\n }\n\n /**\n * The number of key/value pairs stored in the map.\n */\n public get size() {\n return this.kernel.size;\n }\n\n /**\n * Executes the given callback on each entry in the map.\n * @param callbackFn - Callback function\n */\n public forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void {\n this.kernel.forEach(callbackFn);\n }\n\n /**\n * {@inheritDoc ISharedMap.get}\n */\n public get<T = any>(key: string): T | undefined {\n return this.kernel.get<T>(key);\n }\n\n /**\n * Check if a key exists in the map.\n * @param key - The key to check\n * @returns True if the key exists, false otherwise\n */\n public has(key: string): boolean {\n return this.kernel.has(key);\n }\n\n /**\n * {@inheritDoc ISharedMap.set}\n */\n public set(key: string, value: any): this {\n this.kernel.set(key, value);\n return this;\n }\n\n /**\n * Delete a key from the map.\n * @param key - Key to delete\n * @returns True if the key existed and was deleted, false if it did not exist\n */\n public delete(key: string): boolean {\n return this.kernel.delete(key);\n }\n\n /**\n * Clear all data from the map.\n */\n public clear(): void {\n this.kernel.clear();\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n * @internal\n */\n protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n let currentSize = 0;\n let counter = 0;\n let headerBlob: IMapDataObjectSerializable = {};\n const blobs: string[] = [];\n\n const builder = new SummaryTreeBuilder();\n\n const data = this.kernel.getSerializedStorage(serializer);\n\n // If single property exceeds this size, it goes into its own blob\n const MinValueSizeSeparateSnapshotBlob = 8 * 1024;\n\n // Maximum blob size for multiple map properties\n // Should be bigger than MinValueSizeSeparateSnapshotBlob\n const MaxSnapshotBlobSize = 16 * 1024;\n\n // Partitioning algorithm:\n // 1) Split large (over MinValueSizeSeparateSnapshotBlob = 8K) properties into their own blobs.\n // Naming (across snapshots) of such blob does not have to be stable across snapshots,\n // As de-duping process (in driver) should not care about paths, only content.\n // 2) Split remaining properties into blobs of MaxSnapshotBlobSize (16K) size.\n // This process does not produce stable partitioning. This means\n // modification (including addition / deletion) of property can shift properties across blobs\n // and result in non-incremental snapshot.\n // This can be improved in the future, without being format breaking change, as loading sequence\n // loads all blobs at once and partitioning schema has no impact on that process.\n for (const key of Object.keys(data)) {\n const value = data[key];\n if (value.value && value.value.length >= MinValueSizeSeparateSnapshotBlob) {\n const blobName = `blob${counter}`;\n counter++;\n blobs.push(blobName);\n const content: IMapDataObjectSerializable = {\n [key]: {\n type: value.type,\n value: JSON.parse(value.value),\n },\n };\n builder.addBlob(blobName, JSON.stringify(content));\n } else {\n currentSize += value.type.length + 21; // Approximation cost of property header\n if (value.value) {\n currentSize += value.value.length;\n }\n\n if (currentSize > MaxSnapshotBlobSize) {\n const blobName = `blob${counter}`;\n counter++;\n blobs.push(blobName);\n builder.addBlob(blobName, JSON.stringify(headerBlob));\n headerBlob = {};\n currentSize = 0;\n }\n headerBlob[key] = {\n type: value.type,\n value: value.value === undefined ? undefined : JSON.parse(value.value),\n };\n }\n }\n\n const header: IMapSerializationFormat = {\n blobs,\n content: headerBlob,\n };\n builder.addBlob(snapshotFileName, JSON.stringify(header));\n\n return builder.getSummaryTree();\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n * @internal\n */\n protected async loadCore(storage: IChannelStorageService) {\n const json = await readAndParse<object>(storage, snapshotFileName);\n const newFormat = json as IMapSerializationFormat;\n if (Array.isArray(newFormat.blobs)) {\n this.kernel.populateFromSerializable(newFormat.content);\n await Promise.all(newFormat.blobs.map(async (value) => {\n const content = await readAndParse<IMapDataObjectSerializable>(storage, value);\n this.kernel.populateFromSerializable(content);\n }));\n } else {\n this.kernel.populateFromSerializable(json as IMapDataObjectSerializable);\n }\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n * @internal\n */\n protected onDisconnect() {}\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}\n * @internal\n */\n protected reSubmitCore(content: any, localOpMetadata: unknown) {\n this.kernel.trySubmitMessage(content, localOpMetadata);\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}\n * @internal\n */\n protected applyStashedOp(content: any): unknown {\n this.kernel.tryProcessMessage(content, false, undefined);\n return this.kernel.tryGetStashedOpLocalMetadata(content);\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n * @internal\n */\n protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) {\n if (message.type === MessageType.Operation) {\n this.kernel.tryProcessMessage(message.contents, local, localOpMetadata);\n }\n }\n}\n"]}
|
package/dist/mapKernel.js
CHANGED
|
@@ -378,7 +378,7 @@ class MapKernel {
|
|
|
378
378
|
// Found an unack'd op. Clear it from the map if the pendingMessageId in the map matches this message's
|
|
379
379
|
// and don't process the op.
|
|
380
380
|
if (local) {
|
|
381
|
-
(0, common_utils_1.assert)(localOpMetadata !== undefined, 0x014 /*
|
|
381
|
+
(0, common_utils_1.assert)(localOpMetadata !== undefined, 0x014 /* pendingMessageId is missing from the local client's operation */);
|
|
382
382
|
const pendingMessageId = localOpMetadata;
|
|
383
383
|
const pendingKeyMessageId = this.pendingKeys.get(op.key);
|
|
384
384
|
if (pendingKeyMessageId === pendingMessageId) {
|
package/dist/mapKernel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapKernel.js","sourceRoot":"","sources":["../src/mapKernel.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2EAAiF;AACjF,+DAAyE;AAOzE,+CAIuB;AAgGvB;;GAEG;AACH,MAAa,SAAS;IAuClB;;;;;;;;OAQG;IACH,YACqB,UAA4B,EAC5B,MAAoB,EACpB,aAA0D,EAC1D,UAAyB,EACzB,YAAiD;QAJjD,eAAU,GAAV,UAAU,CAAkB;QAC5B,WAAM,GAAN,MAAM,CAAc;QACpB,kBAAa,GAAb,aAAa,CAA6C;QAC1D,eAAU,GAAV,UAAU,CAAe;QACzB,iBAAY,GAAZ,YAAY,CAAqC;QA7CtE;;WAEG;QACc,oBAAe,GAA4C,IAAI,GAAG,EAAE,CAAC;QAEtF;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAAuB,CAAC;QAE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AAE,CAAC,CAAC;YAClD,CAAC;SACJ,CAAC,CAAC;QAEP,OAAO,eAAe,CAAC;IAC3B,CAAC;IAEO,+BAA+B,CAAC,EAAsB;QAC1D,MAAM,gBAAgB,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,qBAAqB,GAAG,gBAAgB,CAAC;QAC9C,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACK,qBAAqB,CAAC,EAAsB;QAChD,MAAM,gBAAgB,GAAG,IAAI,CAAC,+BAA+B,CAAC,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;IAC7C,CAAC;IAEO,6BAA6B,CAAC,EAAoB;QACtD,MAAM,gBAAgB,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;QAC/C,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACK,mBAAmB,CAAC,EAAoB;QAC5C,MAAM,gBAAgB,GAAG,IAAI,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;IAC7C,CAAC;CACJ;AAtiBD,8BAsiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { IFluidSerializer, ValueType } from \"@fluidframework/shared-object-base\";\nimport { assert, TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport {\n ISerializableValue,\n ISerializedValue,\n IValueChanged,\n ISharedMapEvents,\n} from \"./interfaces\";\nimport {\n ILocalValue,\n LocalValueMaker,\n makeSerializable,\n} from \"./localValues\";\n\n/**\n * Defines the means to process and submit a given op on a map.\n */\ninterface IMapMessageHandler {\n /**\n * Apply the given operation.\n * @param op - The map operation to apply\n * @param local - Whether the message originated from the local client\n * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n * For messages from a remote client, this will be undefined.\n */\n process(\n op: IMapOperation,\n local: boolean,\n localOpMetadata: unknown,\n ): void;\n\n /**\n * Communicate the operation to remote clients.\n * @param op - The map operation to submit\n * @param localOpMetadata - The metadata to be submitted with the message.\n */\n submit(op: IMapOperation, localOpMetadata: unknown): void;\n\n getStashedOpLocalMetadata(op: IMapOperation): unknown;\n}\n\n/**\n * Operation indicating a value should be set for a key.\n */\nexport interface IMapSetOperation {\n /**\n * String identifier of the operation type.\n */\n type: \"set\";\n\n /**\n * Map key being modified.\n */\n key: string;\n\n /**\n * Value to be set on the key.\n */\n value: ISerializableValue;\n}\n\n/**\n * Operation indicating a key should be deleted from the map.\n */\nexport interface IMapDeleteOperation {\n /**\n * String identifier of the operation type.\n */\n type: \"delete\";\n\n /**\n * Map key being modified.\n */\n key: string;\n}\n\n/**\n * Map key operations are one of several types.\n */\nexport type IMapKeyOperation = IMapSetOperation | IMapDeleteOperation;\n\n/**\n * Operation indicating the map should be cleared.\n */\nexport interface IMapClearOperation {\n /**\n * String identifier of the operation type.\n */\n type: \"clear\";\n}\n\n/**\n * Description of a map delta operation\n */\nexport type IMapOperation = IMapKeyOperation | IMapClearOperation;\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse\n */\nexport interface IMapDataObjectSerializable {\n [key: string]: ISerializableValue;\n}\n\nexport interface IMapDataObjectSerialized {\n [key: string]: ISerializedValue;\n}\n\n/**\n * A SharedMap is a map-like distributed data structure.\n */\nexport class MapKernel {\n /**\n * The number of key/value pairs stored in the map.\n */\n public get size(): number {\n return this.data.size;\n }\n\n /**\n * Mapping of op types to message handlers.\n */\n private readonly messageHandlers: ReadonlyMap<string, IMapMessageHandler> = new Map();\n\n /**\n * The in-memory data the map is storing.\n */\n private readonly data = new Map<string, ILocalValue>();\n\n /**\n * Keys that have been modified locally but not yet ack'd from the server.\n */\n private readonly pendingKeys: Map<string, number> = new Map();\n\n /**\n * This is used to assign a unique id to every outgoing operation and helps in tracking unack'd ops.\n */\n private pendingMessageId: number = -1;\n\n /**\n * If a clear has been performed locally but not yet ack'd from the server, then this stores the pending id\n * of that clear operation. Otherwise, is -1.\n */\n private pendingClearMessageId: number = -1;\n\n /**\n * Object to create encapsulations of the values stored in the map.\n */\n private readonly localValueMaker: LocalValueMaker;\n\n /**\n * Create a new shared map kernel.\n * @param serializer - The serializer to serialize / parse handles\n * @param handle - The handle of the shared object using the kernel\n * @param submitMessage - A callback to submit a message through the shared object\n * @param isAttached - To query whether the shared object should generate ops\n * @param valueTypes - The value types to register\n * @param eventEmitter - The object that will emit map events\n */\n constructor(\n private readonly serializer: IFluidSerializer,\n private readonly handle: IFluidHandle,\n private readonly submitMessage: (op: any, localOpMetadata: unknown) => void,\n private readonly isAttached: () => boolean,\n private readonly eventEmitter: TypedEventEmitter<ISharedMapEvents>,\n ) {\n this.localValueMaker = new LocalValueMaker(serializer);\n this.messageHandlers = this.getMessageHandlers();\n }\n\n /**\n * Get an iterator over the keys in this map.\n * @returns The iterator\n */\n public keys(): IterableIterator<string> {\n return this.data.keys();\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public entries(): IterableIterator<[string, any]> {\n const localEntriesIterator = this.data.entries();\n const iterator = {\n next(): IteratorResult<[string, any]> {\n const nextVal = localEntriesIterator.next();\n if (nextVal.done) {\n return { value: undefined, done: true };\n } else {\n // Unpack the stored value\n return { value: [nextVal.value[0], nextVal.value[1].value], done: false };\n }\n },\n [Symbol.iterator]() {\n return this;\n },\n };\n return iterator;\n }\n\n /**\n * Get an iterator over the values in this map.\n * @returns The iterator\n */\n public values(): IterableIterator<any> {\n const localValuesIterator = this.data.values();\n const iterator = {\n next(): IteratorResult<any> {\n const nextVal = localValuesIterator.next();\n if (nextVal.done) {\n return { value: undefined, done: true };\n } else {\n // Unpack the stored value\n return { value: nextVal.value.value, done: false };\n }\n },\n [Symbol.iterator]() {\n return this;\n },\n };\n return iterator;\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public [Symbol.iterator](): IterableIterator<[string, any]> {\n return this.entries();\n }\n\n /**\n * Executes the given callback on each entry in the map.\n * @param callbackFn - Callback function\n */\n public forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void {\n this.data.forEach((localValue, key, m) => {\n callbackFn(localValue.value, key, m);\n });\n }\n\n /**\n * {@inheritDoc ISharedMap.get}\n */\n public get<T = any>(key: string): T | undefined {\n if (!this.data.has(key)) {\n return undefined;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const localValue = this.data.get(key)!;\n\n return localValue.value as T;\n }\n\n /**\n * Check if a key exists in the map.\n * @param key - The key to check\n * @returns True if the key exists, false otherwise\n */\n public has(key: string): boolean {\n return this.data.has(key);\n }\n\n /**\n * {@inheritDoc ISharedMap.set}\n */\n public set(key: string, value: any) {\n // Undefined/null keys can't be serialized to JSON in the manner we currently snapshot.\n if (key === undefined || key === null) {\n throw new Error(\"Undefined and null keys are not supported\");\n }\n\n // Create a local value and serialize it.\n const localValue = this.localValueMaker.fromInMemory(value);\n const serializableValue = makeSerializable(\n localValue,\n this.serializer,\n this.handle);\n\n // Set the value locally.\n this.setCore(\n key,\n localValue,\n true,\n );\n\n // If we are not attached, don't submit the op.\n if (!this.isAttached()) {\n return;\n }\n\n const op: IMapSetOperation = {\n key,\n type: \"set\",\n value: serializableValue,\n };\n this.submitMapKeyMessage(op);\n }\n\n /**\n * Delete a key from the map.\n * @param key - Key to delete\n * @returns True if the key existed and was deleted, false if it did not exist\n */\n public delete(key: string): boolean {\n // Delete the key locally first.\n const successfullyRemoved = this.deleteCore(key, true);\n\n // If we are not attached, don't submit the op.\n if (!this.isAttached()) {\n return successfullyRemoved;\n }\n\n const op: IMapDeleteOperation = {\n key,\n type: \"delete\",\n };\n this.submitMapKeyMessage(op);\n\n return successfullyRemoved;\n }\n\n /**\n * Clear all data from the map.\n */\n public clear(): void {\n // Clear the data locally first.\n this.clearCore(true);\n\n // If we are not attached, don't submit the op.\n if (!this.isAttached()) {\n return;\n }\n\n const op: IMapClearOperation = {\n type: \"clear\",\n };\n this.submitMapClearMessage(op);\n }\n\n /**\n * Serializes the data stored in the shared map to a JSON string\n * @param serializer - The serializer to use to serialize handles in its values.\n * @returns A JSON string containing serialized map data\n */\n public getSerializedStorage(serializer: IFluidSerializer): IMapDataObjectSerialized {\n const serializableMapData: IMapDataObjectSerialized = {};\n this.data.forEach((localValue, key) => {\n serializableMapData[key] = localValue.makeSerialized(serializer, this.handle);\n });\n return serializableMapData;\n }\n\n public getSerializableStorage(serializer: IFluidSerializer): IMapDataObjectSerializable {\n const serializableMapData: IMapDataObjectSerializable = {};\n this.data.forEach((localValue, key) => {\n serializableMapData[key] = makeSerializable(localValue, serializer, this.handle);\n });\n return serializableMapData;\n }\n\n public serialize(serializer: IFluidSerializer): string {\n return JSON.stringify(this.getSerializableStorage(serializer));\n }\n\n /**\n * Populate the kernel with the given map data.\n * @param data - A JSON string containing serialized map data\n */\n public populateFromSerializable(json: IMapDataObjectSerializable): void {\n for (const [key, serializable] of Object.entries(json)) {\n const localValue = {\n key,\n value: this.makeLocal(key, serializable),\n };\n\n this.data.set(localValue.key, localValue.value);\n }\n }\n\n public populate(json: string): void {\n this.populateFromSerializable(JSON.parse(json) as IMapDataObjectSerializable);\n }\n\n /**\n * Submit the given op if a handler is registered.\n * @param op - The operation to attempt to submit\n * @param localOpMetadata - The local metadata associated with the op. This is kept locally by the runtime\n * and not sent to the server. This will be sent back when this message is received back from the server. This is\n * also sent if we are asked to resubmit the message.\n * @returns True if the operation was submitted, false otherwise.\n */\n public trySubmitMessage(op: any, localOpMetadata: unknown): boolean {\n const type: string = op.type;\n if (this.messageHandlers.has(type)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.messageHandlers.get(type)!.submit(op as IMapOperation, localOpMetadata);\n return true;\n }\n return false;\n }\n\n public tryGetStashedOpLocalMetadata(op: any): unknown {\n const type: string = op.type;\n if (this.messageHandlers.has(type)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.messageHandlers.get(type)!.getStashedOpLocalMetadata(op as IMapOperation);\n }\n throw new Error(\"no apply stashed op handler\");\n }\n\n /**\n * Process the given op if a handler is registered.\n * @param message - The message to process\n * @param local - Whether the message originated from the local client\n * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n * For messages from a remote client, this will be undefined.\n * @returns True if the operation was processed, false otherwise.\n */\n public tryProcessMessage(\n op: IMapOperation,\n local: boolean,\n localOpMetadata: unknown,\n ): boolean {\n if (this.messageHandlers.has(op.type)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.messageHandlers\n .get(op.type)!\n .process(op, local, localOpMetadata);\n return true;\n }\n return false;\n }\n\n /**\n * Set implementation used for both locally sourced sets as well as incoming remote sets.\n * @param key - The key being set\n * @param value - The value being set\n * @param local - Whether the message originated from the local client\n * @param op - The message if from a remote set, or null if from a local set\n */\n private setCore(key: string, value: ILocalValue, local: boolean): void {\n const previousValue = this.get(key);\n this.data.set(key, value);\n const event: IValueChanged = { key, previousValue };\n this.eventEmitter.emit(\"valueChanged\", event, local, this.eventEmitter);\n }\n\n /**\n * Clear implementation used for both locally sourced clears as well as incoming remote clears.\n * @param local - Whether the message originated from the local client\n * @param op - The message if from a remote clear, or null if from a local clear\n */\n private clearCore(local: boolean): void {\n this.data.clear();\n this.eventEmitter.emit(\"clear\", local, this.eventEmitter);\n }\n\n /**\n * Delete implementation used for both locally sourced deletes as well as incoming remote deletes.\n * @param key - The key being deleted\n * @param local - Whether the message originated from the local client\n * @param op - The message if from a remote delete, or null if from a local delete\n * @returns True if the key existed and was deleted, false if it did not exist\n */\n private deleteCore(key: string, local: boolean): boolean {\n const previousValue = this.get(key);\n const successfullyRemoved = this.data.delete(key);\n if (successfullyRemoved) {\n const event: IValueChanged = { key, previousValue };\n this.eventEmitter.emit(\"valueChanged\", event, local, this.eventEmitter);\n }\n return successfullyRemoved;\n }\n\n /**\n * Clear all keys in memory in response to a remote clear, but retain keys we have modified but not yet been ack'd.\n */\n private clearExceptPendingKeys(): void {\n // Assuming the pendingKeys is small and the map is large\n // we will get the value for the pendingKeys and clear the map\n const temp = new Map<string, ILocalValue>();\n this.pendingKeys.forEach((value, key) => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n temp.set(key, this.data.get(key)!);\n });\n this.data.clear();\n temp.forEach((value, key) => {\n this.data.set(key, value);\n });\n }\n\n /**\n * The remote ISerializableValue we're receiving (either as a result of a load or an incoming set op) will\n * have the information we need to create a real object, but will not be the real object yet. For example,\n * we might know it's a map and the map's ID but not have the actual map or its data yet. makeLocal's\n * job is to convert that information into a real object for local usage.\n * @param key - The key that the caller intends to store the local value into (used for ops later). But\n * doesn't actually store the local value into that key. So better not lie!\n * @param serializable - The remote information that we can convert into a real object\n * @returns The local value that was produced\n */\n private makeLocal(key: string, serializable: ISerializableValue): ILocalValue {\n if (serializable.type === ValueType[ValueType.Plain] || serializable.type === ValueType[ValueType.Shared]) {\n return this.localValueMaker.fromSerializable(serializable);\n } else {\n throw new Error(\"Unknown local value type\");\n }\n }\n\n /**\n * If our local operations that have not yet been ack'd will eventually overwrite an incoming operation, we should\n * not process the incoming operation.\n * @param op - Operation to check\n * @param local - Whether the message originated from the local client\n * @param message - The message\n * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n * For messages from a remote client, this will be undefined.\n * @returns True if the operation should be processed, false otherwise\n */\n private needProcessKeyOperation(\n op: IMapKeyOperation,\n local: boolean,\n localOpMetadata: unknown,\n ): boolean {\n if (this.pendingClearMessageId !== -1) {\n if (local) {\n assert(localOpMetadata !== undefined && localOpMetadata as number < this.pendingClearMessageId,\n 0x013 /* \"Received out of order op when there is an unackd clear message\" */);\n }\n // If we have an unack'd clear, we can ignore all ops.\n return false;\n }\n\n if (this.pendingKeys.has(op.key)) {\n // Found an unack'd op. Clear it from the map if the pendingMessageId in the map matches this message's\n // and don't process the op.\n if (local) {\n assert(localOpMetadata !== undefined,\n 0x014 /* `pendingMessageId is missing from the local client's ${op.type} operation` */);\n const pendingMessageId = localOpMetadata as number;\n const pendingKeyMessageId = this.pendingKeys.get(op.key);\n if (pendingKeyMessageId === pendingMessageId) {\n this.pendingKeys.delete(op.key);\n }\n }\n return false;\n }\n\n // If we don't have a NACK op on the key, we need to process the remote ops.\n return !local;\n }\n\n /**\n * Get the message handlers for the map.\n * @returns A map of string op names to IMapMessageHandlers for those ops\n */\n private getMessageHandlers() {\n const messageHandlers = new Map<string, IMapMessageHandler>();\n messageHandlers.set(\n \"clear\",\n {\n process: (op: IMapClearOperation, local, localOpMetadata) => {\n if (local) {\n assert(localOpMetadata !== undefined,\n 0x015 /* \"pendingMessageId is missing from the local client's clear operation\" */);\n const pendingMessageId = localOpMetadata as number;\n if (this.pendingClearMessageId === pendingMessageId) {\n this.pendingClearMessageId = -1;\n }\n return;\n }\n if (this.pendingKeys.size !== 0) {\n this.clearExceptPendingKeys();\n return;\n }\n this.clearCore(local);\n },\n submit: (op: IMapClearOperation, localOpMetadata: unknown) => {\n // We don't reuse the metadata but send a new one on each submit.\n this.submitMapClearMessage(op);\n },\n getStashedOpLocalMetadata: (op: IMapClearOperation) => {\n // We don't reuse the metadata but send a new one on each submit.\n return this.getMapClearMessageLocalMetadata(op);\n },\n });\n messageHandlers.set(\n \"delete\",\n {\n process: (op: IMapDeleteOperation, local, localOpMetadata) => {\n if (!this.needProcessKeyOperation(op, local, localOpMetadata)) {\n return;\n }\n this.deleteCore(op.key, local);\n },\n submit: (op: IMapDeleteOperation, localOpMetadata: unknown) => {\n // We don't reuse the metadata but send a new one on each submit.\n this.submitMapKeyMessage(op);\n },\n getStashedOpLocalMetadata: (op: IMapDeleteOperation) => {\n // We don't reuse the metadata but send a new one on each submit.\n return this.getMapKeyMessageLocalMetadata(op);\n },\n });\n messageHandlers.set(\n \"set\",\n {\n process: (op: IMapSetOperation, local, localOpMetadata) => {\n if (!this.needProcessKeyOperation(op, local, localOpMetadata)) {\n return;\n }\n\n // needProcessKeyOperation should have returned false if local is true\n const context = this.makeLocal(op.key, op.value);\n this.setCore(op.key, context, local);\n },\n submit: (op: IMapSetOperation, localOpMetadata: unknown) => {\n // We don't reuse the metadata but send a new one on each submit.\n this.submitMapKeyMessage(op);\n },\n getStashedOpLocalMetadata: (op: IMapSetOperation) => {\n // We don't reuse the metadata but send a new one on each submit.\n return this.getMapKeyMessageLocalMetadata(op);\n },\n });\n\n return messageHandlers;\n }\n\n private getMapClearMessageLocalMetadata(op: IMapClearOperation): number {\n const pendingMessageId = ++this.pendingMessageId;\n this.pendingClearMessageId = pendingMessageId;\n return pendingMessageId;\n }\n\n /**\n * Submit a clear message to remote clients.\n * @param op - The clear message\n */\n private submitMapClearMessage(op: IMapClearOperation): void {\n const pendingMessageId = this.getMapClearMessageLocalMetadata(op);\n this.submitMessage(op, pendingMessageId);\n }\n\n private getMapKeyMessageLocalMetadata(op: IMapKeyOperation): number {\n const pendingMessageId = ++this.pendingMessageId;\n this.pendingKeys.set(op.key, pendingMessageId);\n return pendingMessageId;\n }\n\n /**\n * Submit a map key message to remote clients.\n * @param op - The map key message\n */\n private submitMapKeyMessage(op: IMapKeyOperation): void {\n const pendingMessageId = this.getMapKeyMessageLocalMetadata(op);\n this.submitMessage(op, pendingMessageId);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mapKernel.js","sourceRoot":"","sources":["../src/mapKernel.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2EAAiF;AACjF,+DAAyE;AAOzE,+CAIuB;AAgGvB;;GAEG;AACH,MAAa,SAAS;IAuClB;;;;;;;;OAQG;IACH,YACqB,UAA4B,EAC5B,MAAoB,EACpB,aAA0D,EAC1D,UAAyB,EACzB,YAAiD;QAJjD,eAAU,GAAV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K,CAAC,CAAC;YACzC,CAAC;YACD,MAAM,EAAE,CAAC,EAAoB,EAAE,eAAwB,EAAE,EAAE;gBACvD,iEAAiE;gBACjE,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;YACjC,CAAC;YACD,yBAAyB,EAAE,CAAC,EAAoB,EAAE,EAAE;gBAChD,iEAAiE;gBACjE,OAAO,IAAI,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;YAClD,CAAC;SACJ,CAAC,CAAC;QAEP,OAAO,eAAe,CAAC;IAC3B,CAAC;IAEO,+BAA+B,CAAC,EAAsB;QAC1D,MAAM,gBAAgB,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,qBAAqB,GAAG,gBAAgB,CAAC;QAC9C,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACK,qBAAqB,CAAC,EAAsB;QAChD,MAAM,gBAAgB,GAAG,IAAI,CAAC,+BAA+B,CAAC,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;IAC7C,CAAC;IAEO,6BAA6B,CAAC,EAAoB;QACtD,MAAM,gBAAgB,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;QAC/C,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACK,mBAAmB,CAAC,EAAoB;QAC5C,MAAM,gBAAgB,GAAG,IAAI,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;IAC7C,CAAC;CACJ;AAtiBD,8BAsiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { IFluidSerializer, ValueType } from \"@fluidframework/shared-object-base\";\nimport { assert, TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport {\n ISerializableValue,\n ISerializedValue,\n IValueChanged,\n ISharedMapEvents,\n} from \"./interfaces\";\nimport {\n ILocalValue,\n LocalValueMaker,\n makeSerializable,\n} from \"./localValues\";\n\n/**\n * Defines the means to process and submit a given op on a map.\n */\ninterface IMapMessageHandler {\n /**\n * Apply the given operation.\n * @param op - The map operation to apply\n * @param local - Whether the message originated from the local client\n * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n * For messages from a remote client, this will be undefined.\n */\n process(\n op: IMapOperation,\n local: boolean,\n localOpMetadata: unknown,\n ): void;\n\n /**\n * Communicate the operation to remote clients.\n * @param op - The map operation to submit\n * @param localOpMetadata - The metadata to be submitted with the message.\n */\n submit(op: IMapOperation, localOpMetadata: unknown): void;\n\n getStashedOpLocalMetadata(op: IMapOperation): unknown;\n}\n\n/**\n * Operation indicating a value should be set for a key.\n */\nexport interface IMapSetOperation {\n /**\n * String identifier of the operation type.\n */\n type: \"set\";\n\n /**\n * Map key being modified.\n */\n key: string;\n\n /**\n * Value to be set on the key.\n */\n value: ISerializableValue;\n}\n\n/**\n * Operation indicating a key should be deleted from the map.\n */\nexport interface IMapDeleteOperation {\n /**\n * String identifier of the operation type.\n */\n type: \"delete\";\n\n /**\n * Map key being modified.\n */\n key: string;\n}\n\n/**\n * Map key operations are one of several types.\n */\nexport type IMapKeyOperation = IMapSetOperation | IMapDeleteOperation;\n\n/**\n * Operation indicating the map should be cleared.\n */\nexport interface IMapClearOperation {\n /**\n * String identifier of the operation type.\n */\n type: \"clear\";\n}\n\n/**\n * Description of a map delta operation\n */\nexport type IMapOperation = IMapKeyOperation | IMapClearOperation;\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse\n */\nexport interface IMapDataObjectSerializable {\n [key: string]: ISerializableValue;\n}\n\nexport interface IMapDataObjectSerialized {\n [key: string]: ISerializedValue;\n}\n\n/**\n * A SharedMap is a map-like distributed data structure.\n */\nexport class MapKernel {\n /**\n * The number of key/value pairs stored in the map.\n */\n public get size(): number {\n return this.data.size;\n }\n\n /**\n * Mapping of op types to message handlers.\n */\n private readonly messageHandlers: ReadonlyMap<string, IMapMessageHandler> = new Map();\n\n /**\n * The in-memory data the map is storing.\n */\n private readonly data = new Map<string, ILocalValue>();\n\n /**\n * Keys that have been modified locally but not yet ack'd from the server.\n */\n private readonly pendingKeys: Map<string, number> = new Map();\n\n /**\n * This is used to assign a unique id to every outgoing operation and helps in tracking unack'd ops.\n */\n private pendingMessageId: number = -1;\n\n /**\n * If a clear has been performed locally but not yet ack'd from the server, then this stores the pending id\n * of that clear operation. Otherwise, is -1.\n */\n private pendingClearMessageId: number = -1;\n\n /**\n * Object to create encapsulations of the values stored in the map.\n */\n private readonly localValueMaker: LocalValueMaker;\n\n /**\n * Create a new shared map kernel.\n * @param serializer - The serializer to serialize / parse handles\n * @param handle - The handle of the shared object using the kernel\n * @param submitMessage - A callback to submit a message through the shared object\n * @param isAttached - To query whether the shared object should generate ops\n * @param valueTypes - The value types to register\n * @param eventEmitter - The object that will emit map events\n */\n constructor(\n private readonly serializer: IFluidSerializer,\n private readonly handle: IFluidHandle,\n private readonly submitMessage: (op: any, localOpMetadata: unknown) => void,\n private readonly isAttached: () => boolean,\n private readonly eventEmitter: TypedEventEmitter<ISharedMapEvents>,\n ) {\n this.localValueMaker = new LocalValueMaker(serializer);\n this.messageHandlers = this.getMessageHandlers();\n }\n\n /**\n * Get an iterator over the keys in this map.\n * @returns The iterator\n */\n public keys(): IterableIterator<string> {\n return this.data.keys();\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public entries(): IterableIterator<[string, any]> {\n const localEntriesIterator = this.data.entries();\n const iterator = {\n next(): IteratorResult<[string, any]> {\n const nextVal = localEntriesIterator.next();\n if (nextVal.done) {\n return { value: undefined, done: true };\n } else {\n // Unpack the stored value\n return { value: [nextVal.value[0], nextVal.value[1].value], done: false };\n }\n },\n [Symbol.iterator]() {\n return this;\n },\n };\n return iterator;\n }\n\n /**\n * Get an iterator over the values in this map.\n * @returns The iterator\n */\n public values(): IterableIterator<any> {\n const localValuesIterator = this.data.values();\n const iterator = {\n next(): IteratorResult<any> {\n const nextVal = localValuesIterator.next();\n if (nextVal.done) {\n return { value: undefined, done: true };\n } else {\n // Unpack the stored value\n return { value: nextVal.value.value, done: false };\n }\n },\n [Symbol.iterator]() {\n return this;\n },\n };\n return iterator;\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public [Symbol.iterator](): IterableIterator<[string, any]> {\n return this.entries();\n }\n\n /**\n * Executes the given callback on each entry in the map.\n * @param callbackFn - Callback function\n */\n public forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void {\n this.data.forEach((localValue, key, m) => {\n callbackFn(localValue.value, key, m);\n });\n }\n\n /**\n * {@inheritDoc ISharedMap.get}\n */\n public get<T = any>(key: string): T | undefined {\n if (!this.data.has(key)) {\n return undefined;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const localValue = this.data.get(key)!;\n\n return localValue.value as T;\n }\n\n /**\n * Check if a key exists in the map.\n * @param key - The key to check\n * @returns True if the key exists, false otherwise\n */\n public has(key: string): boolean {\n return this.data.has(key);\n }\n\n /**\n * {@inheritDoc ISharedMap.set}\n */\n public set(key: string, value: any) {\n // Undefined/null keys can't be serialized to JSON in the manner we currently snapshot.\n if (key === undefined || key === null) {\n throw new Error(\"Undefined and null keys are not supported\");\n }\n\n // Create a local value and serialize it.\n const localValue = this.localValueMaker.fromInMemory(value);\n const serializableValue = makeSerializable(\n localValue,\n this.serializer,\n this.handle);\n\n // Set the value locally.\n this.setCore(\n key,\n localValue,\n true,\n );\n\n // If we are not attached, don't submit the op.\n if (!this.isAttached()) {\n return;\n }\n\n const op: IMapSetOperation = {\n key,\n type: \"set\",\n value: serializableValue,\n };\n this.submitMapKeyMessage(op);\n }\n\n /**\n * Delete a key from the map.\n * @param key - Key to delete\n * @returns True if the key existed and was deleted, false if it did not exist\n */\n public delete(key: string): boolean {\n // Delete the key locally first.\n const successfullyRemoved = this.deleteCore(key, true);\n\n // If we are not attached, don't submit the op.\n if (!this.isAttached()) {\n return successfullyRemoved;\n }\n\n const op: IMapDeleteOperation = {\n key,\n type: \"delete\",\n };\n this.submitMapKeyMessage(op);\n\n return successfullyRemoved;\n }\n\n /**\n * Clear all data from the map.\n */\n public clear(): void {\n // Clear the data locally first.\n this.clearCore(true);\n\n // If we are not attached, don't submit the op.\n if (!this.isAttached()) {\n return;\n }\n\n const op: IMapClearOperation = {\n type: \"clear\",\n };\n this.submitMapClearMessage(op);\n }\n\n /**\n * Serializes the data stored in the shared map to a JSON string\n * @param serializer - The serializer to use to serialize handles in its values.\n * @returns A JSON string containing serialized map data\n */\n public getSerializedStorage(serializer: IFluidSerializer): IMapDataObjectSerialized {\n const serializableMapData: IMapDataObjectSerialized = {};\n this.data.forEach((localValue, key) => {\n serializableMapData[key] = localValue.makeSerialized(serializer, this.handle);\n });\n return serializableMapData;\n }\n\n public getSerializableStorage(serializer: IFluidSerializer): IMapDataObjectSerializable {\n const serializableMapData: IMapDataObjectSerializable = {};\n this.data.forEach((localValue, key) => {\n serializableMapData[key] = makeSerializable(localValue, serializer, this.handle);\n });\n return serializableMapData;\n }\n\n public serialize(serializer: IFluidSerializer): string {\n return JSON.stringify(this.getSerializableStorage(serializer));\n }\n\n /**\n * Populate the kernel with the given map data.\n * @param data - A JSON string containing serialized map data\n */\n public populateFromSerializable(json: IMapDataObjectSerializable): void {\n for (const [key, serializable] of Object.entries(json)) {\n const localValue = {\n key,\n value: this.makeLocal(key, serializable),\n };\n\n this.data.set(localValue.key, localValue.value);\n }\n }\n\n public populate(json: string): void {\n this.populateFromSerializable(JSON.parse(json) as IMapDataObjectSerializable);\n }\n\n /**\n * Submit the given op if a handler is registered.\n * @param op - The operation to attempt to submit\n * @param localOpMetadata - The local metadata associated with the op. This is kept locally by the runtime\n * and not sent to the server. This will be sent back when this message is received back from the server. This is\n * also sent if we are asked to resubmit the message.\n * @returns True if the operation was submitted, false otherwise.\n */\n public trySubmitMessage(op: any, localOpMetadata: unknown): boolean {\n const type: string = op.type;\n if (this.messageHandlers.has(type)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.messageHandlers.get(type)!.submit(op as IMapOperation, localOpMetadata);\n return true;\n }\n return false;\n }\n\n public tryGetStashedOpLocalMetadata(op: any): unknown {\n const type: string = op.type;\n if (this.messageHandlers.has(type)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.messageHandlers.get(type)!.getStashedOpLocalMetadata(op as IMapOperation);\n }\n throw new Error(\"no apply stashed op handler\");\n }\n\n /**\n * Process the given op if a handler is registered.\n * @param message - The message to process\n * @param local - Whether the message originated from the local client\n * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n * For messages from a remote client, this will be undefined.\n * @returns True if the operation was processed, false otherwise.\n */\n public tryProcessMessage(\n op: IMapOperation,\n local: boolean,\n localOpMetadata: unknown,\n ): boolean {\n if (this.messageHandlers.has(op.type)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.messageHandlers\n .get(op.type)!\n .process(op, local, localOpMetadata);\n return true;\n }\n return false;\n }\n\n /**\n * Set implementation used for both locally sourced sets as well as incoming remote sets.\n * @param key - The key being set\n * @param value - The value being set\n * @param local - Whether the message originated from the local client\n * @param op - The message if from a remote set, or null if from a local set\n */\n private setCore(key: string, value: ILocalValue, local: boolean): void {\n const previousValue = this.get(key);\n this.data.set(key, value);\n const event: IValueChanged = { key, previousValue };\n this.eventEmitter.emit(\"valueChanged\", event, local, this.eventEmitter);\n }\n\n /**\n * Clear implementation used for both locally sourced clears as well as incoming remote clears.\n * @param local - Whether the message originated from the local client\n * @param op - The message if from a remote clear, or null if from a local clear\n */\n private clearCore(local: boolean): void {\n this.data.clear();\n this.eventEmitter.emit(\"clear\", local, this.eventEmitter);\n }\n\n /**\n * Delete implementation used for both locally sourced deletes as well as incoming remote deletes.\n * @param key - The key being deleted\n * @param local - Whether the message originated from the local client\n * @param op - The message if from a remote delete, or null if from a local delete\n * @returns True if the key existed and was deleted, false if it did not exist\n */\n private deleteCore(key: string, local: boolean): boolean {\n const previousValue = this.get(key);\n const successfullyRemoved = this.data.delete(key);\n if (successfullyRemoved) {\n const event: IValueChanged = { key, previousValue };\n this.eventEmitter.emit(\"valueChanged\", event, local, this.eventEmitter);\n }\n return successfullyRemoved;\n }\n\n /**\n * Clear all keys in memory in response to a remote clear, but retain keys we have modified but not yet been ack'd.\n */\n private clearExceptPendingKeys(): void {\n // Assuming the pendingKeys is small and the map is large\n // we will get the value for the pendingKeys and clear the map\n const temp = new Map<string, ILocalValue>();\n this.pendingKeys.forEach((value, key) => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n temp.set(key, this.data.get(key)!);\n });\n this.data.clear();\n temp.forEach((value, key) => {\n this.data.set(key, value);\n });\n }\n\n /**\n * The remote ISerializableValue we're receiving (either as a result of a load or an incoming set op) will\n * have the information we need to create a real object, but will not be the real object yet. For example,\n * we might know it's a map and the map's ID but not have the actual map or its data yet. makeLocal's\n * job is to convert that information into a real object for local usage.\n * @param key - The key that the caller intends to store the local value into (used for ops later). But\n * doesn't actually store the local value into that key. So better not lie!\n * @param serializable - The remote information that we can convert into a real object\n * @returns The local value that was produced\n */\n private makeLocal(key: string, serializable: ISerializableValue): ILocalValue {\n if (serializable.type === ValueType[ValueType.Plain] || serializable.type === ValueType[ValueType.Shared]) {\n return this.localValueMaker.fromSerializable(serializable);\n } else {\n throw new Error(\"Unknown local value type\");\n }\n }\n\n /**\n * If our local operations that have not yet been ack'd will eventually overwrite an incoming operation, we should\n * not process the incoming operation.\n * @param op - Operation to check\n * @param local - Whether the message originated from the local client\n * @param message - The message\n * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n * For messages from a remote client, this will be undefined.\n * @returns True if the operation should be processed, false otherwise\n */\n private needProcessKeyOperation(\n op: IMapKeyOperation,\n local: boolean,\n localOpMetadata: unknown,\n ): boolean {\n if (this.pendingClearMessageId !== -1) {\n if (local) {\n assert(localOpMetadata !== undefined && localOpMetadata as number < this.pendingClearMessageId,\n 0x013 /* \"Received out of order op when there is an unackd clear message\" */);\n }\n // If we have an unack'd clear, we can ignore all ops.\n return false;\n }\n\n if (this.pendingKeys.has(op.key)) {\n // Found an unack'd op. Clear it from the map if the pendingMessageId in the map matches this message's\n // and don't process the op.\n if (local) {\n assert(localOpMetadata !== undefined,\n 0x014 /* pendingMessageId is missing from the local client's operation */);\n const pendingMessageId = localOpMetadata as number;\n const pendingKeyMessageId = this.pendingKeys.get(op.key);\n if (pendingKeyMessageId === pendingMessageId) {\n this.pendingKeys.delete(op.key);\n }\n }\n return false;\n }\n\n // If we don't have a NACK op on the key, we need to process the remote ops.\n return !local;\n }\n\n /**\n * Get the message handlers for the map.\n * @returns A map of string op names to IMapMessageHandlers for those ops\n */\n private getMessageHandlers() {\n const messageHandlers = new Map<string, IMapMessageHandler>();\n messageHandlers.set(\n \"clear\",\n {\n process: (op: IMapClearOperation, local, localOpMetadata) => {\n if (local) {\n assert(localOpMetadata !== undefined,\n 0x015 /* \"pendingMessageId is missing from the local client's clear operation\" */);\n const pendingMessageId = localOpMetadata as number;\n if (this.pendingClearMessageId === pendingMessageId) {\n this.pendingClearMessageId = -1;\n }\n return;\n }\n if (this.pendingKeys.size !== 0) {\n this.clearExceptPendingKeys();\n return;\n }\n this.clearCore(local);\n },\n submit: (op: IMapClearOperation, localOpMetadata: unknown) => {\n // We don't reuse the metadata but send a new one on each submit.\n this.submitMapClearMessage(op);\n },\n getStashedOpLocalMetadata: (op: IMapClearOperation) => {\n // We don't reuse the metadata but send a new one on each submit.\n return this.getMapClearMessageLocalMetadata(op);\n },\n });\n messageHandlers.set(\n \"delete\",\n {\n process: (op: IMapDeleteOperation, local, localOpMetadata) => {\n if (!this.needProcessKeyOperation(op, local, localOpMetadata)) {\n return;\n }\n this.deleteCore(op.key, local);\n },\n submit: (op: IMapDeleteOperation, localOpMetadata: unknown) => {\n // We don't reuse the metadata but send a new one on each submit.\n this.submitMapKeyMessage(op);\n },\n getStashedOpLocalMetadata: (op: IMapDeleteOperation) => {\n // We don't reuse the metadata but send a new one on each submit.\n return this.getMapKeyMessageLocalMetadata(op);\n },\n });\n messageHandlers.set(\n \"set\",\n {\n process: (op: IMapSetOperation, local, localOpMetadata) => {\n if (!this.needProcessKeyOperation(op, local, localOpMetadata)) {\n return;\n }\n\n // needProcessKeyOperation should have returned false if local is true\n const context = this.makeLocal(op.key, op.value);\n this.setCore(op.key, context, local);\n },\n submit: (op: IMapSetOperation, localOpMetadata: unknown) => {\n // We don't reuse the metadata but send a new one on each submit.\n this.submitMapKeyMessage(op);\n },\n getStashedOpLocalMetadata: (op: IMapSetOperation) => {\n // We don't reuse the metadata but send a new one on each submit.\n return this.getMapKeyMessageLocalMetadata(op);\n },\n });\n\n return messageHandlers;\n }\n\n private getMapClearMessageLocalMetadata(op: IMapClearOperation): number {\n const pendingMessageId = ++this.pendingMessageId;\n this.pendingClearMessageId = pendingMessageId;\n return pendingMessageId;\n }\n\n /**\n * Submit a clear message to remote clients.\n * @param op - The clear message\n */\n private submitMapClearMessage(op: IMapClearOperation): void {\n const pendingMessageId = this.getMapClearMessageLocalMetadata(op);\n this.submitMessage(op, pendingMessageId);\n }\n\n private getMapKeyMessageLocalMetadata(op: IMapKeyOperation): number {\n const pendingMessageId = ++this.pendingMessageId;\n this.pendingKeys.set(op.key, pendingMessageId);\n return pendingMessageId;\n }\n\n /**\n * Submit a map key message to remote clients.\n * @param op - The map key message\n */\n private submitMapKeyMessage(op: IMapKeyOperation): void {\n const pendingMessageId = this.getMapKeyMessageLocalMetadata(op);\n this.submitMessage(op, pendingMessageId);\n }\n}\n"]}
|
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/map";
|
|
8
|
-
export declare const pkgVersion = "0.59.
|
|
8
|
+
export declare const pkgVersion = "0.59.4000-71130";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,wBAAwB,CAAC;AAC7C,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,wBAAwB,CAAC;AAC7C,eAAO,MAAM,UAAU,oBAAoB,CAAC"}
|
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/map";
|
|
11
|
-
exports.pkgVersion = "0.59.
|
|
11
|
+
exports.pkgVersion = "0.59.4000-71130";
|
|
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,qBAAqB,CAAC;AAChC,QAAA,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,qBAAqB,CAAC;AAChC,QAAA,UAAU,GAAG,iBAAiB,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/map\";\nexport const pkgVersion = \"0.59.4000-71130\";\n"]}
|
package/lib/directory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACH,yBAAyB,EAE5B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAa,MAAM,oCAAoC,CAAC;AAG/F,OAAO,EACH,UAAU,EAGV,kBAAkB,EAElB,gBAAgB,EAChB,sBAAsB,EAEzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAEH,eAAe,EAElB,MAAM,eAAe,CAAC;AAkCvB;;GAEG;AACH,UAAU,sBAAsB;IAC5B;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;IAEZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,kBAAkB,CAAC;CAC7B;AAED;;GAEG;AACH,UAAU,yBAAyB;IAC/B;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,aAAK,sBAAsB,GAAG,sBAAsB,GAAG,yBAAyB,CAAC;AAEjF;;GAEG;AAC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