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 profile, 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 profile. mapping: an object whose keys are remote columns and whose values are the profilePropertyRule 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>

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

getLocalFilePath

  • getLocalFilePath(fileGuid: string): Promise<string>
  • Given a fileGuid, download the file to this server and return the readable local path

    Parameters

    • fileGuid: string

    Returns Promise<string>

getProfileData

  • getProfileData(profile: Profile): Promise<{}>
  • Takes a profile and returns data with the values from the properties and current time.

    Parameters

    Returns Promise<{}>

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>
  • Read a setting for this plugin

    Parameters

    • pluginName: string
    • key: string

    Returns Promise<Setting>

registerPlugin

  • Register a Grouparoo Plugin

    Parameters

    Returns void

registerSetting

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

    Parameters

    • pluginName: string
    • key: string
    • title: string
    • defaultValue: any
    • description: string
    • type: typeof settingTypes[number]
    • Default value variant: string = "info"

    Returns Promise<Setting>

replaceTemplateProfilePropertyGuidsWithProfilePropertyKeys

  • replaceTemplateProfilePropertyGuidsWithProfilePropertyKeys(string: string): Promise<string>
  • Takes a string with mustache variable (guids) and replaces them with the profile property keys ie: select * where id = {{ ppr_abc123 }} => select * where id = {{ userId }}

    Parameters

    • string: string

    Returns Promise<string>

replaceTemplateProfilePropertyKeysWithProfilePropertyGuid

  • replaceTemplateProfilePropertyKeysWithProfilePropertyGuid(string: string): Promise<string>
  • Takes a string with mustache variable (keys) and replaces them with the profile property guids ie: select * where id = {{ userId }} => select * where id = {{ ppr_abc123 }}

    Parameters

    • string: string

    Returns Promise<string>

replaceTemplateProfileVariables

  • replaceTemplateProfileVariables(string: string, profile: Profile): Promise<string>
  • Takes a string with mustache variables and replaces them with the proper values for a profile

    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>

updateSetting

  • updateSetting(pluginName: string, key: string, value: any): Promise<Setting>
  • Update a setting for this plugin

    Parameters

    • pluginName: string
    • key: string
    • value: any

    Returns Promise<Setting>

Generated using TypeDoc