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, request: any, user: BaseUser): Promise<Document[]>
  • Retrieve Documents based on provided query parameters

    Parameters

    • documentClass: Function

      The Document definition

    • request: any

      The requested operation

    • user: BaseUser

    Returns Promise<Document[]>

    The created Document instances

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

    Parameters

    • documentClass: Function

      The Document definition

    • request: any

      The requested operation

    • user: BaseUser

    Returns Promise<Document[]>

    The created Document instances

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

    Parameters

    • documentClass: Function

      The Document definition

    • request: any

      The requested operation

    • user: BaseUser

    Returns Promise<Document[]>

    The updated Document instances

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

    Parameters

    • documentClass: Function

      The Document definition

    • request: any

      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>

  • _getEmbeddedDocuments(documentClass: any, parent: any, request: any, user: any): Promise<void>
  • Get embedded Document instances

    Parameters

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

    Returns Promise<void>

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

    Parameters

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

    Returns Promise<Document[]>

  • _createEmbeddedDocuments(documentClass: any, parent: any, request: any, user: any): Promise<Document[]>
  • Create embedded Document instances

    Parameters

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

    Returns Promise<Document[]>

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

    Parameters

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

    Returns Promise<Document[]>

  • _updateEmbeddedDocuments(documentClass: any, parent: any, request: any, user: any): Promise<Document[]>
  • Update embedded Document instances

    Parameters

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

    Returns Promise<Document[]>

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

    Parameters

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

    Returns Promise<Document[]>

  • _deleteEmbeddedDocuments(documentClass: any, parent: any, request: any, user: any): Promise<Document[]>
  • Delete embedded Document instances

    Parameters

    • documentClass: any
    • parent: any
    • request: 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(request?: { query: any; options: any; pack: string }): { query: any; options: any; pack: string }
  • Validate the arguments passed to the get operation

    Parameters

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

      The requested operation

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

    Returns { query: any; options: any; pack: string }

    • query: any
    • options: any
    • pack: string
  • _getParent(request: any): Promise<Document>
  • Get the parent Document (if any) associated with a request

    Parameters

    • request: any

      The requested operation

    Returns Promise<Document>

    The parent Document, or null

  • _createArgs(request?: { data: any[]; options: any; pack: string }): { data: any[]; options: any; pack: string }
  • Validate the arguments passed to the create operation

    Parameters

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

      The requested operation

      • data: any[]

        An array of document data

      • options: any
      • pack: string

    Returns { data: any[]; options: any; pack: string }

    • data: any[]
    • options: any
    • pack: string
  • _updateArgs(request?: { updates: any[]; options: any; pack: string }): { updates: any[]; options: any; pack: string }
  • Validate the arguments passed to the update operation

    Parameters

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

      The requested operation

      • updates: any[]

        An array of document data

      • options: any
      • pack: string

    Returns { updates: any[]; options: any; pack: string }

    • updates: any[]
    • options: any
    • pack: string
  • _deleteArgs(request?: { ids: string[]; options: any; pack: string }): { ids: string[]; options: any; pack: string }
  • Validate the arguments passed to the delete operation

    Parameters

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

      The requested operation

      • ids: string[]

        An array of document ids

      • options: any
      • pack: string

    Returns { ids: string[]; options: any; pack: string }

    • ids: string[]
    • options: any
    • pack: string
  • _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