@fluidframework/map 0.58.2000 → 0.58.2001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/directory.d.ts +0 -2
- package/dist/directory.d.ts.map +1 -1
- package/dist/directory.js +1 -67
- package/dist/directory.js.map +1 -1
- package/dist/interfaces.d.ts +2 -15
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/directory.d.ts +0 -2
- package/lib/directory.d.ts.map +1 -1
- package/lib/directory.js +1 -67
- package/lib/directory.js.map +1 -1
- package/lib/interfaces.d.ts +2 -15
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +9 -10
- package/src/directory.ts +1 -74
- package/src/interfaces.ts +2 -17
- package/src/packageVersion.ts +1 -1
package/README.md
CHANGED
|
@@ -52,5 +52,3 @@ To "navigate" the subdirectory structure, `IDirectory` provides a `getWorkingDir
|
|
|
52
52
|
#### Eventing
|
|
53
53
|
|
|
54
54
|
`valueChanged` events additionally provide the absolute path to the subdirectory storing the value that changed.
|
|
55
|
-
|
|
56
|
-
`dispose` events are fired on sub directory which is deleted. Any access to this sub directory will throw an error once it is disposed.
|
package/dist/directory.d.ts
CHANGED
|
@@ -221,8 +221,6 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
221
221
|
* {@inheritDoc IDirectory.set}
|
|
222
222
|
*/
|
|
223
223
|
set<T = any>(key: string, value: T): this;
|
|
224
|
-
dispose(error?: Error): void;
|
|
225
|
-
get disposed(): boolean;
|
|
226
224
|
/**
|
|
227
225
|
* Deletes the given key from within this IDirectory.
|
|
228
226
|
* @param key - The key to delete
|
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;
|
|
1
|
+
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,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;AACH,UAAU,wBAAwB;IAC9B;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH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,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
|
@@ -25,7 +25,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.SharedDirectory = exports.DirectoryFactory = void 0;
|
|
27
27
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
28
|
-
const container_utils_1 = require("@fluidframework/container-utils");
|
|
29
28
|
const driver_utils_1 = require("@fluidframework/driver-utils");
|
|
30
29
|
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
31
30
|
const shared_object_base_1 = require("@fluidframework/shared-object-base");
|
|
@@ -220,12 +219,6 @@ class SharedDirectory extends shared_object_base_1.SharedObject {
|
|
|
220
219
|
this.root.set(key, value);
|
|
221
220
|
return this;
|
|
222
221
|
}
|
|
223
|
-
dispose(error) {
|
|
224
|
-
this.root.dispose(error);
|
|
225
|
-
}
|
|
226
|
-
get disposed() {
|
|
227
|
-
return this.root.disposed;
|
|
228
|
-
}
|
|
229
222
|
/**
|
|
230
223
|
* Deletes the given key from within this IDirectory.
|
|
231
224
|
* @param key - The key to delete
|
|
@@ -558,10 +551,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
558
551
|
this.runtime = runtime;
|
|
559
552
|
this.serializer = serializer;
|
|
560
553
|
this.absolutePath = absolutePath;
|
|
561
|
-
/**
|
|
562
|
-
* Tells if the sub directory is disposed or not.
|
|
563
|
-
*/
|
|
564
|
-
this._disposed = false;
|
|
565
554
|
/**
|
|
566
555
|
* String representation for the class.
|
|
567
556
|
*/
|
|
@@ -592,25 +581,12 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
592
581
|
*/
|
|
593
582
|
this.pendingClearMessageId = -1;
|
|
594
583
|
}
|
|
595
|
-
dispose(error) {
|
|
596
|
-
this._disposed = true;
|
|
597
|
-
this.emit("disposed", this);
|
|
598
|
-
}
|
|
599
|
-
get disposed() {
|
|
600
|
-
return this._disposed;
|
|
601
|
-
}
|
|
602
|
-
throwIfDisposed() {
|
|
603
|
-
if (this._disposed) {
|
|
604
|
-
throw new container_utils_1.UsageError("Cannot access Disposed subDirectory");
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
584
|
/**
|
|
608
585
|
* Checks whether the given key exists in this IDirectory.
|
|
609
586
|
* @param key - The key to check
|
|
610
587
|
* @returns True if the key exists, false otherwise
|
|
611
588
|
*/
|
|
612
589
|
has(key) {
|
|
613
|
-
this.throwIfDisposed();
|
|
614
590
|
return this._storage.has(key);
|
|
615
591
|
}
|
|
616
592
|
/**
|
|
@@ -618,14 +594,12 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
618
594
|
*/
|
|
619
595
|
get(key) {
|
|
620
596
|
var _a;
|
|
621
|
-
this.throwIfDisposed();
|
|
622
597
|
return (_a = this._storage.get(key)) === null || _a === void 0 ? void 0 : _a.value;
|
|
623
598
|
}
|
|
624
599
|
/**
|
|
625
600
|
* {@inheritDoc IDirectory.set}
|
|
626
601
|
*/
|
|
627
602
|
set(key, value) {
|
|
628
|
-
this.throwIfDisposed();
|
|
629
603
|
// Undefined/null keys can't be serialized to JSON in the manner we currently snapshot.
|
|
630
604
|
if (key === undefined || key === null) {
|
|
631
605
|
throw new Error("Undefined and null keys are not supported");
|
|
@@ -652,7 +626,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
652
626
|
* {@inheritDoc IDirectory.createSubDirectory}
|
|
653
627
|
*/
|
|
654
628
|
createSubDirectory(subdirName) {
|
|
655
|
-
this.throwIfDisposed();
|
|
656
629
|
// Undefined/null subdirectory names can't be serialized to JSON in the manner we currently snapshot.
|
|
657
630
|
if (subdirName === undefined || subdirName === null) {
|
|
658
631
|
throw new Error("SubDirectory name may not be undefined or null");
|
|
@@ -680,21 +653,18 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
680
653
|
* {@inheritDoc IDirectory.getSubDirectory}
|
|
681
654
|
*/
|
|
682
655
|
getSubDirectory(subdirName) {
|
|
683
|
-
this.throwIfDisposed();
|
|
684
656
|
return this._subdirectories.get(subdirName);
|
|
685
657
|
}
|
|
686
658
|
/**
|
|
687
659
|
* {@inheritDoc IDirectory.hasSubDirectory}
|
|
688
660
|
*/
|
|
689
661
|
hasSubDirectory(subdirName) {
|
|
690
|
-
this.throwIfDisposed();
|
|
691
662
|
return this._subdirectories.has(subdirName);
|
|
692
663
|
}
|
|
693
664
|
/**
|
|
694
665
|
* {@inheritDoc IDirectory.deleteSubDirectory}
|
|
695
666
|
*/
|
|
696
667
|
deleteSubDirectory(subdirName) {
|
|
697
|
-
this.throwIfDisposed();
|
|
698
668
|
// Delete the sub directory locally first.
|
|
699
669
|
const successfullyRemoved = this.deleteSubDirectoryCore(subdirName, true);
|
|
700
670
|
// If we are not attached, don't submit the op.
|
|
@@ -713,14 +683,12 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
713
683
|
* {@inheritDoc IDirectory.subdirectories}
|
|
714
684
|
*/
|
|
715
685
|
subdirectories() {
|
|
716
|
-
this.throwIfDisposed();
|
|
717
686
|
return this._subdirectories.entries();
|
|
718
687
|
}
|
|
719
688
|
/**
|
|
720
689
|
* {@inheritDoc IDirectory.getWorkingDirectory}
|
|
721
690
|
*/
|
|
722
691
|
getWorkingDirectory(relativePath) {
|
|
723
|
-
this.throwIfDisposed();
|
|
724
692
|
return this.directory.getWorkingDirectory(this.makeAbsolute(relativePath));
|
|
725
693
|
}
|
|
726
694
|
/**
|
|
@@ -729,7 +697,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
729
697
|
* @returns True if the key existed and was deleted, false if it did not exist
|
|
730
698
|
*/
|
|
731
699
|
delete(key) {
|
|
732
|
-
this.throwIfDisposed();
|
|
733
700
|
// Delete the key locally first.
|
|
734
701
|
const successfullyRemoved = this.deleteCore(key, true);
|
|
735
702
|
// If we are not attached, don't submit the op.
|
|
@@ -748,7 +715,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
748
715
|
* Deletes all keys from within this IDirectory.
|
|
749
716
|
*/
|
|
750
717
|
clear() {
|
|
751
|
-
this.throwIfDisposed();
|
|
752
718
|
// Clear the data locally first.
|
|
753
719
|
this.clearCore(true);
|
|
754
720
|
// If we are not attached, don't submit the op.
|
|
@@ -766,7 +732,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
766
732
|
* @param callback - Callback to issue
|
|
767
733
|
*/
|
|
768
734
|
forEach(callback) {
|
|
769
|
-
this.throwIfDisposed();
|
|
770
735
|
this._storage.forEach((localValue, key, map) => {
|
|
771
736
|
callback(localValue.value, key, map);
|
|
772
737
|
});
|
|
@@ -775,7 +740,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
775
740
|
* The number of entries under this IDirectory.
|
|
776
741
|
*/
|
|
777
742
|
get size() {
|
|
778
|
-
this.throwIfDisposed();
|
|
779
743
|
return this._storage.size;
|
|
780
744
|
}
|
|
781
745
|
/**
|
|
@@ -783,7 +747,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
783
747
|
* @returns The iterator
|
|
784
748
|
*/
|
|
785
749
|
entries() {
|
|
786
|
-
this.throwIfDisposed();
|
|
787
750
|
const localEntriesIterator = this._storage.entries();
|
|
788
751
|
const iterator = {
|
|
789
752
|
next() {
|
|
@@ -807,7 +770,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
807
770
|
* @returns The iterator
|
|
808
771
|
*/
|
|
809
772
|
keys() {
|
|
810
|
-
this.throwIfDisposed();
|
|
811
773
|
return this._storage.keys();
|
|
812
774
|
}
|
|
813
775
|
/**
|
|
@@ -815,7 +777,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
815
777
|
* @returns The iterator
|
|
816
778
|
*/
|
|
817
779
|
values() {
|
|
818
|
-
this.throwIfDisposed();
|
|
819
780
|
const localValuesIterator = this._storage.values();
|
|
820
781
|
const iterator = {
|
|
821
782
|
next() {
|
|
@@ -839,7 +800,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
839
800
|
* @returns The iterator
|
|
840
801
|
*/
|
|
841
802
|
[Symbol.iterator]() {
|
|
842
|
-
this.throwIfDisposed();
|
|
843
803
|
return this.entries();
|
|
844
804
|
}
|
|
845
805
|
/**
|
|
@@ -852,7 +812,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
852
812
|
* @internal
|
|
853
813
|
*/
|
|
854
814
|
processClearMessage(op, local, localOpMetadata) {
|
|
855
|
-
this.throwIfDisposed();
|
|
856
815
|
if (local) {
|
|
857
816
|
common_utils_1.assert(localOpMetadata !== undefined, 0x00f /* `pendingMessageId is missing from the local client's ${op.type} operation` */);
|
|
858
817
|
const pendingMessageId = localOpMetadata;
|
|
@@ -874,7 +833,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
874
833
|
* @internal
|
|
875
834
|
*/
|
|
876
835
|
processDeleteMessage(op, local, localOpMetadata) {
|
|
877
|
-
this.throwIfDisposed();
|
|
878
836
|
if (!this.needProcessStorageOperation(op, local, localOpMetadata)) {
|
|
879
837
|
return;
|
|
880
838
|
}
|
|
@@ -890,7 +848,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
890
848
|
* @internal
|
|
891
849
|
*/
|
|
892
850
|
processSetMessage(op, context, local, localOpMetadata) {
|
|
893
|
-
this.throwIfDisposed();
|
|
894
851
|
if (!this.needProcessStorageOperation(op, local, localOpMetadata)) {
|
|
895
852
|
return;
|
|
896
853
|
}
|
|
@@ -909,7 +866,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
909
866
|
* @internal
|
|
910
867
|
*/
|
|
911
868
|
processCreateSubDirectoryMessage(op, local, localOpMetadata) {
|
|
912
|
-
this.throwIfDisposed();
|
|
913
869
|
if (!this.needProcessSubDirectoryOperations(op, local, localOpMetadata)) {
|
|
914
870
|
return;
|
|
915
871
|
}
|
|
@@ -925,7 +881,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
925
881
|
* @internal
|
|
926
882
|
*/
|
|
927
883
|
processDeleteSubDirectoryMessage(op, local, localOpMetadata) {
|
|
928
|
-
this.throwIfDisposed();
|
|
929
884
|
if (!this.needProcessSubDirectoryOperations(op, local, localOpMetadata)) {
|
|
930
885
|
return;
|
|
931
886
|
}
|
|
@@ -937,7 +892,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
937
892
|
* @internal
|
|
938
893
|
*/
|
|
939
894
|
submitClearMessage(op) {
|
|
940
|
-
this.throwIfDisposed();
|
|
941
895
|
const pendingMessageId = ++this.pendingMessageId;
|
|
942
896
|
this.directory.submitDirectoryMessage(op, pendingMessageId);
|
|
943
897
|
this.pendingClearMessageId = pendingMessageId;
|
|
@@ -948,7 +902,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
948
902
|
* @internal
|
|
949
903
|
*/
|
|
950
904
|
submitKeyMessage(op) {
|
|
951
|
-
this.throwIfDisposed();
|
|
952
905
|
const pendingMessageId = ++this.pendingMessageId;
|
|
953
906
|
this.directory.submitDirectoryMessage(op, pendingMessageId);
|
|
954
907
|
this.pendingKeys.set(op.key, pendingMessageId);
|
|
@@ -959,7 +912,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
959
912
|
* @internal
|
|
960
913
|
*/
|
|
961
914
|
submitSubDirectoryMessage(op) {
|
|
962
|
-
this.throwIfDisposed();
|
|
963
915
|
const pendingMessageId = ++this.pendingMessageId;
|
|
964
916
|
this.directory.submitDirectoryMessage(op, pendingMessageId);
|
|
965
917
|
this.pendingSubDirectories.set(op.subdirName, pendingMessageId);
|
|
@@ -971,7 +923,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
971
923
|
* @internal
|
|
972
924
|
*/
|
|
973
925
|
*getSerializedStorage(serializer) {
|
|
974
|
-
this.throwIfDisposed();
|
|
975
926
|
for (const [key, localValue] of this._storage) {
|
|
976
927
|
const value = localValue.makeSerialized(serializer, this.directory.handle);
|
|
977
928
|
const res = [key, value];
|
|
@@ -985,7 +936,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
985
936
|
* @internal
|
|
986
937
|
*/
|
|
987
938
|
populateStorage(key, localValue) {
|
|
988
|
-
this.throwIfDisposed();
|
|
989
939
|
this._storage.set(key, localValue);
|
|
990
940
|
}
|
|
991
941
|
/**
|
|
@@ -995,7 +945,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
995
945
|
* @internal
|
|
996
946
|
*/
|
|
997
947
|
populateSubDirectory(subdirName, newSubDir) {
|
|
998
|
-
this.throwIfDisposed();
|
|
999
948
|
this._subdirectories.set(subdirName, newSubDir);
|
|
1000
949
|
}
|
|
1001
950
|
/**
|
|
@@ -1006,7 +955,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1006
955
|
* @internal
|
|
1007
956
|
*/
|
|
1008
957
|
getLocalValue(key) {
|
|
1009
|
-
this.throwIfDisposed();
|
|
1010
958
|
return this._storage.get(key);
|
|
1011
959
|
}
|
|
1012
960
|
/**
|
|
@@ -1150,23 +1098,9 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1150
1098
|
* @param op - The message if from a remote delete, or null if from a local delete
|
|
1151
1099
|
*/
|
|
1152
1100
|
deleteSubDirectoryCore(subdirName, local) {
|
|
1153
|
-
const previousValue = this.getSubDirectory(subdirName);
|
|
1154
1101
|
// This should make the subdirectory structure unreachable so it can be GC'd and won't appear in snapshots
|
|
1155
1102
|
// Might want to consider cleaning out the structure more exhaustively though?
|
|
1156
|
-
|
|
1157
|
-
this.disposeSubDirectoryTree(previousValue);
|
|
1158
|
-
return successfullyRemoved;
|
|
1159
|
-
}
|
|
1160
|
-
disposeSubDirectoryTree(directory) {
|
|
1161
|
-
if (!directory) {
|
|
1162
|
-
return;
|
|
1163
|
-
}
|
|
1164
|
-
// Dispose the subdirectory tree. This will dispose the subdirectories from bottom to top.
|
|
1165
|
-
const subDirectories = directory.subdirectories();
|
|
1166
|
-
for (const [_, subDirectory] of subDirectories) {
|
|
1167
|
-
this.disposeSubDirectoryTree(subDirectory);
|
|
1168
|
-
}
|
|
1169
|
-
directory.dispose();
|
|
1103
|
+
return this._subdirectories.delete(subdirName);
|
|
1170
1104
|
}
|
|
1171
1105
|
}
|
|
1172
1106
|
//# sourceMappingURL=directory.js.map
|