Skip to content

[NOT FOR MERGING] Use persisted metadata in ai-collab sample app #24862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 48 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bd8406a
Initial change.
TommyBrosman May 12, 2025
3165fe3
persistedMetadata is now backed by an object instead of a string.
TommyBrosman May 13, 2025
9709ede
Updated codec.spec.ts to cover FormatV2.
TommyBrosman May 13, 2025
ba058e1
Removed extraneous whitespace change.
TommyBrosman May 13, 2025
b819742
- Changed TreeNodeStoredSchema implementations to take the write vers…
TommyBrosman May 13, 2025
0b5c842
- Changed the stored schema implementation to handle multiple schema …
TommyBrosman May 13, 2025
ecdca7a
Merge branch 'main' into metadata-schema-3
TommyBrosman May 13, 2025
1117c2c
Apply suggestions from code review
TommyBrosman May 14, 2025
94a5c39
- Switched to using the SchemaCodecVersion in public APIs. Eventually…
TommyBrosman May 14, 2025
302cb21
Merge branch 'metadata-schema-3' of https://github.com/TommyBrosman/F…
TommyBrosman May 14, 2025
0ba34d1
- Removed the schema version constant and replaced it with SchemaCode…
TommyBrosman May 14, 2025
3275ee0
Minor: reverted changes to FluidClientVersion utils.
TommyBrosman May 15, 2025
7c48b9d
Switched back to using min client version for importCompressed.
TommyBrosman May 15, 2025
a2f4195
Minor: reverted accidental change.
TommyBrosman May 15, 2025
4786dcc
Apply suggestions from code review
TommyBrosman May 15, 2025
6fa8836
Made persisted metadata schema field naming consistent.
TommyBrosman May 15, 2025
e4064c7
- Created a separate storedSchemaDecodeDispatcher for v2 schemas.
TommyBrosman May 16, 2025
ab1b882
- Refactored the node kind dispatch.
TommyBrosman May 19, 2025
1027daa
Updated snapshots.
TommyBrosman May 19, 2025
e527eba
- Removed minimum client version changes. Equivalent changes will be …
TommyBrosman May 19, 2025
3eae1f6
Removed more minimumClientVersion glue.
TommyBrosman May 19, 2025
98e1b76
Updated API files.
TommyBrosman May 19, 2025
ecc77c9
Rename: SchemaCodecVersion -> SchemaVersion.
TommyBrosman May 20, 2025
37e900f
Merge branch 'main' into metadata-schema-3
TommyBrosman May 20, 2025
737633b
Removed top-level persisted metadata.
TommyBrosman May 21, 2025
4bb136c
Fixed comments.
TommyBrosman May 22, 2025
0bcb90f
Exposed persistedMetadata as a JsonCompatibleReadOnlyObject.
TommyBrosman May 22, 2025
a675338
Changeset.
TommyBrosman May 22, 2025
1d1ef5f
Wired up toStoredSchema. Still needs tests.
TommyBrosman May 22, 2025
b9898e8
- Updated an old snapshot that didn't include the metadata field.
TommyBrosman May 22, 2025
6ca189a
Refactor: persistedMetadata -> metadata on persisted types.
TommyBrosman May 27, 2025
85240dc
Apply suggestions from code review
TommyBrosman May 27, 2025
8883d45
- Updated the changeset description
TommyBrosman May 28, 2025
9c2c13f
Reverted unnecessary change.
TommyBrosman May 28, 2025
c62f7ec
Wired up node schema metadata persistence. Currently errors on tests …
TommyBrosman May 29, 2025
2f6b519
Reverted unneeded change.
TommyBrosman May 29, 2025
ae1779b
Removed tests for the alpha API I removed in a previous revision.
TommyBrosman May 29, 2025
7eff8ab
This revision adds simple-tree persistence for node and field schema …
TommyBrosman May 30, 2025
0a84a12
Update example app to use SPE
alexvy86 Jun 1, 2025
2a4221f
Add persistedMetadata to schema in example app
alexvy86 Jun 1, 2025
d7ec62b
Updates in SharedTree
alexvy86 Jun 1, 2025
61322c9
Formatting
alexvy86 Jun 1, 2025
3624379
Revert funky changes in API reports
alexvy86 Jun 1, 2025
e11beed
Skip v4 tests
alexvy86 Jun 1, 2025
3156997
Skip the other v4 tests
alexvy86 Jun 1, 2025
e4c8be8
Formatting
alexvy86 Jun 1, 2025
fe13eac
Include metadata when exporting stored schema as simple schema
alexvy86 Jun 1, 2025
5e88b30
Hack to get persistedMetadata to get encoded (in the wrong place) for…
alexvy86 Jun 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/brown-dingos-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@fluidframework/tree": minor
"fluid-framework": minor
"__section": tree
---
Add APIs for declaring "persisted" schema metadata

