# Shared mutation exports

At the verified commit, `server/exports.lua` exposes runtime mutation helpers for jobs, gangs,
and items. These exports run on the server and notify clients after a successful change.

| Namespace | Add | Add many | Update | Remove |
| --- | --- | --- | --- | --- |
| Jobs | `AddJob` | `AddJobs` | `UpdateJob` | `RemoveJob` |
| Gangs | `AddGang` | `AddGangs` | `UpdateGang` | `RemoveGang` |
| Items | `AddItem` | `AddItems` | `UpdateItem` | `RemoveItem` |

Each operation returns a success boolean followed by a status string. Bulk operations can also
return the value that caused validation to fail.

```lua
local ok, reason = exports['qb-core']:AddItem('example_item', {
  name = 'example_item',
  label = 'Example item',
  weight = 100,
  type = 'item',
  image = 'example_item.png',
  unique = false,
  useable = false,
  shouldClose = true,
  combinable = nil,
  description = 'Example only'
})

if not ok then
  print(('AddItem failed: %s'):format(reason))
end
```

Validate table data against current upstream definitions and test dependent resources after every
mutation. Runtime changes are not a substitute for maintaining the deployed source definitions.

The same file also exports:

| Export | Signature | Return / boundary |
| --- | --- | --- |
| `SetMethod` | `SetMethod(methodName, handler)` | Success boolean + status; rejects existing/invalid names |
| `SetField` | `SetField(fieldName, data)` | Success boolean + status; rejects existing/reserved fields |
| `GetCoreVersion` | `GetCoreVersion(invokingResource)` | Core version string; also logs the request |
| `ExploitBan` | `ExploitBan(playerId, origin)` | Security/ban helper used by core integrations; not a general gameplay API |

`ExploitBan` is exported because other QBCore resources can invoke the core's exploit-ban path.
Do not use it as an application-level authorization substitute; validate server events before a
reward or privileged state change.

Source: [server/exports.lua](https://github.com/qbcore-fivem/qb-core/blob/9b3cddcce93e5e12cbcf6b47b866b687d32ac7bf/server/exports.lua)
