> For the complete documentation index, see [llms.txt](https://nexeum.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nexeum.gitbook.io/docs/nex-duty/exports.md).

# Exports

## Get All Units

`exports["nex-duty"]:getAllUnits()`

**Returns**

{% code overflow="wrap" %}

```lua
Documentation WIP
```

{% endcode %}

## Get Units by Entity

`exports["nex-duty"]:getUnitsByEntity(department)`

**Arguments**

| Argument     | Description           | Example  |
| ------------ | --------------------- | -------- |
| `department` | The entity identifier | `"sasp"` |

**Returns**

{% code overflow="wrap" %}

```lua
```

{% endcode %}

## Get Units by Entities

`exports["nex-duty"]:getUnitsByEntities(departments)`

**Arguments**

| Argument      | Description                    | Example                     |
| ------------- | ------------------------------ | --------------------------- |
| `departments` | An array of entity identifiers | `{"sasp", "pubcop", "fbi"}` |

**Returns**

{% code overflow="wrap" %}

```lua
[
    {
        "blips_enabled": true,
        "username": "Michael Scott",
        "rank": "member",
        "id": 183,
        "avatar": "<cdn.discordapp.com url>",
        "current_street": "Strawberry Ave",
        "stationary_time": 0,
        "current_postal": "8054",
        "status": "active",
        "entity": "sasp",
        "callsign": "201",
        "afk_time": 0,
        "past_position": {
            "x": 201.07252502441407,
            "y": -925.5692138671875,
            "z": 30.6783447265625
        },
        "source": 2
    }
]
```

{% endcode %}

## Get Unit Data

`exports["nex-duty"]:getUnitData(source)`

**Arguments**

| Argument | Description            | Example |
| -------- | ---------------------- | ------- |
| `source` | The Source of the Unit | `21`    |

**Returns**

{% code overflow="wrap" %}

```lua
{
    "entity": "sasp",
    "rank": "member",
    "source": 1,
    "start_time": 1745523818,
    "username": "montgomery",
    "callsign": "222"
}
```

{% endcode %}
