# Class Plugin

Plugin Class

- Defined in packages/saltcorn-data/models/plugin.ts:26

##### Index

### Constructors

constructor

### Properties

configuration?
deploy_private_key?
description?
documentation_link?
has_auth?
has_theme?
id?
location
name
source
unsafe?
version?

### Methods

delete
dependant_views
ready_for_mobile
upgrade_version
upsert
find
findOne
get_cached_plugins
is_fixed_plugin
read_local_store_entries
store_by_name
store_plugins_available
store_plugins_available_from_store

## Constructors

### constructor

- new Plugin(o: Plugin | PluginCfg): Plugin

  Plugin constructor

  #### Parameters

  - o: Plugin | PluginCfg

  #### Returns Plugin

  - Defined in packages/saltcorn-data/models/plugin.ts:44

## Properties

### `Optional` configuration

configuration?: any

- Defined in packages/saltcorn-data/models/plugin.ts:32

### `Optional` deploy_private_key

deploy_private_key?: string

- Defined in packages/saltcorn-data/models/plugin.ts:38

### `Optional` description

description?: string

- Defined in packages/saltcorn-data/models/plugin.ts:34

### `Optional` documentation_link

documentation_link?: string

- Defined in packages/saltcorn-data/models/plugin.ts:31

### `Optional` has_auth

has_auth?: boolean

- Defined in packages/saltcorn-data/models/plugin.ts:36

### `Optional` has_theme

has_theme?: boolean

- Defined in packages/saltcorn-data/models/plugin.ts:35

### `Optional` id

id?: number

- Defined in packages/saltcorn-data/models/plugin.ts:27

### location

location: string

- Defined in packages/saltcorn-data/models/plugin.ts:28

### name

name: string

- Defined in packages/saltcorn-data/models/plugin.ts:29

### source

source: PluginSourceType

- Defined in packages/saltcorn-data/models/plugin.ts:33

### `Optional` unsafe

unsafe?: boolean

- Defined in packages/saltcorn-data/models/plugin.ts:37

### `Optional` version

version?: string | number

- Defined in packages/saltcorn-data/models/plugin.ts:30

## Methods

### delete

- delete(): Promise<void>

  Delete plugin

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/plugin.ts:105

### dependant_views

- dependant_views(): Promise<string[]>

  List of views relay on this plugin

  #### Returns Promise<string[]>

  - Defined in packages/saltcorn-data/models/plugin.ts:138

### ready_for_mobile

- ready_for_mobile(): boolean

  #### Returns boolean

  - Defined in packages/saltcorn-data/models/plugin.ts:155

### upgrade_version

- upgrade_version(
  requirePlugin: (arg0: Plugin, arg1: boolean) => Plugin,
  newVersion?: string,
  ): Promise<void>

  Upgrade plugin version

  #### Parameters

  - requirePlugin: (arg0: Plugin, arg1: boolean) => Plugin
  - `Optional` newVersion: string

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/plugin.ts:117

### upsert

- upsert(): Promise<void>

  Update or Insert plugin

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/plugin.ts:84

### `Static` find

- find(where?: Where): Promise<Plugin[]>

  Find plugins

  #### Parameters

  - `Optional` where: Where

    where object

  #### Returns Promise<Plugin[]>

  returns plugins list

  - Defined in packages/saltcorn-data/models/plugin.ts:74

### `Static` findOne

- findOne(where: Where): Promise<Plugin | null>

  Find one plugin

  #### Parameters

  - where: Where

    where object

  #### Returns Promise<Plugin | null>

  return existing plugin or new plugin

  - Defined in packages/saltcorn-data/models/plugin.ts:64

### `Static` get_cached_plugins

- get_cached_plugins(): Plugin[]

  #### Returns Plugin[]

  - Defined in packages/saltcorn-data/models/plugin.ts:163

### `Static` is_fixed_plugin

- is_fixed_plugin(name: string): boolean

  check if plugin is base-plugin or sbadmin2

  #### Parameters

  - name: string

  #### Returns boolean

  - Defined in packages/saltcorn-data/models/plugin.ts:302

### `Static` read_local_store_entries

- read_local_store_entries(): Promise<any>

  #### Returns Promise<any>

  - Defined in packages/saltcorn-data/models/plugin.ts:170

### `Static` store_by_name

- store_by_name(name: string, endpoint?: string): Promise<Plugin | null>

  #### Parameters

  - name: string
  - `Optional` endpoint: string

  #### Returns Promise<Plugin | null>

  - Defined in packages/saltcorn-data/models/plugin.ts:278

### `Static` store_plugins_available

- store_plugins_available(msgs?: string[]): Promise<Plugin[]>

  List plugins available in store

  #### Parameters

  - `Optional` msgs: string[]

    optional packages/plugins-loader/plugin_installer.jsmessages array

  #### Returns Promise<Plugin[]>

  - Defined in packages/saltcorn-data/models/plugin.ts:183

### `Static` store_plugins_available_from_store

- store_plugins_available_from_store(endpoint?: string): Promise<Plugin[]>

  #### Parameters

  - `Optional` endpoint: string

  #### Returns Promise<Plugin[]>

  - Defined in packages/saltcorn-data/models/plugin.ts:250