CMS
Tablas de contenido que leen tus sitios y apps.
Una tabla de CMS es una tabla normal de la base de datos del espacio de trabajo. Gestionas las tablas con los métodos de CMS, y lees y escribes sus registros con los métodos de registros. Cada llamada es un POST a /cpi/<method> con un cuerpo JSON que lleva tu clave de API.
La respuesta contiene cada tabla con sus campos y su número de registros, y la base de datos en la que vive (el app_id que toman los métodos de registros).
Desde el panel
Cada tabla tiene una ventana de API: pulsa API y JSON en una tarjeta o en una tabla abierta. Muestra las cinco llamadas de registros de esa tabla, los campos de la propia tabla como JSON, la misma petición como cURL o JavaScript y un lugar para enviarla. Su selector de claves lista las claves que llegan al espacio de trabajo, y puede crear una nueva. Una clave con acceso completo funciona. Una personalizada necesita dbs_read para leer y dbs_create, dbs_update y dbs_delete para escribir.
Registros
Las cinco llamadas de la ventana ejecutan estos métodos. Cada uno toma el app_id de la base de datos del espacio de trabajo y el id de la tabla.
Un registro es un objeto cuyas claves son los ids de campo de la tabla. Envía table_data como un array para añadir varios registros a la vez. Eliminar mueve los registros a Archivado, y dbs_restore con los mismos ids los devuelve. Añade permanent para eliminarlos definitivamente.
DBS Read
Reads records from an app table with optional row range, single-row lookup, sorting, filtering, and archived-record selection.
DBS Create
Creates a new record in the specified app table from the provided key-value table data.
DBS Update
Replaces the data of an existing record, identified by row_id, in the specified app table.
DBS Delete
Soft-deletes (or permanently deletes when 'permanent' is set) the listed record IDs from an app table.
DBS Restore
Restores previously soft-deleted records, identified by their IDs, in the specified app table.
Tablas
Get CMS Tables
The CMS tables of one workspace, active and archived, each with its fields and how many records it holds, plus the database the records live in (the app_id to hand dbs_read, dbs_create, dbs_update, dbs_delete and dbs_restore), whether that database is ready, and the plan with what it allows. The first open of a workspace other than Main installs the database plugin there and answers preparing until it is ready.
Get CMS Table
One CMS table as Xuda Studio stores it (its fields and indexes), with its record count and the database it lives in.
Save CMS Table
Create a CMS table, or change one when table_id is sent. A table has a name, an optional description and its fields, each a name, a type (string, number, boolean, date, array, object, or relation) and whether it is required. A relation field relates the table to the Contacts module ({ kind: 'module', module: 'contacts' }) or to another CMS table of the workspace ({ kind: 'table', table_id }), holding one id or, with many, several; a saved relation keeps what it relates to and its shape. Field names start with a letter and use letters, digits and underscores. A new table counts against the plan's tables, and every table against its fields per table. The table is an ordinary Xuda Studio table in the workspace's database, so it opens in Studio too.
Archive CMS Table
Archive a CMS table (it leaves the list and its records stay) or bring it back with archived false, which counts against the plan's tables again.
Get CMS Records Of An Item
The CMS tables related to one item of another module (a ticket, a delivery, an order, a product, a finance document or a contact), each with its fields and the records that point at that item, so the item can show them to fill. A workspace with CMS switched off answers no tables.
Una tabla nueva cuenta para las tablas de tu plan, cada tabla para sus campos, y añadir o restaurar registros para sus registros. Una llamada que supera un límite se rechaza con un mensaje que dice cuál.