Add alpha APIs for declaring node and field schema metadata which future versions of the Fluid Framework will provide a way to opt into persisting in the document.
4 changes: 2 additions & 2 deletions examples/apps/ai-collab/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import { useFluidContainerNextJs } from "@/useFluidContainerNextjs";
import { useSharedTreeRerender } from "@/useSharedTreeRerender";

// Uncomment the import line that corresponds to the server you want to use
// import { createContainer, loadContainer, postAttach, containerIdFromUrl } from "./spe"; // eslint-disable-line import/order
import { createContainer, loadContainer, postAttach, containerIdFromUrl } from "./tinylicious"; // eslint-disable-line import/order
import { createContainer, loadContainer, postAttach, containerIdFromUrl } from "./spe"; // eslint-disable-line import/order
// import { createContainer, loadContainer, postAttach, containerIdFromUrl } from "./tinylicious"; // eslint-disable-line import/order

export async function createAndInitializeContainer(): Promise<
IFluidContainer<typeof CONTAINER_SCHEMA>
Expand Down
38 changes: 24 additions & 14 deletions examples/apps/ai-collab/src/types/sharedTreeAppSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@ const sf = new SchemaFactoryAlpha("ai-collab-sample-application");
export class SharedTreeTask extends sf.objectAlpha(
"Task",
{
title: sf.required(sf.string, {
title: sf.requiredAlpha(sf.string, {
metadata: {
description: `The title of the task.`,
},
}),
id: sf.identifier,
description: sf.required(sf.string, {
description: sf.requiredAlpha(sf.string, {
metadata: {
description: `The description of the task.`,
},
}),
priority: sf.required(sf.string, {
priority: sf.requiredAlpha(sf.string, {
metadata: {
description: `The priority of the task which can ONLY be one of three levels: "Low", "Medium", "High" (case-sensitive).`,
},
}),
complexity: sf.required(sf.number, {
complexity: sf.requiredAlpha(sf.number, {
metadata: {
description: `The complexity of the task as a fibonacci number.`,
},
}),
status: sf.required(sf.string, {
status: sf.requiredAlpha(sf.string, {
metadata: {
description: `The status of the task which can ONLY be one of the following values: "To Do", "In Progress", "Done" (case-sensitive).`,
},
}),
assignee: sf.required(sf.string, {
assignee: sf.requiredAlpha(sf.string, {
metadata: {
description: `The name of the tasks assignee e.g. "Bob" or "Alice".`,
},
Expand All @@ -52,6 +52,9 @@ export class SharedTreeTask extends sf.objectAlpha(
metadata: {
description: `A task that can be assigned to an engineer.`,
},
persistedMetadata: {
"eDiscovery-exclude": "comment",
},
},
) {}

Expand All @@ -60,21 +63,28 @@ export class SharedTreeTaskList extends sf.array("TaskList", SharedTreeTask) {}
export class SharedTreeEngineer extends sf.objectAlpha(
"Engineer",
{
name: sf.required(sf.string, {
name: sf.requiredAlpha(sf.string, {
metadata: {
description: `The name of the engineer.`,
},
}),
id: sf.identifier,
skills: sf.required(sf.string, {
skills: sf.requiredAlpha(sf.string, {
metadata: {
description: `A description of the engineer's skills, which influence what types of tasks they should be assigned to.`,
},
persistedMetadata: {
"eDiscovery-exclude": "comment",
},
}),
maxCapacity: sf.required(sf.number, {
maxCapacity: sf.requiredAlpha(sf.number, {
metadata: {
description: `The maximum capacity of tasks this engineer can handle, measured in task complexity points.`,
},
persistedMetadata: {
"eDiscovery-exclude": "exclude",
"search-exclude": "true",
},
}),
},
{
Expand All @@ -89,23 +99,23 @@ export class SharedTreeEngineerList extends sf.array("EngineerList", SharedTreeE
export class SharedTreeTaskGroup extends sf.objectAlpha(
"TaskGroup",
{
description: sf.required(sf.string, {
description: sf.requiredAlpha(sf.string, {
metadata: {
description: `The description of the task group.`,
},
}),
id: sf.identifier,
title: sf.required(sf.string, {
title: sf.requiredAlpha(sf.string, {
metadata: {
description: `The title of the task group.`,
},
}),
tasks: sf.required(SharedTreeTaskList, {
tasks: sf.requiredAlpha(SharedTreeTaskList, {
metadata: {
description: `The lists of tasks within this task group.`,
},
}),
engineers: sf.required(SharedTreeEngineerList, {
engineers: sf.requiredAlpha(SharedTreeEngineerList, {
metadata: {
description: `The lists of engineers within this task group to whom tasks may be assigned.`,
},
Expand All @@ -121,7 +131,7 @@ export class SharedTreeTaskGroup extends sf.objectAlpha(
export class SharedTreeTaskGroupList extends sf.array("TaskGroupList", SharedTreeTaskGroup) {}

export class SharedTreeAppState extends sf.object("AppState", {
taskGroups: sf.required(SharedTreeTaskGroupList, {
taskGroups: sf.requiredAlpha(SharedTreeTaskGroupList, {
metadata: {
description: `The list of task groups that are being managed by this task management application.`,
},
Expand Down
62 changes: 45 additions & 17 deletions packages/dds/tree/api-report/tree.alpha.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ export interface FieldProps<TCustomMetadata = unknown> {
readonly metadata?: FieldSchemaMetadata<TCustomMetadata>;
}

// @alpha
export interface FieldPropsAlpha<TCustomMetadata = unknown> extends FieldProps<TCustomMetadata> {
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
}

// @public @sealed
export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, out TCustomMetadata = unknown> {
protected constructor(
Expand All @@ -198,13 +203,14 @@ export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types exten

// @alpha @sealed
export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, TCustomMetadata = unknown> extends FieldSchema<Kind, Types, TCustomMetadata> implements SimpleFieldSchema {
protected constructor(kind: Kind, types: Types, annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes, props?: FieldProps<TCustomMetadata>);
protected constructor(kind: Kind, types: Types, annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes, props?: FieldPropsAlpha<TCustomMetadata>);
// (undocumented)
get allowedTypesIdentifiers(): ReadonlySet<string>;
readonly allowedTypesMetadata: AllowedTypesMetadata;
// (undocumented)
readonly annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes;
get annotatedAllowedTypeSet(): ReadonlyMap<TreeNodeSchema, AllowedTypeMetadata>;
get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined;
}

// @alpha @sealed @system
Expand Down Expand Up @@ -443,6 +449,14 @@ export type JsonCompatibleObject<TExtra = never> = {
[P in string]?: JsonCompatible<TExtra>;
};

// @alpha
export type JsonCompatibleReadOnly = string | number | boolean | null | readonly JsonCompatibleReadOnly[] | JsonCompatibleReadOnlyObject;

// @alpha
export type JsonCompatibleReadOnlyObject = {
readonly [P in string]?: JsonCompatibleReadOnly;
};

// @alpha @sealed
export type JsonFieldSchema = {
readonly description?: string | undefined;
Expand Down Expand Up @@ -591,6 +605,11 @@ export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
}

// @alpha @sealed
export interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
}

// @alpha
export const noopValidator: JsonValidator;

Expand Down Expand Up @@ -756,30 +775,33 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde

// @alpha
export class SchemaFactoryAlpha<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactory<TScope, TName> {
arrayAlpha<const Name extends TName, const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): ArrayNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
arrayAlpha<const Name extends TName, const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): ArrayNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
arrayRecursive<const Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): ArrayNodeCustomizableSchemaUnsafe<ScopedSchemaName<TScope, Name>, T, TCustomMetadata>;
static readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha_2<FieldKind_2.Identifier, LeafSchema_2<"string", string> & SimpleLeafNodeSchema_2, TCustomMetadata>;
static readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Identifier, LeafSchema_2<"string", string> & SimpleLeafNodeSchema_2, TCustomMetadata>;
static readonly leaves: readonly [LeafSchema_2<"string", string> & SimpleLeafNodeSchema_2, LeafSchema_2<"number", number> & SimpleLeafNodeSchema_2, LeafSchema_2<"boolean", boolean> & SimpleLeafNodeSchema_2, LeafSchema_2<"null", null> & SimpleLeafNodeSchema_2, LeafSchema_2<"handle", IFluidHandle<unknown>> & SimpleLeafNodeSchema_2];
mapAlpha<Name extends TName, const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): MapNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
mapAlpha<Name extends TName, const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): MapNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
mapRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): MapNodeCustomizableSchemaUnsafe<ScopedSchemaName<TScope, Name>, T, TCustomMetadata>;
objectAlpha<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitAnnotatedFieldSchema>, const TCustomMetadata = unknown>(name: Name, fields: T, options?: SchemaFactoryObjectOptions<TCustomMetadata>): ObjectNodeSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> & {
readonly createFromInsertable: unknown;
};
objectRecursive<const Name extends TName, const T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>, const TCustomMetadata = unknown>(name: Name, t: T, options?: SchemaFactoryObjectOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, System_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & System_Unsafe.InsertableObjectFromSchemaRecordUnsafe<T>, false, T, never, TCustomMetadata> & SimpleObjectNodeSchema<TCustomMetadata> & Pick<ObjectNodeSchema, "fields">;
static readonly optional: {
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Optional, T, TCustomMetadata>;
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldProps_2<TCustomMetadata_1>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Optional, UnannotateImplicitAllowedTypes_2<T_1>, TCustomMetadata_1>;
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined): FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata>;
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldProps_2<TCustomMetadata_1>, "defaultProvider"> | undefined): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T_1>, TCustomMetadata_1>;
};
static readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe_2<FieldKind_2.Optional, T, TCustomMetadata>;
optionalAlpha<const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
static readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata>;
optionalRecursiveAlpha<const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">): FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata>;
static readonly required: {
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Required, T, TCustomMetadata>;
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldProps_2<TCustomMetadata_1>, "defaultProvider"> | undefined): FieldSchemaAlpha_2<FieldKind_2.Required, UnannotateImplicitAllowedTypes_2<T_1>, TCustomMetadata_1>;
<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps_2<TCustomMetadata>, "defaultProvider"> | undefined): FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata>;
<const T_1 extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldProps_2<TCustomMetadata_1>, "defaultProvider"> | undefined): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T_1>, TCustomMetadata_1>;
};
requiredAlpha<const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
scopedFactory<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryAlpha<ScopedSchemaName<TScope, T>, TNameInner>;
}

// @alpha
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends NodeSchemaOptionsAlpha<TCustomMetadata> {
allowUnknownOptionalFields?: boolean;
}

Expand Down Expand Up @@ -822,6 +844,7 @@ export const SharedTreeFormatVersion: {
readonly v1: 1;
readonly v2: 2;
readonly v3: 3;
readonly v4: 4;
};

// @alpha
Expand All @@ -831,7 +854,7 @@ export type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;
export type SharedTreeOptions = Partial<ICodecOptions> & Partial<SharedTreeFormatOptions> & ForestOptions;

// @alpha @sealed
export interface SimpleArrayNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBase<NodeKind.Array, TCustomMetadata> {
export interface SimpleArrayNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Array, TCustomMetadata> {
readonly allowedTypesIdentifiers: ReadonlySet<string>;
}

Expand All @@ -843,12 +866,12 @@ export interface SimpleFieldSchema {
}

// @alpha @sealed
export interface SimpleLeafNodeSchema extends SimpleNodeSchemaBase<NodeKind.Leaf> {
export interface SimpleLeafNodeSchema extends SimpleNodeSchemaBaseAlpha<NodeKind.Leaf> {
readonly leafKind: ValueSchema;
}

// @alpha @sealed
export interface SimpleMapNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBase<NodeKind.Map, TCustomMetadata> {
export interface SimpleMapNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Map, TCustomMetadata> {
readonly allowedTypesIdentifiers: ReadonlySet<string>;
}

Expand All @@ -861,13 +884,18 @@ export interface SimpleNodeSchemaBase<out TNodeKind extends NodeKind, out TCusto
readonly metadata: NodeSchemaMetadata<TCustomMetadata>;
}

// @alpha @sealed @system
export interface SimpleNodeSchemaBaseAlpha<out TNodeKind extends NodeKind, out TCustomMetadata = unknown> extends SimpleNodeSchemaBase<TNodeKind, TCustomMetadata> {
readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined;
}

// @alpha @sealed
export interface SimpleObjectFieldSchema extends SimpleFieldSchema {
readonly storedKey: string;
}

// @alpha @sealed
export interface SimpleObjectNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBase<NodeKind.Object, TCustomMetadata> {
export interface SimpleObjectNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Object, TCustomMetadata> {
readonly fields: ReadonlyMap<string, SimpleObjectFieldSchema>;
}

Expand Down Expand Up @@ -900,7 +928,7 @@ export namespace System_TableSchema {
props: InsertableTreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TPropsSchema>>;
}), true, {
readonly props: TPropsSchema;
readonly id: FieldSchema_2<FieldKind_3.Identifier, LeafSchema_3<"string", string>, unknown>;
readonly id: FieldSchema_2<FieldKind_2.Identifier, LeafSchema_3<"string", string>, unknown>;
}>;
// @system
export type CreateRowOptionsBase<TSchemaFactory extends SchemaFactoryAlpha = SchemaFactoryAlpha, TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes> = OptionsWithSchemaFactory<TSchemaFactory> & OptionsWithCellSchema<TCell>;
Expand All @@ -914,8 +942,8 @@ export namespace System_TableSchema {
props: InsertableTreeFieldFromImplicitField<UnannotateImplicitFieldSchema<TPropsSchema>>;
}), true, {
readonly props: TPropsSchema;
readonly id: FieldSchema_2<FieldKind_3.Identifier, LeafSchema_3<"string", string>, unknown>;
readonly cells: FieldSchema_2<FieldKind_3.Required, TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, TreeMapNode_2<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, MapNodeInsertableData_2<TCellSchema>, true, TCellSchema, undefined>, unknown>;
readonly id: FieldSchema_2<FieldKind_2.Identifier, LeafSchema_3<"string", string>, unknown>;
readonly cells: FieldSchema_2<FieldKind_2.Required, TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, TreeMapNode_2<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, MapNodeInsertableData_2<TCellSchema>, true, TCellSchema, undefined>, unknown>;
}>;
// @system
export function createTableSchema<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TColumnSchema extends ColumnSchemaBase<TInputScope, TCellSchema>, const TRowSchema extends RowSchemaBase<TInputScope, TCellSchema>>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, _cellSchema: TCellSchema, columnSchema: TColumnSchema, rowSchema: TRowSchema): TreeNodeSchemaCore_2<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Table">, NodeKind.Object, true, {
Expand Down
4 changes: 3 additions & 1 deletion packages/dds/tree/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,13 @@ export {
storedEmptyFieldSchema,
type StoredSchemaCollection,
schemaFormatV1,
schemaFormatV2,
LeafNodeStoredSchema,
ObjectNodeStoredSchema,
MapNodeStoredSchema,
decodeFieldSchema,
encodeFieldSchema,
encodeFieldSchemaV1,
encodeFieldSchemaV2,
storedSchemaDecodeDispatcher,
type SchemaAndPolicy,
Multiplicity,
Expand Down
Loading