CMS
Tabelas de conteúdo que os seus sites e apps leem.
Uma tabela do CMS é uma tabela normal na base de dados da área de trabalho. Gere as tabelas com os métodos do CMS e lê e escreve os seus registos com os métodos de registos. Cada chamada é um POST para /cpi/<method> com um corpo JSON que leva a sua chave de API.
A resposta contém cada tabela com os seus campos e o número de registos, e a base de dados onde vive (o app_id que os métodos de registos recebem).
A partir do painel
Cada tabela tem uma janela de API: prima API e JSON num cartão ou numa tabela aberta. Mostra as cinco chamadas de registos dessa tabela, os campos da própria tabela como JSON, o mesmo pedido como cURL ou JavaScript e um lugar para o enviar. O seu seletor de chaves lista as chaves que chegam à área de trabalho e pode criar uma nova. Uma chave com acesso total funciona. Uma personalizada precisa de dbs_read para ler e de dbs_create, dbs_update e dbs_delete para escrever.
Registos
As cinco chamadas da janela executam estes métodos. Cada uma recebe o app_id da base de dados da área de trabalho e o id da tabela.
Um registo é um objeto cujas chaves são os ids dos campos da tabela. Envie table_data como um array para adicionar vários registos de uma vez. Eliminar move os registos para Arquivados, e dbs_restore com os mesmos ids traz-os de volta. Acrescente permanent para os eliminar 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.
Tabelas
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.
Uma nova tabela conta para as tabelas do seu plano, cada tabela para os seus campos, e adicionar ou restaurar registos para os seus registos. Uma chamada além de um limite é recusada com uma mensagem que diz qual.