Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace plugin

Index

Functions

createImport

  • createImport(mapping: {}, run: Run, row: {}): Promise<Import>
  • When your plugin has a record for a record, send it to this method. We will use the provided mapping against your raw data row to store the original data and mapped data to the record. mapping: an object whose keys are remote columns and whose values are the property keys, ie: {remoteColumnId: 'userId'} row: {email: 'abc@company.com', vip: true}

    Parameters

    • mapping: {}
      • [remoteKey: string]: string
    • run: Run
    • row: {}
      • [remoteKey: string]: any

    Returns Promise<Import>

createImports

  • createImports(mapping: {}, run: Run, rows: {}[]): Promise<Import[]>
  • Like plugin.createImport, but for many imports at once!

    • mapping: an object whose keys are remote columns and whose values are the property keys, ie: {remoteColumnId: 'userId'} rows: Array<{email: 'abc@company.com', vip: true}>

    Parameters

    • mapping: {}
      • [remoteKey: string]: string
    • run: Run
    • rows: {}[]

    Returns Promise<Import[]>

expandDates

  • expandDates(raw: Date): { date: string; iso: string; raw: Date; sql: string; time: string }
  • data helpers

    Parameters

    • raw: Date

    Returns { date: string; iso: string; raw: Date; sql: string; time: string }

    • date: string
    • iso: string
    • raw: Date
    • sql: string
    • time: string

getRecordData

mountModels

  • mountModels(): void
  • This is needed when running in dev mode (TS) but you are using a compiled plugin (JS). The plugin will actually load the JS model while core will be loading the TS model. Both need to be "added" to sequelize to know which connection to use.

    Returns void

readSetting

  • readSetting(pluginName: string, key: string): Promise<Setting>

registerPlugin

registerSetting

  • registerSetting(pluginName: string, key: string, title: string, defaultValue: any, description: string, type: "string" | "number" | "boolean", variant?: string): Promise<Setting>
  • Register a setting for your Grouparoo plugin

    Parameters

    • pluginName: string
    • key: string
    • title: string
    • defaultValue: any
    • description: string
    • type: "string" | "number" | "boolean"
    • variant: string = "info"

    Returns Promise<Setting>

replaceTemplateRecordPropertyIdsWithRecordPropertyKeys

  • replaceTemplateRecordPropertyIdsWithRecordPropertyKeys(string: string, modelId: string): Promise<string>
  • Takes a string with mustache variable (ids) and replaces them with the record property keys ie: select * where id = {{ ppr_abc123 }} => select * where id = {{ userId }}

    Parameters

    • string: string
    • modelId: string

    Returns Promise<string>

replaceTemplateRecordPropertyKeysWithRecordPropertyId

  • replaceTemplateRecordPropertyKeysWithRecordPropertyId(string: string, modelId: string): Promise<string>
  • Takes a string with mustache variable (keys) and replaces them with the record property ids ie: select * where id = {{ userId }} => select * where id = {{ ppr_abc123 }}

    Parameters

    • string: string
    • modelId: string

    Returns Promise<string>

replaceTemplateRecordVariables

  • replaceTemplateRecordVariables(string: string, record: GrouparooRecord, strict?: boolean): Promise<string>
  • Takes a string with mustache variables and replaces them with the proper values for a record

    Parameters

    Returns Promise<string>

replaceTemplateRunVariables

  • replaceTemplateRunVariables(string: string, run?: Run): Promise<any>
  • Takes a string with mustache variables and replaces them with the proper values for a schedule and run

    Parameters

    • string: string
    • Optional run: Run

    Returns Promise<any>

setApmWrap

  • setApmWrap(f: APMWrap): void

updateSetting

  • updateSetting(pluginName: string, key: string, value: any): Promise<Setting>

Generated using TypeDoc