mcp-quickbase 2.0.5 → 2.2.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/.crewchief/runs/state.json +3 -0
- package/.mcp.json +6 -32
- package/.sdd/tickets/RELS_relationship-management/README.md +98 -0
- package/.sdd/tickets/RELS_relationship-management/planning/analysis.md +190 -0
- package/.sdd/tickets/RELS_relationship-management/planning/architecture.md +413 -0
- package/.sdd/tickets/RELS_relationship-management/planning/plan.md +177 -0
- package/.sdd/tickets/RELS_relationship-management/planning/quality-strategy.md +335 -0
- package/.sdd/tickets/RELS_relationship-management/planning/review-updates.md +95 -0
- package/.sdd/tickets/RELS_relationship-management/planning/security-review.md +213 -0
- package/.sdd/tickets/RELS_relationship-management/planning/ticket-review.md +885 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1001_domain-setup.md +96 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1002_get-relationships-tool.md +142 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1003_register-phase1-tools.md +105 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.2001_create-relationship-tool.md +151 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.2002_update-relationship-tool.md +145 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.3001_delete-relationship-tool.md +154 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.4001_integration-testing.md +159 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.4002_final-verification.md +182 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS_TASK_INDEX.md +179 -0
- package/crewchief.config.js +31 -0
- package/dist/client/quickbase.d.ts +7 -2
- package/dist/client/quickbase.js +64 -51
- package/dist/client/quickbase.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/server.d.ts +3 -3
- package/dist/mcp/server.js +21 -17
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp-stdio-server.js +64 -49
- package/dist/mcp-stdio-server.js.map +1 -1
- package/dist/server.js +84 -83
- package/dist/server.js.map +1 -1
- package/dist/tools/apps/create_app.d.ts +2 -2
- package/dist/tools/apps/create_app.js +23 -23
- package/dist/tools/apps/create_app.js.map +1 -1
- package/dist/tools/apps/index.d.ts +4 -4
- package/dist/tools/apps/index.js +3 -3
- package/dist/tools/apps/list_tables.d.ts +7 -7
- package/dist/tools/apps/list_tables.js +28 -27
- package/dist/tools/apps/list_tables.js.map +1 -1
- package/dist/tools/apps/update_app.d.ts +2 -2
- package/dist/tools/apps/update_app.js +28 -26
- package/dist/tools/apps/update_app.js.map +1 -1
- package/dist/tools/base.d.ts +3 -3
- package/dist/tools/base.js +7 -7
- package/dist/tools/base.js.map +1 -1
- package/dist/tools/configure_cache.d.ts +3 -3
- package/dist/tools/configure_cache.js +16 -16
- package/dist/tools/configure_cache.js.map +1 -1
- package/dist/tools/fields/create_field.d.ts +8 -7
- package/dist/tools/fields/create_field.js +39 -29
- package/dist/tools/fields/create_field.js.map +1 -1
- package/dist/tools/fields/delete_field.d.ts +79 -0
- package/dist/tools/fields/delete_field.js +105 -0
- package/dist/tools/fields/delete_field.js.map +1 -0
- package/dist/tools/fields/get_field.d.ts +91 -0
- package/dist/tools/fields/get_field.js +82 -0
- package/dist/tools/fields/get_field.js.map +1 -0
- package/dist/tools/fields/index.d.ts +5 -3
- package/dist/tools/fields/index.js +11 -5
- package/dist/tools/fields/index.js.map +1 -1
- package/dist/tools/fields/update_field.d.ts +7 -15
- package/dist/tools/fields/update_field.js +39 -38
- package/dist/tools/fields/update_field.js.map +1 -1
- package/dist/tools/files/download_file.d.ts +2 -2
- package/dist/tools/files/download_file.js +35 -35
- package/dist/tools/files/download_file.js.map +1 -1
- package/dist/tools/files/index.d.ts +3 -3
- package/dist/tools/files/index.js +3 -3
- package/dist/tools/files/upload_file.d.ts +2 -2
- package/dist/tools/files/upload_file.js +52 -44
- package/dist/tools/files/upload_file.js.map +1 -1
- package/dist/tools/index.d.ts +13 -12
- package/dist/tools/index.js +6 -3
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/records/bulk_create_records.d.ts +2 -2
- package/dist/tools/records/bulk_create_records.js +28 -28
- package/dist/tools/records/bulk_create_records.js.map +1 -1
- package/dist/tools/records/bulk_update_records.d.ts +2 -2
- package/dist/tools/records/bulk_update_records.js +27 -27
- package/dist/tools/records/bulk_update_records.js.map +1 -1
- package/dist/tools/records/create_record.d.ts +2 -2
- package/dist/tools/records/create_record.js +40 -40
- package/dist/tools/records/create_record.js.map +1 -1
- package/dist/tools/records/index.d.ts +6 -6
- package/dist/tools/records/index.js +3 -3
- package/dist/tools/records/query_records.d.ts +3 -3
- package/dist/tools/records/query_records.js +82 -78
- package/dist/tools/records/query_records.js.map +1 -1
- package/dist/tools/records/update_record.d.ts +2 -2
- package/dist/tools/records/update_record.js +31 -29
- package/dist/tools/records/update_record.js.map +1 -1
- package/dist/tools/registry.d.ts +1 -1
- package/dist/tools/registry.js +1 -1
- package/dist/tools/relationships/create_relationship.d.ts +150 -0
- package/dist/tools/relationships/create_relationship.js +181 -0
- package/dist/tools/relationships/create_relationship.js.map +1 -0
- package/dist/tools/relationships/delete_relationship.d.ts +66 -0
- package/dist/tools/relationships/delete_relationship.js +85 -0
- package/dist/tools/relationships/delete_relationship.js.map +1 -0
- package/dist/tools/relationships/get_relationships.d.ts +126 -0
- package/dist/tools/relationships/get_relationships.js +126 -0
- package/dist/tools/relationships/get_relationships.js.map +1 -0
- package/dist/tools/relationships/index.d.ts +14 -0
- package/dist/tools/relationships/index.js +37 -0
- package/dist/tools/relationships/index.js.map +1 -0
- package/dist/tools/relationships/update_relationship.d.ts +139 -0
- package/dist/tools/relationships/update_relationship.js +168 -0
- package/dist/tools/relationships/update_relationship.js.map +1 -0
- package/dist/tools/reports/index.d.ts +2 -2
- package/dist/tools/reports/index.js +3 -3
- package/dist/tools/reports/run_report.d.ts +3 -3
- package/dist/tools/reports/run_report.js +29 -29
- package/dist/tools/reports/run_report.js.map +1 -1
- package/dist/tools/tables/create_table.d.ts +2 -49
- package/dist/tools/tables/create_table.js +26 -49
- package/dist/tools/tables/create_table.js.map +1 -1
- package/dist/tools/tables/get_table_fields.d.ts +2 -2
- package/dist/tools/tables/get_table_fields.js +25 -25
- package/dist/tools/tables/get_table_fields.js.map +1 -1
- package/dist/tools/tables/index.d.ts +4 -4
- package/dist/tools/tables/index.js +3 -3
- package/dist/tools/tables/update_table.d.ts +2 -2
- package/dist/tools/tables/update_table.js +28 -26
- package/dist/tools/tables/update_table.js.map +1 -1
- package/dist/tools/test_connection.d.ts +2 -2
- package/dist/tools/test_connection.js +28 -28
- package/dist/tools/test_connection.js.map +1 -1
- package/dist/types/api.d.ts +1 -1
- package/dist/types/mcp.d.ts +1 -1
- package/dist/utils/cache.js +16 -16
- package/dist/utils/cache.js.map +1 -1
- package/dist/utils/file.js +44 -40
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/logger.js +30 -28
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/retry.js +10 -10
- package/dist/utils/retry.js.map +1 -1
- package/dist/utils/validation.d.ts +1 -1
- package/dist/utils/validation.js +39 -36
- package/dist/utils/validation.js.map +1 -1
- package/docs/README.md +6 -0
- package/docs/future-improvements.md +33 -0
- package/docs/migration-guide.md +160 -0
- package/docs/release-notes.md +89 -0
- package/package.json +5 -4
- /package/{HARDENING_SUMMARY.md → docs/hardening-summary.md} +0 -0
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ConfigureCacheTool = void 0;
|
|
4
4
|
const base_1 = require("./base");
|
|
5
5
|
const logger_1 = require("../utils/logger");
|
|
6
|
-
const logger = (0, logger_1.createLogger)(
|
|
6
|
+
const logger = (0, logger_1.createLogger)("ConfigureCacheTool");
|
|
7
7
|
/**
|
|
8
8
|
* Tool for configuring the caching behavior of the Quickbase connector
|
|
9
9
|
*/
|
|
@@ -15,28 +15,28 @@ class ConfigureCacheTool extends base_1.BaseTool {
|
|
|
15
15
|
*/
|
|
16
16
|
constructor(client, cacheService) {
|
|
17
17
|
super(client);
|
|
18
|
-
this.name =
|
|
19
|
-
this.description =
|
|
18
|
+
this.name = "configure_cache";
|
|
19
|
+
this.description = "Configures caching behavior for Quickbase operations";
|
|
20
20
|
/**
|
|
21
21
|
* Parameter schema for configure_cache
|
|
22
22
|
*/
|
|
23
23
|
this.paramSchema = {
|
|
24
|
-
type:
|
|
24
|
+
type: "object",
|
|
25
25
|
properties: {
|
|
26
26
|
enabled: {
|
|
27
|
-
type:
|
|
28
|
-
description:
|
|
27
|
+
type: "boolean",
|
|
28
|
+
description: "Whether to enable caching (default: true)",
|
|
29
29
|
},
|
|
30
30
|
clear: {
|
|
31
|
-
type:
|
|
32
|
-
description:
|
|
31
|
+
type: "boolean",
|
|
32
|
+
description: "Whether to clear all existing caches (default: false)",
|
|
33
33
|
},
|
|
34
34
|
ttl: {
|
|
35
|
-
type:
|
|
36
|
-
description:
|
|
37
|
-
}
|
|
35
|
+
type: "number",
|
|
36
|
+
description: "Cache time-to-live in seconds",
|
|
37
|
+
},
|
|
38
38
|
},
|
|
39
|
-
required: []
|
|
39
|
+
required: [],
|
|
40
40
|
};
|
|
41
41
|
this.cacheService = cacheService;
|
|
42
42
|
}
|
|
@@ -46,22 +46,22 @@ class ConfigureCacheTool extends base_1.BaseTool {
|
|
|
46
46
|
* @returns Configuration result
|
|
47
47
|
*/
|
|
48
48
|
async run(params) {
|
|
49
|
-
logger.info(
|
|
49
|
+
logger.info("Configuring cache", params);
|
|
50
50
|
const result = {
|
|
51
51
|
cacheEnabled: this.cacheService.isEnabled(),
|
|
52
|
-
cacheCleared: false
|
|
52
|
+
cacheCleared: false,
|
|
53
53
|
};
|
|
54
54
|
// Clear cache if requested
|
|
55
55
|
if (params.clear) {
|
|
56
56
|
this.cacheService.clear();
|
|
57
57
|
result.cacheCleared = true;
|
|
58
|
-
logger.info(
|
|
58
|
+
logger.info("Cache cleared");
|
|
59
59
|
}
|
|
60
60
|
// Enable/disable cache if specified
|
|
61
61
|
if (params.enabled !== undefined) {
|
|
62
62
|
this.cacheService.setEnabled(params.enabled);
|
|
63
63
|
result.cacheEnabled = params.enabled;
|
|
64
|
-
logger.info(`Cache ${params.enabled ?
|
|
64
|
+
logger.info(`Cache ${params.enabled ? "enabled" : "disabled"}`);
|
|
65
65
|
}
|
|
66
66
|
// Set TTL if specified
|
|
67
67
|
if (params.ttl !== undefined && params.ttl > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure_cache.js","sourceRoot":"","sources":["../../src/tools/configure_cache.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAGlC,4CAA+C;AAE/C,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,oBAAoB,CAAC,CAAC;AA0ClD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,
|
|
1
|
+
{"version":3,"file":"configure_cache.js","sourceRoot":"","sources":["../../src/tools/configure_cache.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAGlC,4CAA+C;AAE/C,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,oBAAoB,CAAC,CAAC;AA0ClD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,eAGvC;IA+BC;;;;OAIG;IACH,YAAY,MAAuB,EAAE,YAA0B;QAC7D,KAAK,CAAC,MAAM,CAAC,CAAC;QApCT,SAAI,GAAG,iBAAiB,CAAC;QACzB,gBAAW,GAAG,sDAAsD,CAAC;QAE5E;;WAEG;QACI,gBAAW,GAAG;YACnB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,2CAA2C;iBACzD;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,uDAAuD;iBACrE;gBACD,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,+BAA+B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
|
|
|
1
|
-
import { BaseTool } from
|
|
2
|
-
import { QuickbaseClient } from
|
|
1
|
+
import { BaseTool } from "../base";
|
|
2
|
+
import { QuickbaseClient } from "../../client/quickbase";
|
|
3
3
|
/**
|
|
4
4
|
* Field property definitions for various field types
|
|
5
5
|
*/
|
|
@@ -27,15 +27,16 @@ export interface CreateFieldParams {
|
|
|
27
27
|
*/
|
|
28
28
|
table_id: string;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Display label for the field
|
|
31
31
|
*/
|
|
32
32
|
field_name: string;
|
|
33
33
|
/**
|
|
34
|
-
* Type of the field
|
|
34
|
+
* Type of the field: text, text-multi-line, rich-text, numeric, currency,
|
|
35
|
+
* percent, rating, date, datetime, checkbox, user, email, url, phone, address, file
|
|
35
36
|
*/
|
|
36
37
|
field_type: string;
|
|
37
38
|
/**
|
|
38
|
-
*
|
|
39
|
+
* Help text shown to users when editing the field (stored as fieldHelp)
|
|
39
40
|
*/
|
|
40
41
|
description?: string;
|
|
41
42
|
/**
|
|
@@ -60,9 +61,9 @@ export interface CreateFieldResult {
|
|
|
60
61
|
*/
|
|
61
62
|
fieldType: string;
|
|
62
63
|
/**
|
|
63
|
-
*
|
|
64
|
+
* Help text for the field (shown to users when editing)
|
|
64
65
|
*/
|
|
65
|
-
|
|
66
|
+
fieldHelp?: string;
|
|
66
67
|
/**
|
|
67
68
|
* The ID of the table the field was created in
|
|
68
69
|
*/
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CreateFieldTool = void 0;
|
|
4
4
|
const base_1 = require("../base");
|
|
5
5
|
const logger_1 = require("../../utils/logger");
|
|
6
|
-
const logger = (0, logger_1.createLogger)(
|
|
6
|
+
const logger = (0, logger_1.createLogger)("CreateFieldTool");
|
|
7
7
|
/**
|
|
8
8
|
* Tool for creating a new field in a Quickbase table
|
|
9
9
|
*/
|
|
@@ -14,36 +14,42 @@ class CreateFieldTool extends base_1.BaseTool {
|
|
|
14
14
|
*/
|
|
15
15
|
constructor(client) {
|
|
16
16
|
super(client);
|
|
17
|
-
this.name =
|
|
18
|
-
this.description =
|
|
17
|
+
this.name = "create_field";
|
|
18
|
+
this.description = "Creates a new field in a Quickbase table. " +
|
|
19
|
+
"Valid field_type values: text, text-multi-line, text-multiple-choice, rich-text, " +
|
|
20
|
+
"numeric, currency, percent, rating, date, datetime, timestamp, timeofday, duration, " +
|
|
21
|
+
"checkbox, user, multiuser, email, url, phone, address, file. " +
|
|
22
|
+
"Use options to set field properties like maxLength, defaultValue, numLines, etc.";
|
|
19
23
|
/**
|
|
20
24
|
* Parameter schema for create_field
|
|
21
25
|
*/
|
|
22
26
|
this.paramSchema = {
|
|
23
|
-
type:
|
|
27
|
+
type: "object",
|
|
24
28
|
properties: {
|
|
25
29
|
table_id: {
|
|
26
|
-
type:
|
|
27
|
-
description:
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "The ID of the table (e.g., 'bqx7xkw3r')",
|
|
28
32
|
},
|
|
29
33
|
field_name: {
|
|
30
|
-
type:
|
|
31
|
-
description:
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Display label for the field",
|
|
32
36
|
},
|
|
33
37
|
field_type: {
|
|
34
|
-
type:
|
|
35
|
-
description:
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Field type: text, text-multi-line, rich-text, numeric, currency, " +
|
|
40
|
+
"percent, rating, date, datetime, checkbox, user, email, url, phone, address, file",
|
|
36
41
|
},
|
|
37
42
|
description: {
|
|
38
|
-
type:
|
|
39
|
-
description:
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "Help text shown to users when editing the field (stored as fieldHelp)",
|
|
40
45
|
},
|
|
41
46
|
options: {
|
|
42
|
-
type:
|
|
43
|
-
description:
|
|
44
|
-
|
|
47
|
+
type: "object",
|
|
48
|
+
description: "Field properties: appearsByDefault, findEnabled, required, unique, " +
|
|
49
|
+
"maxLength (text), numLines (multi-line), defaultValue, etc.",
|
|
50
|
+
},
|
|
45
51
|
},
|
|
46
|
-
required: [
|
|
52
|
+
required: ["table_id", "field_name", "field_type"],
|
|
47
53
|
};
|
|
48
54
|
}
|
|
49
55
|
/**
|
|
@@ -53,48 +59,52 @@ class CreateFieldTool extends base_1.BaseTool {
|
|
|
53
59
|
*/
|
|
54
60
|
async run(params) {
|
|
55
61
|
const { table_id, field_name, field_type, description, options } = params;
|
|
56
|
-
logger.info(
|
|
62
|
+
logger.info("Creating new field in Quickbase table", {
|
|
57
63
|
tableId: table_id,
|
|
58
64
|
fieldName: field_name,
|
|
59
|
-
fieldType: field_type
|
|
65
|
+
fieldType: field_type,
|
|
60
66
|
});
|
|
61
67
|
// Prepare request body
|
|
68
|
+
// Note: Quickbase API uses 'fieldHelp' at root level for help text (not 'description')
|
|
62
69
|
const body = {
|
|
63
70
|
label: field_name,
|
|
64
71
|
fieldType: field_type,
|
|
65
|
-
description: description || ''
|
|
66
72
|
};
|
|
73
|
+
// Add fieldHelp if description provided (maps to root-level fieldHelp)
|
|
74
|
+
if (description) {
|
|
75
|
+
body.fieldHelp = description;
|
|
76
|
+
}
|
|
67
77
|
// Add properties if provided
|
|
68
|
-
if (options) {
|
|
78
|
+
if (options && Object.keys(options).length > 0) {
|
|
69
79
|
body.properties = { ...options };
|
|
70
80
|
}
|
|
71
81
|
// Create the field
|
|
72
82
|
const response = await this.client.request({
|
|
73
|
-
method:
|
|
83
|
+
method: "POST",
|
|
74
84
|
path: `/fields?tableId=${table_id}`,
|
|
75
|
-
body
|
|
85
|
+
body,
|
|
76
86
|
});
|
|
77
87
|
if (!response.success || !response.data) {
|
|
78
|
-
logger.error(
|
|
88
|
+
logger.error("Failed to create field", {
|
|
79
89
|
error: response.error,
|
|
80
90
|
tableId: table_id,
|
|
81
|
-
fieldName: field_name
|
|
91
|
+
fieldName: field_name,
|
|
82
92
|
});
|
|
83
|
-
throw new Error(response.error?.message ||
|
|
93
|
+
throw new Error(response.error?.message || "Failed to create field");
|
|
84
94
|
}
|
|
85
95
|
const field = response.data;
|
|
86
|
-
logger.info(
|
|
96
|
+
logger.info("Successfully created field", {
|
|
87
97
|
fieldId: field.id,
|
|
88
98
|
tableId: table_id,
|
|
89
|
-
fieldName: field.label
|
|
99
|
+
fieldName: field.label,
|
|
90
100
|
});
|
|
91
101
|
return {
|
|
92
102
|
fieldId: field.id,
|
|
93
103
|
label: field.label,
|
|
94
104
|
fieldType: field.fieldType,
|
|
95
|
-
|
|
105
|
+
fieldHelp: field.fieldHelp,
|
|
96
106
|
tableId: table_id,
|
|
97
|
-
...field
|
|
107
|
+
...field,
|
|
98
108
|
};
|
|
99
109
|
}
|
|
100
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create_field.js","sourceRoot":"","sources":["../../../src/tools/fields/create_field.ts"],"names":[],"mappings":";;;AAAA,kCAAmC;AAEnC,+CAAkD;AAElD,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,iBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"create_field.js","sourceRoot":"","sources":["../../../src/tools/fields/create_field.ts"],"names":[],"mappings":";;;AAAA,kCAAmC;AAEnC,+CAAkD;AAElD,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,iBAAiB,CAAC,CAAC;AAsG/C;;GAEG;AACH,MAAa,eAAgB,SAAQ,eAGpC;IA4CC;;;OAGG;IACH,YAAY,MAAuB;QACjC,KAAK,CAAC,MAAM,CAAC,CAAC;QAhDT,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAChB,4CAA4C;YAC5C,mFAAmF;YACnF,sFAAsF;YACtF,+DAA+D;YAC/D,kFAAkF,CAAC;QAErF;;WAEG;QACI,gBAAW,GAAG;YACnB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yCAAyC;iBACvD;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,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C;QAEH,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACxC,MAAM,CAAC,KAAK,CAAC,wBAAwB,EAAE;gBACrC,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,OAAO,EAAE,QAAQ;gBACjB,SAAS,EAAE,UAAU;aACtB,CAAC,CAAC;YACH,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,IAAI,wBAAwB,CAAC,CAAC;QACvE,CAAC;QAED,MAAM,KAAK,GAAG,QAAQ,CAAC,IAA2B,CAAC;QAEnD,MAAM,CAAC,IAAI,CAAC,4BAA4B,EAAE;YACxC,OAAO,EAAE,KAAK,CAAC,EAAE;YACjB,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,KAAK,CAAC,KAAK;SACvB,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,EAAE;YACjB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,OAAO,EAAE,QAAQ;YACjB,GAAG,KAAK;SACT,CAAC;IACJ,CAAC;CACF;AAvHD,0CAuHC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { BaseTool } from "../base";
|
|
2
|
+
import { QuickbaseClient } from "../../client/quickbase";
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for delete_field tool
|
|
5
|
+
*/
|
|
6
|
+
export interface DeleteFieldParams {
|
|
7
|
+
/**
|
|
8
|
+
* The ID of the table containing the field
|
|
9
|
+
*/
|
|
10
|
+
table_id: string;
|
|
11
|
+
/**
|
|
12
|
+
* The ID of the field to delete
|
|
13
|
+
*/
|
|
14
|
+
field_id: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional explicit confirmation for deletion
|
|
17
|
+
*/
|
|
18
|
+
confirm_deletion?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Response from deleting a field
|
|
22
|
+
*/
|
|
23
|
+
export interface DeleteFieldResult {
|
|
24
|
+
/**
|
|
25
|
+
* The ID of the deleted field
|
|
26
|
+
*/
|
|
27
|
+
deletedFieldId: string;
|
|
28
|
+
/**
|
|
29
|
+
* The ID of the table the field was deleted from
|
|
30
|
+
*/
|
|
31
|
+
tableId: string;
|
|
32
|
+
/**
|
|
33
|
+
* Confirmation message
|
|
34
|
+
*/
|
|
35
|
+
message: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Tool for deleting a field from a Quickbase table.
|
|
39
|
+
*
|
|
40
|
+
* WARNING: This operation is destructive and cannot be undone.
|
|
41
|
+
* All data stored in the field will be permanently lost.
|
|
42
|
+
* System fields (IDs 1-5) cannot be deleted.
|
|
43
|
+
*/
|
|
44
|
+
export declare class DeleteFieldTool extends BaseTool<DeleteFieldParams, DeleteFieldResult> {
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
/**
|
|
48
|
+
* Parameter schema for delete_field
|
|
49
|
+
*/
|
|
50
|
+
paramSchema: {
|
|
51
|
+
type: string;
|
|
52
|
+
properties: {
|
|
53
|
+
table_id: {
|
|
54
|
+
type: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
field_id: {
|
|
58
|
+
type: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
confirm_deletion: {
|
|
62
|
+
type: string;
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
required: string[];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Constructor
|
|
70
|
+
* @param client Quickbase client
|
|
71
|
+
*/
|
|
72
|
+
constructor(client: QuickbaseClient);
|
|
73
|
+
/**
|
|
74
|
+
* Run the delete_field tool
|
|
75
|
+
* @param params Tool parameters
|
|
76
|
+
* @returns Deletion confirmation
|
|
77
|
+
*/
|
|
78
|
+
protected run(params: DeleteFieldParams): Promise<DeleteFieldResult>;
|
|
79
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteFieldTool = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const logger_1 = require("../../utils/logger");
|
|
6
|
+
const logger = (0, logger_1.createLogger)("DeleteFieldTool");
|
|
7
|
+
/**
|
|
8
|
+
* System field IDs that cannot be deleted
|
|
9
|
+
* 1 = Record ID
|
|
10
|
+
* 2 = Date Created
|
|
11
|
+
* 3 = Date Modified
|
|
12
|
+
* 4 = Record Owner
|
|
13
|
+
* 5 = Last Modified By
|
|
14
|
+
*/
|
|
15
|
+
const SYSTEM_FIELD_IDS = ["1", "2", "3", "4", "5"];
|
|
16
|
+
/**
|
|
17
|
+
* Tool for deleting a field from a Quickbase table.
|
|
18
|
+
*
|
|
19
|
+
* WARNING: This operation is destructive and cannot be undone.
|
|
20
|
+
* All data stored in the field will be permanently lost.
|
|
21
|
+
* System fields (IDs 1-5) cannot be deleted.
|
|
22
|
+
*/
|
|
23
|
+
class DeleteFieldTool extends base_1.BaseTool {
|
|
24
|
+
/**
|
|
25
|
+
* Constructor
|
|
26
|
+
* @param client Quickbase client
|
|
27
|
+
*/
|
|
28
|
+
constructor(client) {
|
|
29
|
+
super(client);
|
|
30
|
+
this.name = "delete_field";
|
|
31
|
+
this.description = "Deletes a field from a Quickbase table. WARNING: This operation is destructive and cannot be undone. All data in the field will be permanently lost. System fields (Record ID, Date Created, Date Modified, Record Owner, Last Modified By) cannot be deleted.";
|
|
32
|
+
/**
|
|
33
|
+
* Parameter schema for delete_field
|
|
34
|
+
*/
|
|
35
|
+
this.paramSchema = {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
table_id: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "The ID of the Quickbase table containing the field",
|
|
41
|
+
},
|
|
42
|
+
field_id: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "The ID of the field to delete",
|
|
45
|
+
},
|
|
46
|
+
confirm_deletion: {
|
|
47
|
+
type: "boolean",
|
|
48
|
+
description: "Optional explicit confirmation for deletion (recommended for safety)",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
required: ["table_id", "field_id"],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Run the delete_field tool
|
|
56
|
+
* @param params Tool parameters
|
|
57
|
+
* @returns Deletion confirmation
|
|
58
|
+
*/
|
|
59
|
+
async run(params) {
|
|
60
|
+
const { table_id, field_id } = params;
|
|
61
|
+
logger.info("Attempting to delete field from Quickbase table", {
|
|
62
|
+
tableId: table_id,
|
|
63
|
+
fieldId: field_id,
|
|
64
|
+
});
|
|
65
|
+
// System field protection - reject field IDs 1-5
|
|
66
|
+
if (SYSTEM_FIELD_IDS.includes(field_id)) {
|
|
67
|
+
logger.warn("Attempted to delete system field", {
|
|
68
|
+
tableId: table_id,
|
|
69
|
+
fieldId: field_id,
|
|
70
|
+
});
|
|
71
|
+
throw new Error("Cannot delete system fields (Record ID, Date Created, Date Modified, Record Owner, Last Modified By). Field IDs 1-5 are protected.");
|
|
72
|
+
}
|
|
73
|
+
// Delete the field
|
|
74
|
+
// Quickbase API uses DELETE /fields?tableId=... with fieldIds array in body
|
|
75
|
+
const response = await this.client.request({
|
|
76
|
+
method: "DELETE",
|
|
77
|
+
path: `/fields?tableId=${table_id}`,
|
|
78
|
+
body: {
|
|
79
|
+
fieldIds: [parseInt(field_id, 10)],
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
if (!response.success) {
|
|
83
|
+
logger.error("Failed to delete field", {
|
|
84
|
+
error: response.error,
|
|
85
|
+
tableId: table_id,
|
|
86
|
+
fieldId: field_id,
|
|
87
|
+
});
|
|
88
|
+
throw new Error(response.error?.message || "Failed to delete field");
|
|
89
|
+
}
|
|
90
|
+
// Invalidate cache after successful deletion
|
|
91
|
+
this.client.invalidateCache(`fields:${table_id}`);
|
|
92
|
+
this.client.invalidateCache(`field:${table_id}:${field_id}`);
|
|
93
|
+
logger.info("Successfully deleted field", {
|
|
94
|
+
fieldId: field_id,
|
|
95
|
+
tableId: table_id,
|
|
96
|
+
});
|
|
97
|
+
return {
|
|
98
|
+
deletedFieldId: field_id,
|
|
99
|
+
tableId: table_id,
|
|
100
|
+
message: `Field ${field_id} has been successfully deleted from table ${table_id}.`,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.DeleteFieldTool = DeleteFieldTool;
|
|
105
|
+
//# sourceMappingURL=delete_field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete_field.js","sourceRoot":"","sources":["../../../src/tools/fields/delete_field.ts"],"names":[],"mappings":";;;AAAA,kCAAmC;AAEnC,+CAAkD;AAElD,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,iBAAiB,CAAC,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AA0CnD;;;;;;GAMG;AACH,MAAa,eAAgB,SAAQ,eAGpC;IA4BC;;;OAGG;IACH,YAAY,MAAuB;QACjC,KAAK,CAAC,MAAM,CAAC,CAAC;QAhCT,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAChB,gQAAgQ,CAAC;QAEnQ;;WAEG;QACI,gBAAW,GAAG;YACnB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,oDAAoD;iBAClE;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,+BAA+B;iBAC7C;gBACD,gBAAgB,EAAE;oBAChB,IAAI,EAAE,SAAS;oBACf,WA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EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,QAAQ,IAAI,QAAQ,EAAE,CAAC,CAAC;QAE7D,MAAM,CAAC,IAAI,CAAC,4BAA4B,EAAE;YACxC,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,QAAQ;SAClB,CAAC,CAAC;QAEH,OAAO;YACL,cAAc,EAAE,QAAQ;YACxB,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,SAAS,QAAQ,6CAA6C,QAAQ,GAAG;SACnF,CAAC;IACJ,CAAC;CACF;AAjGD,0CAiGC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { BaseTool } from "../base";
|
|
2
|
+
import { QuickbaseClient } from "../../client/quickbase";
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for get_field tool
|
|
5
|
+
*/
|
|
6
|
+
export interface GetFieldParams {
|
|
7
|
+
/**
|
|
8
|
+
* The ID of the table containing the field
|
|
9
|
+
*/
|
|
10
|
+
table_id: string;
|
|
11
|
+
/**
|
|
12
|
+
* The ID of the field to retrieve
|
|
13
|
+
*/
|
|
14
|
+
field_id: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Response from getting a field
|
|
18
|
+
*/
|
|
19
|
+
export interface GetFieldResult {
|
|
20
|
+
/**
|
|
21
|
+
* The ID of the field
|
|
22
|
+
*/
|
|
23
|
+
fieldId: string;
|
|
24
|
+
/**
|
|
25
|
+
* The label (display name) of the field
|
|
26
|
+
*/
|
|
27
|
+
label: string;
|
|
28
|
+
/**
|
|
29
|
+
* The type of the field
|
|
30
|
+
*/
|
|
31
|
+
fieldType: string;
|
|
32
|
+
/**
|
|
33
|
+
* The description of the field
|
|
34
|
+
*/
|
|
35
|
+
description?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the field is required
|
|
38
|
+
*/
|
|
39
|
+
required?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the field is unique
|
|
42
|
+
*/
|
|
43
|
+
unique?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Additional properties of the field
|
|
46
|
+
*/
|
|
47
|
+
properties?: Record<string, any>;
|
|
48
|
+
/**
|
|
49
|
+
* The ID of the table containing the field
|
|
50
|
+
*/
|
|
51
|
+
tableId: string;
|
|
52
|
+
/**
|
|
53
|
+
* Additional details about the field
|
|
54
|
+
*/
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Tool for retrieving detailed information about a single field by ID
|
|
59
|
+
*/
|
|
60
|
+
export declare class GetFieldTool extends BaseTool<GetFieldParams, GetFieldResult> {
|
|
61
|
+
name: string;
|
|
62
|
+
description: string;
|
|
63
|
+
/**
|
|
64
|
+
* Parameter schema for get_field
|
|
65
|
+
*/
|
|
66
|
+
paramSchema: {
|
|
67
|
+
type: string;
|
|
68
|
+
properties: {
|
|
69
|
+
table_id: {
|
|
70
|
+
type: string;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
field_id: {
|
|
74
|
+
type: string;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
required: string[];
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Constructor
|
|
82
|
+
* @param client Quickbase client
|
|
83
|
+
*/
|
|
84
|
+
constructor(client: QuickbaseClient);
|
|
85
|
+
/**
|
|
86
|
+
* Run the get_field tool
|
|
87
|
+
* @param params Tool parameters
|
|
88
|
+
* @returns Field information
|
|
89
|
+
*/
|
|
90
|
+
protected run(params: GetFieldParams): Promise<GetFieldResult>;
|
|
91
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetFieldTool = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const logger_1 = require("../../utils/logger");
|
|
6
|
+
const logger = (0, logger_1.createLogger)("GetFieldTool");
|
|
7
|
+
/**
|
|
8
|
+
* Tool for retrieving detailed information about a single field by ID
|
|
9
|
+
*/
|
|
10
|
+
class GetFieldTool extends base_1.BaseTool {
|
|
11
|
+
/**
|
|
12
|
+
* Constructor
|
|
13
|
+
* @param client Quickbase client
|
|
14
|
+
*/
|
|
15
|
+
constructor(client) {
|
|
16
|
+
super(client);
|
|
17
|
+
this.name = "get_field";
|
|
18
|
+
this.description = "Retrieves detailed information about a single field in a Quickbase table by its field ID";
|
|
19
|
+
/**
|
|
20
|
+
* Parameter schema for get_field
|
|
21
|
+
*/
|
|
22
|
+
this.paramSchema = {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
table_id: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "The ID of the Quickbase table containing the field",
|
|
28
|
+
},
|
|
29
|
+
field_id: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "The ID of the field to retrieve",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
required: ["table_id", "field_id"],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Run the get_field tool
|
|
39
|
+
* @param params Tool parameters
|
|
40
|
+
* @returns Field information
|
|
41
|
+
*/
|
|
42
|
+
async run(params) {
|
|
43
|
+
const { table_id, field_id } = params;
|
|
44
|
+
logger.info("Retrieving field from Quickbase table", {
|
|
45
|
+
tableId: table_id,
|
|
46
|
+
fieldId: field_id,
|
|
47
|
+
});
|
|
48
|
+
// Get the field
|
|
49
|
+
const response = await this.client.request({
|
|
50
|
+
method: "GET",
|
|
51
|
+
path: `/fields/${field_id}?tableId=${table_id}`,
|
|
52
|
+
});
|
|
53
|
+
if (!response.success || !response.data) {
|
|
54
|
+
logger.error("Failed to retrieve field", {
|
|
55
|
+
error: response.error,
|
|
56
|
+
tableId: table_id,
|
|
57
|
+
fieldId: field_id,
|
|
58
|
+
});
|
|
59
|
+
throw new Error(response.error?.message || "Failed to retrieve field");
|
|
60
|
+
}
|
|
61
|
+
const field = response.data;
|
|
62
|
+
logger.info("Successfully retrieved field", {
|
|
63
|
+
fieldId: field.id,
|
|
64
|
+
tableId: table_id,
|
|
65
|
+
label: field.label,
|
|
66
|
+
fieldType: field.fieldType,
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
fieldId: field.id,
|
|
70
|
+
label: field.label,
|
|
71
|
+
fieldType: field.fieldType,
|
|
72
|
+
description: field.description,
|
|
73
|
+
required: field.required,
|
|
74
|
+
unique: field.unique,
|
|
75
|
+
properties: field.properties,
|
|
76
|
+
tableId: table_id,
|
|
77
|
+
...field,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.GetFieldTool = GetFieldTool;
|
|
82
|
+
//# sourceMappingURL=get_field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_field.js","sourceRoot":"","sources":["../../../src/tools/fields/get_field.ts"],"names":[],"mappings":";;;AAAA,kCAAmC;AAEnC,+CAAkD;AAElD,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,cAAc,CAAC,CAAC;AAmE5C;;GAEG;AACH,MAAa,YAAa,SAAQ,eAAwC;IAuBxE;;;OAGG;IACH,YAAY,MAAuB;QACjC,KAAK,CAAC,MAAM,CAAC,CAAC;QA3BT,SAAI,GAAG,WAAW,CAAC;QACnB,gBAAW,GAChB,0FAA0F,CAAC;QAE7F;;WAEG;QACI,gBAAW,GAAG;YACnB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,oDAAoD;iBAClE;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iCAAiC;iBAC/C;aACF;YACD,QAAQ,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;SACnC,CAAC;IAQF,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,GAAG,CA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AAQ;YACjB,GAAG,KAAK;SACT,CAAC;IACJ,CAAC;CACF;AAhFD,oCAgFC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { QuickbaseClient } from
|
|
1
|
+
import { QuickbaseClient } from "../../client/quickbase";
|
|
2
2
|
/**
|
|
3
3
|
* Register all field management tools with the registry
|
|
4
4
|
* @param client Quickbase client
|
|
5
5
|
*/
|
|
6
6
|
export declare function registerFieldTools(client: QuickbaseClient): void;
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
7
|
+
export * from "./create_field";
|
|
8
|
+
export * from "./get_field";
|
|
9
|
+
export * from "./update_field";
|
|
10
|
+
export * from "./delete_field";
|