Hierarchy (view full)

Constructors

Accessors

Methods

  • Execute a simple prompt without requiring a stored AI Prompt entity. This is designed for interactive components that need quick AI responses.

    Parameters

    • systemPrompt: string
    • __namedParameters: {
          userPayload: UserPayload;
      }
    • Optional messages: string
    • Optional preferredModels: string[]
    • Optional modelPower: string
    • Optional responseFormat: string

    Returns Promise<SimplePromptResult>

  • Filters encrypted field values before sending to the API client.

    For each encrypted field in the entity:

    • If AllowDecryptInAPI is true: value passes through unchanged (already decrypted by data provider)
    • If AllowDecryptInAPI is false and SendEncryptedValue is true: re-encrypt and send ciphertext
    • If AllowDecryptInAPI is false and SendEncryptedValue is false: replace with sentinel value

    Parameters

    • entityName: string

      Name of the entity

    • dataObject: Record<string, unknown>

      The data object containing field values

    • contextUser: UserInfo

      User context for encryption operations

    Returns Promise<Record<string, unknown>>

    The filtered data object

  • Maps field names to their GraphQL-safe CodeNames and handles encryption for API responses.

    For encrypted fields coming from raw SQL queries (not entity objects):

    • AllowDecryptInAPI=true: Decrypt the value before sending to client
    • AllowDecryptInAPI=false + SendEncryptedValue=true: Keep encrypted ciphertext
    • AllowDecryptInAPI=false + SendEncryptedValue=false: Replace with sentinel

    Parameters

    • entityName: string

      The entity name

    • dataObject: any

      The data object with field values

    • Optional contextUser: UserInfo

      Optional user context for decryption (required for encrypted fields)

    Returns Promise<any>

    The processed data object

  • Public mutation for regular users to run AI prompts with authentication.

    Parameters

    • promptId: string
    • __namedParameters: AppContext
    • Optional data: string
    • Optional overrideModelId: string
    • Optional overrideVendorId: string
    • Optional configurationId: string
    • Optional skipValidation: boolean
    • Optional templateData: string
    • Optional responseFormat: string
    • Optional temperature: number
    • Optional topP: number
    • Optional topK: number
    • Optional minP: number
    • Optional frequencyPenalty: number
    • Optional presencePenalty: number
    • Optional seed: number
    • Optional stopSequences: string[]
    • Optional includeLogProbs: boolean
    • Optional topLogProbs: number
    • Optional messages: string
    • Optional rerunFromPromptRunID: string
    • Optional systemPromptOverride: string

    Returns Promise<AIPromptRunResult>

  • System user query for running AI prompts with elevated privileges. Requires the

    Parameters

    • promptId: string
    • __namedParameters: AppContext
    • Optional data: string
    • Optional overrideModelId: string
    • Optional overrideVendorId: string
    • Optional configurationId: string
    • Optional skipValidation: boolean
    • Optional templateData: string
    • Optional responseFormat: string
    • Optional temperature: number
    • Optional topP: number
    • Optional topK: number
    • Optional minP: number
    • Optional frequencyPenalty: number
    • Optional presencePenalty: number
    • Optional seed: number
    • Optional stopSequences: string[]
    • Optional includeLogProbs: boolean
    • Optional topLogProbs: number
    • Optional messages: string
    • Optional rerunFromPromptRunID: string
    • Optional systemPromptOverride: string

    Returns Promise<AIPromptRunResult>

    Require System User

    decorator to ensure only system users can access.

  • Optimized RunViewGenericInternal implementation with:

    • Field filtering at source (Fix #7)
    • Improved error handling (Fix #9)

    Parameters

    • provider: DatabaseProviderBase
    • viewInfo: UserViewEntityExtended
    • extraFilter: string
    • orderBy: string
    • userSearchString: string
    • excludeUserViewRunID: string
    • overrideExcludeFilter: string
    • saveViewResults: boolean
    • fields: string[]
    • ignoreMaxRows: boolean
    • excludeDataFromAllPriorViewRuns: boolean
    • forceAuditLog: boolean
    • auditLogDescription: string
    • resultType: string
    • userPayload: UserPayload
    • maxRows: number
    • startRow: number

    Returns Promise<RunViewResult<any>>

  • This routine compares the OldValues property in the input object to the values in the DB that we just loaded. If there are differences, we need to check to see if the client is trying to update any of those fields (e.g. overlap). If there is overlap, we throw an error. If there is no overlap, we can proceed with the update even if the DB Values and the ClientOldValues are not 100% the same, so long as there is no overlap in the specific FIELDS that are different.

    ASSUMES: input object has an OldValues___ property that is an array of Key/Value pairs that represent the old values of the record that the client is trying to update.

    Parameters

    Returns Promise<void>

  • Private

    Internal method that handles the core AI prompt execution logic. This method is called by both the regular and system user resolvers.

    Parameters

    • p: DatabaseProviderBase
    • promptId: string
    • userPayload: UserPayload
    • Optional data: string
    • Optional overrideModelId: string
    • Optional overrideVendorId: string
    • Optional configurationId: string
    • Optional skipValidation: boolean
    • Optional templateData: string
    • Optional responseFormat: string
    • Optional temperature: number
    • Optional topP: number
    • Optional topK: number
    • Optional minP: number
    • Optional frequencyPenalty: number
    • Optional presencePenalty: number
    • Optional seed: number
    • Optional stopSequences: string[]
    • Optional includeLogProbs: boolean
    • Optional topLogProbs: number
    • Optional messages: string
    • Optional rerunFromPromptRunID: string
    • Optional systemPromptOverride: string

    Returns Promise<AIPromptRunResult>

  • Private

    Helper method to select a model for simple prompt execution based on preferences or power level

    Parameters

    • preferredModels: string[]
    • modelPower: string
    • contextUser: any

    Returns Promise<AIModelEntityExtended>