@rashidazarang/airtable-mcp 3.2.5 → 3.2.8
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 +198 -360
- package/dist/typescript/airtable-mcp-server.js +2 -2
- package/dist/typescript/airtable-mcp-server.js.map +1 -1
- package/dist/typescript/app/airtable-client.js +24 -22
- package/dist/typescript/app/airtable-client.js.map +1 -1
- package/dist/typescript/app/config.js +11 -1
- package/dist/typescript/app/config.js.map +1 -1
- package/dist/typescript/app/logger.js +2 -2
- package/dist/typescript/app/logger.js.map +1 -1
- package/dist/typescript/app/sanitize.js +95 -0
- package/dist/typescript/app/sanitize.js.map +1 -0
- package/dist/typescript/app/tools/create.js +3 -2
- package/dist/typescript/app/tools/create.js.map +1 -1
- package/dist/typescript/app/tools/describe.js +65 -21
- package/dist/typescript/app/tools/describe.js.map +1 -1
- package/dist/typescript/app/tools/handleError.js +161 -10
- package/dist/typescript/app/tools/handleError.js.map +1 -1
- package/dist/typescript/app/tools/listBases.js +3 -8
- package/dist/typescript/app/tools/listBases.js.map +1 -1
- package/dist/typescript/app/tools/listExceptions.js +2 -4
- package/dist/typescript/app/tools/listExceptions.js.map +1 -1
- package/dist/typescript/app/tools/listGovernance.js +2 -4
- package/dist/typescript/app/tools/listGovernance.js.map +1 -1
- package/dist/typescript/app/tools/query.js +11 -4
- package/dist/typescript/app/tools/query.js.map +1 -1
- package/dist/typescript/app/tools/response.js +21 -0
- package/dist/typescript/app/tools/response.js.map +1 -0
- package/dist/typescript/app/tools/update.js +3 -2
- package/dist/typescript/app/tools/update.js.map +1 -1
- package/dist/typescript/app/tools/upsert.js +3 -2
- package/dist/typescript/app/tools/upsert.js.map +1 -1
- package/dist/typescript/app/tools/webhooks.js +4 -3
- package/dist/typescript/app/tools/webhooks.js.map +1 -1
- package/dist/typescript/app/types.js +18 -9
- package/dist/typescript/app/types.js.map +1 -1
- package/dist/typescript/app/validateApiKey.js +75 -0
- package/dist/typescript/app/validateApiKey.js.map +1 -0
- package/dist/typescript/errors.js.map +1 -1
- package/package.json +4 -5
- package/types/typescript/app/airtable-client.d.ts +2 -1
- package/types/typescript/app/config.d.ts +1 -0
- package/types/typescript/app/sanitize.d.ts +50 -0
- package/types/typescript/app/tools/create.d.ts +1 -1
- package/types/typescript/app/tools/describe.d.ts +1 -1
- package/types/typescript/app/tools/index.d.ts +1 -1
- package/types/typescript/app/tools/listBases.d.ts +3 -23
- package/types/typescript/app/tools/listExceptions.d.ts +1 -1
- package/types/typescript/app/tools/listGovernance.d.ts +1 -1
- package/types/typescript/app/tools/query.d.ts +1 -1
- package/types/typescript/app/tools/response.d.ts +20 -0
- package/types/typescript/app/tools/update.d.ts +1 -1
- package/types/typescript/app/tools/upsert.d.ts +1 -1
- package/types/typescript/app/tools/webhooks.d.ts +1 -1
- package/types/typescript/app/types.d.ts +149 -661
- package/types/typescript/app/validateApiKey.d.ts +25 -0
- package/types/typescript/errors.d.ts +2 -0
- package/dist/typescript/apps-sdk/mappers.js +0 -70
- package/dist/typescript/apps-sdk/mappers.js.map +0 -1
- package/types/typescript/apps-sdk/mappers.d.ts +0 -53
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API key format validation for Airtable Personal Access Tokens.
|
|
3
|
+
*
|
|
4
|
+
* Provides helpful warnings when token format appears incorrect,
|
|
5
|
+
* without blocking startup (token might still work in edge cases).
|
|
6
|
+
*/
|
|
7
|
+
export interface TokenValidationResult {
|
|
8
|
+
isValid: boolean;
|
|
9
|
+
warnings: string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Validates Airtable API key format and returns warnings for common issues.
|
|
13
|
+
*
|
|
14
|
+
* @param apiKey - The API key to validate
|
|
15
|
+
* @returns Validation result with warnings array
|
|
16
|
+
*/
|
|
17
|
+
export declare function validateApiKey(apiKey: string): TokenValidationResult;
|
|
18
|
+
/**
|
|
19
|
+
* Get token format warnings for inclusion in error messages.
|
|
20
|
+
* Only returns warnings if issues are detected.
|
|
21
|
+
*
|
|
22
|
+
* @param apiKey - The API key to check
|
|
23
|
+
* @returns Array of warning strings, empty if token format looks valid
|
|
24
|
+
*/
|
|
25
|
+
export declare function getTokenFormatWarnings(apiKey: string): string[];
|
|
@@ -13,9 +13,11 @@ export interface ErrorContext {
|
|
|
13
13
|
attempt?: number;
|
|
14
14
|
totalAttempts?: number;
|
|
15
15
|
upstreamErrorType?: string;
|
|
16
|
+
upstreamErrorMessage?: string;
|
|
16
17
|
upstreamRequestId?: string;
|
|
17
18
|
governanceRule?: string;
|
|
18
19
|
endpoint?: string;
|
|
20
|
+
tokenFormatWarnings?: string[];
|
|
19
21
|
}
|
|
20
22
|
interface AirtableErrorOptions {
|
|
21
23
|
status?: number;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toInlineResultCard = toInlineResultCard;
|
|
4
|
-
exports.toFullscreenGrid = toFullscreenGrid;
|
|
5
|
-
exports.buildDiffModalForCreate = buildDiffModalForCreate;
|
|
6
|
-
exports.buildDiffModalForUpdate = buildDiffModalForUpdate;
|
|
7
|
-
function toInlineResultCard(table, result) {
|
|
8
|
-
const sample = result.records.slice(0, 5);
|
|
9
|
-
const colSet = new Set();
|
|
10
|
-
for (const r of sample)
|
|
11
|
-
Object.keys(r.fields || {}).forEach((k) => colSet.add(k));
|
|
12
|
-
const columns = Array.from(colSet).map((k) => ({ key: k, label: k }));
|
|
13
|
-
return {
|
|
14
|
-
title: `${table}`,
|
|
15
|
-
subtitle: sample.length > 0 && typeof result.summary?.returned === 'number'
|
|
16
|
-
? `Showing ${sample.length} of ${result.summary.returned}${result.summary.hasMore ? '+' : ''}`
|
|
17
|
-
: undefined,
|
|
18
|
-
columns,
|
|
19
|
-
rows: sample.map((r) => ({ id: r.id, ...r.fields })),
|
|
20
|
-
pagination: { hasMore: Boolean(result.summary?.hasMore), nextOffset: result.offset },
|
|
21
|
-
actions: ['view_fullscreen', 'export_csv'],
|
|
22
|
-
state: sample.length === 0 ? 'empty' : 'ready'
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function toFullscreenGrid(_table, result, selection = []) {
|
|
26
|
-
const colSet = new Set();
|
|
27
|
-
for (const r of result.records)
|
|
28
|
-
Object.keys(r.fields || {}).forEach((k) => colSet.add(k));
|
|
29
|
-
const columns = Array.from(colSet).map((k) => ({ key: k, label: k }));
|
|
30
|
-
return {
|
|
31
|
-
columns,
|
|
32
|
-
rows: result.records.map((r) => ({ id: r.id, ...(r.fields || {}) })),
|
|
33
|
-
filters: {},
|
|
34
|
-
sorts: [],
|
|
35
|
-
selection,
|
|
36
|
-
toolbarActions: ['propose_edit', 'upsert_by_key', 'export_csv'],
|
|
37
|
-
state: result.records.length === 0 ? 'empty' : 'ready'
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
function buildDiffModalForCreate(output, idempotencyKey) {
|
|
41
|
-
const changes = [];
|
|
42
|
-
for (const r of output.records || []) {
|
|
43
|
-
const fields = r.fields || {};
|
|
44
|
-
for (const [field, after] of Object.entries(fields)) {
|
|
45
|
-
changes.push({ recordId: r.id || 'new', field, before: null, after, status: 'add' });
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
changes,
|
|
50
|
-
idempotencyKey,
|
|
51
|
-
confirmAction: 'create',
|
|
52
|
-
cancelAction: 'close'
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function buildDiffModalForUpdate(output, idempotencyKey) {
|
|
56
|
-
const changes = [];
|
|
57
|
-
for (const r of output.records || []) {
|
|
58
|
-
const fields = r.fields || {};
|
|
59
|
-
for (const [field, after] of Object.entries(fields)) {
|
|
60
|
-
changes.push({ recordId: r.id, field, before: undefined, after, status: 'update' });
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
changes,
|
|
65
|
-
idempotencyKey,
|
|
66
|
-
confirmAction: 'update',
|
|
67
|
-
cancelAction: 'close'
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=mappers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../../src/typescript/apps-sdk/mappers.ts"],"names":[],"mappings":";;AAEA,gDAiBC;AAED,4CAcC;AAWD,0DAcC;AAED,0DAcC;AA1ED,SAAgB,kBAAkB,CAAC,KAAa,EAAE,MAAmB;IACnE,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,CAAC,IAAI,MAAM;QAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClF,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEtE,OAAO;QACL,KAAK,EAAE,GAAG,KAAK,EAAE;QACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,MAAM,CAAC,OAAO,EAAE,QAAQ,KAAK,QAAQ;YACzE,CAAC,CAAC,WAAW,MAAM,CAAC,MAAM,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC9F,CAAC,CAAC,SAAS;QACb,OAAO;QACP,IAAI,EAAE,MAAM,CAA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EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;IACD,OAAO;QACL,OAAO;QACP,cAAc;QACd,aAAa,EAAE,QAAiB;QAChC,YAAY,EAAE,OAAgB;KAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { QueryOutput, CreateOutput, UpdateOutput } from '../app/types';
|
|
2
|
-
export declare function toInlineResultCard(table: string, result: QueryOutput): {
|
|
3
|
-
title: string;
|
|
4
|
-
subtitle: string | undefined;
|
|
5
|
-
columns: {
|
|
6
|
-
key: string;
|
|
7
|
-
label: string;
|
|
8
|
-
}[];
|
|
9
|
-
rows: {
|
|
10
|
-
id: string;
|
|
11
|
-
}[];
|
|
12
|
-
pagination: {
|
|
13
|
-
hasMore: boolean;
|
|
14
|
-
nextOffset: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
actions: string[];
|
|
17
|
-
state: string;
|
|
18
|
-
};
|
|
19
|
-
export declare function toFullscreenGrid(_table: string, result: QueryOutput, selection?: string[]): {
|
|
20
|
-
columns: {
|
|
21
|
-
key: string;
|
|
22
|
-
label: string;
|
|
23
|
-
}[];
|
|
24
|
-
rows: {
|
|
25
|
-
id: string;
|
|
26
|
-
}[];
|
|
27
|
-
filters: {};
|
|
28
|
-
sorts: never[];
|
|
29
|
-
selection: string[];
|
|
30
|
-
toolbarActions: string[];
|
|
31
|
-
state: string;
|
|
32
|
-
};
|
|
33
|
-
type DiffChange = {
|
|
34
|
-
recordId: string;
|
|
35
|
-
field: string;
|
|
36
|
-
before?: unknown;
|
|
37
|
-
after?: unknown;
|
|
38
|
-
status: 'add' | 'update' | 'unchanged' | 'conflict';
|
|
39
|
-
warning?: string;
|
|
40
|
-
};
|
|
41
|
-
export declare function buildDiffModalForCreate(output: CreateOutput, idempotencyKey?: string): {
|
|
42
|
-
changes: DiffChange[];
|
|
43
|
-
idempotencyKey: string | undefined;
|
|
44
|
-
confirmAction: "create";
|
|
45
|
-
cancelAction: "close";
|
|
46
|
-
};
|
|
47
|
-
export declare function buildDiffModalForUpdate(output: UpdateOutput, idempotencyKey?: string): {
|
|
48
|
-
changes: DiffChange[];
|
|
49
|
-
idempotencyKey: string | undefined;
|
|
50
|
-
confirmAction: "update";
|
|
51
|
-
cancelAction: "close";
|
|
52
|
-
};
|
|
53
|
-
export {};
|