@fluidframework/tree 2.82.0 → 2.83.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/CHANGELOG.md +43 -0
- package/README.md +33 -5
- package/api-report/tree.alpha.api.md +25 -21
- package/api-report/tree.beta.api.md +14 -2
- package/api-report/tree.legacy.beta.api.md +14 -2
- package/api-report/tree.legacy.public.api.md +1 -1
- package/api-report/tree.public.api.md +1 -1
- package/dist/alpha.d.ts +3 -3
- package/dist/beta.d.ts +1 -0
- package/dist/codec/codec.d.ts +3 -39
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +5 -50
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +1 -2
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +20 -7
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +56 -30
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +6 -4
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/extensibleUnionNode.d.ts +97 -0
- package/dist/extensibleUnionNode.d.ts.map +1 -0
- package/dist/{extensibleSchemaUnion.js → extensibleUnionNode.js} +28 -18
- package/dist/extensibleUnionNode.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +4 -4
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +7 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +3 -3
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV1.d.ts +2 -3
- package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV1.js +1 -2
- package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV2.d.ts +2 -3
- package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV2.js +1 -2
- package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +4 -4
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +6 -4
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/tree.d.ts +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +1 -1
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +2 -4
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +3 -3
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -2
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +2 -2
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +148 -29
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +180 -99
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts +1 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +1 -0
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +29 -0
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +2 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +4 -13
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +33 -7
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +3 -3
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +48 -32
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/util/bTreeUtils.d.ts.map +1 -1
- package/dist/util/bTreeUtils.js +6 -6
- package/dist/util/bTreeUtils.js.map +1 -1
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +5 -6
- package/dist/util/rangeMap.js.map +1 -1
- package/lib/alpha.d.ts +3 -3
- package/lib/beta.d.ts +1 -0
- package/lib/codec/codec.d.ts +3 -39
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +4 -47
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +20 -7
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +59 -33
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +6 -4
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/extensibleUnionNode.d.ts +97 -0
- package/lib/extensibleUnionNode.d.ts.map +1 -0
- package/lib/{extensibleSchemaUnion.js → extensibleUnionNode.js} +28 -18
- package/lib/extensibleUnionNode.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +5 -5
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +8 -2
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +3 -3
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV1.d.ts +2 -3
- package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV1.js +1 -2
- package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV2.d.ts +2 -3
- package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV2.js +1 -2
- package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +4 -4
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +6 -4
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +1 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/tree.d.ts +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +1 -1
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +2 -4
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +3 -3
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +2 -2
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js +2 -2
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +2 -2
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +148 -29
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +179 -98
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts +1 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +1 -0
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +29 -0
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +5 -14
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +34 -8
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +3 -3
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +30 -14
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/util/bTreeUtils.d.ts.map +1 -1
- package/lib/util/bTreeUtils.js +6 -6
- package/lib/util/bTreeUtils.js.map +1 -1
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +5 -6
- package/lib/util/rangeMap.js.map +1 -1
- package/package.json +23 -23
- package/src/codec/codec.ts +10 -112
- package/src/codec/index.ts +0 -3
- package/src/codec/versioned/codec.ts +119 -83
- package/src/core/tree/detachedFieldIndexCodecs.ts +6 -4
- package/src/{extensibleSchemaUnion.ts → extensibleUnionNode.ts} +61 -19
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +5 -11
- package/src/feature-libraries/forest-summary/codec.ts +8 -7
- package/src/feature-libraries/forest-summary/formatCommon.ts +5 -3
- package/src/feature-libraries/forest-summary/formatV1.ts +1 -3
- package/src/feature-libraries/forest-summary/formatV2.ts +1 -3
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +5 -6
- package/src/feature-libraries/schema-index/codec.ts +6 -4
- package/src/index.ts +3 -3
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/sharedTreeChangeCodecs.ts +2 -2
- package/src/shared-tree/tree.ts +1 -1
- package/src/shared-tree/treeAlpha.ts +1 -1
- package/src/shared-tree/treeCheckout.ts +2 -4
- package/src/shared-tree-core/editManagerCodecsCommons.ts +7 -7
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -10
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -10
- package/src/shared-tree-core/messageCodecs.ts +2 -6
- package/src/simple-tree/api/index.ts +2 -2
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +344 -142
- package/src/simple-tree/api/tree.ts +1 -1
- package/src/simple-tree/api/treeBeta.ts +1 -1
- package/src/simple-tree/core/allowedTypes.ts +1 -1
- package/src/simple-tree/core/unhydratedFlexTree.ts +43 -1
- package/src/simple-tree/index.ts +2 -2
- package/src/simple-tree/node-kinds/array/arrayNode.ts +13 -19
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +51 -10
- package/src/text/textDomainFormatted.ts +37 -17
- package/src/util/bTreeUtils.ts +10 -6
- package/src/util/rangeMap.ts +9 -6
- package/api-extractor-lint.json +0 -4
- package/dist/extensibleSchemaUnion.d.ts +0 -72
- package/dist/extensibleSchemaUnion.d.ts.map +0 -1
- package/dist/extensibleSchemaUnion.js.map +0 -1
- package/lib/extensibleSchemaUnion.d.ts +0 -72
- package/lib/extensibleSchemaUnion.d.ts.map +0 -1
- package/lib/extensibleSchemaUnion.js.map +0 -1
|
@@ -37,7 +37,7 @@ function encodeFieldChangesForJsonI(change, context, fieldChangesetCodecs) {
|
|
|
37
37
|
const encodedFields = [];
|
|
38
38
|
for (const [field, fieldChange] of change) {
|
|
39
39
|
const { codec, compiledSchema } = getFieldChangesetCodec(fieldChange.fieldKind, fieldChangesetCodecs);
|
|
40
|
-
const encodedChange = codec.
|
|
40
|
+
const encodedChange = codec.encode(fieldChange.change, context);
|
|
41
41
|
if (compiledSchema !== undefined && !compiledSchema.check(encodedChange)) {
|
|
42
42
|
(0, internal_1.fail)(0xb1f /* Encoded change didn't pass schema validation. */);
|
|
43
43
|
}
|
|
@@ -90,7 +90,7 @@ function decodeFieldChangesFromJson(encodedChange, parentId, decoded, context, i
|
|
|
90
90
|
return nodeId;
|
|
91
91
|
},
|
|
92
92
|
};
|
|
93
|
-
const fieldChangeset = codec.
|
|
93
|
+
const fieldChangeset = codec.decode(field.change, fieldContext);
|
|
94
94
|
const crossFieldKeys = getChangeHandler(fieldKinds, field.fieldKind).getCrossFieldKeys(fieldChangeset);
|
|
95
95
|
for (const { key, count } of crossFieldKeys) {
|
|
96
96
|
decoded.crossFieldKeys.set(key, count, fieldId);
|
|
@@ -273,8 +273,8 @@ function getFieldChangesetCodecs(fieldKinds, revisionTagCodec, codecOptions) {
|
|
|
273
273
|
const codec = kind.changeHandler.codecsFactory(revisionTagCodec).resolve(formatVersion);
|
|
274
274
|
return {
|
|
275
275
|
codec,
|
|
276
|
-
compiledSchema: codec.
|
|
277
|
-
? (0, index_js_1.extractJsonValidator)(codecOptions.jsonValidator).compile(codec.
|
|
276
|
+
compiledSchema: codec.encodedSchema
|
|
277
|
+
? (0, index_js_1.extractJsonValidator)(codecOptions.jsonValidator).compile(codec.encodedSchema)
|
|
278
278
|
: undefined,
|
|
279
279
|
};
|
|
280
280
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modularChangeCodecV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeCodecV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAwE;AAGxE,mDAO8B;AAW9B,kDAM6B;AAC7B,kEAAuF;AACvF,yDAKoC;AACpC,wEAAqE;AAOrE,+DAAyD;AACzD,yEAQoC;AACpC,mEAQiC;AAwBjC,SAAgB,sBAAsB,CACrC,SAA8B,EAC9B,oBAA0C;IAK1C,MAAM,KAAK,GAAG,oBAAoB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAClD,IAAA,iBAAM,EAAC,KAAK,KAAK,SAAS,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/E,OAAO,KAAK,CAAC;AACd,CAAC;AAVD,wDAUC;AAED,SAAgB,yBAAyB,CACxC,MAAsB,EACtB,OAA8B,EAC9B,WAA6C,EAC7C,oBAA0C;IAE1C,MAAM,YAAY,GAA+B;QAChD,WAAW,EAAE,OAAO;QAEpB,UAAU,EAAE,CAAC,MAAc,EAAwB,EAAE;YACpD,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;YAChE,IAAA,iBAAM,EAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;YACxD,OAAO,wBAAwB,CAAC,IAAI,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;QAC3E,CAAC;QAED,UAAU,EAAE,GAAG,EAAE,CAAC,IAAA,eAAI,EAAC,KAAK,CAAC,mDAAmD,CAAC;KACjF,CAAC;IAEF,OAAO,0BAA0B,CAAC,MAAM,EAAE,YAAY,EAAE,oBAAoB,CAAC,CA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AkB,EAClB,YAAY,CAAC,aAAa,CAC1B,CAAC;AACH,CAAC;AA7CD,4DA6CC;AAED,SAAS,gBAAgB,CACxB,UAAkC,EAClC,SAA8B;IAE9B,IAAI,SAAS,KAAK,sCAAgB,CAAC,UAAU,EAAE,CAAC;QAC/C,OAAO,sCAAgB,CAAC,aAAa,CAAC;IACvC,CAAC;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC;IAC9D,IAAA,iBAAM,EAAC,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC9D,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,SAAS,iBAAiB,CACzB,aAKC,EACD,QAAiC,EACjC,OAA8B;IAE9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,OAAO,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob, fail } from \"@fluidframework/core-utils/internal\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport {\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\ttype IMultiFormatCodec,\n\ttype SchemaValidationFunction,\n\textractJsonValidator,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tFieldKey,\n\tFieldKindIdentifier,\n\tITreeCursorSynchronous,\n\tRevisionInfo,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport {\n\ttype IdAllocator,\n\ttype JsonCompatibleReadOnly,\n\ttype Mutable,\n\tbrand,\n\tidAllocatorFromMaxId,\n} from \"../../util/index.js\";\nimport { newChangeAtomIdBTree, type ChangeAtomIdBTree } from \"../changeAtomIdBTree.js\";\nimport {\n\ttype FieldBatchCodec,\n\ttype TreeChunk,\n\tchunkFieldSingle,\n\tdefaultChunkPolicy,\n} from \"../chunked-forest/index.js\";\nimport { TreeCompressionStrategy } from \"../treeCompressionUtils.js\";\n\nimport type { FieldChangeEncodingContext, FieldChangeHandler } from \"./fieldChangeHandler.js\";\nimport type {\n\tFieldKindConfiguration,\n\tFieldKindConfigurationEntry,\n} from \"./fieldKindConfiguration.js\";\nimport { genericFieldKind } from \"./genericFieldKind.js\";\nimport {\n\ttype EncodedBuilds,\n\ttype EncodedBuildsArray,\n\ttype EncodedFieldChange,\n\ttype EncodedFieldChangeMap,\n\tEncodedModularChangesetV1,\n\ttype EncodedNodeChangeset,\n\ttype EncodedRevisionInfo,\n} from \"./modularChangeFormatV1.js\";\nimport {\n\ttype FieldChangeset,\n\tnewCrossFieldKeyTable,\n\ttype FieldChangeMap,\n\ttype FieldId,\n\ttype ModularChangeset,\n\ttype NodeChangeset,\n\ttype NodeId,\n} from \"./modularChangeTypes.js\";\n\ntype ModularChangeCodec = IJsonCodec<\n\tModularChangeset,\n\tEncodedModularChangesetV1,\n\tEncodedModularChangesetV1,\n\tChangeEncodingContext\n>;\n\ntype FieldCodec = IMultiFormatCodec<\n\tFieldChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n>;\n\ntype FieldChangesetCodecs = Map<\n\tFieldKindIdentifier,\n\t{\n\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\tcodec: FieldCodec;\n\t}\n>;\n\nexport function getFieldChangesetCodec(\n\tfieldKind: FieldKindIdentifier,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): {\n\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\tcodec: FieldCodec;\n} {\n\tconst entry = fieldChangesetCodecs.get(fieldKind);\n\tassert(entry !== undefined, 0x5ea /* Tried to encode unsupported fieldKind */);\n\treturn entry;\n}\n\nexport function encodeFieldChangesForJson(\n\tchange: FieldChangeMap,\n\tcontext: ChangeEncodingContext,\n\tnodeChanges: ChangeAtomIdBTree<NodeChangeset>,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedFieldChangeMap {\n\tconst fieldContext: FieldChangeEncodingContext = {\n\t\tbaseContext: context,\n\n\t\tencodeNode: (nodeId: NodeId): EncodedNodeChangeset => {\n\t\t\tconst node = nodeChanges.get([nodeId.revision, nodeId.localId]);\n\t\t\tassert(node !== undefined, 0x92e /* Unknown node ID */);\n\t\t\treturn encodeNodeChangesForJson(node, fieldContext, fieldChangesetCodecs);\n\t\t},\n\n\t\tdecodeNode: () => fail(0xb1e /* Should not decode nodes during field encoding */),\n\t};\n\n\treturn encodeFieldChangesForJsonI(change, fieldContext, fieldChangesetCodecs);\n}\n\nexport function encodeFieldChangesForJsonI(\n\tchange: FieldChangeMap,\n\tcontext: FieldChangeEncodingContext,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedFieldChangeMap {\n\tconst encodedFields: EncodedFieldChangeMap = [];\n\n\tfor (const [field, fieldChange] of change) {\n\t\tconst { codec, compiledSchema } = getFieldChangesetCodec(\n\t\t\tfieldChange.fieldKind,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t\tconst encodedChange = codec.json.encode(fieldChange.change, context);\n\t\tif (compiledSchema !== undefined && !compiledSchema.check(encodedChange)) {\n\t\t\tfail(0xb1f /* Encoded change didn't pass schema validation. */);\n\t\t}\n\n\t\tconst fieldKey: FieldKey = field;\n\t\tconst encodedField: EncodedFieldChange = {\n\t\t\tfieldKey,\n\t\t\tfieldKind: fieldChange.fieldKind,\n\t\t\tchange: encodedChange,\n\t\t};\n\n\t\tencodedFields.push(encodedField);\n\t}\n\n\treturn encodedFields;\n}\n\nexport function encodeNodeChangesForJson(\n\tchange: NodeChangeset,\n\tcontext: FieldChangeEncodingContext,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedNodeChangeset {\n\tconst encodedChange: EncodedNodeChangeset = {};\n\t// Note: revert constraints are ignored for now because they would only be needed if we supported reverting changes made by peers.\n\tconst { fieldChanges, nodeExistsConstraint } = change;\n\n\tif (fieldChanges !== undefined) {\n\t\tencodedChange.fieldChanges = encodeFieldChangesForJsonI(\n\t\t\tfieldChanges,\n\t\t\tcontext,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t}\n\n\tif (nodeExistsConstraint !== undefined) {\n\t\tencodedChange.nodeExistsConstraint = nodeExistsConstraint;\n\t}\n\n\treturn encodedChange;\n}\n\nexport function decodeFieldChangesFromJson(\n\tencodedChange: EncodedFieldChangeMap,\n\tparentId: NodeId | undefined,\n\tdecoded: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tidAllocator: IdAllocator,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): FieldChangeMap {\n\tconst decodedFields: FieldChangeMap = new Map();\n\tfor (const field of encodedChange) {\n\t\tconst { codec, compiledSchema } = getFieldChangesetCodec(\n\t\t\tfield.fieldKind,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t\tif (compiledSchema !== undefined && !compiledSchema.check(field.change)) {\n\t\t\tfail(0xb20 /* Encoded change didn't pass schema validation. */);\n\t\t}\n\n\t\tconst fieldId: FieldId = {\n\t\t\tnodeId: parentId,\n\t\t\tfield: field.fieldKey,\n\t\t};\n\n\t\tconst fieldContext: FieldChangeEncodingContext = {\n\t\t\tbaseContext: context,\n\n\t\t\tencodeNode: () => fail(0xb21 /* Should not encode nodes during field decoding */),\n\n\t\t\tdecodeNode: (encodedNode: EncodedNodeChangeset): NodeId => {\n\t\t\t\tconst nodeId: NodeId = {\n\t\t\t\t\trevision: context.revision,\n\t\t\t\t\tlocalId: brand(idAllocator.allocate()),\n\t\t\t\t};\n\n\t\t\t\tconst node = decodeNodeChangesetFromJson(\n\t\t\t\t\tencodedNode,\n\t\t\t\t\tnodeId,\n\t\t\t\t\tdecoded,\n\t\t\t\t\tcontext,\n\t\t\t\t\tidAllocator,\n\t\t\t\t\tfieldKinds,\n\t\t\t\t\tfieldChangesetCodecs,\n\t\t\t\t);\n\n\t\t\t\tdecoded.nodeChanges.set([nodeId.revision, nodeId.localId], node);\n\t\t\t\tdecoded.nodeToParent.set([nodeId.revision, nodeId.localId], fieldId);\n\t\t\t\treturn nodeId;\n\t\t\t},\n\t\t};\n\n\t\tconst fieldChangeset = codec.json.decode(field.change, fieldContext);\n\n\t\tconst crossFieldKeys = getChangeHandler(fieldKinds, field.fieldKind).getCrossFieldKeys(\n\t\t\tfieldChangeset,\n\t\t);\n\n\t\tfor (const { key, count } of crossFieldKeys) {\n\t\t\tdecoded.crossFieldKeys.set(key, count, fieldId);\n\t\t}\n\n\t\tconst fieldKey: FieldKey = brand<FieldKey>(field.fieldKey);\n\n\t\tdecodedFields.set(fieldKey, {\n\t\t\tfieldKind: field.fieldKind,\n\t\t\tchange: brand(fieldChangeset),\n\t\t});\n\t}\n\n\treturn decodedFields;\n}\n\nexport function decodeNodeChangesetFromJson(\n\tencodedChange: EncodedNodeChangeset,\n\tid: NodeId,\n\tdecoded: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tidAllocator: IdAllocator,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): NodeChangeset {\n\tconst decodedChange: NodeChangeset = {};\n\tconst { fieldChanges, nodeExistsConstraint } = encodedChange;\n\n\tif (fieldChanges !== undefined) {\n\t\tdecodedChange.fieldChanges = decodeFieldChangesFromJson(\n\t\t\tfieldChanges,\n\t\t\tid,\n\t\t\tdecoded,\n\t\t\tcontext,\n\t\t\tidAllocator,\n\t\t\tfieldKinds,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t}\n\n\tif (nodeExistsConstraint !== undefined) {\n\t\tdecodedChange.nodeExistsConstraint = nodeExistsConstraint;\n\t}\n\n\treturn decodedChange;\n}\n\nexport function encodeDetachedNodes(\n\tdetachedNodes: ChangeAtomIdBTree<TreeChunk> | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): EncodedBuilds | undefined {\n\tif (detachedNodes === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst treesToEncode: ITreeCursorSynchronous[] = [];\n\tconst buildsArray: EncodedBuildsArray = [];\n\n\tlet buildsForRevision:\n\t\t| [[ChangesetLocalId, number][], EncodedRevisionTag]\n\t\t| [[ChangesetLocalId, number][]]\n\t\t| undefined;\n\n\tfor (const [[revision, id], chunk] of detachedNodes.entries()) {\n\t\tconst encodedRevision = encodeRevisionOpt(revisionTagCodec, revision, context);\n\n\t\tif (buildsForRevision === undefined || buildsForRevision[1] !== encodedRevision) {\n\t\t\tif (buildsForRevision !== undefined) {\n\t\t\t\tbuildsArray.push(buildsForRevision);\n\t\t\t}\n\n\t\t\tbuildsForRevision = encodedRevision === undefined ? [[]] : [[], encodedRevision];\n\t\t}\n\n\t\ttreesToEncode.push(chunk.cursor());\n\t\tconst treeIndexInBatch = treesToEncode.length - 1;\n\t\tbuildsForRevision?.[0].push([id, treeIndexInBatch]);\n\t}\n\n\tif (buildsForRevision !== undefined) {\n\t\tbuildsArray.push(buildsForRevision);\n\t}\n\n\treturn buildsArray.length === 0\n\t\t? undefined\n\t\t: {\n\t\t\t\tbuilds: buildsArray,\n\t\t\t\ttrees: fieldsCodec.encode(treesToEncode, {\n\t\t\t\t\tencodeType: chunkCompressionStrategy,\n\t\t\t\t\tschema: context.schema,\n\t\t\t\t\toriginatorId: context.originatorId,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t}),\n\t\t\t};\n}\n\nexport function decodeDetachedNodes(\n\tencoded: EncodedBuilds | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): ChangeAtomIdBTree<TreeChunk> | undefined {\n\tif (encoded === undefined || encoded.builds.length === 0) {\n\t\treturn undefined;\n\t}\n\n\tconst chunks = fieldsCodec.decode(encoded.trees, {\n\t\tencodeType: chunkCompressionStrategy,\n\t\toriginatorId: context.originatorId,\n\t\tidCompressor: context.idCompressor,\n\t});\n\tconst getChunk = (index: number): TreeChunk => {\n\t\tassert(index < chunks.length, 0x898 /* out of bounds index for build chunk */);\n\t\treturn chunkFieldSingle(chunks[index] ?? oob(), {\n\t\t\tpolicy: defaultChunkPolicy,\n\t\t\tidCompressor: context.idCompressor,\n\t\t});\n\t};\n\n\tconst map: ModularChangeset[\"builds\"] = newChangeAtomIdBTree();\n\t// eslint-disable-next-line unicorn/no-array-for-each -- Codec internals: minimizing changes to serialization logic\n\tencoded.builds.forEach((build) => {\n\t\t// EncodedRevisionTag cannot be an array so this ensures that we can isolate the tuple\n\t\tconst revision =\n\t\t\tbuild[1] === undefined ? context.revision : revisionTagCodec.decode(build[1], context);\n\n\t\tconst decodedChunks: [ChangesetLocalId, TreeChunk][] = build[0].map(([i, n]) => [\n\t\t\ti,\n\t\t\tgetChunk(n),\n\t\t]);\n\n\t\tfor (const [id, chunk] of decodedChunks) {\n\t\t\tmap.set([revision, id], chunk);\n\t\t}\n\t});\n\n\treturn map;\n}\n\nexport function encodeRevisionInfos(\n\trevisions: readonly RevisionInfo[],\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): EncodedRevisionInfo[] | undefined {\n\tif (context.revision !== undefined) {\n\t\tassert(\n\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- Using optional chaining here would change behavior: `revisions[0]?.rollbackOf === undefined` is true when revisions[0] is undefined, but this check requires revisions[0] to be defined. As currently written, such a change would be safe because context.revision is included in the check and from a couple lines above is confirmed not undefined. But this more verbose form is clearer.\n\t\t\trevisions.length === 1 &&\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n\t\t\t\trevisions[0] !== undefined &&\n\t\t\t\trevisions[0].revision === context.revision &&\n\t\t\t\trevisions[0].rollbackOf === undefined,\n\t\t\t0x964 /* A tagged change should only contain the tagged revision */,\n\t\t);\n\n\t\treturn undefined;\n\t}\n\n\tconst encodedRevisions = [];\n\tfor (const revision of revisions) {\n\t\tconst encodedRevision: Mutable<EncodedRevisionInfo> = {\n\t\t\trevision: revisionTagCodec.encode(revision.revision, context),\n\t\t};\n\n\t\tif (revision.rollbackOf !== undefined) {\n\t\t\tencodedRevision.rollbackOf = revisionTagCodec.encode(revision.rollbackOf, context);\n\t\t}\n\n\t\tencodedRevisions.push(encodedRevision);\n\t}\n\n\treturn encodedRevisions;\n}\n\nexport function decodeRevisionInfos(\n\trevisions: readonly EncodedRevisionInfo[] | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): RevisionInfo[] | undefined {\n\tif (revisions === undefined) {\n\t\treturn context.revision === undefined ? undefined : [{ revision: context.revision }];\n\t}\n\n\tconst decodedRevisions = [];\n\tfor (const revision of revisions) {\n\t\tconst decodedRevision: Mutable<RevisionInfo> = {\n\t\t\trevision: revisionTagCodec.decode(revision.revision, context),\n\t\t};\n\n\t\tif (revision.rollbackOf !== undefined) {\n\t\t\tdecodedRevision.rollbackOf = revisionTagCodec.decode(revision.rollbackOf, context);\n\t\t}\n\n\t\tdecodedRevisions.push(decodedRevision);\n\t}\n\n\treturn decodedRevisions;\n}\n\nexport function encodeChange(\n\tchange: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tfieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): EncodedModularChangesetV1 {\n\t// Destroys only exist in rollback changesets, which are never sent.\n\tassert(change.destroys === undefined, 0x899 /* Unexpected changeset with destroys */);\n\treturn {\n\t\tmaxId: change.maxId,\n\t\trevisions:\n\t\t\tchange.revisions === undefined\n\t\t\t\t? undefined\n\t\t\t\t: encodeRevisionInfos(change.revisions, context, revisionTagCodec),\n\t\tchanges: encodeFieldChangesForJson(\n\t\t\tchange.fieldChanges,\n\t\t\tcontext,\n\t\t\tchange.nodeChanges,\n\t\t\tfieldChangesetCodecs,\n\t\t),\n\t\tbuilds: encodeDetachedNodes(\n\t\t\tchange.builds,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t),\n\t\trefreshers: encodeDetachedNodes(\n\t\t\tchange.refreshers,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t),\n\t\tviolations: change.constraintViolationCount,\n\t};\n}\n\nexport function decodeChange(\n\tencodedChange: EncodedModularChangesetV1,\n\tcontext: ChangeEncodingContext,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): Mutable<ModularChangeset> {\n\tconst decoded: Mutable<ModularChangeset> = {\n\t\tfieldChanges: new Map(),\n\t\tnodeChanges: newChangeAtomIdBTree(),\n\t\tnodeToParent: newChangeAtomIdBTree(),\n\t\tnodeAliases: newChangeAtomIdBTree(),\n\t\tcrossFieldKeys: newCrossFieldKeyTable(),\n\t};\n\n\tdecoded.fieldChanges = decodeFieldChangesFromJson(\n\t\tencodedChange.changes,\n\t\tundefined,\n\t\tdecoded,\n\t\tcontext,\n\t\tidAllocatorFromMaxId(encodedChange.maxId),\n\t\tfieldKinds,\n\t\tfieldChangesetCodecs,\n\t);\n\n\tif (encodedChange.builds !== undefined) {\n\t\tdecoded.builds = decodeDetachedNodes(\n\t\t\tencodedChange.builds,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t}\n\tif (encodedChange.refreshers !== undefined) {\n\t\tdecoded.refreshers = decodeDetachedNodes(\n\t\t\tencodedChange.refreshers,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t}\n\n\tif (encodedChange.violations !== undefined) {\n\t\tdecoded.constraintViolationCount = encodedChange.violations;\n\t}\n\n\tconst decodedRevInfos = decodeRevisionInfos(\n\t\tencodedChange.revisions,\n\t\tcontext,\n\t\trevisionTagCodec,\n\t);\n\tif (decodedRevInfos !== undefined) {\n\t\tdecoded.revisions = decodedRevInfos;\n\t}\n\tif (encodedChange.maxId !== undefined) {\n\t\tdecoded.maxId = encodedChange.maxId;\n\t}\n\treturn decoded;\n}\n\nexport function getFieldChangesetCodecs(\n\tfieldKinds: FieldKindConfiguration,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tcodecOptions: ICodecOptions,\n): Map<\n\tFieldKindIdentifier,\n\t{ compiledSchema?: SchemaValidationFunction<TAnySchema>; codec: FieldCodec }\n> {\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tconst getMapEntry = ({ kind, formatVersion }: FieldKindConfigurationEntry) => {\n\t\tconst codec = kind.changeHandler.codecsFactory(revisionTagCodec).resolve(formatVersion);\n\t\treturn {\n\t\t\tcodec,\n\t\t\tcompiledSchema: codec.json.encodedSchema\n\t\t\t\t? extractJsonValidator(codecOptions.jsonValidator).compile(codec.json.encodedSchema)\n\t\t\t\t: undefined,\n\t\t};\n\t};\n\n\t/**\n\t * The codec version for the generic field kind.\n\t */\n\tconst genericFieldKindFormatVersion = 1;\n\tconst fieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t> = new Map([\n\t\t[\n\t\t\tgenericFieldKind.identifier,\n\t\t\tgetMapEntry({ kind: genericFieldKind, formatVersion: genericFieldKindFormatVersion }),\n\t\t],\n\t]);\n\n\t// eslint-disable-next-line unicorn/no-array-for-each -- Map.forEach with (value, key) signature; codec initialization\n\tfieldKinds.forEach((entry, identifier) => {\n\t\tfieldChangesetCodecs.set(identifier, getMapEntry(entry));\n\t});\n\n\treturn fieldChangesetCodecs;\n}\n\nexport function makeModularChangeCodecV1(\n\tfieldKinds: FieldKindConfiguration,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tcodecOptions: ICodecOptions,\n\tchunkCompressionStrategy: TreeCompressionStrategy = TreeCompressionStrategy.Compressed,\n): ModularChangeCodec {\n\tconst fieldChangesetCodecs = getFieldChangesetCodecs(\n\t\tfieldKinds,\n\t\trevisionTagCodec,\n\t\tcodecOptions,\n\t);\n\n\tconst modularChangeCodec: ModularChangeCodec = {\n\t\tencode: (change, context) =>\n\t\t\tencodeChange(\n\t\t\t\tchange,\n\t\t\t\tcontext,\n\t\t\t\tfieldChangesetCodecs,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tfieldsCodec,\n\t\t\t\tchunkCompressionStrategy,\n\t\t\t),\n\t\tdecode: (encodedChange, context) =>\n\t\t\tdecodeChange(\n\t\t\t\tencodedChange,\n\t\t\t\tcontext,\n\t\t\t\tfieldKinds,\n\t\t\t\tfieldChangesetCodecs,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tfieldsCodec,\n\t\t\t\tchunkCompressionStrategy,\n\t\t\t),\n\t};\n\n\treturn withSchemaValidation(\n\t\tEncodedModularChangesetV1,\n\t\tmodularChangeCodec,\n\t\tcodecOptions.jsonValidator,\n\t);\n}\n\nfunction getChangeHandler(\n\tfieldKinds: FieldKindConfiguration,\n\tfieldKind: FieldKindIdentifier,\n): FieldChangeHandler<unknown> {\n\tif (fieldKind === genericFieldKind.identifier) {\n\t\treturn genericFieldKind.changeHandler;\n\t}\n\n\tconst handler = fieldKinds.get(fieldKind)?.kind.changeHandler;\n\tassert(handler !== undefined, 0x9c1 /* Unknown field kind */);\n\treturn handler;\n}\n\nfunction encodeRevisionOpt(\n\trevisionCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\trevision: RevisionTag | undefined,\n\tcontext: ChangeEncodingContext,\n): EncodedRevisionTag | undefined {\n\tif (revision === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn revision === context.revision ? undefined : revisionCodec.encode(revision, context);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"modularChangeCodecV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeCodecV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAwE;AAGxE,mDAM8B;AAW9B,kDAM6B;AAC7B,kEAAuF;AACvF,yDAKoC;AACpC,wEAAqE;AAOrE,+DAAyD;AACzD,yEAQoC;AACpC,mEAQiC;AAwBjC,SAAgB,sBAAsB,CACrC,SAA8B,EAC9B,oBAA0C;IAK1C,MAAM,KAAK,GAAG,oBAAoB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAClD,IAAA,iBAAM,EAAC,KAAK,KAAK,SAAS,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/E,OAAO,KAAK,CAAC;AACd,CAAC;AAVD,wDAUC;AAED,SAAgB,yBAAyB,CACxC,MAAsB,EACtB,OAA8B,EAC9B,WAA6C,EAC7C,oBAA0C;IAE1C,MAAM,YAAY,GAA+B;QAChD,WAAW,EAAE,OAAO;QAEpB,UAAU,EAAE,CAAC,MAAc,EAAwB,EAAE;YACpD,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;YAChE,IAAA,iBAAM,EAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;YACxD,OAAO,wBAAwB,CAAC,IAAI,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;QAC3E,CAAC;QAED,UAAU,EAAE,GAAG,EAAE,CAAC,IAAA,eAAI,EAAC,KAAK,CAAC,mDAAmD,CAAC;KACjF,CAAC;IAEF,OAAO,0BAA0B,CAAC,MAAM,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;AAC/E,CAAC;AAnBD,8DAmBC;AAED,SAAgB,0BAA0B,CACzC,MAAsB,EACtB,OAAmC,EACnC,oBAA0C;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sCAAgB,CAAC,UAAU,EAAE,CAAC;QAC/C,OAAO,sCAAgB,CAAC,aAAa,CAAC;IACvC,CAAC;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC;IAC9D,IAAA,iBAAM,EAAC,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC9D,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,SAAS,iBAAiB,CACzB,aAKC,EACD,QAAiC,EACjC,OAA8B;IAE9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,OAAO,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob, fail } from \"@fluidframework/core-utils/internal\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport {\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\ttype SchemaValidationFunction,\n\textractJsonValidator,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangesetLocalId,\n\tEncodedRevisionTag,\n\tFieldKey,\n\tFieldKindIdentifier,\n\tITreeCursorSynchronous,\n\tRevisionInfo,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport {\n\ttype IdAllocator,\n\ttype JsonCompatibleReadOnly,\n\ttype Mutable,\n\tbrand,\n\tidAllocatorFromMaxId,\n} from \"../../util/index.js\";\nimport { newChangeAtomIdBTree, type ChangeAtomIdBTree } from \"../changeAtomIdBTree.js\";\nimport {\n\ttype FieldBatchCodec,\n\ttype TreeChunk,\n\tchunkFieldSingle,\n\tdefaultChunkPolicy,\n} from \"../chunked-forest/index.js\";\nimport { TreeCompressionStrategy } from \"../treeCompressionUtils.js\";\n\nimport type { FieldChangeEncodingContext, FieldChangeHandler } from \"./fieldChangeHandler.js\";\nimport type {\n\tFieldKindConfiguration,\n\tFieldKindConfigurationEntry,\n} from \"./fieldKindConfiguration.js\";\nimport { genericFieldKind } from \"./genericFieldKind.js\";\nimport {\n\ttype EncodedBuilds,\n\ttype EncodedBuildsArray,\n\ttype EncodedFieldChange,\n\ttype EncodedFieldChangeMap,\n\tEncodedModularChangesetV1,\n\ttype EncodedNodeChangeset,\n\ttype EncodedRevisionInfo,\n} from \"./modularChangeFormatV1.js\";\nimport {\n\ttype FieldChangeset,\n\tnewCrossFieldKeyTable,\n\ttype FieldChangeMap,\n\ttype FieldId,\n\ttype ModularChangeset,\n\ttype NodeChangeset,\n\ttype NodeId,\n} from \"./modularChangeTypes.js\";\n\ntype ModularChangeCodec = IJsonCodec<\n\tModularChangeset,\n\tEncodedModularChangesetV1,\n\tEncodedModularChangesetV1,\n\tChangeEncodingContext\n>;\n\ntype FieldCodec = IJsonCodec<\n\tFieldChangeset,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tFieldChangeEncodingContext\n>;\n\ntype FieldChangesetCodecs = Map<\n\tFieldKindIdentifier,\n\t{\n\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\tcodec: FieldCodec;\n\t}\n>;\n\nexport function getFieldChangesetCodec(\n\tfieldKind: FieldKindIdentifier,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): {\n\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\tcodec: FieldCodec;\n} {\n\tconst entry = fieldChangesetCodecs.get(fieldKind);\n\tassert(entry !== undefined, 0x5ea /* Tried to encode unsupported fieldKind */);\n\treturn entry;\n}\n\nexport function encodeFieldChangesForJson(\n\tchange: FieldChangeMap,\n\tcontext: ChangeEncodingContext,\n\tnodeChanges: ChangeAtomIdBTree<NodeChangeset>,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedFieldChangeMap {\n\tconst fieldContext: FieldChangeEncodingContext = {\n\t\tbaseContext: context,\n\n\t\tencodeNode: (nodeId: NodeId): EncodedNodeChangeset => {\n\t\t\tconst node = nodeChanges.get([nodeId.revision, nodeId.localId]);\n\t\t\tassert(node !== undefined, 0x92e /* Unknown node ID */);\n\t\t\treturn encodeNodeChangesForJson(node, fieldContext, fieldChangesetCodecs);\n\t\t},\n\n\t\tdecodeNode: () => fail(0xb1e /* Should not decode nodes during field encoding */),\n\t};\n\n\treturn encodeFieldChangesForJsonI(change, fieldContext, fieldChangesetCodecs);\n}\n\nexport function encodeFieldChangesForJsonI(\n\tchange: FieldChangeMap,\n\tcontext: FieldChangeEncodingContext,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedFieldChangeMap {\n\tconst encodedFields: EncodedFieldChangeMap = [];\n\n\tfor (const [field, fieldChange] of change) {\n\t\tconst { codec, compiledSchema } = getFieldChangesetCodec(\n\t\t\tfieldChange.fieldKind,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t\tconst encodedChange = codec.encode(fieldChange.change, context);\n\t\tif (compiledSchema !== undefined && !compiledSchema.check(encodedChange)) {\n\t\t\tfail(0xb1f /* Encoded change didn't pass schema validation. */);\n\t\t}\n\n\t\tconst fieldKey: FieldKey = field;\n\t\tconst encodedField: EncodedFieldChange = {\n\t\t\tfieldKey,\n\t\t\tfieldKind: fieldChange.fieldKind,\n\t\t\tchange: encodedChange,\n\t\t};\n\n\t\tencodedFields.push(encodedField);\n\t}\n\n\treturn encodedFields;\n}\n\nexport function encodeNodeChangesForJson(\n\tchange: NodeChangeset,\n\tcontext: FieldChangeEncodingContext,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): EncodedNodeChangeset {\n\tconst encodedChange: EncodedNodeChangeset = {};\n\t// Note: revert constraints are ignored for now because they would only be needed if we supported reverting changes made by peers.\n\tconst { fieldChanges, nodeExistsConstraint } = change;\n\n\tif (fieldChanges !== undefined) {\n\t\tencodedChange.fieldChanges = encodeFieldChangesForJsonI(\n\t\t\tfieldChanges,\n\t\t\tcontext,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t}\n\n\tif (nodeExistsConstraint !== undefined) {\n\t\tencodedChange.nodeExistsConstraint = nodeExistsConstraint;\n\t}\n\n\treturn encodedChange;\n}\n\nexport function decodeFieldChangesFromJson(\n\tencodedChange: EncodedFieldChangeMap,\n\tparentId: NodeId | undefined,\n\tdecoded: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tidAllocator: IdAllocator,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): FieldChangeMap {\n\tconst decodedFields: FieldChangeMap = new Map();\n\tfor (const field of encodedChange) {\n\t\tconst { codec, compiledSchema } = getFieldChangesetCodec(\n\t\t\tfield.fieldKind,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t\tif (compiledSchema !== undefined && !compiledSchema.check(field.change)) {\n\t\t\tfail(0xb20 /* Encoded change didn't pass schema validation. */);\n\t\t}\n\n\t\tconst fieldId: FieldId = {\n\t\t\tnodeId: parentId,\n\t\t\tfield: field.fieldKey,\n\t\t};\n\n\t\tconst fieldContext: FieldChangeEncodingContext = {\n\t\t\tbaseContext: context,\n\n\t\t\tencodeNode: () => fail(0xb21 /* Should not encode nodes during field decoding */),\n\n\t\t\tdecodeNode: (encodedNode: EncodedNodeChangeset): NodeId => {\n\t\t\t\tconst nodeId: NodeId = {\n\t\t\t\t\trevision: context.revision,\n\t\t\t\t\tlocalId: brand(idAllocator.allocate()),\n\t\t\t\t};\n\n\t\t\t\tconst node = decodeNodeChangesetFromJson(\n\t\t\t\t\tencodedNode,\n\t\t\t\t\tnodeId,\n\t\t\t\t\tdecoded,\n\t\t\t\t\tcontext,\n\t\t\t\t\tidAllocator,\n\t\t\t\t\tfieldKinds,\n\t\t\t\t\tfieldChangesetCodecs,\n\t\t\t\t);\n\n\t\t\t\tdecoded.nodeChanges.set([nodeId.revision, nodeId.localId], node);\n\t\t\t\tdecoded.nodeToParent.set([nodeId.revision, nodeId.localId], fieldId);\n\t\t\t\treturn nodeId;\n\t\t\t},\n\t\t};\n\n\t\tconst fieldChangeset = codec.decode(field.change, fieldContext);\n\n\t\tconst crossFieldKeys = getChangeHandler(fieldKinds, field.fieldKind).getCrossFieldKeys(\n\t\t\tfieldChangeset,\n\t\t);\n\n\t\tfor (const { key, count } of crossFieldKeys) {\n\t\t\tdecoded.crossFieldKeys.set(key, count, fieldId);\n\t\t}\n\n\t\tconst fieldKey: FieldKey = brand<FieldKey>(field.fieldKey);\n\n\t\tdecodedFields.set(fieldKey, {\n\t\t\tfieldKind: field.fieldKind,\n\t\t\tchange: brand(fieldChangeset),\n\t\t});\n\t}\n\n\treturn decodedFields;\n}\n\nexport function decodeNodeChangesetFromJson(\n\tencodedChange: EncodedNodeChangeset,\n\tid: NodeId,\n\tdecoded: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tidAllocator: IdAllocator,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: FieldChangesetCodecs,\n): NodeChangeset {\n\tconst decodedChange: NodeChangeset = {};\n\tconst { fieldChanges, nodeExistsConstraint } = encodedChange;\n\n\tif (fieldChanges !== undefined) {\n\t\tdecodedChange.fieldChanges = decodeFieldChangesFromJson(\n\t\t\tfieldChanges,\n\t\t\tid,\n\t\t\tdecoded,\n\t\t\tcontext,\n\t\t\tidAllocator,\n\t\t\tfieldKinds,\n\t\t\tfieldChangesetCodecs,\n\t\t);\n\t}\n\n\tif (nodeExistsConstraint !== undefined) {\n\t\tdecodedChange.nodeExistsConstraint = nodeExistsConstraint;\n\t}\n\n\treturn decodedChange;\n}\n\nexport function encodeDetachedNodes(\n\tdetachedNodes: ChangeAtomIdBTree<TreeChunk> | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): EncodedBuilds | undefined {\n\tif (detachedNodes === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst treesToEncode: ITreeCursorSynchronous[] = [];\n\tconst buildsArray: EncodedBuildsArray = [];\n\n\tlet buildsForRevision:\n\t\t| [[ChangesetLocalId, number][], EncodedRevisionTag]\n\t\t| [[ChangesetLocalId, number][]]\n\t\t| undefined;\n\n\tfor (const [[revision, id], chunk] of detachedNodes.entries()) {\n\t\tconst encodedRevision = encodeRevisionOpt(revisionTagCodec, revision, context);\n\n\t\tif (buildsForRevision === undefined || buildsForRevision[1] !== encodedRevision) {\n\t\t\tif (buildsForRevision !== undefined) {\n\t\t\t\tbuildsArray.push(buildsForRevision);\n\t\t\t}\n\n\t\t\tbuildsForRevision = encodedRevision === undefined ? [[]] : [[], encodedRevision];\n\t\t}\n\n\t\ttreesToEncode.push(chunk.cursor());\n\t\tconst treeIndexInBatch = treesToEncode.length - 1;\n\t\tbuildsForRevision?.[0].push([id, treeIndexInBatch]);\n\t}\n\n\tif (buildsForRevision !== undefined) {\n\t\tbuildsArray.push(buildsForRevision);\n\t}\n\n\treturn buildsArray.length === 0\n\t\t? undefined\n\t\t: {\n\t\t\t\tbuilds: buildsArray,\n\t\t\t\ttrees: fieldsCodec.encode(treesToEncode, {\n\t\t\t\t\tencodeType: chunkCompressionStrategy,\n\t\t\t\t\tschema: context.schema,\n\t\t\t\t\toriginatorId: context.originatorId,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t}),\n\t\t\t};\n}\n\nexport function decodeDetachedNodes(\n\tencoded: EncodedBuilds | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): ChangeAtomIdBTree<TreeChunk> | undefined {\n\tif (encoded === undefined || encoded.builds.length === 0) {\n\t\treturn undefined;\n\t}\n\n\tconst chunks = fieldsCodec.decode(encoded.trees, {\n\t\tencodeType: chunkCompressionStrategy,\n\t\toriginatorId: context.originatorId,\n\t\tidCompressor: context.idCompressor,\n\t});\n\tconst getChunk = (index: number): TreeChunk => {\n\t\tassert(index < chunks.length, 0x898 /* out of bounds index for build chunk */);\n\t\treturn chunkFieldSingle(chunks[index] ?? oob(), {\n\t\t\tpolicy: defaultChunkPolicy,\n\t\t\tidCompressor: context.idCompressor,\n\t\t});\n\t};\n\n\tconst map: ModularChangeset[\"builds\"] = newChangeAtomIdBTree();\n\t// eslint-disable-next-line unicorn/no-array-for-each -- Codec internals: minimizing changes to serialization logic\n\tencoded.builds.forEach((build) => {\n\t\t// EncodedRevisionTag cannot be an array so this ensures that we can isolate the tuple\n\t\tconst revision =\n\t\t\tbuild[1] === undefined ? context.revision : revisionTagCodec.decode(build[1], context);\n\n\t\tconst decodedChunks: [ChangesetLocalId, TreeChunk][] = build[0].map(([i, n]) => [\n\t\t\ti,\n\t\t\tgetChunk(n),\n\t\t]);\n\n\t\tfor (const [id, chunk] of decodedChunks) {\n\t\t\tmap.set([revision, id], chunk);\n\t\t}\n\t});\n\n\treturn map;\n}\n\nexport function encodeRevisionInfos(\n\trevisions: readonly RevisionInfo[],\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): EncodedRevisionInfo[] | undefined {\n\tif (context.revision !== undefined) {\n\t\tassert(\n\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- Using optional chaining here would change behavior: `revisions[0]?.rollbackOf === undefined` is true when revisions[0] is undefined, but this check requires revisions[0] to be defined. As currently written, such a change would be safe because context.revision is included in the check and from a couple lines above is confirmed not undefined. But this more verbose form is clearer.\n\t\t\trevisions.length === 1 &&\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n\t\t\t\trevisions[0] !== undefined &&\n\t\t\t\trevisions[0].revision === context.revision &&\n\t\t\t\trevisions[0].rollbackOf === undefined,\n\t\t\t0x964 /* A tagged change should only contain the tagged revision */,\n\t\t);\n\n\t\treturn undefined;\n\t}\n\n\tconst encodedRevisions = [];\n\tfor (const revision of revisions) {\n\t\tconst encodedRevision: Mutable<EncodedRevisionInfo> = {\n\t\t\trevision: revisionTagCodec.encode(revision.revision, context),\n\t\t};\n\n\t\tif (revision.rollbackOf !== undefined) {\n\t\t\tencodedRevision.rollbackOf = revisionTagCodec.encode(revision.rollbackOf, context);\n\t\t}\n\n\t\tencodedRevisions.push(encodedRevision);\n\t}\n\n\treturn encodedRevisions;\n}\n\nexport function decodeRevisionInfos(\n\trevisions: readonly EncodedRevisionInfo[] | undefined,\n\tcontext: ChangeEncodingContext,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): RevisionInfo[] | undefined {\n\tif (revisions === undefined) {\n\t\treturn context.revision === undefined ? undefined : [{ revision: context.revision }];\n\t}\n\n\tconst decodedRevisions = [];\n\tfor (const revision of revisions) {\n\t\tconst decodedRevision: Mutable<RevisionInfo> = {\n\t\t\trevision: revisionTagCodec.decode(revision.revision, context),\n\t\t};\n\n\t\tif (revision.rollbackOf !== undefined) {\n\t\t\tdecodedRevision.rollbackOf = revisionTagCodec.decode(revision.rollbackOf, context);\n\t\t}\n\n\t\tdecodedRevisions.push(decodedRevision);\n\t}\n\n\treturn decodedRevisions;\n}\n\nexport function encodeChange(\n\tchange: ModularChangeset,\n\tcontext: ChangeEncodingContext,\n\tfieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): EncodedModularChangesetV1 {\n\t// Destroys only exist in rollback changesets, which are never sent.\n\tassert(change.destroys === undefined, 0x899 /* Unexpected changeset with destroys */);\n\treturn {\n\t\tmaxId: change.maxId,\n\t\trevisions:\n\t\t\tchange.revisions === undefined\n\t\t\t\t? undefined\n\t\t\t\t: encodeRevisionInfos(change.revisions, context, revisionTagCodec),\n\t\tchanges: encodeFieldChangesForJson(\n\t\t\tchange.fieldChanges,\n\t\t\tcontext,\n\t\t\tchange.nodeChanges,\n\t\t\tfieldChangesetCodecs,\n\t\t),\n\t\tbuilds: encodeDetachedNodes(\n\t\t\tchange.builds,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t),\n\t\trefreshers: encodeDetachedNodes(\n\t\t\tchange.refreshers,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t),\n\t\tviolations: change.constraintViolationCount,\n\t};\n}\n\nexport function decodeChange(\n\tencodedChange: EncodedModularChangesetV1,\n\tcontext: ChangeEncodingContext,\n\tfieldKinds: FieldKindConfiguration,\n\tfieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tchunkCompressionStrategy: TreeCompressionStrategy,\n): Mutable<ModularChangeset> {\n\tconst decoded: Mutable<ModularChangeset> = {\n\t\tfieldChanges: new Map(),\n\t\tnodeChanges: newChangeAtomIdBTree(),\n\t\tnodeToParent: newChangeAtomIdBTree(),\n\t\tnodeAliases: newChangeAtomIdBTree(),\n\t\tcrossFieldKeys: newCrossFieldKeyTable(),\n\t};\n\n\tdecoded.fieldChanges = decodeFieldChangesFromJson(\n\t\tencodedChange.changes,\n\t\tundefined,\n\t\tdecoded,\n\t\tcontext,\n\t\tidAllocatorFromMaxId(encodedChange.maxId),\n\t\tfieldKinds,\n\t\tfieldChangesetCodecs,\n\t);\n\n\tif (encodedChange.builds !== undefined) {\n\t\tdecoded.builds = decodeDetachedNodes(\n\t\t\tencodedChange.builds,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t}\n\tif (encodedChange.refreshers !== undefined) {\n\t\tdecoded.refreshers = decodeDetachedNodes(\n\t\t\tencodedChange.refreshers,\n\t\t\tcontext,\n\t\t\trevisionTagCodec,\n\t\t\tfieldsCodec,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t}\n\n\tif (encodedChange.violations !== undefined) {\n\t\tdecoded.constraintViolationCount = encodedChange.violations;\n\t}\n\n\tconst decodedRevInfos = decodeRevisionInfos(\n\t\tencodedChange.revisions,\n\t\tcontext,\n\t\trevisionTagCodec,\n\t);\n\tif (decodedRevInfos !== undefined) {\n\t\tdecoded.revisions = decodedRevInfos;\n\t}\n\tif (encodedChange.maxId !== undefined) {\n\t\tdecoded.maxId = encodedChange.maxId;\n\t}\n\treturn decoded;\n}\n\nexport function getFieldChangesetCodecs(\n\tfieldKinds: FieldKindConfiguration,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tcodecOptions: ICodecOptions,\n): Map<\n\tFieldKindIdentifier,\n\t{ compiledSchema?: SchemaValidationFunction<TAnySchema>; codec: FieldCodec }\n> {\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tconst getMapEntry = ({ kind, formatVersion }: FieldKindConfigurationEntry) => {\n\t\tconst codec = kind.changeHandler.codecsFactory(revisionTagCodec).resolve(formatVersion);\n\t\treturn {\n\t\t\tcodec,\n\t\t\tcompiledSchema: codec.encodedSchema\n\t\t\t\t? extractJsonValidator(codecOptions.jsonValidator).compile(codec.encodedSchema)\n\t\t\t\t: undefined,\n\t\t};\n\t};\n\n\t/**\n\t * The codec version for the generic field kind.\n\t */\n\tconst genericFieldKindFormatVersion = 1;\n\tconst fieldChangesetCodecs: Map<\n\t\tFieldKindIdentifier,\n\t\t{\n\t\t\tcompiledSchema?: SchemaValidationFunction<TAnySchema>;\n\t\t\tcodec: FieldCodec;\n\t\t}\n\t> = new Map([\n\t\t[\n\t\t\tgenericFieldKind.identifier,\n\t\t\tgetMapEntry({ kind: genericFieldKind, formatVersion: genericFieldKindFormatVersion }),\n\t\t],\n\t]);\n\n\t// eslint-disable-next-line unicorn/no-array-for-each -- Map.forEach with (value, key) signature; codec initialization\n\tfieldKinds.forEach((entry, identifier) => {\n\t\tfieldChangesetCodecs.set(identifier, getMapEntry(entry));\n\t});\n\n\treturn fieldChangesetCodecs;\n}\n\nexport function makeModularChangeCodecV1(\n\tfieldKinds: FieldKindConfiguration,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tfieldsCodec: FieldBatchCodec,\n\tcodecOptions: ICodecOptions,\n\tchunkCompressionStrategy: TreeCompressionStrategy = TreeCompressionStrategy.Compressed,\n): ModularChangeCodec {\n\tconst fieldChangesetCodecs = getFieldChangesetCodecs(\n\t\tfieldKinds,\n\t\trevisionTagCodec,\n\t\tcodecOptions,\n\t);\n\n\tconst modularChangeCodec: ModularChangeCodec = {\n\t\tencode: (change, context) =>\n\t\t\tencodeChange(\n\t\t\t\tchange,\n\t\t\t\tcontext,\n\t\t\t\tfieldChangesetCodecs,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tfieldsCodec,\n\t\t\t\tchunkCompressionStrategy,\n\t\t\t),\n\t\tdecode: (encodedChange, context) =>\n\t\t\tdecodeChange(\n\t\t\t\tencodedChange,\n\t\t\t\tcontext,\n\t\t\t\tfieldKinds,\n\t\t\t\tfieldChangesetCodecs,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tfieldsCodec,\n\t\t\t\tchunkCompressionStrategy,\n\t\t\t),\n\t};\n\n\treturn withSchemaValidation(\n\t\tEncodedModularChangesetV1,\n\t\tmodularChangeCodec,\n\t\tcodecOptions.jsonValidator,\n\t);\n}\n\nfunction getChangeHandler(\n\tfieldKinds: FieldKindConfiguration,\n\tfieldKind: FieldKindIdentifier,\n): FieldChangeHandler<unknown> {\n\tif (fieldKind === genericFieldKind.identifier) {\n\t\treturn genericFieldKind.changeHandler;\n\t}\n\n\tconst handler = fieldKinds.get(fieldKind)?.kind.changeHandler;\n\tassert(handler !== undefined, 0x9c1 /* Unknown field kind */);\n\treturn handler;\n}\n\nfunction encodeRevisionOpt(\n\trevisionCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\trevision: RevisionTag | undefined,\n\tcontext: ChangeEncodingContext,\n): EncodedRevisionTag | undefined {\n\tif (revision === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn revision === context.revision ? undefined : revisionCodec.encode(revision, context);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,oCAAoC,EACpC,KAAK,iBAAiB,EAEtB,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,mBAAmB,EAGnB,KAAK,gBAAgB,EAKrB,MAAM,qBAAqB,CAAC;AAM7B;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,oBAAoB,CAAC,EAAE,mBAAmB,GACxC,UAAU,CAAC,gBAAgB,CAAC,CAM9B;AA0ED;;GAEG;AACH,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,oCAAoC,EACpC,KAAK,iBAAiB,EAEtB,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,mBAAmB,EAGnB,KAAK,gBAAgB,EAKrB,MAAM,qBAAqB,CAAC;AAM7B;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,oBAAoB,CAAC,EAAE,mBAAmB,GACxC,UAAU,CAAC,gBAAgB,CAAC,CAM9B;AA0ED;;GAEG;AACH,eAAO,MAAM,kBAAkB,0NAmB7B,CAAC"}
|
|
@@ -96,8 +96,9 @@ function decodeV2(f) {
|
|
|
96
96
|
/**
|
|
97
97
|
* Creates a codec which performs synchronous monolithic encoding of schema content.
|
|
98
98
|
*/
|
|
99
|
-
exports.schemaCodecBuilder = index_js_1.ClientVersionDispatchingCodecBuilder.build("Schema",
|
|
100
|
-
|
|
99
|
+
exports.schemaCodecBuilder = index_js_1.ClientVersionDispatchingCodecBuilder.build("Schema", [
|
|
100
|
+
{
|
|
101
|
+
minVersionForCollab: internal_2.lowestMinVersionForCollab,
|
|
101
102
|
formatVersion: index_js_2.SchemaFormatVersion.v1,
|
|
102
103
|
codec: {
|
|
103
104
|
encode: (data) => encodeRepoV1(data),
|
|
@@ -105,7 +106,8 @@ exports.schemaCodecBuilder = index_js_1.ClientVersionDispatchingCodecBuilder.bui
|
|
|
105
106
|
schema: formatV1_js_1.Format,
|
|
106
107
|
},
|
|
107
108
|
},
|
|
108
|
-
|
|
109
|
+
{
|
|
110
|
+
minVersionForCollab: index_js_1.FluidClientVersion.v2_43,
|
|
109
111
|
formatVersion: index_js_2.SchemaFormatVersion.v2,
|
|
110
112
|
codec: {
|
|
111
113
|
encode: (data) => encodeRepoV2(data),
|
|
@@ -113,5 +115,5 @@ exports.schemaCodecBuilder = index_js_1.ClientVersionDispatchingCodecBuilder.bui
|
|
|
113
115
|
schema: formatV2_js_1.Format,
|
|
114
116
|
},
|
|
115
117
|
},
|
|
116
|
-
|
|
118
|
+
]);
|
|
117
119
|
//# sourceMappingURL=codec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAC3D,qEAAmF;AAEnF,mDAK8B;AAC9B,kDAS6B;AAC7B,kDAA4C;AAE5C,+CAAmD;AACnD,+CAAmD;AAEnD;;;;;;;;;;;GAWG;AACH,SAAgB,eAAe,CAC9B,OAA0B,EAC1B,oBAA0C;IAE1C,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;IAC/D,IAAI,oBAAoB,KAAK,SAAS,EAAE,CAAC;QACxC,SAAS,CAAC,GAAG,CAAC,0BAAkB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,0BAAkB,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,CAAC,CAAC;AACnF,CAAC;AATD,0CASC;AAED,SAAS,YAAY,CAAC,IAAsB;IAC3C,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,EAAE,C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,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACrD,MAAM,mBAAmB,GAAG,uCAA4B,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE/E,4BAA4B;QAC5B,UAAU,CAAC,GAAG,CAAC,IAAA,gBAAK,EAAC,GAAG,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,OAAO;QACN,eAAe,EAAE,IAAA,4BAAiB,EAAC,CAAC,CAAC,IAAI,CAAC;QAC1C,UAAU;KACV,CAAC;AACH,CAAC;AAED;;GAEG;AACU,QAAA,kBAAkB,GAAG,+CAAoC,CAAC,KAAK,CAAC,QAAQ,EAAE;IACtF;QACC,mBAAmB,EAAE,oCAAyB;QAC9C,aAAa,EAAE,8BAAmB,CAAC,EAAE;QACrC,KAAK,EAAE;YACN,MAAM,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;YACtD,MAAM,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC1C,MAAM,EAAE,oBAAQ;SAChB;KACD;IACD;QACC,mBAAmB,EAAE,6BAAkB,CAAC,KAAK;QAC7C,aAAa,EAAE,8BAAmB,CAAC,EAAE;QACrC,KAAK,EAAE;YACN,MAAM,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;YACtD,MAAM,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC1C,MAAM,EAAE,oBAAQ;SAChB;KACD;CACD,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport { lowestMinVersionForCollab } from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tClientVersionDispatchingCodecBuilder,\n\ttype CodecWriteOptions,\n\tFluidClientVersion,\n\ttype IJsonCodec,\n} from \"../../codec/index.js\";\nimport {\n\tSchemaFormatVersion,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchemaV1,\n\tencodeFieldSchemaV2,\n\tstoredSchemaDecodeDispatcher,\n} from \"../../core/index.js\";\nimport { brand } from \"../../util/index.js\";\n\nimport { Format as FormatV1 } from \"./formatV1.js\";\nimport { Format as FormatV2 } from \"./formatV2.js\";\n\n/**\n * Create a schema codec.\n * @param options - Specifies common codec options, including `minVersionForCollab` and which `validator` to use.\n * @param writeVersionOverride - The schema version to write. If not provided, the version will be derived from `minVersionForCollab`.\n * TODO: Currently this parameter is provided when it probably should not be. Users of it should probably allow the automatic selection to occur and this parameter can be removed.\n * Any case where an override is actually required can use `options` to do so.\n * @returns The composed codec.\n *\n * @privateRemarks We should consider using the Shared Tree format version instead as it may be more valuable for application authors than the schema version.\n *\n * TODO: replace use of this with schemaCodecBuilder.build(...).\n */\nexport function makeSchemaCodec(\n\toptions: CodecWriteOptions,\n\twriteVersionOverride?: SchemaFormatVersion,\n): IJsonCodec<TreeStoredSchema> {\n\tconst overrides = new Map(options.writeVersionOverrides ?? []);\n\tif (writeVersionOverride !== undefined) {\n\t\toverrides.set(schemaCodecBuilder.name, writeVersionOverride);\n\t}\n\treturn schemaCodecBuilder.build({ ...options, writeVersionOverrides: overrides });\n}\n\nfunction encodeRepoV1(repo: TreeStoredSchema): FormatV1 {\n\tconst nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV1());\n\tconst rootFieldSchema = encodeFieldSchemaV1(repo.rootFieldSchema);\n\treturn {\n\t\tversion: SchemaFormatVersion.v1,\n\t\tnodes: nodeSchema,\n\t\troot: rootFieldSchema,\n\t};\n}\n\nfunction encodeRepoV2(repo: TreeStoredSchema): FormatV2 {\n\tconst nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV2());\n\tconst rootFieldSchema = encodeFieldSchemaV2(repo.rootFieldSchema);\n\treturn {\n\t\tversion: SchemaFormatVersion.v2,\n\t\tnodes: nodeSchema,\n\t\troot: rootFieldSchema,\n\t};\n}\n\n/**\n * Shared logic for encoding node schemas.\n * @param repo - The stored schema to encode.\n * @param encodeValue - A function which encodes a single node schema.\n * @returns The encoded node schema.\n */\nfunction encodeNodeSchema<TFormat>(\n\trepo: TreeStoredSchema,\n\tencodeValue: (schema: TreeNodeStoredSchema) => TFormat,\n): Record<string, TFormat> {\n\tconst nodeSchema: Record<string, TFormat> = Object.create(null) as Record<string, TFormat>;\n\tfor (const name of [...repo.nodeSchema.keys()].sort()) {\n\t\tconst schema = repo.nodeSchema.get(name) ?? fail(0xb28 /* missing schema */);\n\t\tObject.defineProperty(nodeSchema, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: encodeValue(schema),\n\t\t});\n\t}\n\n\treturn nodeSchema;\n}\n\nfunction decodeV1(f: FormatV1): TreeStoredSchema {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\tfor (const [key, schema] of Object.entries(f.nodes)) {\n\t\tconst storedSchemaDecoder = storedSchemaDecodeDispatcher.dispatch(schema);\n\n\t\t// No metadata in v1, so pass undefined\n\t\tnodeSchema.set(brand(key), storedSchemaDecoder(undefined));\n\t}\n\treturn {\n\t\trootFieldSchema: decodeFieldSchema(f.root),\n\t\tnodeSchema,\n\t};\n}\n\nfunction decodeV2(f: FormatV2): TreeStoredSchema {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\tfor (const [key, schema] of Object.entries(f.nodes)) {\n\t\tconst storedSchemaDecoder = storedSchemaDecodeDispatcher.dispatch(schema.kind);\n\n\t\t// Pass in the node metadata\n\t\tnodeSchema.set(brand(key), storedSchemaDecoder(schema.metadata));\n\t}\n\treturn {\n\t\trootFieldSchema: decodeFieldSchema(f.root),\n\t\tnodeSchema,\n\t};\n}\n\n/**\n * Creates a codec which performs synchronous monolithic encoding of schema content.\n */\nexport const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build(\"Schema\", [\n\t{\n\t\tminVersionForCollab: lowestMinVersionForCollab,\n\t\tformatVersion: SchemaFormatVersion.v1,\n\t\tcodec: {\n\t\t\tencode: (data: TreeStoredSchema) => encodeRepoV1(data),\n\t\t\tdecode: (data: FormatV1) => decodeV1(data),\n\t\t\tschema: FormatV1,\n\t\t},\n\t},\n\t{\n\t\tminVersionForCollab: FluidClientVersion.v2_43,\n\t\tformatVersion: SchemaFormatVersion.v2,\n\t\tcodec: {\n\t\t\tencode: (data: TreeStoredSchema) => encodeRepoV2(data),\n\t\t\tdecode: (data: FormatV2) => decodeV2(data),\n\t\t\tschema: FormatV2,\n\t\t},\n\t},\n]);\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export type Listenable<T extends object> = EventListenable<T>;
|
|
|
30
30
|
export type Off = EventOff;
|
|
31
31
|
export { TreeStatus, TreeCompressionStrategy, type TreeIndex, type TreeIndexKey, type TreeIndexNodes, type IncrementalEncodingPolicy, } from "./feature-libraries/index.js";
|
|
32
32
|
export { type ITreeInternal, type SharedTreeOptions, type SharedTreeOptionsBeta, type ForestType, type SharedTreeFormatOptions, Tree, type RunTransaction, type ForestOptions, getBranch, type BranchableTree, type TreeBranchFork, independentInitializedView, type ViewContent, TreeAlpha, type ObservationResults, type TreeIdentifierUtils, independentView, type IndependentViewOptions, createIndependentTreeBeta, createIndependentTreeAlpha, type CreateIndependentTreeAlphaOptions, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, } from "./shared-tree/index.js";
|
|
33
|
-
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, SchemaFactoryBeta, type SchemaStaticsBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type FieldSchemaAlpha, type FieldSchemaMetadata, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, ObjectNodeSchema, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, type InternalTreeNode, type WithType, type NodeChangedData, type SchemaUpgrade, contentSchemaSymbol, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type System_Unsafe, type FieldSchemaAlphaUnsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type typeSchemaSymbol, type TreeNodeSchemaNonClass, type ValidateRecursiveSchema, type FixRecursiveArraySchema, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, adaptEnum, enumFromStrings, singletonSchema, type UnsafeUnknownSchema, type TreeViewAlpha, type TreeViewBeta, type InsertableField, type Insertable, type InsertableContent, type FactoryContent, type FactoryContentObject, type ReadableField, type ReadSchema, type AnnotatedAllowedType, type AnnotatedAllowedTypes, type AllowedTypesFullEvaluated, type AllowedTypeMetadata, type AllowedTypesMetadata, type UnannotateAllowedTypesList, type AnnotateAllowedTypesList, type AllowedTypesFull, type AllowedTypesFullFromMixed, type SchemaType, TreeBeta, type TreeChangeEventsBeta, type VerboseTreeNode, type TreeEncodingOptions, type TreeSchemaEncodingOptions, type TreeSchema, TreeViewConfigurationAlpha, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, getJsonSchema, type LazyItem, type Unenforced, type SimpleNodeSchemaBase, type SimpleNodeSchemaBaseAlpha, type SimpleTreeSchema, type SimpleNodeSchema, type SimpleFieldSchema, type SimpleLeafNodeSchema, type SimpleMapNodeSchema, type SimpleArrayNodeSchema, type SimpleObjectNodeSchema, type SimpleObjectFieldSchema, type SimpleRecordNodeSchema, normalizeAllowedTypes, walkFieldSchema, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, getSimpleSchema, type ReadonlyArrayNode, type InsertableTreeNodeFromAllowedTypes, type Input, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, asTreeViewAlpha, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type NodeSchemaMetadata, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type TransactionConstraintAlpha, type NodeInDocumentConstraint, type NoChangeConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type LeafSchema, type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, type ObjectFromSchemaRecord, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, RecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, type TreeRecordNode, KeyEncodingOptions, type TreeParsingOptions, type SchemaFactory_base, type NumberKeys, type SimpleAllowedTypeAttributes, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility,
|
|
33
|
+
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, SchemaFactoryBeta, type SchemaStaticsBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type FieldSchemaAlpha, type FieldSchemaMetadata, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, ObjectNodeSchema, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, type InternalTreeNode, type WithType, type NodeChangedData, type SchemaUpgrade, contentSchemaSymbol, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type System_Unsafe, type FieldSchemaAlphaUnsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type UnannotateAllowedTypeUnsafe, type AnnotatedAllowedTypeUnsafe, type AnnotatedAllowedTypesUnsafe, type AllowedTypesFullUnsafe, type AllowedTypesFullFromMixedUnsafe, type UnannotateAllowedTypesListUnsafe, type AnnotateAllowedTypesListUnsafe, type typeSchemaSymbol, type TreeNodeSchemaNonClass, type ValidateRecursiveSchema, type FixRecursiveArraySchema, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, adaptEnum, enumFromStrings, singletonSchema, type UnsafeUnknownSchema, type TreeViewAlpha, type TreeViewBeta, type InsertableField, type Insertable, type InsertableContent, type FactoryContent, type FactoryContentObject, type ReadableField, type ReadSchema, type AnnotatedAllowedType, type AnnotatedAllowedTypes, type AllowedTypesFullEvaluated, type AllowedTypeMetadata, type AllowedTypesMetadata, type UnannotateAllowedTypesList, type AnnotateAllowedTypesList, type AllowedTypesFull, type AllowedTypesFullFromMixed, type SchemaType, TreeBeta, type TreeChangeEventsBeta, type VerboseTreeNode, type TreeEncodingOptions, type TreeSchemaEncodingOptions, type TreeSchema, TreeViewConfigurationAlpha, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, getJsonSchema, type LazyItem, type Unenforced, type SimpleNodeSchemaBase, type SimpleNodeSchemaBaseAlpha, type SimpleTreeSchema, type SimpleNodeSchema, type SimpleFieldSchema, type SimpleLeafNodeSchema, type SimpleMapNodeSchema, type SimpleArrayNodeSchema, type SimpleObjectNodeSchema, type SimpleObjectFieldSchema, type SimpleRecordNodeSchema, normalizeAllowedTypes, walkFieldSchema, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, getSimpleSchema, type ReadonlyArrayNode, type InsertableTreeNodeFromAllowedTypes, type Input, type TreeBranch, type TreeBranchAlpha, type TreeBranchEvents, asTreeViewAlpha, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type NodeSchemaMetadata, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type TransactionConstraintAlpha, type NodeInDocumentConstraint, type NoChangeConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type LeafSchema, type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, type ObjectFromSchemaRecord, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, RecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, type TreeRecordNode, KeyEncodingOptions, type TreeParsingOptions, type SchemaFactory_base, type NumberKeys, type SimpleAllowedTypeAttributes, encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, snapshotSchemaCompatibility, type SnapshotFileSystem, incrementalSummaryHint, incrementalEncodingPolicyForAllowedTypes, eraseSchemaDetails, eraseSchemaDetailsSubclassable, type SnapshotSchemaCompatibilityOptions, type ArrayPlaceAnchor, createArrayInsertionAnchor, } from "./simple-tree/index.js";
|
|
34
34
|
export { SharedTree, configuredSharedTree, configuredSharedTreeAlpha, configuredSharedTreeBeta, configuredSharedTreeBetaLegacy, } from "./treeFactory.js";
|
|
35
35
|
export { SharedTreeAttributes, SharedTreeFactoryType } from "./sharedTreeAttributes.js";
|
|
36
36
|
export { persistedToSimpleSchema } from "./shared-tree/index.js";
|
|
@@ -50,5 +50,5 @@ export { FluidSerializableAsTree } from "./serializableDomainSchema.js";
|
|
|
50
50
|
export { TableSchema, type System_TableSchema } from "./tableSchema.js";
|
|
51
51
|
export { asAlpha, asBeta } from "./api.js";
|
|
52
52
|
export { TextAsTree, FormattedTextAsTree } from "./text/index.js";
|
|
53
|
-
export {
|
|
53
|
+
export { ExtensibleUnionNode } from "./extensibleUnionNode.js";
|
|
54
54
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,KAAK,UAAU,EACf,UAAU,EACV,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACX,SAAS,IAAI,cAAc,EAC3B,UAAU,IAAI,eAAe,EAC7B,UAAU,IAAI,eAAe,EAC7B,GAAG,IAAI,QAAQ,EACf,MAAM,iCAAiC,CAAC;AAEzC;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;AAC5D;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;AAC/C;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;AAC9D;;;;GAIG;AACH,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC;AAE3B,OAAO,EACN,UAAU,EACV,uBAAuB,EACvB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,yBAAyB,GAC9B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAA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4BAA4B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,CAAC;AAKzB,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.replaceHandles = exports.replaceConciseTreeHandles = exports.evaluateLazySchema = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.asTreeViewAlpha = exports.getSimpleSchema = exports.walkAllowedTypes = exports.walkNodeSchema = exports.walkFieldSchema = exports.normalizeAllowedTypes = exports.getJsonSchema = exports.comparePersistedSchema = exports.extractPersistedSchema = exports.TreeViewConfigurationAlpha = exports.TreeBeta = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.trackDirtyNodes = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.contentSchemaSymbol = exports.normalizeFieldSchema = exports.ObjectNodeSchema = exports.NodeKind = exports.FieldSchema = exports.FieldKind = exports.SchemaFactoryAlpha = exports.SchemaFactoryBeta = exports.SchemaFactory = exports.TreeViewConfiguration = exports.TreeNode = exports.IterableTreeArrayContent = exports.TreeArrayNode = exports.ForestTypeReference = exports.ForestTypeExpensiveDebug = exports.ForestTypeOptimized = exports.createIndependentTreeAlpha = exports.createIndependentTreeBeta = exports.independentView = exports.TreeAlpha = exports.independentInitializedView = exports.getBranch = exports.Tree = exports.TreeCompressionStrategy = exports.TreeStatus = exports.RevertibleStatus = exports.CommitKind = exports.ValueSchema = void 0;
|
|
31
|
-
exports.
|
|
31
|
+
exports.ExtensibleUnionNode = exports.FormattedTextAsTree = exports.TextAsTree = exports.asBeta = exports.asAlpha = exports.TableSchema = exports.FluidSerializableAsTree = exports.JsonAsTree = exports.InternalTypes = exports.cloneWithReplacements = exports.FormatValidatorBasic = exports.FormatValidatorNoOp = exports.FluidClientVersion = exports.persistedToSimpleSchema = exports.SharedTreeFactoryType = exports.SharedTreeAttributes = exports.configuredSharedTreeBetaLegacy = exports.configuredSharedTreeBeta = exports.configuredSharedTreeAlpha = exports.configuredSharedTree = exports.SharedTree = exports.createArrayInsertionAnchor = exports.eraseSchemaDetailsSubclassable = exports.eraseSchemaDetails = exports.incrementalEncodingPolicyForAllowedTypes = exports.incrementalSummaryHint = exports.snapshotSchemaCompatibility = exports.checkCompatibility = exports.importCompatibilitySchemaSnapshot = exports.exportCompatibilitySchemaSnapshot = exports.decodeSchemaCompatibilitySnapshot = exports.encodeSchemaCompatibilitySnapshot = exports.KeyEncodingOptions = exports.RecordNodeSchema = exports.MapNodeSchema = exports.ArrayNodeSchema = exports.allowUnused = exports.replaceVerboseTreeHandles = void 0;
|
|
32
32
|
var index_js_1 = require("./core/index.js");
|
|
33
33
|
Object.defineProperty(exports, "ValueSchema", { enumerable: true, get: function () { return index_js_1.ValueSchema; } });
|
|
34
34
|
Object.defineProperty(exports, "CommitKind", { enumerable: true, get: function () { return index_js_1.CommitKind; } });
|
|
@@ -96,7 +96,7 @@ Object.defineProperty(exports, "decodeSchemaCompatibilitySnapshot", { enumerable
|
|
|
96
96
|
Object.defineProperty(exports, "exportCompatibilitySchemaSnapshot", { enumerable: true, get: function () { return index_js_4.exportCompatibilitySchemaSnapshot; } });
|
|
97
97
|
Object.defineProperty(exports, "importCompatibilitySchemaSnapshot", { enumerable: true, get: function () { return index_js_4.importCompatibilitySchemaSnapshot; } });
|
|
98
98
|
Object.defineProperty(exports, "checkCompatibility", { enumerable: true, get: function () { return index_js_4.checkCompatibility; } });
|
|
99
|
-
Object.defineProperty(exports, "
|
|
99
|
+
Object.defineProperty(exports, "snapshotSchemaCompatibility", { enumerable: true, get: function () { return index_js_4.snapshotSchemaCompatibility; } });
|
|
100
100
|
Object.defineProperty(exports, "incrementalSummaryHint", { enumerable: true, get: function () { return index_js_4.incrementalSummaryHint; } });
|
|
101
101
|
Object.defineProperty(exports, "incrementalEncodingPolicyForAllowedTypes", { enumerable: true, get: function () { return index_js_4.incrementalEncodingPolicyForAllowedTypes; } });
|
|
102
102
|
Object.defineProperty(exports, "eraseSchemaDetails", { enumerable: true, get: function () { return index_js_4.eraseSchemaDetails; } });
|
|
@@ -134,6 +134,6 @@ Object.defineProperty(exports, "asBeta", { enumerable: true, get: function () {
|
|
|
134
134
|
var index_js_9 = require("./text/index.js");
|
|
135
135
|
Object.defineProperty(exports, "TextAsTree", { enumerable: true, get: function () { return index_js_9.TextAsTree; } });
|
|
136
136
|
Object.defineProperty(exports, "FormattedTextAsTree", { enumerable: true, get: function () { return index_js_9.FormattedTextAsTree; } });
|
|
137
|
-
var
|
|
138
|
-
Object.defineProperty(exports, "
|
|
137
|
+
var extensibleUnionNode_js_1 = require("./extensibleUnionNode.js");
|
|
138
|
+
Object.defineProperty(exports, "ExtensibleUnionNode", { enumerable: true, get: function () { return extensibleUnionNode_js_1.ExtensibleUnionNode; } });
|
|
139
139
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;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AAA;AAChC,mDAAwE;AAA/D,6GAAA,WAAW,OAAA;AACpB,mCAA2C;AAAlC,iGAAA,OAAO,OAAA;AAAE,gGAAA,MAAM,OAAA;AAExB,4CAAkE;AAAzD,sGAAA,UAAU,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AACxC,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tValueSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\n\nimport type {\n\tListeners as EventListeners,\n\tIsListener as EventIsListener,\n\tListenable as EventListenable,\n\tOff as EventOff,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listeners}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listeners<T extends object> = EventListeners<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#IsListener}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type IsListener<T> = EventIsListener<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listenable}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listenable<T extends object> = EventListenable<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Off}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Off = EventOff;\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n\ttype IncrementalEncodingPolicy,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ITreeInternal,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsBeta,\n\ttype ForestType,\n\ttype SharedTreeFormatOptions,\n\tTree,\n\ttype RunTransaction,\n\ttype ForestOptions,\n\tgetBranch,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\ttype ObservationResults,\n\ttype TreeIdentifierUtils,\n\tindependentView,\n\ttype IndependentViewOptions,\n\tcreateIndependentTreeBeta,\n\tcreateIndependentTreeAlpha,\n\ttype CreateIndependentTreeAlphaOptions,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\tSchemaFactoryBeta,\n\ttype SchemaStaticsBeta,\n\tSchemaFactoryAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\tObjectNodeSchema,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype NodeChangedData,\n\ttype SchemaUpgrade,\n\tcontentSchemaSymbol,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype System_Unsafe,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype UnannotateAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypesUnsafe,\n\ttype AllowedTypesFullUnsafe,\n\ttype AllowedTypesFullFromMixedUnsafe,\n\ttype UnannotateAllowedTypesListUnsafe,\n\ttype AnnotateAllowedTypesListUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype TreeViewBeta,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype AnnotatedAllowedType,\n\ttype AnnotatedAllowedTypes,\n\ttype AllowedTypesFullEvaluated,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\ttype UnannotateAllowedTypesList,\n\ttype AnnotateAllowedTypesList,\n\ttype AllowedTypesFull,\n\ttype AllowedTypesFullFromMixed,\n\ttype SchemaType,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\t// Other\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype TreeSchemaEncodingOptions,\n\ttype TreeSchema,\n\tTreeViewConfigurationAlpha,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleNodeSchemaBaseAlpha,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleRecordNodeSchema,\n\tnormalizeAllowedTypes,\n\twalkFieldSchema,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\tgetSimpleSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchAlpha,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype NodeSchemaMetadata,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\tevaluateLazySchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype LeafSchema,\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\ttype ObjectFromSchemaRecord,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\ttype TreeRecordNode,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n\ttype SchemaFactory_base,\n\ttype NumberKeys,\n\ttype SimpleAllowedTypeAttributes,\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n\tcheckSchemaCompatibilitySnapshots,\n\ttype SnapshotFileSystem,\n\tincrementalSummaryHint,\n\tincrementalEncodingPolicyForAllowedTypes,\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n\ttype SchemaCompatibilitySnapshotsOptions,\n\ttype ArrayPlaceAnchor,\n\tcreateArrayInsertionAnchor,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n\tconfiguredSharedTreeAlpha,\n\tconfiguredSharedTreeBeta,\n\tconfiguredSharedTreeBetaLegacy,\n} from \"./treeFactory.js\";\nexport { SharedTreeAttributes, SharedTreeFactoryType } from \"./sharedTreeAttributes.js\";\nexport { persistedToSimpleSchema } from \"./shared-tree/index.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\ttype CodecWriteOptionsBeta,\n\tFluidClientVersion,\n\ttype FormatValidator,\n\tFormatValidatorNoOp,\n\ttype CodecName,\n\ttype FormatVersion,\n} from \"./codec/index.js\";\nexport { FormatValidatorBasic } from \"./external-utilities/index.js\";\n\nexport type {\n\t// Type Testing\n\trequireTrue,\n\trequireFalse,\n\trequireAssignableTo,\n\tareSafelyAssignable,\n\tisAssignableTo,\n\tisAny,\n\teitherIsAny,\n\t// Other\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\tMakeNominal,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"./util/index.js\";\nexport { cloneWithReplacements } from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\n/**\n * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n * They are used internally to implement API aspects, but are not intended for use by external consumers.\n */\n// eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor)\nexport { InternalTypes };\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport { JsonAsTree } from \"./jsonDomainSchema.js\";\nexport { FluidSerializableAsTree } from \"./serializableDomainSchema.js\";\nexport { TableSchema, type System_TableSchema } from \"./tableSchema.js\";\nexport { asAlpha, asBeta } from \"./api.js\";\n\nexport { TextAsTree, FormattedTextAsTree } from \"./text/index.js\";\nexport { ExtensibleSchemaUnion } from \"./extensibleSchemaUnion.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAYyB;AAXxB,uGAAA,WAAW,OAAA;AAEX,sGAAA,UAAU,OAAA;AACV,4GAAA,gBAAgB,OAAA;AA0CjB,yDAOsC;AANrC,sGAAA,UAAU,OAAA;AACV,mHAAA,uBAAuB,OAAA;AAOxB,mDAyBgC;AAnB/B,gGAAA,IAAI,OAAA;AAGJ,qGAAA,SAAS,OAAA;AAGT,sHAAA,0BAA0B,OAAA;AAE1B,qGAAA,SAAS,OAAA;AAGT,2GAAA,eAAe,OAAA;AAEf,qHAAA,yBAAyB,OAAA;AACzB,sHAAA,0BAA0B,OAAA;AAE1B,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,+GAAA,mBAAmB,OAAA;AAGpB,mDA4NgC;AA3N/B,yGAAA,aAAa,OAAA;AAEb,oHAAA,wBAAwB,OAAA;AACxB,oGAAA,QAAQ,OAAA;AAIR,iHAAA,qBAAqB,OAAA;AAKrB,yGA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ACxC,8GAAA,kBAAkB,OAAA;AAClB,0HAAA,8BAA8B,OAAA;AAG9B,sHAAA,0BAA0B,OAAA;AAE3B,mDAM0B;AALzB,4GAAA,UAAU,OAAA;AACV,sHAAA,oBAAoB,OAAA;AACpB,2HAAA,yBAAyB,OAAA;AACzB,0HAAA,wBAAwB,OAAA;AACxB,gIAAA,8BAA8B,OAAA;AAE/B,qEAAwF;AAA/E,+HAAA,oBAAoB,OAAA;AAAE,gIAAA,qBAAqB,OAAA;AACpD,mDAAiE;AAAxD,mHAAA,uBAAuB,OAAA;AAEhC,6CAS0B;AALzB,8GAAA,kBAAkB,OAAA;AAElB,+GAAA,mBAAmB,OAAA;AAIpB,0DAAqE;AAA5D,gHAAA,oBAAoB,OAAA;AAwB7B,4CAAwD;AAA/C,iHAAA,qBAAqB,OAAA;AAE9B,kEAAoD;AAM3C,sCAAa;AAOtB,6DAAmD;AAA1C,iHAAA,UAAU,OAAA;AACnB,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,mDAAwE;AAA/D,6GAAA,WAAW,OAAA;AACpB,mCAA2C;AAAlC,iGAAA,OAAO,OAAA;AAAE,gGAAA,MAAM,OAAA;AAExB,4CAAkE;AAAzD,sGAAA,UAAU,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AACxC,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tValueSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\n\nimport type {\n\tListeners as EventListeners,\n\tIsListener as EventIsListener,\n\tListenable as EventListenable,\n\tOff as EventOff,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listeners}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listeners<T extends object> = EventListeners<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#IsListener}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type IsListener<T> = EventIsListener<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listenable}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listenable<T extends object> = EventListenable<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Off}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Off = EventOff;\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n\ttype IncrementalEncodingPolicy,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ITreeInternal,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsBeta,\n\ttype ForestType,\n\ttype SharedTreeFormatOptions,\n\tTree,\n\ttype RunTransaction,\n\ttype ForestOptions,\n\tgetBranch,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\ttype ObservationResults,\n\ttype TreeIdentifierUtils,\n\tindependentView,\n\ttype IndependentViewOptions,\n\tcreateIndependentTreeBeta,\n\tcreateIndependentTreeAlpha,\n\ttype CreateIndependentTreeAlphaOptions,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\tSchemaFactoryBeta,\n\ttype SchemaStaticsBeta,\n\tSchemaFactoryAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\tObjectNodeSchema,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype NodeChangedData,\n\ttype SchemaUpgrade,\n\tcontentSchemaSymbol,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype System_Unsafe,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype UnannotateAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypesUnsafe,\n\ttype AllowedTypesFullUnsafe,\n\ttype AllowedTypesFullFromMixedUnsafe,\n\ttype UnannotateAllowedTypesListUnsafe,\n\ttype AnnotateAllowedTypesListUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype TreeViewBeta,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype AnnotatedAllowedType,\n\ttype AnnotatedAllowedTypes,\n\ttype AllowedTypesFullEvaluated,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\ttype UnannotateAllowedTypesList,\n\ttype AnnotateAllowedTypesList,\n\ttype AllowedTypesFull,\n\ttype AllowedTypesFullFromMixed,\n\ttype SchemaType,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\t// Other\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype TreeSchemaEncodingOptions,\n\ttype TreeSchema,\n\tTreeViewConfigurationAlpha,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleNodeSchemaBaseAlpha,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleRecordNodeSchema,\n\tnormalizeAllowedTypes,\n\twalkFieldSchema,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\tgetSimpleSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchAlpha,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype NodeSchemaMetadata,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\tevaluateLazySchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype LeafSchema,\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\ttype ObjectFromSchemaRecord,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\ttype TreeRecordNode,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n\ttype SchemaFactory_base,\n\ttype NumberKeys,\n\ttype SimpleAllowedTypeAttributes,\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n\tsnapshotSchemaCompatibility,\n\ttype SnapshotFileSystem,\n\tincrementalSummaryHint,\n\tincrementalEncodingPolicyForAllowedTypes,\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n\ttype SnapshotSchemaCompatibilityOptions,\n\ttype ArrayPlaceAnchor,\n\tcreateArrayInsertionAnchor,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n\tconfiguredSharedTreeAlpha,\n\tconfiguredSharedTreeBeta,\n\tconfiguredSharedTreeBetaLegacy,\n} from \"./treeFactory.js\";\nexport { SharedTreeAttributes, SharedTreeFactoryType } from \"./sharedTreeAttributes.js\";\nexport { persistedToSimpleSchema } from \"./shared-tree/index.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\ttype CodecWriteOptionsBeta,\n\tFluidClientVersion,\n\ttype FormatValidator,\n\tFormatValidatorNoOp,\n\ttype CodecName,\n\ttype FormatVersion,\n} from \"./codec/index.js\";\nexport { FormatValidatorBasic } from \"./external-utilities/index.js\";\n\nexport type {\n\t// Type Testing\n\trequireTrue,\n\trequireFalse,\n\trequireAssignableTo,\n\tareSafelyAssignable,\n\tisAssignableTo,\n\tisAny,\n\teitherIsAny,\n\t// Other\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\tMakeNominal,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"./util/index.js\";\nexport { cloneWithReplacements } from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\n/**\n * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n * They are used internally to implement API aspects, but are not intended for use by external consumers.\n */\n// eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor)\nexport { InternalTypes };\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport { JsonAsTree } from \"./jsonDomainSchema.js\";\nexport { FluidSerializableAsTree } from \"./serializableDomainSchema.js\";\nexport { TableSchema, type System_TableSchema } from \"./tableSchema.js\";\nexport { asAlpha, asBeta } from \"./api.js\";\n\nexport { TextAsTree, FormattedTextAsTree } from \"./text/index.js\";\nexport { ExtensibleUnionNode } from \"./extensibleUnionNode.js\";\n"]}
|
package/dist/legacy.d.ts
CHANGED
package/dist/packageVersion.d.ts
CHANGED
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/tree";
|
|
11
|
-
exports.pkgVersion = "2.
|
|
11
|
+
exports.pkgVersion = "2.83.0";
|
|
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,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,QAAQ,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/tree\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,QAAQ,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/tree\";\nexport const pkgVersion = \"2.83.0\";\n"]}
|
|
@@ -15,7 +15,7 @@ function makeSharedTreeChangeCodecFamily(modularChangeCodecFamily, options) {
|
|
|
15
15
|
const schemaChangeCodecs = (0, index_js_3.makeSchemaChangeCodecs)(options);
|
|
16
16
|
const versions = [...exports.dependenciesForChangeFormat.entries()].map(([format, { modularChange, schemaChange }]) => [
|
|
17
17
|
format,
|
|
18
|
-
makeSharedTreeChangeCodec(modularChangeCodecFamily.resolve(modularChange)
|
|
18
|
+
makeSharedTreeChangeCodec(modularChangeCodecFamily.resolve(modularChange), schemaChangeCodecs.resolve(schemaChange), options),
|
|
19
19
|
]);
|
|
20
20
|
return (0, index_js_1.makeCodecFamily)(versions);
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedTreeChangeCodecs.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeCodecs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAG3D,gDAU2B;AAC3B,+CAI0B;AAC1B,4DAQuC;AACvC,+CAK0B;AAE1B,2EAGqC;AAGrC,SAAgB,+BAA+B,CAC9C,wBAA+E,EAC/E,OAA0B;IAE1B,MAAM,kBAAkB,GAAG,IAAA,iCAAsB,EAAC,OAAO,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAQR,CAAC,GAAG,mCAA2B,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CACnD,CAAC,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,MAAM;QACN,yBAAyB,CACxB,wBAAwB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,IAAI,EACpD,kBAAkB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,IAAI,EAC7C,OAAO,CACP;KACD,CACD,CAAC;IACF,OAAO,IAAA,0BAAe,EAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAxBD,0EAwBC;AAOD;;GAEG;AACU,QAAA,6BAA6B,GAAG,IAAA,qBAAU,EAAC,+BAA+B,EAAE;IACxF;;;;OAIG;IACH,EAAE,EAAE,CAAC;IACL;;;;;;;OAOG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,EAAE,EAAE,CAAC;CACL,CAAC,CAAC;AAGH;;;;;GAKG;AACU,QAAA,2BAA2B,GAAG,IAAI,GAAG,CAGhD;IACD;QACC,qCAA6B,CAAC,EAAE;QAChC,EA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C,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;YAC3D,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,CAAC;QACpB,CAAC;KACD,EACD,YAAY,CAAC,aAAa,CAC1B,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\tDiscriminatedUnionDispatcher,\n\ttype FormatVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\twithSchemaValidation,\n} from \"../codec/index.js\";\nimport {\n\ttype ChangeEncodingContext,\n\tSchemaFormatVersion,\n\ttype TreeStoredSchema,\n} from \"../core/index.js\";\nimport {\n\tModularChangeFormatVersion,\n\ttype ModularChangeset,\n\ttype SchemaChange,\n\tdefaultSchemaPolicy,\n\tgetCodecTreeForModularChangeFormat,\n\tgetCodecTreeForSchemaChangeFormat,\n\tmakeSchemaChangeCodecs,\n} from \"../feature-libraries/index.js\";\nimport {\n\tstrictEnum,\n\ttype JsonCompatibleReadOnly,\n\ttype Mutable,\n\ttype Values,\n} from \"../util/index.js\";\n\nimport {\n\tEncodedSharedTreeChange,\n\ttype EncodedSharedTreeInnerChange,\n} from \"./sharedTreeChangeFormat.js\";\nimport type { SharedTreeChange, SharedTreeInnerChange } from \"./sharedTreeChangeTypes.js\";\n\nexport function makeSharedTreeChangeCodecFamily(\n\tmodularChangeCodecFamily: ICodecFamily<ModularChangeset, ChangeEncodingContext>,\n\toptions: CodecWriteOptions,\n): ICodecFamily<SharedTreeChange, ChangeEncodingContext> {\n\tconst schemaChangeCodecs = makeSchemaChangeCodecs(options);\n\tconst versions: [\n\t\tFormatVersion,\n\t\tIJsonCodec<\n\t\t\tSharedTreeChange,\n\t\t\tEncodedSharedTreeChange,\n\t\t\tEncodedSharedTreeChange,\n\t\t\tChangeEncodingContext\n\t\t>,\n\t][] = [...dependenciesForChangeFormat.entries()].map(\n\t\t([format, { modularChange, schemaChange }]) => [\n\t\t\tformat,\n\t\t\tmakeSharedTreeChangeCodec(\n\t\t\t\tmodularChangeCodecFamily.resolve(modularChange).json,\n\t\t\t\tschemaChangeCodecs.resolve(schemaChange).json,\n\t\t\t\toptions,\n\t\t\t),\n\t\t],\n\t);\n\treturn makeCodecFamily(versions);\n}\n\ninterface ChangeFormatDependencies {\n\treadonly modularChange: ModularChangeFormatVersion;\n\treadonly schemaChange: SchemaFormatVersion;\n}\n\n/**\n * The format version for `SharedTreeChange`.\n */\nexport const SharedTreeChangeFormatVersion = strictEnum(\"SharedTreeChangeFormatVersion\", {\n\t/**\n\t * Introduced prior to 2.0 and used beyond.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability needs to be maintained so long as {@link lowestMinVersionForCollab} is less than 2.2.0.\n\t */\n\tv3: 3,\n\t/**\n\t * Introduced in 2.2.0.\n\t * Was inadvertently made usable for writing in 2.43.0 (through configuredSharedTree) and remains available.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability could be dropped in favor of {@link SharedTreeChangeFormatVersion.v3},\n\t * but doing so would make the pattern of writable versions more complex and gain little\n\t * because the logic for this format is shared with {@link SharedTreeChangeFormatVersion.v3}.\n\t */\n\tv4: 4,\n\t/**\n\t * Introduced and made available for writing in 2.80.0\n\t * Adds support for \"no change\" constraints.\n\t */\n\tv5: 5,\n});\nexport type SharedTreeChangeFormatVersion = Values<typeof SharedTreeChangeFormatVersion>;\n\n/**\n * Defines for each SharedTree change format the corresponding dependent formats to use.\n * This is an arbitrary mapping that is injected in the SharedTree change codec.\n * Once an entry is defined and used in production, it cannot be changed.\n * This is because the format for the dependent formats are not explicitly versioned.\n */\nexport const dependenciesForChangeFormat = new Map<\n\tSharedTreeChangeFormatVersion,\n\tChangeFormatDependencies\n>([\n\t[\n\t\tSharedTreeChangeFormatVersion.v3,\n\t\t{ modularChange: ModularChangeFormatVersion.v3, schemaChange: SchemaFormatVersion.v1 },\n\t],\n\t[\n\t\tSharedTreeChangeFormatVersion.v4,\n\t\t{ modularChange: ModularChangeFormatVersion.v4, schemaChange: SchemaFormatVersion.v1 },\n\t],\n\t[\n\t\tSharedTreeChangeFormatVersion.v5,\n\t\t{ modularChange: ModularChangeFormatVersion.v5, schemaChange: SchemaFormatVersion.v1 },\n\t],\n]);\n\nexport function getCodecTreeForChangeFormat(\n\tversion: SharedTreeChangeFormatVersion,\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\tconst { modularChange, schemaChange } =\n\t\tdependenciesForChangeFormat.get(version) ?? fail(0xc78 /* Unknown change format */);\n\treturn {\n\t\tname: \"SharedTreeChange\",\n\t\tversion,\n\t\tchildren: [\n\t\t\tgetCodecTreeForModularChangeFormat(modularChange),\n\t\t\tgetCodecTreeForSchemaChangeFormat(schemaChange, clientVersion),\n\t\t],\n\t};\n}\n\nfunction makeSharedTreeChangeCodec(\n\tmodularChangeCodec: IJsonCodec<\n\t\tModularChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\tschemaChangeCodec: IJsonCodec<SchemaChange>,\n\tcodecOptions: ICodecOptions,\n): IJsonCodec<\n\tSharedTreeChange,\n\tEncodedSharedTreeChange,\n\tEncodedSharedTreeChange,\n\tChangeEncodingContext\n> {\n\tconst decoderLibrary = new DiscriminatedUnionDispatcher<\n\t\tEncodedSharedTreeInnerChange,\n\t\t[context: ChangeEncodingContext],\n\t\tSharedTreeInnerChange\n\t>({\n\t\tdata(encoded, context): SharedTreeInnerChange {\n\t\t\treturn {\n\t\t\t\ttype: \"data\",\n\t\t\t\tinnerChange: modularChangeCodec.decode(encoded, context),\n\t\t\t};\n\t\t},\n\t\tschema(encoded): SharedTreeInnerChange {\n\t\t\treturn {\n\t\t\t\ttype: \"schema\",\n\t\t\t\tinnerChange: schemaChangeCodec.decode(encoded),\n\t\t\t};\n\t\t},\n\t});\n\n\treturn withSchemaValidation(\n\t\tEncodedSharedTreeChange,\n\t\t{\n\t\t\tencode: (change, context) => {\n\t\t\t\tconst changes: EncodedSharedTreeInnerChange[] = [];\n\t\t\t\tlet updatedSchema: TreeStoredSchema | undefined;\n\t\t\t\tfor (const decodedChange of change.changes) {\n\t\t\t\t\tif (decodedChange.type === \"data\") {\n\t\t\t\t\t\tconst schemaAndPolicy =\n\t\t\t\t\t\t\tupdatedSchema === undefined\n\t\t\t\t\t\t\t\t? context.schema\n\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\tpolicy:\n\t\t\t\t\t\t\t\t\t\t\tcontext.schema === undefined\n\t\t\t\t\t\t\t\t\t\t\t\t? defaultSchemaPolicy\n\t\t\t\t\t\t\t\t\t\t\t\t: context.schema.policy,\n\t\t\t\t\t\t\t\t\t\tschema: updatedSchema,\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\tchanges.push({\n\t\t\t\t\t\t\tdata: modularChangeCodec.encode(decodedChange.innerChange, {\n\t\t\t\t\t\t\t\toriginatorId: context.originatorId,\n\t\t\t\t\t\t\t\tschema: schemaAndPolicy,\n\t\t\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\t\t\trevision: context.revision,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (decodedChange.type === \"schema\") {\n\t\t\t\t\t\tchanges.push({\n\t\t\t\t\t\t\tschema: schemaChangeCodec.encode(decodedChange.innerChange),\n\t\t\t\t\t\t});\n\t\t\t\t\t\tupdatedSchema = decodedChange.innerChange.schema.new;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn changes;\n\t\t\t},\n\t\t\tdecode: (encodedChange, context) => {\n\t\t\t\tconst changes: Mutable<SharedTreeChange[\"changes\"]> = [];\n\t\t\t\tfor (const subChange of encodedChange) {\n\t\t\t\t\tchanges.push(decoderLibrary.dispatch(subChange, context));\n\t\t\t\t}\n\t\t\t\treturn { changes };\n\t\t\t},\n\t\t},\n\t\tcodecOptions.jsonValidator,\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sharedTreeChangeCodecs.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeCodecs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAG3D,gDAU2B;AAC3B,+CAI0B;AAC1B,4DAQuC;AACvC,+CAK0B;AAE1B,2EAGqC;AAGrC,SAAgB,+BAA+B,CAC9C,wBAA+E,EAC/E,OAA0B;IAE1B,MAAM,kBAAkB,GAAG,IAAA,iCAAsB,EAAC,OAAO,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAQR,CAAC,GAAG,mCAA2B,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CACnD,CAAC,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,MAAM;QACN,yBAAyB,CACxB,wBAAwB,CAAC,OAAO,CAAC,aAAa,CAAC,EAC/C,kBAAkB,CAAC,OAAO,CAAC,YAAY,CAAC,EACxC,OAAO,CACP;KACD,CACD,CAAC;IACF,OAAO,IAAA,0BAAe,EAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAxBD,0EAwBC;AAOD;;GAEG;AACU,QAAA,6BAA6B,GAAG,IAAA,qBAAU,EAAC,+BAA+B,EAAE;IACxF;;;;OAIG;IACH,EAAE,EAAE,CAAC;IACL;;;;;;;OAOG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,EAAE,EAAE,CAAC;CACL,CAAC,CAAC;AAGH;;;;;GAKG;AACU,QAAA,2BAA2B,GAAG,IAAI,GAAG,CAGhD;IACD;QACC,qCAA6B,CAAC,EAAE;QAChC,EAAE,aAAa,EAAE,qCAA0B,CAAC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AQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;YAC3D,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,CAAC;QACpB,CAAC;KACD,EACD,YAAY,CAAC,aAAa,CAC1B,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\tDiscriminatedUnionDispatcher,\n\ttype FormatVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\twithSchemaValidation,\n} from \"../codec/index.js\";\nimport {\n\ttype ChangeEncodingContext,\n\tSchemaFormatVersion,\n\ttype TreeStoredSchema,\n} from \"../core/index.js\";\nimport {\n\tModularChangeFormatVersion,\n\ttype ModularChangeset,\n\ttype SchemaChange,\n\tdefaultSchemaPolicy,\n\tgetCodecTreeForModularChangeFormat,\n\tgetCodecTreeForSchemaChangeFormat,\n\tmakeSchemaChangeCodecs,\n} from \"../feature-libraries/index.js\";\nimport {\n\tstrictEnum,\n\ttype JsonCompatibleReadOnly,\n\ttype Mutable,\n\ttype Values,\n} from \"../util/index.js\";\n\nimport {\n\tEncodedSharedTreeChange,\n\ttype EncodedSharedTreeInnerChange,\n} from \"./sharedTreeChangeFormat.js\";\nimport type { SharedTreeChange, SharedTreeInnerChange } from \"./sharedTreeChangeTypes.js\";\n\nexport function makeSharedTreeChangeCodecFamily(\n\tmodularChangeCodecFamily: ICodecFamily<ModularChangeset, ChangeEncodingContext>,\n\toptions: CodecWriteOptions,\n): ICodecFamily<SharedTreeChange, ChangeEncodingContext> {\n\tconst schemaChangeCodecs = makeSchemaChangeCodecs(options);\n\tconst versions: [\n\t\tFormatVersion,\n\t\tIJsonCodec<\n\t\t\tSharedTreeChange,\n\t\t\tEncodedSharedTreeChange,\n\t\t\tEncodedSharedTreeChange,\n\t\t\tChangeEncodingContext\n\t\t>,\n\t][] = [...dependenciesForChangeFormat.entries()].map(\n\t\t([format, { modularChange, schemaChange }]) => [\n\t\t\tformat,\n\t\t\tmakeSharedTreeChangeCodec(\n\t\t\t\tmodularChangeCodecFamily.resolve(modularChange),\n\t\t\t\tschemaChangeCodecs.resolve(schemaChange),\n\t\t\t\toptions,\n\t\t\t),\n\t\t],\n\t);\n\treturn makeCodecFamily(versions);\n}\n\ninterface ChangeFormatDependencies {\n\treadonly modularChange: ModularChangeFormatVersion;\n\treadonly schemaChange: SchemaFormatVersion;\n}\n\n/**\n * The format version for `SharedTreeChange`.\n */\nexport const SharedTreeChangeFormatVersion = strictEnum(\"SharedTreeChangeFormatVersion\", {\n\t/**\n\t * Introduced prior to 2.0 and used beyond.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability needs to be maintained so long as {@link lowestMinVersionForCollab} is less than 2.2.0.\n\t */\n\tv3: 3,\n\t/**\n\t * Introduced in 2.2.0.\n\t * Was inadvertently made usable for writing in 2.43.0 (through configuredSharedTree) and remains available.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability could be dropped in favor of {@link SharedTreeChangeFormatVersion.v3},\n\t * but doing so would make the pattern of writable versions more complex and gain little\n\t * because the logic for this format is shared with {@link SharedTreeChangeFormatVersion.v3}.\n\t */\n\tv4: 4,\n\t/**\n\t * Introduced and made available for writing in 2.80.0\n\t * Adds support for \"no change\" constraints.\n\t */\n\tv5: 5,\n});\nexport type SharedTreeChangeFormatVersion = Values<typeof SharedTreeChangeFormatVersion>;\n\n/**\n * Defines for each SharedTree change format the corresponding dependent formats to use.\n * This is an arbitrary mapping that is injected in the SharedTree change codec.\n * Once an entry is defined and used in production, it cannot be changed.\n * This is because the format for the dependent formats are not explicitly versioned.\n */\nexport const dependenciesForChangeFormat = new Map<\n\tSharedTreeChangeFormatVersion,\n\tChangeFormatDependencies\n>([\n\t[\n\t\tSharedTreeChangeFormatVersion.v3,\n\t\t{ modularChange: ModularChangeFormatVersion.v3, schemaChange: SchemaFormatVersion.v1 },\n\t],\n\t[\n\t\tSharedTreeChangeFormatVersion.v4,\n\t\t{ modularChange: ModularChangeFormatVersion.v4, schemaChange: SchemaFormatVersion.v1 },\n\t],\n\t[\n\t\tSharedTreeChangeFormatVersion.v5,\n\t\t{ modularChange: ModularChangeFormatVersion.v5, schemaChange: SchemaFormatVersion.v1 },\n\t],\n]);\n\nexport function getCodecTreeForChangeFormat(\n\tversion: SharedTreeChangeFormatVersion,\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\tconst { modularChange, schemaChange } =\n\t\tdependenciesForChangeFormat.get(version) ?? fail(0xc78 /* Unknown change format */);\n\treturn {\n\t\tname: \"SharedTreeChange\",\n\t\tversion,\n\t\tchildren: [\n\t\t\tgetCodecTreeForModularChangeFormat(modularChange),\n\t\t\tgetCodecTreeForSchemaChangeFormat(schemaChange, clientVersion),\n\t\t],\n\t};\n}\n\nfunction makeSharedTreeChangeCodec(\n\tmodularChangeCodec: IJsonCodec<\n\t\tModularChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\tschemaChangeCodec: IJsonCodec<SchemaChange>,\n\tcodecOptions: ICodecOptions,\n): IJsonCodec<\n\tSharedTreeChange,\n\tEncodedSharedTreeChange,\n\tEncodedSharedTreeChange,\n\tChangeEncodingContext\n> {\n\tconst decoderLibrary = new DiscriminatedUnionDispatcher<\n\t\tEncodedSharedTreeInnerChange,\n\t\t[context: ChangeEncodingContext],\n\t\tSharedTreeInnerChange\n\t>({\n\t\tdata(encoded, context): SharedTreeInnerChange {\n\t\t\treturn {\n\t\t\t\ttype: \"data\",\n\t\t\t\tinnerChange: modularChangeCodec.decode(encoded, context),\n\t\t\t};\n\t\t},\n\t\tschema(encoded): SharedTreeInnerChange {\n\t\t\treturn {\n\t\t\t\ttype: \"schema\",\n\t\t\t\tinnerChange: schemaChangeCodec.decode(encoded),\n\t\t\t};\n\t\t},\n\t});\n\n\treturn withSchemaValidation(\n\t\tEncodedSharedTreeChange,\n\t\t{\n\t\t\tencode: (change, context) => {\n\t\t\t\tconst changes: EncodedSharedTreeInnerChange[] = [];\n\t\t\t\tlet updatedSchema: TreeStoredSchema | undefined;\n\t\t\t\tfor (const decodedChange of change.changes) {\n\t\t\t\t\tif (decodedChange.type === \"data\") {\n\t\t\t\t\t\tconst schemaAndPolicy =\n\t\t\t\t\t\t\tupdatedSchema === undefined\n\t\t\t\t\t\t\t\t? context.schema\n\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\tpolicy:\n\t\t\t\t\t\t\t\t\t\t\tcontext.schema === undefined\n\t\t\t\t\t\t\t\t\t\t\t\t? defaultSchemaPolicy\n\t\t\t\t\t\t\t\t\t\t\t\t: context.schema.policy,\n\t\t\t\t\t\t\t\t\t\tschema: updatedSchema,\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\tchanges.push({\n\t\t\t\t\t\t\tdata: modularChangeCodec.encode(decodedChange.innerChange, {\n\t\t\t\t\t\t\t\toriginatorId: context.originatorId,\n\t\t\t\t\t\t\t\tschema: schemaAndPolicy,\n\t\t\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\t\t\trevision: context.revision,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (decodedChange.type === \"schema\") {\n\t\t\t\t\t\tchanges.push({\n\t\t\t\t\t\t\tschema: schemaChangeCodec.encode(decodedChange.innerChange),\n\t\t\t\t\t\t});\n\t\t\t\t\t\tupdatedSchema = decodedChange.innerChange.schema.new;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn changes;\n\t\t\t},\n\t\t\tdecode: (encodedChange, context) => {\n\t\t\t\tconst changes: Mutable<SharedTreeChange[\"changes\"]> = [];\n\t\t\t\tfor (const subChange of encodedChange) {\n\t\t\t\t\tchanges.push(decoderLibrary.dispatch(subChange, context));\n\t\t\t\t}\n\t\t\t\treturn { changes };\n\t\t\t},\n\t\t},\n\t\tcodecOptions.jsonValidator,\n\t);\n}\n"]}
|
|
@@ -7,7 +7,7 @@ import { type ImplicitFieldSchema, type TreeNode, type TreeNodeApi, type TreeVie
|
|
|
7
7
|
* Provides various functions for interacting with {@link TreeNode}s.
|
|
8
8
|
* @remarks
|
|
9
9
|
* This type should only be used via the {@link (Tree:variable)} export.
|
|
10
|
-
* @
|
|
10
|
+
* @sealed @public
|
|
11
11
|
*/
|
|
12
12
|
export interface Tree extends TreeNodeApi {
|
|
13
13
|
/**
|