Skip to content
Draft
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions packages/database/src/crossAppContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,20 @@ export type CrossAppEmbedding = {
embedding?: Enums<"EmbeddingName">;
};

// An inline document, to put inside Content (or Concept)
export type InlineCrossAppDocument = Partial<CrossAppBase> & {
// MIME type
contentType: string;
};

// A Content object. It can be put inline inside a concept.
// Missing CrossAppBase attributes are inferred from enclosing object.
export type InlineCrossAppContent = Partial<CrossAppBase> & {
value: string;
embedding?: CrossAppEmbedding;
scale?: Enums<"Scale">;
partOf?: Ref;
document?: InlineCrossAppDocument;
contentType?: ContentType;
};

Expand All @@ -89,6 +97,8 @@ export type CrossAppNode = CrossAppBase & {
direct: InlineCrossAppContent;
full: InlineCrossAppTypedContent;
};
// This is a way to define document globally for all contents
document?: InlineCrossAppDocument;
};

// A relation instance
Expand Down