Options
All
  • Public
  • Public/Protected
  • All
Menu

An interface shared by both the client and server-side which defines how creation, update, and deletion operations are transacted.

abstract
interface
memberof

abstract

Hierarchy

Index

Constructors

Methods

  • get(documentClass: Function, context: any, user: BaseUser): Promise<Document[]>
  • Retrieve Documents based on provided query parameters

    Parameters

    • documentClass: Function

      The Document definition

    • context: any

      Context for the requested operation

    • user: BaseUser

    Returns Promise<Document[]>

    The created Document instances

  • create(documentClass: Function, context: any, user: BaseUser): Promise<Document[]>
  • Perform document creation operations

    Parameters

    • documentClass: Function

      The Document definition

    • context: any

      Context for the requested operation

    • user: BaseUser

    Returns Promise<Document[]>

    The created Document instances

  • update(documentClass: Function, context: any, user: BaseUser): Promise<Document[]>
  • Perform document update operations

    Parameters

    • documentClass: Function

      The Document definition

    • context: any

      Context for the requested operation

    • user: BaseUser

    Returns Promise<Document[]>

    The updated Document instances

  • delete(documentClass: Function, context: any, user: BaseUser): Promise<Document[]>
  • Perform document deletion operations

    Parameters

    • documentClass: Function

      The Document definition

    • context: any

      Context for the requested operation

    • user: BaseUser

    Returns Promise<Document[]>

    The deleted Document instances

  • getFlagScopes(): string[]
  • Describe the scopes which are suitable as the namespace for a flag key

    Returns string[]

  • getCompendiumScopes(): string[]
  • Describe the scopes which are suitable as the namespace for a flag key

    Returns string[]

  • _getDocuments(documentClass: any, request: any, user: any): Promise<void>
  • Get primary Document instances

    Parameters

    • documentClass: any
    • request: any
    • user: any

    Returns Promise<void>

  • _createDocuments(documentClass: any, context: any, user: any): Promise<Document[]>
  • Create primary Document instances

    Parameters

    • documentClass: any
    • context: any
    • user: any

    Returns Promise<Document[]>

  • _updateDocuments(documentClass: any, context: any, user: any): Promise<Document[]>
  • Update primary Document instances

    Parameters

    • documentClass: any
    • context: any
    • user: any

    Returns Promise<Document[]>

  • _deleteDocuments(documentClass: any, context: any, user: any): Promise<Document[]>
  • Delete primary Document instances

    Parameters

    • documentClass: any
    • context: any
    • user: any

    Returns Promise<Document[]>

  • _getLogger(): any
  • Provide the Logger implementation that should be used for database operations

    Returns any

  • _logOperation(action: string, type: string, documents: Document[], __namedParameters?: string): void
  • Log a database operation for an embedded document, capturing the action taken and relevant IDs

    Parameters

    • action: string

      The action performed

    • type: string

      The document type

    • documents: Document[]

      The documents modified

    • __namedParameters: string = {}

    Returns void

  • _logError(user: any, action: any, subject: any, __namedParameters?: { parent: any; pack: any }): string
  • Construct a standardized error message given the context of an attempted operation

    Parameters

    • user: any
    • action: any
    • subject: any
    • __namedParameters: { parent: any; pack: any } = {}
      • parent: any
      • pack: any

    Returns string

  • _getArgs(context?: { query: any; options: any; pack: string }): Promise<{ query: any; options: any; pack: string; parent: Document; parentUuid: any }>
  • Validate the arguments passed to the get operation

    Parameters

    • context: { query: any; options: any; pack: string } = {}

      The requested operation

      • query: any
      • options: any
      • pack: string

    Returns Promise<{ query: any; options: any; pack: string; parent: Document; parentUuid: any }>

  • _getParent(context: any): Promise<Document>
  • Get the parent Document (if any) associated with a request context.

    Parameters

    • context: any

      The requested operation

    Returns Promise<Document>

    The parent Document, or null

  • _createArgs(context?: { data: any[]; options: any; pack: string }): Promise<{ data: any[]; options: any; pack: string; parent: Document; parentUuid: any }>
  • Validate the arguments passed to the create operation

    Parameters

    • context: { data: any[]; options: any; pack: string } = {}

      The requested operation

      • data: any[]

        An array of document data

      • options: any
      • pack: string

    Returns Promise<{ data: any[]; options: any; pack: string; parent: Document; parentUuid: any }>

  • _updateArgs(context?: { updates: any[]; options: any; pack: string }): Promise<{ updates: any[]; options: any; pack: string; parent: Document; parentUuid: any }>
  • Validate the arguments passed to the update operation

    Parameters

    • context: { updates: any[]; options: any; pack: string } = {}

      The requested operation

      • updates: any[]

        An array of document data

      • options: any
      • pack: string

    Returns Promise<{ updates: any[]; options: any; pack: string; parent: Document; parentUuid: any }>

  • _deleteArgs(context?: { ids: string[]; options: any; pack: string }): Promise<{ ids: string[]; options: any; pack: string; parent: Document; parentUuid: any }>
  • Validate the arguments passed to the delete operation

    Parameters

    • context: { ids: string[]; options: any; pack: string } = {}

      The requested operation

      • ids: string[]

        An array of document ids

      • options: any
      • pack: string

    Returns Promise<{ ids: string[]; options: any; pack: string; parent: Document; parentUuid: any }>

  • _logContext(__namedParameters?: { parent: any; pack: any }): string
  • Determine a string suffix for a log message based on the parent and/or compendium context.

    Parameters

    • __namedParameters: { parent: any; pack: any } = {}
      • parent: any
      • pack: any

    Returns string