From 1412f7d95cb07fbd38458806845d27819251371e Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 3 Mar 2023 13:40:19 +0800 Subject: [PATCH] chore(sdk): regenerate Api.ts --- packages/nocodb-sdk/src/lib/Api.ts | 2764 ++++++++++++++-------------- 1 file changed, 1422 insertions(+), 1342 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 741bef52f2..bf2e919cd9 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -10,175 +10,75 @@ */ /** - * Model for User + * Model for API Token */ -export interface UserType { - /** - * Unique identifier for the given user. - * @example us_8kugj628ebjngs - */ - id: string; - /** - * The first name of the user - * @example Alice - */ - firstname: string; - /** - * The last name of the user - * @example Smith - */ - lastname: string; - /** - * The email of the user - * @format email - * @example alice.smith@nocodb.com - */ - email: string; - /** - * The roles of the user - * @example org-level-viewer - */ - roles?: string; - /** Set to true if the user's email has been verified. */ - email_verified: boolean; - /** - * The date that the user was created. - * @format date-time - * @example 2023-03-01 11:36:49 - */ - created_at?: string; - /** - * The date that the user was created. - * @format date-time - * @example 2023-03-01 11:36:49 - */ - updated_at?: string; +export interface ApiTokenType { + created_at?: any; + description?: string; + fk_user_id?: string; + /** Unique ID */ + id?: IdType; + token?: string; + updated_at?: any; } /** - * Model for User List + * Model for API Token Request */ -export interface UserListType { - /** users includes `list` and `pageInfo` */ - users: { - /** List of User objects */ - list: UserType; - /** Pagination info */ - pageInfo: PaginatedType; - }; +export interface ApiTokenReqType { + /** Description of the API token */ + description?: string; } /** - * Model for Project Request + * Model for Attachment */ -export interface ProjectReqType { - /** - * Project Title - * @example My Project - */ - title: string; - /** - * Project Description - * @example This is my project description - */ - description?: string; - /** - * Primary Theme Color - * @example #24716E - */ - color?: string; - /** Array of Bases */ - bases?: BaseReqType[]; +export interface AttachmentType { + data?: any; + icon?: string; + mimetype?: string; + path?: string; + size?: string; + title?: string; + url?: string; } /** - * Model for Project + * Model for Audit */ -export interface ProjectType { - /** - * Unique Project ID - * @example p_124hhlkbeasewh - */ - id?: string; - /** - * Project Title - * @example my-project - */ - title?: string; - status?: string; - /** - * Project Description - * @example This is my project description - */ +export interface AuditType { + base_id?: string; description?: string; - /** Meta Info such as theme colors */ - meta?: MetaType; - /** - * Primary Theme Color - * @example #24716E - */ - color?: string; - /** Is the project deleted */ - deleted?: BoolType; - /** The order in project list */ - order?: number; - /** List of base models */ - bases?: BaseType[]; - /** Model for Bool */ - is_meta?: BoolType; - /** - * Project prefix. Used in XCDB only. - * @example nc_vm5q__ - */ - prefix?: string; - /** - * The created time of the record - * @format date-time - * @example 2023-03-01 14:27:36 - */ - created_at?: string; - /** - * The updated time of the record - * @format date-time - * @example 2023-03-01 14:27:36 - */ - updated_at?: string; + details?: string; + fk_model_id?: string; + /** Unique ID */ + id?: IdType; + ip?: string; + op_sub_type?: string; + op_type?: string; + project_id?: string; + row_id?: string; + status?: string; + user?: string; } /** - * Model for Project List + * Model for Audit Row Update Request */ -export interface ProjectListType { - /** List of Project Models */ - list?: ProjectType[]; - /** Pagination Info */ - pageInfo?: PaginatedType; +export interface AuditRowUpdateReqType { + column_name?: string; + fk_model_id?: string; + prev_value?: any; + row_id?: string; + value?: any; } /** * Model for Base */ export interface BaseType { - /** Unique Base ID */ - id?: string; - /** The project ID that this base belongs to */ - project_id?: string; /** Base Name - Default BASE will be null by default */ alias?: StringOrNullType; - /** - * DB Type - * @example mysql2 - */ - type?: - | 'mysql2' - | 'sqlite' - | 'mysql' - | 'mssql' - | 'snowflake' - | 'oracledb' - | 'pg'; - /** Is the data source connected externally */ - is_meta?: BoolType; /** Base Configuration */ config?: any; /** @@ -187,12 +87,10 @@ export interface BaseType { * @example 2023-03-01 14:27:36 */ created_at?: string; - /** - * The datatime this base is updated at - * @format date-time - * @example 2023-03-01 14:27:36 - */ - updated_at?: string; + /** Is this base enabled */ + enabled?: BoolType; + /** Unique Base ID */ + id?: string; /** * Inflection for columns * @example camelize @@ -203,13 +101,44 @@ export interface BaseType { * @example camelize */ inflection_table?: string; + /** Is the data source connected externally */ + is_meta?: BoolType; /** * The order of the list of bases * @example 1 */ order?: number; - /** Is this base enabled */ - enabled?: BoolType; + /** The project ID that this base belongs to */ + project_id?: string; + /** + * DB Type + * @example mysql2 + */ + type?: + | 'mssql' + | 'mysql' + | 'mysql2' + | 'oracledb' + | 'pg' + | 'snowflake' + | 'sqlite'; + /** + * The datatime this base is updated at + * @format date-time + * @example 2023-03-01 14:27:36 + */ + updated_at?: string; +} + +/** + * Model for Base List + */ +export interface BaseListType { + bases: { + list: BaseType[]; + /** Model for Paginated */ + pageInfo: PaginatedType; + }; } /** @@ -221,17 +150,6 @@ export interface BaseReqType { * @example My Base */ alias?: string; - /** DB Type */ - type?: - | 'mysql' - | 'mysql2' - | 'pg' - | 'sqlite3' - | 'mssql' - | 'oracledb' - | 'snowflake'; - /** Is the data source connected externally */ - is_meta?: boolean; /** Base Configuration */ config?: any; /** @@ -244,818 +162,928 @@ export interface BaseReqType { * @example camelize */ inflection_table?: string; + /** Is the data source connected externally */ + is_meta?: boolean; + /** DB Type */ + type?: + | 'mssql' + | 'mysql' + | 'mysql2' + | 'oracledb' + | 'pg' + | 'snowflake' + | 'sqlite3'; } /** - * Model for Base List + * Model for Bool */ -export interface BaseListType { - bases: { - list: BaseType[]; - /** Model for Paginated */ - pageInfo: PaginatedType; - }; -} +export type BoolType = number | boolean | null; /** - * Model for View + * Model for Column */ -export interface ViewType { - /** Unique ID for View */ +export interface ColumnType { + /** Is Auto-Increment? */ + ai?: BoolType; + /** Auto Update Timestamp */ + au?: BoolType; + /** + * Base ID that this column belongs to + * @example ds_krsappzu9f8vmo + */ + base_id?: string; + /** Column Comment */ + cc?: string; + /** Column Default */ + cdf?: string; + /** Character Maximum Length */ + clen?: number | null | string; + /** Column Options */ + colOptions?: + | FormulaType + | LinkToAnotherRecordType + | LookupType + | RollupType + | SelectOptionsType + | object + | (FormulaType & + LinkToAnotherRecordType & + LookupType & + RollupType & + SelectOptionsType & + object); + /** + * Column Name + * @example title + */ + column_name?: string; + /** Column Ordinal Position */ + cop?: string; + /** + * Character Set Name + * @example utf8mb4 + */ + csn?: string; + /** + * Column Type + * @example varchar(45) + */ + ct?: string; + /** Is Deleted? */ + deleted?: BoolType; + /** + * Data Type in DB + * @example varchar + */ + dt?: string; + /** + * Data Type X + * @example specificType + */ + dtx?: string; + /** Data Type X Precision */ + dtxp?: null | number | string; + /** Data Type X Scale */ + dtxs?: null | number | string; + /** + * Model ID that this column belongs to + * @example md_yvwvbt2i78rgcm + */ + fk_model_id?: string; + /** Unique ID */ id?: IdType; - /** Unique Base ID */ - base_id?: IdType; - /** Unique Project ID */ - project_id?: IdType; - /** Unique Model ID */ - fk_model_id: IdType; - /** View Title */ - title: string; - /** View Type */ - type: number; - /** If this view is shown? */ - show: BoolType; - /** The rder of the list of views */ - order?: number; - /** UUID of the view */ - uuid?: string; - /** Password for protecting the view */ - password?: string; - /** Meta data for this view */ + /** Meta Info */ meta?: MetaType; - /** Should show system fields in this view? */ - show_system_fields?: BoolType; - /** Lock Type of the view */ - lock_type?: 'collaborative' | 'locked' | 'personal'; - /** Associated View Model */ - view?: - | FormType - | GridType - | GalleryType - | KanbanType - | MapType - | (FormType & GridType & GalleryType & KanbanType & MapType); + /** Numeric Precision */ + np?: number | null | string; + /** Numeric Scale */ + ns?: number | null | string; + /** The order of the list of columns */ + order?: number; + /** Is Primary Key? */ + pk?: BoolType; + /** Is Primary Value? */ + pv?: BoolType; + /** Is Required? */ + rqd?: BoolType; + /** Is System Colun? */ + system?: BoolType; + /** + * Column Title + * @example Title + */ + title?: string; + /** + * The data type in UI + * @example SingleLineText + */ + uidt?: string; + /** Is Unsigned? */ + un?: BoolType; + /** Is unique? */ + unique?: BoolType; + /** Is Visible? */ + visible?: BoolType; } /** - * Model for Table + * Model for Column List */ -export interface TableType { - /** Unique Table ID */ - id?: string; - /** Unique Project ID */ - project_id?: string; - /** Unique Base ID */ - base_id?: string; - /** Table Name. Prefix will be added for XCDB projects. */ - table_name: string; - /** Table Title */ - title: string; - /** Table Type */ - type?: string; - /** Is this table enabled? */ - enabled?: BoolType; - /** Currently not in use */ - tags?: string; - /** Currently not in use */ - pinned?: BoolType; - /** Model for Bool */ - deleted?: BoolType; - /** The order of the list of tables */ - order?: number; - /** The columns included in this table */ - columns?: ColumnType[]; - /** Column Models grouped by IDs */ - columnsById?: object; - /** Is this table used for M2M */ - mm?: BoolType; - /** Meta Data */ - meta?: MetaType; +export interface ColumnListType { + columns: { + list: ColumnType[]; + }; } /** - * Model for Table Request + * Model for Column Request */ -export interface TableReqType { - /** - * Table name - * @example my_table - */ - table_name: string; - /** - * Table title - * @example My Table - */ +export type ColumnReqType = ( + | FormulaColumnReqType + | LinkToAnotherColumnReqType + | LookupColumnReqType + | NormalColumnRequestType + | RollupColumnReqType + | (FormulaColumnReqType & + LinkToAnotherColumnReqType & + LookupColumnReqType & + NormalColumnRequestType & + RollupColumnReqType) +) & { + column_name: string; + /** Column order in a specific view */ + column_order?: { + order?: number; + view_id?: string; + }; title: string; - /** - * The order of table list - * @example 1 - */ - order?: number; - /** The column models in this table */ - columns: NormalColumnRequestType[]; - /** the meta data for this table */ - meta?: MetaType; -} +}; /** - * Model for Table List + * Model for Comment Request */ -export interface TableListType { - list?: TableType[]; - /** Model for Paginated */ - pageInfo?: PaginatedType; +export interface CommentReqType { + description?: string; + fk_model_id: string; + row_id: string; } /** * Model for Filter */ export interface FilterType { - /** Unique ID */ - id?: IdType; - /** Foreign Key to Model */ - fk_model_id?: IdType; - /** Foreign Key to Column */ - fk_column_id?: IdType; - /** Logical Operator */ - logical_op?: 'and' | 'or' | 'not'; + /** Unqiue Base ID */ + base_id?: string; + /** Children filters. Available when the filter is grouped. */ + children?: FilterType[]; /** Comparison Operator */ comparison_op?: - | 'eq' - | 'neq' - | 'not' - | 'like' - | 'nlike' - | 'empty' - | 'notempty' - | 'null' - | 'notnull' - | 'checked' - | 'notchecked' - | 'blank' - | 'notblank' | 'allof' | 'anyof' - | 'nallof' - | 'nanyof' + | 'blank' + | 'btw' + | 'checked' + | 'empty' + | 'eq' + | 'ge' | 'gt' - | 'lt' | 'gte' - | 'lte' - | 'ge' - | 'le' | 'in' - | 'isnot' | 'is' | 'isWithin' - | 'btw' - | 'nbtw'; - /** Comparison Sub-Operator */ - comparison_sub_op?: - | 'pastWeek' - | 'pastMonth' - | 'pastYear' - | 'nextWeek' - | 'nextMonth' - | 'nextYear' - | 'pastNumberOfDays' + | 'isnot' + | 'le' + | 'like' + | 'lt' + | 'lte' + | 'nallof' + | 'nanyof' + | 'nbtw' + | 'neq' + | 'nlike' + | 'not' + | 'notblank' + | 'notchecked' + | 'notempty' + | 'notnull' + | 'null'; + /** Comparison Sub-Operator */ + comparison_sub_op?: + | 'daysAgo' + | 'daysFromNow' + | 'exactDate' + | 'nextMonth' | 'nextNumberOfDays' + | 'nextWeek' + | 'nextYear' + | 'oneMonthAgo' + | 'oneMonthFromNow' + | 'oneWeekAgo' + | 'oneWeekFromNow' + | 'pastMonth' + | 'pastNumberOfDays' + | 'pastWeek' + | 'pastYear' | 'today' | 'tomorrow' | 'yesterday' - | 'oneWeekAgo' - | 'oneWeekFromNow' - | 'oneMonthAgo' - | 'oneMonthFromNow' - | 'daysAgo' - | 'daysFromNow' - | 'exactDate' | null | ( - | 'pastWeek' - | 'pastMonth' - | 'pastYear' - | 'nextWeek' + | 'daysAgo' + | 'daysFromNow' + | 'exactDate' | 'nextMonth' + | 'nextNumberOfDays' + | 'nextWeek' | 'nextYear' + | 'oneMonthAgo' + | 'oneMonthFromNow' + | 'oneWeekAgo' + | 'oneWeekFromNow' + | 'pastMonth' | 'pastNumberOfDays' - | 'nextNumberOfDays' + | 'pastWeek' + | 'pastYear' | 'today' | 'tomorrow' - | 'yesterday' - | 'oneWeekAgo' - | 'oneWeekFromNow' - | 'oneMonthAgo' - | 'oneMonthFromNow' - | 'daysAgo' - | 'daysFromNow' - | ('exactDate' & null) + | ('yesterday' & null) ); - /** The filter value. Can be NULL for some operators. */ - value?: any; - /** Is this filter grouped? */ - is_group?: boolean | number | null; - /** Children filters. Available when the filter is grouped. */ - children?: FilterType[]; - /** Unique Project ID */ - project_id?: string; - /** Unqiue Base ID */ - base_id?: string; + /** Foreign Key to Column */ + fk_column_id?: IdType; + /** Foreign Key to Hook */ + fk_hook_id?: StringOrNullType; + /** Foreign Key to Model */ + fk_model_id?: IdType; /** Foreign Key to parent group. */ fk_parent_id?: StringOrNullType; /** Foreign Key to View */ fk_view_id?: StringOrNullType; - /** Foreign Key to Hook */ - fk_hook_id?: StringOrNullType; + /** Unique ID */ + id?: IdType; + /** Is this filter grouped? */ + is_group?: boolean | number | null; + /** Logical Operator */ + logical_op?: 'and' | 'not' | 'or'; + /** Unique Project ID */ + project_id?: string; + /** The filter value. Can be NULL for some operators. */ + value?: any; +} + +/** + * Model for Filter List + */ +export interface FilterListType { + filters: { + list: FilterType[]; + }; } /** * Model for Filter Request */ export interface FilterReqType { - /** Foreign Key to Column */ - fk_column_id?: IdType; - /** Logical Operator */ - logical_op?: 'and' | 'or' | 'not'; /** Comparison Operator */ comparison_op?: - | 'eq' - | 'neq' - | 'not' - | 'like' - | 'nlike' - | 'empty' - | 'notempty' - | 'null' - | 'notnull' - | 'checked' - | 'notchecked' - | 'blank' - | 'notblank' | 'allof' | 'anyof' - | 'nallof' - | 'nanyof' + | 'blank' + | 'btw' + | 'checked' + | 'empty' + | 'eq' + | 'ge' | 'gt' - | 'lt' | 'gte' - | 'lte' - | 'ge' - | 'le' | 'in' - | 'isnot' | 'is' | 'isWithin' - | 'btw' - | 'nbtw'; + | 'isnot' + | 'le' + | 'like' + | 'lt' + | 'lte' + | 'nallof' + | 'nanyof' + | 'nbtw' + | 'neq' + | 'nlike' + | 'not' + | 'notblank' + | 'notchecked' + | 'notempty' + | 'notnull' + | 'null'; /** Comparison Sub-Operator */ comparison_sub_op?: - | 'pastWeek' - | 'pastMonth' - | 'pastYear' - | 'nextWeek' + | 'daysAgo' + | 'daysFromNow' + | 'exactDate' | 'nextMonth' + | 'nextNumberOfDays' + | 'nextWeek' | 'nextYear' + | 'oneMonthAgo' + | 'oneMonthFromNow' + | 'oneWeekAgo' + | 'oneWeekFromNow' + | 'pastMonth' | 'pastNumberOfDays' - | 'nextNumberOfDays' + | 'pastWeek' + | 'pastYear' | 'today' | 'tomorrow' | 'yesterday' - | 'oneWeekAgo' - | 'oneWeekFromNow' - | 'oneMonthAgo' - | 'oneMonthFromNow' - | 'daysAgo' - | 'daysFromNow' - | 'exactDate' | null | ( - | 'pastWeek' - | 'pastMonth' - | 'pastYear' - | 'nextWeek' + | 'daysAgo' + | 'daysFromNow' + | 'exactDate' | 'nextMonth' + | 'nextNumberOfDays' + | 'nextWeek' | 'nextYear' + | 'oneMonthAgo' + | 'oneMonthFromNow' + | 'oneWeekAgo' + | 'oneWeekFromNow' + | 'pastMonth' | 'pastNumberOfDays' - | 'nextNumberOfDays' + | 'pastWeek' + | 'pastYear' | 'today' | 'tomorrow' - | 'yesterday' - | 'oneWeekAgo' - | 'oneWeekFromNow' - | 'oneMonthAgo' - | 'oneMonthFromNow' - | 'daysAgo' - | 'daysFromNow' - | ('exactDate' & null) + | ('yesterday' & null) ); - /** The filter value. Can be NULL for some operators. */ - value?: any; - /** Is this filter grouped? */ - is_group?: BoolType; + /** Foreign Key to Column */ + fk_column_id?: IdType; /** Belong to which filter ID */ fk_parent_id?: IdType; + /** Is this filter grouped? */ + is_group?: BoolType; + /** Logical Operator */ + logical_op?: 'and' | 'not' | 'or'; + /** The filter value. Can be NULL for some operators. */ + value?: any; +} + +/** + * Model for Form + */ +export interface FormType { + /** Model for StringOrNull */ + banner_image_url?: StringOrNullType; + columns?: FormColumnType[]; + /** Model for StringOrNull */ + email?: StringOrNullType; + fk_model_id?: string; + heading?: string; + /** Unique ID */ + id?: IdType; + lock_type?: 'collaborative' | 'locked' | 'personal'; + /** Model for StringOrNull */ + logo_url?: StringOrNullType; + /** Model for Meta */ + meta?: MetaType; + /** Model for StringOrNull */ + redirect_after_secs?: StringOrNullType; + /** Model for StringOrNull */ + redirect_url?: StringOrNullType; + /** Model for Bool */ + show_blank_form?: BoolType; + subheading?: string; + /** Model for Bool */ + submit_another_form?: BoolType; + success_msg?: string; + title?: string; +} + +/** + * Model for Form Column + */ +export interface FormColumnType { + created_at?: string; + description?: string; + /** Foreign Key to Column */ + fk_column_id?: IdType; + fk_view_id?: string; + help?: any; + id?: string; + label?: string; + /** Model for Meta */ + meta?: MetaType; + order?: number; + /** Model for Bool */ + required?: BoolType; + /** Model for Bool */ + show?: BoolType; + updated_at?: string; + uuid?: any; +} + +/** + * Model for Form Column Request + */ +export interface FormColumnReqType { + description?: string; + help?: any; + label?: string; + /** Model for Meta */ + meta?: MetaType; + order?: number; + /** Model for Bool */ + required?: BoolType; + /** Model for Bool */ + show?: BoolType; +} + +/** + * Model for Form Create + */ +export type FormCreateReqType = FormReqType; + +/** + * Model for Form Request + */ +export interface FormReqType { + /** Banner Image URL. Not in use currently. */ + banner_image_url?: StringOrNullType; + /** Model for StringOrNull */ + email?: StringOrNullType; + /** + * The heading of the form + * @example My Form + */ + heading?: string; + lock_type?: 'collaborative' | 'locked' | 'personal'; + /** Logo URL. Not in use currently. */ + logo_url?: StringOrNullType; + /** Meta Info for this view */ + meta?: MetaType; + /** The numbers of seconds to redirect after form submission */ + redirect_after_secs?: StringOrNullType; + /** URL to redirect after submission */ + redirect_url?: StringOrNullType; + /** Show `Blank Form` after 5 seconds */ + show_blank_form?: BoolType; + /** + * The subheading of the form + * @example My Form Subheading + */ + subheading?: string; + /** Show `Submit Another Form` button */ + submit_another_form?: BoolType; + /** Custom message after the form is successfully submitted */ + success_msg?: StringOrNullType; + /** + * The title of the form + * @example My Form + */ + title?: string; +} + +/** + * Model for Formula + */ +export interface FormulaType { + deleted?: string; + /** Foreign Key to Column */ + fk_column_id?: IdType; + formula?: string; + formula_raw?: string; + /** Unique ID */ + id?: IdType; + order?: string; + type?: string; + /** Model for Bool */ + virtual?: BoolType; +} + +/** + * Model for Formula Column Request + */ +export interface FormulaColumnReqType { + formula?: string; + formula_raw?: string; + title?: string; + uidt?: 'Formula'; +} + +/** + * Model for Gallery + */ +export interface GalleryType { + alias?: string; + columns?: GalleryColumnType[]; + cover_image?: string; + cover_image_idx?: number; + /** Model for Bool */ + deleted?: BoolType; + fk_cover_image_col_id?: string; + fk_model_id?: string; + fk_view_id?: string; + lock_type?: 'collaborative' | 'locked' | 'personal'; + /** Model for Bool */ + next_enabled?: BoolType; + order?: number; + /** Model for Bool */ + prev_enabled?: BoolType; + restrict_number?: string; + restrict_size?: string; + restrict_types?: string; + title?: string; +} + +/** + * Model for Gallery Column + */ +export interface GalleryColumnType { + fk_col_id?: string; + fk_gallery_id?: string; + help?: string; + /** Unique ID */ + id?: IdType; + label?: string; +} + +/** + * Model for Gallery Request + */ +export interface GalleryReqType { + cover_image?: string; + /** @min 0 */ + cover_image_idx?: number; + /** The id of the column that contains the cover image */ + fk_cover_image_col_id?: string; + /** The lock type of gallery */ + lock_type?: 'collaborative' | 'locked' | 'personal'; + /** Model for Bool */ + next_enabled?: BoolType; + /** Model for Bool */ + prev_enabled?: BoolType; + restrict_number?: string; + restrict_size?: string; + restrict_types?: string; + /** + * The title of the gallery + * @example My Gallery + */ + title: string; } /** - * Model for Filter List + * Model for Geo Location */ -export interface FilterListType { - filters: { - list: FilterType[]; - }; +export interface GeoLocationType { + /** + * The latitude of the location + * @format double + * @example 18.52139 + */ + latitude?: number; + /** + * The longitude of the location + * @format double + * @example 179.87295 + */ + longitude?: number; } /** - * Model for Sort + * Model for Grid */ -export interface SortType { +export interface GridType { + alias?: string; + /** Model for Bool */ + deleted?: BoolType; /** Unique ID */ id?: IdType; - /** Model for ID */ - fk_model_id?: IdType; - /** Model for ID */ - fk_column_id?: IdType; - direction?: string; + lock_type?: 'collaborative' | 'locked' | 'personal'; order?: number; - project_id?: string; - base_id?: string; + row_height?: number; + title?: string; } /** - * Model for Sort Request + * Model for Grid Column */ -export interface SortReqType { +export interface GridColumnType { /** Foreign Key to Column */ fk_column_id?: IdType; - /** Sort direction */ - direction?: 'asc' | 'desc'; -} - -/** - * Model for Sort List - */ -export interface SortListType { - sorts: { - list: SharedViewType[]; - }; + help?: string; + /** Unique ID of Grid Column */ + id?: string; + label?: string; + width?: string; } /** - * Model for Column + * Model for Grid Column Request */ -export interface ColumnType { - /** Unique ID */ - id?: IdType; - /** - * Base ID that this column belongs to - * @example ds_krsappzu9f8vmo - */ - base_id?: string; - /** - * Model ID that this column belongs to - * @example md_yvwvbt2i78rgcm - */ - fk_model_id?: string; - /** - * Column Title - * @example Title - */ - title?: string; - /** - * The data type in UI - * @example SingleLineText - */ - uidt?: string; +export interface GridColumnReqType { + /** Foreign Key to Column */ + fk_column_id?: IdType; + help?: string; /** - * Data Type in DB - * @example varchar + * The label of the column + * @example My Column */ - dt?: string; - /** Numeric Precision */ - np?: string | number | null; - /** Numeric Scale */ - ns?: string | number | null; - /** Character Maximum Length */ - clen?: string | number | null; - /** Column Ordinal Position */ - cop?: string; - /** Is Primary Key? */ - pk?: BoolType; - /** Is Primary Value? */ - pv?: BoolType; - /** Is Required? */ - rqd?: BoolType; + label?: string; /** - * Column Name - * @example title + * The width of the column + * @pattern ^[0-9]+(px|%)$ + * @example 200px */ - column_name?: string; - /** Is Unsigned? */ - un?: BoolType; + width?: string; +} + +/** + * Model for Grid Request + */ +export interface GridReqType { + /** The lock type of the grid */ + lock_type?: 'collaborative' | 'locked' | 'personal'; /** - * Column Type - * @example varchar(45) + * The order of the grid + * @example 1 */ - ct?: string; - /** Is Auto-Increment? */ - ai?: BoolType; - /** Is unique? */ - unique?: BoolType; - /** Column Default */ - cdf?: string; - /** Column Comment */ - cc?: string; + order?: number; /** - * Character Set Name - * @example utf8mb4 + * The height of the grid rows + * @min 1 + * @example 1 */ - csn?: string; + row_height?: number; /** - * Data Type X - * @example specificType + * The title of the grid + * @example My Grid */ - dtx?: string; - /** Data Type X Precision */ - dtxp?: string | number | null; - /** Data Type X Scale */ - dtxs?: string | number | null; - /** Auto Update Timestamp */ - au?: BoolType; - /** Is Deleted? */ - deleted?: BoolType; - /** Is Visible? */ - visible?: BoolType; - /** The order of the list of columns */ - order?: number; - /** Is System Colun? */ - system?: BoolType; - /** Meta Info */ - meta?: MetaType; - /** Column Options */ - colOptions?: - | LinkToAnotherRecordType - | FormulaType - | RollupType - | LookupType - | SelectOptionsType - | object - | (LinkToAnotherRecordType & - FormulaType & - RollupType & - LookupType & - SelectOptionsType & - object); -} - -/** - * Model for Column List - */ -export interface ColumnListType { - columns: { - list: ColumnType[]; - }; -} - -/** - * Model for Column Request - */ -export type ColumnReqType = ( - | LinkToAnotherColumnReqType - | RollupColumnReqType - | FormulaColumnReqType - | LookupColumnReqType - | NormalColumnRequestType - | (LinkToAnotherColumnReqType & - RollupColumnReqType & - FormulaColumnReqType & - LookupColumnReqType & - NormalColumnRequestType) -) & { - column_name: string; title: string; - /** Column order in a specific view */ - column_order?: { - view_id?: string; - order?: number; - }; -}; +} /** - * Model for LinkToAnotherRecord + * Model for Hook */ -export interface LinkToAnotherRecordType { +export interface HookType { + /** Model for Bool */ + active?: BoolType; + /** Model for Bool */ + async?: BoolType; + description?: string; + env?: string; + event?: 'after' | 'before'; + fk_model_id?: string; /** Unique ID */ id?: IdType; - type?: string; - /** Model for Bool */ - virtual?: BoolType; - /** Foreign Key to Column */ - fk_column_id?: IdType; - fk_child_column_id?: string; - fk_parent_column_id?: string; - fk_mm_model_id?: string; - fk_related_model_id?: string; - fk_mm_child_column_id?: string; - fk_mm_parent_column_id?: string; - ur?: string; - dr?: string; - fk_index_name?: string; - deleted?: string; - order?: string; + notification?: string; + operation?: 'delete' | 'insert' | 'update'; + retries?: number; + retry_interval?: number; + timeout?: number; + title?: string; + type?: string; } /** - * Model for Lookup + * Model for Hook List */ -export interface LookupType { - /** Unique ID */ - id?: IdType; - type?: string; - /** Model for Bool */ - virtual?: BoolType; - /** Foreign Key to Column */ - fk_column_id?: IdType; - fk_relation_column_id?: string; - fk_lookup_column_id?: string; - deleted?: string; - order?: string; +export interface HookListType { + list?: object[]; + /** Model for Paginated */ + pageInfo?: PaginatedType; } /** - * Model for Rollup + * Model for Hook Log */ -export interface RollupType { +export interface HookLogType { + base_id?: string; + conditions?: string; + created_at?: string; + error?: string; + error_code?: string; + error_message?: string; + event?: string; + execution_time?: string; + /** Model for StringOrNull */ + fk_hook_id?: StringOrNullType; /** Unique ID */ id?: IdType; - type?: string; + notifications?: string; + operation?: string; + payload?: any; + project_id?: string; + response?: string; /** Model for Bool */ - virtual?: BoolType; - /** Foreign Key to Column */ - fk_column_id?: IdType; - fk_relation_column_id?: string; - fk_rollup_column_id?: string; - rollup_function?: string; - deleted?: string; - order?: string; + test_call?: BoolType; + triggered_by?: string; + type?: string; + updated_at?: string; } /** - * Model for Formula + * Model for Hook Request */ -export interface FormulaType { - /** Unique ID */ - id?: IdType; - type?: string; +export interface HookReqType { /** Model for Bool */ - virtual?: BoolType; - /** Foreign Key to Column */ - fk_column_id?: IdType; - formula?: string; - formula_raw?: string; - deleted?: string; - order?: string; + active?: BoolType; + /** Model for Bool */ + async?: BoolType; + /** Model for StringOrNull */ + description?: StringOrNullType; + env?: string; + event: 'after' | 'before'; + fk_model_id?: string; + notification: any; + operation: 'delete' | 'insert' | 'update'; + retries?: number | null; + retry_interval?: number | null; + timeout?: number | null; + title: string; } /** - * Model for SelectOptions + * Model for Hook Test Request */ -export interface SelectOptionsType { - options: SelectOptionType[]; +export interface HookTestReqType { + /** Model for Hook Request */ + hook: HookReqType; + payload: any; } /** - * Model for SelectOption + * Model for ID */ -export interface SelectOptionType { +export type IdType = string; + +/** + * Model for Kanban + */ +export interface KanbanType { + alias?: string; + columns?: KanbanColumnType[]; + fk_cover_image_col_id?: string; + /** Model for StringOrNull */ + fk_grp_col_id?: StringOrNullType; + fk_model_id?: string; /** Unique ID */ id?: IdType; - /** Foreign Key to Column */ - fk_column_id?: IdType; + /** Model for Meta */ + meta?: MetaType; title?: string; - color?: string; - order?: number; } /** - * Model for Grid + * Model for Kanban Column */ -export interface GridType { +export interface KanbanColumnType { + /** Foreign Key to Column */ + fk_column_id?: IdType; + fk_kanban_id?: string; + help?: string; /** Unique ID */ id?: IdType; - title?: string; - alias?: string; - /** Model for Bool */ - deleted?: BoolType; - order?: number; - lock_type?: 'collaborative' | 'locked' | 'personal'; - row_height?: number; + label?: string; } /** - * Model for Grid Request + * Model for Kanban Request */ -export interface GridReqType { +export interface KanbanReqType { + /** Model for StringOrNull */ + fk_grp_col_id?: StringOrNullType; /** - * The title of the grid - * @example My Grid + * The title of the kanban + * @example My Kanban */ title: string; - /** - * The order of the grid - * @example 1 - */ - order?: number; - /** The lock type of the grid */ - lock_type?: 'collaborative' | 'locked' | 'personal'; - /** - * The height of the grid rows - * @min 1 - * @example 1 - */ - row_height?: number; } /** - * Model for Gallery + * Model for Kanban Update Request */ -export interface GalleryType { - fk_view_id?: string; - title?: string; - alias?: string; - /** Model for Bool */ - deleted?: BoolType; - order?: number; - /** Model for Bool */ - next_enabled?: BoolType; - /** Model for Bool */ - prev_enabled?: BoolType; - cover_image_idx?: number; - cover_image?: string; - restrict_types?: string; - restrict_size?: string; - restrict_number?: string; - columns?: GalleryColumnType[]; - fk_model_id?: string; - fk_cover_image_col_id?: string; - lock_type?: 'collaborative' | 'locked' | 'personal'; +export interface KanbanUpdateReqType { + /** Model for StringOrNull */ + fk_grp_col_id?: StringOrNullType; } /** - * Model for Gallery Request + * Model for Kanban Request */ -export interface GalleryReqType { +export interface LicenseReqType { /** - * The title of the gallery - * @example My Gallery + * The license key + * @example 1234567890 */ - title: string; - /** Model for Bool */ - next_enabled?: BoolType; - /** Model for Bool */ - prev_enabled?: BoolType; - /** @min 0 */ - cover_image_idx?: number; - cover_image?: string; - restrict_types?: string; - restrict_size?: string; - restrict_number?: string; - /** The id of the column that contains the cover image */ - fk_cover_image_col_id?: string; - /** The lock type of gallery */ - lock_type?: 'collaborative' | 'locked' | 'personal'; -} - -/** - * Model for Gallery Column - */ -export interface GalleryColumnType { - /** Unique ID */ - id?: IdType; - label?: string; - help?: string; - fk_col_id?: string; - fk_gallery_id?: string; + key?: string; } /** - * Model for Grid Column Request + * Model for LinkToAnotherColumn Request */ -export interface GridColumnReqType { - /** - * The label of the column - * @example My Column - */ - label?: string; - help?: string; - /** Foreign Key to Column */ - fk_column_id?: IdType; - /** - * The width of the column - * @pattern ^[0-9]+(px|%)$ - * @example 200px - */ - width?: string; +export interface LinkToAnotherColumnReqType { + /** Model for ID */ + childId: IdType; + /** Model for ID */ + parentId: IdType; + title: string; + type: 'bt' | 'hm' | 'mm'; + uidt: 'LinkToAnotherRecord'; + /** Model for Bool */ + virtual?: BoolType; } /** - * Model for Grid Column + * Model for LinkToAnotherRecord */ -export interface GridColumnType { - /** Unique ID of Grid Column */ - id?: string; - label?: string; - help?: string; +export interface LinkToAnotherRecordType { + deleted?: string; + dr?: string; + fk_child_column_id?: string; /** Foreign Key to Column */ fk_column_id?: IdType; - width?: string; -} - -/** - * Model for Kanban Column - */ -export interface KanbanColumnType { + fk_index_name?: string; + fk_mm_child_column_id?: string; + fk_mm_model_id?: string; + fk_mm_parent_column_id?: string; + fk_parent_column_id?: string; + fk_related_model_id?: string; /** Unique ID */ id?: IdType; - label?: string; - help?: string; - /** Foreign Key to Column */ - fk_column_id?: IdType; - fk_kanban_id?: string; + order?: string; + type?: string; + ur?: string; + /** Model for Bool */ + virtual?: BoolType; } /** - * Model for Kanban + * Model for Lookup */ -export interface KanbanType { +export interface LookupType { + deleted?: string; + /** Foreign Key to Column */ + fk_column_id?: IdType; + fk_lookup_column_id?: string; + fk_relation_column_id?: string; /** Unique ID */ id?: IdType; - title?: string; - alias?: string; - columns?: KanbanColumnType[]; - fk_model_id?: string; - /** Model for StringOrNull */ - fk_grp_col_id?: StringOrNullType; - fk_cover_image_col_id?: string; - /** Model for Meta */ - meta?: MetaType; + order?: string; + type?: string; + /** Model for Bool */ + virtual?: BoolType; } /** - * Model for Geo Location + * Model for Lookup Column Request */ -export interface GeoLocationType { - /** - * The latitude of the location - * @format double - * @example 18.52139 - */ - latitude?: number; - /** - * The longitude of the location - * @format double - * @example 179.87295 - */ - longitude?: number; +export interface LookupColumnReqType { + /** Model for ID */ + fk_lookup_column_id: IdType; + /** Model for ID */ + fk_relation_column_id: IdType; + title: string; + uidt: 'Lookup'; } /** * Model for Map */ export interface MapType { - /** - * Unique ID for Map - * @example vw_qjt7klod1p9kyv - */ - fk_view_id?: string; - /** - * Title of Map View - * @example My Map - */ - title?: string; - /** - * The ID of the project that this view belongs to - * @example p_xm3thidrblw4n7 - */ - project_id?: string; /** * The ID of the base that this view belongs to * @example ds_g4ccx6e77h1dmi */ base_id?: string; + /** Columns in this view */ + columns?: MapColumnType[]; /** * Foreign Key to GeoData Column * @example cl_8iw2o4ejzvdyna */ fk_geo_data_col_id?: string; - /** Columns in this view */ - columns?: MapColumnType[]; + /** + * Unique ID for Map + * @example vw_qjt7klod1p9kyv + */ + fk_view_id?: string; /** Meta data for this view */ meta?: MetaType; - /** To show this Map or not */ - show?: boolean; /** The order of the map list */ order?: number; + /** + * The ID of the project that this view belongs to + * @example p_xm3thidrblw4n7 + */ + project_id?: string; + /** To show this Map or not */ + show?: boolean; + /** + * Title of Map View + * @example My Map + */ + title?: string; } /** @@ -1063,193 +1091,151 @@ export interface MapType { */ export interface MapColumnType { /** - * Unique ID of Map Column - * @example nc_46xcacqn4rc9xf - */ - id?: string; - /** - * Whether to show this column or not - * @example 1 + * The ID of the base that this map column belongs to + * @example ds_g4ccx6e77h1dmi */ - show?: number; + base_id?: string; /** - * the order in the list of map columns - * @example 1 + * Foreign Key to Column + * @example cl_8iw2o4ejzvdyna */ - order?: number; + fk_column_id?: string; /** * Foreign Key to View * @example vw_qjt7klod1p9kyv */ fk_view_id?: string; /** - * Foreign Key to Column - * @example cl_8iw2o4ejzvdyna + * Unique ID of Map Column + * @example nc_46xcacqn4rc9xf */ - fk_column_id?: string; + id?: string; + /** + * the order in the list of map columns + * @example 1 + */ + order?: number; /** * The ID of the project that this map column belongs to * @example p_xm3thidrblw4n7 */ project_id?: string; /** - * The ID of the base that this map column belongs to - * @example ds_g4ccx6e77h1dmi - */ - base_id?: string; -} - -/** - * Model for Kanban Request - */ -export interface LicenseReqType { - /** - * The license key - * @example 1234567890 - */ - key?: string; -} - -/** - * Model for Kanban Request - */ -export interface KanbanReqType { - /** - * The title of the kanban - * @example My Kanban + * Whether to show this column or not + * @example 1 */ - title: string; - /** Model for StringOrNull */ - fk_grp_col_id?: StringOrNullType; + show?: number; } /** - * Model for Kanban Update Request + * Model for Meta */ -export interface KanbanUpdateReqType { - /** Model for StringOrNull */ - fk_grp_col_id?: StringOrNullType; -} +export type MetaType = null | object | string; /** - * Model for Form + * Model for ModelRoleVisibility */ -export interface FormType { - /** Unique ID */ - id?: IdType; - title?: string; - heading?: string; - subheading?: string; - success_msg?: string; - /** Model for StringOrNull */ - redirect_url?: StringOrNullType; - /** Model for StringOrNull */ - redirect_after_secs?: StringOrNullType; - /** Model for StringOrNull */ - email?: StringOrNullType; - /** Model for StringOrNull */ - banner_image_url?: StringOrNullType; - /** Model for StringOrNull */ - logo_url?: StringOrNullType; - /** Model for Bool */ - submit_another_form?: BoolType; +export interface ModelRoleVisibilityType { + base_id?: string; /** Model for Bool */ - show_blank_form?: BoolType; - columns?: FormColumnType[]; + disabled?: BoolType; fk_model_id?: string; - lock_type?: 'collaborative' | 'locked' | 'personal'; - /** Model for Meta */ - meta?: MetaType; + fk_view_id?: string; + /** Unique ID */ + id?: IdType; + project_id?: string; + role?: string; } /** - * Model for Form Request + * Model for Normal Column Request */ -export interface FormReqType { - /** - * The title of the form - * @example My Form - */ - title?: string; - /** - * The heading of the form - * @example My Form - */ - heading?: string; - /** - * The subheading of the form - * @example My Form Subheading - */ - subheading?: string; - /** Custom message after the form is successfully submitted */ - success_msg?: StringOrNullType; - /** URL to redirect after submission */ - redirect_url?: StringOrNullType; - /** The numbers of seconds to redirect after form submission */ - redirect_after_secs?: StringOrNullType; +export interface NormalColumnRequestType { + /** Model for Bool */ + ai?: BoolType; + /** Model for Bool */ + au?: BoolType; /** Model for StringOrNull */ - email?: StringOrNullType; - /** Banner Image URL. Not in use currently. */ - banner_image_url?: StringOrNullType; - /** Logo URL. Not in use currently. */ - logo_url?: StringOrNullType; - /** Show `Submit Another Form` button */ - submit_another_form?: BoolType; - /** Show `Blank Form` after 5 seconds */ - show_blank_form?: BoolType; - lock_type?: 'collaborative' | 'locked' | 'personal'; - /** Meta Info for this view */ - meta?: MetaType; -} - -/** - * Model for Form Create - */ -export type FormCreateReqType = FormReqType; - -/** - * Model for Form Column - */ -export interface FormColumnType { - /** Foreign Key to Column */ - fk_column_id?: IdType; - id?: string; - fk_view_id?: string; - uuid?: any; - label?: string; - help?: any; + cc?: StringOrNullType; + /** Model for StringOrNull */ + cdf?: StringOrNullType; + column_name?: string; + /** Model for StringOrNull */ + csn?: StringOrNullType; + dt?: string; + /** Model for StringOrNull */ + dtx?: StringOrNullType; + dtxp?: StringOrNullType | number; + dtxs?: StringOrNullType | number; + np?: StringOrNullType | number; + ns?: StringOrNullType | number; /** Model for Bool */ - required?: BoolType; + pk?: BoolType; /** Model for Bool */ - show?: BoolType; - order?: number; - created_at?: string; - updated_at?: string; - description?: string; - /** Model for Meta */ - meta?: MetaType; + pv?: BoolType; + /** Model for Bool */ + rqd?: BoolType; + title?: string; + uidt?: + | 'Attachment' + | 'AutoNumber' + | 'Barcode' + | 'Button' + | 'Checkbox' + | 'Collaborator' + | 'Count' + | 'CreateTime' + | 'Currency' + | 'Date' + | 'DateTime' + | 'Decimal' + | 'Duration' + | 'Email' + | 'GeoData' + | 'Geometry' + | 'ID' + | 'JSON' + | 'LastModifiedTime' + | 'LongText' + | 'MultiSelect' + | 'Number' + | 'Percent' + | 'PhoneNumber' + | 'Rating' + | 'SingleLineText' + | 'SingleSelect' + | 'SpecificDBType' + | 'Time' + | 'URL' + | 'Year'; + /** Model for Bool */ + un?: BoolType; + /** Model for Bool */ + unique?: BoolType; } /** - * Model for Form Column Request + * Model for Organisation User Update Request */ -export interface FormColumnReqType { - label?: string; - help?: any; - /** Model for Bool */ - required?: BoolType; - /** Model for Bool */ - show?: BoolType; - order?: number; - description?: string; - /** Model for Meta */ - meta?: MetaType; +export interface OrgUserReqType { + /** @format email */ + email?: string; + roles?: 'org-level-creator' | 'org-level-viewer'; } /** * Model for Paginated */ export interface PaginatedType { + /** Is the current page the first page */ + isFirstPage?: boolean; + /** Is the current page the last page */ + isLastPage?: boolean; + /** + * The current page + * @example 1 + */ + page?: number; /** * The number of pages * @example 10 @@ -1260,481 +1246,347 @@ export interface PaginatedType { * @example 1 */ totalRows?: number; - /** Is the current page the first page */ - isFirstPage?: boolean; - /** Is the current page the last page */ - isLastPage?: boolean; - /** - * The current page - * @example 1 - */ - page?: number; } /** - * Model for Hook List + * Model for Password + * @example password123456789 */ -export interface HookListType { - list?: object[]; - /** Model for Paginated */ - pageInfo?: PaginatedType; -} +export type PasswordType = string; /** - * Model for Shared View + * Model for Password Change Request */ -export interface SharedViewType { - /** Unique ID */ - id?: IdType; - fk_view_id?: string; - password?: string; - deleted?: string; +export interface PasswordChangeReqType { + currentPassword: string; + newPassword: string; } /** - * Model for Shared View List + * Model for Password Forgot Request */ -export interface SharedViewListType { - list?: SharedViewType[]; - /** Model for Paginated */ - pageInfo?: PaginatedType; +export interface PasswordForgotReqType { + /** + * Email address of the user + * @format email + */ + email: string; } /** - * Model for View List + * Model for Password Reset Request */ -export interface ViewListType { - list?: ViewType[]; - /** Model for Paginated */ - pageInfo?: PaginatedType; +export interface PasswordResetReqType { + /** + * New password + * @example newpassword + */ + password: string; } /** - * Model for Attachment + * Model for Plugin */ -export interface AttachmentType { - url?: string; - title?: string; - mimetype?: string; - size?: string; +export interface PluginType { + /** Model for Bool */ + active?: BoolType; + category?: string; + creator?: string; + creator_website?: string; + description?: string; + docs?: string; icon?: string; - path?: string; - data?: any; -} - -/** - * Model for Webhook - */ -export interface WebhookType { - /** Unique ID */ - id?: IdType; - title?: string; - type?: string; -} - -/** - * Model for Audit - */ -export interface AuditType { /** Unique ID */ id?: IdType; - user?: string; - ip?: string; - base_id?: string; - project_id?: string; - fk_model_id?: string; - row_id?: string; - op_type?: string; - op_sub_type?: string; + input?: StringOrNullType | number; + input_schema?: string; + logo?: string; + price?: string; + rating?: number; status?: string; - description?: string; - details?: string; -} - -/** - * Model for Hook - */ -export interface HookType { - /** Unique ID */ - id?: IdType; - fk_model_id?: string; + status_details?: string; + tags?: string; title?: string; - description?: string; - env?: string; - type?: string; - event?: 'after' | 'before'; - operation?: 'insert' | 'delete' | 'update'; - /** Model for Bool */ - async?: BoolType; - notification?: string; - retries?: number; - retry_interval?: number; - timeout?: number; - /** Model for Bool */ - active?: BoolType; -} - -/** - * Model for Hook Request - */ -export interface HookReqType { - fk_model_id?: string; - title: string; - /** Model for StringOrNull */ - description?: StringOrNullType; - env?: string; - event: 'after' | 'before'; - operation: 'insert' | 'delete' | 'update'; - /** Model for Bool */ - async?: BoolType; - notification: any; - retries?: number | null; - retry_interval?: number | null; - timeout?: number | null; - /** Model for Bool */ - active?: BoolType; -} - -/** - * Model for Hook Test Request - */ -export interface HookTestReqType { - payload: any; - /** Model for Hook Request */ - hook: HookReqType; -} - -/** - * Model for Signup Request - */ -export interface SignUpReqType { - /** - * Email address of the user - * @format email - * @example user@example.com - */ - email: string; - /** - * Password of the user - * @example password123456789 - */ - password: string; + version?: string; } /** - * Model for Signin Request + * Model for Plugin Request */ -export interface SignInReqType { - /** - * Email address of the user - * @format email - */ - email: string; - /** Password of the user */ - password: string; +export interface PluginReqType { + /** Model for Bool */ + active?: BoolType; + input?: any; } /** - * Model for Password Forgot Request + * Model for Plugin Test Request */ -export interface PasswordForgotReqType { - /** - * Email address of the user - * @format email - */ - email: string; +export interface PluginTestReqType { + input: any; + title: string; } /** - * Model for Password Reset Request + * Model for Project */ -export interface PasswordResetReqType { +export interface ProjectType { + /** List of base models */ + bases?: BaseType[]; /** - * New password - * @example newpassword + * Primary Theme Color + * @example #24716E */ - password: string; + color?: string; + /** + * The created time of the record + * @format date-time + * @example 2023-03-01 14:27:36 + */ + created_at?: string; + /** Is the project deleted */ + deleted?: BoolType; + /** + * Project Description + * @example This is my project description + */ + description?: string; + /** + * Unique Project ID + * @example p_124hhlkbeasewh + */ + id?: string; + /** Model for Bool */ + is_meta?: BoolType; + /** Meta Info such as theme colors */ + meta?: MetaType; + /** The order in project list */ + order?: number; + /** + * Project prefix. Used in XCDB only. + * @example nc_vm5q__ + */ + prefix?: string; + status?: string; + /** + * Project Title + * @example my-project + */ + title?: string; + /** + * The updated time of the record + * @format date-time + * @example 2023-03-01 14:27:36 + */ + updated_at?: string; } /** - * Model for Password Change Request + * Model for Project List */ -export interface PasswordChangeReqType { - currentPassword: string; - newPassword: string; +export interface ProjectListType { + /** List of Project Models */ + list?: ProjectType[]; + /** Pagination Info */ + pageInfo?: PaginatedType; } /** - * Model for API Token Request + * Model for Project Request */ -export interface ApiTokenReqType { - /** Description of the API token */ +export interface ProjectReqType { + /** Array of Bases */ + bases?: BaseReqType[]; + /** + * Primary Theme Color + * @example #24716E + */ + color?: string; + /** + * Project Description + * @example This is my project description + */ description?: string; + /** + * Project Title + * @example My Project + */ + title: string; } /** - * Model for Plugin + * Model for Project User Request */ -export interface PluginType { - /** Unique ID */ - id?: IdType; - title?: string; - description?: string; - /** Model for Bool */ - active?: BoolType; - rating?: number; - version?: string; - docs?: string; - status?: string; - status_details?: string; - logo?: string; - icon?: string; - tags?: string; - category?: string; - input_schema?: string; - input?: number | StringOrNullType; - creator?: string; - creator_website?: string; - price?: string; +export interface ProjectUserReqType { + /** @format email */ + email: string; + roles: 'commenter' | 'editor' | 'guest' | 'owner' | 'viewer'; } /** - * Model for ModelRoleVisibility + * Model for Rollup */ -export interface ModelRoleVisibilityType { +export interface RollupType { + deleted?: string; + /** Foreign Key to Column */ + fk_column_id?: IdType; + fk_relation_column_id?: string; + fk_rollup_column_id?: string; /** Unique ID */ id?: IdType; - project_id?: string; - base_id?: string; - fk_model_id?: string; - fk_view_id?: string; - role?: string; + order?: string; + rollup_function?: string; + type?: string; /** Model for Bool */ - disabled?: BoolType; + virtual?: BoolType; } /** - * Model for API Token + * Model for Rollup Column Request */ -export interface ApiTokenType { - /** Unique ID */ - id?: IdType; - token?: string; - description?: string; - fk_user_id?: string; - created_at?: any; - updated_at?: any; +export interface RollupColumnReqType { + /** Model for ID */ + fk_relation_column_id: IdType; + /** Model for ID */ + fk_rollup_column_id: IdType; + rollup_function: + | 'avg' + | 'avgDistinct' + | 'count' + | 'countDistinct' + | 'max' + | 'min' + | 'sum' + | 'sumDistinct'; + title: string; + uidt: 'Rollup'; } /** - * Model for Hook Log + * Model for SelectOption */ -export interface HookLogType { +export interface SelectOptionType { + color?: string; + /** Foreign Key to Column */ + fk_column_id?: IdType; /** Unique ID */ - id?: IdType; - base_id?: string; - project_id?: string; - /** Model for StringOrNull */ - fk_hook_id?: StringOrNullType; - type?: string; - event?: string; - operation?: string; - /** Model for Bool */ - test_call?: BoolType; - payload?: any; - conditions?: string; - notifications?: string; - error_code?: string; - error_message?: string; - error?: string; - execution_time?: string; - response?: string; - triggered_by?: string; - created_at?: string; - updated_at?: string; -} - -/** - * Model for Normal Column Request - */ -export interface NormalColumnRequestType { - uidt?: - | 'ID' - | 'SingleLineText' - | 'LongText' - | 'Attachment' - | 'Checkbox' - | 'MultiSelect' - | 'SingleSelect' - | 'Collaborator' - | 'Date' - | 'Year' - | 'GeoData' - | 'Time' - | 'PhoneNumber' - | 'Email' - | 'URL' - | 'Number' - | 'Decimal' - | 'Currency' - | 'Percent' - | 'Duration' - | 'Rating' - | 'Count' - | 'DateTime' - | 'CreateTime' - | 'LastModifiedTime' - | 'AutoNumber' - | 'Geometry' - | 'JSON' - | 'SpecificDBType' - | 'Barcode' - | 'Button'; - title?: string; - dt?: string; - np?: number | StringOrNullType; - ns?: number | StringOrNullType; - /** Model for Bool */ - pk?: BoolType; - /** Model for Bool */ - pv?: BoolType; - /** Model for Bool */ - rqd?: BoolType; - column_name?: string; - /** Model for Bool */ - un?: BoolType; - /** Model for Bool */ - ai?: BoolType; - /** Model for Bool */ - unique?: BoolType; - /** Model for StringOrNull */ - cdf?: StringOrNullType; - /** Model for StringOrNull */ - cc?: StringOrNullType; - /** Model for StringOrNull */ - csn?: StringOrNullType; - /** Model for StringOrNull */ - dtx?: StringOrNullType; - dtxp?: number | StringOrNullType; - dtxs?: number | StringOrNullType; - /** Model for Bool */ - au?: BoolType; + id?: IdType; + order?: number; + title?: string; } /** - * Model for LinkToAnotherColumn Request + * Model for SelectOptions */ -export interface LinkToAnotherColumnReqType { - uidt: 'LinkToAnotherRecord'; - title: string; - /** Model for Bool */ - virtual?: BoolType; - /** Model for ID */ - parentId: IdType; - /** Model for ID */ - childId: IdType; - type: 'hm' | 'bt' | 'mm'; +export interface SelectOptionsType { + options: SelectOptionType[]; } /** - * Model for Rollup Column Request + * Model for Shared Base Request */ -export interface RollupColumnReqType { - uidt: 'Rollup'; - title: string; - /** Model for ID */ - fk_relation_column_id: IdType; - /** Model for ID */ - fk_rollup_column_id: IdType; - rollup_function: - | 'count' - | 'min' - | 'max' - | 'avg' - | 'sum' - | 'countDistinct' - | 'sumDistinct' - | 'avgDistinct'; +export interface SharedBaseReqType { + password?: string; + roles?: 'commenter' | 'editor' | 'viewer'; } /** - * Model for Lookup Column Request + * Model for Shared View */ -export interface LookupColumnReqType { - uidt: 'Lookup'; - title: string; - /** Model for ID */ - fk_relation_column_id: IdType; - /** Model for ID */ - fk_lookup_column_id: IdType; +export interface SharedViewType { + deleted?: string; + fk_view_id?: string; + /** Unique ID */ + id?: IdType; + password?: string; } /** - * Model for Formula Column Request + * Model for Shared View List */ -export interface FormulaColumnReqType { - uidt?: 'Formula'; - formula_raw?: string; - formula?: string; - title?: string; +export interface SharedViewListType { + list?: SharedViewType[]; + /** Model for Paginated */ + pageInfo?: PaginatedType; } /** - * Model for User Info + * Model for Shared View Request */ -export interface UserInfoType { - /** User ID */ - id?: string; +export interface SharedViewReqType { + /** Meta data passing to Shared View such as if download is allowed or not. */ + meta?: MetaType; /** - * User Email + * Password to restrict access + * @example 123456789 + */ + password?: string; +} + +/** + * Model for Signin Request + */ +export interface SignInReqType { + /** + * Email address of the user * @format email */ - email?: string; - /** Set to true if the user's email has been verified. */ - email_verified?: boolean; - /** The firstname of the user */ - firstname?: string; - /** The lastname of the user */ - lastname?: string; - /** The roles of the user */ - roles?: any; + email: string; + /** Password of the user */ + password: string; } /** - * Model for Visibility Rule Request + * Model for Signup Request */ -export type VisibilityRuleReqType = { - disabled?: { - /** Model for Bool */ - commenter?: BoolType; - /** Model for Bool */ - creator?: BoolType; - /** Model for Bool */ - editor?: BoolType; - /** Model for Bool */ - guest?: BoolType; - /** Model for Bool */ - owner?: BoolType; - /** Model for Bool */ - viewer?: BoolType; - }; -}[]; +export interface SignUpReqType { + /** + * Email address of the user + * @format email + * @example user@example.com + */ + email: string; + /** + * Password of the user + * @example password123456789 + */ + password: string; +} /** - * Model for Bool + * Model for Sort */ -export type BoolType = boolean | number | null; +export interface SortType { + base_id?: string; + direction?: string; + /** Model for ID */ + fk_column_id?: IdType; + /** Model for ID */ + fk_model_id?: IdType; + /** Unique ID */ + id?: IdType; + order?: number; + project_id?: string; +} /** - * Model for ID + * Model for Sort List */ -export type IdType = string; +export interface SortListType { + sorts: { + list: SharedViewType[]; + }; +} /** - * Model for Password - * @example password123456789 + * Model for Sort Request */ -export type PasswordType = string; +export interface SortReqType { + /** Sort direction */ + direction?: 'asc' | 'desc'; + /** Foreign Key to Column */ + fk_column_id?: IdType; +} /** * Model for StringOrNull @@ -1742,98 +1594,246 @@ export type PasswordType = string; export type StringOrNullType = string | null; /** - * Model for Meta + * Model for Table */ -export type MetaType = object | string | null; +export interface TableType { + /** Unique Base ID */ + base_id?: string; + /** The columns included in this table */ + columns?: ColumnType[]; + /** Column Models grouped by IDs */ + columnsById?: object; + /** Model for Bool */ + deleted?: BoolType; + /** Is this table enabled? */ + enabled?: BoolType; + /** Unique Table ID */ + id?: string; + /** Meta Data */ + meta?: MetaType; + /** Is this table used for M2M */ + mm?: BoolType; + /** The order of the list of tables */ + order?: number; + /** Currently not in use */ + pinned?: BoolType; + /** Unique Project ID */ + project_id?: string; + /** Table Name. Prefix will be added for XCDB projects. */ + table_name: string; + /** Currently not in use */ + tags?: string; + /** Table Title */ + title: string; + /** Table Type */ + type?: string; +} /** - * Model for Comment Request + * Model for Table List */ -export interface CommentReqType { - row_id: string; - fk_model_id: string; - description?: string; +export interface TableListType { + list?: TableType[]; + /** Model for Paginated */ + pageInfo?: PaginatedType; } /** - * Model for Audit Row Update Request + * Model for Table Request */ -export interface AuditRowUpdateReqType { - fk_model_id?: string; - column_name?: string; - row_id?: string; - value?: any; - prev_value?: any; +export interface TableReqType { + /** The column models in this table */ + columns: NormalColumnRequestType[]; + /** the meta data for this table */ + meta?: MetaType; + /** + * The order of table list + * @example 1 + */ + order?: number; + /** + * Table name + * @example my_table + */ + table_name: string; + /** + * Table title + * @example My Table + */ + title: string; +} + +/** + * Model for User + */ +export interface UserType { + /** + * The date that the user was created. + * @format date-time + * @example 2023-03-01 11:36:49 + */ + created_at?: string; + /** + * The email of the user + * @format email + * @example alice.smith@nocodb.com + */ + email: string; + /** Set to true if the user's email has been verified. */ + email_verified: boolean; + /** + * The first name of the user + * @example Alice + */ + firstname: string; + /** + * Unique identifier for the given user. + * @example us_8kugj628ebjngs + */ + id: string; + /** + * The last name of the user + * @example Smith + */ + lastname: string; + /** + * The roles of the user + * @example org-level-viewer + */ + roles?: string; + /** + * The date that the user was created. + * @format date-time + * @example 2023-03-01 11:36:49 + */ + updated_at?: string; } /** - * Model for Organisation User Update Request + * Model for User Info */ -export interface OrgUserReqType { - /** @format email */ +export interface UserInfoType { + /** + * User Email + * @format email + */ email?: string; - roles?: 'org-level-creator' | 'org-level-viewer'; + /** Set to true if the user's email has been verified. */ + email_verified?: boolean; + /** The firstname of the user */ + firstname?: string; + /** User ID */ + id?: string; + /** The lastname of the user */ + lastname?: string; + /** The roles of the user */ + roles?: any; } /** - * Model for Project User Request + * Model for User List */ -export interface ProjectUserReqType { - /** @format email */ - email: string; - roles: 'owner' | 'editor' | 'viewer' | 'commenter' | 'guest'; +export interface UserListType { + /** users includes `list` and `pageInfo` */ + users: { + /** List of User objects */ + list: UserType; + /** Pagination info */ + pageInfo: PaginatedType; + }; } /** - * Model for Shared Base Request + * Model for View */ -export interface SharedBaseReqType { - roles?: 'editor' | 'viewer' | 'commenter'; +export interface ViewType { + /** Unique Base ID */ + base_id?: IdType; + /** Unique Model ID */ + fk_model_id: IdType; + /** Unique ID for View */ + id?: IdType; + /** Lock Type of the view */ + lock_type?: 'collaborative' | 'locked' | 'personal'; + /** Meta data for this view */ + meta?: MetaType; + /** The rder of the list of views */ + order?: number; + /** Password for protecting the view */ password?: string; -} - -/** - * Model for Plugin Test Request - */ -export interface PluginTestReqType { + /** Unique Project ID */ + project_id?: IdType; + /** If this view is shown? */ + show: BoolType; + /** Should show system fields in this view? */ + show_system_fields?: BoolType; + /** View Title */ title: string; - input: any; + /** View Type */ + type: number; + /** UUID of the view */ + uuid?: string; + /** Associated View Model */ + view?: + | FormType + | GalleryType + | GridType + | KanbanType + | MapType + | (FormType & GalleryType & GridType & KanbanType & MapType); } /** - * Model for Plugin Request + * Model for View List */ -export interface PluginReqType { - /** Model for Bool */ - active?: BoolType; - input?: any; +export interface ViewListType { + list?: ViewType[]; + /** Model for Paginated */ + pageInfo?: PaginatedType; } /** * Model for View Request */ export interface ViewReqType { - /** @min 0 */ - order?: number; + lock_type?: 'collaborative' | 'locked' | 'personal'; /** Model for Meta */ meta?: MetaType; - title?: string; + /** @min 0 */ + order?: number; /** Model for Bool */ show_system_fields?: BoolType; - lock_type?: 'collaborative' | 'locked' | 'personal'; + title?: string; } /** - * Model for Shared View Request + * Model for Visibility Rule Request */ -export interface SharedViewReqType { - /** - * Password to restrict access - * @example 123456789 - */ - password?: string; - /** Meta data passing to Shared View such as if download is allowed or not. */ - meta?: MetaType; +export type VisibilityRuleReqType = { + disabled?: { + /** Model for Bool */ + commenter?: BoolType; + /** Model for Bool */ + creator?: BoolType; + /** Model for Bool */ + editor?: BoolType; + /** Model for Bool */ + guest?: BoolType; + /** Model for Bool */ + owner?: BoolType; + /** Model for Bool */ + viewer?: BoolType; + }; +}[]; + +/** + * Model for Webhook + */ +export interface WebhookType { + /** Unique ID */ + id?: IdType; + title?: string; + type?: string; } import axios, { AxiosInstance, AxiosRequestConfig, ResponseType } from 'axios'; @@ -4816,10 +4816,26 @@ export class Api< columnName: string, refRowId: string, query?: { - /** @min 1 */ - limit?: number; - /** @min 0 */ + /** Which fields to be shown */ + fields?: any[]; + /** The result will be sorted based on `sort` query */ + sort?: string[] | string; + /** Extra filtering */ + where?: string; + /** + * Offset in rows + * @min 0 + */ offset?: number; + /** + * Limit in rows + * @min 1 + */ + limit?: number; + /** Used for multiple sort queries */ + sortArrJson?: string; + /** Used for multiple filter queries */ + filterArrJson?: string; }, params: RequestParams = {} ) => @@ -5210,10 +5226,26 @@ export class Api< sharedViewUuid: string, columnId: IdType, query?: { - /** @min 1 */ - limit?: number; - /** @min 0 */ + /** Which fields to be shown */ + fields?: any[]; + /** The result will be sorted based on `sort` query */ + sort?: string[] | string; + /** Extra filtering */ + where?: string; + /** + * Offset in rows + * @min 0 + */ offset?: number; + /** + * Limit in rows + * @min 1 + */ + limit?: number; + /** Used for multiple sort queries */ + sortArrJson?: string; + /** Used for multiple filter queries */ + filterArrJson?: string; }, params: RequestParams = {} ) => @@ -5237,10 +5269,26 @@ export class Api< dataList: ( sharedViewUuid: string, query?: { - /** @min 1 */ - limit?: number; - /** @min 0 */ + /** Which fields to be shown */ + fields?: any[]; + /** The result will be sorted based on `sort` query */ + sort?: string[] | string; + /** Extra filtering */ + where?: string; + /** + * Offset in rows + * @min 0 + */ offset?: number; + /** + * Limit in rows + * @min 1 + */ + limit?: number; + /** Used for multiple sort queries */ + sortArrJson?: string; + /** Used for multiple filter queries */ + filterArrJson?: string; }, params: RequestParams = {} ) => @@ -5290,10 +5338,26 @@ export class Api< relationType: 'mm' | 'hm' | 'bt', columnName: string, query?: { - /** @min 1 */ - limit?: number; - /** @min 0 */ + /** Which fields to be shown */ + fields?: any[]; + /** The result will be sorted based on `sort` query */ + sort?: string[] | string; + /** Extra filtering */ + where?: string; + /** + * Offset in rows + * @min 0 + */ offset?: number; + /** + * Limit in rows + * @min 1 + */ + limit?: number; + /** Used for multiple sort queries */ + sortArrJson?: string; + /** Used for multiple filter queries */ + filterArrJson?: string; }, params: RequestParams = {} ) => @@ -5338,10 +5402,26 @@ export class Api< sharedViewUuid: string, columnName: string, query?: { - /** @min 1 */ - limit?: number; - /** @min 0 */ + /** Which fields to be shown */ + fields?: any[]; + /** The result will be sorted based on `sort` query */ + sort?: string[] | string; + /** Extra filtering */ + where?: string; + /** + * Offset in rows + * @min 0 + */ offset?: number; + /** + * Limit in rows + * @min 1 + */ + limit?: number; + /** Used for multiple sort queries */ + sortArrJson?: string; + /** Used for multiple filter queries */ + filterArrJson?: string; }, params: RequestParams = {} ) =>