0nmcp 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +233 -695
- package/cli.js +9 -1
- package/crm/agent-studio.js +114 -0
- package/crm/funnels.js +90 -0
- package/crm/index.js +15 -0
- package/crm/knowledge-base.js +69 -0
- package/crm/objects.js +5 -69
- package/crm/saas.js +147 -0
- package/crm/users.js +5 -80
- package/crm/voice-ai.js +150 -0
- package/engine/index.js +338 -2
- package/engine/multi-ai.js +525 -0
- package/engine/plugin-builder.js +578 -0
- package/engine/plugin-registry.js +419 -0
- package/engine/plugin.js +448 -0
- package/engine/training-feed.js +520 -0
- package/engine/training.js +875 -0
- package/index.js +9 -1
- package/lib/stats.json +1 -1
- package/package.json +12 -2
package/cli.js
CHANGED
|
@@ -76,6 +76,14 @@ async function main() {
|
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
// ── Install (full onboarding — no login required) ─────────
|
|
80
|
+
|
|
81
|
+
if (command === 'install') {
|
|
82
|
+
const { install } = await import('./install.js');
|
|
83
|
+
await install();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
79
87
|
// ── Auth commands (no login required) ──────────────────────
|
|
80
88
|
|
|
81
89
|
if (command === 'login') {
|
|
@@ -194,7 +202,7 @@ ${c.bright}Links:${c.reset}
|
|
|
194
202
|
|
|
195
203
|
// ── Auth Gate ──────────────────────────────────────────────
|
|
196
204
|
// All commands below this point require authentication.
|
|
197
|
-
const AUTH_FREE = ['help', '--help', '-h', 'login', 'logout', 'whoami', 'version', '--version', '-v'];
|
|
205
|
+
const AUTH_FREE = ['help', '--help', '-h', 'login', 'logout', 'whoami', 'version', '--version', '-v', 'install'];
|
|
198
206
|
if (!AUTH_FREE.includes(command)) {
|
|
199
207
|
try {
|
|
200
208
|
const { isAuthenticated } = await import('./auth.js');
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// 0nMCP — CRM Agent Studio API Tool Definitions
|
|
3
|
+
// ============================================================
|
|
4
|
+
// AI agents per location with knowledge base + MCP integration.
|
|
5
|
+
// Agents can call 0nMCP tools via MCP Server nodes.
|
|
6
|
+
// ============================================================
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
{
|
|
10
|
+
name: "crm_list_agents",
|
|
11
|
+
description: "List all Agent Studio agents for a location with pagination.",
|
|
12
|
+
method: "GET",
|
|
13
|
+
path: "/agent-studio/agent",
|
|
14
|
+
params: {
|
|
15
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "query" },
|
|
16
|
+
limit: { type: "number", description: "Results per page", required: false, in: "query" },
|
|
17
|
+
offset: { type: "number", description: "Pagination offset", required: false, in: "query" },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
{
|
|
22
|
+
name: "crm_create_agent",
|
|
23
|
+
description: "Create a new Agent Studio agent with a staging version. Can be connected to knowledge bases and MCP servers.",
|
|
24
|
+
method: "POST",
|
|
25
|
+
path: "/agent-studio/agent",
|
|
26
|
+
params: {
|
|
27
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "body" },
|
|
28
|
+
name: { type: "string", description: "Agent name", required: true, in: "body" },
|
|
29
|
+
description: { type: "string", description: "Agent description", required: false, in: "body" },
|
|
30
|
+
},
|
|
31
|
+
body: ["locationId", "name", "description"],
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
{
|
|
35
|
+
name: "crm_get_agent",
|
|
36
|
+
description: "Get a specific Agent Studio agent by ID with all versions.",
|
|
37
|
+
method: "GET",
|
|
38
|
+
path: "/agent-studio/agent/:agentId",
|
|
39
|
+
params: {
|
|
40
|
+
agentId: { type: "string", description: "Agent ID", required: true, in: "path" },
|
|
41
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "query" },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
{
|
|
46
|
+
name: "crm_update_agent",
|
|
47
|
+
description: "Update an agent version — modify nodes, edges, variables, knowledge base connections, and MCP server nodes.",
|
|
48
|
+
method: "PUT",
|
|
49
|
+
path: "/agent-studio/agent/:agentId",
|
|
50
|
+
params: {
|
|
51
|
+
agentId: { type: "string", description: "Agent ID", required: true, in: "path" },
|
|
52
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "body" },
|
|
53
|
+
versionId: { type: "string", description: "Version ID to update", required: true, in: "body" },
|
|
54
|
+
nodes: { type: "array", description: "Array of workflow nodes (knowledge_base, mcp_server, action, condition, etc.)", required: false, in: "body" },
|
|
55
|
+
edges: { type: "array", description: "Array of edges connecting nodes", required: false, in: "body" },
|
|
56
|
+
variables: { type: "object", description: "Agent variables/context", required: false, in: "body" },
|
|
57
|
+
},
|
|
58
|
+
body: ["locationId", "versionId", "nodes", "edges", "variables"],
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
{
|
|
62
|
+
name: "crm_update_agent_metadata",
|
|
63
|
+
description: "Update agent name, description, and status (active/inactive).",
|
|
64
|
+
method: "PATCH",
|
|
65
|
+
path: "/agent-studio/agent/:agentId/metadata",
|
|
66
|
+
params: {
|
|
67
|
+
agentId: { type: "string", description: "Agent ID", required: true, in: "path" },
|
|
68
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "body" },
|
|
69
|
+
name: { type: "string", description: "Agent name", required: false, in: "body" },
|
|
70
|
+
description: { type: "string", description: "Description", required: false, in: "body" },
|
|
71
|
+
status: { type: "string", description: "Agent status (active, inactive)", required: false, in: "body" },
|
|
72
|
+
},
|
|
73
|
+
body: ["locationId", "name", "description", "status"],
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
{
|
|
77
|
+
name: "crm_delete_agent",
|
|
78
|
+
description: "Delete an Agent Studio agent and all its versions.",
|
|
79
|
+
method: "DELETE",
|
|
80
|
+
path: "/agent-studio/agent/:agentId",
|
|
81
|
+
params: {
|
|
82
|
+
agentId: { type: "string", description: "Agent ID", required: true, in: "path" },
|
|
83
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "query" },
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
{
|
|
88
|
+
name: "crm_promote_agent",
|
|
89
|
+
description: "Promote an agent's draft/staging version to production.",
|
|
90
|
+
method: "POST",
|
|
91
|
+
path: "/agent-studio/agent/:agentId/promote",
|
|
92
|
+
params: {
|
|
93
|
+
agentId: { type: "string", description: "Agent ID", required: true, in: "path" },
|
|
94
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "body" },
|
|
95
|
+
versionId: { type: "string", description: "Version ID to promote", required: true, in: "body" },
|
|
96
|
+
},
|
|
97
|
+
body: ["locationId", "versionId"],
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
{
|
|
101
|
+
name: "crm_execute_agent",
|
|
102
|
+
description: "Execute an Agent Studio agent. Send a message and get a response. Use executionId to maintain conversation sessions.",
|
|
103
|
+
method: "POST",
|
|
104
|
+
path: "/agent-studio/agent/:agentId/execute",
|
|
105
|
+
params: {
|
|
106
|
+
agentId: { type: "string", description: "Agent ID", required: true, in: "path" },
|
|
107
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "body" },
|
|
108
|
+
message: { type: "string", description: "User message to send to the agent", required: true, in: "body" },
|
|
109
|
+
executionId: { type: "string", description: "Previous execution ID to continue a conversation session. Omit for new sessions.", required: false, in: "body" },
|
|
110
|
+
contactId: { type: "string", description: "Contact ID for context", required: false, in: "body" },
|
|
111
|
+
},
|
|
112
|
+
body: ["locationId", "message", "executionId", "contactId"],
|
|
113
|
+
},
|
|
114
|
+
]
|
package/crm/funnels.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// 0nMCP — CRM Funnels & Forms & Surveys Tool Definitions
|
|
3
|
+
// ============================================================
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
// ── Funnels ────────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
{ name: "crm_list_funnels", description: "List all funnels for a location.", method: "GET", path: "/funnels/funnel/list",
|
|
9
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "query" }, limit: { type: "number", description: "Results per page", required: false, in: "query" }, offset: { type: "number", description: "Offset", required: false, in: "query" } } },
|
|
10
|
+
|
|
11
|
+
{ name: "crm_list_funnel_pages", description: "List all pages across funnels for a location.", method: "GET", path: "/funnels/page",
|
|
12
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "query" }, funnelId: { type: "string", description: "Filter by funnel ID", required: false, in: "query" }, limit: { type: "number", description: "Results per page", required: false, in: "query" }, offset: { type: "number", description: "Offset", required: false, in: "query" } } },
|
|
13
|
+
|
|
14
|
+
{ name: "crm_count_funnel_pages", description: "Get count of funnel pages for a location.", method: "GET", path: "/funnels/page/count",
|
|
15
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "query" }, funnelId: { type: "string", description: "Filter by funnel ID", required: false, in: "query" } } },
|
|
16
|
+
|
|
17
|
+
{ name: "crm_create_redirect", description: "Create a URL redirect/trigger link.", method: "POST", path: "/funnels/lookup/redirect",
|
|
18
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "body" }, target: { type: "string", description: "Target URL", required: true, in: "body" }, domain: { type: "string", description: "Domain", required: false, in: "body" }, path: { type: "string", description: "Path slug", required: false, in: "body" } },
|
|
19
|
+
body: ["locationId", "target", "domain", "path"] },
|
|
20
|
+
|
|
21
|
+
{ name: "crm_list_redirects", description: "List all redirects for a location.", method: "GET", path: "/funnels/lookup/redirect/list",
|
|
22
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "query" }, limit: { type: "number", description: "Results", required: false, in: "query" }, offset: { type: "number", description: "Offset", required: false, in: "query" } } },
|
|
23
|
+
|
|
24
|
+
{ name: "crm_update_redirect", description: "Update a redirect by ID.", method: "PATCH", path: "/funnels/lookup/redirect/:id",
|
|
25
|
+
params: { id: { type: "string", description: "Redirect ID", required: true, in: "path" }, target: { type: "string", description: "New target URL", required: false, in: "body" } },
|
|
26
|
+
body: ["target"] },
|
|
27
|
+
|
|
28
|
+
{ name: "crm_delete_redirect", description: "Delete a redirect by ID.", method: "DELETE", path: "/funnels/lookup/redirect/:id",
|
|
29
|
+
params: { id: { type: "string", description: "Redirect ID", required: true, in: "path" } } },
|
|
30
|
+
|
|
31
|
+
// ── Forms ──────────────────────────────────────────────────
|
|
32
|
+
|
|
33
|
+
{ name: "crm_list_forms", description: "List all forms for a location.", method: "GET", path: "/forms/",
|
|
34
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "query" }, limit: { type: "number", description: "Results", required: false, in: "query" }, skip: { type: "number", description: "Skip", required: false, in: "query" }, type: { type: "string", description: "Form type filter", required: false, in: "query" } } },
|
|
35
|
+
|
|
36
|
+
{ name: "crm_list_form_submissions", description: "List form submissions with filters.", method: "GET", path: "/forms/submissions",
|
|
37
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "query" }, formId: { type: "string", description: "Filter by form ID", required: false, in: "query" }, startAt: { type: "string", description: "Start date ISO", required: false, in: "query" }, endAt: { type: "string", description: "End date ISO", required: false, in: "query" }, limit: { type: "number", description: "Results", required: false, in: "query" }, page: { type: "number", description: "Page", required: false, in: "query" } } },
|
|
38
|
+
|
|
39
|
+
// ── Surveys ────────────────────────────────────────────────
|
|
40
|
+
|
|
41
|
+
{ name: "crm_list_surveys", description: "List all surveys for a location.", method: "GET", path: "/surveys/",
|
|
42
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "query" }, limit: { type: "number", description: "Results", required: false, in: "query" }, skip: { type: "number", description: "Skip", required: false, in: "query" }, type: { type: "string", description: "Survey type filter", required: false, in: "query" } } },
|
|
43
|
+
|
|
44
|
+
{ name: "crm_list_survey_submissions", description: "List survey submissions with filters.", method: "GET", path: "/surveys/submissions",
|
|
45
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "query" }, surveyId: { type: "string", description: "Filter by survey ID", required: false, in: "query" }, startAt: { type: "string", description: "Start date ISO", required: false, in: "query" }, endAt: { type: "string", description: "End date ISO", required: false, in: "query" }, limit: { type: "number", description: "Results", required: false, in: "query" }, page: { type: "number", description: "Page", required: false, in: "query" } } },
|
|
46
|
+
|
|
47
|
+
// ── Associations ───────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
{ name: "crm_list_associations", description: "List all associations for a location.", method: "GET", path: "/associations/",
|
|
50
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "query" } } },
|
|
51
|
+
|
|
52
|
+
{ name: "crm_create_association", description: "Create a new association between object types.", method: "POST", path: "/associations/",
|
|
53
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "body" }, key: { type: "string", description: "Association key name", required: true, in: "body" }, fromObjectKey: { type: "string", description: "Source object key", required: true, in: "body" }, toObjectKey: { type: "string", description: "Target object key", required: true, in: "body" } },
|
|
54
|
+
body: ["locationId", "key", "fromObjectKey", "toObjectKey"] },
|
|
55
|
+
|
|
56
|
+
{ name: "crm_get_association", description: "Get association by ID.", method: "GET", path: "/associations/:associationId",
|
|
57
|
+
params: { associationId: { type: "string", description: "Association ID", required: true, in: "path" } } },
|
|
58
|
+
|
|
59
|
+
{ name: "crm_update_association", description: "Update an association.", method: "PUT", path: "/associations/:associationId",
|
|
60
|
+
params: { associationId: { type: "string", description: "Association ID", required: true, in: "path" }, key: { type: "string", description: "Association key", required: false, in: "body" } },
|
|
61
|
+
body: ["key"] },
|
|
62
|
+
|
|
63
|
+
{ name: "crm_delete_association", description: "Delete an association.", method: "DELETE", path: "/associations/:associationId",
|
|
64
|
+
params: { associationId: { type: "string", description: "Association ID", required: true, in: "path" } } },
|
|
65
|
+
|
|
66
|
+
{ name: "crm_create_relation", description: "Create a relation between two records.", method: "POST", path: "/associations/relations",
|
|
67
|
+
params: { locationId: { type: "string", description: "Location ID", required: true, in: "body" }, associationId: { type: "string", description: "Association ID", required: true, in: "body" }, fromRecordId: { type: "string", description: "Source record ID", required: true, in: "body" }, toRecordId: { type: "string", description: "Target record ID", required: true, in: "body" } },
|
|
68
|
+
body: ["locationId", "associationId", "fromRecordId", "toRecordId"] },
|
|
69
|
+
|
|
70
|
+
{ name: "crm_list_relations", description: "Get all relations for a record.", method: "GET", path: "/associations/relations/:recordId",
|
|
71
|
+
params: { recordId: { type: "string", description: "Record ID", required: true, in: "path" } } },
|
|
72
|
+
|
|
73
|
+
{ name: "crm_delete_relation", description: "Delete a relation.", method: "DELETE", path: "/associations/relations/:relationId",
|
|
74
|
+
params: { relationId: { type: "string", description: "Relation ID", required: true, in: "path" } } },
|
|
75
|
+
|
|
76
|
+
// ── Snapshots ──────────────────────────────────────────────
|
|
77
|
+
|
|
78
|
+
{ name: "crm_list_snapshots", description: "List all account snapshots/templates.", method: "GET", path: "/snapshots/",
|
|
79
|
+
params: { companyId: { type: "string", description: "Company ID", required: true, in: "query" } } },
|
|
80
|
+
|
|
81
|
+
{ name: "crm_create_snapshot_share_link", description: "Create a shareable link for a snapshot.", method: "POST", path: "/snapshots/share/link",
|
|
82
|
+
params: { companyId: { type: "string", description: "Company ID", required: true, in: "body" }, snapshotId: { type: "string", description: "Snapshot ID", required: true, in: "body" }, shareType: { type: "string", description: "Share type (link, permanent)", required: false, in: "body" } },
|
|
83
|
+
body: ["companyId", "snapshotId", "shareType"] },
|
|
84
|
+
|
|
85
|
+
{ name: "crm_get_snapshot_push_status", description: "Get snapshot push status between dates.", method: "GET", path: "/snapshots/snapshot-status/:snapshotId",
|
|
86
|
+
params: { snapshotId: { type: "string", description: "Snapshot ID", required: true, in: "path" }, from: { type: "string", description: "From date", required: false, in: "query" }, to: { type: "string", description: "To date", required: false, in: "query" } } },
|
|
87
|
+
|
|
88
|
+
{ name: "crm_get_snapshot_last_push", description: "Get last snapshot push status for a specific location.", method: "GET", path: "/snapshots/snapshot-status/:snapshotId/location/:locationId",
|
|
89
|
+
params: { snapshotId: { type: "string", description: "Snapshot ID", required: true, in: "path" }, locationId: { type: "string", description: "Location ID", required: true, in: "path" } } },
|
|
90
|
+
]
|
package/crm/index.js
CHANGED
|
@@ -26,6 +26,11 @@ import locations from "./locations.js";
|
|
|
26
26
|
import social from "./social.js";
|
|
27
27
|
import users from "./users.js";
|
|
28
28
|
import objects from "./objects.js";
|
|
29
|
+
import knowledgeBase from "./knowledge-base.js";
|
|
30
|
+
import voiceAi from "./voice-ai.js";
|
|
31
|
+
import saas from "./saas.js";
|
|
32
|
+
import funnels from "./funnels.js"; // includes forms, surveys, associations, snapshots
|
|
33
|
+
import agentStudio from "./agent-studio.js";
|
|
29
34
|
|
|
30
35
|
// Re-export definitions + helpers for external consumers (e.g. CRM bridges)
|
|
31
36
|
export {
|
|
@@ -40,6 +45,11 @@ export {
|
|
|
40
45
|
social,
|
|
41
46
|
users,
|
|
42
47
|
objects,
|
|
48
|
+
knowledgeBase,
|
|
49
|
+
voiceAi,
|
|
50
|
+
saas,
|
|
51
|
+
funnels,
|
|
52
|
+
agentStudio,
|
|
43
53
|
crmHeaders,
|
|
44
54
|
CRM_API_BASE,
|
|
45
55
|
API_VERSION,
|
|
@@ -69,6 +79,11 @@ export function registerCrmTools(server, z, proxy) {
|
|
|
69
79
|
{ name: "Social & Blogs", defs: social },
|
|
70
80
|
{ name: "Users & Forms", defs: users },
|
|
71
81
|
{ name: "Objects & Misc", defs: objects },
|
|
82
|
+
{ name: "Knowledge Base", defs: knowledgeBase },
|
|
83
|
+
{ name: "Voice AI", defs: voiceAi },
|
|
84
|
+
{ name: "SaaS & Billing", defs: saas },
|
|
85
|
+
{ name: "Funnels, Forms, Surveys & More", defs: funnels },
|
|
86
|
+
{ name: "Agent Studio", defs: agentStudio },
|
|
72
87
|
];
|
|
73
88
|
|
|
74
89
|
let totalTools = 5; // auth tools count
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// 0nMCP — CRM Knowledge Base API Tool Definitions
|
|
3
|
+
// ============================================================
|
|
4
|
+
// Personal AI knowledge bases per location. Each user gets up to
|
|
5
|
+
// 15 knowledge bases trained on their business data. Powers
|
|
6
|
+
// Voice AI, chat bots, and Agent Studio agents.
|
|
7
|
+
// ============================================================
|
|
8
|
+
|
|
9
|
+
export default [
|
|
10
|
+
// ── Knowledge Base CRUD ────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
{
|
|
13
|
+
name: "crm_list_knowledge_bases",
|
|
14
|
+
description: "List all knowledge bases for a location (paginated). Each location can have up to 15 knowledge bases.",
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: "/knowledge-bases/",
|
|
17
|
+
params: {
|
|
18
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "query" },
|
|
19
|
+
limit: { type: "number", description: "Number of results per page", required: false, in: "query" },
|
|
20
|
+
offset: { type: "number", description: "Pagination offset", required: false, in: "query" },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
{
|
|
25
|
+
name: "crm_create_knowledge_base",
|
|
26
|
+
description: "Create a new knowledge base for a location. Max 15 per location. This becomes the user's personal AI trained on their business data.",
|
|
27
|
+
method: "POST",
|
|
28
|
+
path: "/knowledge-bases/",
|
|
29
|
+
params: {
|
|
30
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "body" },
|
|
31
|
+
name: { type: "string", description: "Name of the knowledge base (e.g., 'Company FAQ', 'Product Catalog', 'Sales Playbook')", required: true, in: "body" },
|
|
32
|
+
description: { type: "string", description: "Description of what this knowledge base contains", required: false, in: "body" },
|
|
33
|
+
},
|
|
34
|
+
body: ["locationId", "name", "description"],
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
name: "crm_get_knowledge_base",
|
|
39
|
+
description: "Get a specific knowledge base by ID including its configuration and source count.",
|
|
40
|
+
method: "GET",
|
|
41
|
+
path: "/knowledge-bases/:knowledgeBaseId",
|
|
42
|
+
params: {
|
|
43
|
+
knowledgeBaseId: { type: "string", description: "Knowledge base ID", required: true, in: "path" },
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
{
|
|
48
|
+
name: "crm_update_knowledge_base",
|
|
49
|
+
description: "Update a knowledge base's name or description.",
|
|
50
|
+
method: "PUT",
|
|
51
|
+
path: "/knowledge-bases/:knowledgeBaseId",
|
|
52
|
+
params: {
|
|
53
|
+
knowledgeBaseId: { type: "string", description: "Knowledge base ID", required: true, in: "path" },
|
|
54
|
+
name: { type: "string", description: "Updated name", required: false, in: "body" },
|
|
55
|
+
description: { type: "string", description: "Updated description", required: false, in: "body" },
|
|
56
|
+
},
|
|
57
|
+
body: ["name", "description"],
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
{
|
|
61
|
+
name: "crm_delete_knowledge_base",
|
|
62
|
+
description: "Delete a knowledge base and all its sources/content.",
|
|
63
|
+
method: "DELETE",
|
|
64
|
+
path: "/knowledge-bases/:knowledgeBaseId",
|
|
65
|
+
params: {
|
|
66
|
+
knowledgeBaseId: { type: "string", description: "Knowledge base ID", required: true, in: "path" },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
]
|
package/crm/objects.js
CHANGED
|
@@ -155,36 +155,8 @@ export default [
|
|
|
155
155
|
|
|
156
156
|
// ── Associations ────────────────────────────────────────────
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
description: "List all association definitions for a custom object schema in a CRM location.",
|
|
161
|
-
method: "GET",
|
|
162
|
-
path: "/associations/",
|
|
163
|
-
params: {
|
|
164
|
-
locationId: { type: "string", description: "Location / sub-account ID", required: true, in: "query" },
|
|
165
|
-
schemaKey: { type: "string", description: "Custom object schema key to list associations for", required: true, in: "query" },
|
|
166
|
-
},
|
|
167
|
-
query: ["locationId", "schemaKey"],
|
|
168
|
-
body: [],
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
{
|
|
172
|
-
name: "crm_create_association",
|
|
173
|
-
description: "Create a new association definition between two custom object schemas.",
|
|
174
|
-
method: "POST",
|
|
175
|
-
path: "/associations/",
|
|
176
|
-
params: {
|
|
177
|
-
locationId: { type: "string", description: "Location / sub-account ID", required: true, in: "body" },
|
|
178
|
-
name: { type: "string", description: "Display name for the association", required: true, in: "body" },
|
|
179
|
-
key: { type: "string", description: "Unique key for the association (lowercase, no spaces)", required: true, in: "body" },
|
|
180
|
-
fromSchemaKey: { type: "string", description: "Schema key of the source object", required: true, in: "body" },
|
|
181
|
-
toSchemaKey: { type: "string", description: "Schema key of the target object", required: true, in: "body" },
|
|
182
|
-
fromDisplayField: { type: "string", description: "Field key shown when viewing from the source side", required: false, in: "body" },
|
|
183
|
-
toDisplayField: { type: "string", description: "Field key shown when viewing from the target side", required: false, in: "body" },
|
|
184
|
-
},
|
|
185
|
-
query: [],
|
|
186
|
-
body: ["locationId", "name", "key", "fromSchemaKey", "toSchemaKey", "fromDisplayField", "toDisplayField"],
|
|
187
|
-
},
|
|
158
|
+
// crm_list_associations — defined in funnels.js
|
|
159
|
+
// crm_create_association — defined in funnels.js
|
|
188
160
|
|
|
189
161
|
// ── Email Builder ───────────────────────────────────────────
|
|
190
162
|
|
|
@@ -310,45 +282,9 @@ export default [
|
|
|
310
282
|
|
|
311
283
|
// ── Snapshots ───────────────────────────────────────────────
|
|
312
284
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
method: "GET",
|
|
317
|
-
path: "/snapshots/",
|
|
318
|
-
params: {
|
|
319
|
-
companyId: { type: "string", description: "Company / agency ID", required: true, in: "query" },
|
|
320
|
-
},
|
|
321
|
-
query: ["companyId"],
|
|
322
|
-
body: [],
|
|
323
|
-
},
|
|
324
|
-
|
|
325
|
-
{
|
|
326
|
-
name: "crm_create_snapshot_share_link",
|
|
327
|
-
description: "Create a shareable link for a snapshot so it can be pushed to other locations.",
|
|
328
|
-
method: "POST",
|
|
329
|
-
path: "/snapshots/share/link",
|
|
330
|
-
params: {
|
|
331
|
-
companyId: { type: "string", description: "Company / agency ID", required: true, in: "body" },
|
|
332
|
-
snapshotId: { type: "string", description: "Snapshot ID to share", required: true, in: "body" },
|
|
333
|
-
shareType: { type: "string", description: "Type of share (e.g. link, permanent)", required: true, in: "body" },
|
|
334
|
-
relationshipNumber: { type: "string", description: "Relationship number for the share link", required: false, in: "body" },
|
|
335
|
-
},
|
|
336
|
-
query: [],
|
|
337
|
-
body: ["companyId", "snapshotId", "shareType", "relationshipNumber"],
|
|
338
|
-
},
|
|
339
|
-
|
|
340
|
-
{
|
|
341
|
-
name: "crm_get_snapshot_push_status",
|
|
342
|
-
description: "Get the push status between a snapshot and a specific location.",
|
|
343
|
-
method: "GET",
|
|
344
|
-
path: "/snapshots/snapshot-status/:snapshotId/:locationId",
|
|
345
|
-
params: {
|
|
346
|
-
snapshotId: { type: "string", description: "Snapshot ID to check", required: true, in: "path" },
|
|
347
|
-
locationId: { type: "string", description: "Location / sub-account ID to check status against", required: true, in: "path" },
|
|
348
|
-
},
|
|
349
|
-
query: [],
|
|
350
|
-
body: [],
|
|
351
|
-
},
|
|
285
|
+
// crm_list_snapshots — defined in funnels.js
|
|
286
|
+
// crm_create_snapshot_share_link — defined in funnels.js
|
|
287
|
+
// crm_get_snapshot_push_status — defined in funnels.js
|
|
352
288
|
|
|
353
289
|
// ── Trigger Links ───────────────────────────────────────────
|
|
354
290
|
|
package/crm/saas.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// 0nMCP — CRM SaaS API Tool Definitions
|
|
3
|
+
// ============================================================
|
|
4
|
+
// Manage SaaS subscriptions, plans, rebilling, and sub-account
|
|
5
|
+
// provisioning. This is how 0nMCP sells products on the
|
|
6
|
+
// CRM marketplace — enable SaaS per location, manage plans,
|
|
7
|
+
// handle billing through Stripe integration.
|
|
8
|
+
// ============================================================
|
|
9
|
+
|
|
10
|
+
export default [
|
|
11
|
+
// ── Plans ──────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
{
|
|
14
|
+
name: "crm_get_saas_agency_plans",
|
|
15
|
+
description: "Get all SaaS plans for an agency/company. These are the subscription tiers offered to sub-accounts.",
|
|
16
|
+
method: "GET",
|
|
17
|
+
path: "/saas-api/public-api/agency-plans/:companyId",
|
|
18
|
+
params: {
|
|
19
|
+
companyId: { type: "string", description: "Agency/company ID", required: true, in: "path" },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
{
|
|
24
|
+
name: "crm_get_saas_plan",
|
|
25
|
+
description: "Get details of a specific SaaS plan by ID.",
|
|
26
|
+
method: "GET",
|
|
27
|
+
path: "/saas-api/public-api/saas-plan/:planId",
|
|
28
|
+
params: {
|
|
29
|
+
planId: { type: "string", description: "SaaS plan ID", required: true, in: "path" },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
// ── Enable/Disable SaaS ────────────────────────────────────
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
name: "crm_enable_saas_location",
|
|
37
|
+
description: "Enable SaaS for a sub-account/location. This activates billing and plan management for that location.",
|
|
38
|
+
method: "POST",
|
|
39
|
+
path: "/saas-api/public-api/enable-saas/:locationId",
|
|
40
|
+
params: {
|
|
41
|
+
locationId: { type: "string", description: "Location/sub-account ID to enable SaaS for", required: true, in: "path" },
|
|
42
|
+
planId: { type: "string", description: "SaaS plan ID to assign", required: true, in: "body" },
|
|
43
|
+
stripeCustomerId: { type: "string", description: "Stripe customer ID for billing", required: false, in: "body" },
|
|
44
|
+
},
|
|
45
|
+
body: ["planId", "stripeCustomerId"],
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
{
|
|
49
|
+
name: "crm_bulk_enable_saas",
|
|
50
|
+
description: "Enable SaaS for multiple locations at once.",
|
|
51
|
+
method: "POST",
|
|
52
|
+
path: "/saas-api/public-api/bulk-enable-saas/:companyId",
|
|
53
|
+
params: {
|
|
54
|
+
companyId: { type: "string", description: "Agency/company ID", required: true, in: "path" },
|
|
55
|
+
locationIds: { type: "array", description: "Array of location IDs to enable", required: true, in: "body" },
|
|
56
|
+
planId: { type: "string", description: "SaaS plan ID to assign to all", required: true, in: "body" },
|
|
57
|
+
},
|
|
58
|
+
body: ["locationIds", "planId"],
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
{
|
|
62
|
+
name: "crm_bulk_disable_saas",
|
|
63
|
+
description: "Disable SaaS for multiple locations.",
|
|
64
|
+
method: "POST",
|
|
65
|
+
path: "/saas-api/public-api/bulk-disable-saas/:companyId",
|
|
66
|
+
params: {
|
|
67
|
+
companyId: { type: "string", description: "Agency/company ID", required: true, in: "path" },
|
|
68
|
+
locationIds: { type: "array", description: "Array of location IDs to disable", required: true, in: "body" },
|
|
69
|
+
},
|
|
70
|
+
body: ["locationIds"],
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
// ── Subscriptions ──────────────────────────────────────────
|
|
74
|
+
|
|
75
|
+
{
|
|
76
|
+
name: "crm_get_saas_subscription",
|
|
77
|
+
description: "Get SaaS subscription details for a location including plan, status, and billing info.",
|
|
78
|
+
method: "GET",
|
|
79
|
+
path: "/saas-api/public-api/get-saas-subscription/:locationId",
|
|
80
|
+
params: {
|
|
81
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "path" },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
{
|
|
86
|
+
name: "crm_update_saas_subscription",
|
|
87
|
+
description: "Update a location's SaaS subscription — change plan, update billing, modify features.",
|
|
88
|
+
method: "PUT",
|
|
89
|
+
path: "/saas-api/public-api/update-saas-subscription/:locationId",
|
|
90
|
+
params: {
|
|
91
|
+
locationId: { type: "string", description: "Location ID", required: true, in: "path" },
|
|
92
|
+
planId: { type: "string", description: "New plan ID", required: false, in: "body" },
|
|
93
|
+
status: { type: "string", description: "Subscription status", required: false, in: "body" },
|
|
94
|
+
},
|
|
95
|
+
body: ["planId", "status"],
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
// ── Location Management ────────────────────────────────────
|
|
99
|
+
|
|
100
|
+
{
|
|
101
|
+
name: "crm_list_saas_locations",
|
|
102
|
+
description: "List all SaaS-enabled locations for a company with their subscription status.",
|
|
103
|
+
method: "GET",
|
|
104
|
+
path: "/saas-api/public-api/saas-locations/:companyId",
|
|
105
|
+
params: {
|
|
106
|
+
companyId: { type: "string", description: "Agency/company ID", required: true, in: "path" },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
{
|
|
111
|
+
name: "crm_get_saas_locations_by_stripe",
|
|
112
|
+
description: "Get locations by Stripe customer ID with company ID.",
|
|
113
|
+
method: "GET",
|
|
114
|
+
path: "/saas-api/public-api/locations",
|
|
115
|
+
params: {
|
|
116
|
+
companyId: { type: "string", description: "Agency/company ID", required: true, in: "query" },
|
|
117
|
+
stripeCustomerId: { type: "string", description: "Stripe customer ID", required: false, in: "query" },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
{
|
|
122
|
+
name: "crm_pause_saas_location",
|
|
123
|
+
description: "Pause a SaaS location — temporarily suspend billing and access.",
|
|
124
|
+
method: "POST",
|
|
125
|
+
path: "/saas-api/public-api/pause/:locationId",
|
|
126
|
+
params: {
|
|
127
|
+
locationId: { type: "string", description: "Location ID to pause", required: true, in: "path" },
|
|
128
|
+
paused: { type: "boolean", description: "Whether to pause (true) or unpause (false)", required: true, in: "body" },
|
|
129
|
+
},
|
|
130
|
+
body: ["paused"],
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
// ── Rebilling ──────────────────────────────────────────────
|
|
134
|
+
|
|
135
|
+
{
|
|
136
|
+
name: "crm_update_saas_rebilling",
|
|
137
|
+
description: "Update rebilling configuration for an agency — controls how sub-accounts are charged.",
|
|
138
|
+
method: "POST",
|
|
139
|
+
path: "/saas-api/public-api/update-rebilling/:companyId",
|
|
140
|
+
params: {
|
|
141
|
+
companyId: { type: "string", description: "Agency/company ID", required: true, in: "path" },
|
|
142
|
+
enabled: { type: "boolean", description: "Enable/disable rebilling", required: false, in: "body" },
|
|
143
|
+
markup: { type: "number", description: "Markup percentage on costs", required: false, in: "body" },
|
|
144
|
+
},
|
|
145
|
+
body: ["enabled", "markup"],
|
|
146
|
+
},
|
|
147
|
+
]
|