|
|
|
@ -14,17 +14,22 @@ export interface UserType {
|
|
|
|
|
id: string; |
|
|
|
|
firstname: string; |
|
|
|
|
lastname: string; |
|
|
|
|
|
|
|
|
|
/** @format email */ |
|
|
|
|
email: string; |
|
|
|
|
|
|
|
|
|
/** @format email */ |
|
|
|
|
roles?: string; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @format date |
|
|
|
|
* @example 1997-10-31 |
|
|
|
|
*/ |
|
|
|
|
date_of_birth?: string; |
|
|
|
|
|
|
|
|
|
/** Set to true if the user's email has been verified. */ |
|
|
|
|
email_verified: boolean; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The date that the user was created. |
|
|
|
|
* @format date |
|
|
|
@ -39,10 +44,7 @@ export interface PageReqQueryParamsType {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface UserListType { |
|
|
|
|
users: { |
|
|
|
|
list: UserType; |
|
|
|
|
pageInfo: PaginatedType; |
|
|
|
|
}; |
|
|
|
|
users: { list: UserType; pageInfo: PaginatedType }; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface ProjectReqType { |
|
|
|
@ -99,10 +101,7 @@ export interface BaseReqType {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface BaseListType { |
|
|
|
|
bases: { |
|
|
|
|
list: BaseType[]; |
|
|
|
|
pageInfo: PaginatedType; |
|
|
|
|
}; |
|
|
|
|
bases: { list: BaseType[]; pageInfo: PaginatedType }; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface TableType { |
|
|
|
@ -188,7 +187,7 @@ export interface FilterType {
|
|
|
|
|
fk_column_id?: string; |
|
|
|
|
logical_op?: string; |
|
|
|
|
comparison_op?: string; |
|
|
|
|
value?: string | number | boolean | null; |
|
|
|
|
value?: string | number | number | boolean | null; |
|
|
|
|
is_group?: boolean; |
|
|
|
|
children?: FilterType[]; |
|
|
|
|
project_id?: string; |
|
|
|
@ -199,9 +198,7 @@ export interface FilterType {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface FilterListType { |
|
|
|
|
filters: { |
|
|
|
|
list: FilterType[]; |
|
|
|
|
}; |
|
|
|
|
filters: { list: FilterType[] }; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface SortType { |
|
|
|
@ -215,9 +212,7 @@ export interface SortType {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface SortListType { |
|
|
|
|
sorts: { |
|
|
|
|
list: SharedViewType[]; |
|
|
|
|
}; |
|
|
|
|
sorts: { list: SharedViewType[] }; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface ColumnType { |
|
|
|
@ -261,9 +256,7 @@ export interface ColumnType {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface ColumnListType { |
|
|
|
|
columns: { |
|
|
|
|
list: ColumnType[]; |
|
|
|
|
}; |
|
|
|
|
columns: { list: ColumnType[] }; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface LinkToAnotherRecordType { |
|
|
|
@ -676,12 +669,7 @@ export type ColumnReqType =
|
|
|
|
|
fk_relation_column_id?: string; |
|
|
|
|
fk_lookup_column_id?: string; |
|
|
|
|
} |
|
|
|
|
| { |
|
|
|
|
uidt?: string; |
|
|
|
|
formula_raw?: string; |
|
|
|
|
formula?: string; |
|
|
|
|
title?: string; |
|
|
|
|
}; |
|
|
|
|
| { uidt?: string; formula_raw?: string; formula?: string; title?: string }; |
|
|
|
|
|
|
|
|
|
export interface UserInfoType { |
|
|
|
|
id?: string; |
|
|
|
@ -866,32 +854,16 @@ export class Api<
|
|
|
|
|
* @name Signup |
|
|
|
|
* @summary Signup |
|
|
|
|
* @request POST:/api/v1/auth/user/signup |
|
|
|
|
* @response `200` `{
|
|
|
|
|
token?: string, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `400` `{
|
|
|
|
|
msg?: string, |
|
|
|
|
|
|
|
|
|
}` Bad Request
|
|
|
|
|
* @response `200` `{ token?: string }` OK |
|
|
|
|
* @response `400` `{ msg?: string }` Bad Request |
|
|
|
|
* @response `401` `void` Unauthorized |
|
|
|
|
* @response `403` `void` Forbidden |
|
|
|
|
*/ |
|
|
|
|
signup: ( |
|
|
|
|
data: { |
|
|
|
|
email?: string; |
|
|
|
|
password?: string; |
|
|
|
|
}, |
|
|
|
|
data: { email?: string; password?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
token?: string; |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
msg?: string; |
|
|
|
|
} | void |
|
|
|
|
>({ |
|
|
|
|
this.request<{ token?: string }, { msg?: string } | void>({ |
|
|
|
|
path: `/api/v1/auth/user/signup`, |
|
|
|
|
method: 'POST', |
|
|
|
|
body: data, |
|
|
|
@ -906,30 +878,14 @@ export class Api<
|
|
|
|
|
* @name Signin |
|
|
|
|
* @summary Signin |
|
|
|
|
* @request POST:/api/v1/auth/user/signin |
|
|
|
|
* @response `200` `{
|
|
|
|
|
token?: string, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `400` `{
|
|
|
|
|
msg?: string, |
|
|
|
|
|
|
|
|
|
}` Bad Request
|
|
|
|
|
* @response `200` `{ token?: string }` OK |
|
|
|
|
* @response `400` `{ msg?: string }` Bad Request |
|
|
|
|
*/ |
|
|
|
|
signin: ( |
|
|
|
|
data: { |
|
|
|
|
email: string; |
|
|
|
|
password: string; |
|
|
|
|
}, |
|
|
|
|
data: { email: string; password: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
token?: string; |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
msg?: string; |
|
|
|
|
} |
|
|
|
|
>({ |
|
|
|
|
this.request<{ token?: string }, { msg?: string }>({ |
|
|
|
|
path: `/api/v1/auth/user/signin`, |
|
|
|
|
method: 'POST', |
|
|
|
|
body: data, |
|
|
|
@ -947,13 +903,7 @@ export class Api<
|
|
|
|
|
* @request GET:/api/v1/auth/user/me |
|
|
|
|
* @response `200` `UserInfoType` OK |
|
|
|
|
*/ |
|
|
|
|
me: ( |
|
|
|
|
query?: { |
|
|
|
|
/** Pass project id to get project specific roles along with user info */ |
|
|
|
|
project_id?: string; |
|
|
|
|
}, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
me: (query?: { project_id?: string }, params: RequestParams = {}) => |
|
|
|
|
this.request<UserInfoType, any>({ |
|
|
|
|
path: `/api/v1/auth/user/me`, |
|
|
|
|
method: 'GET', |
|
|
|
@ -972,12 +922,7 @@ export class Api<
|
|
|
|
|
* @response `200` `void` OK |
|
|
|
|
* @response `401` `void` Unauthorized |
|
|
|
|
*/ |
|
|
|
|
passwordForgot: ( |
|
|
|
|
data: { |
|
|
|
|
email?: string; |
|
|
|
|
}, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
passwordForgot: (data: { email?: string }, params: RequestParams = {}) => |
|
|
|
|
this.request<void, void>({ |
|
|
|
|
path: `/api/v1/auth/password/forgot`, |
|
|
|
|
method: 'POST', |
|
|
|
@ -993,30 +938,14 @@ export class Api<
|
|
|
|
|
* @name PasswordChange |
|
|
|
|
* @summary Password change |
|
|
|
|
* @request POST:/api/v1/auth/password/change |
|
|
|
|
* @response `200` `{
|
|
|
|
|
msg?: string, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `400` `{
|
|
|
|
|
msg?: string, |
|
|
|
|
|
|
|
|
|
}` Bad request
|
|
|
|
|
* @response `200` `{ msg?: string }` OK |
|
|
|
|
* @response `400` `{ msg?: string }` Bad request |
|
|
|
|
*/ |
|
|
|
|
passwordChange: ( |
|
|
|
|
data: { |
|
|
|
|
currentPassword?: string; |
|
|
|
|
newPassword?: string; |
|
|
|
|
}, |
|
|
|
|
data: { currentPassword?: string; newPassword?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
msg?: string; |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
msg?: string; |
|
|
|
|
} |
|
|
|
|
>({ |
|
|
|
|
this.request<{ msg?: string }, { msg?: string }>({ |
|
|
|
|
path: `/api/v1/auth/password/change`, |
|
|
|
|
method: 'POST', |
|
|
|
|
body: data, |
|
|
|
@ -1068,9 +997,7 @@ export class Api<
|
|
|
|
|
*/ |
|
|
|
|
passwordReset: ( |
|
|
|
|
token: string, |
|
|
|
|
data: { |
|
|
|
|
new_password?: string; |
|
|
|
|
}, |
|
|
|
|
data: { new_password?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<void, any>({ |
|
|
|
@ -1104,23 +1031,11 @@ export class Api<
|
|
|
|
|
* @name ProjectUserList |
|
|
|
|
* @summary Project users |
|
|
|
|
* @request GET:/api/v1/db/meta/projects/{projectId}/users |
|
|
|
|
* @response `200` `{
|
|
|
|
|
users?: { |
|
|
|
|
list: (UserType)[], |
|
|
|
|
pageInfo: PaginatedType, |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ users?: { list: (UserType)[], pageInfo: PaginatedType } }` OK |
|
|
|
|
*/ |
|
|
|
|
projectUserList: (projectId: string, params: RequestParams = {}) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
users?: { |
|
|
|
|
list: UserType[]; |
|
|
|
|
pageInfo: PaginatedType; |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
{ users?: { list: UserType[]; pageInfo: PaginatedType } }, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
path: `/api/v1/db/meta/projects/${projectId}/users`, |
|
|
|
@ -1225,17 +1140,7 @@ export class Api<
|
|
|
|
|
* @name MetaGet |
|
|
|
|
* @summary Project info |
|
|
|
|
* @request GET:/api/v1/db/meta/projects/{projectId}/info |
|
|
|
|
* @response `200` `{
|
|
|
|
|
Node?: string, |
|
|
|
|
Arch?: string, |
|
|
|
|
Platform?: string, |
|
|
|
|
Docker?: boolean, |
|
|
|
|
Database?: string, |
|
|
|
|
ProjectOnRootDB?: string, |
|
|
|
|
RootDB?: string, |
|
|
|
|
PackageVersion?: string, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ Node?: string, Arch?: string, Platform?: string, Docker?: boolean, Database?: string, ProjectOnRootDB?: string, RootDB?: string, PackageVersion?: string }` OK |
|
|
|
|
*/ |
|
|
|
|
metaGet: (projectId: string, params: RequestParams = {}, query: object) => |
|
|
|
|
this.request< |
|
|
|
@ -1269,9 +1174,7 @@ export class Api<
|
|
|
|
|
*/ |
|
|
|
|
modelVisibilityList: ( |
|
|
|
|
projectId: string, |
|
|
|
|
query?: { |
|
|
|
|
includeM2M?: boolean; |
|
|
|
|
}, |
|
|
|
|
query?: { includeM2M?: boolean }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any[], any>({ |
|
|
|
@ -1314,11 +1217,7 @@ export class Api<
|
|
|
|
|
* @response `201` `ProjectListType` |
|
|
|
|
*/ |
|
|
|
|
list: ( |
|
|
|
|
query?: { |
|
|
|
|
page?: number; |
|
|
|
|
pageSize?: number; |
|
|
|
|
sort?: string; |
|
|
|
|
}, |
|
|
|
|
query?: { page?: number; pageSize?: number; sort?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<ProjectListType, any>({ |
|
|
|
@ -1338,9 +1237,7 @@ export class Api<
|
|
|
|
|
* @response `200` `ProjectType` OK |
|
|
|
|
*/ |
|
|
|
|
create: ( |
|
|
|
|
data: ProjectType & { |
|
|
|
|
external?: boolean; |
|
|
|
|
}, |
|
|
|
|
data: ProjectType & { external?: boolean }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<ProjectType, any>({ |
|
|
|
@ -1409,22 +1306,10 @@ export class Api<
|
|
|
|
|
* @tags Project |
|
|
|
|
* @name SharedBaseGet |
|
|
|
|
* @request GET:/api/v1/db/meta/projects/{projectId}/shared |
|
|
|
|
* @response `200` `{
|
|
|
|
|
uuid?: string, |
|
|
|
|
url?: string, |
|
|
|
|
roles?: string, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ uuid?: string, url?: string, roles?: string }` OK |
|
|
|
|
*/ |
|
|
|
|
sharedBaseGet: (projectId: string, params: RequestParams = {}) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
uuid?: string; |
|
|
|
|
url?: string; |
|
|
|
|
roles?: string; |
|
|
|
|
}, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
this.request<{ uuid?: string; url?: string; roles?: string }, any>({ |
|
|
|
|
path: `/api/v1/db/meta/projects/${projectId}/shared`, |
|
|
|
|
method: 'GET', |
|
|
|
|
format: 'json', |
|
|
|
@ -1452,29 +1337,14 @@ export class Api<
|
|
|
|
|
* @tags Project |
|
|
|
|
* @name SharedBaseCreate |
|
|
|
|
* @request POST:/api/v1/db/meta/projects/{projectId}/shared |
|
|
|
|
* @response `200` `{
|
|
|
|
|
uuid?: string, |
|
|
|
|
url?: string, |
|
|
|
|
roles?: string, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ uuid?: string, url?: string, roles?: string }` OK |
|
|
|
|
*/ |
|
|
|
|
sharedBaseCreate: ( |
|
|
|
|
projectId: string, |
|
|
|
|
data: { |
|
|
|
|
roles?: string; |
|
|
|
|
password?: string; |
|
|
|
|
}, |
|
|
|
|
data: { roles?: string; password?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
uuid?: string; |
|
|
|
|
url?: string; |
|
|
|
|
roles?: string; |
|
|
|
|
}, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
this.request<{ uuid?: string; url?: string; roles?: string }, any>({ |
|
|
|
|
path: `/api/v1/db/meta/projects/${projectId}/shared`, |
|
|
|
|
method: 'POST', |
|
|
|
|
body: data, |
|
|
|
@ -1489,29 +1359,14 @@ export class Api<
|
|
|
|
|
* @tags Project |
|
|
|
|
* @name SharedBaseUpdate |
|
|
|
|
* @request PATCH:/api/v1/db/meta/projects/{projectId}/shared |
|
|
|
|
* @response `200` `{
|
|
|
|
|
uuid?: string, |
|
|
|
|
url?: string, |
|
|
|
|
roles?: string, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ uuid?: string, url?: string, roles?: string }` OK |
|
|
|
|
*/ |
|
|
|
|
sharedBaseUpdate: ( |
|
|
|
|
projectId: string, |
|
|
|
|
data: { |
|
|
|
|
roles?: string; |
|
|
|
|
password?: string; |
|
|
|
|
}, |
|
|
|
|
data: { roles?: string; password?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
uuid?: string; |
|
|
|
|
url?: string; |
|
|
|
|
roles?: string; |
|
|
|
|
}, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
this.request<{ uuid?: string; url?: string; roles?: string }, any>({ |
|
|
|
|
path: `/api/v1/db/meta/projects/${projectId}/shared`, |
|
|
|
|
method: 'PATCH', |
|
|
|
|
body: data, |
|
|
|
@ -1575,27 +1430,14 @@ export class Api<
|
|
|
|
|
* @tags Project |
|
|
|
|
* @name AuditList |
|
|
|
|
* @request GET:/api/v1/db/meta/projects/{projectId}/audits |
|
|
|
|
* @response `200` `{
|
|
|
|
|
list: (AuditType)[], |
|
|
|
|
pageInfo: PaginatedType, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ list: (AuditType)[], pageInfo: PaginatedType }` OK |
|
|
|
|
*/ |
|
|
|
|
auditList: ( |
|
|
|
|
projectId: string, |
|
|
|
|
query?: { |
|
|
|
|
offset?: string; |
|
|
|
|
limit?: string; |
|
|
|
|
}, |
|
|
|
|
query?: { offset?: string; limit?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
list: AuditType[]; |
|
|
|
|
pageInfo: PaginatedType; |
|
|
|
|
}, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
this.request<{ list: AuditType[]; pageInfo: PaginatedType }, any>({ |
|
|
|
|
path: `/api/v1/db/meta/projects/${projectId}/audits`, |
|
|
|
|
method: 'GET', |
|
|
|
|
query: query, |
|
|
|
@ -1677,10 +1519,7 @@ export class Api<
|
|
|
|
|
*/ |
|
|
|
|
update: ( |
|
|
|
|
tableId: string, |
|
|
|
|
data: { |
|
|
|
|
table_name?: string; |
|
|
|
|
project_id?: string; |
|
|
|
|
}, |
|
|
|
|
data: { table_name?: string; project_id?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -1717,9 +1556,7 @@ export class Api<
|
|
|
|
|
*/ |
|
|
|
|
reorder: ( |
|
|
|
|
tableId: string, |
|
|
|
|
data: { |
|
|
|
|
order?: number; |
|
|
|
|
}, |
|
|
|
|
data: { order?: number }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<void, any>({ |
|
|
|
@ -1873,9 +1710,7 @@ export class Api<
|
|
|
|
|
*/ |
|
|
|
|
showAllColumn: ( |
|
|
|
|
viewId: string, |
|
|
|
|
query?: { |
|
|
|
|
ignoreIds?: any[]; |
|
|
|
|
}, |
|
|
|
|
query?: { ignoreIds?: any[] }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<void, any>({ |
|
|
|
@ -1895,9 +1730,7 @@ export class Api<
|
|
|
|
|
*/ |
|
|
|
|
hideAllColumn: ( |
|
|
|
|
viewId: string, |
|
|
|
|
query?: { |
|
|
|
|
ignoreIds?: any[]; |
|
|
|
|
}, |
|
|
|
|
query?: { ignoreIds?: any[] }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<void, any>({ |
|
|
|
@ -2229,18 +2062,10 @@ export class Api<
|
|
|
|
|
* @tags DB view share |
|
|
|
|
* @name Create |
|
|
|
|
* @request POST:/api/v1/db/meta/views/{viewId}/share |
|
|
|
|
* @response `200` `{
|
|
|
|
|
uuid?: string, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ uuid?: string }` OK |
|
|
|
|
*/ |
|
|
|
|
create: (viewId: string, params: RequestParams = {}) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
uuid?: string; |
|
|
|
|
}, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
this.request<{ uuid?: string }, any>({ |
|
|
|
|
path: `/api/v1/db/meta/views/${viewId}/share`, |
|
|
|
|
method: 'POST', |
|
|
|
|
format: 'json', |
|
|
|
@ -2257,10 +2082,7 @@ export class Api<
|
|
|
|
|
*/ |
|
|
|
|
update: ( |
|
|
|
|
viewId: string, |
|
|
|
|
data: { |
|
|
|
|
password?: string; |
|
|
|
|
meta?: any; |
|
|
|
|
}, |
|
|
|
|
data: { password?: string; meta?: any }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<SharedViewType, any>({ |
|
|
|
@ -2348,23 +2170,10 @@ export class Api<
|
|
|
|
|
* @tags DB table sort |
|
|
|
|
* @name List |
|
|
|
|
* @request GET:/api/v1/db/meta/views/{viewId}/sorts |
|
|
|
|
* @response `200` `{
|
|
|
|
|
sorts?: { |
|
|
|
|
list?: (SortType)[], |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ sorts?: { list?: (SortType)[] } }` OK |
|
|
|
|
*/ |
|
|
|
|
list: (viewId: string, params: RequestParams = {}) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
sorts?: { |
|
|
|
|
list?: SortType[]; |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
this.request<{ sorts?: { list?: SortType[] } }, any>({ |
|
|
|
|
path: `/api/v1/db/meta/views/${viewId}/sorts`, |
|
|
|
|
method: 'GET', |
|
|
|
|
format: 'json', |
|
|
|
@ -2637,11 +2446,7 @@ export class Api<
|
|
|
|
|
orgs: string, |
|
|
|
|
projectName: string, |
|
|
|
|
tableName: string, |
|
|
|
|
query?: { |
|
|
|
|
fields?: any[]; |
|
|
|
|
sort?: any[]; |
|
|
|
|
where?: string; |
|
|
|
|
}, |
|
|
|
|
query?: { fields?: any[]; sort?: any[]; where?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -2666,7 +2471,6 @@ export class Api<
|
|
|
|
|
projectName: string, |
|
|
|
|
tableName: string, |
|
|
|
|
query?: { |
|
|
|
|
/** Column name of the column you want to group by, eg. `column_name=column1` */ |
|
|
|
|
column_name?: string; |
|
|
|
|
sort?: any[]; |
|
|
|
|
where?: string; |
|
|
|
@ -2697,13 +2501,7 @@ export class Api<
|
|
|
|
|
projectName: string, |
|
|
|
|
tableName: string, |
|
|
|
|
columnId: string, |
|
|
|
|
query?: { |
|
|
|
|
fields?: any[]; |
|
|
|
|
sort?: any[]; |
|
|
|
|
where?: string; |
|
|
|
|
/** Query params for nested data */ |
|
|
|
|
nested?: any; |
|
|
|
|
}, |
|
|
|
|
query?: { fields?: any[]; sort?: any[]; where?: string; nested?: any }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -2898,9 +2696,7 @@ export class Api<
|
|
|
|
|
projectName: string, |
|
|
|
|
tableName: string, |
|
|
|
|
data: any, |
|
|
|
|
query?: { |
|
|
|
|
where?: string; |
|
|
|
|
}, |
|
|
|
|
query?: { where?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -2927,9 +2723,7 @@ export class Api<
|
|
|
|
|
projectName: string, |
|
|
|
|
tableName: string, |
|
|
|
|
data: any, |
|
|
|
|
query?: { |
|
|
|
|
where?: string; |
|
|
|
|
}, |
|
|
|
|
query?: { where?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3013,10 +2807,7 @@ export class Api<
|
|
|
|
|
relationType: 'mm' | 'hm' | 'bt', |
|
|
|
|
columnName: string, |
|
|
|
|
refRowId: string, |
|
|
|
|
query?: { |
|
|
|
|
limit?: string; |
|
|
|
|
offset?: string; |
|
|
|
|
}, |
|
|
|
|
query?: { limit?: string; offset?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3100,13 +2891,7 @@ export class Api<
|
|
|
|
|
tableName: string, |
|
|
|
|
viewName: string, |
|
|
|
|
columnId: string, |
|
|
|
|
query?: { |
|
|
|
|
fields?: any[]; |
|
|
|
|
sort?: any[]; |
|
|
|
|
where?: string; |
|
|
|
|
/** Query params for nested data */ |
|
|
|
|
nested?: any; |
|
|
|
|
}, |
|
|
|
|
query?: { fields?: any[]; sort?: any[]; where?: string; nested?: any }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3131,13 +2916,7 @@ export class Api<
|
|
|
|
|
projectName: string, |
|
|
|
|
tableName: string, |
|
|
|
|
viewName: string, |
|
|
|
|
query?: { |
|
|
|
|
fields?: any[]; |
|
|
|
|
sort?: any[]; |
|
|
|
|
where?: string; |
|
|
|
|
/** Query params for nested data */ |
|
|
|
|
nested?: any; |
|
|
|
|
}, |
|
|
|
|
query?: { fields?: any[]; sort?: any[]; where?: string; nested?: any }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3188,13 +2967,7 @@ export class Api<
|
|
|
|
|
projectName: string, |
|
|
|
|
tableName: string, |
|
|
|
|
viewName: string, |
|
|
|
|
query?: { |
|
|
|
|
fields?: any[]; |
|
|
|
|
sort?: any[]; |
|
|
|
|
where?: string; |
|
|
|
|
/** Query params for nested data */ |
|
|
|
|
nested?: any; |
|
|
|
|
}, |
|
|
|
|
query?: { fields?: any[]; sort?: any[]; where?: string; nested?: any }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3220,7 +2993,6 @@ export class Api<
|
|
|
|
|
tableName: string, |
|
|
|
|
viewName: string, |
|
|
|
|
query?: { |
|
|
|
|
/** Column name of the column you want to group by, eg. `column_name=column1` */ |
|
|
|
|
column_name?: string; |
|
|
|
|
sort?: any[]; |
|
|
|
|
where?: string; |
|
|
|
@ -3251,11 +3023,7 @@ export class Api<
|
|
|
|
|
projectName: string, |
|
|
|
|
tableName: string, |
|
|
|
|
viewName: string, |
|
|
|
|
query?: { |
|
|
|
|
where?: string; |
|
|
|
|
/** Query params for nested data */ |
|
|
|
|
nested?: any; |
|
|
|
|
}, |
|
|
|
|
query?: { where?: string; nested?: any }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3400,10 +3168,7 @@ export class Api<
|
|
|
|
|
groupedDataList: ( |
|
|
|
|
sharedViewUuid: string, |
|
|
|
|
columnId: string, |
|
|
|
|
query?: { |
|
|
|
|
limit?: string; |
|
|
|
|
offset?: string; |
|
|
|
|
}, |
|
|
|
|
query?: { limit?: string; offset?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3424,10 +3189,7 @@ export class Api<
|
|
|
|
|
*/ |
|
|
|
|
dataList: ( |
|
|
|
|
sharedViewUuid: string, |
|
|
|
|
query?: { |
|
|
|
|
limit?: string; |
|
|
|
|
offset?: string; |
|
|
|
|
}, |
|
|
|
|
query?: { limit?: string; offset?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3473,10 +3235,7 @@ export class Api<
|
|
|
|
|
rowId: string, |
|
|
|
|
relationType: 'mm' | 'hm' | 'bt', |
|
|
|
|
columnName: string, |
|
|
|
|
query?: { |
|
|
|
|
limit?: string; |
|
|
|
|
offset?: string; |
|
|
|
|
}, |
|
|
|
|
query?: { limit?: string; offset?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3518,10 +3277,7 @@ export class Api<
|
|
|
|
|
dataRelationList: ( |
|
|
|
|
sharedViewUuid: string, |
|
|
|
|
columnName: string, |
|
|
|
|
query?: { |
|
|
|
|
limit?: string; |
|
|
|
|
offset?: string; |
|
|
|
|
}, |
|
|
|
|
query?: { limit?: string; offset?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3538,18 +3294,10 @@ export class Api<
|
|
|
|
|
* @tags Public |
|
|
|
|
* @name SharedBaseGet |
|
|
|
|
* @request GET:/api/v1/db/public/shared-base/{sharedBaseUuid}/meta |
|
|
|
|
* @response `200` `{
|
|
|
|
|
project_id?: string, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ project_id?: string }` OK |
|
|
|
|
*/ |
|
|
|
|
sharedBaseGet: (sharedBaseUuid: string, params: RequestParams = {}) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
project_id?: string; |
|
|
|
|
}, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
this.request<{ project_id?: string }, any>({ |
|
|
|
|
path: `/api/v1/db/public/shared-base/${sharedBaseUuid}/meta`, |
|
|
|
|
method: 'GET', |
|
|
|
|
format: 'json', |
|
|
|
@ -3562,16 +3310,7 @@ export class Api<
|
|
|
|
|
* @tags Public |
|
|
|
|
* @name SharedViewMetaGet |
|
|
|
|
* @request GET:/api/v1/db/public/shared-view/{sharedViewUuid}/meta |
|
|
|
|
* @response `200` `(ViewType & {
|
|
|
|
|
relatedMetas?: any, |
|
|
|
|
client?: string, |
|
|
|
|
columns?: ((GridColumnType | FormColumnType | GalleryColumnType) & ColumnType), |
|
|
|
|
model?: TableType, |
|
|
|
|
|
|
|
|
|
} & { |
|
|
|
|
view?: (FormType | GridType | GalleryType), |
|
|
|
|
|
|
|
|
|
})` OK
|
|
|
|
|
* @response `200` `(ViewType & { relatedMetas?: any, client?: string, columns?: ((GridColumnType | FormColumnType | GalleryColumnType) & ColumnType), model?: TableType } & { view?: (FormType | GridType | GalleryType) })` OK |
|
|
|
|
*/ |
|
|
|
|
sharedViewMetaGet: (sharedViewUuid: string, params: RequestParams = {}) => |
|
|
|
|
this.request< |
|
|
|
@ -3581,9 +3320,7 @@ export class Api<
|
|
|
|
|
columns?: (GridColumnType | FormColumnType | GalleryColumnType) & |
|
|
|
|
ColumnType; |
|
|
|
|
model?: TableType; |
|
|
|
|
} & { |
|
|
|
|
view?: FormType | GridType | GalleryType; |
|
|
|
|
}, |
|
|
|
|
} & { view?: FormType | GridType | GalleryType }, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
path: `/api/v1/db/public/shared-view/${sharedViewUuid}/meta`, |
|
|
|
@ -3602,11 +3339,7 @@ export class Api<
|
|
|
|
|
* @response `201` `any` Created |
|
|
|
|
*/ |
|
|
|
|
commentList: ( |
|
|
|
|
query: { |
|
|
|
|
row_id: string; |
|
|
|
|
fk_model_id: string; |
|
|
|
|
comments_only?: boolean; |
|
|
|
|
}, |
|
|
|
|
query: { row_id: string; fk_model_id: string; comments_only?: boolean }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3626,11 +3359,7 @@ export class Api<
|
|
|
|
|
* @response `200` `void` OK |
|
|
|
|
*/ |
|
|
|
|
commentRow: ( |
|
|
|
|
data: { |
|
|
|
|
row_id: string; |
|
|
|
|
fk_model_id: string; |
|
|
|
|
description?: string; |
|
|
|
|
}, |
|
|
|
|
data: { row_id: string; fk_model_id: string; description?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<void, any>({ |
|
|
|
@ -3650,10 +3379,7 @@ export class Api<
|
|
|
|
|
* @response `201` `any` Created |
|
|
|
|
*/ |
|
|
|
|
commentCount: ( |
|
|
|
|
query: { |
|
|
|
|
ids: any[]; |
|
|
|
|
fk_model_id: string; |
|
|
|
|
}, |
|
|
|
|
query: { ids: any[]; fk_model_id: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3697,20 +3423,10 @@ export class Api<
|
|
|
|
|
* @tags Utils |
|
|
|
|
* @name TestConnection |
|
|
|
|
* @request POST:/api/v1/db/meta/connection/test |
|
|
|
|
* @response `200` `{
|
|
|
|
|
code?: number, |
|
|
|
|
message?: string, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ code?: number, message?: string }` OK |
|
|
|
|
*/ |
|
|
|
|
testConnection: (data: any, params: RequestParams = {}) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
code?: number; |
|
|
|
|
message?: string; |
|
|
|
|
}, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
this.request<{ code?: number; message?: string }, any>({ |
|
|
|
|
path: `/api/v1/db/meta/connection/test`, |
|
|
|
|
method: 'POST', |
|
|
|
|
body: data, |
|
|
|
@ -3807,53 +3523,14 @@ export class Api<
|
|
|
|
|
* @tags Utils |
|
|
|
|
* @name AggregatedMetaInfo |
|
|
|
|
* @request GET:/api/v1/aggregated-meta-info |
|
|
|
|
* @response `200` `{
|
|
|
|
|
projectCount?: number, |
|
|
|
|
projects?: ({ |
|
|
|
|
tableCount?: { |
|
|
|
|
table?: number, |
|
|
|
|
view?: number, |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
external?: boolean, |
|
|
|
|
viewCount?: { |
|
|
|
|
formCount?: number, |
|
|
|
|
gridCount?: number, |
|
|
|
|
galleryCount?: number, |
|
|
|
|
kanbanCount?: number, |
|
|
|
|
total?: number, |
|
|
|
|
sharedFormCount?: number, |
|
|
|
|
sharedGridCount?: number, |
|
|
|
|
sharedGalleryCount?: number, |
|
|
|
|
sharedKanbanCount?: number, |
|
|
|
|
sharedTotal?: number, |
|
|
|
|
sharedLockedCount?: number, |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
webhookCount?: number, |
|
|
|
|
filterCount?: number, |
|
|
|
|
sortCount?: number, |
|
|
|
|
rowCount?: ({ |
|
|
|
|
TotalRecords?: string, |
|
|
|
|
|
|
|
|
|
})[], |
|
|
|
|
userCount?: number, |
|
|
|
|
|
|
|
|
|
})[], |
|
|
|
|
userCount?: number, |
|
|
|
|
sharedBaseCount?: number, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ projectCount?: number, projects?: ({ tableCount?: { table?: number, view?: number }, external?: boolean, viewCount?: { formCount?: number, gridCount?: number, galleryCount?: number, kanbanCount?: number, total?: number, sharedFormCount?: number, sharedGridCount?: number, sharedGalleryCount?: number, sharedKanbanCount?: number, sharedTotal?: number, sharedLockedCount?: number }, webhookCount?: number, filterCount?: number, sortCount?: number, rowCount?: ({ TotalRecords?: string })[], userCount?: number })[], userCount?: number, sharedBaseCount?: number }` OK |
|
|
|
|
*/ |
|
|
|
|
aggregatedMetaInfo: (params: RequestParams = {}) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
projectCount?: number; |
|
|
|
|
projects?: { |
|
|
|
|
tableCount?: { |
|
|
|
|
table?: number; |
|
|
|
|
view?: number; |
|
|
|
|
}; |
|
|
|
|
tableCount?: { table?: number; view?: number }; |
|
|
|
|
external?: boolean; |
|
|
|
|
viewCount?: { |
|
|
|
|
formCount?: number; |
|
|
|
@ -3871,9 +3548,7 @@ export class Api<
|
|
|
|
|
webhookCount?: number; |
|
|
|
|
filterCount?: number; |
|
|
|
|
sortCount?: number; |
|
|
|
|
rowCount?: { |
|
|
|
|
TotalRecords?: string; |
|
|
|
|
}[]; |
|
|
|
|
rowCount?: { TotalRecords?: string }[]; |
|
|
|
|
userCount?: number; |
|
|
|
|
}[]; |
|
|
|
|
userCount?: number; |
|
|
|
@ -3924,20 +3599,10 @@ export class Api<
|
|
|
|
|
* @tags DB table webhook |
|
|
|
|
* @name List |
|
|
|
|
* @request GET:/api/v1/db/meta/tables/{tableId}/hooks |
|
|
|
|
* @response `200` `{
|
|
|
|
|
list: (HookType)[], |
|
|
|
|
pageInfo: PaginatedType, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ list: (HookType)[], pageInfo: PaginatedType }` OK |
|
|
|
|
*/ |
|
|
|
|
list: (tableId: string, params: RequestParams = {}) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
list: HookType[]; |
|
|
|
|
pageInfo: PaginatedType; |
|
|
|
|
}, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
this.request<{ list: HookType[]; pageInfo: PaginatedType }, any>({ |
|
|
|
|
path: `/api/v1/db/meta/tables/${tableId}/hooks`, |
|
|
|
|
method: 'GET', |
|
|
|
|
format: 'json', |
|
|
|
@ -3972,13 +3637,7 @@ export class Api<
|
|
|
|
|
*/ |
|
|
|
|
test: ( |
|
|
|
|
tableId: string, |
|
|
|
|
data: { |
|
|
|
|
payload?: { |
|
|
|
|
data?: any; |
|
|
|
|
user?: any; |
|
|
|
|
}; |
|
|
|
|
hook?: HookType; |
|
|
|
|
}, |
|
|
|
|
data: { payload?: { data?: any; user?: any }; hook?: HookType }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -3996,14 +3655,7 @@ export class Api<
|
|
|
|
|
* @tags DB table webhook |
|
|
|
|
* @name SamplePayloadGet |
|
|
|
|
* @request GET:/api/v1/db/meta/tables/{tableId}/hooks/samplePayload/{operation} |
|
|
|
|
* @response `200` `{
|
|
|
|
|
plugins?: { |
|
|
|
|
list: (PluginType)[], |
|
|
|
|
pageInfo: PaginatedType, |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ plugins?: { list: (PluginType)[], pageInfo: PaginatedType } }` OK |
|
|
|
|
*/ |
|
|
|
|
samplePayloadGet: ( |
|
|
|
|
tableId: string, |
|
|
|
@ -4011,12 +3663,7 @@ export class Api<
|
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
plugins?: { |
|
|
|
|
list: PluginType[]; |
|
|
|
|
pageInfo: PaginatedType; |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
{ plugins?: { list: PluginType[]; pageInfo: PaginatedType } }, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
path: `/api/v1/db/meta/tables/${tableId}/hooks/samplePayload/${operation}`, |
|
|
|
@ -4065,20 +3712,10 @@ export class Api<
|
|
|
|
|
* @tags Plugin |
|
|
|
|
* @name List |
|
|
|
|
* @request GET:/api/v1/db/meta/plugins |
|
|
|
|
* @response `200` `{
|
|
|
|
|
list?: (PluginType)[], |
|
|
|
|
pageInfo?: PaginatedType, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `200` `{ list?: (PluginType)[], pageInfo?: PaginatedType }` OK |
|
|
|
|
*/ |
|
|
|
|
list: (params: RequestParams = {}) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
list?: PluginType[]; |
|
|
|
|
pageInfo?: PaginatedType; |
|
|
|
|
}, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
this.request<{ list?: PluginType[]; pageInfo?: PaginatedType }, any>({ |
|
|
|
|
path: `/api/v1/db/meta/plugins`, |
|
|
|
|
method: 'GET', |
|
|
|
|
format: 'json', |
|
|
|
@ -4112,12 +3749,7 @@ export class Api<
|
|
|
|
|
* @response `401` `void` Unauthorized |
|
|
|
|
*/ |
|
|
|
|
test: ( |
|
|
|
|
data: { |
|
|
|
|
id?: string; |
|
|
|
|
title?: string; |
|
|
|
|
input?: any; |
|
|
|
|
category?: string; |
|
|
|
|
}, |
|
|
|
|
data: { id?: string; title?: string; input?: any; category?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, void>({ |
|
|
|
@ -4192,9 +3824,7 @@ export class Api<
|
|
|
|
|
*/ |
|
|
|
|
create: ( |
|
|
|
|
projectId: string, |
|
|
|
|
data: { |
|
|
|
|
description?: string; |
|
|
|
|
}, |
|
|
|
|
data: { description?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<void, any>({ |
|
|
|
@ -4230,13 +3860,8 @@ export class Api<
|
|
|
|
|
* @request POST:/api/v1/db/storage/upload |
|
|
|
|
*/ |
|
|
|
|
upload: ( |
|
|
|
|
query: { |
|
|
|
|
path: string; |
|
|
|
|
}, |
|
|
|
|
data: { |
|
|
|
|
files?: any; |
|
|
|
|
json?: string; |
|
|
|
|
}, |
|
|
|
|
query: { path: string }, |
|
|
|
|
data: { files?: any; json?: string }, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request<any, any>({ |
|
|
|
@ -4257,9 +3882,7 @@ export class Api<
|
|
|
|
|
* @request POST:/api/v1/db/storage/upload-by-url |
|
|
|
|
*/ |
|
|
|
|
uploadByUrl: ( |
|
|
|
|
query: { |
|
|
|
|
path: string; |
|
|
|
|
}, |
|
|
|
|
query: { path: string }, |
|
|
|
|
data: { |
|
|
|
|
url?: string; |
|
|
|
|
fileName?: string; |
|
|
|
|