Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace plugin

Index

Functions

  • 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(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: {email: 'abc@company.com', vip: true}[]

    Parameters

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

    Returns Promise<Import[]>

  • 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
  • getOAuthAppAccessToken(providerName: string, refreshToken: string): Promise<string>
  • Returns the access token for an OAuth-based plugin app that uses refresh tokens. Manages cache and expiration of the token. In order to use this, app OAuth access must first be setup by the Grouparoo team.

    Parameters

    • providerName: string

      the name of the provider (e.g. hubspot)

    • refreshToken: string

      the refresh token stored by the app options

    Returns Promise<string>

    the access token

  • getRecordData(record: GrouparooRecord): Promise<{ createdAt: { date: string; iso: string; raw: Date; sql: string; time: string }; now: { date: string; iso: string; raw: Date; sql: string; time: string }; updatedAt: { date: string; iso: string; raw: Date; sql: string; time: string } } & Record<string, string | number | boolean | { date: string; iso: string; raw: Date; sql: string; time: string }>>
  • Takes a record and returns data with the values from the properties and current time.

    Parameters

    Returns Promise<{ createdAt: { date: string; iso: string; raw: Date; sql: string; time: string }; now: { date: string; iso: string; raw: Date; sql: string; time: string }; updatedAt: { date: string; iso: string; raw: Date; sql: string; time: string } } & Record<string, string | number | boolean | { date: string; iso: string; raw: Date; sql: string; time: string }>>

  • 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(pluginName: string, key: string): Promise<Setting>
  • 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(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(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(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(string: string, run?: Run): Promise<string>
  • 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<string>

  • setApmWrap(f: APMWrap): void
  • updateSetting(pluginName: string, key: string, value: any): Promise<Setting>

Generated using TypeDoc