---
name: "getCleaningRecords"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.36" }
  - { name: "Base library", version: "2.21.0" }
title: "Cleaning Records"
---

## getCleaningRecords

> [VERSION] @ray-js/ray >= 1.5.36 | Base library >= 2.21.0

### Description

Get the cleaning record list

### 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 with 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 | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID |
| `startTime` | `string` | Start time (timestamp string) |
| `endTime` | `string` | End time (timestamp string) |
| `limit` | `number` | Maximum number of records to return |
| `offset` | `number` | Pagination offset |
| `fileType` | `string` | 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` | Bucket where the file is stored |
| `extend` | `string` | Cleaning info (extended fields) |
| `devId` | `string` | Device ID |
| `fileType` | `string` | File type |


### Examples

```tsx
import React from 'react';
import { Button, getCleaningRecords } from '@ray-js/ray';

export default function Demo() {
  const handleFetch = async () => {
    const result = await getCleaningRecords({
      devId: 'your-device-id',
      startTime: '1700000000',
      endTime: '1700086400',
      offset: 0,
      limit: 10,
    });
    console.log(result.datas, result.totalCount);
  };
  return <Button onClick={handleFetch}>Get cleaning records</Button>;
}
```


---
name: "deleteCleaningRecord"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.36" }
  - { name: "Base library", version: "2.21.0" }
title: "Cleaning Records"
---
## deleteCleaningRecord

> [VERSION] @ray-js/ray >= 1.5.36 | Base library >= 2.21.0

### Description

Delete cleaning records

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `DeleteCleaningRecordParams` | Yes | Contains Device ID and an array of record IDs to delete |

### Return Value

Type: `Promise<boolean>`

Promise that resolves to a boolean indicating whether deletion succeeded

### Referenced Types

##### `interface` DeleteCleaningRecordParams

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


### Examples

```tsx
import React from 'react';
import { Button, deleteCleaningRecord } from '@ray-js/ray';

export default function Demo() {
  const handleDelete = async () => {
    const success = await deleteCleaningRecord({
      devId: 'your-device-id',
      fileIds: [1001, 1002],
    });
    console.log('Delete result:', success);
  };
  return <Button onClick={handleDelete}>Delete records</Button>;
}
```


---
name: "getGyroCleanRecords"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.7.14" }
  - { name: "Base library", version: "2.29.0" }
title: "Cleaning Records"
---
## getGyroCleanRecords

> [VERSION] @ray-js/ray >= 1.7.14 | Base library >= 2.29.0

### Description

Get the cleaning record list for a gyroscope-based robot vacuum

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetGyroCleanRecordsParams` | Yes | Query parameters including Device ID, a set of DPs, and pagination info |

### Return Value

Type: `Promise<GetGyroCleanRecordsResponse>`

Promise that resolves with the gyroscope-based vacuum's 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 | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID |
| `dpIds` | `number[]` | Set of DP IDs |
| `offset` | `number` | Pagination offset |
| `limit` | `number` | Page size |
| `userId` | `string` | 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

```tsx
import React from 'react';
import { Button, getGyroCleanRecords } from '@ray-js/ray';

export default function Demo() {
  const handleFetch = async () => {
    const result = await getGyroCleanRecords({
      devId: 'your-device-id',
      dpIds: [101, 102],
      offset: 0,
      limit: 10,
    });
    console.log(result.datas, result.totalCount);
  };
  return <Button onClick={handleFetch}>Get gyroscope records</Button>;
}
```


---
name: "getGyroCleanRecordDetail"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.7.14" }
  - { name: "Base library", version: "2.29.0" }
title: "Cleaning Records"
---
## getGyroCleanRecordDetail

> [VERSION] @ray-js/ray >= 1.7.14 | Base library >= 2.29.0

### Description

Get cleaning record details for a gyroscope-based robot vacuum

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetGyroCleanRecordDetailParams` | Yes | Query parameters including Device ID, sub-record ID, and pagination info |

### Return Value

Type: `Promise<GetGyroCleanRecordDetailResponse>`

Promise that resolves with the cleaning record's map data and pagination info

##### GetGyroCleanRecordDetailResponse

| Property | Type | Description |
| --- | --- | --- |
| `dataList` | `string[]` | Map data list |
| `startRow` | `string` | Start-row cursor |
| `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` | Has next page |

### Referenced Types

##### `interface` GetGyroCleanRecordDetailParams

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


### Examples

```tsx
import React from 'react';
import { Button, getGyroCleanRecordDetail } from '@ray-js/ray';

export default function Demo() {
  const handleFetch = async () => {
    const detail = await getGyroCleanRecordDetail({
      devId: 'your-device-id',
      subRecordId: 12345,
      start: 0,
      size: 100,
    });
    console.log(detail.dataList, detail.hasNext);
  };
  return <Button onClick={handleFetch}>Get record details</Button>;
}
```
