Module @saltcorn/data

This is saltcorn data

@saltcorn/data

Data models for saltcorn

If you are a saltcorn user, you probably want to install this package instead: @saltcorn/cli

Namespaces

Properties

Variables

Properties

state: {
    add_tenant: ((t) => void);
    features: {
        aggregation_query: boolean;
        async_validate: boolean;
        bootstrap5: boolean;
        deep_public_plugin_serve: boolean;
        ellipsize: boolean;
        esm_plugins: boolean;
        fieldrepeats_in_field_attributes: boolean;
        get_view_goto: boolean;
        json_state_query: boolean;
        list_builder: boolean;
        no_plugin_fieldview_length_check: boolean;
        prefix_or_in_queries: boolean;
        public_user_role: number;
        serve_static_dependencies: boolean;
        table_undo: boolean;
        version_plugin_serve_path: boolean;
    };
    getAllTenants: (() => Record<string, State>);
    getRootState: (() => State);
    getState: (() => undefined | State);
    getTenant: ((ten) => State);
    get_other_domain_tenant: ((hostname) => string);
    get_process_init_time: (() => Date);
    init_multi_tenant: ((plugin_loader, disableMigrate, tenantList) => Promise<void>);
    process_send: ((v) => void);
    restart_tenant: ((plugin_loader) => Promise<void>);
    set_tenant_base_url: ((tenant_subdomain, value?) => void);
}

Type declaration

  • add_tenant: ((t) => void)
      • (t): void
      • Add tenant to State

        Parameters

        • t: string

        Returns void

  • features: {
        aggregation_query: boolean;
        async_validate: boolean;
        bootstrap5: boolean;
        deep_public_plugin_serve: boolean;
        ellipsize: boolean;
        esm_plugins: boolean;
        fieldrepeats_in_field_attributes: boolean;
        get_view_goto: boolean;
        json_state_query: boolean;
        list_builder: boolean;
        no_plugin_fieldview_length_check: boolean;
        prefix_or_in_queries: boolean;
        public_user_role: number;
        serve_static_dependencies: boolean;
        table_undo: boolean;
        version_plugin_serve_path: boolean;
    }
    • aggregation_query: boolean
    • async_validate: boolean
    • bootstrap5: boolean
    • deep_public_plugin_serve: boolean
    • ellipsize: boolean
    • esm_plugins: boolean
    • fieldrepeats_in_field_attributes: boolean
    • get_view_goto: boolean
    • json_state_query: boolean
    • list_builder: boolean
    • no_plugin_fieldview_length_check: boolean
    • prefix_or_in_queries: boolean
    • public_user_role: number
    • serve_static_dependencies: boolean
    • table_undo: boolean
    • version_plugin_serve_path: boolean
  • getAllTenants: (() => Record<string, State>)
      • (): Record<string, State>
      • Returns all Tenants (from State)

        Returns Record<string, State>

  • getRootState: (() => State)
      • (): State
      • Returns State

  • getState: (() => undefined | State)
      • (): undefined | State
      • Get the state in the current tenant

        Returns undefined | State

        Function

  • getTenant: ((ten) => State)
      • (ten): State
      • Get tenant from State

        Parameters

        • ten: string

        Returns State

  • get_other_domain_tenant: ((hostname) => string)
      • (hostname): string
      • Get tenant that has another domain (not subdomain)

        Parameters

        • hostname: string

        Returns string

  • get_process_init_time: (() => Date)
      • (): Date
      • Get Process Init Time - moment when Saltcorn process was initiated

        Returns Date

  • init_multi_tenant: ((plugin_loader, disableMigrate, tenantList) => Promise<void>)
      • (plugin_loader, disableMigrate, tenantList): Promise<void>
      • Switch to multi_tenant

        Parameters

        • plugin_loader: Function
        • disableMigrate: boolean

          if true then dont migrate db

        • tenantList: string[]

        Returns Promise<void>

  • process_send: ((v) => void)
      • (v): void
      • Parameters

        • v: any

        Returns void

  • restart_tenant: ((plugin_loader) => Promise<void>)
      • (plugin_loader): Promise<void>
      • Restart tenant (means reload of plugins)

        Parameters

        • plugin_loader: Function

        Returns Promise<void>

  • set_tenant_base_url: ((tenant_subdomain, value?) => void)
      • (tenant_subdomain, value?): void
      • Set tenant base url??? From my point of view it just add tenant to list of otherdomaintenant

        Parameters

        • tenant_subdomain: string
        • Optional value: string

          new

        Returns void

web_mobile_commons: {
    get_extra_menu: ((role, __, user?, locale?) => any);
    prepare_insert_row: ((row, fields) => Promise<any>);
    prepare_update_row: ((table, row, id) => Promise<string[]>);
    show_calculated_fieldview: ((req, res, param2) => Promise<any>);
}

Type declaration

  • get_extra_menu: ((role, __, user?, locale?) => any)
      • (role, __, user?, locale?): any
      • Get extra menu

        Parameters

        • role: number
        • __: ((str) => string)

          translation function

            • (str): string
            • Parameters

              • str: string

              Returns string

        • Optional user: User
        • Optional locale: string

        Returns any

        array of extra menu items

  • prepare_insert_row: ((row, fields) => Promise<any>)
      • (row, fields): Promise<any>
      • take a row from a form, and prepare it for a db insert needed for tabulator

        Parameters

        • row: any
        • fields: Field[]

        Returns Promise<any>

  • prepare_update_row: ((table, row, id) => Promise<string[]>)
      • (table, row, id): Promise<string[]>
      • take a row from a form, and prepare it for a db update needed for tabulator

        Parameters

        • table: Table
        • row: any

          output parameter

        • id: number

        Returns Promise<string[]>

  • show_calculated_fieldview: ((req, res, param2) => Promise<any>)
      • (req, res, param2): Promise<any>
      • Parameters

        • req: any

          express or mocked mobile requese

        • res: any

          express or mocked mobile response

        • param2: {
              fieldName: string;
              fieldview: string;
              tableName: string;
          }

          table field and fieldview

          • fieldName: string
          • fieldview: string
          • tableName: string

        Returns Promise<any>

        void and writes to res

Generated using TypeDoc