Upgrade / Upgrading to 0.13
Upgrade / upgrade-0-13
Upgrading to 0.13
Schema version 7 adds one table for automations and roles. Four new screens. Nothing changes for an existing app until you use them.
On this page
1. Schema version 7#
One new table: cms_records. It holds automations, their run history and roles. Nothing existing changes.
npx @mainsoft/agent-cms migrate check
npx @mainsoft/agent-cms migrate apply # or `migrate print` and run the SQL yourselfIf your Drizzle schema file re-exports the tables, add cmsRecords (a fresh init writes it).
2. Roles change nothing until you make one#
Who may do what is decided in this order: the system, then a collection's own access functions in code, then roles, then the default (admins only). An app that never makes a role behaves exactly as before. See Automations, roles and the dashboard.
3. Automations run with the cron call#
An automation's work is a background job, so it runs on the next POST /_cron, the same call that sends webhooks. A new automation made on the screen starts switched off.
4. Screens#
npx @mainsoft/agent-cms add --update brings cms-shell (Dashboard, Automations, Roles, Import and export) and cms-messages. Then add the new ones and a page for each:
npx @mainsoft/agent-cms add cms-dashboard cms-automations cms-roles cms-transfer| Screen | Page | Who sees the menu entry |
|---|---|---|
CmsDashboard | /admin/dashboard | Everyone who is signed in |
CmsAutomations | /admin/automations | Admins |
CmsRoles | /admin/roles | Admins |
CmsTransfer | /admin/transfer | Admins |
5. REST and CLI#
- New routes:
GET /openapi.json,GET /_stats,GET /export,POST /import,/automations…,/roles….GET /_mereturnsdashboard,automations,roles. openapi.jsonis now a reserved name: a collection cannot have that slug.- New commands:
export <dir> [--with-files],import <dir>,import <file> --from json|csv|wordpress,openapi. See Export and import and OpenAPI and other servers. - New entry
@mainsoft/agent-cms/adapters/node.
6. Types#
CreateCmsOptionsgainedusersandautomations.- A custom
CmsReponeeds the record methods (insertRecord,findRecord,findRecordByKey,listRecords,updateRecord,deleteRecords) andversionsSince;MemoryRepoandDrizzleRepohave them. - New error codes:
name_taken,role_not_found,role_last_admin,forbidden_roles,automation_not_found,automation_invalid,forbidden_automations.