<!-- AANCER developer pages, part 10 of 16. All parts: https://aancer.ai/dev/llms.txt -->

## Field reference

JSON Schema: [connector.schema.json](https://aancer.ai/dev/schemas/connector.schema.json) (the connector item spec)

### pack.json

| Field | Type | Required | Rules |
|---|---|---|---|
| `displayName` | string | yes | 1 to 80 characters. The name in the catalog |
| `title` | string | no | pack title. Default `<displayName> connector` |
| `description` | string | no | at most 300 characters. Default: the `package.json` description |
| `category` | string | no | `AI`, `Comms`, `Commerce`, `Core`, `Business`, `Finance`, `Productivity`, `Content`, `Developer`, `Support`, `Forms`, `HR`, `Payments`, `Marketing`, `Sales`, `Other`. Default `Other` |
| `licence` | string | no | `"required"` for a paid connector bound to one customer licence. Leave it out for a free connector. A paid connector's pack version gets the suffix `-l<first 8 hex of the licence id>` |
| `framework` | string | no | `major.minor` of the connector framework the connector is built against |
| `egressHosts` | string[] | no | at most 64 fixed hosts the connector calls. Default `[]` |
| `egressFromConnection` | object | no | `{ hostProp, portProp, defaultPort }`: take the host from the connection settings. For systems each customer hosts themselves |

### Connector item spec

This is what certification writes into the pack. You do not write it by hand, but it shows exactly what the installation checks.

| Field | Type | Required | Rules |
|---|---|---|---|
| `pieceName` | string | yes | `@aancer/piece-<name>`, name `^[a-z0-9][a-z0-9-]{1,62}$`. Must be unique on the installation |
| `pieceVersion` | string | yes | strict `x.y.z`, no pre-release |
| `displayName` | string | yes | 1 to 80 characters |
| `description` | string | no | at most 300 characters |
| `category` | string | yes | see the category list above |
| `archive` | string | yes | set by the build; do not edit |
| `framework` | string | yes | `major.minor` of the connector framework, written by certification |
| `egressHosts` | string[] | yes | at most 64. Hostname with optional `*.` prefix and `:port`. A bare `*` is refused |
| `egressFromConnection` | object | no | `{ hostProp (1 to 64), portProp (1 to 64), defaultPort (1 to 65535) }` |
| `licenceId` | string | no | lower-case UUID of the customer licence for a paid connector. Absent means free |
| `deps` | array | yes | the bill of materials: up to 2000 of `{ name, version, license }` |
| `build` | object | no | build facts recorded by certification |
| `knowledgeSource` | object | no | for a connector that feeds knowledge sets: `{ contract: 1, label (1 to 40), actions: { list, item, download, estimate? }, siteProps? (up to 5), sharedConnectionView? }`. Action names match `^[a-z][a-z0-9_]{0,63}$` |
| `metadata` | boolean | no | `true` when the archive root holds `aancer-metadata.json` |

No other fields are allowed.

### Network egress

There are two ways to let a connector reach the network:

1. **Fixed hosts** (`egressHosts`): for a cloud API such as `api.example.com` or `*.example.org`. When an administrator clicks **Enable**, these hosts are added to the installation's allow-list.
2. **Host from the connection** (`egressFromConnection`): for a system each customer runs, such as an on-premises database. The administrator types host and port into the connection and switches its egress on. Only that `host:port` is allowed. Loopback, link-local and cloud metadata addresses are always blocked.

Disable or uninstall removes the grant. Connections and credentials are kept.

### Authentication

The connector carries its own authentication: `ConnectorAuth.None()`, `ConnectorAuth.SecretText(...)`, `ConnectorAuth.CustomAuth({ props: {...} })` or the framework's OAuth2 properties. Secrets are stored encrypted in the connection.

### Build rules

Certification refuses a connector that breaks any of these rules. Check them before you submit:

- No `install`, `preinstall`, `postinstall` or `prepare` scripts in any dependency.
- No native add-ons (`*.node`, `binding.gyp`, `prebuilds/`), no symlinks.
- Do not bundle the connector framework itself.
- `npm audit --omit=dev` reports 0 vulnerabilities.
- Dependency licences: MIT, ISC, BSD-2-Clause, BSD-3-Clause, Apache-2.0 or 0BSD.
- The built connector loads without network access.
- At most 2000 packages, 20,000 files and 32 MiB per file.
- `package-lock.json` is committed.

## Full examples

### A paid connector for a customer-hosted database

`pack.json`:

```json
{
  "title": "Example ERP connector",
  "displayName": "Example ERP",
  "description": "Read-only orders, invoices, production status and customers from the ERP database.",
  "category": "Business",
  "licence": "required",
  "egressHosts": [],
  "egressFromConnection": { "hostProp": "server", "portProp": "port", "defaultPort": 1433 }
}
```

The connection properties in the connector must include `server` and `port`:

```ts
import { ConnectorAuth, Property } from '@aancer/connector-framework';

export const erpAuth = ConnectorAuth.CustomAuth({
  displayName: 'ERP connection',
  required: true,
  props: {
    server: Property.ShortText({ displayName: 'Server', required: true }),
    port: Property.Number({ displayName: 'Port', defaultValue: 1433, required: true }),
    database: Property.ShortText({ displayName: 'Database', required: true }),
    username: Property.ShortText({ displayName: 'User name', required: true }),
    password: ConnectorAuth.SecretText({ displayName: 'Password', required: true }),
  },
  validate: async () => ({ valid: true }),
});
```

### The signed manifest of a free connector

```json
{
  "v": 2,
  "kind": "bundle",
  "id": "conn.example-echo",
  "version": "0.1.0",
  "title": "Example echo connector",
  "publisher": { "name": "Evntx FZCO", "keyId": "platform-<12 hex>" },
  "parameters": [],
  "assets": [
    { "path": "<set by the build>", "sha256": "<64 hex characters>", "contentType": "application/x-tar" }
  ],
  "items": [
    {
      "kind": "connector",
      "schemaVersion": 1,
      "id": "example-echo",
      "scope": "install",
      "spec": {
        "pieceName": "@aancer/piece-example-echo",
        "pieceVersion": "0.1.0",
        "displayName": "Example echo",
        "description": "Echoes its input back. Useful to test connector install.",
        "category": "Developer",
        "archive": "<set by the build>",
        "framework": "<major.minor>",
        "egressHosts": ["api.example.com"],
        "deps": [{ "name": "ms", "version": "2.1.3", "license": "MIT" }]
      }
    }
  ]
}
```

## Install and test

### Test on your developer edition

```bash
aancer-pack connector check my-connector              # checks the code and the manifest
aancer-pack connector run echo my-connector --props props.json   # runs one action locally
aancer-pack dev my-connector --target http://localhost --trust-key-on-target --watch
```

`aancer-pack dev` signs the pack with your developer key, installs it on your developer edition and does it again on every save. `--trust-key-on-target` adds your public key there as a developer key the first time.

### Submit for certification

Build and test the connector with the connector kit on your own machine. Then submit the source folder through the [AANCER partner programme](https://aancer.ai/partners). AANCER runs the build rules, a security review and the archive checks, then signs the pack with the platform key. You get back a `conn.<name>-<version>.ancpack` file.

### Install a certified connector pack

| Action | UI | API |
|---|---|---|
| Upload the pack | Admin > Connectivity > Connectors > **Add from files**, or Platform Settings > Extensions > **Import pack** | `POST /api/extensions/packs/import?activate=1` with the raw `.ancpack` bytes (`extensions.manage`) |
| Install from the release library | Catalog > **Install** | `POST /api/admin/connectors/install {"ids": ["<catalog id>"]}` (`connectors.install`) |
| Enable network access | Catalog > **Enable** | `POST /api/admin/connectors/{id}/enable` |
| Disable | Catalog > **Disable** | `POST /api/admin/connectors/{id}/disable` |
| Uninstall | Catalog > **Uninstall** | `POST /api/admin/connectors/uninstall {"ids": [...]}` |
| Browse | Admin > Connectivity > Connectors | `GET /api/admin/connectors/browse` (`connectors.view`) |

An installed connector is usable about 90 seconds later. No restart is needed. Then create a connection, and use the connector in a workflow, an agent or chat.

## Common errors

| Code | Message | Fix |
|---|---|---|
| `PACK_SIGNER_NOT_ALLOWED` | Connector packs must be signed by the platform key. This pack was signed by another key. | Submit the connector for certification |
| `PACK_SCHEMA_INVALID` | `/egressHosts/0: a bare '*' is not allowed; name the hosts` | List the real hosts |
| `PACK_SCHEMA_INVALID` | `/egressHosts/0: must be a hostname (optionally *.domain and :port)` | No scheme or path, just the host |
| `PACK_SCHEMA_INVALID` | `/items: a connector pack carries no other kinds` | Put other items in a separate pack |
| `PACK_CONTENT_FORBIDDEN` | The connector archive contains forbidden content: ... native addon (*.node) | Remove native dependencies |
| `PACK_PIECE_NAME_TAKEN` | A connector named ... is already installed on this platform. | Choose a unique connector name |
| `PACK_VERSION_CONFLICT` | Pack ... is already imported with different content. Bump the version. | Raise `version` in `package.json` |
| `PACK_LICENCE_REQUIRED` | This connector pack needs an active licence. | Activate the licence first |
| `PACK_LICENCE_MISMATCH` | This connector pack was issued for a different licence. | Request a pack issued for this installation |
| `CONNECTOR_NOT_INSTALLED` | Install this connector first, then enable it. | |
| `CONNECTOR_LICENCE_REQUIRED` | This connector is not part of your licence. | |
| `CREDENTIAL_REQUIRED` | Add the provider API key first. | Configure the connector |
| `EXTENSION_REFERENCED` | Enabled flows use this connector: ... | Disable those workflows first |
| Validation | A connector must declare at least one allowed egress host before it can be enabled. | Add `egressHosts` or `egressFromConnection` |

## Limits and editions

- One connector per pack. Archive at most 96 MiB, unzipped at most 128 MiB.
- Connectors are installation-wide. There is no per-workspace install.
- Connector packs are signed by AANCER through certification. Partners submit them.
- Some catalog connectors are licensed and can be installed but not enabled without the matching licence feature. Paid partner connectors are bound to one customer licence.
- Check your edition on [aancer.ai/pricing](https://aancer.ai/pricing).


---

Source: https://aancer.ai/developers-dashboards

---
title: Dashboards, datasets and models | AANCER Developers
description: Build AANCER dashboards as data: datasets, semantic models, widgets with declarative charts, KPIs, tables and forms, and dashboard layouts.
---

## Dashboards

An AANCER dashboard is data, not code. It is built from four object kinds that stack:

1. a **dataset**: a typed table stored in the installation;
2. a **model**: the semantic layer with entities, dimensions, measures, named filters, variables and joins;
3. a **widget**: a table, a chart, a KPI, Markdown text or a form, bound to a model query;
4. a **dashboard**: a 12-column grid of widgets plus global filters.

Charts are declarative chart specifications (JSON) without data: the platform runs the query and injects the result. Dashboards are versioned. You save a draft, then publish version N, with rollback and retire. You can build them in the UI under **Work > Dashboards**, through the REST API, or ship them in a signed pack with items of kind `dataset`, `model`, `widget` and `dashboard`. Every published dashboard also gets a 2D and 3D view switch, which needs no authoring.

## Quick start

One dataset, one model, one chart, one dashboard, as pack item specs.

```json
{ "id": "sales_orders", "title": "Sales orders",
  "columns": [
    { "id": "date", "type": "date", "required": true },
    { "id": "region", "type": "string", "required": true },
    { "id": "amount", "type": "number", "min": 0 }
  ],
  "retention": { "maxAgeDays": 730 } }
```

```json
{ "id": "sales",
  "entities": { "orders": { "dataset": "sales_orders" } },
  "dimensions": { "region": { "entity": "orders", "column": "region", "label": "Region" } },
  "measures": { "revenue": { "entity": "orders", "agg": "sum", "column": "amount", "label": "Revenue", "format": "currency" } } }
```

```json
{ "id": "revenue_by_region", "type": "chart", "title": "Revenue by region",
  "source": { "model": "sales", "query": { "measures": ["revenue"], "dimensions": ["region"] } },
  "chart": { "mark": "bar", "encoding": {
    "x": { "field": "region", "type": "nominal" },
    "y": { "field": "revenue", "type": "quantitative" } } } }
```

```json
{ "id": "sales-overview", "title": "Sales overview", "icon": "BarChart3",
  "layout": [ { "widget": "revenue_by_region", "x": 0, "y": 0, "w": 12, "h": 8 } ] }
```

## File layout

```text
acme-sales-dashboard/
  manifest.json                         # items: dataset, model, widget(s), dashboard
  content/
    dataset.sales_orders.json
    model.sales.json
    widget.revenue_by_region.json
    dashboard.sales-overview.json
```

Each item uses `"schemaVersion": 1` and `"scope": "workspace"` with `"workspace": "{{param.target_workspace}}"`. Declare `target_workspace` as a `workspace` pack parameter.

Next part: https://aancer.ai/dev/parts/pages/11-field-reference.md
