@resistdesign/voltra
    Preparing search index...

    Class TypeInfoORMService

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

    Implements

    Index

    Constructors

    Methods

    • Parameters

      • typeName: string

        Type name used for field qualification.

      • where: Where

        Structured query to map.

      • OptionalfieldMap: Record<string, string>

        Optional field mapping by type.

      Returns Where

      Mapped structured query.

    • Parameters

      • typeName: string

        Type being listed.

      • Optionalcriteria: SearchCriteria

        Criteria to evaluate.

      Returns boolean

      True when criteria can be evaluated using structured indexing.

    • 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 list routing decision observability events without impacting runtime behavior.

      Parameters

      • typeName: string

        Type being listed.

      • path: "fullText" | "structured" | "fullScanCompare"

        Selected routing path.

      • reason:
            | "fullTextPlan"
            | "structuredEligible"
            | "criteriaWithoutIndexedPath"
            | "indexedPathFailedOrUnsupported"

        Why this path was selected.

      • criteriaCount: number

        Number of criteria considered.

      Returns void

    • 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.

      • indexedFieldCount: number

        Number of indexed fields in the write payload.

      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

      • typeName: string

        Type name for index field resolution.

      • item: Partial<TypeInfoDataItem>

        Item to index.

      • OptionalindexFieldOverride: string | string[]

        Optional override for the index field.

      Returns Promise<void>

      Promise resolved once indexing is complete.

    • 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.

    • 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 old full-text tokens cannot be removed safely.

      Parameters

      Returns Promise<boolean>

      True when reindexing completed.

    • Parameters

      • typeName: string

        Type name for index field resolution.

      • item: Partial<TypeInfoDataItem>

        Item to remove from the index.

      • OptionalindexFieldOverride: string | string[]

        Optional override for the index field.

      Returns Promise<void>

      Promise resolved once removal is complete.

    • Parameters

      • typeName: string

        Type name for field mapping.

      • item: Partial<TypeInfoDataItem>

        Item to remove from the structured index.

      Returns Promise<void>

      Promise resolved once removal is complete.

    • Parameters

      • typeName: string

        Type name for index field resolution.

      • previousItem: Partial<TypeInfoDataItem>

        Previous item state to remove from the index.

      • nextItem: Partial<TypeInfoDataItem>

        Next item state to index.

      • OptionalindexFieldOverride: string | string[]

        Optional override for the index field.

      Returns Promise<void>

      Promise resolved once replacement is complete.

    • 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 full-text fields and indexing a new field set.

      Parameters

      Returns Promise<void>

      Promise resolved when replacement indexing completes.

    • Parameters

      • typeName: string

        Type being listed.

      • Optionalcriteria: SearchCriteria

        Search criteria from list config.

      Returns { indexField: string; mode: "lossy" | "exact"; query: string } | undefined

      Auto full-text search plan for list criteria, if applicable.

    • Parameters

      • typeName: string

        Type name used to resolve the default index field(s).

      • Optionaloverride: string | string[]

        Optional override for the index field.

      Returns string[]

      Resolved full-text index field names.

    • Parameters

      • typeName: string

        Type name used to resolve indexed structured fields.

      Returns Set<string>

      Explicitly indexed structured field names for a type.

    • Parameters

      Returns { mode: "lossy" | "exact"; query: string } | undefined

      Full-text query plan derived from a field criterion.

    • 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.

    • 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.