@cmk/fe_utils
Version:
frontend utility library
379 lines (377 loc) • 12.8 kB
TypeScript
import { EntityJoiningType } from './entity_joinings';
import { EntityListFieldType } from './entity_list_fields';
import { EntityType } from './entities';
import { EntityValueType } from './entity_values';
import { EntityFieldType } from './entitiy_fields';
import { EntityListType } from './entity_lists';
/** An object to initialize the database tables required for the entity data model
* @keys The object's property keys represent the table_name in the database
* @values The object's property values represent the table columns in the database (DatabaseFieldDefinitionType[])
**/
export declare const EntityDataModelTableFieldDefs: {
_entities: import('./databaseDefinitionType').DatabaseFieldDefinitionType[];
_entity_fields: ({
name: "entity_field_id";
data_type: string;
is_id_field: boolean;
required?: undefined;
ui_type?: undefined;
readonly width12?: undefined;
readonly fillWidth?: undefined;
} | {
name: "entity_id";
data_type: string;
required: boolean;
ui_type: string;
readonly is_id_field?: undefined;
readonly width12?: undefined;
readonly fillWidth?: undefined;
} | {
readonly name: "name";
readonly data_type: "varchar";
readonly required: true;
readonly width12: 6;
readonly fillWidth: true;
readonly is_id_field?: undefined;
ui_type?: undefined;
} | {
readonly name: "is_id_field";
readonly data_type: "bool";
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
readonly width12?: undefined;
readonly fillWidth?: undefined;
} | {
readonly name: "data_type";
readonly data_type: "varchar";
readonly required: true;
readonly ui_type: "dropdown";
readonly width12: 6;
readonly is_id_field?: undefined;
readonly fillWidth?: undefined;
} | {
readonly name: "ui_type";
readonly data_type: "varchar";
readonly ui_type: "dropdown";
readonly width12: 6;
readonly is_id_field?: undefined;
required?: undefined;
readonly fillWidth?: undefined;
} | {
readonly name: "options_values_id";
readonly data_type: "integer references _entity_values (entity_values_id)";
readonly ui_type: "dropdown";
readonly width12: 6;
readonly is_id_field?: undefined;
required?: undefined;
readonly fillWidth?: undefined;
} | {
readonly name: "ui_autocomplete_accept_custom_values";
readonly data_type: "bool";
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
readonly width12?: undefined;
readonly fillWidth?: undefined;
} | {
readonly name: "reference_entity_field_id";
readonly data_type: "integer references _entity_fields (entity_field_id)";
readonly ui_type: "dropdown";
readonly width12: 6;
readonly is_id_field?: undefined;
required?: undefined;
readonly fillWidth?: undefined;
} | {
readonly name: "form_label";
readonly data_type: "varchar";
readonly required: true;
readonly is_id_field?: undefined;
ui_type?: undefined;
readonly width12?: undefined;
readonly fillWidth?: undefined;
} | {
readonly name: "layout_width12";
readonly data_type: "integer";
readonly width12: 6;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
readonly fillWidth?: undefined;
} | {
readonly name: "layout_fill_width";
readonly data_type: "bool";
readonly width12: 6;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
readonly fillWidth?: undefined;
} | {
readonly name: "form_sequence";
readonly data_type: "integer";
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
readonly width12?: undefined;
readonly fillWidth?: undefined;
} | {
name: "owner_user_id";
data_type: string;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
readonly width12?: undefined;
readonly fillWidth?: undefined;
} | {
name: "html_project_id";
data_type: string;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
readonly width12?: undefined;
readonly fillWidth?: undefined;
})[];
_entity_lists: ({
readonly name: "entity_list_id";
readonly data_type: "serial PRIMARY KEY";
readonly is_id_field: true;
required?: undefined;
ui_type?: undefined;
} | {
readonly name: "base_entity_id";
readonly data_type: "integer references _entities(entity_id)";
readonly required: true;
readonly ui_type: "dropdown";
readonly is_id_field?: undefined;
} | {
name: "list_label";
data_type: string;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
} | {
name: "list_type";
data_type: string;
ui_type: string;
readonly is_id_field?: undefined;
required?: undefined;
} | {
name: "owner_user_id";
data_type: string;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
} | {
name: "html_project_id";
data_type: string;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
})[];
_entity_list_fields: ({
readonly name: "entity_list_field_id";
readonly data_type: "serial PRIMARY KEY";
readonly is_id_field: true;
ui_type?: undefined;
required?: undefined;
} | {
readonly name: "entity_list_id";
readonly data_type: "integer references _entity_lists(entity_list_id) ";
readonly ui_type: "dropdown";
readonly is_id_field?: undefined;
required?: undefined;
} | {
readonly name: "label";
readonly data_type: "varchar";
readonly required: true;
readonly is_id_field?: undefined;
ui_type?: undefined;
} | {
readonly name: "src_entity_field_id";
readonly data_type: "integer references _entity_fields(entity_field_id) ";
readonly ui_type: "dropdown";
readonly is_id_field?: undefined;
required?: undefined;
} | {
readonly name: "src_be_mapping_fn_name";
readonly data_type: "varchar";
readonly is_id_field?: undefined;
ui_type?: undefined;
required?: undefined;
} | {
readonly name: "is_filtered";
readonly data_type: "bool";
readonly is_id_field?: undefined;
ui_type?: undefined;
required?: undefined;
} | {
readonly name: "is_sortable";
readonly data_type: "bool";
readonly is_id_field?: undefined;
ui_type?: undefined;
required?: undefined;
} | {
readonly name: "is_editable";
readonly data_type: "bool";
readonly is_id_field?: undefined;
ui_type?: undefined;
required?: undefined;
} | {
readonly name: "required_list_field_type";
readonly data_type: "varchar";
readonly required: true;
readonly ui_type: "dropdown";
readonly is_id_field?: undefined;
} | {
readonly name: "list_sequence";
readonly data_type: "integer";
readonly is_id_field?: undefined;
ui_type?: undefined;
required?: undefined;
} | {
name: "owner_user_id";
data_type: string;
readonly is_id_field?: undefined;
ui_type?: undefined;
required?: undefined;
} | {
name: "html_project_id";
data_type: string;
readonly is_id_field?: undefined;
ui_type?: undefined;
required?: undefined;
})[];
_entity_values: ({
readonly name: "entity_values_id";
readonly data_type: "serial PRIMARY KEY";
readonly is_id_field: true;
required?: undefined;
ui_type?: undefined;
} | {
readonly name: "name";
readonly data_type: "varchar";
readonly required: true;
readonly is_id_field?: undefined;
ui_type?: undefined;
} | {
readonly name: "base_entity_id";
readonly data_type: "integer references _entities(entity_id)";
readonly required: true;
readonly ui_type: "dropdown";
readonly is_id_field?: undefined;
} | {
name: "type";
data_type: string;
required: boolean;
ui_type: string;
readonly is_id_field?: undefined;
} | {
name: "sql_format_parmeter";
data_type: string;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
} | {
name: "fe_mapping_key";
data_type: string;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
} | {
name: "owner_user_id";
data_type: string;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
} | {
name: "html_project_id";
data_type: string;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
})[];
_entity_joinings: ({
readonly name: "entity_joining_id";
readonly data_type: "serial PRIMARY KEY";
readonly is_id_field: true;
required?: undefined;
ui_type?: undefined;
} | {
readonly name: "base_entity_id";
readonly data_type: "integer references _entities(entity_id)";
readonly required: true;
readonly ui_type: "dropdown";
readonly is_id_field?: undefined;
} | {
readonly name: "base_entity_field_id";
readonly data_type: "integer references _entity_fields(entity_field_id)";
readonly required: true;
readonly ui_type: "dropdown";
readonly is_id_field?: undefined;
} | {
readonly name: "linked_entity_id";
readonly data_type: "integer references _entities(entity_id)";
readonly required: true;
readonly ui_type: "dropdown";
readonly is_id_field?: undefined;
} | {
readonly name: "linked_entity_field_id";
readonly data_type: "integer references _entity_fields(entity_field_id)";
readonly required: true;
readonly ui_type: "dropdown";
readonly is_id_field?: undefined;
} | {
name: "sql_join_type";
data_type: string;
ui_type: string;
readonly is_id_field?: undefined;
required?: undefined;
} | {
name: "owner_user_id";
data_type: string;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
} | {
name: "html_project_id";
data_type: string;
readonly is_id_field?: undefined;
required?: undefined;
ui_type?: undefined;
})[];
};
export type BASIC_ENTITY_MODEL_TYPE = {
_entities: EntityType[];
_entity_fields: EntityFieldType[];
_entity_lists: EntityListType[];
_entity_list_fields: EntityListFieldType[];
_entity_joinings: EntityJoiningType[];
_entity_values: EntityValueType[];
};
export type ENRICHED_ENTITY_FIELDS_MODEL_TYPE = EntityFieldType & {
entity?: EntityType | null;
};
type ENRICHED_ENTITY_LIST_MODEL_TYPE = EntityListType & {
entity: EntityType | null;
};
type ENRICHED_ENTITY_LIST_FIELD_MODEL_TYPE = EntityListFieldType & {
entity_field: ENRICHED_ENTITY_FIELDS_MODEL_TYPE | null;
};
type ENRICHED_ENTITY_VALUES_MODEL_TYPE = EntityValueType & {
entity: EntityType | null;
};
export type ENRICHED_ENTITY_JOININGS_MODEL_TYPE = EntityJoiningType & {
base_entity: EntityType | null;
linked_entity: EntityType | null;
linked_entity_fields: ENRICHED_ENTITY_FIELDS_MODEL_TYPE[] | null;
base_entity_fields: ENRICHED_ENTITY_FIELDS_MODEL_TYPE[] | null;
};
export type EntityModelType = {
_entities: EntityType[];
_entity_fields: ENRICHED_ENTITY_FIELDS_MODEL_TYPE[];
_entity_lists: ENRICHED_ENTITY_LIST_MODEL_TYPE[];
_entity_list_fields: ENRICHED_ENTITY_LIST_FIELD_MODEL_TYPE[];
_entity_values: ENRICHED_ENTITY_VALUES_MODEL_TYPE[];
_entity_joinings: ENRICHED_ENTITY_JOININGS_MODEL_TYPE[];
};
export {};