Appearance
Knowledge base
API
- API overview: What the CoCoCo GraphQL API is, how to reach and authenticate against it, and how its main domains map to print-production concepts.
- Core patterns: Pagination, filtering, sorting, IDs, enums, mutation payloads and errors in the CoCoCo GraphQL API.
- Job management: Create, find, update and track production jobs, their operations and milestones, and group related jobs.
- Components and media: Add components to a job, read their print specification and substrates, and attach artwork files.
- Orders and commerce: Customers, estimates, orders and order lines, turning orders into jobs, invoices and shipments.
- GraphQL introduction: The GraphQL concepts you need for the CoCoCo API, including schema, types, queries, mutations, variables, fragments and subscriptions.
- GraphQL for REST users: How familiar REST ideas (resources, verbs, status codes, pagination, caching) translate to the CoCoCo GraphQL API.
- GraphQL for XML users: How XML Schema, SOAP and JDF-style XML ideas translate to the CoCoCo GraphQL API.
- GraphQL tooling: Tools for exploring and calling the CoCoCo GraphQL API, including the console playground, HTTP clients, client libraries, code generation and editor support.
MQTT
- Connecting a device over MQTT: Create a device, issue its certificate bundle, and connect to the CoCoCo MQTT broker with mutual TLS.
- Publishing metrics over MQTT: The s/metrics topic, its JSON payload, metric kinds and units, and the rules that decide whether a message is recorded.
- JavaScript example: A minimal Node.js client with mqtt.js that connects with the device certificate bundle and publishes metrics.
- Automating on device data: Start a workflow when a device publishes an MQTT message, using a Device MQTT trigger, a JSONLogic filter and a Lua script node.
Workflows
- Workflows: How CoCoCo workflows are built from nodes and edges, how versions and activation work, and how to run workflows and inspect executions.
- Workflow expressions: The expression language used in workflow node settings, with references, operators, filters and truthiness rules.
- Workflow node reference: Every workflow node type in CoCoCo, what it does and how its output is used.
- Workflow triggers: Start CoCoCo workflows automatically on a schedule, on data changes, on device MQTT messages, on edge app events or when files arrive.
Lua scripting
- Lua scripting overview: Where Lua scripts run in CoCoCo, the ctx API each script role sees, the (ok, res) error model, entry points and execution budgets.
- Lua dialect guide: Lua basics as they work in CoCoCo's SwiftLua dialect, and every place it differs from stock Lua.
- Sandbox environment: What a CoCoCo Lua script can and cannot reach, how determinism works, and how network access is controlled.
- GraphQL (ctx.graphql): Run GraphQL queries and mutations from a Lua script with the caller's permissions and tenant scope.
- SQL (ctx.sql and ctx.device.sql): Read-only reporting queries with ctx.sql.query, and SQL through a device connection with ctx.device.sql.
- Device (ctx.device): Talk to machines and systems configured as devices in CoCoCo, over HTTP or SQL, directly or through a device handle.
- Cache (ctx.cache): A tenant-scoped key/value cache with optional TTL for sharing values between script runs.
- Notify (ctx.notify): Send a notification from a Lua script to a notification group or a single recipient.
- Template (ctx.template): Render a stored CoCoCo template (Stencil text, DataXML or XML-to-PDF) by handle from a Lua script.
- JSON (ctx.json): Encode Lua values as JSON strings and decode JSON text into Lua tables.
- Time (ctx.time and time): Read the current time with ctx.time, and parse, format and calculate with the time value library.
- Log (ctx.log): Write structured log lines from a Lua script and find them in the workflow execution, playground or integration logs.
- Config (ctx.config): Read tenant configuration values from a Lua script, with a default for keys that are not set.
- Script loading (ctx.script.load): Reuse code across Lua scripts by loading another tenant Script as a module with ctx.script.load.
- JDF and JMF (ctx.jdf, ctx.jmf): Parse JDF and JMF documents, load JDF/JMF template Scripts, and send JMF messages to print devices from Lua.
Custom apps
- Custom apps: Build your own screens inside the CoCoCo console with a Vue template, a client script and an optional server-side Lua API.
- Custom app server API: Run Lua on the CoCoCo server from a custom app, export functions and call them from the browser with rpc().
- Kiosk mode: Run custom apps full-screen on shop-floor terminals with kiosk user accounts that see only the apps assigned to them.