Documentation
    Preparing search index...

    Plugin Class

    Implements

    Index

    Constructors

    Properties

    configuration?: any
    contents?: string
    deploy_private_key?: string
    description?: string
    documentation_link?: string
    has_auth?: boolean
    has_theme?: boolean
    id?: number
    location: string
    name: string
    unsafe?: boolean
    version?: string | number

    Accessors

    Methods

    • Upgrade plugin version

      Parameters

      • requirePlugin: (arg0: Plugin, arg1: boolean) => Plugin
      • OptionalnewVersion: string

      Returns Promise<void>

    • Check the saltcorn engine property and change the plugin version if necessary

      Parameters

      • plugin: Plugin

        plugin to validate; plugin.version may be mutated

      • OptionalforceFetch: boolean

        bypass the engine-info cache when checking versions

      Returns Promise<void>

    • Return cached engine constraint metadata for a plugin, fetching from npm if needed

      Parameters

      • plugin: Plugin

        plugin whose npm location is queried

      • OptionalforceFetch: boolean

        bypass the cache and re-fetch from npm

      Returns Promise<any>

      map of { version: { engines?: { saltcorn: string } } }

    • Load all plugins from the database into state

      Parameters

      • Optionalforce: boolean

        passed through to loadPlugin for each plugin

      • reloadModule: boolean = false

        force fresh module loads for each plugin

      Returns Promise<void>

    • Load plugin and its dependencies and save into local installation

      Parameters

      • plugin: Plugin

        plugin to install

      • Optionalforce: boolean

        force reinstall; retries after removing the install dir on failure

      • OptionalnoSignalOrDB: boolean

        skip database upsert and processSend signal (e.g. during restore)

      • __: (str: string, ...args: any[]) => string = ...

        i18n translation function for user-facing messages

      • OptionalallowUnsafeOnTenantsWithoutConfigSetting: boolean

        allow unsafe plugins on tenants without the global config flag

      • OptionaloverwriteDependencies: Record<string, string>

        substitute local paths for dependencies; testing only

      Returns Promise<string[] | undefined>

      warning/info messages collected during install, or undefined if skipped

    • Load one plugin and register in state (without DB save)

      Parameters

      • plugin: Plugin

        plugin to load

      • Optionalforce: boolean

        remove the install directory and retry on registration failure

      • OptionalforceFetch: boolean

        bypass the engine-info cache when resolving versions

      • reloadModule: boolean = false

        force a fresh module load even if already cached

      Returns Promise<any>

      PluginInstaller result ({ plugin_module, location, … })

    • Install plugin without registering in state or saving to database

      Parameters

      • plugin: Plugin

        plugin to install

      • Optionalforce: boolean

        force reinstall even if already present

      Returns Promise<any>

      PluginInstaller result ({ plugin_module, location, version, … })

    • List plugins available in store

      Parameters

      • Optionalmsgs: string[]

        optional packages/plugins-loader/plugin_installer.jsmessages array

      Returns Promise<Plugin[]>