@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
|
@@ -9,7 +9,6 @@ import type { TAnySchema } from "@sinclair/typebox";
|
|
|
9
9
|
import {
|
|
10
10
|
type ICodecOptions,
|
|
11
11
|
type IJsonCodec,
|
|
12
|
-
type IMultiFormatCodec,
|
|
13
12
|
type SchemaValidationFunction,
|
|
14
13
|
extractJsonValidator,
|
|
15
14
|
withSchemaValidation,
|
|
@@ -72,7 +71,7 @@ type ModularChangeCodec = IJsonCodec<
|
|
|
72
71
|
ChangeEncodingContext
|
|
73
72
|
>;
|
|
74
73
|
|
|
75
|
-
type FieldCodec =
|
|
74
|
+
type FieldCodec = IJsonCodec<
|
|
76
75
|
FieldChangeset,
|
|
77
76
|
JsonCompatibleReadOnly,
|
|
78
77
|
JsonCompatibleReadOnly,
|
|
@@ -132,7 +131,7 @@ export function encodeFieldChangesForJsonI(
|
|
|
132
131
|
fieldChange.fieldKind,
|
|
133
132
|
fieldChangesetCodecs,
|
|
134
133
|
);
|
|
135
|
-
const encodedChange = codec.
|
|
134
|
+
const encodedChange = codec.encode(fieldChange.change, context);
|
|
136
135
|
if (compiledSchema !== undefined && !compiledSchema.check(encodedChange)) {
|
|
137
136
|
fail(0xb1f /* Encoded change didn't pass schema validation. */);
|
|
138
137
|
}
|
|
@@ -225,7 +224,7 @@ export function decodeFieldChangesFromJson(
|
|
|
225
224
|
},
|
|
226
225
|
};
|
|
227
226
|
|
|
228
|
-
const fieldChangeset = codec.
|
|
227
|
+
const fieldChangeset = codec.decode(field.change, fieldContext);
|
|
229
228
|
|
|
230
229
|
const crossFieldKeys = getChangeHandler(fieldKinds, field.fieldKind).getCrossFieldKeys(
|
|
231
230
|
fieldChangeset,
|
|
@@ -597,8 +596,8 @@ export function getFieldChangesetCodecs(
|
|
|
597
596
|
const codec = kind.changeHandler.codecsFactory(revisionTagCodec).resolve(formatVersion);
|
|
598
597
|
return {
|
|
599
598
|
codec,
|
|
600
|
-
compiledSchema: codec.
|
|
601
|
-
? extractJsonValidator(codecOptions.jsonValidator).compile(codec.
|
|
599
|
+
compiledSchema: codec.encodedSchema
|
|
600
|
+
? extractJsonValidator(codecOptions.jsonValidator).compile(codec.encodedSchema)
|
|
602
601
|
: undefined,
|
|
603
602
|
};
|
|
604
603
|
};
|
|
@@ -125,8 +125,9 @@ function decodeV2(f: FormatV2): TreeStoredSchema {
|
|
|
125
125
|
/**
|
|
126
126
|
* Creates a codec which performs synchronous monolithic encoding of schema content.
|
|
127
127
|
*/
|
|
128
|
-
export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Schema",
|
|
129
|
-
|
|
128
|
+
export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Schema", [
|
|
129
|
+
{
|
|
130
|
+
minVersionForCollab: lowestMinVersionForCollab,
|
|
130
131
|
formatVersion: SchemaFormatVersion.v1,
|
|
131
132
|
codec: {
|
|
132
133
|
encode: (data: TreeStoredSchema) => encodeRepoV1(data),
|
|
@@ -134,7 +135,8 @@ export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Sc
|
|
|
134
135
|
schema: FormatV1,
|
|
135
136
|
},
|
|
136
137
|
},
|
|
137
|
-
|
|
138
|
+
{
|
|
139
|
+
minVersionForCollab: FluidClientVersion.v2_43,
|
|
138
140
|
formatVersion: SchemaFormatVersion.v2,
|
|
139
141
|
codec: {
|
|
140
142
|
encode: (data: TreeStoredSchema) => encodeRepoV2(data),
|
|
@@ -142,4 +144,4 @@ export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Sc
|
|
|
142
144
|
schema: FormatV2,
|
|
143
145
|
},
|
|
144
146
|
},
|
|
145
|
-
|
|
147
|
+
]);
|
package/src/index.ts
CHANGED
|
@@ -296,13 +296,13 @@ export {
|
|
|
296
296
|
exportCompatibilitySchemaSnapshot,
|
|
297
297
|
importCompatibilitySchemaSnapshot,
|
|
298
298
|
checkCompatibility,
|
|
299
|
-
|
|
299
|
+
snapshotSchemaCompatibility,
|
|
300
300
|
type SnapshotFileSystem,
|
|
301
301
|
incrementalSummaryHint,
|
|
302
302
|
incrementalEncodingPolicyForAllowedTypes,
|
|
303
303
|
eraseSchemaDetails,
|
|
304
304
|
eraseSchemaDetailsSubclassable,
|
|
305
|
-
type
|
|
305
|
+
type SnapshotSchemaCompatibilityOptions,
|
|
306
306
|
type ArrayPlaceAnchor,
|
|
307
307
|
createArrayInsertionAnchor,
|
|
308
308
|
} from "./simple-tree/index.js";
|
|
@@ -371,4 +371,4 @@ export { TableSchema, type System_TableSchema } from "./tableSchema.js";
|
|
|
371
371
|
export { asAlpha, asBeta } from "./api.js";
|
|
372
372
|
|
|
373
373
|
export { TextAsTree, FormattedTextAsTree } from "./text/index.js";
|
|
374
|
-
export {
|
|
374
|
+
export { ExtensibleUnionNode } from "./extensibleUnionNode.js";
|
package/src/packageVersion.ts
CHANGED
|
@@ -61,8 +61,8 @@ export function makeSharedTreeChangeCodecFamily(
|
|
|
61
61
|
([format, { modularChange, schemaChange }]) => [
|
|
62
62
|
format,
|
|
63
63
|
makeSharedTreeChangeCodec(
|
|
64
|
-
modularChangeCodecFamily.resolve(modularChange)
|
|
65
|
-
schemaChangeCodecs.resolve(schemaChange)
|
|
64
|
+
modularChangeCodecFamily.resolve(modularChange),
|
|
65
|
+
schemaChangeCodecs.resolve(schemaChange),
|
|
66
66
|
options,
|
|
67
67
|
),
|
|
68
68
|
],
|
package/src/shared-tree/tree.ts
CHANGED
|
@@ -28,7 +28,7 @@ import type { ITreeCheckout } from "./treeCheckout.js";
|
|
|
28
28
|
* Provides various functions for interacting with {@link TreeNode}s.
|
|
29
29
|
* @remarks
|
|
30
30
|
* This type should only be used via the {@link (Tree:variable)} export.
|
|
31
|
-
* @
|
|
31
|
+
* @sealed @public
|
|
32
32
|
*/
|
|
33
33
|
export interface Tree extends TreeNodeApi {
|
|
34
34
|
/**
|
|
@@ -226,7 +226,7 @@ export interface TreeIdentifierUtils {
|
|
|
226
226
|
* There should be a way to provide a source for defaulted identifiers for unhydrated node creation, either via these APIs or some way to add them to its output later.
|
|
227
227
|
* If an option were added to these APIs, it could also be used to enable unknown optional fields.
|
|
228
228
|
*
|
|
229
|
-
* @
|
|
229
|
+
* @sealed @alpha
|
|
230
230
|
*/
|
|
231
231
|
export interface TreeAlpha {
|
|
232
232
|
/**
|
|
@@ -597,9 +597,7 @@ export class TreeCheckout implements ITreeCheckoutFork {
|
|
|
597
597
|
originatorId: this.idCompressor.localSessionId,
|
|
598
598
|
revision,
|
|
599
599
|
};
|
|
600
|
-
const encodedChange = this.changeFamily.codecs
|
|
601
|
-
.resolve(4)
|
|
602
|
-
.json.encode(change, context);
|
|
600
|
+
const encodedChange = this.changeFamily.codecs.resolve(4).encode(change, context);
|
|
603
601
|
|
|
604
602
|
assert(
|
|
605
603
|
commit.parent !== undefined,
|
|
@@ -666,7 +664,7 @@ export class TreeCheckout implements ITreeCheckoutFork {
|
|
|
666
664
|
originatorId: this.idCompressor.localSessionId,
|
|
667
665
|
revision,
|
|
668
666
|
};
|
|
669
|
-
const decodedChange = this.changeFamily.codecs.resolve(4).
|
|
667
|
+
const decodedChange = this.changeFamily.codecs.resolve(4).decode(change, context);
|
|
670
668
|
this.applyChange(decodedChange, revision);
|
|
671
669
|
}
|
|
672
670
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import type { IIdCompressor, SessionId } from "@fluidframework/id-compressor";
|
|
8
8
|
|
|
9
|
-
import type { IJsonCodec
|
|
9
|
+
import type { IJsonCodec } from "../codec/index.js";
|
|
10
10
|
import type {
|
|
11
11
|
ChangeEncodingContext,
|
|
12
12
|
EncodedRevisionTag,
|
|
@@ -32,7 +32,7 @@ export interface EditManagerEncodingContext {
|
|
|
32
32
|
|
|
33
33
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
34
34
|
function encodeCommit<TChangeset, T extends Commit<TChangeset>>(
|
|
35
|
-
changeCodec:
|
|
35
|
+
changeCodec: IJsonCodec<
|
|
36
36
|
TChangeset,
|
|
37
37
|
JsonCompatibleReadOnly,
|
|
38
38
|
JsonCompatibleReadOnly,
|
|
@@ -54,13 +54,13 @@ function encodeCommit<TChangeset, T extends Commit<TChangeset>>(
|
|
|
54
54
|
idCompressor: context.idCompressor,
|
|
55
55
|
revision: undefined,
|
|
56
56
|
}),
|
|
57
|
-
change: changeCodec.
|
|
57
|
+
change: changeCodec.encode(commit.change, { ...context, revision: commit.revision }),
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
62
62
|
function decodeCommit<TChangeset, T extends EncodedCommit<JsonCompatibleReadOnly>>(
|
|
63
|
-
changeCodec:
|
|
63
|
+
changeCodec: IJsonCodec<
|
|
64
64
|
TChangeset,
|
|
65
65
|
JsonCompatibleReadOnly,
|
|
66
66
|
JsonCompatibleReadOnly,
|
|
@@ -84,12 +84,12 @@ function decodeCommit<TChangeset, T extends EncodedCommit<JsonCompatibleReadOnly
|
|
|
84
84
|
return {
|
|
85
85
|
...commit,
|
|
86
86
|
revision,
|
|
87
|
-
change: changeCodec.
|
|
87
|
+
change: changeCodec.decode(commit.change, { ...context, revision }),
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
export function encodeSharedBranch<TChangeset>(
|
|
92
|
-
changeCodec:
|
|
92
|
+
changeCodec: IJsonCodec<
|
|
93
93
|
TChangeset,
|
|
94
94
|
JsonCompatibleReadOnly,
|
|
95
95
|
JsonCompatibleReadOnly,
|
|
@@ -160,7 +160,7 @@ export function encodeSharedBranch<TChangeset>(
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
export function decodeSharedBranch<TChangeset>(
|
|
163
|
-
changeCodec:
|
|
163
|
+
changeCodec: IJsonCodec<
|
|
164
164
|
TChangeset,
|
|
165
165
|
JsonCompatibleReadOnly,
|
|
166
166
|
JsonCompatibleReadOnly,
|
|
@@ -5,12 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
type ICodecOptions,
|
|
10
|
-
type IJsonCodec,
|
|
11
|
-
type IMultiFormatCodec,
|
|
12
|
-
withSchemaValidation,
|
|
13
|
-
} from "../codec/index.js";
|
|
8
|
+
import { type ICodecOptions, type IJsonCodec, withSchemaValidation } from "../codec/index.js";
|
|
14
9
|
import type {
|
|
15
10
|
ChangeEncodingContext,
|
|
16
11
|
EncodedRevisionTag,
|
|
@@ -29,7 +24,7 @@ export interface EditManagerEncodingContext {
|
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
export function makeV1CodecWithVersion<TChangeset>(
|
|
32
|
-
changeCodec:
|
|
27
|
+
changeCodec: IJsonCodec<
|
|
33
28
|
TChangeset,
|
|
34
29
|
JsonCompatibleReadOnly,
|
|
35
30
|
JsonCompatibleReadOnly,
|
|
@@ -49,9 +44,7 @@ export function makeV1CodecWithVersion<TChangeset>(
|
|
|
49
44
|
JsonCompatibleReadOnly,
|
|
50
45
|
EditManagerEncodingContext
|
|
51
46
|
> {
|
|
52
|
-
const format = EncodedEditManager(
|
|
53
|
-
changeCodec.json.encodedSchema ?? JsonCompatibleReadOnlySchema,
|
|
54
|
-
);
|
|
47
|
+
const format = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);
|
|
55
48
|
|
|
56
49
|
const codec: IJsonCodec<
|
|
57
50
|
SummaryData<TChangeset>,
|
|
@@ -6,12 +6,7 @@
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
type ICodecOptions,
|
|
11
|
-
type IJsonCodec,
|
|
12
|
-
type IMultiFormatCodec,
|
|
13
|
-
withSchemaValidation,
|
|
14
|
-
} from "../codec/index.js";
|
|
9
|
+
import { type ICodecOptions, type IJsonCodec, withSchemaValidation } from "../codec/index.js";
|
|
15
10
|
import type {
|
|
16
11
|
ChangeEncodingContext,
|
|
17
12
|
EncodedRevisionTag,
|
|
@@ -36,7 +31,7 @@ export interface EditManagerEncodingContext {
|
|
|
36
31
|
}
|
|
37
32
|
|
|
38
33
|
export function makeSharedBranchesCodecWithVersion<TChangeset>(
|
|
39
|
-
changeCodec:
|
|
34
|
+
changeCodec: IJsonCodec<
|
|
40
35
|
TChangeset,
|
|
41
36
|
JsonCompatibleReadOnly,
|
|
42
37
|
JsonCompatibleReadOnly,
|
|
@@ -56,9 +51,7 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
|
|
|
56
51
|
JsonCompatibleReadOnly,
|
|
57
52
|
EditManagerEncodingContext
|
|
58
53
|
> {
|
|
59
|
-
const format = EncodedEditManager(
|
|
60
|
-
changeCodec.json.encodedSchema ?? JsonCompatibleReadOnlySchema,
|
|
61
|
-
);
|
|
54
|
+
const format = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);
|
|
62
55
|
|
|
63
56
|
const codec: IJsonCodec<
|
|
64
57
|
SummaryData<TChangeset>,
|
|
@@ -146,9 +146,7 @@ export function makeMessageCodecs<TChangeset>(
|
|
|
146
146
|
case unbrand(MessageFormatVersion.v3):
|
|
147
147
|
case unbrand(MessageFormatVersion.v4):
|
|
148
148
|
case unbrand(MessageFormatVersion.v6): {
|
|
149
|
-
const changeCodec = changeCodecs.resolve(
|
|
150
|
-
dependentChangeFormatVersion.lookup(version),
|
|
151
|
-
).json;
|
|
149
|
+
const changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));
|
|
152
150
|
return [
|
|
153
151
|
version,
|
|
154
152
|
makeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, options, version),
|
|
@@ -158,9 +156,7 @@ export function makeMessageCodecs<TChangeset>(
|
|
|
158
156
|
return [version, makeDiscontinuedCodecVersion(options, version, "2.74.0")];
|
|
159
157
|
}
|
|
160
158
|
case unbrand(MessageFormatVersion.vSharedBranches): {
|
|
161
|
-
const changeCodec = changeCodecs.resolve(
|
|
162
|
-
dependentChangeFormatVersion.lookup(version),
|
|
163
|
-
).json;
|
|
159
|
+
const changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));
|
|
164
160
|
return [
|
|
165
161
|
version,
|
|
166
162
|
makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, options, version),
|
|
@@ -181,7 +181,7 @@ export {
|
|
|
181
181
|
exportCompatibilitySchemaSnapshot,
|
|
182
182
|
importCompatibilitySchemaSnapshot,
|
|
183
183
|
checkCompatibility,
|
|
184
|
-
|
|
184
|
+
snapshotSchemaCompatibility,
|
|
185
185
|
type SnapshotFileSystem,
|
|
186
|
-
type
|
|
186
|
+
type SnapshotSchemaCompatibilityOptions,
|
|
187
187
|
} from "./snapshotCompatibilityChecker.js";
|