diff --git a/packages/database/src/crossAppContracts.ts b/packages/database/src/crossAppContracts.ts index f5c3185f5..c1bf4268a 100644 --- a/packages/database/src/crossAppContracts.ts +++ b/packages/database/src/crossAppContracts.ts @@ -4,6 +4,9 @@ import { Enums, type Json } from "./dbTypes"; // An identifier for objects in the platform. Expected to be unique within the platform. export type LocalId = string; +// A composite identifier for objects in other spaces. +export type Rid = string; + // Common attributes for most types export type CrossAppBase = { localId: LocalId; @@ -76,3 +79,12 @@ export type CrossAppNode = CrossAppBase & { full?: InlineCrossAppTypedContent; }; }; + +// A relation instance +export type CrossAppRelation = CrossAppBase & { + relationType: LocalId; + /* eslint-disable @typescript-eslint/no-duplicate-type-constituents */ + source: LocalId | Rid; + destination: LocalId | Rid; + /* eslint-enable @typescript-eslint/no-duplicate-type-constituents */ +};