---
name: "getCleaningRecords"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.0" }
title: "Cleaning Records"
---

## getCleaningRecords

> [VERSION] Base Library >= 2.21.0

### Description

Get cleaning records

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetCleaningRecordsParams` | Yes | Query parameters, including device ID, time range, and pagination info |

### Return Value

Type: `Promise<GetCleaningRecordsResponse>`

Promise that resolves to the cleaning record list and total count

##### GetCleaningRecordsResponse

| Property | Type | Description |
| --- | --- | --- |
| `datas` | `CleaningRecord[]` | Cleaning record list |
| `totalCount` | `number` | Total count |

### Referenced Types

##### `interface` GetCleaningRecordsParams

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `devId` | `string` | Yes | Device ID |
| `startTime` | `string` | Yes | Start time (timestamp string) |
| `endTime` | `string` | Yes | End time (timestamp string) |
| `limit` | `number` | Yes | Result limit |
| `offset` | `number` | Yes | Pagination offset |
| `fileType` | `string` | No | File type, default 'pic' |

##### `interface` CleaningRecord

| Property | Type | Description |
| --- | --- | --- |
| `id` | `number` | Unique cleaning record ID |
| `time` | `number` | Cleaning timestamp |
| `file` | `string` | Cleaning record file path |
| `bucket` | `string` | Storage bucket |
| `extend` | `string` | Cleaning info (extended fields) |
| `devId` | `string` | Device ID |
| `fileType` | `string` | File type |


### Examples

```js
const result = await ty.getCleaningRecords({
  devId: 'your-device-id',
  startTime: '1700000000',
  endTime: '1700086400',
  offset: 0,
  limit: 10,
});
console.log(result.datas, result.totalCount);
```


---
name: "deleteCleaningRecord"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.0" }
title: "Cleaning Records"
---
## deleteCleaningRecord

> [VERSION] Base Library >= 2.21.0

### Description

Delete cleaning records

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `DeleteCleaningRecordParams` | Yes | Parameter object containing the device ID and an array of record IDs to delete |

### Return Value

Type: `Promise<boolean>`

Promise that resolves to a boolean indicating whether the deletion succeeded

### Referenced Types

##### `interface` DeleteCleaningRecordParams

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `devId` | `string` | Yes | Device ID |
| `fileIds` | `number[]` | Yes | Array of record IDs to delete |


### Examples

```js
const result = await ty.deleteCleaningRecord({
  devId: 'your-device-id',
  fileIds: [1001, 1002],
});
console.log('Deletion result:', result);
```


---
name: "getGyroCleanRecords"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.29.0" }
title: "Cleaning Records"
---
## getGyroCleanRecords

> [VERSION] Base Library >= 2.29.0

### Description

Get cleaning records for a gyroscope-based robot vacuum

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetGyroCleanRecordsParams` | Yes | Parameter object containing the device ID, a DP collection, and pagination info |

### Return Value

Type: `Promise<GetGyroCleanRecordsResponse>`

Promise that resolves to the gyroscope-based robot vacuum cleaning record list and total count

##### GetGyroCleanRecordsResponse

| Property | Type | Description |
| --- | --- | --- |
| `datas` | `GyroCleanRecord[]` | Cleaning record list |
| `totalCount` | `number` | Total count |

### Referenced Types

##### `interface` GetGyroCleanRecordsParams

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `devId` | `string` | Yes | Device ID |
| `dpIds` | `number[]` | Yes | DP ID set |
| `offset` | `number` | Yes | Pagination offset |
| `limit` | `number` | Yes | Page size |
| `userId` | `string` | No | User ID, default '0' |

##### `interface` GyroCleanRecord

| Property | Type | Description |
| --- | --- | --- |
| `dpId` | `number` | DP ID |
| `gid` | `number` | Map ID |
| `gmtCreate` | `number` | Record creation timestamp |
| `recordId` | `string` | Record ID |
| `uuid` | `string` | Device UUID |
| `value` | `string` | Record value |


### Examples

```js
const result = await ty.getGyroCleanRecords({
  devId: 'your-device-id',
  dpIds: [101, 102],
  offset: 0,
  limit: 10,
});
console.log(result.datas, result.totalCount);
```


---
name: "getGyroCleanRecordDetail"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.29.0" }
title: "Cleaning Records"
---
## getGyroCleanRecordDetail

> [VERSION] Base Library >= 2.29.0

### Description

Get detailed cleaning record data for a gyroscope-based robot vacuum

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetGyroCleanRecordDetailParams` | Yes | Parameter object containing the device ID, sub-record ID, and pagination info |

### Return Value

Type: `Promise<GetGyroCleanRecordDetailResponse>`

Promise that resolves to cleaning record details (map data, time, pagination info, etc.)

##### GetGyroCleanRecordDetailResponse

| Property | Type | Description |
| --- | --- | --- |
| `dataList` | `string[]` | Map data list |
| `startRow` | `string` | Start row marker |
| `devId` | `string` | Device ID |
| `mapId` | `number` | Map ID |
| `startTime` | `number` | Cleaning start timestamp |
| `endTime` | `number` | Cleaning end timestamp |
| `subRecordId` | `number` | Sub-record ID |
| `hasNext` | `boolean` | Whether there is a next page |

### Referenced Types

##### `interface` GetGyroCleanRecordDetailParams

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `devId` | `string` | Yes | Device ID |
| `subRecordId` | `number` | Yes | Sub-record ID |
| `start` | `number` | Yes | Start row (startRow) |
| `size` | `number` | Yes | Number of items per request |


### Examples

```js
const result = await ty.getGyroCleanRecordDetail({
  devId: 'your-device-id',
  subRecordId: 2001,
  start: 0,
  size: 20,
});
console.log(result.dataList, result.hasNext);
```
