1805 lines
62 KiB
JSON
1805 lines
62 KiB
JSON
[
|
|
{
|
|
"title": "Namespaces",
|
|
"parameters": {},
|
|
"entrypoint": "namespace",
|
|
"path": "/namespace",
|
|
"authentication": [],
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"sqlxTypes github.com/jmoiron/sqlx/types",
|
|
"time"
|
|
]
|
|
}
|
|
],
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"title": "List namespaces",
|
|
"path": "/",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"type": "string",
|
|
"name": "query",
|
|
"required": false,
|
|
"title": "Search query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "slug",
|
|
"required": false,
|
|
"title": "Search by namespace slug"
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Page number (0 based)"
|
|
},
|
|
{
|
|
"name": "perPage",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Returned items per page (default 50)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "create",
|
|
"method": "POST",
|
|
"title": "Create namespace",
|
|
"path": "/",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"type": "string",
|
|
"name": "name",
|
|
"required": true,
|
|
"title": "Name"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "slug",
|
|
"required": false,
|
|
"title": "Slug (url path part)"
|
|
},
|
|
{
|
|
"type": "bool",
|
|
"name": "enabled",
|
|
"required": false,
|
|
"title": "Enabled"
|
|
},
|
|
{
|
|
"type": "sqlxTypes.JSONText",
|
|
"name": "meta",
|
|
"required": true,
|
|
"title": "Meta data"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "read",
|
|
"method": "GET",
|
|
"title": "Read namespace",
|
|
"path": "/{namespaceID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "namespaceID",
|
|
"required": true,
|
|
"title": "ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "update",
|
|
"method": "POST",
|
|
"title": "Update namespace",
|
|
"path": "/{namespaceID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "namespaceID",
|
|
"required": true,
|
|
"title": "ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"type": "string",
|
|
"name": "name",
|
|
"required": true,
|
|
"title": "Name"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "slug",
|
|
"required": false,
|
|
"title": "Slug (url path part)"
|
|
},
|
|
{
|
|
"type": "bool",
|
|
"name": "enabled",
|
|
"required": false,
|
|
"title": "Enabled"
|
|
},
|
|
{
|
|
"type": "sqlxTypes.JSONText",
|
|
"name": "meta",
|
|
"required": true,
|
|
"title": "Meta data"
|
|
},
|
|
{
|
|
"type": "*time.Time",
|
|
"name": "updatedAt",
|
|
"required": false,
|
|
"title": "Last update (or creation) date"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"method": "DELETE",
|
|
"title": "Delete namespace",
|
|
"path": "/{namespaceID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "namespaceID",
|
|
"required": true,
|
|
"title": "ID"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Pages",
|
|
"description": "Compose pages",
|
|
"entrypoint": "page",
|
|
"path": "/namespace/{namespaceID}/page",
|
|
"authentication": [],
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"sqlxTypes github.com/jmoiron/sqlx/types"
|
|
]
|
|
}
|
|
],
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "namespaceID",
|
|
"required": true,
|
|
"title": "Namespace ID"
|
|
}
|
|
]
|
|
},
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"path": "/",
|
|
"title": "List available pages",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "selfID",
|
|
"required": false,
|
|
"title": "Parent page ID"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "query",
|
|
"required": false,
|
|
"title": "Search query"
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Page number (0 based)"
|
|
},
|
|
{
|
|
"name": "perPage",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Returned items per page (default 50)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "create",
|
|
"method": "POST",
|
|
"title": "Create page",
|
|
"path": "/",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "selfID",
|
|
"required": false,
|
|
"title": "Parent Page ID"
|
|
},
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": false,
|
|
"title": "Module ID"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "title",
|
|
"required": true,
|
|
"title": "Title"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "description",
|
|
"required": false,
|
|
"title": "Description"
|
|
},
|
|
{
|
|
"type": "bool",
|
|
"name": "visible",
|
|
"required": false,
|
|
"title": "Visible in navigation"
|
|
},
|
|
{
|
|
"type": "sqlxTypes.JSONText",
|
|
"name": "blocks",
|
|
"required": true,
|
|
"title": "Blocks JSON"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "read",
|
|
"path": "/{pageID}",
|
|
"method": "GET",
|
|
"title": "Get page details",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "pageID",
|
|
"required": true,
|
|
"title": "Page ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "tree",
|
|
"path": "/tree",
|
|
"method": "GET",
|
|
"title": "Get page all (non-record) pages, hierarchically",
|
|
"parameters": {}
|
|
},
|
|
{
|
|
"name": "update",
|
|
"method": "POST",
|
|
"title": "Update page",
|
|
"path": "/{pageID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "pageID",
|
|
"required": true,
|
|
"title": "Page ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "selfID",
|
|
"required": false,
|
|
"title": "Parent Page ID"
|
|
},
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": false,
|
|
"title": "Module ID (optional)"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "title",
|
|
"required": true,
|
|
"title": "Title"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "description",
|
|
"required": false,
|
|
"title": "Description"
|
|
},
|
|
{
|
|
"type": "bool",
|
|
"name": "visible",
|
|
"required": false,
|
|
"title": "Visible in navigation"
|
|
},
|
|
{
|
|
"type": "sqlxTypes.JSONText",
|
|
"name": "blocks",
|
|
"required": true,
|
|
"title": "Blocks JSON"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "reorder",
|
|
"method": "POST",
|
|
"title": "Reorder pages",
|
|
"path": "/{selfID}/reorder",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "selfID",
|
|
"required": true,
|
|
"title": "Parent page ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"type": "[]string",
|
|
"name": "pageIDs",
|
|
"required": true,
|
|
"title": "Page ID order"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"path": "/{pageID}",
|
|
"method": "Delete",
|
|
"title": "Delete page",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "pageID",
|
|
"required": true,
|
|
"title": "Page ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "upload",
|
|
"path": "/{pageID}/attachment",
|
|
"method": "POST",
|
|
"title": "Uploads attachment to page",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "pageID",
|
|
"required": true,
|
|
"title": "Page ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"name": "upload",
|
|
"type": "*multipart.FileHeader",
|
|
"required": true,
|
|
"title": "File to upload"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Modules",
|
|
"description": "Compose module definitions",
|
|
"entrypoint": "module",
|
|
"path": "/namespace/{namespaceID}/module",
|
|
"authentication": [],
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "namespaceID",
|
|
"required": true,
|
|
"title": "Namespace ID"
|
|
}
|
|
]
|
|
},
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"sqlxTypes github.com/jmoiron/sqlx/types",
|
|
"github.com/cortezaproject/corteza-server/compose/types",
|
|
"time"
|
|
]
|
|
}
|
|
],
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"title": "List modules",
|
|
"path": "/",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"type": "string",
|
|
"name": "query",
|
|
"required": false,
|
|
"title": "Search query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "name",
|
|
"required": false,
|
|
"title": "Search by name"
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Page number (0 based)"
|
|
},
|
|
{
|
|
"name": "perPage",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Returned items per page (default 50)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "create",
|
|
"method": "POST",
|
|
"title": "Create module",
|
|
"path": "/",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"type": "string",
|
|
"name": "name",
|
|
"required": true,
|
|
"title": "Module Name"
|
|
},
|
|
{
|
|
"type": "types.ModuleFieldSet",
|
|
"name": "fields",
|
|
"required": true,
|
|
"title": "Fields JSON"
|
|
},
|
|
{
|
|
"type": "sqlxTypes.JSONText",
|
|
"name": "meta",
|
|
"required": true,
|
|
"title": "Module meta data"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "read",
|
|
"method": "GET",
|
|
"title": "Read module",
|
|
"path": "/{moduleID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "update",
|
|
"method": "POST",
|
|
"title": "Update module",
|
|
"path": "/{moduleID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"type": "string",
|
|
"name": "name",
|
|
"required": true,
|
|
"title": "Module Name"
|
|
},
|
|
{
|
|
"type": "types.ModuleFieldSet",
|
|
"name": "fields",
|
|
"required": true,
|
|
"title": "Fields JSON"
|
|
},
|
|
{
|
|
"type": "sqlxTypes.JSONText",
|
|
"name": "meta",
|
|
"required": true,
|
|
"title": "Module meta data"
|
|
},
|
|
{
|
|
"type": "*time.Time",
|
|
"name": "updatedAt",
|
|
"required": false,
|
|
"title": "Last update (or creation) date"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"method": "DELETE",
|
|
"title": "Delete module",
|
|
"path": "/{moduleID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Records",
|
|
"description": "Compose records",
|
|
"entrypoint": "record",
|
|
"path": "/namespace/{namespaceID}/module/{moduleID}/record",
|
|
"authentication": [],
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"github.com/cortezaproject/corteza-server/compose/types"
|
|
]
|
|
}
|
|
],
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "namespaceID",
|
|
"required": true,
|
|
"title": "Namespace ID"
|
|
},
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
}
|
|
]
|
|
},
|
|
"apis": [
|
|
{
|
|
"name": "report",
|
|
"method": "GET",
|
|
"title": "Generates report from module records",
|
|
"path": "/report",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"type": "string",
|
|
"name": "metrics",
|
|
"required": false,
|
|
"title": "Metrics (eg: 'SUM(money), MAX(calls)')"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "dimensions",
|
|
"required": true,
|
|
"title": "Dimensions (eg: 'DATE(foo), status')"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "filter",
|
|
"required": false,
|
|
"title": "Filter (eg: 'DATE(foo) > 2010')"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"title": "List/read records from module section",
|
|
"path": "/",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"name": "filter",
|
|
"type": "string",
|
|
"required": false,
|
|
"title": "Filtering condition"
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Page number (0 based)"
|
|
},
|
|
{
|
|
"name": "perPage",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Returned items per page (default 50)"
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"type": "string",
|
|
"required": false,
|
|
"title": "Sort field (default id desc)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "importInit",
|
|
"path": "/import",
|
|
"method": "POST",
|
|
"title": "Initiate record import session",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"name": "upload",
|
|
"type": "*multipart.FileHeader",
|
|
"required": true,
|
|
"title": "File import"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "importRun",
|
|
"path": "/import/{sessionID}",
|
|
"method": "PATCH",
|
|
"title": "Run record import",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"name": "sessionID",
|
|
"type": "uint64",
|
|
"required": true,
|
|
"title": "Import session"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"name": "fields",
|
|
"type": "json.RawMessage",
|
|
"required": true,
|
|
"title": "Fields defined by import file"
|
|
},
|
|
{
|
|
"name": "onError",
|
|
"type": "string",
|
|
"required": true,
|
|
"title": "What happens if record fails to import"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "importProgress",
|
|
"path": "/import/{sessionID}",
|
|
"method": "GET",
|
|
"title": "Get import progress",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"name": "sessionID",
|
|
"type": "uint64",
|
|
"required": true,
|
|
"title": "Import session"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "export",
|
|
"path": "/export{filename}.{ext}",
|
|
"method": "GET",
|
|
"title": "Exports records that match ",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "string",
|
|
"name": "filename",
|
|
"required": false,
|
|
"title": "Filename to use"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "ext",
|
|
"required": true,
|
|
"title": "Export format"
|
|
}
|
|
],
|
|
"get": [
|
|
{
|
|
"name": "filter",
|
|
"type": "string",
|
|
"required": false,
|
|
"title": "Filtering condition"
|
|
},
|
|
{
|
|
"name": "fields",
|
|
"type": "[]string",
|
|
"required": true,
|
|
"title": "Fields to export"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "exec",
|
|
"path": "/exec/{procedure}",
|
|
"method": "POST",
|
|
"title": "Executes server-side procedure over one or more module records",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "string",
|
|
"name": "procedure",
|
|
"required": true,
|
|
"title": "Name of procedure to execute"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"type": "[]ProcedureArg",
|
|
"name": "args",
|
|
"required": false,
|
|
"title": "Procedure arguments"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "create",
|
|
"method": "POST",
|
|
"title": "Create record in module section",
|
|
"path": "/",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"type": "types.RecordValueSet",
|
|
"name": "values",
|
|
"required": true,
|
|
"title": "Record values"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "read",
|
|
"method": "GET",
|
|
"title": "Read records by ID from module section",
|
|
"path": "/{recordID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "recordID",
|
|
"required": true,
|
|
"title": "Record ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "update",
|
|
"method": "POST",
|
|
"title": "Update records in module section",
|
|
"path": "/{recordID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "recordID",
|
|
"required": true,
|
|
"title": "Record ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"type": "types.RecordValueSet",
|
|
"name": "values",
|
|
"required": true,
|
|
"title": "Record values"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"method": "DELETE",
|
|
"title": "Delete record row from module section",
|
|
"path": "/{recordID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "recordID",
|
|
"required": true,
|
|
"title": "Record ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "upload",
|
|
"path": "/attachment",
|
|
"method": "POST",
|
|
"title": "Uploads attachment and validates it against record field requirements",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"name": "recordID",
|
|
"type": "uint64",
|
|
"required": false,
|
|
"title": "Record ID"
|
|
},
|
|
{
|
|
"name": "fieldName",
|
|
"type": "string",
|
|
"required": true,
|
|
"title": "Field name"
|
|
},
|
|
{
|
|
"name": "upload",
|
|
"type": "*multipart.FileHeader",
|
|
"required": true,
|
|
"title": "File to upload"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Charts",
|
|
"path": "/namespace/{namespaceID}/chart",
|
|
"entrypoint": "chart",
|
|
"authentication": [],
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"sqlxTypes github.com/jmoiron/sqlx/types",
|
|
"time"
|
|
]
|
|
}
|
|
],
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "namespaceID",
|
|
"required": true,
|
|
"title": "Namespace ID"
|
|
}
|
|
]
|
|
},
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"title": "List/read charts",
|
|
"path": "/",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"name": "query",
|
|
"required": false,
|
|
"title": "Search query to match against charts",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Page number (0 based)"
|
|
},
|
|
{
|
|
"name": "perPage",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Returned items per page (default 50)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "create",
|
|
"method": "POST",
|
|
"title": "List/read charts ",
|
|
"path": "/",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"type": "sqlxTypes.JSONText",
|
|
"name": "config",
|
|
"required": true,
|
|
"title": "Chart JSON"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"title": "Chart name",
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "read",
|
|
"method": "GET",
|
|
"title": "Read charts by ID",
|
|
"path": "/{chartID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "chartID",
|
|
"required": true,
|
|
"title": "Chart ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "update",
|
|
"method": "POST",
|
|
"title": "Add/update charts",
|
|
"path": "/{chartID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "chartID",
|
|
"required": true,
|
|
"title": "Chart ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"type": "sqlxTypes.JSONText",
|
|
"name": "config",
|
|
"required": true,
|
|
"title": "Chart JSON"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"title": "Chart name",
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "*time.Time",
|
|
"name": "updatedAt",
|
|
"required": false,
|
|
"title": "Last update (or creation) date"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"method": "DELETE",
|
|
"title": "Delete chart",
|
|
"path": "/{chartID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "chartID",
|
|
"required": true,
|
|
"title": "Chart ID"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Notifications",
|
|
"description": "Compose Notifications",
|
|
"entrypoint": "notification",
|
|
"path": "/notification",
|
|
"authentication": [],
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"sqlxTypes github.com/jmoiron/sqlx/types"
|
|
]
|
|
}
|
|
],
|
|
"apis": [
|
|
{
|
|
"name": "email/send",
|
|
"method": "POST",
|
|
"title": "Send email from the Compose",
|
|
"path": "/email",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"name": "to",
|
|
"type": "[]string",
|
|
"required": true,
|
|
"title": "Email addresses"
|
|
},
|
|
{
|
|
"name": "cc",
|
|
"type": "[]string",
|
|
"required": false,
|
|
"title": "Email addresses"
|
|
},
|
|
{
|
|
"name": "replyTo",
|
|
"type": "string",
|
|
"required": false,
|
|
"title": "Email address in reply-to field"
|
|
},
|
|
{
|
|
"name": "subject ",
|
|
"type": "string",
|
|
"required": false,
|
|
"title": "Email subject"
|
|
},
|
|
{
|
|
"name": "content",
|
|
"type": "sqlxTypes.JSONText",
|
|
"required": true,
|
|
"title": "Message content"
|
|
},
|
|
{
|
|
"name": "remoteAttachments",
|
|
"type": "[]string",
|
|
"required": false,
|
|
"title": "Remote files to attach to the email"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Attachments",
|
|
"path": "/namespace/{namespaceID}/attachment/{kind}",
|
|
"entrypoint": "attachment",
|
|
"authentication": [
|
|
"Client ID",
|
|
"Session ID"
|
|
],
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"name": "kind",
|
|
"type": "string",
|
|
"required": true,
|
|
"title": "Attachment kind"
|
|
},
|
|
{
|
|
"type": "uint64",
|
|
"name": "namespaceID",
|
|
"required": true,
|
|
"title": "Namespace ID"
|
|
}
|
|
],
|
|
"get": [
|
|
{
|
|
"type": "string",
|
|
"name": "sign",
|
|
"required": false,
|
|
"title": "Signature"
|
|
},
|
|
{
|
|
"type": "uint64",
|
|
"name": "userID",
|
|
"required": false,
|
|
"title": "User ID"
|
|
}
|
|
]
|
|
},
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"path": "/",
|
|
"method": "GET",
|
|
"title": "List, filter all page attachments",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"name": "pageID",
|
|
"type": "uint64",
|
|
"required": false,
|
|
"title": "Filter attachments by page ID"
|
|
},
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": false,
|
|
"title": "Filter attachments by module ID"
|
|
},
|
|
{
|
|
"name": "recordID",
|
|
"type": "uint64",
|
|
"required": false,
|
|
"title": "Filter attachments by record ID"
|
|
},
|
|
{
|
|
"name": "fieldName",
|
|
"type": "string",
|
|
"required": false,
|
|
"title": "Filter attachments by field name"
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Page number (0 based)"
|
|
},
|
|
{
|
|
"name": "perPage",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Returned items per page (default 50)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "read",
|
|
"path": "/{attachmentID}",
|
|
"method": "GET",
|
|
"title": "Attachment details",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"name": "attachmentID",
|
|
"type": "uint64",
|
|
"required": true,
|
|
"title": "Attachment ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"path": "/{attachmentID}",
|
|
"method": "DELETE",
|
|
"title": "Delete attachment",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"name": "attachmentID",
|
|
"type": "uint64",
|
|
"required": true,
|
|
"title": "Attachment ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "original",
|
|
"path": "/{attachmentID}/original/{name}",
|
|
"method": "GET",
|
|
"title": "Serves attached file",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"name": "attachmentID",
|
|
"type": "uint64",
|
|
"required": true,
|
|
"title": "Attachment ID"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "string",
|
|
"required": true,
|
|
"title": "File name"
|
|
}
|
|
],
|
|
"get": [
|
|
{
|
|
"type": "bool",
|
|
"name": "download",
|
|
"required": false,
|
|
"title": "Force file download"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "preview",
|
|
"path": "/{attachmentID}/preview.{ext}",
|
|
"method": "GET",
|
|
"title": "Serves preview of an attached file",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"name": "attachmentID",
|
|
"type": "uint64",
|
|
"required": true,
|
|
"title": "Attachment ID"
|
|
},
|
|
{
|
|
"name": "ext",
|
|
"type": "string",
|
|
"required": true,
|
|
"title": "Preview extension/format"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Permissions",
|
|
"parameters": {},
|
|
"entrypoint": "permissions",
|
|
"path": "/permissions",
|
|
"authentication": [
|
|
"Client ID",
|
|
"Session ID"
|
|
],
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"github.com/cortezaproject/corteza-server/internal/permissions"
|
|
]
|
|
}
|
|
],
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"path": "/",
|
|
"method": "GET",
|
|
"title": "Retrieve defined permissions",
|
|
"parameters": {}
|
|
},
|
|
{
|
|
"name": "effective",
|
|
"path": "/effective",
|
|
"method": "GET",
|
|
"title": "Effective rules for current user",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"name": "resource",
|
|
"type": "string",
|
|
"required": false,
|
|
"title": "Show only rules for a specific resource"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "read",
|
|
"path": "/{roleID}/rules",
|
|
"method": "GET",
|
|
"title": "Retrieve role permissions",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"name": "roleID",
|
|
"type": "uint64",
|
|
"required": true,
|
|
"title": "Role ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"path": "/{roleID}/rules",
|
|
"method": "DELETE",
|
|
"title": "Remove all defined role permissions",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"name": "roleID",
|
|
"type": "uint64",
|
|
"required": true,
|
|
"title": "Role ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "update",
|
|
"path": "/{roleID}/rules",
|
|
"method": "PATCH",
|
|
"title": "Update permission settings",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"name": "roleID",
|
|
"type": "uint64",
|
|
"required": true,
|
|
"title": "Role ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"name": "rules",
|
|
"type": "permissions.RuleSet",
|
|
"required": true,
|
|
"title": "List of permission rules to set"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Automation scripts",
|
|
"entrypoint": "automation_script",
|
|
"path": "/namespace/{namespaceID}/automation/script",
|
|
"authentication": [
|
|
"Client ID",
|
|
"Session ID"
|
|
],
|
|
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"github.com/cortezaproject/corteza-server/pkg/automation"
|
|
]
|
|
}
|
|
],
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "namespaceID",
|
|
"required": true,
|
|
"title": "Namespace ID"
|
|
}
|
|
]
|
|
},
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"title": "List/read automation script",
|
|
"path": "/",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"name": "query",
|
|
"required": false,
|
|
"title": "Search query to match against automation script",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "resource",
|
|
"required": false,
|
|
"title": "Limit by resource (via trigger)",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "incDeleted",
|
|
"required": false,
|
|
"title": "Include deleted scripts",
|
|
"type": "bool"
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Page number (0 based)"
|
|
},
|
|
{
|
|
"name": "perPage",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Returned items per page (default 50)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "create",
|
|
"method": "POST",
|
|
"title": "Add new automation script ",
|
|
"path": "/",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"name": "name",
|
|
"title": "automation name",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "sourceRef",
|
|
"title": "Source URL",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "source",
|
|
"title": "Source code",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "runAs",
|
|
"title": "Run as specific user",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"name": "runInUA",
|
|
"title": "Run script in user-agent (browser)",
|
|
"type": "bool"
|
|
},
|
|
{
|
|
"name": "timeout",
|
|
"title": "Script timeout (in milliseconds)",
|
|
"type": "uint"
|
|
},
|
|
{
|
|
"name": "critical",
|
|
"title": "Is it critical to run this script successfully",
|
|
"type": "bool"
|
|
},
|
|
{
|
|
"name": "async",
|
|
"title": "Will this script be ran asynchronously",
|
|
"type": "bool"
|
|
},
|
|
{
|
|
"name": "enabled",
|
|
"type": "bool"
|
|
},
|
|
{
|
|
"name": "triggers",
|
|
"type": "automation.TriggerSet"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "read",
|
|
"method": "GET",
|
|
"title": "Read automation script by ID",
|
|
"path": "/{scriptID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "scriptID",
|
|
"required": true,
|
|
"title": "automation script ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "update",
|
|
"method": "POST",
|
|
"title": "Update automation script",
|
|
"path": "/{scriptID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "scriptID",
|
|
"required": true,
|
|
"title": "Automation script ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"name": "name",
|
|
"title": "Script name",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "sourceRef",
|
|
"title": "Source URL",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "source",
|
|
"title": "Source code",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "runAs",
|
|
"title": "Run script as specific user",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"name": "runInUA",
|
|
"title": "Run script in user-agent (browser)",
|
|
"type": "bool"
|
|
},
|
|
{
|
|
"name": "timeout",
|
|
"title": "Run script in user-agent (browser)",
|
|
"type": "uint"
|
|
},
|
|
{
|
|
"name": "critical",
|
|
"title": "Is it critical to run this script successfully",
|
|
"type": "bool"
|
|
},
|
|
{
|
|
"name": "async",
|
|
"title": "Will this script be ran asynchronously",
|
|
"type": "bool"
|
|
},
|
|
{
|
|
"name": "enabled",
|
|
"type": "bool"
|
|
},
|
|
{
|
|
"name": "triggers",
|
|
"type": "automation.TriggerSet"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"method": "DELETE",
|
|
"title": "Delete script",
|
|
"path": "/{scriptID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "scriptID",
|
|
"required": true,
|
|
"title": "Script ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "runnable",
|
|
"method": "GET",
|
|
"title": "List of runnable (event=manual) scripts (executable on the backend or from user-agent/browser)",
|
|
"path": "/runnable",
|
|
"parameters": {
|
|
"get": [
|
|
{"name": "resource", "type": "string", "title": "Resource"},
|
|
{"name": "condition", "type": "string", "title": "Trigger condition"}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "run",
|
|
"method": "POST",
|
|
"title": "Run a specific script or code at the backend. Used for running script manually",
|
|
"path": "/{scriptID}/run",
|
|
"parameters": {
|
|
"path": [
|
|
{"type": "uint64", "name": "scriptID", "required": true}
|
|
],
|
|
"post": [
|
|
{"name": "moduleID", "type": "uint64", "title": "ModuleID to be used"},
|
|
{"name": "recordID", "type": "uint64", "title": "RecordID to be used (instead of record payload)"},
|
|
{"name": "record", "type": "json.RawMessage", "title": "Record payload to be used (instead of specific record when using recordID)"}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "test",
|
|
"method": "POST",
|
|
"title": "Run source code in corredor. Used for testing",
|
|
"path": "/test",
|
|
"parameters": {
|
|
"post": [
|
|
{"name": "source", "type": "string", "title": "Script's source code"},
|
|
{"name": "moduleID", "type": "uint64", "title": "Preload module and pass it to the automation script"},
|
|
{"name": "record", "type": "json.RawMessage", "title": "Record to pass to the automation script"}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Automation script triggers",
|
|
"entrypoint": "automation_trigger",
|
|
"path": "/namespace/{namespaceID}/automation/script/{scriptID}/trigger",
|
|
"authentication": [
|
|
"Client ID",
|
|
"Session ID"
|
|
],
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "namespaceID",
|
|
"required": true,
|
|
"title": "Namespace ID"
|
|
},
|
|
{
|
|
"type": "uint64",
|
|
"name": "scriptID",
|
|
"required": true,
|
|
"title": "Script ID"
|
|
}
|
|
]
|
|
},
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"title": "List/read automation script triggers",
|
|
"path": "/",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"name": "resource",
|
|
"required": false,
|
|
"title": "Only triggers of a specific resource",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "event",
|
|
"required": false,
|
|
"title": "Only triggers of a specific event",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "incDeleted",
|
|
"required": false,
|
|
"title": "Include deleted scripts",
|
|
"type": "bool"
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Page number (0 based)"
|
|
},
|
|
{
|
|
"name": "perPage",
|
|
"type": "uint",
|
|
"required": false,
|
|
"title": "Returned items per page (default 50)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "create",
|
|
"method": "POST",
|
|
"title": "Add new automation script trigger",
|
|
"path": "/",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"name": "resource",
|
|
"title": "Resource",
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "event",
|
|
"title": "Event",
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "condition",
|
|
"title": "Event",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "enabled",
|
|
"type": "bool"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "read",
|
|
"method": "GET",
|
|
"title": "Read automation script trigger by ID",
|
|
"path": "/{triggerID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "triggerID",
|
|
"required": true,
|
|
"title": "Automation script trigger ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "update",
|
|
"method": "POST",
|
|
"title": "Update automation script trigger",
|
|
"path": "/{triggerID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "triggerID",
|
|
"required": true,
|
|
"title": "Automation script trigger ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"name": "resource",
|
|
"title": "Resource",
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "event",
|
|
"title": "Event",
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "condition",
|
|
"title": "Event",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "enabled",
|
|
"type": "bool"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"method": "DELETE",
|
|
"title": "Delete script",
|
|
"path": "/{triggerID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "triggerID",
|
|
"required": true,
|
|
"title": "automation script trigger ID"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|