@resistdesign/voltra
    Preparing search index...

    Class TypeInfoORMService

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

    Implements

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

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

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

    • Parameters

      • typeName: string

        Type name used to look up TypeInfo.

      • item: Partial<TypeInfoDataItem>

        Item to clean.

      • OptionaldacFieldResources: Partial<Record<string, DACAccessResult>>

        Optional DAC field resource map.

      • OptionalselectedFields: string[]

        Optional selected fields to include.

      Returns Partial<TypeInfoDataItem>

      Cleaned item with selected fields and DAC constraints applied.

    • 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

        Optional override for the index field.

      Returns Promise<void>

      Promise resolved once indexing is complete.

    • Parameters

      • typeName: string

        Type name for field mapping.

      • item: Partial<TypeInfoDataItem>

        Item to index.

      Returns Promise<void>

      Promise resolved once indexing is complete.

    • List items of the given type, with the given criteria.

      Parameters

      • typeName: string

        Type name to list.

      • config: ListItemsConfig

        List configuration and criteria.

      • OptionalselectedFields: string[]

        Optional fields to select.

      • Optionalcontext: TypeInfoORMContext

      Returns Promise<ListItemsResults<Partial<TypeInfoDataItem>>>

      List results with items and cursor.

    • List related items for the relationship origin.

      Parameters

      • config: ListRelationshipsConfig

        Relationship list configuration.

      • OptionalselectedFields: string[]

        Optional fields to select on related items.

      • Optionalcontext: TypeInfoORMContext

      Returns Promise<{ cursor: string | undefined; items: Partial<TypeInfoDataItem>[] }>

      Items and cursor for related items.

    • List the relationships for a given item.

      Parameters

      • config: ListRelationshipsConfig

        Relationship list configuration.

      • Optionalcontext: TypeInfoORMContext

      Returns Promise<ListItemsResults<ItemRelationshipInfo>>

      Relationship items and paging 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.

    • Parameters

      • typeName: string

        Type name for index field resolution.

      • item: Partial<TypeInfoDataItem>

        Item to remove from the index.

      • OptionalindexFieldOverride: 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

        Optional override for the index field.

      Returns Promise<void>

      Promise resolved once replacement is complete.

    • Parameters

      • typeName: string

        Type name used to resolve the default index field.

      • Optionaloverride: string

        Optional override for the index field.

      Returns string | undefined

      Resolved index field name, if available.

    • 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

      • typeName: string

        Type name to update.

      • item: TypeInfoDataItem

        Item payload to update.

      • Optionalcontext: TypeInfoORMContext

      Returns Promise<boolean>

      True when the update succeeded.

    • Parameters

      • typeName: string

        Type name to validate.

      • item: TypeInfoDataItem

        Item to validate.

      • typeOperation: TypeOperation

        Operation being validated.

      • OptionalitemIsPartial: boolean

        Whether the item is a partial update.

      Returns void

      Nothing (throws on invalid items).

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