conduyt-mcp 4.105.25 → 4.105.27
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/dist/tool-annotations.js +8 -0
- package/dist/tools/bulk.js +30 -0
- package/dist/tools/custom-fields.js +71 -9
- package/dist/tools/deals.js +17 -0
- package/dist/tools/store-options.d.ts +72 -0
- package/dist/tools/store-options.js +104 -0
- package/package.json +1 -1
- package/scripts/coverage-matrix.json +41 -11
package/dist/tool-annotations.js
CHANGED
|
@@ -33,6 +33,8 @@ export const TOOL_ANNOTATIONS = {
|
|
|
33
33
|
conduyt_refingerprint_import: destroy("Confirm Or Discard Parked Import"),
|
|
34
34
|
conduyt_list_deals: ro("List Deals"),
|
|
35
35
|
conduyt_pipeline_health: ro("Get Pipeline Health"),
|
|
36
|
+
conduyt_get_deals_forecast: ro("Get Deals Forecast"),
|
|
37
|
+
conduyt_lookup_deal_by_lead_id: ro("Look Up Deal By Lead ID"),
|
|
36
38
|
conduyt_pipeline_health_fix_deal: update("Fix Deal From Pipeline Health"),
|
|
37
39
|
conduyt_pipeline_health_fix_next_action: create("Set Next Action From Pipeline Health"),
|
|
38
40
|
conduyt_get_deal: ro("Get Deal"),
|
|
@@ -247,6 +249,11 @@ export const TOOL_ANNOTATIONS = {
|
|
|
247
249
|
conduyt_create_mirror_field: create("Create Deal Mirror Field"),
|
|
248
250
|
conduyt_update_custom_field: update("Update Custom Field"),
|
|
249
251
|
conduyt_delete_custom_field: destroy("Delete Custom Field"),
|
|
252
|
+
// (parity35, #1308) the list of a store-backed select: the set REPLACES the active list but never deletes a row (the others are deactivated, a repeat lands on the same state)
|
|
253
|
+
conduyt_search_custom_field_options: ro("Search Custom Field Options"),
|
|
254
|
+
conduyt_set_custom_field_options: update("Set Custom Field Options"),
|
|
255
|
+
conduyt_remove_custom_field_option: destroy("Remove Custom Field Option"),
|
|
256
|
+
conduyt_resolve_custom_field_options: ro("Resolve Custom Field Option Label"),
|
|
250
257
|
conduyt_get_contact_table_defaults: ro("Get Contact Table Defaults"),
|
|
251
258
|
conduyt_set_contact_table_defaults: update("Set Contact Table Defaults"),
|
|
252
259
|
conduyt_list_smart_lists: ro("List Smart Lists"),
|
|
@@ -266,6 +273,7 @@ export const TOOL_ANNOTATIONS = {
|
|
|
266
273
|
conduyt_ai_import_contacts: create("Import Contacts With AI"),
|
|
267
274
|
conduyt_export_contacts: create("Export Contacts"),
|
|
268
275
|
conduyt_export_deals: create("Export Deals"),
|
|
276
|
+
conduyt_export_companies: create("Export Companies"), // GET /companies/export appends an Activity row and an audit log row on EVERY call (not readOnly, not idempotent), like the contacts and deals exports
|
|
269
277
|
conduyt_bulk_tag_contacts: update("Bulk Tag Contacts"),
|
|
270
278
|
conduyt_bulk_untag_contacts: update("Bulk Untag Contacts"),
|
|
271
279
|
conduyt_bulk_edit_contacts: row("Bulk Edit Contacts", false, true, true), // optedOutSms / optedOutEmail / doNotContact can clear consent and re-enable outreach; switches are state-predicated absolute writes, so a repeat of the same body lands the same state
|
package/dist/tools/bulk.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { formatResult } from "../client.js";
|
|
3
3
|
import { INVALID_NUMBER_REFUSALS } from "./contacts.js";
|
|
4
|
+
import { strictInput } from "./strict.js";
|
|
4
5
|
/** (#136, Codex r1 m2) POST /bulk/contacts/update is NOT atomic and answers per row: an impossible phone is a per-row success:false inside HTTP 200 (no code) while other rows commit; the route takes no country */
|
|
5
6
|
export const BULK_UPDATE_REFUSALS = " Results are PER ROW inside an HTTP 200 (not atomic: some rows can be saved while others fail): read data.summary { total, succeeded, failed } and data.results, each { id, success, error? }. An impossible US/Canada number (area code or exchange starting 0 or 1) fails only that row, success: false with the error text (no phone_invalid code, no top-level 400), and nothing is saved for that row. This route does not take country: a country-only row fails as a row, and a country sent beside another field is ignored while that field is applied (use conduyt_bulk_edit_contacts for a country; it refuses a null or blank country 400 country_invalid).";
|
|
6
7
|
export function registerBulkTools(server, client) {
|
|
@@ -83,6 +84,35 @@ export function registerBulkTools(server, client) {
|
|
|
83
84
|
});
|
|
84
85
|
return formatResult(result);
|
|
85
86
|
});
|
|
87
|
+
strictInput(server.tool("conduyt_export_companies", "Export companies as JSON with filtering (GET /api/v1/companies/export, JSON only here): { companies, meta { total, exported_at, filters_applied } }. Owner or admin only (otherwise 403); Secure custom field values are always masked. At most 50,000 rows: past that 413 and nothing is exported (narrow the filters); the response is bounded at 25 MB (past it a structured response_too_large error says to narrow the filters). Rate limited to 5 exports a minute per workspace and address (429, wait Retry-After). The export is audited (an Activity row and an audit log row), so it is not a pure read. The API judges the query names first (batch33): a name the export does not read is 400 unknown_query_param { message, unknown[], accepted[], didYouMean } (it used to be ignored and every company exported) and two different values of format or of a single-value filter 400 query_param_conflict { message, param }; ownerId or ids that are not UUIDs are 400. This tool sends only accepted names.", {
|
|
88
|
+
search: z.string().optional().describe("Search name, domain or phone"),
|
|
89
|
+
industry: z.string().optional().describe("Filter by industry"),
|
|
90
|
+
ownerId: z.string().uuid().optional().describe("Filter by owner user UUID"),
|
|
91
|
+
lifecycleStage: z.string().optional().describe("Filter by lifecycle stage"),
|
|
92
|
+
hasOpenDeals: z.boolean().optional().describe("true = only companies with an open deal (false sends nothing)"),
|
|
93
|
+
ids: z.array(z.string().uuid()).min(1).max(1000).optional().describe("Only these company UUIDs (1 to 1000; omit for no id filter: an empty list is refused, never an unfiltered export)"),
|
|
94
|
+
}, async (params) => {
|
|
95
|
+
const qp = new URLSearchParams({ format: "json" });
|
|
96
|
+
if (params.search)
|
|
97
|
+
qp.set("search", params.search);
|
|
98
|
+
if (params.industry)
|
|
99
|
+
qp.set("industry", params.industry);
|
|
100
|
+
if (params.ownerId)
|
|
101
|
+
qp.set("ownerId", params.ownerId);
|
|
102
|
+
if (params.lifecycleStage)
|
|
103
|
+
qp.set("lifecycleStage", params.lifecycleStage);
|
|
104
|
+
if (params.hasOpenDeals === true)
|
|
105
|
+
qp.set("hasOpenDeals", "true");
|
|
106
|
+
if (params.ids && params.ids.length > 0)
|
|
107
|
+
qp.set("ids", params.ids.join(","));
|
|
108
|
+
// Same widened-but-bounded budget as the contacts and deals exports, but never retried.
|
|
109
|
+
const result = await client.get(`/api/v1/companies/export?${qp}`, {
|
|
110
|
+
timeoutMs: 120_000,
|
|
111
|
+
maxResponseBytes: 25_000_000,
|
|
112
|
+
noRetry: true, // the export appends audit rows: a lost response is never replayed by the client
|
|
113
|
+
});
|
|
114
|
+
return formatResult(result);
|
|
115
|
+
}));
|
|
86
116
|
server.tool("conduyt_bulk_tag_contacts", "Add one tag to many contacts in a single call. Requires contacts:edit.", {
|
|
87
117
|
contactIds: z.array(z.string()).describe("Contact UUIDs to tag"),
|
|
88
118
|
tagId: z.string().describe("Tag UUID to add to all of them"),
|
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { ConduytApiError, formatResult } from "../client.js";
|
|
3
3
|
import { USER_NOTE } from "./user-fields-doc.js";
|
|
4
4
|
import { OPTIONS_CAP_NOTE, OPTIONS_MAX, TYPE_CHANGE_NOTE } from "./lender-options.js";
|
|
5
|
+
import { REMOVE_NOTE, RESOLVE_NOTE, SEARCH_NOTE, SET_NOTE, STORE_LIST_NOTE, STORE_UPDATE_NOTE, optionRowSchema, setRowsProblem, storeCreateProblem, storeUpdateProblem, writeFlags, writeQuery } from "./store-options.js";
|
|
5
6
|
import { CUSTOM_FIELD_TYPES, DELANCEY_ID_NOTE, fail, formulaCreateProblem, formulaUpdateProblem, FORMULA_DEFINITION_NOTE, SECURE_IDENTIFIER_NOTE } from "./formula-fields.js";
|
|
6
7
|
// (parity1292, batch30 #1292 Ship 1) Secure custom fields: the flag, its reveal set, and the codes. There is NO reveal tool: the reveal
|
|
7
8
|
// routes (POST /{contacts|deals|companies}/{id}/custom-fields/{key}/reveal) refuse an API key (403 reveal_requires_session), and this
|
|
@@ -10,7 +11,7 @@ const SECURE_NOTE = "Secure fields (isSecure): every read, export and outbound p
|
|
|
10
11
|
const revealRoles = z.array(z.string().min(1).max(40)).max(10).optional().describe("Roles whose members may reveal a Secure value (max 10, 1 to 40 characters each; a super admin always; an API key never)");
|
|
11
12
|
const revealGroupIds = z.array(z.string().uuid()).max(20).optional().describe("Team group UUIDs whose members may reveal a Secure value (max 20)");
|
|
12
13
|
export function registerCustomFieldTools(server, client) {
|
|
13
|
-
server.tool("conduyt_list_custom_fields", "List custom field definitions. Filter by entity type (contact, deal, or company) to see available fields.", {
|
|
14
|
+
server.tool("conduyt_list_custom_fields", "List custom field definitions. Filter by entity type (contact, deal, or company) to see available fields. Every row carries optionCount: the ACTIVE rows of a store-backed select (options.optionList \"store\"; its options read { optionList, allowOther }, the list is read with conduyt_search_custom_field_options), the choices count of an inline select / radio / multiselect, null for every other type; a single-definition answer does not carry it.", {
|
|
14
15
|
entityType: z.enum(["contact", "deal", "company"]).optional().describe("Filter by entity type"),
|
|
15
16
|
page: z.number().optional().describe("Page number (default 1)"),
|
|
16
17
|
per_page: z.number().optional().describe("Results per page"),
|
|
@@ -25,32 +26,41 @@ export function registerCustomFieldTools(server, client) {
|
|
|
25
26
|
const result = await client.get(`/api/v1/custom-fields?${params}`);
|
|
26
27
|
return formatResult(result);
|
|
27
28
|
});
|
|
28
|
-
server.tool("conduyt_create_custom_field", "Create a new custom field definition for contacts, deals, or companies. Field types: text, textarea, number, date, datetime, url, select, radio, multiselect, boolean, phone, email, formula, user. " + FORMULA_DEFINITION_NOTE + " " + SECURE_IDENTIFIER_NOTE + " " + SECURE_NOTE + " " + OPTIONS_CAP_NOTE + " " + DELANCEY_ID_NOTE + " " + USER_NOTE, {
|
|
29
|
+
server.tool("conduyt_create_custom_field", "Create a new custom field definition for contacts, deals, or companies. Field types: text, textarea, number, date, datetime, url, select, radio, multiselect, boolean, phone, email, formula, user. " + FORMULA_DEFINITION_NOTE + " " + SECURE_IDENTIFIER_NOTE + " " + SECURE_NOTE + " " + OPTIONS_CAP_NOTE + " " + DELANCEY_ID_NOTE + " " + USER_NOTE + " " + STORE_LIST_NOTE, {
|
|
29
30
|
entityType: z.enum(["contact", "deal", "company"]).describe("Entity type this field applies to"),
|
|
30
31
|
fieldKey: z.string().describe("Unique field key (alphanumeric + underscores, e.g. 'lead_score'). On deals, delancey_deal_id is RESERVED (the Delancey Street deal ID the push writes: 422 reserved_field_key, never Secure, never edited or deleted); oes_number and dpp_oes_raw are allowed only as plain optional text fields and are never Secure"),
|
|
31
32
|
label: z.string().describe("Human-readable label (e.g. 'Lead Score')"),
|
|
32
33
|
fieldType: z.enum(CUSTOM_FIELD_TYPES).describe("Field data type; formula is computed at read time from two number fields (options { op, left, right, format })"),
|
|
33
34
|
section: z.string().optional().describe("Section grouping for UI display"),
|
|
34
35
|
options: z.any().optional().describe("Options for select/multiselect fields (array of strings, up to 1000, each 1 to 200 characters); for fieldType formula the object { op: add|sub|mul|div, left: <number field key>, right: <number field key or a number>, format: number|currency|percent }"),
|
|
36
|
+
optionList: z.literal("store").optional().describe("\"store\" = a STORE-BACKED select (typeahead): the list lives in the option store, starts empty, filled with conduyt_set_custom_field_options; needs fieldType select and allowOther; options may carry only { visibility } (no inline choices)"),
|
|
37
|
+
allowOther: z.boolean().optional().describe("Store-backed select, REQUIRED with optionList: true = a typed value that is not on the list is also accepted, false = strict (custom_field_value_not_on_list). Refused 422 custom_field_allow_other_refused on a partner creditor field (contact creditor_1..creditor_7 or a Creditors Relief list)"),
|
|
35
38
|
isRequired: z.boolean().optional().describe("Whether this field is required"),
|
|
36
39
|
sortOrder: z.number().optional().describe("Display order"),
|
|
37
40
|
isSecure: z.boolean().optional().describe("Make this a Secure field (values masked everywhere; 400 secure_fields_not_enabled until enabled)"),
|
|
38
41
|
revealRoles,
|
|
39
42
|
revealGroupIds,
|
|
40
|
-
}, async (
|
|
41
|
-
const problem = formulaCreateProblem(
|
|
43
|
+
}, async (input) => {
|
|
44
|
+
const problem = formulaCreateProblem(input);
|
|
42
45
|
if (problem)
|
|
43
46
|
return fail(problem);
|
|
44
|
-
if (Array.isArray(
|
|
45
|
-
return fail(`options holds at most ${OPTIONS_MAX} choices (got ${
|
|
46
|
-
const
|
|
47
|
+
if (Array.isArray(input.options) && input.options.length > OPTIONS_MAX)
|
|
48
|
+
return fail(`options holds at most ${OPTIONS_MAX} choices (got ${input.options.length}).`);
|
|
49
|
+
const store = storeCreateProblem(input);
|
|
50
|
+
if (typeof store === "string")
|
|
51
|
+
return fail(store);
|
|
52
|
+
// optionList / allowOther are tool inputs folded into options { optionList, allowOther }, never top-level body keys
|
|
53
|
+
const { optionList: _l, allowOther: _a, ...params } = input;
|
|
54
|
+
const result = await client.post("/api/v1/custom-fields", { ...params, ...(store ?? {}) });
|
|
47
55
|
return formatResult(result);
|
|
48
56
|
});
|
|
49
|
-
server.tool("conduyt_update_custom_field", "Update a custom field's label, options, required status, Secure flag or reveal set. Cannot change the field key or entity type. A FORMULA field's options (op / left / right / format), Secure flag and required flag are re-judged with its inputs locked: 422 formula_invalid, 422 formula_secure_input; turning Secure on for a number field a non-Secure formula computes from is 409 formula_secure_input naming the formulas. A deal MIRROR (conduyt_create_mirror_field) takes only section and sortOrder; anything else answers 422 invalid_mirror_definition. Turning Secure OFF (isSecure false) makes every stored value visible and needs confirmUnsecure true, else 409 secure_unsecure_unconfirmed. " + SECURE_NOTE + " " + OPTIONS_CAP_NOTE + " " + TYPE_CHANGE_NOTE + " " + DELANCEY_ID_NOTE + " " + USER_NOTE, {
|
|
57
|
+
server.tool("conduyt_update_custom_field", "Update a custom field's label, options, required status, Secure flag or reveal set. Cannot change the field key or entity type. A FORMULA field's options (op / left / right / format), Secure flag and required flag are re-judged with its inputs locked: 422 formula_invalid, 422 formula_secure_input; turning Secure on for a number field a non-Secure formula computes from is 409 formula_secure_input naming the formulas. A deal MIRROR (conduyt_create_mirror_field) takes only section and sortOrder; anything else answers 422 invalid_mirror_definition. Turning Secure OFF (isSecure false) makes every stored value visible and needs confirmUnsecure true, else 409 secure_unsecure_unconfirmed. " + SECURE_NOTE + " " + OPTIONS_CAP_NOTE + " " + TYPE_CHANGE_NOTE + " " + DELANCEY_ID_NOTE + " " + USER_NOTE + " " + STORE_UPDATE_NOTE, {
|
|
50
58
|
id: z.string().describe("Custom field UUID"),
|
|
51
59
|
label: z.string().optional().describe("Updated label"),
|
|
52
60
|
section: z.string().max(120).nullable().optional().describe("Updated section grouping (null clears); the one place besides sortOrder a deal MIRROR can be edited"),
|
|
53
61
|
options: z.any().optional().describe("Updated options for select/multiselect; for a formula field the object { op, left, right, format } (re-judged with its inputs locked)"),
|
|
62
|
+
optionList: z.literal("store").optional().describe("\"store\" = CONVERT a select with inline choices into a STORE-BACKED list (owner / admin signed in only; sent alone with allowOther)"),
|
|
63
|
+
allowOther: z.boolean().optional().describe("Store-backed select: true = accept a typed value that is not on the list, false = strict. Never true on a partner creditor field (422 custom_field_allow_other_refused). Alone it switches allowOther in place"),
|
|
54
64
|
isRequired: z.boolean().optional().describe("Updated required status"),
|
|
55
65
|
sortOrder: z.number().optional().describe("Updated display order"),
|
|
56
66
|
isSecure: z.boolean().optional().describe("Turn Secure on or off (off needs confirmUnsecure true)"),
|
|
@@ -63,7 +73,11 @@ export function registerCustomFieldTools(server, client) {
|
|
|
63
73
|
return fail(problem);
|
|
64
74
|
if (Array.isArray(updates.options) && updates.options.length > OPTIONS_MAX)
|
|
65
75
|
return fail(`options holds at most ${OPTIONS_MAX} choices (got ${updates.options.length}).`);
|
|
66
|
-
const
|
|
76
|
+
const store = storeUpdateProblem(updates);
|
|
77
|
+
if (typeof store === "string")
|
|
78
|
+
return fail(store);
|
|
79
|
+
const { optionList: _l, allowOther: _a, ...rest } = updates;
|
|
80
|
+
const result = await client.patch(`/api/v1/custom-fields/${id}`, { ...rest, ...(store ?? {}) });
|
|
67
81
|
return formatResult(result);
|
|
68
82
|
});
|
|
69
83
|
server.tool("conduyt_delete_custom_field", "Delete a custom field definition. Removes the field from all entities. A field a formula computes from cannot be deleted: 409 deletion_blocked (the formula named in blockers). A contact / company field mirrored on deals cannot be deleted: 409 mirror_source_in_use { mirrors } (delete the deal mirrors first; deleting a mirror deletes only the placement, never the contact's value). A Secure field cannot be deleted: 409 secure_field_delete_refused (turn Secure off first with conduyt_update_custom_field isSecure false + confirmUnsecure true, then delete). A BDA-sized field can take longer than the server's impact budget to read: DELETE answers 503 custom_field_impact_timeout with Retry-After 5 (nothing was deleted: the transaction rolled back and no lock is held), a RETRYABLE answer: wait the Retry-After seconds and call this tool again (this tool does not replay a delete itself); if it keeps answering 503 after a few tries, stop and report the code. GET /api/v1/custom-fields/{id}/impact (the Settings delete preview) answers the same 503 (\"Impact preview timed out, the delete still works.\"). The same 503 also answers the delete's pre-check (the read that produces the 409 counts) and a dry run; nothing changes either way. The 409 with counts is unchanged." + " " + DELANCEY_ID_NOTE, {
|
|
@@ -72,6 +86,54 @@ export function registerCustomFieldTools(server, client) {
|
|
|
72
86
|
const result = await client.del(`/api/v1/custom-fields/${id}`);
|
|
73
87
|
return formatResult(result);
|
|
74
88
|
});
|
|
89
|
+
// ---- (parity35, #1308 lane A) the list of a STORE-BACKED select ----
|
|
90
|
+
server.tool("conduyt_search_custom_field_options", SEARCH_NOTE, {
|
|
91
|
+
id: z.string().uuid().describe("Custom field UUID (a store-backed select)"),
|
|
92
|
+
q: z.string().optional().describe("Case-insensitive substring, trimmed, at most 200 characters; empty = list from the top"),
|
|
93
|
+
limit: z.number().int().min(1).max(200).optional().describe("Page size 1 to 200 (default 50)"),
|
|
94
|
+
cursor: z.string().min(1).optional().describe("The previous page's nextCursor, passed back UNCHANGED (opaque)"),
|
|
95
|
+
}, async ({ id, q, limit, cursor }) => {
|
|
96
|
+
if (q !== undefined && q.trim().length > 200)
|
|
97
|
+
return fail("q is at most 200 characters.");
|
|
98
|
+
const params = new URLSearchParams();
|
|
99
|
+
if (q !== undefined)
|
|
100
|
+
params.set("q", q);
|
|
101
|
+
if (limit !== undefined)
|
|
102
|
+
params.set("limit", String(limit));
|
|
103
|
+
if (cursor !== undefined)
|
|
104
|
+
params.set("cursor", cursor);
|
|
105
|
+
const qs = params.toString();
|
|
106
|
+
const result = await client.get(`/api/v1/custom-fields/${id}/options` + (qs ? `?${qs}` : ""));
|
|
107
|
+
return formatResult(result);
|
|
108
|
+
});
|
|
109
|
+
server.tool("conduyt_set_custom_field_options", SET_NOTE, {
|
|
110
|
+
id: z.string().uuid().describe("Custom field UUID (a store-backed select)"),
|
|
111
|
+
options: z.array(optionRowSchema).max(1000).describe("The new ACTIVE list, at most 1000 options; every other option is deactivated"),
|
|
112
|
+
...writeFlags,
|
|
113
|
+
}, async ({ id, options, dryRun, sandbox }) => {
|
|
114
|
+
const problem = setRowsProblem(options);
|
|
115
|
+
if (problem)
|
|
116
|
+
return fail(problem);
|
|
117
|
+
const qs = writeQuery({ dryRun, sandbox });
|
|
118
|
+
const result = await client.put(`/api/v1/custom-fields/${id}/options` + qs, { options });
|
|
119
|
+
return formatResult(result);
|
|
120
|
+
});
|
|
121
|
+
server.tool("conduyt_remove_custom_field_option", REMOVE_NOTE, {
|
|
122
|
+
id: z.string().uuid().describe("Custom field UUID (a store-backed select)"),
|
|
123
|
+
optionId: z.string().uuid().describe("The option row id (from conduyt_search_custom_field_options)"),
|
|
124
|
+
...writeFlags,
|
|
125
|
+
}, async ({ id, optionId, dryRun, sandbox }) => {
|
|
126
|
+
const qs = writeQuery({ dryRun, sandbox });
|
|
127
|
+
const result = await client.del(`/api/v1/custom-fields/${id}/options/${optionId}` + qs);
|
|
128
|
+
return formatResult(result);
|
|
129
|
+
});
|
|
130
|
+
server.tool("conduyt_resolve_custom_field_options", RESOLVE_NOTE, {
|
|
131
|
+
id: z.string().uuid().describe("Custom field UUID (a store-backed select)"),
|
|
132
|
+
label: z.string().min(1).max(200).describe("The exact label (1 to 200 characters, case-sensitive, not trimmed)"),
|
|
133
|
+
}, async ({ id, label }) => {
|
|
134
|
+
const result = await client.get(`/api/v1/custom-fields/${id}/options/resolve?${new URLSearchParams({ label })}`);
|
|
135
|
+
return formatResult(result);
|
|
136
|
+
});
|
|
75
137
|
// (mirror1292, batch31 #1292 Ship 3) a DEAL MIRROR: POST /custom-fields with mirrorOf (no type, options, required or Secure flags)
|
|
76
138
|
server.tool("conduyt_create_mirror_field", "Create a DEAL MIRROR field (#1292): a write-through view of a contact or company field shown and edited on every deal as ONE value (nothing is copied). Deal reads (conduyt_get_deal / conduyt_list_deals) answer the deal's linked contact's / company's value under fieldKey with a mirrorFields entry; conduyt_update_deal with the key writes that record. It has no type, options, required or Secure flag of its own: all the source's (a mirror of a Secure source is masked and revealed exactly like it). A re-linked deal shows the new record's value. Not filterable (422 mirror_not_filterable) and never a deal trigger (422 mirror_not_triggerable). Refusals: 422 invalid_mirror_definition (unknown or system-managed source, deals already store values under fieldKey); 409 when fieldKey already exists on deals. POST /api/v1/custom-fields with mirrorOf.", {
|
|
77
139
|
fieldKey: z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).describe("The deal field key of the mirror (letters, digits, underscores; not starting with a digit)"),
|
package/dist/tools/deals.js
CHANGED
|
@@ -172,6 +172,23 @@ export function registerDealTools(server, client) {
|
|
|
172
172
|
const result = qs ? await client.get("/api/v1/deals/inspection?" + qs) : await client.get("/api/v1/deals/inspection");
|
|
173
173
|
return formatResult(result);
|
|
174
174
|
}));
|
|
175
|
+
strictInput(server.tool("conduyt_get_deals_forecast", "Weighted pipeline value and the probability forecast (GET /api/v1/deals/forecast): per pipeline and stage, the year's monthly open and won values, win rate. Needs deals.view (an API key needs the deals scope) and a Professional-or-above plan: a lower plan, a free trial included, is 403 code plan_required; an account whose billing is not active is 402. `pipeline` limits it to one pipeline (a UUID that is not one is 400; a hidden or unknown one is 404 Pipeline not found); omit it for every visible active pipeline. The API judges the query names: a name the route does not read is 400 unknown_query_param { message, unknown[], accepted[], didYouMean } (it used to be ignored and every pipeline was forecast); this tool sends only `pipeline`. Read-only.", {
|
|
176
|
+
pipeline: z.string().uuid().optional().describe("Pipeline UUID; omit for every visible active pipeline."),
|
|
177
|
+
}, async ({ pipeline }) => {
|
|
178
|
+
// literal paths on purpose: the coverage scanner reads the first string after client.get(
|
|
179
|
+
const result = pipeline !== undefined ? await client.get("/api/v1/deals/forecast?pipeline=" + encodeURIComponent(pipeline)) : await client.get("/api/v1/deals/forecast");
|
|
180
|
+
return formatResult(result);
|
|
181
|
+
}));
|
|
182
|
+
strictInput(server.tool("conduyt_lookup_deal_by_lead_id", "Resolve a Lead ID to deals (GET /api/v1/deals/lead-id): the first 8 to 32 hex characters of a deal id or of a contact id, dashes optional, any case (a whole id matches exactly). Answers { term, total, deals[{ id, title, pipeline, stage, contact, matchedBy: deal|contact, onBoard }] }; contact is null when the caller may not see it, and a Lead ID the caller cannot see answers like one nobody has (total 0). Read with the deal-detail visibility (deals.view, owned or shared leads, the pipeline allowlist). 400 when the term is not a Lead ID, when more than 100 visible records share it, or on a limit outside 1..20 (default 5; total counts every match); 400 unknown_query_param { message, unknown[], accepted[], didYouMean } for a name the route does not read (this tool sends only term and limit). Read-only.", {
|
|
183
|
+
term: z.string().regex(/^[0-9a-fA-F-]+$/, "a Lead ID is hex characters (dashes optional)").refine((t) => /^[0-9a-f]{8,32}$/i.test(t.replace(/-/g, "")), "a Lead ID is 8 to 32 hex digits once dashes are removed").describe("The Lead ID: 8 to 32 hex characters of a deal or contact id (dashes optional)."),
|
|
184
|
+
limit: z.number().int().min(1).max(20).optional().describe("Deals to list, 1-20 (default 5); total counts every match."),
|
|
185
|
+
}, async ({ term, limit }) => {
|
|
186
|
+
const params = new URLSearchParams({ term });
|
|
187
|
+
if (limit !== undefined)
|
|
188
|
+
params.set("limit", String(limit));
|
|
189
|
+
const result = await client.get(`/api/v1/deals/lead-id?${params}`);
|
|
190
|
+
return formatResult(result);
|
|
191
|
+
}));
|
|
175
192
|
strictInput(server.tool("conduyt_pipeline_health_fix_deal", "Pipeline health QUICK FIX for a deal row (PATCH /api/v1/deals/{id} with checkOrigin). Pass the health check the row came from, the deal's updatedAt exactly as the health row carried it (expectedUpdatedAt, REQUIRED), and ONLY that check's fix: stale = stageId (+ optional expectedStageId, the stage the move was chosen against); unassigned = assignedTo; missing_close_date = expectedCloseDate; missing_contact = contactId. Each set to a value; any other combination is refused 400 health_fix_mismatch and nothing is read or written. For the next-action checks (high_value_idle, needs_action) use conduyt_pipeline_health_fix_next_action instead. Refusals reach you verbatim (status, server message, code, and the deal's CURRENT health row) and are NEVER retried. Error text grammar: `Conduyt API <status>: <message>[ [Retry-After: Ns]][ <one JSON object, the final token>]` (see README, Error text grammar). 409 deal_changed (the deal is no longer at expectedUpdatedAt; error text carries updatedAt and the current row: read it, choose again against row.updatedAt), 409 deal_check_cleared (the deal no longer fails that check; nothing written), a 409 without a code (a stage move by another writer, a stale expectedStageId, an in-flight publication), 400 health_fix_mismatch, 404 (no such deal, or your key cannot see it). The row in a refusal is null when your key can no longer see the deal. Ordinary edits (several fields, no health context) stay on conduyt_update_deal.", {
|
|
176
193
|
dealId: z.string().uuid().describe("Deal UUID"),
|
|
177
194
|
checkOrigin: z.enum(["stale", "unassigned", "missing_close_date", "missing_contact"]).describe("The health check this edit fixes"),
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (parity35, batch35 #1308 lane A) STORE-BACKED typeahead select: a select whose list lives in the server's option store
|
|
3
|
+
* (options { optionList: "store", allowOther }) instead of inline choices, so it can hold a long list (a lender or creditor book).
|
|
4
|
+
* conduyt_search_custom_field_options / conduyt_set_custom_field_options / conduyt_remove_custom_field_option /
|
|
5
|
+
* conduyt_resolve_custom_field_options manage that list; conduyt_create_custom_field / conduyt_update_custom_field take optionList
|
|
6
|
+
* + allowOther. The server is the authority; every check here only refuses before a request leaves and none is stricter than the
|
|
7
|
+
* frozen route contract (typeahead1308a CONTRACT.md).
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
export declare const STORE_LIST_MAX_PER_REQUEST = 1000;
|
|
11
|
+
export declare const STORE_LABEL_MAX = 200;
|
|
12
|
+
export declare const ALLOW_OTHER_RULE_NOTE = "HARD RULE: allowOther is NEVER available on a PARTNER CREDITOR field (the contact creditor_1 .. creditor_7 fields, or any store-backed list holding a row whose externalSource is creditors_relief): Creditors Relief refuses an unknown creditor, so allowOther true there is 422 custom_field_allow_other_refused (on create, on update, and when Creditors Relief rows are put into an allowOther list with conduyt_set_custom_field_options).";
|
|
13
|
+
export declare const STORE_LIST_NOTE: string;
|
|
14
|
+
export declare const STORE_UPDATE_NOTE: string;
|
|
15
|
+
export declare const OPTIONS_ACCESS_NOTE = "Reads need settings.view or view on the field's entity module; writes need settings.edit (API keys included; no new scope). Codes: 404 custom_field_not_found (unknown id), 422 custom_field_not_list_backed (the field is not a store-backed select).";
|
|
16
|
+
export declare const SEARCH_NOTE: string;
|
|
17
|
+
export declare const SET_NOTE: string;
|
|
18
|
+
export declare const REMOVE_NOTE: string;
|
|
19
|
+
export declare const RESOLVE_NOTE: string;
|
|
20
|
+
/** one row of the PUT body, strict (the route's additionalProperties false) */
|
|
21
|
+
export declare const optionRowSchema: z.ZodObject<{
|
|
22
|
+
label: z.ZodString;
|
|
23
|
+
externalId: z.ZodOptional<z.ZodUnion<[z.ZodType<string, z.ZodTypeDef, string>, z.ZodNull]>>;
|
|
24
|
+
externalSource: z.ZodOptional<z.ZodUnion<[z.ZodType<string, z.ZodTypeDef, string>, z.ZodNull]>>;
|
|
25
|
+
sortKey: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
}, "strict", z.ZodTypeAny, {
|
|
27
|
+
label: string;
|
|
28
|
+
externalId?: string | null | undefined;
|
|
29
|
+
externalSource?: string | null | undefined;
|
|
30
|
+
sortKey?: number | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
label: string;
|
|
33
|
+
externalId?: string | null | undefined;
|
|
34
|
+
externalSource?: string | null | undefined;
|
|
35
|
+
sortKey?: number | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
type Body = Record<string, unknown>;
|
|
38
|
+
/** the generated dry_run / sandbox query booleans of the two write routes: sent whenever supplied (false included) */
|
|
39
|
+
export declare function writeQuery(p: {
|
|
40
|
+
dryRun?: boolean;
|
|
41
|
+
sandbox?: boolean;
|
|
42
|
+
}): string;
|
|
43
|
+
export declare const writeFlags: {
|
|
44
|
+
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
sandbox: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
};
|
|
47
|
+
/** create: the store-list options object, or a problem text (undefined options = no store flag was passed) */
|
|
48
|
+
export declare function storeCreateProblem(p: {
|
|
49
|
+
fieldType?: unknown;
|
|
50
|
+
options?: unknown;
|
|
51
|
+
optionList?: unknown;
|
|
52
|
+
allowOther?: unknown;
|
|
53
|
+
}): string | {
|
|
54
|
+
options: {
|
|
55
|
+
optionList: "store";
|
|
56
|
+
allowOther: boolean;
|
|
57
|
+
visibility?: unknown;
|
|
58
|
+
};
|
|
59
|
+
} | undefined;
|
|
60
|
+
/** update: allowOther alone switches in place; optionList store (the convert) goes alone with allowOther */
|
|
61
|
+
export declare function storeUpdateProblem(updates: Body): string | {
|
|
62
|
+
options: {
|
|
63
|
+
optionList: "store";
|
|
64
|
+
allowOther: boolean;
|
|
65
|
+
visibility?: unknown;
|
|
66
|
+
};
|
|
67
|
+
} | undefined;
|
|
68
|
+
/** set: the rows judged before any request (labels unique after trimming; the cap; an empty list needs confirmation) */
|
|
69
|
+
export declare function setRowsProblem(rows: Array<{
|
|
70
|
+
label: string;
|
|
71
|
+
}>): string | undefined;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (parity35, batch35 #1308 lane A) STORE-BACKED typeahead select: a select whose list lives in the server's option store
|
|
3
|
+
* (options { optionList: "store", allowOther }) instead of inline choices, so it can hold a long list (a lender or creditor book).
|
|
4
|
+
* conduyt_search_custom_field_options / conduyt_set_custom_field_options / conduyt_remove_custom_field_option /
|
|
5
|
+
* conduyt_resolve_custom_field_options manage that list; conduyt_create_custom_field / conduyt_update_custom_field take optionList
|
|
6
|
+
* + allowOther. The server is the authority; every check here only refuses before a request leaves and none is stricter than the
|
|
7
|
+
* frozen route contract (typeahead1308a CONTRACT.md).
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
export const STORE_LIST_MAX_PER_REQUEST = 1000;
|
|
11
|
+
export const STORE_LABEL_MAX = 200;
|
|
12
|
+
export const ALLOW_OTHER_RULE_NOTE = "HARD RULE: allowOther is NEVER available on a PARTNER CREDITOR field (the contact creditor_1 .. creditor_7 fields, or any store-backed list holding a row whose externalSource is creditors_relief): Creditors Relief refuses an unknown creditor, so allowOther true there is 422 custom_field_allow_other_refused (on create, on update, and when Creditors Relief rows are put into an allowOther list with conduyt_set_custom_field_options).";
|
|
13
|
+
export const STORE_LIST_NOTE = "STORE-BACKED select (typeahead): fieldType select with optionList \"store\" makes a select whose list lives in the option store (it starts EMPTY: fill it with conduyt_set_custom_field_options), sent as options { optionList: \"store\", allowOther } with NO inline choices (options may carry only { visibility } beside it, merged into the store options; any other key or an array is inline choices and is refused; formula cannot be combined with it). A record stores the plain LABEL text, never an option id. allowOther is REQUIRED with optionList: true = a typed value that is not on the list is also taken (stored as typed: trimmed, 1 to 200 characters), false = strict (an off-list value is refused custom_field_value_not_on_list). " + ALLOW_OTHER_RULE_NOTE + " Codes: 422 custom_field_options_invalid (optionList or allowOther on a non-select, allowOther without optionList, choices beside a list), 422 custom_field_option_list_full (conduyt_set_custom_field_options with more than 1000 options, or a list that would pass 20000 rows counting deactivated ones), 400 / 422 custom_field_value_not_on_list (a record write of an off-list value to a strict list; an unchanged re-send of a stored value is never re-judged, so a deactivated label stays readable and re-sendable). conduyt_list_custom_fields rows carry optionCount (ACTIVE rows of a store-backed list, the choices count of an inline select / radio / multiselect, null for every other type).";
|
|
14
|
+
export const STORE_UPDATE_NOTE = "Update of a store-backed select: allowOther (true or false) switches it in place (sent as options { optionList: \"store\", allowOther }); inline choices (an options array or any options key but visibility), formula or a type change on it are 422 custom_field_option_list_convert_refused; options { visibility } alone may ride with allowOther (there is no way back to inline choices). Turning a select that has inline choices INTO a store-backed list (the convert: every choice becomes a row, the choices are cleared) is optionList \"store\" plus allowOther and NOTHING else (id, optionList and allowOther only, no options at all, visibility included, which the server keeps; anything beside them is refused here and by the server 422 custom_field_option_list_convert_refused); it is an owner / admin SIGNED-IN action only, so with this server's API key it answers 403 field_type_change_forbidden; 409 custom_field_option_list_convert_refused when the field became or stopped being a list between the read and the lock. Codes: 422 custom_field_options_invalid, 422 custom_field_value_not_on_list (a record write), 422 custom_field_option_list_full (the list itself: conduyt_set_custom_field_options). " + ALLOW_OTHER_RULE_NOTE;
|
|
15
|
+
export const OPTIONS_ACCESS_NOTE = "Reads need settings.view or view on the field's entity module; writes need settings.edit (API keys included; no new scope). Codes: 404 custom_field_not_found (unknown id), 422 custom_field_not_list_backed (the field is not a store-backed select).";
|
|
16
|
+
export const SEARCH_NOTE = "Typeahead read of the list of a STORE-BACKED select (GET /custom-fields/{id}/options): ACTIVE options only, prefix hits first then the other substring hits, each tier by sortKey, label, id. q is a case-insensitive substring (trimmed, at most 200 characters; % _ and \\ match themselves; empty = list from the top); limit 1 to 200 (default 50); cursor is the previous page's nextCursor passed back UNCHANGED (opaque; a cursor the route did not issue is 400 invalid_cursor). Answers { data: Option[], hasMore, nextCursor } (nextCursor null on the last page) with Option = { id, label, externalId, externalSource, sortKey, active }; page until hasMore is false. Each parameter is sent at most once (a repeat is 400 invalid_query). " + OPTIONS_ACCESS_NOTE;
|
|
17
|
+
export const SET_NOTE = "REPLACES the active list of a STORE-BACKED select (PUT /custom-fields/{id}/options): the ACTIVE set becomes exactly the options sent, every other option is DEACTIVATED (never deleted; a deactivated label that comes back is reactivated). Each option is { label, externalId?, externalSource?, sortKey? }: label 1 to 200 characters, trimmed, unique after trimming; externalId 1 to 200 or null; externalSource 1 to 64 or null; sortKey 0 to 1000000 (default = the position). An omitted externalId / externalSource keeps the stored value, an explicit null clears it. At most 1000 options per request: more is refused HERE before any request (the server answers 422 custom_field_option_list_full, which is also the answer when the whole list, deactivated rows included, would pass 20000). An EMPTY array is valid and deactivates EVERY option (the active set becomes exactly the request). dryRun / sandbox send the route's dry_run / sandbox query booleans (validate the mutation without persisting it / run it in sandbox mode). Answers { data: { active, added, reactivated, updated, deactivated, unchanged } }; repeating the call with the same options changes nothing (idempotent). 422 custom_field_options_invalid (body shape, a label repeated after trimming, a label over 200), 422 custom_field_allow_other_refused (creditors_relief rows into an allowOther list), 413 body_too_large over 1 MB. " + OPTIONS_ACCESS_NOTE;
|
|
18
|
+
export const REMOVE_NOTE = "Deactivates ONE option of a STORE-BACKED select (DELETE /custom-fields/{id}/options/{optionId}; the row is kept, a record that holds its label keeps the value, it just stops being offered / accepted on a strict list). Idempotent: answers { data: { option, changed } } with changed false when it was already inactive. 404 custom_field_option_not_found (an option id that is not on this field). The optionId is the id of an option row from conduyt_search_custom_field_options. dryRun / sandbox send the route's dry_run / sandbox query booleans. " + OPTIONS_ACCESS_NOTE;
|
|
19
|
+
export const RESOLVE_NOTE = "Is this exact label on the list of a STORE-BACKED select? (GET /custom-fields/{id}/options/resolve?label=...) label is 1 to 200 characters, matched EXACTLY (case-sensitive, not trimmed). Answers { data: { label, onList, option } } where option is the ACTIVE row or null. Read-only: a lookup that writes nothing (the contract has one route, so there is no dry-run / apply pair). " + OPTIONS_ACCESS_NOTE;
|
|
20
|
+
const nullable = (s) => z.union([s, z.null()]);
|
|
21
|
+
/** one row of the PUT body, strict (the route's additionalProperties false) */
|
|
22
|
+
export const optionRowSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
label: z.string().trim().min(1).max(STORE_LABEL_MAX).describe("The option text (1 to 200 characters after trimming; unique in the request after trimming)"),
|
|
25
|
+
externalId: nullable(z.string().trim().min(1).max(200)).optional().describe("Partner id, 1 to 200 characters, or null to clear; omitted keeps the stored value"),
|
|
26
|
+
externalSource: nullable(z.string().trim().min(1).max(64)).optional().describe("Partner name (e.g. creditors_relief), 1 to 64 characters, or null to clear; omitted keeps the stored value"),
|
|
27
|
+
sortKey: z.number().int().min(0).max(1000000).optional().describe("Order key 0 to 1000000 (default = the position in the array)"),
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
/** the generated dry_run / sandbox query booleans of the two write routes: sent whenever supplied (false included) */
|
|
31
|
+
export function writeQuery(p) {
|
|
32
|
+
const usp = new URLSearchParams();
|
|
33
|
+
if (p.dryRun !== undefined)
|
|
34
|
+
usp.set("dry_run", String(p.dryRun));
|
|
35
|
+
if (p.sandbox !== undefined)
|
|
36
|
+
usp.set("sandbox", String(p.sandbox));
|
|
37
|
+
const s = usp.toString();
|
|
38
|
+
return s ? `?${s}` : "";
|
|
39
|
+
}
|
|
40
|
+
export const writeFlags = {
|
|
41
|
+
dryRun: z.boolean().optional().describe("Send dry_run: validate the mutation without persisting it"),
|
|
42
|
+
sandbox: z.boolean().optional().describe("Send sandbox: run the mutation in sandbox mode"),
|
|
43
|
+
};
|
|
44
|
+
/** a store-backed list's options object may also carry `visibility` (and nothing else beside optionList / allowOther): the object of the options input, or a problem text for anything else (inline choices) */
|
|
45
|
+
function visibilityOnly(options) {
|
|
46
|
+
if (options === undefined)
|
|
47
|
+
return {};
|
|
48
|
+
const isObj = options !== null && typeof options === "object" && !Array.isArray(options);
|
|
49
|
+
if (!isObj || Object.keys(options).some((k) => k !== "visibility"))
|
|
50
|
+
return "A store-backed select carries no inline choices: drop options, or pass only { visibility } in it (the list is managed with conduyt_set_custom_field_options).";
|
|
51
|
+
return "visibility" in options ? { visibility: options.visibility } : {};
|
|
52
|
+
}
|
|
53
|
+
/** create: the store-list options object, or a problem text (undefined options = no store flag was passed) */
|
|
54
|
+
export function storeCreateProblem(p) {
|
|
55
|
+
if (p.optionList === undefined && p.allowOther === undefined)
|
|
56
|
+
return undefined;
|
|
57
|
+
if (p.optionList !== undefined && p.optionList !== "store")
|
|
58
|
+
return `optionList must be "store" (the only list kind).`;
|
|
59
|
+
const vis = visibilityOnly(p.options);
|
|
60
|
+
if (typeof vis === "string")
|
|
61
|
+
return vis;
|
|
62
|
+
if (p.fieldType !== "select")
|
|
63
|
+
return "optionList store belongs to fieldType select.";
|
|
64
|
+
if (p.allowOther === undefined)
|
|
65
|
+
return "optionList store needs allowOther (true or false): allowOther is required with optionList (the server answers 422 custom_field_options_invalid without it).";
|
|
66
|
+
if (p.optionList === undefined)
|
|
67
|
+
return "allowOther on create belongs to a store-backed select: pass optionList \"store\" (fieldType select).";
|
|
68
|
+
return { options: { optionList: "store", allowOther: p.allowOther, ...vis } };
|
|
69
|
+
}
|
|
70
|
+
/** update: allowOther alone switches in place; optionList store (the convert) goes alone with allowOther */
|
|
71
|
+
export function storeUpdateProblem(updates) {
|
|
72
|
+
const { optionList, allowOther, ...rest } = updates;
|
|
73
|
+
if (optionList === undefined && allowOther === undefined)
|
|
74
|
+
return undefined;
|
|
75
|
+
if (optionList !== undefined && optionList !== "store")
|
|
76
|
+
return `optionList must be "store" (the only list kind).`;
|
|
77
|
+
const vis = visibilityOnly(rest.options);
|
|
78
|
+
if (typeof vis === "string")
|
|
79
|
+
return vis;
|
|
80
|
+
if (allowOther === undefined)
|
|
81
|
+
return "optionList store needs allowOther (true or false): allowOther is required with optionList (the server answers 422 custom_field_options_invalid without it).";
|
|
82
|
+
if (optionList !== undefined) {
|
|
83
|
+
// the convert is optionList + allowOther only (visibility is kept by the server, never sent with it)
|
|
84
|
+
const extra = Object.keys(rest).filter((k) => rest[k] !== undefined);
|
|
85
|
+
if (extra.length > 0)
|
|
86
|
+
return `optionList store (the convert to a store-backed list) must be sent alone with allowOther: drop ${extra.join(", ")}.`;
|
|
87
|
+
}
|
|
88
|
+
return { options: { optionList: "store", allowOther: allowOther, ...vis } };
|
|
89
|
+
}
|
|
90
|
+
/** set: the rows judged before any request (labels unique after trimming; the cap; an empty list needs confirmation) */
|
|
91
|
+
export function setRowsProblem(rows) {
|
|
92
|
+
if (rows.length > STORE_LIST_MAX_PER_REQUEST)
|
|
93
|
+
return `A request holds at most ${STORE_LIST_MAX_PER_REQUEST} options (got ${rows.length}); the server answers 422 custom_field_option_list_full above that. Nothing was sent.`;
|
|
94
|
+
const seen = new Set();
|
|
95
|
+
for (const [i, r] of rows.entries()) {
|
|
96
|
+
const t = r.label.trim();
|
|
97
|
+
if (t.length < 1 || t.length > STORE_LABEL_MAX)
|
|
98
|
+
return `option ${i + 1}: label must be 1 to ${STORE_LABEL_MAX} characters after trimming.`;
|
|
99
|
+
if (seen.has(t))
|
|
100
|
+
return `option ${i + 1}: label ${JSON.stringify(t)} is repeated after trimming (labels are unique; 422 custom_field_options_invalid).`;
|
|
101
|
+
seen.add(t);
|
|
102
|
+
}
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-11-
|
|
3
|
-
"toolCount":
|
|
4
|
-
"totalEndpoints":
|
|
2
|
+
"generatedAt": "2026-11-14T09:05:03.593Z",
|
|
3
|
+
"toolCount": 437,
|
|
4
|
+
"totalEndpoints": 1212,
|
|
5
5
|
"counts": {
|
|
6
|
-
"covered":
|
|
6
|
+
"covered": 386,
|
|
7
7
|
"excluded": 372,
|
|
8
|
-
"planned":
|
|
8
|
+
"planned": 454,
|
|
9
9
|
"uncategorized": 0
|
|
10
10
|
},
|
|
11
11
|
"matrix": {
|
|
@@ -1762,8 +1762,10 @@
|
|
|
1762
1762
|
"reason": "company subroutes beyond core CRUD"
|
|
1763
1763
|
},
|
|
1764
1764
|
"GET /api/v1/companies/export": {
|
|
1765
|
-
"status": "
|
|
1766
|
-
"
|
|
1765
|
+
"status": "covered",
|
|
1766
|
+
"tools": [
|
|
1767
|
+
"conduyt_export_companies"
|
|
1768
|
+
]
|
|
1767
1769
|
},
|
|
1768
1770
|
"POST /api/v1/companies/merge": {
|
|
1769
1771
|
"status": "planned",
|
|
@@ -2535,6 +2537,30 @@
|
|
|
2535
2537
|
"status": "planned",
|
|
2536
2538
|
"reason": "custom field admin beyond read"
|
|
2537
2539
|
},
|
|
2540
|
+
"GET /api/v1/custom-fields/:id/options": {
|
|
2541
|
+
"status": "covered",
|
|
2542
|
+
"tools": [
|
|
2543
|
+
"conduyt_search_custom_field_options"
|
|
2544
|
+
]
|
|
2545
|
+
},
|
|
2546
|
+
"PUT /api/v1/custom-fields/:id/options": {
|
|
2547
|
+
"status": "covered",
|
|
2548
|
+
"tools": [
|
|
2549
|
+
"conduyt_set_custom_field_options"
|
|
2550
|
+
]
|
|
2551
|
+
},
|
|
2552
|
+
"DELETE /api/v1/custom-fields/:id/options/:optionId": {
|
|
2553
|
+
"status": "covered",
|
|
2554
|
+
"tools": [
|
|
2555
|
+
"conduyt_remove_custom_field_option"
|
|
2556
|
+
]
|
|
2557
|
+
},
|
|
2558
|
+
"GET /api/v1/custom-fields/:id/options/resolve": {
|
|
2559
|
+
"status": "covered",
|
|
2560
|
+
"tools": [
|
|
2561
|
+
"conduyt_resolve_custom_field_options"
|
|
2562
|
+
]
|
|
2563
|
+
},
|
|
2538
2564
|
"GET /api/v1/dashboard": {
|
|
2539
2565
|
"status": "covered",
|
|
2540
2566
|
"tools": [
|
|
@@ -2729,8 +2755,10 @@
|
|
|
2729
2755
|
]
|
|
2730
2756
|
},
|
|
2731
2757
|
"GET /api/v1/deals/forecast": {
|
|
2732
|
-
"status": "
|
|
2733
|
-
"
|
|
2758
|
+
"status": "covered",
|
|
2759
|
+
"tools": [
|
|
2760
|
+
"conduyt_get_deals_forecast"
|
|
2761
|
+
]
|
|
2734
2762
|
},
|
|
2735
2763
|
"GET /api/v1/deals/inspection": {
|
|
2736
2764
|
"status": "covered",
|
|
@@ -2739,8 +2767,10 @@
|
|
|
2739
2767
|
]
|
|
2740
2768
|
},
|
|
2741
2769
|
"GET /api/v1/deals/lead-id": {
|
|
2742
|
-
"status": "
|
|
2743
|
-
"
|
|
2770
|
+
"status": "covered",
|
|
2771
|
+
"tools": [
|
|
2772
|
+
"conduyt_lookup_deal_by_lead_id"
|
|
2773
|
+
]
|
|
2744
2774
|
},
|
|
2745
2775
|
"POST /api/v1/deals/probabilities": {
|
|
2746
2776
|
"status": "planned",
|