|
|
|
@ -7542,245 +7542,6 @@ export class Api<
|
|
|
|
|
format: 'json', |
|
|
|
|
...params, |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description List all table view rows |
|
|
|
|
*
|
|
|
|
|
* @tags DB Table Row |
|
|
|
|
* @name TableRowList |
|
|
|
|
* @summary List Table View Rows |
|
|
|
|
* @request GET:/api/v1/base/{projectId}/tables/{tableId} |
|
|
|
|
* @response `200` `{
|
|
|
|
|
\** List of table view rows *\ |
|
|
|
|
list: (object)[], |
|
|
|
|
\** Paginated Info *\ |
|
|
|
|
pageInfo: PaginatedType, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
* @response `400` `{
|
|
|
|
|
\** @example BadRequest [Error]: <ERROR MESSAGE> *\ |
|
|
|
|
msg: string, |
|
|
|
|
|
|
|
|
|
}` |
|
|
|
|
*/ |
|
|
|
|
tableRowList: ( |
|
|
|
|
projectId: string, |
|
|
|
|
tableId: string, |
|
|
|
|
query: { |
|
|
|
|
viewId: string; |
|
|
|
|
fields?: any[]; |
|
|
|
|
sort?: any[]; |
|
|
|
|
where?: string; |
|
|
|
|
/** Query params for nested data */ |
|
|
|
|
nested?: any; |
|
|
|
|
offset?: number; |
|
|
|
|
}, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
/** List of table view rows */ |
|
|
|
|
list: object[]; |
|
|
|
|
/** Paginated Info */ |
|
|
|
|
pageInfo: PaginatedType; |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
/** @example BadRequest [Error]: <ERROR MESSAGE> */ |
|
|
|
|
msg: string; |
|
|
|
|
} |
|
|
|
|
>({ |
|
|
|
|
path: `/api/v1/base/${projectId}/tables/${tableId}`, |
|
|
|
|
method: 'GET', |
|
|
|
|
query: query, |
|
|
|
|
format: 'json', |
|
|
|
|
...params, |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description Create a new row in the given Table View |
|
|
|
|
*
|
|
|
|
|
* @tags DB Table Row |
|
|
|
|
* @name TableRowCreate |
|
|
|
|
* @summary Create Table View Row |
|
|
|
|
* @request POST:/api/v1/base/{projectId}/tables/{tableId} |
|
|
|
|
* @response `200` `object` OK |
|
|
|
|
* @response `400` `{
|
|
|
|
|
\** @example BadRequest [Error]: <ERROR MESSAGE> *\ |
|
|
|
|
msg: string, |
|
|
|
|
|
|
|
|
|
}` |
|
|
|
|
*/ |
|
|
|
|
tableRowCreate: ( |
|
|
|
|
projectId: string, |
|
|
|
|
tableId: string, |
|
|
|
|
query: { |
|
|
|
|
viewId: string; |
|
|
|
|
}, |
|
|
|
|
data: object, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
object, |
|
|
|
|
{ |
|
|
|
|
/** @example BadRequest [Error]: <ERROR MESSAGE> */ |
|
|
|
|
msg: string; |
|
|
|
|
} |
|
|
|
|
>({ |
|
|
|
|
path: `/api/v1/base/${projectId}/tables/${tableId}`, |
|
|
|
|
method: 'POST', |
|
|
|
|
query: query, |
|
|
|
|
body: data, |
|
|
|
|
type: ContentType.Json, |
|
|
|
|
format: 'json', |
|
|
|
|
...params, |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description Count how many rows in the given Table View |
|
|
|
|
*
|
|
|
|
|
* @tags DB Table Row |
|
|
|
|
* @name TableRowCount |
|
|
|
|
* @summary Count Table View Rows |
|
|
|
|
* @request GET:/api/v1/base/{projectId}/tables/{tableId}/count |
|
|
|
|
* @response `200` `{
|
|
|
|
|
count?: number, |
|
|
|
|
|
|
|
|
|
}` OK
|
|
|
|
|
*/ |
|
|
|
|
tableRowCount: ( |
|
|
|
|
projectId: string, |
|
|
|
|
tableId: string, |
|
|
|
|
query: { |
|
|
|
|
viewId: string; |
|
|
|
|
where?: string; |
|
|
|
|
/** Query params for nested data */ |
|
|
|
|
nested?: any; |
|
|
|
|
}, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
{ |
|
|
|
|
count?: number; |
|
|
|
|
}, |
|
|
|
|
any |
|
|
|
|
>({ |
|
|
|
|
path: `/api/v1/base/${projectId}/tables/${tableId}/count`, |
|
|
|
|
method: 'GET', |
|
|
|
|
query: query, |
|
|
|
|
format: 'json', |
|
|
|
|
...params, |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description Get the target Table View Row |
|
|
|
|
*
|
|
|
|
|
* @tags DB Table Row |
|
|
|
|
* @name DbViewRowRead |
|
|
|
|
* @summary Get Table View Row |
|
|
|
|
* @request GET:/api/v1/db/tables/{tableId}/rows/{rowId} |
|
|
|
|
* @response `200` `object` OK |
|
|
|
|
* @response `400` `{
|
|
|
|
|
\** @example BadRequest [Error]: <ERROR MESSAGE> *\ |
|
|
|
|
msg: string, |
|
|
|
|
|
|
|
|
|
}` |
|
|
|
|
*/ |
|
|
|
|
dbViewRowRead: ( |
|
|
|
|
tableId: string, |
|
|
|
|
rowId: any, |
|
|
|
|
query: { |
|
|
|
|
viewId: string; |
|
|
|
|
}, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
object, |
|
|
|
|
{ |
|
|
|
|
/** @example BadRequest [Error]: <ERROR MESSAGE> */ |
|
|
|
|
msg: string; |
|
|
|
|
} |
|
|
|
|
>({ |
|
|
|
|
path: `/api/v1/db/tables/${tableId}/rows/${rowId}`, |
|
|
|
|
method: 'GET', |
|
|
|
|
query: query, |
|
|
|
|
format: 'json', |
|
|
|
|
...params, |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description Update the target Table View Row |
|
|
|
|
*
|
|
|
|
|
* @tags DB Table Row |
|
|
|
|
* @name TableRowUpdate |
|
|
|
|
* @summary Update Table View Row |
|
|
|
|
* @request PATCH:/api/v1/db/tables/{tableId}/rows/{rowId} |
|
|
|
|
* @response `200` `object` OK |
|
|
|
|
* @response `400` `{
|
|
|
|
|
\** @example BadRequest [Error]: <ERROR MESSAGE> *\ |
|
|
|
|
msg: string, |
|
|
|
|
|
|
|
|
|
}` |
|
|
|
|
*/ |
|
|
|
|
tableRowUpdate: ( |
|
|
|
|
tableId: string, |
|
|
|
|
rowId: any, |
|
|
|
|
query: { |
|
|
|
|
viewId: string; |
|
|
|
|
}, |
|
|
|
|
data: object, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
object, |
|
|
|
|
{ |
|
|
|
|
/** @example BadRequest [Error]: <ERROR MESSAGE> */ |
|
|
|
|
msg: string; |
|
|
|
|
} |
|
|
|
|
>({ |
|
|
|
|
path: `/api/v1/db/tables/${tableId}/rows/${rowId}`, |
|
|
|
|
method: 'PATCH', |
|
|
|
|
query: query, |
|
|
|
|
body: data, |
|
|
|
|
type: ContentType.Json, |
|
|
|
|
format: 'json', |
|
|
|
|
...params, |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description Delete the target Table View Row |
|
|
|
|
*
|
|
|
|
|
* @tags DB Table Row |
|
|
|
|
* @name TableRowDelete |
|
|
|
|
* @summary Delete Table View Row |
|
|
|
|
* @request DELETE:/api/v1/db/tables/{tableId}/rows/{rowId} |
|
|
|
|
* @response `200` `number` OK |
|
|
|
|
* @response `400` `{
|
|
|
|
|
\** @example BadRequest [Error]: <ERROR MESSAGE> *\ |
|
|
|
|
msg: string, |
|
|
|
|
|
|
|
|
|
}` |
|
|
|
|
*/ |
|
|
|
|
tableRowDelete: ( |
|
|
|
|
tableId: string, |
|
|
|
|
rowId: any, |
|
|
|
|
query: { |
|
|
|
|
viewId: string; |
|
|
|
|
}, |
|
|
|
|
params: RequestParams = {} |
|
|
|
|
) => |
|
|
|
|
this.request< |
|
|
|
|
number, |
|
|
|
|
{ |
|
|
|
|
/** @example BadRequest [Error]: <ERROR MESSAGE> */ |
|
|
|
|
msg: string; |
|
|
|
|
} |
|
|
|
|
>({ |
|
|
|
|
path: `/api/v1/db/tables/${tableId}/rows/${rowId}`, |
|
|
|
|
method: 'DELETE', |
|
|
|
|
query: query, |
|
|
|
|
format: 'json', |
|
|
|
|
...params, |
|
|
|
|
}), |
|
|
|
|
}; |
|
|
|
|
dbViewRow = { |
|
|
|
|
/** |
|
|
|
|