@fluidframework/map 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.217212
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/api-extractor-lint.json +13 -0
- package/api-report/map.api.md +42 -44
- package/dist/directory.cjs +2 -11
- package/dist/directory.cjs.map +1 -1
- package/dist/directory.d.ts +14 -36
- package/dist/directory.d.ts.map +1 -1
- package/dist/interfaces.cjs.map +1 -1
- package/dist/interfaces.d.ts +10 -20
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/localValues.cjs +1 -2
- package/dist/localValues.cjs.map +1 -1
- package/dist/localValues.d.ts +2 -4
- package/dist/localValues.d.ts.map +1 -1
- package/dist/map-alpha.d.ts +51 -902
- package/dist/map-beta.d.ts +59 -906
- package/dist/map-public.d.ts +59 -906
- package/dist/map-untrimmed.d.ts +28 -70
- package/dist/map.cjs +2 -10
- package/dist/map.cjs.map +1 -1
- package/dist/map.d.ts +2 -10
- package/dist/map.d.ts.map +1 -1
- package/dist/packageVersion.cjs +1 -1
- package/dist/packageVersion.cjs.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/lib/directory.d.ts +14 -36
- package/lib/directory.d.ts.map +1 -1
- package/lib/directory.mjs +2 -11
- package/lib/directory.mjs.map +1 -1
- package/lib/interfaces.d.ts +10 -20
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.mjs.map +1 -1
- package/lib/localValues.d.ts +2 -4
- package/lib/localValues.d.ts.map +1 -1
- package/lib/localValues.mjs +1 -2
- package/lib/localValues.mjs.map +1 -1
- package/lib/map-alpha.d.ts +51 -902
- package/lib/map-beta.d.ts +59 -906
- package/lib/map-public.d.ts +59 -906
- package/lib/map-untrimmed.d.ts +28 -70
- package/lib/map.d.ts +2 -10
- package/lib/map.d.ts.map +1 -1
- package/lib/map.mjs +2 -10
- package/lib/map.mjs.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.mjs +1 -1
- package/lib/packageVersion.mjs.map +1 -1
- package/package.json +17 -16
- package/src/directory.ts +14 -36
- package/src/interfaces.ts +10 -20
- package/src/localValues.ts +2 -4
- package/src/map.ts +2 -10
- package/src/packageVersion.ts +1 -1
package/lib/map-untrimmed.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ import { SharedObject } from '@fluidframework/shared-object-base';
|
|
|
32
32
|
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedDirectory}.
|
|
33
33
|
*
|
|
34
34
|
* @sealed
|
|
35
|
-
* @
|
|
35
|
+
* @internal
|
|
36
36
|
*/
|
|
37
37
|
export declare class DirectoryFactory implements IChannelFactory {
|
|
38
38
|
/**
|
|
@@ -63,8 +63,7 @@ export declare class DirectoryFactory implements IChannelFactory {
|
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Create info for the subdirectory.
|
|
66
|
-
*
|
|
67
|
-
* @public
|
|
66
|
+
* @internal
|
|
68
67
|
*/
|
|
69
68
|
export declare interface ICreateInfo {
|
|
70
69
|
/**
|
|
@@ -81,8 +80,7 @@ export declare interface ICreateInfo {
|
|
|
81
80
|
* Interface describing actions on a directory.
|
|
82
81
|
*
|
|
83
82
|
* @remarks When used as a Map, operates on its keys.
|
|
84
|
-
*
|
|
85
|
-
* @public
|
|
83
|
+
* @internal
|
|
86
84
|
*/
|
|
87
85
|
export declare interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {
|
|
88
86
|
/**
|
|
@@ -147,8 +145,7 @@ export declare interface IDirectory extends Map<string, any>, IEventProvider<IDi
|
|
|
147
145
|
|
|
148
146
|
/**
|
|
149
147
|
* Operation indicating the directory should be cleared.
|
|
150
|
-
*
|
|
151
|
-
* @public
|
|
148
|
+
* @internal
|
|
152
149
|
*/
|
|
153
150
|
export declare interface IDirectoryClearOperation {
|
|
154
151
|
/**
|
|
@@ -163,8 +160,7 @@ export declare interface IDirectoryClearOperation {
|
|
|
163
160
|
|
|
164
161
|
/**
|
|
165
162
|
* Operation indicating a subdirectory should be created.
|
|
166
|
-
*
|
|
167
|
-
* @public
|
|
163
|
+
* @internal
|
|
168
164
|
*/
|
|
169
165
|
export declare interface IDirectoryCreateSubDirectoryOperation {
|
|
170
166
|
/**
|
|
@@ -188,8 +184,7 @@ export declare interface IDirectoryCreateSubDirectoryOperation {
|
|
|
188
184
|
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
|
|
189
185
|
* | JSON.stringify}, direct result from
|
|
190
186
|
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse | JSON.parse}.
|
|
191
|
-
*
|
|
192
|
-
* @public
|
|
187
|
+
* @internal
|
|
193
188
|
*/
|
|
194
189
|
export declare interface IDirectoryDataObject {
|
|
195
190
|
/**
|
|
@@ -216,8 +211,7 @@ export declare interface IDirectoryDataObject {
|
|
|
216
211
|
|
|
217
212
|
/**
|
|
218
213
|
* Operation indicating a key should be deleted from the directory.
|
|
219
|
-
*
|
|
220
|
-
* @public
|
|
214
|
+
* @internal
|
|
221
215
|
*/
|
|
222
216
|
export declare interface IDirectoryDeleteOperation {
|
|
223
217
|
/**
|
|
@@ -236,8 +230,7 @@ export declare interface IDirectoryDeleteOperation {
|
|
|
236
230
|
|
|
237
231
|
/**
|
|
238
232
|
* Operation indicating a subdirectory should be deleted.
|
|
239
|
-
*
|
|
240
|
-
* @public
|
|
233
|
+
* @internal
|
|
241
234
|
*/
|
|
242
235
|
export declare interface IDirectoryDeleteSubDirectoryOperation {
|
|
243
236
|
/**
|
|
@@ -256,8 +249,7 @@ export declare interface IDirectoryDeleteSubDirectoryOperation {
|
|
|
256
249
|
|
|
257
250
|
/**
|
|
258
251
|
* Events emitted in response to changes to the directory data.
|
|
259
|
-
*
|
|
260
|
-
* @public
|
|
252
|
+
* @internal
|
|
261
253
|
*/
|
|
262
254
|
export declare interface IDirectoryEvents extends IEvent {
|
|
263
255
|
/**
|
|
@@ -323,8 +315,7 @@ export declare interface IDirectoryEvents extends IEvent {
|
|
|
323
315
|
|
|
324
316
|
/**
|
|
325
317
|
* An operation on a specific key within a directory.
|
|
326
|
-
*
|
|
327
|
-
* @public
|
|
318
|
+
* @internal
|
|
328
319
|
*/
|
|
329
320
|
export declare type IDirectoryKeyOperation = IDirectorySetOperation | IDirectoryDeleteOperation;
|
|
330
321
|
|
|
@@ -346,15 +337,13 @@ export declare interface IDirectoryNewStorageFormat {
|
|
|
346
337
|
|
|
347
338
|
/**
|
|
348
339
|
* Any operation on a directory.
|
|
349
|
-
*
|
|
350
|
-
* @public
|
|
340
|
+
* @internal
|
|
351
341
|
*/
|
|
352
342
|
export declare type IDirectoryOperation = IDirectoryStorageOperation | IDirectorySubDirectoryOperation;
|
|
353
343
|
|
|
354
344
|
/**
|
|
355
345
|
* Operation indicating a value should be set for a key.
|
|
356
|
-
*
|
|
357
|
-
* @public
|
|
346
|
+
* @internal
|
|
358
347
|
*/
|
|
359
348
|
export declare interface IDirectorySetOperation {
|
|
360
349
|
/**
|
|
@@ -377,22 +366,19 @@ export declare interface IDirectorySetOperation {
|
|
|
377
366
|
|
|
378
367
|
/**
|
|
379
368
|
* An operation on one or more of the keys within a directory.
|
|
380
|
-
*
|
|
381
|
-
* @public
|
|
369
|
+
* @internal
|
|
382
370
|
*/
|
|
383
371
|
export declare type IDirectoryStorageOperation = IDirectoryKeyOperation | IDirectoryClearOperation;
|
|
384
372
|
|
|
385
373
|
/**
|
|
386
374
|
* An operation on the subdirectories within a directory.
|
|
387
|
-
*
|
|
388
|
-
* @public
|
|
375
|
+
* @internal
|
|
389
376
|
*/
|
|
390
377
|
export declare type IDirectorySubDirectoryOperation = IDirectoryCreateSubDirectoryOperation | IDirectoryDeleteSubDirectoryOperation;
|
|
391
378
|
|
|
392
379
|
/**
|
|
393
380
|
* Type of "valueChanged" event parameter for {@link ISharedDirectory}.
|
|
394
|
-
*
|
|
395
|
-
* @public
|
|
381
|
+
* @internal
|
|
396
382
|
*/
|
|
397
383
|
export declare interface IDirectoryValueChanged extends IValueChanged {
|
|
398
384
|
/**
|
|
@@ -403,8 +389,7 @@ export declare interface IDirectoryValueChanged extends IValueChanged {
|
|
|
403
389
|
|
|
404
390
|
/**
|
|
405
391
|
* A local value to be stored in a container type Distributed Data Store (DDS).
|
|
406
|
-
*
|
|
407
|
-
* @public
|
|
392
|
+
* @internal
|
|
408
393
|
*/
|
|
409
394
|
export declare interface ILocalValue {
|
|
410
395
|
/**
|
|
@@ -446,8 +431,7 @@ export declare interface ILocalValue {
|
|
|
446
431
|
* channel ID.
|
|
447
432
|
*
|
|
448
433
|
* @deprecated This type is legacy and deprecated.
|
|
449
|
-
*
|
|
450
|
-
* @public
|
|
434
|
+
* @internal
|
|
451
435
|
*/
|
|
452
436
|
export declare interface ISerializableValue {
|
|
453
437
|
/**
|
|
@@ -462,8 +446,7 @@ export declare interface ISerializableValue {
|
|
|
462
446
|
|
|
463
447
|
/**
|
|
464
448
|
* Serialized {@link ISerializableValue} counterpart.
|
|
465
|
-
*
|
|
466
|
-
* @public
|
|
449
|
+
* @internal
|
|
467
450
|
*/
|
|
468
451
|
export declare interface ISerializedValue {
|
|
469
452
|
/**
|
|
@@ -482,8 +465,7 @@ export declare interface ISerializedValue {
|
|
|
482
465
|
* Provides a hierarchical organization of map-like data structures as SubDirectories.
|
|
483
466
|
* The values stored within can be accessed like a map, and the hierarchy can be navigated using path syntax.
|
|
484
467
|
* SubDirectories can be retrieved for use as working directories.
|
|
485
|
-
*
|
|
486
|
-
* @public
|
|
468
|
+
* @internal
|
|
487
469
|
*/
|
|
488
470
|
export declare interface ISharedDirectory extends ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>, Omit<IDirectory, "on" | "once" | "off"> {
|
|
489
471
|
[Symbol.iterator](): IterableIterator<[string, any]>;
|
|
@@ -495,8 +477,7 @@ export declare interface ISharedDirectory extends ISharedObject<ISharedDirectory
|
|
|
495
477
|
*
|
|
496
478
|
* @remarks
|
|
497
479
|
* These events only emit on the {@link ISharedDirectory} itself, and not on subdirectories.
|
|
498
|
-
*
|
|
499
|
-
* @public
|
|
480
|
+
* @internal
|
|
500
481
|
*/
|
|
501
482
|
export declare interface ISharedDirectoryEvents extends ISharedObjectEvents {
|
|
502
483
|
/**
|
|
@@ -559,8 +540,7 @@ export declare interface ISharedDirectoryEvents extends ISharedObjectEvents {
|
|
|
559
540
|
* {@link @fluidframework/datastore#FluidObjectHandle}.
|
|
560
541
|
*
|
|
561
542
|
* For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.
|
|
562
|
-
*
|
|
563
|
-
* @public
|
|
543
|
+
* @internal
|
|
564
544
|
*/
|
|
565
545
|
export declare interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
|
|
566
546
|
/**
|
|
@@ -580,8 +560,7 @@ export declare interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map
|
|
|
580
560
|
|
|
581
561
|
/**
|
|
582
562
|
* Events emitted in response to changes to the {@link ISharedMap | map} data.
|
|
583
|
-
*
|
|
584
|
-
* @public
|
|
563
|
+
* @internal
|
|
585
564
|
*/
|
|
586
565
|
export declare interface ISharedMapEvents extends ISharedObjectEvents {
|
|
587
566
|
/**
|
|
@@ -610,8 +589,7 @@ export declare interface ISharedMapEvents extends ISharedObjectEvents {
|
|
|
610
589
|
|
|
611
590
|
/**
|
|
612
591
|
* Type of "valueChanged" event parameter.
|
|
613
|
-
*
|
|
614
|
-
* @public
|
|
592
|
+
* @internal
|
|
615
593
|
*/
|
|
616
594
|
export declare interface IValueChanged {
|
|
617
595
|
/**
|
|
@@ -627,8 +605,7 @@ export declare interface IValueChanged {
|
|
|
627
605
|
/**
|
|
628
606
|
* Enables a container type {@link https://fluidframework.com/docs/build/dds/ | DDS} to produce and store local
|
|
629
607
|
* values with minimal awareness of how those objects are stored, serialized, and deserialized.
|
|
630
|
-
*
|
|
631
|
-
* @public
|
|
608
|
+
* @internal
|
|
632
609
|
*/
|
|
633
610
|
export declare class LocalValueMaker {
|
|
634
611
|
private readonly serializer;
|
|
@@ -654,7 +631,7 @@ export declare class LocalValueMaker {
|
|
|
654
631
|
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedMap}.
|
|
655
632
|
*
|
|
656
633
|
* @sealed
|
|
657
|
-
* @
|
|
634
|
+
* @internal
|
|
658
635
|
*/
|
|
659
636
|
export declare class MapFactory implements IChannelFactory {
|
|
660
637
|
/**
|
|
@@ -695,7 +672,7 @@ export declare class MapFactory implements IChannelFactory {
|
|
|
695
672
|
* ```
|
|
696
673
|
*
|
|
697
674
|
* @sealed
|
|
698
|
-
* @
|
|
675
|
+
* @internal
|
|
699
676
|
*/
|
|
700
677
|
export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents> implements ISharedDirectory {
|
|
701
678
|
/**
|
|
@@ -720,9 +697,7 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
720
697
|
* {@inheritDoc IDirectory.absolutePath}
|
|
721
698
|
*/
|
|
722
699
|
get absolutePath(): string;
|
|
723
|
-
|
|
724
|
-
* @internal
|
|
725
|
-
*/
|
|
700
|
+
/***/
|
|
726
701
|
readonly localValueMaker: LocalValueMaker;
|
|
727
702
|
/**
|
|
728
703
|
* Root of the SharedDirectory, most operations on the SharedDirectory itself act on the root.
|
|
@@ -825,7 +800,6 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
825
800
|
getWorkingDirectory(relativePath: string): IDirectory | undefined;
|
|
826
801
|
/**
|
|
827
802
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
828
|
-
* @internal
|
|
829
803
|
*/
|
|
830
804
|
protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
831
805
|
/**
|
|
@@ -833,38 +807,31 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
833
807
|
* @param op - Op to submit
|
|
834
808
|
* @param localOpMetadata - The local metadata associated with the op. We send a unique id that is used to track
|
|
835
809
|
* this op while it has not been ack'd. This will be sent when we receive this op back from the server.
|
|
836
|
-
* @internal
|
|
837
810
|
*/
|
|
838
811
|
submitDirectoryMessage(op: IDirectoryOperation, localOpMetadata: unknown): void;
|
|
839
812
|
/**
|
|
840
813
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
841
|
-
* @internal
|
|
842
814
|
*/
|
|
843
815
|
protected onDisconnect(): void;
|
|
844
816
|
/**
|
|
845
817
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
|
|
846
|
-
* @internal
|
|
847
818
|
*/
|
|
848
819
|
protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
|
|
849
820
|
/**
|
|
850
821
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
851
|
-
* @internal
|
|
852
822
|
*/
|
|
853
823
|
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
854
824
|
/**
|
|
855
825
|
* Populate the directory with the given directory data.
|
|
856
826
|
* @param data - A JSON string containing serialized directory data
|
|
857
|
-
* @internal
|
|
858
827
|
*/
|
|
859
828
|
protected populate(data: IDirectoryDataObject): void;
|
|
860
829
|
/**
|
|
861
830
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
862
|
-
* @internal
|
|
863
831
|
*/
|
|
864
832
|
protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
865
833
|
/**
|
|
866
834
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
|
|
867
|
-
* @internal
|
|
868
835
|
*/
|
|
869
836
|
protected rollback(content: unknown, localOpMetadata: unknown): void;
|
|
870
837
|
/**
|
|
@@ -895,7 +862,6 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
895
862
|
private setMessageHandlers;
|
|
896
863
|
/**
|
|
897
864
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
898
|
-
* @internal
|
|
899
865
|
*/
|
|
900
866
|
protected applyStashedOp(op: unknown): unknown;
|
|
901
867
|
private serializeDirectory;
|
|
@@ -903,8 +869,7 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
903
869
|
|
|
904
870
|
/**
|
|
905
871
|
* {@inheritDoc ISharedMap}
|
|
906
|
-
*
|
|
907
|
-
* @public
|
|
872
|
+
* @internal
|
|
908
873
|
*/
|
|
909
874
|
export declare class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {
|
|
910
875
|
/**
|
|
@@ -997,37 +962,30 @@ export declare class SharedMap extends SharedObject<ISharedMapEvents> implements
|
|
|
997
962
|
clear(): void;
|
|
998
963
|
/**
|
|
999
964
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
1000
|
-
* @internal
|
|
1001
965
|
*/
|
|
1002
966
|
protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
1003
967
|
/**
|
|
1004
968
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
1005
|
-
* @internal
|
|
1006
969
|
*/
|
|
1007
970
|
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
1008
971
|
/**
|
|
1009
972
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
1010
|
-
* @internal
|
|
1011
973
|
*/
|
|
1012
974
|
protected onDisconnect(): void;
|
|
1013
975
|
/**
|
|
1014
976
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
|
|
1015
|
-
* @internal
|
|
1016
977
|
*/
|
|
1017
978
|
protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
|
|
1018
979
|
/**
|
|
1019
980
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
1020
|
-
* @internal
|
|
1021
981
|
*/
|
|
1022
982
|
protected applyStashedOp(content: unknown): unknown;
|
|
1023
983
|
/**
|
|
1024
984
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
1025
|
-
* @internal
|
|
1026
985
|
*/
|
|
1027
986
|
protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
1028
987
|
/**
|
|
1029
988
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
|
|
1030
|
-
* @internal
|
|
1031
989
|
*/
|
|
1032
990
|
protected rollback(content: unknown, localOpMetadata: unknown): void;
|
|
1033
991
|
}
|
package/lib/map.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { ISharedMap, ISharedMapEvents } from "./interfaces";
|
|
|
11
11
|
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedMap}.
|
|
12
12
|
*
|
|
13
13
|
* @sealed
|
|
14
|
-
* @
|
|
14
|
+
* @internal
|
|
15
15
|
*/
|
|
16
16
|
export declare class MapFactory implements IChannelFactory {
|
|
17
17
|
/**
|
|
@@ -41,8 +41,7 @@ export declare class MapFactory implements IChannelFactory {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* {@inheritDoc ISharedMap}
|
|
44
|
-
*
|
|
45
|
-
* @public
|
|
44
|
+
* @internal
|
|
46
45
|
*/
|
|
47
46
|
export declare class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {
|
|
48
47
|
/**
|
|
@@ -135,37 +134,30 @@ export declare class SharedMap extends SharedObject<ISharedMapEvents> implements
|
|
|
135
134
|
clear(): void;
|
|
136
135
|
/**
|
|
137
136
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
138
|
-
* @internal
|
|
139
137
|
*/
|
|
140
138
|
protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
141
139
|
/**
|
|
142
140
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
143
|
-
* @internal
|
|
144
141
|
*/
|
|
145
142
|
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
146
143
|
/**
|
|
147
144
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
148
|
-
* @internal
|
|
149
145
|
*/
|
|
150
146
|
protected onDisconnect(): void;
|
|
151
147
|
/**
|
|
152
148
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
|
|
153
|
-
* @internal
|
|
154
149
|
*/
|
|
155
150
|
protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
|
|
156
151
|
/**
|
|
157
152
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
158
|
-
* @internal
|
|
159
153
|
*/
|
|
160
154
|
protected applyStashedOp(content: unknown): unknown;
|
|
161
155
|
/**
|
|
162
156
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
163
|
-
* @internal
|
|
164
157
|
*/
|
|
165
158
|
protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
166
159
|
/**
|
|
167
160
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
|
|
168
|
-
* @internal
|
|
169
161
|
*/
|
|
170
162
|
protected rollback(content: unknown, localOpMetadata: unknown): void;
|
|
171
163
|
}
|
package/lib/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,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE/F,OA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,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,GAAG,IAAI;IAK1F;;OAEG;IAGI,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAI/C;;;;OAIG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIhC;;OAEG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAK7C;;;;OAIG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAInC;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;OAEG;IACH,SAAS,CAAC,aAAa,CACtB,UAAU,EAAE,gBAAgB,EAC5B,gBAAgB,CAAC,EAAE,iBAAiB,GAClC,qBAAqB;IAyExB;;OAEG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBxE;;OAEG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;IAE9B;;OAEG;IACH,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;IAIxE;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;IAInD;;OAEG;IACH,SAAS,CAAC,WAAW,CACpB,OAAO,EAAE,yBAAyB,EAClC,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,OAAO,GACtB,IAAI;IAUP;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;CAGpE"}
|
package/lib/map.mjs
CHANGED
|
@@ -14,7 +14,7 @@ const snapshotFileName = "header";
|
|
|
14
14
|
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedMap}.
|
|
15
15
|
*
|
|
16
16
|
* @sealed
|
|
17
|
-
* @
|
|
17
|
+
* @internal
|
|
18
18
|
*/
|
|
19
19
|
export class MapFactory {
|
|
20
20
|
/**
|
|
@@ -60,8 +60,7 @@ MapFactory.Attributes = {
|
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
62
|
* {@inheritDoc ISharedMap}
|
|
63
|
-
*
|
|
64
|
-
* @public
|
|
63
|
+
* @internal
|
|
65
64
|
*/
|
|
66
65
|
export class SharedMap extends SharedObject {
|
|
67
66
|
/**
|
|
@@ -191,7 +190,6 @@ export class SharedMap extends SharedObject {
|
|
|
191
190
|
}
|
|
192
191
|
/**
|
|
193
192
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
194
|
-
* @internal
|
|
195
193
|
*/
|
|
196
194
|
summarizeCore(serializer, telemetryContext) {
|
|
197
195
|
let currentSize = 0;
|
|
@@ -259,7 +257,6 @@ export class SharedMap extends SharedObject {
|
|
|
259
257
|
}
|
|
260
258
|
/**
|
|
261
259
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
262
|
-
* @internal
|
|
263
260
|
*/
|
|
264
261
|
async loadCore(storage) {
|
|
265
262
|
const json = await readAndParse(storage, snapshotFileName);
|
|
@@ -277,26 +274,22 @@ export class SharedMap extends SharedObject {
|
|
|
277
274
|
}
|
|
278
275
|
/**
|
|
279
276
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
280
|
-
* @internal
|
|
281
277
|
*/
|
|
282
278
|
onDisconnect() { }
|
|
283
279
|
/**
|
|
284
280
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
|
|
285
|
-
* @internal
|
|
286
281
|
*/
|
|
287
282
|
reSubmitCore(content, localOpMetadata) {
|
|
288
283
|
this.kernel.trySubmitMessage(content, localOpMetadata);
|
|
289
284
|
}
|
|
290
285
|
/**
|
|
291
286
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
|
|
292
|
-
* @internal
|
|
293
287
|
*/
|
|
294
288
|
applyStashedOp(content) {
|
|
295
289
|
return this.kernel.tryApplyStashedOp(content);
|
|
296
290
|
}
|
|
297
291
|
/**
|
|
298
292
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
299
|
-
* @internal
|
|
300
293
|
*/
|
|
301
294
|
processCore(message, local, localOpMetadata) {
|
|
302
295
|
if (message.type === MessageType.Operation) {
|
|
@@ -305,7 +298,6 @@ export class SharedMap extends SharedObject {
|
|
|
305
298
|
}
|
|
306
299
|
/**
|
|
307
300
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
|
|
308
|
-
* @internal
|
|
309
301
|
*/
|
|
310
302
|
rollback(content, localOpMetadata) {
|
|
311
303
|
this.kernel.rollback(content, localOpMetadata);
|
package/lib/map.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.mjs","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;;OAEI,EAA6B,WAAW,EAAE,MAAM,sCAAsC;OAStF,EAAE,YAAY,EAAE,MAAM,8BAA8B;OACpD,EAAoB,YAAY,EAAE,MAAM,oCAAoC;OAC5E,EAAE,kBAAkB,EAAE,MAAM,+BAA+B;OAE3D,EAA6C,SAAS,EAAE;OACxD,EAAE,UAAU,EAAE;AAOrB,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IAetB;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,UAAU,CAAC,IAAI,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,UAAU,CAAC,UAAU,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,EAAE,EAAE,OAAO,EA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CAAC,CAAC;IAChD,CAAC;CACD","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\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats, ITelemetryContext } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport { IFluidSerializer, SharedObject } from \"@fluidframework/shared-object-base\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils\";\nimport { ISharedMap, ISharedMapEvents } from \"./interfaces\";\nimport { IMapDataObjectSerializable, IMapOperation, MapKernel } from \"./mapKernel\";\nimport { pkgVersion } from \"./packageVersion\";\n\ninterface IMapSerializationFormat {\n\tblobs?: string[];\n\tcontent: IMapDataObjectSerializable;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedMap}.\n *\n * @sealed\n * @public\n */\nexport class MapFactory implements IChannelFactory {\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/map\";\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: MapFactory.Type,\n\t\tsnapshotFormatVersion: \"0.2\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic get type(): string {\n\t\treturn MapFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn MapFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedMap> {\n\t\tconst map = new SharedMap(id, runtime, attributes);\n\t\tawait map.load(services);\n\n\t\treturn map;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap {\n\t\tconst map = new SharedMap(id, runtime, MapFactory.Attributes);\n\t\tmap.initializeLocal();\n\n\t\treturn map;\n\t}\n}\n\n/**\n * {@inheritDoc ISharedMap}\n *\n * @public\n */\nexport class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {\n\t/**\n\t * Create a new shared map.\n\t * @param runtime - The data store runtime that the new shared map belongs to.\n\t * @param id - Optional name of the shared map.\n\t * @returns Newly created shared map.\n\t *\n\t * @example\n\t * To create a `SharedMap`, call the static create method:\n\t *\n\t * ```typescript\n\t * const myMap = SharedMap.create(this.runtime, id);\n\t * ```\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string): SharedMap {\n\t\treturn runtime.createChannel(id, MapFactory.Type) as SharedMap;\n\t}\n\n\t/**\n\t * Get a factory for SharedMap to register with the data store.\n\t * @returns A factory that creates SharedMaps and loads them from storage.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new MapFactory();\n\t}\n\n\t/**\n\t * String representation for the class.\n\t */\n\tpublic readonly [Symbol.toStringTag]: string = \"SharedMap\";\n\n\t/**\n\t * MapKernel which manages actual map operations.\n\t */\n\tprivate readonly kernel: MapKernel;\n\n\t/**\n\t * Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}.\n\t *\n\t * @param id - String identifier.\n\t * @param runtime - Data store runtime.\n\t * @param attributes - The attributes for the map.\n\t */\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_map_\");\n\t\tthis.kernel = new MapKernel(\n\t\t\tthis.serializer,\n\t\t\tthis.handle,\n\t\t\t(op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata),\n\t\t\t() => this.isAttached(),\n\t\t\tthis,\n\t\t);\n\t}\n\n\t/**\n\t * Get an iterator over the keys in this map.\n\t * @returns The iterator\n\t */\n\tpublic keys(): IterableIterator<string> {\n\t\treturn this.kernel.keys();\n\t}\n\n\t/**\n\t * Get an iterator over the entries in this map.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic entries(): IterableIterator<[string, any]> {\n\t\treturn this.kernel.entries();\n\t}\n\n\t/**\n\t * Get an iterator over the values in this map.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic values(): IterableIterator<any> {\n\t\treturn this.kernel.values();\n\t}\n\n\t/**\n\t * Get an iterator over the entries in this map.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic [Symbol.iterator](): IterableIterator<[string, any]> {\n\t\treturn this.kernel.entries();\n\t}\n\n\t/**\n\t * The number of key/value pairs stored in the map.\n\t */\n\tpublic get size(): number {\n\t\treturn this.kernel.size;\n\t}\n\n\t/**\n\t * Executes the given callback on each entry in the map.\n\t * @param callbackFn - Callback function\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void {\n\t\t// eslint-disable-next-line unicorn/no-array-for-each, unicorn/no-array-callback-reference\n\t\tthis.kernel.forEach(callbackFn);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedMap.get}\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic get<T = any>(key: string): T | undefined {\n\t\treturn this.kernel.get<T>(key);\n\t}\n\n\t/**\n\t * Check if a key exists in the map.\n\t * @param key - The key to check\n\t * @returns True if the key exists, false otherwise\n\t */\n\tpublic has(key: string): boolean {\n\t\treturn this.kernel.has(key);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedMap.set}\n\t */\n\tpublic set(key: string, value: unknown): this {\n\t\tthis.kernel.set(key, value);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Delete a key from the map.\n\t * @param key - Key to delete\n\t * @returns True if the key existed and was deleted, false if it did not exist\n\t */\n\tpublic delete(key: string): boolean {\n\t\treturn this.kernel.delete(key);\n\t}\n\n\t/**\n\t * Clear all data from the map.\n\t */\n\tpublic clear(): void {\n\t\tthis.kernel.clear();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t * @internal\n\t */\n\tprotected summarizeCore(\n\t\tserializer: IFluidSerializer,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats {\n\t\tlet currentSize = 0;\n\t\tlet counter = 0;\n\t\tlet headerBlob: IMapDataObjectSerializable = {};\n\t\tconst blobs: string[] = [];\n\n\t\tconst builder = new SummaryTreeBuilder();\n\n\t\tconst data = this.kernel.getSerializedStorage(serializer);\n\n\t\t// If single property exceeds this size, it goes into its own blob\n\t\tconst MinValueSizeSeparateSnapshotBlob = 8 * 1024;\n\n\t\t// Maximum blob size for multiple map properties\n\t\t// Should be bigger than MinValueSizeSeparateSnapshotBlob\n\t\tconst MaxSnapshotBlobSize = 16 * 1024;\n\n\t\t// Partitioning algorithm:\n\t\t// 1) Split large (over MinValueSizeSeparateSnapshotBlob = 8K) properties into their own blobs.\n\t\t// Naming (across snapshots) of such blob does not have to be stable across snapshots,\n\t\t// As de-duping process (in driver) should not care about paths, only content.\n\t\t// 2) Split remaining properties into blobs of MaxSnapshotBlobSize (16K) size.\n\t\t// This process does not produce stable partitioning. This means\n\t\t// modification (including addition / deletion) of property can shift properties across blobs\n\t\t// and result in non-incremental snapshot.\n\t\t// This can be improved in the future, without being format breaking change, as loading sequence\n\t\t// loads all blobs at once and partitioning schema has no impact on that process.\n\t\tfor (const key of Object.keys(data)) {\n\t\t\tconst value = data[key];\n\t\t\tif (value.value && value.value.length >= MinValueSizeSeparateSnapshotBlob) {\n\t\t\t\tconst blobName = `blob${counter}`;\n\t\t\t\tcounter++;\n\t\t\t\tblobs.push(blobName);\n\t\t\t\tconst content: IMapDataObjectSerializable = {\n\t\t\t\t\t[key]: {\n\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\tvalue: JSON.parse(value.value) as unknown,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tbuilder.addBlob(blobName, JSON.stringify(content));\n\t\t\t} else {\n\t\t\t\tcurrentSize += value.type.length + 21; // Approximation cost of property header\n\t\t\t\tif (value.value) {\n\t\t\t\t\tcurrentSize += value.value.length;\n\t\t\t\t}\n\n\t\t\t\tif (currentSize > MaxSnapshotBlobSize) {\n\t\t\t\t\tconst blobName = `blob${counter}`;\n\t\t\t\t\tcounter++;\n\t\t\t\t\tblobs.push(blobName);\n\t\t\t\t\tbuilder.addBlob(blobName, JSON.stringify(headerBlob));\n\t\t\t\t\theaderBlob = {};\n\t\t\t\t\tcurrentSize = 0;\n\t\t\t\t}\n\t\t\t\theaderBlob[key] = {\n\t\t\t\t\ttype: value.type,\n\t\t\t\t\tvalue:\n\t\t\t\t\t\tvalue.value === undefined\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: (JSON.parse(value.value) as unknown),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconst header: IMapSerializationFormat = {\n\t\t\tblobs,\n\t\t\tcontent: headerBlob,\n\t\t};\n\t\tbuilder.addBlob(snapshotFileName, JSON.stringify(header));\n\n\t\treturn builder.getSummaryTree();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t * @internal\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst json = await readAndParse<object>(storage, snapshotFileName);\n\t\tconst newFormat = json as IMapSerializationFormat;\n\t\tif (Array.isArray(newFormat.blobs)) {\n\t\t\tthis.kernel.populateFromSerializable(newFormat.content);\n\t\t\tawait Promise.all(\n\t\t\t\tnewFormat.blobs.map(async (value) => {\n\t\t\t\t\tconst content = await readAndParse<IMapDataObjectSerializable>(storage, value);\n\t\t\t\t\tthis.kernel.populateFromSerializable(content);\n\t\t\t\t}),\n\t\t\t);\n\t\t} else {\n\t\t\tthis.kernel.populateFromSerializable(json as IMapDataObjectSerializable);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t * @internal\n\t */\n\tprotected onDisconnect(): void {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}\n\t * @internal\n\t */\n\tprotected reSubmitCore(content: unknown, localOpMetadata: unknown): void {\n\t\tthis.kernel.trySubmitMessage(content as IMapOperation, localOpMetadata);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}\n\t * @internal\n\t */\n\tprotected applyStashedOp(content: unknown): unknown {\n\t\treturn this.kernel.tryApplyStashedOp(content as IMapOperation);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t * @internal\n\t */\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tif (message.type === MessageType.Operation) {\n\t\t\tthis.kernel.tryProcessMessage(\n\t\t\t\tmessage.contents as IMapOperation,\n\t\t\t\tlocal,\n\t\t\t\tlocalOpMetadata,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}\n\t * @internal\n\t */\n\tprotected rollback(content: unknown, localOpMetadata: unknown): void {\n\t\tthis.kernel.rollback(content, localOpMetadata);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"map.mjs","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;;OAEI,EAA6B,WAAW,EAAE,MAAM,sCAAsC;OAStF,EAAE,YAAY,EAAE,MAAM,8BAA8B;OACpD,EAAoB,YAAY,EAAE,MAAM,oCAAoC;OAC5E,EAAE,kBAAkB,EAAE,MAAM,+BAA+B;OAE3D,EAA6C,SAAS,EAAE;OACxD,EAAE,UAAU,EAAE;AAOrB,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IAetB;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,UAAU,CAAC,IAAI,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,UAAU,CAAC,UAAU,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,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;IACZ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;QAC9D,GAAG,CAAC,eAAe,EAAE,CAAC;QAEtB,OAAO,GAAG,CAAC;IACZ,CAAC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M,OAAO,GAAG,MAAM,YAAY,CAA6B,OAAO,EAAE,KAAK,CAAC,CAAC;gBAC/E,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;YAC/C,CAAC,CAAC,CACF,CAAC;SACF;aAAM;YACN,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAkC,CAAC,CAAC;SACzE;IACF,CAAC;IAED;;OAEG;IACO,YAAY,KAAU,CAAC;IAEjC;;OAEG;IACO,YAAY,CAAC,OAAgB,EAAE,eAAwB;QAChE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAwB,EAAE,eAAe,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,OAAgB;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAwB,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACO,WAAW,CACpB,OAAkC,EAClC,KAAc,EACd,eAAwB;QAExB,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,SAAS,EAAE;YAC3C,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAC5B,OAAO,CAAC,QAAyB,EACjC,KAAK,EACL,eAAe,CACf,CAAC;SACF;IACF,CAAC;IAED;;OAEG;IACO,QAAQ,CAAC,OAAgB,EAAE,eAAwB;QAC5D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAChD,CAAC;CACD","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\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats, ITelemetryContext } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport { IFluidSerializer, SharedObject } from \"@fluidframework/shared-object-base\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils\";\nimport { ISharedMap, ISharedMapEvents } from \"./interfaces\";\nimport { IMapDataObjectSerializable, IMapOperation, MapKernel } from \"./mapKernel\";\nimport { pkgVersion } from \"./packageVersion\";\n\ninterface IMapSerializationFormat {\n\tblobs?: string[];\n\tcontent: IMapDataObjectSerializable;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedMap}.\n *\n * @sealed\n * @internal\n */\nexport class MapFactory implements IChannelFactory {\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/map\";\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: MapFactory.Type,\n\t\tsnapshotFormatVersion: \"0.2\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic get type(): string {\n\t\treturn MapFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn MapFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedMap> {\n\t\tconst map = new SharedMap(id, runtime, attributes);\n\t\tawait map.load(services);\n\n\t\treturn map;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap {\n\t\tconst map = new SharedMap(id, runtime, MapFactory.Attributes);\n\t\tmap.initializeLocal();\n\n\t\treturn map;\n\t}\n}\n\n/**\n * {@inheritDoc ISharedMap}\n * @internal\n */\nexport class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {\n\t/**\n\t * Create a new shared map.\n\t * @param runtime - The data store runtime that the new shared map belongs to.\n\t * @param id - Optional name of the shared map.\n\t * @returns Newly created shared map.\n\t *\n\t * @example\n\t * To create a `SharedMap`, call the static create method:\n\t *\n\t * ```typescript\n\t * const myMap = SharedMap.create(this.runtime, id);\n\t * ```\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string): SharedMap {\n\t\treturn runtime.createChannel(id, MapFactory.Type) as SharedMap;\n\t}\n\n\t/**\n\t * Get a factory for SharedMap to register with the data store.\n\t * @returns A factory that creates SharedMaps and loads them from storage.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new MapFactory();\n\t}\n\n\t/**\n\t * String representation for the class.\n\t */\n\tpublic readonly [Symbol.toStringTag]: string = \"SharedMap\";\n\n\t/**\n\t * MapKernel which manages actual map operations.\n\t */\n\tprivate readonly kernel: MapKernel;\n\n\t/**\n\t * Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}.\n\t *\n\t * @param id - String identifier.\n\t * @param runtime - Data store runtime.\n\t * @param attributes - The attributes for the map.\n\t */\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_map_\");\n\t\tthis.kernel = new MapKernel(\n\t\t\tthis.serializer,\n\t\t\tthis.handle,\n\t\t\t(op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata),\n\t\t\t() => this.isAttached(),\n\t\t\tthis,\n\t\t);\n\t}\n\n\t/**\n\t * Get an iterator over the keys in this map.\n\t * @returns The iterator\n\t */\n\tpublic keys(): IterableIterator<string> {\n\t\treturn this.kernel.keys();\n\t}\n\n\t/**\n\t * Get an iterator over the entries in this map.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic entries(): IterableIterator<[string, any]> {\n\t\treturn this.kernel.entries();\n\t}\n\n\t/**\n\t * Get an iterator over the values in this map.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic values(): IterableIterator<any> {\n\t\treturn this.kernel.values();\n\t}\n\n\t/**\n\t * Get an iterator over the entries in this map.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic [Symbol.iterator](): IterableIterator<[string, any]> {\n\t\treturn this.kernel.entries();\n\t}\n\n\t/**\n\t * The number of key/value pairs stored in the map.\n\t */\n\tpublic get size(): number {\n\t\treturn this.kernel.size;\n\t}\n\n\t/**\n\t * Executes the given callback on each entry in the map.\n\t * @param callbackFn - Callback function\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void {\n\t\t// eslint-disable-next-line unicorn/no-array-for-each, unicorn/no-array-callback-reference\n\t\tthis.kernel.forEach(callbackFn);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedMap.get}\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic get<T = any>(key: string): T | undefined {\n\t\treturn this.kernel.get<T>(key);\n\t}\n\n\t/**\n\t * Check if a key exists in the map.\n\t * @param key - The key to check\n\t * @returns True if the key exists, false otherwise\n\t */\n\tpublic has(key: string): boolean {\n\t\treturn this.kernel.has(key);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedMap.set}\n\t */\n\tpublic set(key: string, value: unknown): this {\n\t\tthis.kernel.set(key, value);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Delete a key from the map.\n\t * @param key - Key to delete\n\t * @returns True if the key existed and was deleted, false if it did not exist\n\t */\n\tpublic delete(key: string): boolean {\n\t\treturn this.kernel.delete(key);\n\t}\n\n\t/**\n\t * Clear all data from the map.\n\t */\n\tpublic clear(): void {\n\t\tthis.kernel.clear();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(\n\t\tserializer: IFluidSerializer,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats {\n\t\tlet currentSize = 0;\n\t\tlet counter = 0;\n\t\tlet headerBlob: IMapDataObjectSerializable = {};\n\t\tconst blobs: string[] = [];\n\n\t\tconst builder = new SummaryTreeBuilder();\n\n\t\tconst data = this.kernel.getSerializedStorage(serializer);\n\n\t\t// If single property exceeds this size, it goes into its own blob\n\t\tconst MinValueSizeSeparateSnapshotBlob = 8 * 1024;\n\n\t\t// Maximum blob size for multiple map properties\n\t\t// Should be bigger than MinValueSizeSeparateSnapshotBlob\n\t\tconst MaxSnapshotBlobSize = 16 * 1024;\n\n\t\t// Partitioning algorithm:\n\t\t// 1) Split large (over MinValueSizeSeparateSnapshotBlob = 8K) properties into their own blobs.\n\t\t// Naming (across snapshots) of such blob does not have to be stable across snapshots,\n\t\t// As de-duping process (in driver) should not care about paths, only content.\n\t\t// 2) Split remaining properties into blobs of MaxSnapshotBlobSize (16K) size.\n\t\t// This process does not produce stable partitioning. This means\n\t\t// modification (including addition / deletion) of property can shift properties across blobs\n\t\t// and result in non-incremental snapshot.\n\t\t// This can be improved in the future, without being format breaking change, as loading sequence\n\t\t// loads all blobs at once and partitioning schema has no impact on that process.\n\t\tfor (const key of Object.keys(data)) {\n\t\t\tconst value = data[key];\n\t\t\tif (value.value && value.value.length >= MinValueSizeSeparateSnapshotBlob) {\n\t\t\t\tconst blobName = `blob${counter}`;\n\t\t\t\tcounter++;\n\t\t\t\tblobs.push(blobName);\n\t\t\t\tconst content: IMapDataObjectSerializable = {\n\t\t\t\t\t[key]: {\n\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\tvalue: JSON.parse(value.value) as unknown,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tbuilder.addBlob(blobName, JSON.stringify(content));\n\t\t\t} else {\n\t\t\t\tcurrentSize += value.type.length + 21; // Approximation cost of property header\n\t\t\t\tif (value.value) {\n\t\t\t\t\tcurrentSize += value.value.length;\n\t\t\t\t}\n\n\t\t\t\tif (currentSize > MaxSnapshotBlobSize) {\n\t\t\t\t\tconst blobName = `blob${counter}`;\n\t\t\t\t\tcounter++;\n\t\t\t\t\tblobs.push(blobName);\n\t\t\t\t\tbuilder.addBlob(blobName, JSON.stringify(headerBlob));\n\t\t\t\t\theaderBlob = {};\n\t\t\t\t\tcurrentSize = 0;\n\t\t\t\t}\n\t\t\t\theaderBlob[key] = {\n\t\t\t\t\ttype: value.type,\n\t\t\t\t\tvalue:\n\t\t\t\t\t\tvalue.value === undefined\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: (JSON.parse(value.value) as unknown),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconst header: IMapSerializationFormat = {\n\t\t\tblobs,\n\t\t\tcontent: headerBlob,\n\t\t};\n\t\tbuilder.addBlob(snapshotFileName, JSON.stringify(header));\n\n\t\treturn builder.getSummaryTree();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst json = await readAndParse<object>(storage, snapshotFileName);\n\t\tconst newFormat = json as IMapSerializationFormat;\n\t\tif (Array.isArray(newFormat.blobs)) {\n\t\t\tthis.kernel.populateFromSerializable(newFormat.content);\n\t\t\tawait Promise.all(\n\t\t\t\tnewFormat.blobs.map(async (value) => {\n\t\t\t\t\tconst content = await readAndParse<IMapDataObjectSerializable>(storage, value);\n\t\t\t\t\tthis.kernel.populateFromSerializable(content);\n\t\t\t\t}),\n\t\t\t);\n\t\t} else {\n\t\t\tthis.kernel.populateFromSerializable(json as IMapDataObjectSerializable);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect(): void {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}\n\t */\n\tprotected reSubmitCore(content: unknown, localOpMetadata: unknown): void {\n\t\tthis.kernel.trySubmitMessage(content as IMapOperation, localOpMetadata);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}\n\t */\n\tprotected applyStashedOp(content: unknown): unknown {\n\t\treturn this.kernel.tryApplyStashedOp(content as IMapOperation);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tif (message.type === MessageType.Operation) {\n\t\t\tthis.kernel.tryProcessMessage(\n\t\t\t\tmessage.contents as IMapOperation,\n\t\t\t\tlocal,\n\t\t\t\tlocalOpMetadata,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}\n\t */\n\tprotected rollback(content: unknown, localOpMetadata: unknown): void {\n\t\tthis.kernel.rollback(content, localOpMetadata);\n\t}\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/map";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-dev.7.4.0.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev.7.4.0.217212";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.mjs
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluidframework/map";
|
|
8
|
-
export const pkgVersion = "2.0.0-dev.7.4.0.
|
|
8
|
+
export const pkgVersion = "2.0.0-dev.7.4.0.217212";
|
|
9
9
|
//# sourceMappingURL=packageVersion.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.mjs","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAC7C,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,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 = \"2.0.0-dev.7.4.0.
|
|
1
|
+
{"version":3,"file":"packageVersion.mjs","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAC7C,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,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 = \"2.0.0-dev.7.4.0.217212\";\n"]}
|