@resistdesign/voltra
    Preparing search index...

    Class TypeInfoORMService

    TypeInfo-driven ORM service with optional DAC and indexing integrations.

    Implements

    Index

    Constructors

    Methods

    • Parameters

      • relationshipOriginatingItem: ItemRelationshipOriginatingItemInfo

        Relationship originating item used for cleanup.

      Returns Promise<void>

      Promise resolved once cleanup is complete.

    • Create a new item of the given type.

      Parameters

      • typeName: string

        Type name to create.

      • item: TypeInfoDataItem

        Item payload to create.

      Returns Promise<any>

      Primary field value for the created item.

    • Create a new relationship between two items.

      Parameters

      • relationshipItem: BaseItemRelationshipInfo

        Relationship item to create.

        When DAC is enabled and getOwnerPrefix is configured, relationship creation requires:

        1. relationship permission on the relationship resource path, and
        2. endpoint ownership permission for both from and to items.
      • Optionalcontext: TypeInfoORMContext

      Returns Promise<boolean>

      True when the relationship was created.

    • Parameters

      • Optionalcursor: string

        Cursor from list config.

      Returns number

      Decoded offset for full-scan compare pagination.

    • Delete an existing item of the given type.

      Parameters

      • typeName: string

        Type name to delete.

      • primaryFieldValue: any

        Primary field value to delete.

      • Optionalcontext: TypeInfoORMContext

      Returns Promise<boolean>

      True when the delete succeeded.

    • Delete a relationship between two items.

      Parameters

      • relationshipItem: BaseItemRelationshipInfo

        Relationship item to delete.

        When DAC is enabled and getOwnerPrefix is configured, relationship deletion requires:

        1. relationship permission on the relationship resource path, and
        2. endpoint ownership permission for both from and to items.
      • Optionalcontext: TypeInfoORMContext

      Returns Promise<DeleteRelationshipResults>

      Deletion results including whether items remain.

    • Emit structured index write observability events without impacting behavior.

      Parameters

      • typeName: string

        Type being indexed.

      • docId: string

        Indexed document id.

      • action: "upsert" | "remove"

        Structured indexing action.

      • fieldCount: number

        Number of indexed fields in the write payload.

      Returns void

    • Emit list routing decision observability events without impacting runtime behavior.

      Parameters

      • typeName: string

        Type being listed.

      • path: "indexed" | "fullScanCompare" | "canonicalDriverList"

        Selected routing path.

      • reason:
            | "indexedExpression"
            | "noCriteria"
            | "criteriaWithoutIndexedPath"
            | "indexedPathFailedOrUnsupported"

        Why this path was selected.

      • criteriaCount: number

        Number of criteria considered.

      • Optionalplan: IndexSearchDiagnostics

      Returns void

    • Parameters

      • offset: number

        Next offset in filtered/sorted results.

      Returns string

      Encoded cursor for full-scan compare pagination.

    • Parameters

      • typeName: string

        Type name used to look up TypeInfo.

      • OptionalselectedFields: string[]

        Optional selected fields to include.

      Returns string[] | undefined

      Sanitized selected fields or undefined for all fields.

    • Parameters

      • value: unknown

        Value to check.

      Returns value is WhereValue

      True when the value is a supported structured value.

    • Execute a criteria list via full scan + in-memory compare.

      This is the universal fallback strategy for criteria/operators that are not supported by indexed query planners.

      Parameters

      • typeName: string

        Type name to list.

      • config: ListItemsConfig

        Original list config.

      • cleanSelectedFields: string[] | undefined

        Selected fields for cleaned response.

      • useDAC: boolean

        Whether DAC checks are enabled.

      • Optionalcontext: TypeInfoORMContext

        Optional request context.

      Returns Promise<ListItemsResults<Partial<TypeInfoDataItem>>>

      List results with cursor.

    • Parameters

      • typeName: string
      • action:
            | { fields?: string[]; next: Partial<TypeInfoDataItem>; type: "index" }
            | {
                fields?: string[];
                previous: Partial<TypeInfoDataItem>;
                type: "remove";
            }
            | {
                next: Partial<TypeInfoDataItem>;
                nextFields?: string[];
                previous: Partial<TypeInfoDataItem>;
                previousFields?: string[];
                type: "replace";
            }

      Returns Promise<void>

      Promise resolved once indexing is complete.

    • Read an existing item of the given type.

      Parameters

      • typeName: string

        Type name to read.

      • primaryFieldValue: any

        Primary field value to fetch.

      • OptionalselectedFields: string[]

        Optional fields to select.

      • Optionalcontext: TypeInfoORMContext

      Returns Promise<Partial<TypeInfoDataItem>>

      Cleaned item data.

    • Reindex the current stored item using the configured driver.

      When no previous snapshot is supplied, the current stored item is used for both removal and indexing to refresh existing postings without duplication. Supply previousItem when an out-of-band update changed indexed field values, otherwise stale index entries cannot be removed safely.

      Parameters

      Returns Promise<boolean>

      True when reindexing completed.

    • Replace one indexed item snapshot with another.

      Use this when an existing stored item changed outside TypeInfoORMService or when a schema/config change requires removing old indexed fields and indexing a new field set.

      Parameters

      Returns Promise<void>

      Promise resolved when replacement indexing completes.

    • Resolve deterministic, deduplicated fields for mutation operations.

      Parameters

      • typeName: string
      • Optionaloverride: string[]

      Returns string[]

    • Resolve one globally ordered value capability.

      Parameters

      • typeName: string
      • sortFields: SortField[] | undefined

      Returns { field: string; optional?: boolean; reverse?: boolean } | undefined

    • Update an existing item of the given type.

      This update will always act as a patch. Use null to signify the deletion of a field. Assign values to all fields to perform a replacement.

      The item must always contain its primary field value.

      Parameters

      Returns Promise<boolean>

      True when the update succeeded.

    • Validate a delete operation against only the item's primary field.

      Delete receives an identity, not a complete item. The primary field still needs its normal operation and value validation, but unrelated required fields must not participate.

      Parameters

      • typeName: string
      • primaryFieldValue: any

      Returns void

    • Parameters

      • typeName: string

        Type name to validate for read.

      • OptionalselectedFields: string[]

        Optional selected fields to validate.

      Returns void

      Nothing (throws on invalid operations).

    • Parameters

      • relationshipItem: ItemRelationshipInfoType

        Relationship item to validate.

      • omitFields: ItemRelationshipInfoKeys[]

        Relationship fields to omit from validation.

      Returns void

      Nothing (throws on invalid relationships).

    Properties

    ORM service configuration.