# Variable pack

pack: {
add_to_menu: (
item: {
label: string;
min_role: number;
pagename?: string;
type: "View" | "Page";
viewname?: string;
},
) => Promise<void>;
can_install_pack: (
pack: Pack,
) => Promise<true | { error?: string; warning?: string }>;
create_pack_from_tag: (tag: Tag) => Promise<any>;
event_log_pack: (eventLog: EventLog) => Promise<EventLogPack>;
fetch_available_packs: () => Promise<{ name: string }[]>;
fetch_pack_by_name: (
name: string,
) => Promise<{ name: string; pack: any } | null>;
get_cached_packs: () => { name: string }[];
install_pack: (
pack: Pack,
name: string | undefined,
loadAndSaveNewPlugin: (arg0: Plugin) => void,
bare_tables?: boolean,
) => Promise<void>;
library_pack: (name: string) => Promise<LibraryCfg>;
model_instance_pack: (
instanceName: string,
modelName: string,
tableName: string,
) => Promise<ModelInstancePack>;
model_pack: (name: string, tableName: string) => Promise<ModelPack>;
page_group_pack: (name: string) => Promise<PageGroupPack>;
page_pack: (name: string | Page) => Promise<PagePack>;
plugin_pack: (name: string) => Promise<PluginCfg>;
role_pack: (role: string) => Promise<AbstractRole>;
table_pack: (nameOrTable: string | Table) => Promise<TablePack>;
tag_pack: (name: string | Tag) => Promise<TagPack>;
trigger_pack: (name: string | Trigger) => Promise<TriggerCfg>;
uninstall_pack: (pack: Pack, name?: string) => Promise<void>;
view_pack: (name: string | View) => Promise<ViewPack>;
}

#### Type Declaration

- ##### add_to_menu: (
  item: {
  label: string;
  min_role: number;
  pagename?: string;
  type: "View" | "Page";
  viewname?: string;
  },
  ) => Promise<void>

- ##### can_install_pack: (pack: Pack) => Promise<true | { error?: string; warning?: string }>

  Can install pock

- ##### create_pack_from_tag: (tag: Tag) => Promise<any>

- ##### event_log_pack: (eventLog: EventLog) => Promise<EventLogPack>

  the userId gets replaced with userName no lookup by name because either all eventlogs or none are packed

- ##### fetch_available_packs: () => Promise<{ name: string }[]>

  Fetch available packs from the store endpoint (packs_store_endpoint cfg)

- ##### `Function` fetch_pack_by_name: (name: string) => Promise<{ name: string; pack: any } | null>

  Fetch pack by name

- ##### get_cached_packs: () => { name: string }[]

  Get cached packs

- ##### install_pack: (
  pack: Pack,
  name: string | undefined,
  loadAndSaveNewPlugin: (arg0: Plugin) => void,
  bare_tables?: boolean,
  ) => Promise<void>

- ##### `Function` library_pack: (name: string) => Promise<LibraryCfg>

  Library pack

- ##### model_instance_pack: (
  instanceName: string,
  modelName: string,
  tableName: string,
  ) => Promise<ModelInstancePack>

  the modelId gets replaced with modelName + tableName

- ##### model_pack: (name: string, tableName: string) => Promise<ModelPack>

  tableIds are replace by names

- ##### page_group_pack: (name: string) => Promise<PageGroupPack>

  Page group pack (page_id is replaced by page_name)

- ##### page_pack: (name: string | Page) => Promise<PagePack>

  Page Pack

- ##### plugin_pack: (name: string) => Promise<PluginCfg>

  Plugin pack

- ##### `Function` role_pack: (role: string) => Promise<AbstractRole>

  Role pack

- ##### `Function` table_pack: (nameOrTable: string | Table) => Promise<TablePack>

  Table Pack

- ##### tag_pack: (name: string | Tag) => Promise<TagPack>

  'page/view/table/trigger' ids are replaced by names

- ##### trigger_pack: (name: string | Trigger) => Promise<TriggerCfg>

  Trigger pack

- ##### uninstall_pack: (pack: Pack, name?: string) => Promise<void>

  Uninstall pack

- ##### view_pack: (name: string | View) => Promise<ViewPack>

  View Pack

- Defined in models/pack.ts:954