@fluidframework/map 0.59.4001 → 1.1.0-75972
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/.eslintrc.js +1 -1
- package/dist/directory.d.ts +3 -2
- package/dist/directory.d.ts.map +1 -1
- package/dist/directory.js +63 -62
- package/dist/directory.js.map +1 -1
- package/dist/interfaces.d.ts +13 -14
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/map.d.ts +7 -2
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +9 -2
- package/dist/map.js.map +1 -1
- package/dist/mapKernel.d.ts +20 -11
- package/dist/mapKernel.d.ts.map +1 -1
- package/dist/mapKernel.js +160 -82
- 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 +3 -2
- package/lib/directory.d.ts.map +1 -1
- package/lib/directory.js +63 -62
- package/lib/directory.js.map +1 -1
- package/lib/interfaces.d.ts +13 -14
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js.map +1 -1
- package/lib/map.d.ts +7 -2
- package/lib/map.d.ts.map +1 -1
- package/lib/map.js +9 -2
- package/lib/map.js.map +1 -1
- package/lib/mapKernel.d.ts +20 -11
- package/lib/mapKernel.d.ts.map +1 -1
- package/lib/mapKernel.js +160 -82
- 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 +15 -28
- package/src/directory.ts +77 -69
- package/src/interfaces.ts +14 -16
- package/src/map.ts +14 -3
- package/src/mapKernel.ts +195 -90
- package/src/packageVersion.ts +1 -1
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 = "
|
|
11
|
+
exports.pkgVersion = "1.1.0-75972";
|
|
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,aAAa,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 = \"1.1.0-75972\";\n"]}
|
package/lib/directory.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
6
6
|
import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService, IChannelServices, IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
7
|
-
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
7
|
+
import { ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
8
8
|
import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base";
|
|
9
9
|
import { IDirectory, ISerializableValue, ISharedDirectory, ISharedDirectoryEvents } from "./interfaces";
|
|
10
10
|
import { LocalValueMaker } from "./localValues";
|
|
@@ -300,7 +300,7 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
300
300
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
301
301
|
* @internal
|
|
302
302
|
*/
|
|
303
|
-
protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
|
|
303
|
+
protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
304
304
|
/**
|
|
305
305
|
* Submits an operation
|
|
306
306
|
* @param op - Op to submit
|
|
@@ -359,6 +359,7 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
359
359
|
* @internal
|
|
360
360
|
*/
|
|
361
361
|
protected applyStashedOp(): void;
|
|
362
|
+
private serializeDirectory;
|
|
362
363
|
}
|
|
363
364
|
export {};
|
|
364
365
|
//# sourceMappingURL=directory.d.ts.map
|
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;
|
|
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,iBAAiB,EAAE,MAAM,qCAAqC,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iE7B"}
|
package/lib/directory.js
CHANGED
|
@@ -16,61 +16,6 @@ import { pkgVersion } from "./packageVersion";
|
|
|
16
16
|
// We standardize on using posix slashes everywhere.
|
|
17
17
|
const posix = path.posix;
|
|
18
18
|
const snapshotFileName = "header";
|
|
19
|
-
function serializeDirectory(root, serializer) {
|
|
20
|
-
const MinValueSizeSeparateSnapshotBlob = 8 * 1024;
|
|
21
|
-
const builder = new SummaryTreeBuilder();
|
|
22
|
-
let counter = 0;
|
|
23
|
-
const blobs = [];
|
|
24
|
-
const stack = [];
|
|
25
|
-
const content = {};
|
|
26
|
-
stack.push([root, content]);
|
|
27
|
-
while (stack.length > 0) {
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
29
|
-
const [currentSubDir, currentSubDirObject] = stack.pop();
|
|
30
|
-
for (const [key, value] of currentSubDir.getSerializedStorage(serializer)) {
|
|
31
|
-
if (!currentSubDirObject.storage) {
|
|
32
|
-
currentSubDirObject.storage = {};
|
|
33
|
-
}
|
|
34
|
-
const result = {
|
|
35
|
-
type: value.type,
|
|
36
|
-
value: value.value && JSON.parse(value.value),
|
|
37
|
-
};
|
|
38
|
-
if (value.value && value.value.length >= MinValueSizeSeparateSnapshotBlob) {
|
|
39
|
-
const extraContent = {};
|
|
40
|
-
let largeContent = extraContent;
|
|
41
|
-
if (currentSubDir.absolutePath !== posix.sep) {
|
|
42
|
-
for (const dir of currentSubDir.absolutePath.substr(1).split(posix.sep)) {
|
|
43
|
-
const subDataObject = {};
|
|
44
|
-
largeContent.subdirectories = { [dir]: subDataObject };
|
|
45
|
-
largeContent = subDataObject;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
largeContent.storage = { [key]: result };
|
|
49
|
-
const blobName = `blob${counter}`;
|
|
50
|
-
counter++;
|
|
51
|
-
blobs.push(blobName);
|
|
52
|
-
builder.addBlob(blobName, JSON.stringify(extraContent));
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
currentSubDirObject.storage[key] = result;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
for (const [subdirName, subdir] of currentSubDir.subdirectories()) {
|
|
59
|
-
if (!currentSubDirObject.subdirectories) {
|
|
60
|
-
currentSubDirObject.subdirectories = {};
|
|
61
|
-
}
|
|
62
|
-
const subDataObject = {};
|
|
63
|
-
currentSubDirObject.subdirectories[subdirName] = subDataObject;
|
|
64
|
-
stack.push([subdir, subDataObject]);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
const newFormat = {
|
|
68
|
-
blobs,
|
|
69
|
-
content,
|
|
70
|
-
};
|
|
71
|
-
builder.addBlob(snapshotFileName, JSON.stringify(newFormat));
|
|
72
|
-
return builder.getSummaryTree();
|
|
73
|
-
}
|
|
74
19
|
/**
|
|
75
20
|
* The factory that defines the directory.
|
|
76
21
|
* @sealed
|
|
@@ -140,7 +85,7 @@ export class SharedDirectory extends SharedObject {
|
|
|
140
85
|
* @param type - Type identifier
|
|
141
86
|
*/
|
|
142
87
|
constructor(id, runtime, attributes) {
|
|
143
|
-
super(id, runtime, attributes);
|
|
88
|
+
super(id, runtime, attributes, "fluid_directory_");
|
|
144
89
|
/**
|
|
145
90
|
* String representation for the class.
|
|
146
91
|
*/
|
|
@@ -330,8 +275,8 @@ export class SharedDirectory extends SharedObject {
|
|
|
330
275
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
331
276
|
* @internal
|
|
332
277
|
*/
|
|
333
|
-
summarizeCore(serializer) {
|
|
334
|
-
return serializeDirectory(this.root, serializer);
|
|
278
|
+
summarizeCore(serializer, telemetryContext) {
|
|
279
|
+
return this.serializeDirectory(this.root, serializer);
|
|
335
280
|
}
|
|
336
281
|
/**
|
|
337
282
|
* Submits an operation
|
|
@@ -527,6 +472,62 @@ export class SharedDirectory extends SharedObject {
|
|
|
527
472
|
applyStashedOp() {
|
|
528
473
|
throw new Error("not implemented");
|
|
529
474
|
}
|
|
475
|
+
serializeDirectory(root, serializer, telemetryContext) {
|
|
476
|
+
const MinValueSizeSeparateSnapshotBlob = 8 * 1024;
|
|
477
|
+
const builder = new SummaryTreeBuilder();
|
|
478
|
+
let counter = 0;
|
|
479
|
+
const blobs = [];
|
|
480
|
+
const stack = [];
|
|
481
|
+
const content = {};
|
|
482
|
+
stack.push([root, content]);
|
|
483
|
+
while (stack.length > 0) {
|
|
484
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
485
|
+
const [currentSubDir, currentSubDirObject] = stack.pop();
|
|
486
|
+
for (const [key, value] of currentSubDir.getSerializedStorage(serializer)) {
|
|
487
|
+
if (!currentSubDirObject.storage) {
|
|
488
|
+
currentSubDirObject.storage = {};
|
|
489
|
+
}
|
|
490
|
+
const result = {
|
|
491
|
+
type: value.type,
|
|
492
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
493
|
+
value: value.value && JSON.parse(value.value),
|
|
494
|
+
};
|
|
495
|
+
if (value.value && value.value.length >= MinValueSizeSeparateSnapshotBlob) {
|
|
496
|
+
const extraContent = {};
|
|
497
|
+
let largeContent = extraContent;
|
|
498
|
+
if (currentSubDir.absolutePath !== posix.sep) {
|
|
499
|
+
for (const dir of currentSubDir.absolutePath.substr(1).split(posix.sep)) {
|
|
500
|
+
const subDataObject = {};
|
|
501
|
+
largeContent.subdirectories = { [dir]: subDataObject };
|
|
502
|
+
largeContent = subDataObject;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
largeContent.storage = { [key]: result };
|
|
506
|
+
const blobName = `blob${counter}`;
|
|
507
|
+
counter++;
|
|
508
|
+
blobs.push(blobName);
|
|
509
|
+
builder.addBlob(blobName, JSON.stringify(extraContent));
|
|
510
|
+
}
|
|
511
|
+
else {
|
|
512
|
+
currentSubDirObject.storage[key] = result;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
for (const [subdirName, subdir] of currentSubDir.subdirectories()) {
|
|
516
|
+
if (!currentSubDirObject.subdirectories) {
|
|
517
|
+
currentSubDirObject.subdirectories = {};
|
|
518
|
+
}
|
|
519
|
+
const subDataObject = {};
|
|
520
|
+
currentSubDirObject.subdirectories[subdirName] = subDataObject;
|
|
521
|
+
stack.push([subdir, subDataObject]);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
const newFormat = {
|
|
525
|
+
blobs,
|
|
526
|
+
content,
|
|
527
|
+
};
|
|
528
|
+
builder.addBlob(snapshotFileName, JSON.stringify(newFormat));
|
|
529
|
+
return builder.getSummaryTree();
|
|
530
|
+
}
|
|
530
531
|
}
|
|
531
532
|
/**
|
|
532
533
|
* Node of the directory tree.
|
|
@@ -1029,13 +1030,13 @@ class SubDirectory extends TypedEventEmitter {
|
|
|
1029
1030
|
// If I have a NACK clear, we can ignore all ops.
|
|
1030
1031
|
return false;
|
|
1031
1032
|
}
|
|
1032
|
-
|
|
1033
|
+
const pendingKeyMessageId = this.pendingKeys.get(op.key);
|
|
1034
|
+
if (pendingKeyMessageId !== undefined) {
|
|
1033
1035
|
// Found an NACK op, clear it from the directory if the latest sequence number in the directory
|
|
1034
1036
|
// match the message's and don't process the op.
|
|
1035
1037
|
if (local) {
|
|
1036
1038
|
assert(localOpMetadata !== undefined, 0x011 /* pendingMessageId is missing from the local client's operation */);
|
|
1037
1039
|
const pendingMessageId = localOpMetadata;
|
|
1038
|
-
const pendingKeyMessageId = this.pendingKeys.get(op.key);
|
|
1039
1040
|
if (pendingKeyMessageId === pendingMessageId) {
|
|
1040
1041
|
this.pendingKeys.delete(op.key);
|
|
1041
1042
|
}
|
|
@@ -1056,11 +1057,11 @@ class SubDirectory extends TypedEventEmitter {
|
|
|
1056
1057
|
* @returns True if the operation should be processed, false otherwise
|
|
1057
1058
|
*/
|
|
1058
1059
|
needProcessSubDirectoryOperations(op, local, localOpMetadata) {
|
|
1059
|
-
|
|
1060
|
+
const pendingSubDirectoryMessageId = this.pendingSubDirectories.get(op.subdirName);
|
|
1061
|
+
if (pendingSubDirectoryMessageId !== undefined) {
|
|
1060
1062
|
if (local) {
|
|
1061
1063
|
assert(localOpMetadata !== undefined, 0x012 /* pendingMessageId is missing from the local client's operation */);
|
|
1062
1064
|
const pendingMessageId = localOpMetadata;
|
|
1063
|
-
const pendingSubDirectoryMessageId = this.pendingSubDirectories.get(op.subdirName);
|
|
1064
1065
|
if (pendingSubDirectoryMessageId === pendingMessageId) {
|
|
1065
1066
|
this.pendingSubDirectories.delete(op.subdirName);
|
|
1066
1067
|
}
|