@acquis-consulting/asm 1.0.15 → 1.0.16
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/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/tools/apiRequest.d.ts +70 -0
- package/dist/tools/apiRequest.js +67 -0
- package/dist/tools/apiRequest.js.map +1 -0
- package/dist/tools/auditTrailDownload.d.ts +57 -0
- package/dist/tools/auditTrailDownload.js +128 -0
- package/dist/tools/auditTrailDownload.js.map +1 -0
- package/dist/tools/auditTrailSearch.d.ts +102 -0
- package/dist/tools/auditTrailSearch.js +215 -0
- package/dist/tools/auditTrailSearch.js.map +1 -0
- package/dist/tools/bulkExportResults.js +49 -10
- package/dist/tools/bulkExportResults.js.map +1 -1
- package/dist/tools/bulkImportAbort.d.ts +37 -0
- package/dist/tools/bulkImportAbort.js +46 -0
- package/dist/tools/bulkImportAbort.js.map +1 -0
- package/dist/tools/bulkImportResults.d.ts +51 -0
- package/dist/tools/bulkImportResults.js +168 -0
- package/dist/tools/bulkImportResults.js.map +1 -0
- package/dist/tools/bulkImportStart.d.ts +120 -0
- package/dist/tools/bulkImportStart.js +183 -0
- package/dist/tools/bulkImportStart.js.map +1 -0
- package/dist/tools/bulkImportStatus.d.ts +37 -0
- package/dist/tools/bulkImportStatus.js +56 -0
- package/dist/tools/bulkImportStatus.js.map +1 -0
- package/dist/tools/salesforceCliLogin.d.ts +36 -0
- package/dist/tools/salesforceCliLogin.js +73 -0
- package/dist/tools/salesforceCliLogin.js.map +1 -0
- package/dist/tools/salesforceCliLoginStatus.d.ts +25 -0
- package/dist/tools/salesforceCliLoginStatus.js +66 -0
- package/dist/tools/salesforceCliLoginStatus.js.map +1 -0
- package/dist/tools/salesforceLogin.js +2 -1
- package/dist/tools/salesforceLogin.js.map +1 -1
- package/dist/utils/auditTrailCsv.d.ts +42 -0
- package/dist/utils/auditTrailCsv.js +165 -0
- package/dist/utils/auditTrailCsv.js.map +1 -0
- package/dist/utils/errors.d.ts +1 -0
- package/dist/utils/errors.js +14 -0
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/sfCliWebLogin.d.ts +56 -0
- package/dist/utils/sfCliWebLogin.js +208 -0
- package/dist/utils/sfCliWebLogin.js.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import path from 'node:path';
|
|
|
6
6
|
import crypto from 'node:crypto';
|
|
7
7
|
import { z } from 'zod/v4';
|
|
8
8
|
import { createConnection, toolResponse } from './utils/index.js';
|
|
9
|
+
import { formatToolError } from './utils/errors.js';
|
|
9
10
|
import { assertWriteAllowed } from './utils/orgGuard.js';
|
|
10
11
|
import { objectSearchDescriptor } from './tools/objectSearch.js';
|
|
11
12
|
import { objectSchemaDescriptor } from './tools/objectSchema.js';
|
|
@@ -27,8 +28,16 @@ import { bulkExportStartDescriptor } from './tools/bulkExportStart.js';
|
|
|
27
28
|
import { bulkExportStatusDescriptor } from './tools/bulkExportStatus.js';
|
|
28
29
|
import { bulkExportResultsDescriptor } from './tools/bulkExportResults.js';
|
|
29
30
|
import { bulkExportAbortDescriptor } from './tools/bulkExportAbort.js';
|
|
31
|
+
import { auditTrailDownloadDescriptor } from './tools/auditTrailDownload.js';
|
|
32
|
+
import { auditTrailSearchDescriptor } from './tools/auditTrailSearch.js';
|
|
33
|
+
import { bulkImportStartDescriptor } from './tools/bulkImportStart.js';
|
|
34
|
+
import { bulkImportStatusDescriptor } from './tools/bulkImportStatus.js';
|
|
35
|
+
import { bulkImportResultsDescriptor } from './tools/bulkImportResults.js';
|
|
36
|
+
import { bulkImportAbortDescriptor } from './tools/bulkImportAbort.js';
|
|
30
37
|
import { selectOrgDescriptor } from './tools/selectOrg.js';
|
|
31
38
|
import { salesforceLoginDescriptor } from './tools/salesforceLogin.js';
|
|
39
|
+
import { salesforceCliLoginDescriptor } from './tools/salesforceCliLogin.js';
|
|
40
|
+
import { salesforceCliLoginStatusDescriptor } from './tools/salesforceCliLoginStatus.js';
|
|
32
41
|
import { metadataDescribeDescriptor } from './tools/metadataDescribe.js';
|
|
33
42
|
import { metadataListDescriptor } from './tools/metadataList.js';
|
|
34
43
|
import { metadataReadDescriptor } from './tools/metadataRead.js';
|
|
@@ -54,10 +63,13 @@ import { docsFetchDescriptor } from './tools/docsFetch.js';
|
|
|
54
63
|
import { docsListCollectionsDescriptor } from './tools/docsListCollections.js';
|
|
55
64
|
import { trailheadSearchDescriptor } from './tools/trailheadSearch.js';
|
|
56
65
|
import { trailheadFetchDescriptor } from './tools/trailheadFetch.js';
|
|
66
|
+
import { apiRequestDescriptor } from './tools/apiRequest.js';
|
|
57
67
|
const DIST_DIR = import.meta.filename?.endsWith('.ts')
|
|
58
68
|
? path.join(import.meta.dirname, '..', 'dist')
|
|
59
69
|
: import.meta.dirname;
|
|
60
70
|
const server = new McpServer({ name: 'acquis-salesforce-mcp', version: '1.0.0' });
|
|
71
|
+
// Data modification tools (DML, bulk import) are only registered when ENABLE_DATA_MODIFICATIONS=true
|
|
72
|
+
const dataModificationsEnabled = process.env.ENABLE_DATA_MODIFICATIONS === 'true';
|
|
61
73
|
// Read-only tools — safe on any org
|
|
62
74
|
const readTools = [
|
|
63
75
|
objectSearchDescriptor,
|
|
@@ -71,6 +83,10 @@ const readTools = [
|
|
|
71
83
|
bulkExportStatusDescriptor,
|
|
72
84
|
bulkExportResultsDescriptor,
|
|
73
85
|
bulkExportAbortDescriptor,
|
|
86
|
+
auditTrailDownloadDescriptor,
|
|
87
|
+
...(dataModificationsEnabled
|
|
88
|
+
? [bulkImportStatusDescriptor, bulkImportResultsDescriptor, bulkImportAbortDescriptor]
|
|
89
|
+
: []),
|
|
74
90
|
metadataDescribeDescriptor,
|
|
75
91
|
metadataListDescriptor,
|
|
76
92
|
metadataReadDescriptor,
|
|
@@ -84,7 +100,7 @@ const readTools = [
|
|
|
84
100
|
];
|
|
85
101
|
// Write tools — blocked on production orgs unless ALLOW_PRODUCTION_WRITES=true
|
|
86
102
|
const writeTools = [
|
|
87
|
-
dmlDescriptor,
|
|
103
|
+
...(dataModificationsEnabled ? [dmlDescriptor] : []),
|
|
88
104
|
//dmlDeleteDescriptor,
|
|
89
105
|
objectManagementDescriptor,
|
|
90
106
|
fieldManagementDescriptor,
|
|
@@ -94,21 +110,26 @@ const writeTools = [
|
|
|
94
110
|
executeAnonymousDescriptor,
|
|
95
111
|
debugLogsDescriptor,
|
|
96
112
|
bulkExportStartDescriptor,
|
|
113
|
+
...(dataModificationsEnabled ? [bulkImportStartDescriptor] : []),
|
|
97
114
|
metadataImportDescriptor,
|
|
98
115
|
objectPermissionsDescriptor,
|
|
99
116
|
userPermissionsDescriptor,
|
|
100
117
|
createRecordPageDescriptor,
|
|
101
118
|
appTabManagementDescriptor,
|
|
119
|
+
apiRequestDescriptor,
|
|
102
120
|
];
|
|
103
121
|
// Tools that don't need a Salesforce connection
|
|
104
122
|
const standaloneTools = [
|
|
105
123
|
selectOrgDescriptor,
|
|
106
124
|
salesforceLoginDescriptor,
|
|
125
|
+
salesforceCliLoginDescriptor,
|
|
126
|
+
salesforceCliLoginStatusDescriptor,
|
|
107
127
|
docsSearchDescriptor,
|
|
108
128
|
docsFetchDescriptor,
|
|
109
129
|
docsListCollectionsDescriptor,
|
|
110
130
|
trailheadSearchDescriptor,
|
|
111
131
|
trailheadFetchDescriptor,
|
|
132
|
+
auditTrailSearchDescriptor,
|
|
112
133
|
];
|
|
113
134
|
const SESSION_ID_SCHEMA = z
|
|
114
135
|
.string()
|
|
@@ -128,7 +149,7 @@ for (const tool of readTools) {
|
|
|
128
149
|
return tool.handler(conn, toolArgs);
|
|
129
150
|
}
|
|
130
151
|
catch (error) {
|
|
131
|
-
return toolResponse(
|
|
152
|
+
return toolResponse(formatToolError(error, sessionId), true);
|
|
132
153
|
}
|
|
133
154
|
});
|
|
134
155
|
}
|
|
@@ -147,7 +168,7 @@ for (const tool of writeTools) {
|
|
|
147
168
|
return tool.handler(conn, toolArgs);
|
|
148
169
|
}
|
|
149
170
|
catch (error) {
|
|
150
|
-
return toolResponse(
|
|
171
|
+
return toolResponse(formatToolError(error, sessionId), true);
|
|
151
172
|
}
|
|
152
173
|
});
|
|
153
174
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAGjF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM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I;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC1D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Connection } from 'jsforce';
|
|
2
|
+
import { z } from 'zod/v4';
|
|
3
|
+
export declare const apiRequestTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {
|
|
9
|
+
method: {
|
|
10
|
+
type: string;
|
|
11
|
+
enum: string[];
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
path: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
body: {
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
headers: {
|
|
22
|
+
type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
required: string[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export interface ApiRequestArgs {
|
|
30
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
31
|
+
path: string;
|
|
32
|
+
body?: unknown;
|
|
33
|
+
headers?: Record<string, string>;
|
|
34
|
+
}
|
|
35
|
+
export declare function handleApiRequest(conn: Connection, args: ApiRequestArgs): Promise<{
|
|
36
|
+
content: {
|
|
37
|
+
type: "text";
|
|
38
|
+
text: string;
|
|
39
|
+
}[];
|
|
40
|
+
isError: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const apiRequestSchema: {
|
|
43
|
+
method: z.ZodEnum<{
|
|
44
|
+
POST: "POST";
|
|
45
|
+
GET: "GET";
|
|
46
|
+
PUT: "PUT";
|
|
47
|
+
PATCH: "PATCH";
|
|
48
|
+
DELETE: "DELETE";
|
|
49
|
+
}>;
|
|
50
|
+
path: z.ZodString;
|
|
51
|
+
body: z.ZodOptional<z.ZodAny>;
|
|
52
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
53
|
+
};
|
|
54
|
+
export declare const apiRequestDescriptor: {
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
schema: {
|
|
58
|
+
method: z.ZodEnum<{
|
|
59
|
+
POST: "POST";
|
|
60
|
+
GET: "GET";
|
|
61
|
+
PUT: "PUT";
|
|
62
|
+
PATCH: "PATCH";
|
|
63
|
+
DELETE: "DELETE";
|
|
64
|
+
}>;
|
|
65
|
+
path: z.ZodString;
|
|
66
|
+
body: z.ZodOptional<z.ZodAny>;
|
|
67
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
68
|
+
};
|
|
69
|
+
handler: typeof handleApiRequest;
|
|
70
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { toolResponse } from '../utils/index.js';
|
|
3
|
+
export const apiRequestTool = {
|
|
4
|
+
name: 'salesforce_api_request',
|
|
5
|
+
description: 'Call a custom or non-standard Salesforce REST API endpoint that has no dedicated tool — e.g. a custom Apex REST class (/services/apexrest/...), a Manufacturing Cloud / Industries invocable action (e.g. mass-update on a Sales Agreement via /services/data/vXX.X/sobjects/SalesAgreement/.../actions/mass_update), or any other /services/... endpoint. Supports GET, POST, PUT, PATCH, and DELETE with an optional JSON body and headers. This can perform writes on the connected org.',
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
method: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
enum: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],
|
|
12
|
+
description: 'The HTTP method to use.',
|
|
13
|
+
},
|
|
14
|
+
path: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: 'The REST path, starting with /services/ (e.g. /services/apexrest/MyClass or /services/data/v65.0/sobjects/SalesAgreement/actions/mass_update).',
|
|
17
|
+
},
|
|
18
|
+
body: {
|
|
19
|
+
description: 'Optional JSON-serializable request body.',
|
|
20
|
+
},
|
|
21
|
+
headers: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
description: 'Optional additional HTTP headers.',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ['method', 'path'],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export async function handleApiRequest(conn, args) {
|
|
30
|
+
const { method, body, headers } = args;
|
|
31
|
+
let { path } = args;
|
|
32
|
+
if (!path.startsWith('/')) {
|
|
33
|
+
path = `/${path}`;
|
|
34
|
+
}
|
|
35
|
+
if (!path.startsWith('/services/')) {
|
|
36
|
+
return toolResponse('Invalid path: must start with "/services/" (e.g. /services/apexrest/... or /services/data/vXX.X/...).', true);
|
|
37
|
+
}
|
|
38
|
+
const hasBody = body !== undefined;
|
|
39
|
+
const requestHeaders = hasBody ? { 'Content-Type': 'application/json', ...headers } : headers;
|
|
40
|
+
try {
|
|
41
|
+
const result = await conn.request({
|
|
42
|
+
method,
|
|
43
|
+
url: path,
|
|
44
|
+
...(requestHeaders ? { headers: requestHeaders } : {}),
|
|
45
|
+
...(hasBody ? { body: JSON.stringify(body) } : {}),
|
|
46
|
+
});
|
|
47
|
+
const text = typeof result === 'string' ? result : JSON.stringify(result, null, 2);
|
|
48
|
+
return toolResponse(text || '(empty response)');
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
const detail = error.errorCode ? `[${error.errorCode}] ${error.message}` : error.message;
|
|
52
|
+
return toolResponse(`API request failed: ${detail}`, true);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export const apiRequestSchema = {
|
|
56
|
+
method: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']).describe('The HTTP method to use.'),
|
|
57
|
+
path: z.string().describe('The REST path, starting with /services/ (e.g. /services/apexrest/MyClass or /services/data/v65.0/sobjects/SalesAgreement/actions/mass_update).'),
|
|
58
|
+
body: z.any().optional().describe('Optional JSON-serializable request body.'),
|
|
59
|
+
headers: z.record(z.string(), z.string()).optional().describe('Optional additional HTTP headers.'),
|
|
60
|
+
};
|
|
61
|
+
export const apiRequestDescriptor = {
|
|
62
|
+
name: 'salesforce_api_request',
|
|
63
|
+
description: apiRequestTool.description,
|
|
64
|
+
schema: apiRequestSchema,
|
|
65
|
+
handler: handleApiRequest,
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=apiRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiRequest.js","sourceRoot":"","sources":["../../src/tools/apiRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,6dAA6d;IAC/d,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;gBAC/C,WAAW,EAAE,yBAAyB;aACvC;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gJAAgJ;aAC9J;YACD,IAAI,EAAE;gBACJ,WAAW,EAAE,0CAA0C;aACxD;YACD,OAAO,EAAE;gBACP,IAAI,E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
+
inputSchema: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {
|
|
9
|
+
startDate: {
|
|
10
|
+
type: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
endDate: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
outputDir: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
fileName: {
|
|
22
|
+
type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export interface AuditTrailDownloadArgs {
|
|
29
|
+
startDate?: string;
|
|
30
|
+
endDate?: string;
|
|
31
|
+
outputDir?: string;
|
|
32
|
+
fileName?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function handleAuditTrailDownload(conn: Connection, args: AuditTrailDownloadArgs): Promise<{
|
|
35
|
+
content: {
|
|
36
|
+
type: "text";
|
|
37
|
+
text: string;
|
|
38
|
+
}[];
|
|
39
|
+
isError: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
export declare const auditTrailDownloadSchema: {
|
|
42
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
43
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
44
|
+
outputDir: z.ZodOptional<z.ZodString>;
|
|
45
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
46
|
+
};
|
|
47
|
+
export declare const auditTrailDownloadDescriptor: {
|
|
48
|
+
name: string;
|
|
49
|
+
description: string;
|
|
50
|
+
schema: {
|
|
51
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
52
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
53
|
+
outputDir: z.ZodOptional<z.ZodString>;
|
|
54
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
55
|
+
};
|
|
56
|
+
handler: typeof handleAuditTrailDownload;
|
|
57
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { toolResponse } from '../utils/index.js';
|
|
3
|
+
import { AUDIT_TRAIL_COLUMNS, countInto, formatTopCounts, formatUserActivity, normalizeAuditDate, toCsvLine, trackUserActivity, } from '../utils/auditTrailCsv.js';
|
|
4
|
+
import * as fs from 'node:fs';
|
|
5
|
+
import * as path from 'node:path';
|
|
6
|
+
export const auditTrailDownloadTool = {
|
|
7
|
+
name: 'salesforce_audit_trail_download',
|
|
8
|
+
description: 'Download the Setup Audit Trail (SetupAuditTrail, last 180 days) for a date range to a local CSV file. Returns only the file path, row count, changes grouped by user (count, date range, main sections), and top sections — never the rows themselves. Show the user list to the user and ask which user(s) and timeline they want, then use salesforce_audit_trail_search on the returned file.',
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
startDate: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'Start of the range (YYYY-MM-DD or ISO 8601 datetime, UTC). Defaults to 180 days ago.',
|
|
15
|
+
},
|
|
16
|
+
endDate: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
description: 'End of the range, inclusive (YYYY-MM-DD or ISO 8601 datetime, UTC). Defaults to now.',
|
|
19
|
+
},
|
|
20
|
+
outputDir: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
description: 'Directory to save the CSV file. Defaults to SALESFORCE_EXPORT_DIR env var or current working directory.',
|
|
23
|
+
},
|
|
24
|
+
fileName: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Custom file name for the CSV. Defaults to SetupAuditTrail_{org}_{timestamp}.csv.',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const AUDIT_TRAIL_RETENTION_DAYS = 180;
|
|
32
|
+
const MAX_USERS_LISTED = 50;
|
|
33
|
+
export async function handleAuditTrailDownload(conn, args) {
|
|
34
|
+
const { startDate, endDate, outputDir, fileName } = args;
|
|
35
|
+
let soql = '';
|
|
36
|
+
try {
|
|
37
|
+
const start = startDate
|
|
38
|
+
? normalizeAuditDate(startDate, 'start')
|
|
39
|
+
: normalizeAuditDate(new Date(Date.now() - AUDIT_TRAIL_RETENTION_DAYS * 86400000).toISOString(), 'start');
|
|
40
|
+
const end = endDate ? normalizeAuditDate(endDate, 'end') : normalizeAuditDate(new Date().toISOString(), 'end');
|
|
41
|
+
soql =
|
|
42
|
+
`SELECT Id, CreatedDate, CreatedBy.Username, CreatedBy.Name, Action, Section, Display, DelegateUser ` +
|
|
43
|
+
`FROM SetupAuditTrail WHERE CreatedDate >= ${start} AND CreatedDate <= ${end} ORDER BY CreatedDate DESC`;
|
|
44
|
+
const dir = outputDir || process.env.SALESFORCE_EXPORT_DIR || process.cwd();
|
|
45
|
+
if (!fs.existsSync(dir)) {
|
|
46
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
47
|
+
}
|
|
48
|
+
const orgLabel = conn.userInfo?.organizationId ?? new URL(conn.instanceUrl).hostname.split('.')[0];
|
|
49
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
50
|
+
const filePath = path.join(dir, fileName || `SetupAuditTrail_${orgLabel}_${timestamp}.csv`);
|
|
51
|
+
const users = new Map();
|
|
52
|
+
const sections = new Map();
|
|
53
|
+
let rowCount = 0;
|
|
54
|
+
let newest = '';
|
|
55
|
+
let oldest = '';
|
|
56
|
+
// Write each query page as it arrives so the full trail is never buffered in memory
|
|
57
|
+
const fileHandle = await fs.promises.open(filePath, 'w');
|
|
58
|
+
try {
|
|
59
|
+
await fileHandle.write(toCsvLine([...AUDIT_TRAIL_COLUMNS]));
|
|
60
|
+
let result = await conn.query(soql);
|
|
61
|
+
while (true) {
|
|
62
|
+
let chunk = '';
|
|
63
|
+
for (const r of result.records) {
|
|
64
|
+
const username = r.CreatedBy?.Username ?? '';
|
|
65
|
+
const fullName = r.CreatedBy?.Name ?? '';
|
|
66
|
+
chunk += toCsvLine([
|
|
67
|
+
r.Id,
|
|
68
|
+
r.CreatedDate,
|
|
69
|
+
username,
|
|
70
|
+
fullName,
|
|
71
|
+
r.Action,
|
|
72
|
+
r.Section,
|
|
73
|
+
r.Display,
|
|
74
|
+
r.DelegateUser,
|
|
75
|
+
]);
|
|
76
|
+
trackUserActivity(users, { Username: username, UserFullName: fullName, CreatedDate: r.CreatedDate, Section: r.Section ?? '' });
|
|
77
|
+
countInto(sections, r.Section ?? '');
|
|
78
|
+
if (!newest)
|
|
79
|
+
newest = r.CreatedDate;
|
|
80
|
+
oldest = r.CreatedDate;
|
|
81
|
+
rowCount++;
|
|
82
|
+
}
|
|
83
|
+
if (chunk)
|
|
84
|
+
await fileHandle.write(chunk);
|
|
85
|
+
if (result.done || !result.nextRecordsUrl)
|
|
86
|
+
break;
|
|
87
|
+
result = await conn.queryMore(result.nextRecordsUrl);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
await fileHandle.close();
|
|
92
|
+
}
|
|
93
|
+
const fileSizeKB = (fs.statSync(filePath).size / 1024).toFixed(1);
|
|
94
|
+
const lines = [
|
|
95
|
+
`Setup Audit Trail downloaded successfully.`,
|
|
96
|
+
``,
|
|
97
|
+
`File: ${filePath}`,
|
|
98
|
+
`Requested Range: ${start} → ${end}`,
|
|
99
|
+
`Rows: ${rowCount}`,
|
|
100
|
+
`Actual Range: ${rowCount ? `${oldest} → ${newest}` : 'N/A'}`,
|
|
101
|
+
`File Size: ${fileSizeKB} KB`,
|
|
102
|
+
];
|
|
103
|
+
if (rowCount > 0) {
|
|
104
|
+
lines.push('', `Changes by user (${users.size} user${users.size === 1 ? '' : 's'}):`, ...formatUserActivity(users, MAX_USERS_LISTED));
|
|
105
|
+
lines.push('', 'Top sections:', ...formatTopCounts(sections, 10));
|
|
106
|
+
}
|
|
107
|
+
lines.push('', `Next step: Show the "Changes by user" list to the user and ask which user(s) and timeline they are ` +
|
|
108
|
+
`interested in. Then call salesforce_audit_trail_search with filePath "${filePath}" and the chosen ` +
|
|
109
|
+
`user/startDate/endDate. Do not read this file directly — it can be large.`);
|
|
110
|
+
return toolResponse(lines.join('\n'));
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
return toolResponse(`Failed to download Setup Audit Trail: ${error.message}` + (soql ? `\n\nSOQL: ${soql}` : ''), true);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export const auditTrailDownloadSchema = {
|
|
117
|
+
startDate: z.string().describe('Start of the range (YYYY-MM-DD or ISO 8601 datetime, UTC). Defaults to 180 days ago.').optional(),
|
|
118
|
+
endDate: z.string().describe('End of the range, inclusive (YYYY-MM-DD or ISO 8601 datetime, UTC). Defaults to now.').optional(),
|
|
119
|
+
outputDir: z.string().describe('Directory to save the CSV file. Defaults to SALESFORCE_EXPORT_DIR env var or current working directory.').optional(),
|
|
120
|
+
fileName: z.string().describe('Custom file name for the CSV. Defaults to SetupAuditTrail_{org}_{timestamp}.csv.').optional(),
|
|
121
|
+
};
|
|
122
|
+
export const auditTrailDownloadDescriptor = {
|
|
123
|
+
name: 'salesforce_audit_trail_download',
|
|
124
|
+
description: auditTrailDownloadTool.description,
|
|
125
|
+
schema: auditTrailDownloadSchema,
|
|
126
|
+
handler: handleAuditTrailDownload,
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=auditTrailDownload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditTrailDownload.js","sourceRoot":"","sources":["../../src/tools/auditTrailDownload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,GAElB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KA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AAG;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sFAAsF,CAAC,CAAC,QAAQ,EAAE;IACjI,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sFAAsF,CAAC,CAAC,QAAQ,EAAE;IAC/H,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yGAAyG,CAAC,CAAC,QAAQ,EAAE;IACpJ,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kFAAkF,CAAC,CAAC,QAAQ,EAAE;CAC7H,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,iCAAiC;IACvC,WAAW,EAAE,sBAAsB,CAAC,WAAW;IAC/C,MAAM,EAAE,wBAAwB;IAChC,OAAO,EAAE,wBAAwB;CAClC,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export declare const auditTrailSearchTool: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
filePath: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
user: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
startDate: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
endDate: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
section: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
text: {
|
|
29
|
+
type: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
mode: {
|
|
33
|
+
type: string;
|
|
34
|
+
enum: string[];
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
limit: {
|
|
38
|
+
type: string;
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
offset: {
|
|
42
|
+
type: string;
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
required: string[];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export interface AuditTrailSearchArgs {
|
|
50
|
+
filePath: string;
|
|
51
|
+
user?: string;
|
|
52
|
+
startDate?: string;
|
|
53
|
+
endDate?: string;
|
|
54
|
+
section?: string;
|
|
55
|
+
text?: string;
|
|
56
|
+
mode?: 'users' | 'summary' | 'rows';
|
|
57
|
+
limit?: number;
|
|
58
|
+
offset?: number;
|
|
59
|
+
}
|
|
60
|
+
export declare function handleAuditTrailSearch(args: AuditTrailSearchArgs): Promise<{
|
|
61
|
+
content: {
|
|
62
|
+
type: "text";
|
|
63
|
+
text: string;
|
|
64
|
+
}[];
|
|
65
|
+
isError: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
export declare const auditTrailSearchSchema: {
|
|
68
|
+
filePath: z.ZodString;
|
|
69
|
+
user: z.ZodOptional<z.ZodString>;
|
|
70
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
71
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
72
|
+
section: z.ZodOptional<z.ZodString>;
|
|
73
|
+
text: z.ZodOptional<z.ZodString>;
|
|
74
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
75
|
+
users: "users";
|
|
76
|
+
summary: "summary";
|
|
77
|
+
rows: "rows";
|
|
78
|
+
}>>;
|
|
79
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
};
|
|
82
|
+
export declare const auditTrailSearchDescriptor: {
|
|
83
|
+
name: string;
|
|
84
|
+
description: string;
|
|
85
|
+
schema: {
|
|
86
|
+
filePath: z.ZodString;
|
|
87
|
+
user: z.ZodOptional<z.ZodString>;
|
|
88
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
89
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
90
|
+
section: z.ZodOptional<z.ZodString>;
|
|
91
|
+
text: z.ZodOptional<z.ZodString>;
|
|
92
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
93
|
+
users: "users";
|
|
94
|
+
summary: "summary";
|
|
95
|
+
rows: "rows";
|
|
96
|
+
}>>;
|
|
97
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
};
|
|
100
|
+
handler: typeof handleAuditTrailSearch;
|
|
101
|
+
noConnection: boolean;
|
|
102
|
+
};
|