@fluidframework/map 0.52.0-44610 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/directory.d.ts.map +1 -1
- package/dist/directory.js +40 -41
- package/dist/directory.js.map +1 -1
- package/dist/interfaces.d.ts +4 -5
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/map.js +2 -2
- package/dist/map.js.map +1 -1
- package/dist/mapKernel.d.ts +1 -2
- package/dist/mapKernel.d.ts.map +1 -1
- package/dist/mapKernel.js +17 -17
- 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 +40 -41
- package/lib/directory.js.map +1 -1
- package/lib/interfaces.d.ts +4 -5
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js.map +1 -1
- package/lib/map.js +2 -2
- package/lib/map.js.map +1 -1
- package/lib/mapKernel.d.ts +1 -2
- package/lib/mapKernel.d.ts.map +1 -1
- package/lib/mapKernel.js +17 -17
- 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 +10 -10
- package/src/directory.ts +32 -43
- package/src/interfaces.ts +0 -5
- package/src/map.ts +2 -2
- package/src/mapKernel.ts +15 -20
- package/src/packageVersion.ts +1 -1
package/dist/directory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,OAAO,EACH,yBAAyB,EACzB,KA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;OAGG;IACH,SAAS,CAAC,YAAY;IAEtB;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAO7D;;;OAGG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB;IAgBxD;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,oBAAoB;IAmC7C;;;OAGG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;IAiB9B;;;OAGG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;IASzG;;;OAGG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;;;;;;OASG;IACH,OAAO,CAAC,SAAS;IAYjB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgG1B;;OAEG;IACH,SAAS,CAAC,cAAc;CAG3B"}
|
package/dist/directory.js
CHANGED
|
@@ -444,7 +444,7 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
444
444
|
const op = message.contents;
|
|
445
445
|
const handler = this.messageHandlers.get(op.type);
|
|
446
446
|
common_utils_1.assert(handler !== undefined, 0x00e /* `Missing message handler for message type: ${message.type}` */);
|
|
447
|
-
handler.process(op, local,
|
|
447
|
+
handler.process(op, local, localOpMetadata);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
/**
|
|
@@ -473,10 +473,10 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
473
473
|
*/
|
|
474
474
|
setMessageHandlers() {
|
|
475
475
|
this.messageHandlers.set("clear", {
|
|
476
|
-
process: (op, local,
|
|
476
|
+
process: (op, local, localOpMetadata) => {
|
|
477
477
|
const subdir = this.getWorkingDirectory(op.path);
|
|
478
478
|
if (subdir) {
|
|
479
|
-
subdir.processClearMessage(op, local,
|
|
479
|
+
subdir.processClearMessage(op, local, localOpMetadata);
|
|
480
480
|
}
|
|
481
481
|
},
|
|
482
482
|
submit: (op, localOpMetadata) => {
|
|
@@ -488,10 +488,10 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
488
488
|
},
|
|
489
489
|
});
|
|
490
490
|
this.messageHandlers.set("delete", {
|
|
491
|
-
process: (op, local,
|
|
491
|
+
process: (op, local, localOpMetadata) => {
|
|
492
492
|
const subdir = this.getWorkingDirectory(op.path);
|
|
493
493
|
if (subdir) {
|
|
494
|
-
subdir.processDeleteMessage(op, local,
|
|
494
|
+
subdir.processDeleteMessage(op, local, localOpMetadata);
|
|
495
495
|
}
|
|
496
496
|
},
|
|
497
497
|
submit: (op, localOpMetadata) => {
|
|
@@ -503,11 +503,11 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
503
503
|
},
|
|
504
504
|
});
|
|
505
505
|
this.messageHandlers.set("set", {
|
|
506
|
-
process: (op, local,
|
|
506
|
+
process: (op, local, localOpMetadata) => {
|
|
507
507
|
const subdir = this.getWorkingDirectory(op.path);
|
|
508
508
|
if (subdir) {
|
|
509
509
|
const context = local ? undefined : this.makeLocal(op.key, op.path, op.value);
|
|
510
|
-
subdir.processSetMessage(op, context, local,
|
|
510
|
+
subdir.processSetMessage(op, context, local, localOpMetadata);
|
|
511
511
|
}
|
|
512
512
|
},
|
|
513
513
|
submit: (op, localOpMetadata) => {
|
|
@@ -519,10 +519,10 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
519
519
|
},
|
|
520
520
|
});
|
|
521
521
|
this.messageHandlers.set("createSubDirectory", {
|
|
522
|
-
process: (op, local,
|
|
522
|
+
process: (op, local, localOpMetadata) => {
|
|
523
523
|
const parentSubdir = this.getWorkingDirectory(op.path);
|
|
524
524
|
if (parentSubdir) {
|
|
525
|
-
parentSubdir.processCreateSubDirectoryMessage(op, local,
|
|
525
|
+
parentSubdir.processCreateSubDirectoryMessage(op, local, localOpMetadata);
|
|
526
526
|
}
|
|
527
527
|
},
|
|
528
528
|
submit: (op, localOpMetadata) => {
|
|
@@ -534,10 +534,10 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
534
534
|
},
|
|
535
535
|
});
|
|
536
536
|
this.messageHandlers.set("deleteSubDirectory", {
|
|
537
|
-
process: (op, local,
|
|
537
|
+
process: (op, local, localOpMetadata) => {
|
|
538
538
|
const parentSubdir = this.getWorkingDirectory(op.path);
|
|
539
539
|
if (parentSubdir) {
|
|
540
|
-
parentSubdir.processDeleteSubDirectoryMessage(op, local,
|
|
540
|
+
parentSubdir.processDeleteSubDirectoryMessage(op, local, localOpMetadata);
|
|
541
541
|
}
|
|
542
542
|
},
|
|
543
543
|
submit: (op, localOpMetadata) => {
|
|
@@ -653,7 +653,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
653
653
|
const localValue = this.directory.localValueMaker.fromInMemory(value);
|
|
654
654
|
const serializableValue = localValues_1.makeSerializable(localValue, this.serializer, this.directory.handle);
|
|
655
655
|
// Set the value locally.
|
|
656
|
-
this.setCore(key, localValue, true
|
|
656
|
+
this.setCore(key, localValue, true);
|
|
657
657
|
// If we are not attached, don't submit the op.
|
|
658
658
|
if (!this.directory.isAttached()) {
|
|
659
659
|
return this;
|
|
@@ -679,7 +679,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
679
679
|
throw new Error(`SubDirectory name may not contain ${posix.sep}`);
|
|
680
680
|
}
|
|
681
681
|
// Create the sub directory locally first.
|
|
682
|
-
this.createSubDirectoryCore(subdirName, true
|
|
682
|
+
this.createSubDirectoryCore(subdirName, true);
|
|
683
683
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
684
684
|
const subDir = this._subdirectories.get(subdirName);
|
|
685
685
|
// If we are not attached, don't submit the op.
|
|
@@ -711,7 +711,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
711
711
|
*/
|
|
712
712
|
deleteSubDirectory(subdirName) {
|
|
713
713
|
// Delete the sub directory locally first.
|
|
714
|
-
const successfullyRemoved = this.deleteSubDirectoryCore(subdirName, true
|
|
714
|
+
const successfullyRemoved = this.deleteSubDirectoryCore(subdirName, true);
|
|
715
715
|
// If we are not attached, don't submit the op.
|
|
716
716
|
if (!this.directory.isAttached()) {
|
|
717
717
|
return successfullyRemoved;
|
|
@@ -743,7 +743,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
743
743
|
*/
|
|
744
744
|
delete(key) {
|
|
745
745
|
// Delete the key locally first.
|
|
746
|
-
const successfullyRemoved = this.deleteCore(key, true
|
|
746
|
+
const successfullyRemoved = this.deleteCore(key, true);
|
|
747
747
|
// If we are not attached, don't submit the op.
|
|
748
748
|
if (!this.directory.isAttached()) {
|
|
749
749
|
return successfullyRemoved;
|
|
@@ -761,7 +761,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
761
761
|
*/
|
|
762
762
|
clear() {
|
|
763
763
|
// Clear the data locally first.
|
|
764
|
-
this.clearCore(true
|
|
764
|
+
this.clearCore(true);
|
|
765
765
|
// If we are not attached, don't submit the op.
|
|
766
766
|
if (!this.directory.isAttached()) {
|
|
767
767
|
return;
|
|
@@ -856,7 +856,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
856
856
|
* For messages from a remote client, this will be undefined.
|
|
857
857
|
* @internal
|
|
858
858
|
*/
|
|
859
|
-
processClearMessage(op, local,
|
|
859
|
+
processClearMessage(op, local, localOpMetadata) {
|
|
860
860
|
if (local) {
|
|
861
861
|
common_utils_1.assert(localOpMetadata !== undefined, 0x00f /* `pendingMessageId is missing from the local client's ${op.type} operation` */);
|
|
862
862
|
const pendingMessageId = localOpMetadata;
|
|
@@ -866,7 +866,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
866
866
|
return;
|
|
867
867
|
}
|
|
868
868
|
this.clearExceptPendingKeys();
|
|
869
|
-
this.directory.emit("clear", local,
|
|
869
|
+
this.directory.emit("clear", local, this.directory);
|
|
870
870
|
}
|
|
871
871
|
/**
|
|
872
872
|
* Process a delete operation.
|
|
@@ -877,11 +877,11 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
877
877
|
* For messages from a remote client, this will be undefined.
|
|
878
878
|
* @internal
|
|
879
879
|
*/
|
|
880
|
-
processDeleteMessage(op, local,
|
|
881
|
-
if (!this.needProcessStorageOperation(op, local,
|
|
880
|
+
processDeleteMessage(op, local, localOpMetadata) {
|
|
881
|
+
if (!this.needProcessStorageOperation(op, local, localOpMetadata)) {
|
|
882
882
|
return;
|
|
883
883
|
}
|
|
884
|
-
this.deleteCore(op.key, local
|
|
884
|
+
this.deleteCore(op.key, local);
|
|
885
885
|
}
|
|
886
886
|
/**
|
|
887
887
|
* Process a set operation.
|
|
@@ -892,14 +892,14 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
892
892
|
* For messages from a remote client, this will be undefined.
|
|
893
893
|
* @internal
|
|
894
894
|
*/
|
|
895
|
-
processSetMessage(op, context, local,
|
|
896
|
-
if (!this.needProcessStorageOperation(op, local,
|
|
895
|
+
processSetMessage(op, context, local, localOpMetadata) {
|
|
896
|
+
if (!this.needProcessStorageOperation(op, local, localOpMetadata)) {
|
|
897
897
|
return;
|
|
898
898
|
}
|
|
899
899
|
// needProcessStorageOperation should have returned false if local is true
|
|
900
900
|
// so we can assume context is not undefined
|
|
901
901
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
902
|
-
this.setCore(op.key, context, local
|
|
902
|
+
this.setCore(op.key, context, local);
|
|
903
903
|
}
|
|
904
904
|
/**
|
|
905
905
|
* Process a create subdirectory operation.
|
|
@@ -910,11 +910,11 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
910
910
|
* For messages from a remote client, this will be undefined.
|
|
911
911
|
* @internal
|
|
912
912
|
*/
|
|
913
|
-
processCreateSubDirectoryMessage(op, local,
|
|
914
|
-
if (!this.needProcessSubDirectoryOperations(op, local,
|
|
913
|
+
processCreateSubDirectoryMessage(op, local, localOpMetadata) {
|
|
914
|
+
if (!this.needProcessSubDirectoryOperations(op, local, localOpMetadata)) {
|
|
915
915
|
return;
|
|
916
916
|
}
|
|
917
|
-
this.createSubDirectoryCore(op.subdirName, local
|
|
917
|
+
this.createSubDirectoryCore(op.subdirName, local);
|
|
918
918
|
}
|
|
919
919
|
/**
|
|
920
920
|
* Process a delete subdirectory operation.
|
|
@@ -925,11 +925,11 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
925
925
|
* For messages from a remote client, this will be undefined.
|
|
926
926
|
* @internal
|
|
927
927
|
*/
|
|
928
|
-
processDeleteSubDirectoryMessage(op, local,
|
|
929
|
-
if (!this.needProcessSubDirectoryOperations(op, local,
|
|
928
|
+
processDeleteSubDirectoryMessage(op, local, localOpMetadata) {
|
|
929
|
+
if (!this.needProcessSubDirectoryOperations(op, local, localOpMetadata)) {
|
|
930
930
|
return;
|
|
931
931
|
}
|
|
932
|
-
this.deleteSubDirectoryCore(op.subdirName, local
|
|
932
|
+
this.deleteSubDirectoryCore(op.subdirName, local);
|
|
933
933
|
}
|
|
934
934
|
/**
|
|
935
935
|
* Submit a clear operation.
|
|
@@ -1020,7 +1020,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1020
1020
|
* For messages from a remote client, this will be undefined.
|
|
1021
1021
|
* @returns True if the operation should be processed, false otherwise
|
|
1022
1022
|
*/
|
|
1023
|
-
needProcessStorageOperation(op, local,
|
|
1023
|
+
needProcessStorageOperation(op, local, localOpMetadata) {
|
|
1024
1024
|
if (this.pendingClearMessageId !== -1) {
|
|
1025
1025
|
if (local) {
|
|
1026
1026
|
common_utils_1.assert(localOpMetadata !== undefined && localOpMetadata < this.pendingClearMessageId, 0x010 /* "Received out of order storage op when there is an unackd clear message" */);
|
|
@@ -1054,7 +1054,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1054
1054
|
* For messages from a remote client, this will be undefined.
|
|
1055
1055
|
* @returns True if the operation should be processed, false otherwise
|
|
1056
1056
|
*/
|
|
1057
|
-
needProcessSubDirectoryOperations(op, local,
|
|
1057
|
+
needProcessSubDirectoryOperations(op, local, localOpMetadata) {
|
|
1058
1058
|
if (this.pendingSubDirectories.has(op.subdirName)) {
|
|
1059
1059
|
if (local) {
|
|
1060
1060
|
common_utils_1.assert(localOpMetadata !== undefined, 0x012 /* `pendingMessageId is missing from the local client's ${op.type} operation` */);
|
|
@@ -1089,9 +1089,9 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1089
1089
|
* @param local - Whether the message originated from the local client
|
|
1090
1090
|
* @param op - The message if from a remote clear, or null if from a local clear
|
|
1091
1091
|
*/
|
|
1092
|
-
clearCore(local
|
|
1092
|
+
clearCore(local) {
|
|
1093
1093
|
this._storage.clear();
|
|
1094
|
-
this.directory.emit("clear", local,
|
|
1094
|
+
this.directory.emit("clear", local, this.directory);
|
|
1095
1095
|
}
|
|
1096
1096
|
/**
|
|
1097
1097
|
* Delete implementation used for both locally sourced deletes as well as incoming remote deletes.
|
|
@@ -1100,12 +1100,12 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1100
1100
|
* @param op - The message if from a remote delete, or null if from a local delete
|
|
1101
1101
|
* @returns True if the key existed and was deleted, false if it did not exist
|
|
1102
1102
|
*/
|
|
1103
|
-
deleteCore(key, local
|
|
1103
|
+
deleteCore(key, local) {
|
|
1104
1104
|
const previousValue = this.get(key);
|
|
1105
1105
|
const successfullyRemoved = this._storage.delete(key);
|
|
1106
1106
|
if (successfullyRemoved) {
|
|
1107
1107
|
const event = { key, path: this.absolutePath, previousValue };
|
|
1108
|
-
this.directory.emit("valueChanged", event, local,
|
|
1108
|
+
this.directory.emit("valueChanged", event, local, this.directory);
|
|
1109
1109
|
const containedEvent = { key, previousValue };
|
|
1110
1110
|
this.emit("containedValueChanged", containedEvent, local, this);
|
|
1111
1111
|
}
|
|
@@ -1118,11 +1118,11 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1118
1118
|
* @param local - Whether the message originated from the local client
|
|
1119
1119
|
* @param op - The message if from a remote set, or null if from a local set
|
|
1120
1120
|
*/
|
|
1121
|
-
setCore(key, value, local
|
|
1121
|
+
setCore(key, value, local) {
|
|
1122
1122
|
const previousValue = this.get(key);
|
|
1123
1123
|
this._storage.set(key, value);
|
|
1124
1124
|
const event = { key, path: this.absolutePath, previousValue };
|
|
1125
|
-
this.directory.emit("valueChanged", event, local,
|
|
1125
|
+
this.directory.emit("valueChanged", event, local, this.directory);
|
|
1126
1126
|
const containedEvent = { key, previousValue };
|
|
1127
1127
|
this.emit("containedValueChanged", containedEvent, local, this);
|
|
1128
1128
|
}
|
|
@@ -1130,9 +1130,8 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1130
1130
|
* Create subdirectory implementation used for both locally sourced creation as well as incoming remote creation.
|
|
1131
1131
|
* @param subdirName - The name of the subdirectory being created
|
|
1132
1132
|
* @param local - Whether the message originated from the local client
|
|
1133
|
-
* @param op - The message if from a remote create, or null if from a local create
|
|
1134
1133
|
*/
|
|
1135
|
-
createSubDirectoryCore(subdirName, local
|
|
1134
|
+
createSubDirectoryCore(subdirName, local) {
|
|
1136
1135
|
if (!this._subdirectories.has(subdirName)) {
|
|
1137
1136
|
this._subdirectories.set(subdirName, new SubDirectory(this.directory, this.runtime, this.serializer, posix.join(this.absolutePath, subdirName)));
|
|
1138
1137
|
}
|
|
@@ -1143,7 +1142,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1143
1142
|
* @param local - Whether the message originated from the local client
|
|
1144
1143
|
* @param op - The message if from a remote delete, or null if from a local delete
|
|
1145
1144
|
*/
|
|
1146
|
-
deleteSubDirectoryCore(subdirName, local
|
|
1145
|
+
deleteSubDirectoryCore(subdirName, local) {
|
|
1147
1146
|
// This should make the subdirectory structure unreachable so it can be GC'd and won't appear in snapshots
|
|
1148
1147
|
// Might want to consider cleaning out the structure more exhaustively though?
|
|
1149
1148
|
return this._subdirectories.delete(subdirName);
|