937 lines
22 KiB
JSON
937 lines
22 KiB
JSON
[
|
|
{
|
|
"title": "Fields",
|
|
"description": "CRM input field definitions",
|
|
"package": "crm",
|
|
"entrypoint": "field",
|
|
"path": "/field",
|
|
"authentication": [],
|
|
"struct": [],
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"path": "/",
|
|
"title": "List available fields"
|
|
},
|
|
{
|
|
"name": "type",
|
|
"path": "/{typeID}",
|
|
"method": "GET",
|
|
"title": "Get field details",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "string",
|
|
"name": "typeID",
|
|
"required": true,
|
|
"title": "Type ID"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Workflows",
|
|
"description": "CRM workflow definitions",
|
|
"package": "crm",
|
|
"entrypoint": "workflow",
|
|
"path": "/workflow",
|
|
"authentication": [],
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"github.com/crusttech/crust/crm/types"
|
|
]
|
|
}
|
|
],
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"path": "/",
|
|
"title": "List available workflows"
|
|
},
|
|
{
|
|
"name": "create",
|
|
"path": "/",
|
|
"method": "POST",
|
|
"title": "Create new workflow",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"type": "string",
|
|
"name": "name",
|
|
"required": true,
|
|
"title": "Workflow name"
|
|
},
|
|
{
|
|
"type": "types.WorkflowTaskSet",
|
|
"name": "tasks",
|
|
"required": false,
|
|
"title": "Type ID"
|
|
},
|
|
{
|
|
"type": "types.WorkflowTaskSet",
|
|
"name": "onError",
|
|
"required": false,
|
|
"title": "Type ID"
|
|
},
|
|
{
|
|
"type": "int",
|
|
"name": "timeout",
|
|
"required": false,
|
|
"title": "Timeout in seconds"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "get",
|
|
"method": "GET",
|
|
"path": "/{workflowID}",
|
|
"title": "Get workflow details",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "string",
|
|
"name": "workflowID",
|
|
"required": true,
|
|
"title": "Workflow ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "update",
|
|
"method": "POST",
|
|
"path": "/{workflowID}",
|
|
"title": "Update workflow details",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "string",
|
|
"name": "workflowID",
|
|
"required": true,
|
|
"title": "Workflow ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"type": "string",
|
|
"name": "name",
|
|
"required": true,
|
|
"title": "Workflow name"
|
|
},
|
|
{
|
|
"type": "types.WorkflowTaskSet",
|
|
"name": "tasks",
|
|
"required": false,
|
|
"title": "Type ID"
|
|
},
|
|
{
|
|
"type": "types.WorkflowTaskSet",
|
|
"name": "onError",
|
|
"required": false,
|
|
"title": "Type ID"
|
|
},
|
|
{
|
|
"type": "int",
|
|
"name": "timeout",
|
|
"required": false,
|
|
"title": "Timeout in seconds"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"method": "DELETE",
|
|
"path": "/{workflowID}",
|
|
"title": "Delete workflow",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "string",
|
|
"name": "workflowID",
|
|
"required": true,
|
|
"title": "Workflow ID"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Jobs",
|
|
"description": "Workflow Jobs",
|
|
"package": "crm",
|
|
"entrypoint": "job",
|
|
"path": "/job",
|
|
"authentication": [],
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"github.com/crusttech/crust/crm/types",
|
|
"sqlxTypes github.com/jmoiron/sqlx/types"
|
|
]
|
|
}
|
|
],
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"path": "/",
|
|
"title": "List jobs",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"type": "string",
|
|
"name": "status",
|
|
"required": false,
|
|
"title": "Job status (`ok`, `error`, `running`, `cancelled` or `queued`)"
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "int",
|
|
"required": false,
|
|
"title": "Page number (0 based)"
|
|
},
|
|
{
|
|
"name": "perPage",
|
|
"type": "int",
|
|
"required": false,
|
|
"title": "Returned items per page (default 50)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "run",
|
|
"path": "/",
|
|
"method": "POST",
|
|
"title": "Create a new job",
|
|
"parameters": {
|
|
"post": [
|
|
{
|
|
"type": "string",
|
|
"name": "workflowID",
|
|
"required": true,
|
|
"title": "Workflow ID"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "startAt",
|
|
"required": false,
|
|
"title": "Start datetime for a delayed job"
|
|
},
|
|
{
|
|
"type": "types.JobParameterSet",
|
|
"name": "parameters",
|
|
"required": false,
|
|
"title": "Extra job parameters (map[string]string)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "get",
|
|
"method": "GET",
|
|
"path": "/{jobID}",
|
|
"title": "Get job details",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "string",
|
|
"name": "jobID",
|
|
"required": true,
|
|
"title": "Job ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "logs",
|
|
"method": "GET",
|
|
"path": "/{jobID}/logs",
|
|
"title": "Get job logs",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "string",
|
|
"name": "jobID",
|
|
"required": true,
|
|
"title": "Job ID"
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "int",
|
|
"required": false,
|
|
"title": "Page number (0 based)"
|
|
},
|
|
{
|
|
"name": "perPage",
|
|
"type": "int",
|
|
"required": false,
|
|
"title": "Returned items per page (default 50)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "update",
|
|
"method": "POST",
|
|
"path": "/{jobID}",
|
|
"title": "Update job details",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "string",
|
|
"name": "jobID",
|
|
"required": true,
|
|
"title": "Job ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"type": "string",
|
|
"name": "status",
|
|
"required": false,
|
|
"title": "Job status (`ok`, `error`, `running`, `cancelled` or `queued`)"
|
|
},
|
|
{
|
|
"type": "sqlxTypes.JSONText",
|
|
"name": "log",
|
|
"required": false,
|
|
"title": "Job log item (append-only)"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "workflowID",
|
|
"required": false,
|
|
"title": "Workflow ID"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "startAt",
|
|
"required": false,
|
|
"title": "Start datetime for a delayed job"
|
|
},
|
|
{
|
|
"type": "types.JobParameterSet",
|
|
"name": "parameters",
|
|
"required": false,
|
|
"title": "Extra job parameters (map[string]string)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"method": "DELETE",
|
|
"path": "/{jobID}",
|
|
"title": "Cancel job",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "string",
|
|
"name": "jobID",
|
|
"required": true,
|
|
"title": "Job ID"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Pages",
|
|
"description": "CRM module pages",
|
|
"package": "crm",
|
|
"entrypoint": "page",
|
|
"path": "/page",
|
|
"authentication": [],
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"sqlxTypes github.com/jmoiron/sqlx/types"
|
|
]
|
|
}
|
|
],
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"path": "/",
|
|
"title": "List available pages",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "selfID",
|
|
"required": false,
|
|
"title": "Parent page ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"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": "edit",
|
|
"method": "POST",
|
|
"title": "Edit 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"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Modules",
|
|
"description": "CRM module definitions",
|
|
"package": "crm",
|
|
"entrypoint": "module",
|
|
"path": "/module",
|
|
"authentication": [],
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"sqlxTypes github.com/jmoiron/sqlx/types",
|
|
"github.com/crusttech/crust/crm/types"
|
|
]
|
|
}
|
|
],
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"title": "List modules",
|
|
"path": "/",
|
|
"parameters": {
|
|
"get": [
|
|
{
|
|
"type": "string",
|
|
"name": "query",
|
|
"required": false,
|
|
"title": "Search query"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"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"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "read",
|
|
"method": "GET",
|
|
"title": "Read module",
|
|
"path": "/{moduleID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "edit",
|
|
"method": "POST",
|
|
"title": "Edit 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"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"method": "DELETE",
|
|
"title": "Delete module",
|
|
"path": "/{moduleID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "record/report",
|
|
"method": "GET",
|
|
"title": "Generates report from module records",
|
|
"path": "/{moduleID}/report",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
}
|
|
],
|
|
"get": [
|
|
{
|
|
"type": "string",
|
|
"name": "metrics",
|
|
"required": true,
|
|
"title": "Metrics (syntax: alias:expression;...)"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "dimensions",
|
|
"required": true,
|
|
"title": "Dimensions (syntax: alias:field|modifier|modifier2;...)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "record/list",
|
|
"method": "GET",
|
|
"title": "List/read records from module section",
|
|
"path": "/{moduleID}/record",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
}
|
|
],
|
|
"get": [
|
|
{
|
|
"type": "string",
|
|
"name": "query",
|
|
"required": false,
|
|
"title": "Search query"
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "int",
|
|
"required": false,
|
|
"title": "Page number (0 based)"
|
|
},
|
|
{
|
|
"name": "perPage",
|
|
"type": "int",
|
|
"required": false,
|
|
"title": "Returned items per page (default 50)"
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"type": "string",
|
|
"required": false,
|
|
"title": "Sort field (default id desc)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "record/create",
|
|
"method": "POST",
|
|
"title": "Create record in module section",
|
|
"path": "/{moduleID}/record",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"type": "sqlxTypes.JSONText",
|
|
"name": "fields",
|
|
"required": true,
|
|
"title": "Record JSON"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "record/read",
|
|
"method": "GET",
|
|
"title": "Read records by ID from module section",
|
|
"path": "/{moduleID}/record/{recordID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
},
|
|
{
|
|
"type": "uint64",
|
|
"name": "recordID",
|
|
"required": true,
|
|
"title": "Record ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "record/edit",
|
|
"method": "POST",
|
|
"title": "Add/update records in module section",
|
|
"path": "/{moduleID}/record/{recordID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
},
|
|
{
|
|
"type": "uint64",
|
|
"name": "recordID",
|
|
"required": true,
|
|
"title": "Record ID"
|
|
}
|
|
],
|
|
"post": [
|
|
{
|
|
"type": "sqlxTypes.JSONText",
|
|
"name": "fields",
|
|
"required": true,
|
|
"title": "Record JSON"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "record/delete",
|
|
"method": "DELETE",
|
|
"title": "Delete record row from module section",
|
|
"path": "/{moduleID}/record/{recordID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "moduleID",
|
|
"required": true,
|
|
"title": "Module ID"
|
|
},
|
|
{
|
|
"type": "uint64",
|
|
"name": "recordID",
|
|
"required": true,
|
|
"title": "Record ID"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"title": "Charts",
|
|
"path": "/chart",
|
|
"entrypoint": "chart",
|
|
"struct": [
|
|
{
|
|
"imports": [
|
|
"sqlxTypes github.com/jmoiron/sqlx/types"
|
|
]
|
|
}
|
|
],
|
|
"apis": [
|
|
{
|
|
"name": "list",
|
|
"method": "GET",
|
|
"title": "List/read charts from module section",
|
|
"path": "/"
|
|
},
|
|
{
|
|
"name": "create",
|
|
"method": "POST",
|
|
"title": "List/read charts from module section",
|
|
"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 from module section",
|
|
"path": "/{chartID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "chartID",
|
|
"required": true,
|
|
"title": "Chart ID"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "edit",
|
|
"method": "POST",
|
|
"title": "Add/update charts in module section",
|
|
"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
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"method": "DELETE",
|
|
"title": "Delete chart",
|
|
"path": "/{chartID}",
|
|
"parameters": {
|
|
"path": [
|
|
{
|
|
"type": "uint64",
|
|
"name": "chartID",
|
|
"required": true,
|
|
"title": "Chart ID"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|