Options
All
  • Public
  • Public/Protected
  • All
Menu

Module schema

Index

Type aliases

FieldTypeName

FieldTypeName: "String" | "Boolean" | "Number" | "SimpleSchema.Integer" | "Array" | "Object" | "JSON" | "Date"

VulcanCoreInput

VulcanCoreInput: StandardFieldInput | AdvancedFieldInput

VulcanFieldInput

VulcanFieldInput: VulcanCoreInput | string | any

VulcanFieldSchemaServer

VulcanFieldSchemaServer<TField>: VulcanFieldSchema<TField> & VulcanFieldServer<TField>

Type parameters

  • TField = any

VulcanFieldSchemaShared

VulcanFieldSchemaShared<TField>: VulcanFieldSchema<TField> & VulcanFieldShared<TField>

Type parameters

  • TField = any

VulcanFieldType

VulcanFieldType: SchemaDefinition<any>["type"] | VulcanFieldSchema

VulcanSchema

VulcanSchema<TSchemaFieldExtension>: {}

Type parameters

  • TSchemaFieldExtension = AnyObject

Type declaration

VulcanSchemaServer

VulcanSchemaServer<TSchemaFieldExtension>: {}
server-only

Type parameters

  • TSchemaFieldExtension = AnyObject

Type declaration

Functions

Const forEachDocumentField

  • forEachDocumentField(document: VulcanDocument, schema: VulcanSchema<AnyObject>, callback: (input: ForEachFieldInput) => void, currentPath?: string): void
  • Iterate over a document fields and run a callback with side effect Works recursively for nested fields and arrays of objects (but excluding blackboxed objects, native JSON, and arrays of native values)

    Parameters

    • document: VulcanDocument

      Current document

    • schema: VulcanSchema<AnyObject>

      Document schema

    • callback: (input: ForEachFieldInput) => void

      Called on each field with the corresponding field schema, including fields of nested objects and arrays of nested object

        • (input: ForEachFieldInput): void
        • Parameters

          • input: ForEachFieldInput

          Returns void

    • currentPath: string = ""

      Global path of the document (to track recursive calls)

    Returns void

Const getAllowedValues

  • getAllowedValues(field: any): any
  • Parameters

    • field: any

    Returns any

Const getArrayChild

  • Parameters

    Returns VulcanFieldSchema<any>

Const getArrayChildSchema

  • getArrayChildSchema(fieldName: any, schema: any): VulcanSchema<AnyObject>
  • Parameters

    • fieldName: any
    • schema: any

    Returns VulcanSchema<AnyObject>

Const getCreateableFields

  • getCreateableFields(schema: any): string[]
  • Parameters

    • schema: any

    Returns string[]

Const getFieldTypeName

Const getFragmentFieldNames

  • getFragmentFieldNames(__namedParameters: Object): string[]
  • Parameters

    • __namedParameters: Object

    Returns string[]

Const getNestedSchema

Const getReadableFields

  • getReadableFields(schema: any): string[]
  • Get all readable fields of a schema

    // NOTE: this include fields that should'n't go into the default fragment (pure virtual fields and resolved fields) // use getFragmentFieldNames for fragments

    Parameters

    • schema: any

    Returns string[]

Const getUpdateableFields

  • getUpdateableFields(schema: any): string[]
  • Parameters

    • schema: any

    Returns string[]

Const getValidFields

  • getValidFields(schema: any): string[]
  • Parameters

    • schema: any

    Returns string[]

Const hasAllowedValues

  • hasAllowedValues(field: any): boolean
  • Parameters

    • field: any

    Returns boolean

Const hasArrayChild

  • hasArrayChild(fieldName: string, schema: VulcanSchema<AnyObject>): boolean
  • Parameters

    Returns boolean

Const hasArrayNestedChild

  • hasArrayNestedChild(fieldName: any, schema: any): boolean
  • Parameters

    • fieldName: any
    • schema: any

    Returns boolean

Const hasNestedSchema

  • Parameters

    Returns boolean

Const isArrayChildField

  • isArrayChildField(fieldName: any): boolean
  • Parameters

    • fieldName: any

    Returns boolean

Const isBlackbox

  • Parameters

    Returns boolean

Const shouldAddOriginalField

  • Parameters

    Returns boolean

Const toSimpleSchema

  • toSimpleSchema(schema: VulcanSchema<AnyObject>): SimpleSchema
  • Convert the Vulcan schema to an evaluated schema Calling new SimpleSchema around a Vulcan is not sufficient We also need to call it for children fields

    /!\ Supports only one level of nesting

    Parameters

    Returns SimpleSchema

Const unarrayfyFieldName

  • unarrayfyFieldName(fieldName: any): any
  • Parameters

    • fieldName: any

    Returns any

Generated using TypeDoc