caution
This section refers to the old versions of the MonkJs SDK (version 3.X.X
and below). For the v4 docs, please refer to
this page.
View
yarn add @monkvision/corejs
import monk from '@monkvision/corejs'
const { createOne, deleteOne } = monk.entity.view;
createOne
POST /inspections/${inspectionId}/views
await monk.view.createOne(inspectionId, data);
name | type | default |
---|---|---|
inspectionId | string | |
data | CreateView | |
- data.imageId | string | |
- data.newImage | CreateViewImage | |
- data.damageId | string | |
- data.polygons | number[][][] | |
- data.boundingBox | BoundingBox |
{
"axiosResponse": {},
"entities": {
"views": {
"3fa85f64-5717-4562-b3fc-2c963f66afa6": {
"imageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"damageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"polygons": [[[0]]],
"boundingBox": {
"xmin": 0,
"ymin": 0,
"width": 0,
"height": 0
},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
},
"result": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
deleteOne
DELETE /inspections/${inspectionId}/views/${id}
await monk.view.deleteOne(id, inspectionId);
name | type | default |
---|---|---|
id | string | |
inspectionId | string |
{
"axiosResponse": {},
"entities": {
"views": {
"3fa85f64-5717-4562-b3fc-2c963f66afa6": {
"deleted": true,
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
},
"result": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}