@acquis-consulting/asm 1.0.5
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 +0 -0
- package/dist/apps/gitDiffReview/gitDiffParser.d.ts +6 -0
- package/dist/apps/gitDiffReview/gitDiffParser.js +1 -0
- package/dist/apps/gitDiffReview/packageXml.d.ts +8 -0
- package/dist/apps/gitDiffReview/packageXml.js +1 -0
- package/dist/apps/gitDiffReview/tools.d.ts +42 -0
- package/dist/apps/gitDiffReview/tools.js +1 -0
- package/dist/apps/gitDiffReview/types.d.ts +19 -0
- package/dist/apps/gitDiffReview/types.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +193 -0
- package/dist/index.js.map +1 -0
- package/dist/metadata-diff.html +98 -0
- package/dist/tools/aggregateQuery.d.ts +85 -0
- package/dist/tools/aggregateQuery.js +110 -0
- package/dist/tools/aggregateQuery.js.map +1 -0
- package/dist/tools/bulkExportAbort.d.ts +37 -0
- package/dist/tools/bulkExportAbort.js +44 -0
- package/dist/tools/bulkExportAbort.js.map +1 -0
- package/dist/tools/bulkExportResults.d.ts +51 -0
- package/dist/tools/bulkExportResults.js +76 -0
- package/dist/tools/bulkExportResults.js.map +1 -0
- package/dist/tools/bulkExportStart.d.ts +61 -0
- package/dist/tools/bulkExportStart.js +68 -0
- package/dist/tools/bulkExportStart.js.map +1 -0
- package/dist/tools/bulkExportStatus.d.ts +37 -0
- package/dist/tools/bulkExportStatus.js +54 -0
- package/dist/tools/bulkExportStatus.js.map +1 -0
- package/dist/tools/crossObjectSearch.d.ts +155 -0
- package/dist/tools/crossObjectSearch.js +145 -0
- package/dist/tools/crossObjectSearch.js.map +1 -0
- package/dist/tools/debugLogs.d.ts +106 -0
- package/dist/tools/debugLogs.js +189 -0
- package/dist/tools/debugLogs.js.map +1 -0
- package/dist/tools/deployMetadata.d.ts +60 -0
- package/dist/tools/deployMetadata.js +106 -0
- package/dist/tools/deployMetadata.js.map +1 -0
- package/dist/tools/deployPackage.d.ts +49 -0
- package/dist/tools/deployPackage.js +1 -0
- package/dist/tools/dml.d.ts +70 -0
- package/dist/tools/dml.js +105 -0
- package/dist/tools/dml.js.map +1 -0
- package/dist/tools/dmlDelete.d.ts +51 -0
- package/dist/tools/dmlDelete.js +71 -0
- package/dist/tools/dmlDelete.js.map +1 -0
- package/dist/tools/executeAnonymous.d.ts +63 -0
- package/dist/tools/executeAnonymous.js +77 -0
- package/dist/tools/executeAnonymous.js.map +1 -0
- package/dist/tools/fieldManagement.d.ts +222 -0
- package/dist/tools/fieldManagement.js +234 -0
- package/dist/tools/fieldManagement.js.map +1 -0
- package/dist/tools/fieldPermissions.d.ts +94 -0
- package/dist/tools/fieldPermissions.js +191 -0
- package/dist/tools/fieldPermissions.js.map +1 -0
- package/dist/tools/getDependencies.d.ts +58 -0
- package/dist/tools/getDependencies.js +105 -0
- package/dist/tools/getDependencies.js.map +1 -0
- package/dist/tools/listUserPermissions.d.ts +36 -0
- package/dist/tools/listUserPermissions.js +59 -0
- package/dist/tools/listUserPermissions.js.map +1 -0
- package/dist/tools/metadataDescribe.d.ts +37 -0
- package/dist/tools/metadataDescribe.js +35 -0
- package/dist/tools/metadataDescribe.js.map +1 -0
- package/dist/tools/metadataDiff.d.ts +66 -0
- package/dist/tools/metadataDiff.js +215 -0
- package/dist/tools/metadataDiff.js.map +1 -0
- package/dist/tools/metadataDiffFileDetail.d.ts +44 -0
- package/dist/tools/metadataDiffFileDetail.js +84 -0
- package/dist/tools/metadataDiffFileDetail.js.map +1 -0
- package/dist/tools/metadataDiffFiles.d.ts +37 -0
- package/dist/tools/metadataDiffFiles.js +72 -0
- package/dist/tools/metadataDiffFiles.js.map +1 -0
- package/dist/tools/metadataDiffGeneratePackage.d.ts +73 -0
- package/dist/tools/metadataDiffGeneratePackage.js +122 -0
- package/dist/tools/metadataDiffGeneratePackage.js.map +1 -0
- package/dist/tools/metadataImport.d.ts +63 -0
- package/dist/tools/metadataImport.js +122 -0
- package/dist/tools/metadataImport.js.map +1 -0
- package/dist/tools/metadataJobStatus.d.ts +44 -0
- package/dist/tools/metadataJobStatus.js +101 -0
- package/dist/tools/metadataJobStatus.js.map +1 -0
- package/dist/tools/metadataList.d.ts +44 -0
- package/dist/tools/metadataList.js +49 -0
- package/dist/tools/metadataList.js.map +1 -0
- package/dist/tools/metadataRead.d.ts +47 -0
- package/dist/tools/metadataRead.js +52 -0
- package/dist/tools/metadataRead.js.map +1 -0
- package/dist/tools/metadataTypeSchema.d.ts +44 -0
- package/dist/tools/metadataTypeSchema.js +101 -0
- package/dist/tools/metadataTypeSchema.js.map +1 -0
- package/dist/tools/metadataWsdl.d.ts +19 -0
- package/dist/tools/metadataWsdl.js +1 -0
- package/dist/tools/objectManagement.d.ts +107 -0
- package/dist/tools/objectManagement.js +123 -0
- package/dist/tools/objectManagement.js.map +1 -0
- package/dist/tools/objectPermissions.d.ts +101 -0
- package/dist/tools/objectPermissions.js +157 -0
- package/dist/tools/objectPermissions.js.map +1 -0
- package/dist/tools/objectSchema.d.ts +37 -0
- package/dist/tools/objectSchema.js +66 -0
- package/dist/tools/objectSchema.js.map +1 -0
- package/dist/tools/objectSearch.d.ts +37 -0
- package/dist/tools/objectSearch.js +44 -0
- package/dist/tools/objectSearch.js.map +1 -0
- package/dist/tools/packageStatus.d.ts +24 -0
- package/dist/tools/packageStatus.js +1 -0
- package/dist/tools/permissionSetAssignment.d.ts +39 -0
- package/dist/tools/permissionSetAssignment.js +1 -0
- package/dist/tools/readApexClasses.d.ts +50 -0
- package/dist/tools/readApexClasses.js +83 -0
- package/dist/tools/readApexClasses.js.map +1 -0
- package/dist/tools/readApexTriggers.d.ts +50 -0
- package/dist/tools/readApexTriggers.js +82 -0
- package/dist/tools/readApexTriggers.js.map +1 -0
- package/dist/tools/recordPicker.d.ts +48 -0
- package/dist/tools/recordPicker.js +1 -0
- package/dist/tools/recordQuery.d.ts +68 -0
- package/dist/tools/recordQuery.js +131 -0
- package/dist/tools/recordQuery.js.map +1 -0
- package/dist/tools/retrieveJobStatus.d.ts +51 -0
- package/dist/tools/retrieveJobStatus.js +192 -0
- package/dist/tools/retrieveJobStatus.js.map +1 -0
- package/dist/tools/retrieveMetadata.d.ts +79 -0
- package/dist/tools/retrieveMetadata.js +225 -0
- package/dist/tools/retrieveMetadata.js.map +1 -0
- package/dist/tools/retrievePackage.d.ts +37 -0
- package/dist/tools/retrievePackage.js +1 -0
- package/dist/tools/salesforceLogin.d.ts +36 -0
- package/dist/tools/salesforceLogin.js +75 -0
- package/dist/tools/salesforceLogin.js.map +1 -0
- package/dist/tools/selectOrg.d.ts +25 -0
- package/dist/tools/selectOrg.js +91 -0
- package/dist/tools/selectOrg.js.map +1 -0
- package/dist/tools/toolingQuery.d.ts +37 -0
- package/dist/tools/toolingQuery.js +54 -0
- package/dist/tools/toolingQuery.js.map +1 -0
- package/dist/tools/userPermissions.d.ts +76 -0
- package/dist/tools/userPermissions.js +130 -0
- package/dist/tools/userPermissions.js.map +1 -0
- package/dist/tools/versionMetadataComplete.d.ts +45 -0
- package/dist/tools/versionMetadataComplete.js +1 -0
- package/dist/tools/versionMetadataStart.d.ts +25 -0
- package/dist/tools/versionMetadataStart.js +1 -0
- package/dist/tools/versionMetadataStatus.d.ts +25 -0
- package/dist/tools/versionMetadataStatus.js +1 -0
- package/dist/tools/writeApexClasses.d.ts +64 -0
- package/dist/tools/writeApexClasses.js +79 -0
- package/dist/tools/writeApexClasses.js.map +1 -0
- package/dist/tools/writeApexTriggers.d.ts +71 -0
- package/dist/tools/writeApexTriggers.js +96 -0
- package/dist/tools/writeApexTriggers.js.map +1 -0
- package/dist/types/connection.d.ts +20 -0
- package/dist/types/connection.js +9 -0
- package/dist/types/connection.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/metadata.d.ts +44 -0
- package/dist/types/metadata.js +2 -0
- package/dist/types/metadata.js.map +1 -0
- package/dist/types/salesforce.d.ts +38 -0
- package/dist/types/salesforce.js +2 -0
- package/dist/types/salesforce.js.map +1 -0
- package/dist/utils/apexContainer.d.ts +18 -0
- package/dist/utils/apexContainer.js +79 -0
- package/dist/utils/apexContainer.js.map +1 -0
- package/dist/utils/connection.d.ts +3 -0
- package/dist/utils/connection.js +135 -0
- package/dist/utils/connection.js.map +1 -0
- package/dist/utils/decomposePermissions.d.ts +16 -0
- package/dist/utils/decomposePermissions.js +188 -0
- package/dist/utils/decomposePermissions.js.map +1 -0
- package/dist/utils/dxPathMapper.d.ts +16 -0
- package/dist/utils/dxPathMapper.js +217 -0
- package/dist/utils/dxPathMapper.js.map +1 -0
- package/dist/utils/errors.d.ts +8 -0
- package/dist/utils/errors.js +40 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/oauthWebFlow.d.ts +8 -0
- package/dist/utils/oauthWebFlow.js +172 -0
- package/dist/utils/oauthWebFlow.js.map +1 -0
- package/dist/utils/packageJobs.d.ts +17 -0
- package/dist/utils/packageJobs.js +1 -0
- package/dist/utils/packageXml.d.ts +18 -0
- package/dist/utils/packageXml.js +1 -0
- package/dist/utils/permissionSetResolver.d.ts +14 -0
- package/dist/utils/permissionSetResolver.js +1 -0
- package/dist/utils/preSelectMatcher.d.ts +18 -0
- package/dist/utils/preSelectMatcher.js +1 -0
- package/dist/utils/profileCleanup.d.ts +18 -0
- package/dist/utils/profileCleanup.js +1 -0
- package/dist/utils/retrieveStore.d.ts +12 -0
- package/dist/utils/retrieveStore.js +1 -0
- package/dist/utils/sfCli.d.ts +18 -0
- package/dist/utils/sfCli.js +130 -0
- package/dist/utils/sfCli.js.map +1 -0
- package/dist/utils/tokenBroker.d.ts +13 -0
- package/dist/utils/tokenBroker.js +73 -0
- package/dist/utils/tokenBroker.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { toolResponse } from '../utils/index.js';
|
|
3
|
+
export const executeAnonymousTool = {
|
|
4
|
+
name: 'salesforce_execute_anonymous',
|
|
5
|
+
description: 'Execute anonymous Apex code and return compilation/execution results with debug logs. Useful for quick scripts, data fixes, and testing logic.',
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
apexCode: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
description: 'The Apex code to execute.',
|
|
12
|
+
},
|
|
13
|
+
logLevel: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
enum: ['NONE', 'ERROR', 'WARN', 'INFO', 'DEBUG', 'FINE', 'FINER', 'FINEST'],
|
|
16
|
+
description: 'Debug log level. Default: DEBUG.',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ['apexCode'],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export async function handleExecuteAnonymous(conn, args) {
|
|
23
|
+
const { apexCode } = args;
|
|
24
|
+
try {
|
|
25
|
+
const result = await conn.tooling.executeAnonymous(apexCode);
|
|
26
|
+
const lines = [];
|
|
27
|
+
if (!result.compiled) {
|
|
28
|
+
lines.push('## Compilation Failed\n');
|
|
29
|
+
lines.push(`Line ${result.line}, Column ${result.column}: ${result.compileProblem}`);
|
|
30
|
+
return toolResponse(lines.join('\n'), true);
|
|
31
|
+
}
|
|
32
|
+
lines.push('## Compilation: Success\n');
|
|
33
|
+
if (!result.success) {
|
|
34
|
+
lines.push('## Execution Failed\n');
|
|
35
|
+
lines.push(`Exception: ${result.exceptionMessage}`);
|
|
36
|
+
if (result.exceptionStackTrace) {
|
|
37
|
+
lines.push(`\nStack Trace:\n${result.exceptionStackTrace}`);
|
|
38
|
+
}
|
|
39
|
+
return toolResponse(lines.join('\n'), true);
|
|
40
|
+
}
|
|
41
|
+
lines.push('## Execution: Success\n');
|
|
42
|
+
// Attempt to fetch debug log
|
|
43
|
+
try {
|
|
44
|
+
const logResult = await conn.tooling.query(`SELECT Id FROM ApexLog ORDER BY StartTime DESC LIMIT 1`);
|
|
45
|
+
if (logResult.records && logResult.records.length > 0) {
|
|
46
|
+
const logId = logResult.records[0].Id;
|
|
47
|
+
const logBody = await conn.request({
|
|
48
|
+
method: 'GET',
|
|
49
|
+
url: `/services/data/v58.0/tooling/sobjects/ApexLog/${logId}/Body`,
|
|
50
|
+
});
|
|
51
|
+
if (logBody) {
|
|
52
|
+
const bodyStr = typeof logBody === 'string' ? logBody : JSON.stringify(logBody);
|
|
53
|
+
lines.push('## Debug Log\n');
|
|
54
|
+
lines.push('```\n' + bodyStr + '\n```');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
lines.push('\n(Debug log not available)');
|
|
60
|
+
}
|
|
61
|
+
return toolResponse(lines.join('\n'));
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
return toolResponse(`Execute anonymous failed: ${error.message}`, true);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export const executeAnonymousSchema = {
|
|
68
|
+
apexCode: z.string().describe('The Apex code to execute.'),
|
|
69
|
+
logLevel: z.enum(['NONE', 'ERROR', 'WARN', 'INFO', 'DEBUG', 'FINE', 'FINER', 'FINEST']).describe('Debug log level. Default: DEBUG.').optional(),
|
|
70
|
+
};
|
|
71
|
+
export const executeAnonymousDescriptor = {
|
|
72
|
+
name: 'salesforce_execute_anonymous',
|
|
73
|
+
description: executeAnonymousTool.description,
|
|
74
|
+
schema: executeAnonymousSchema,
|
|
75
|
+
handler: handleExecuteAnonymous,
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=executeAnonymous.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeAnonymous.js","sourceRoot":"","sources":["../../src/tools/executeAnonymous.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC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AED,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,YAAY,CAAC,6BAA6B,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC1D,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAC,QAAQ,EAAE;CAChJ,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,oBAAoB,CAAC,WAAW;IAC7C,MAAM,EAAE,sBAAsB;IAC9B,OAAO,EAAE,sBAAsB;CAChC,CAAC"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { Connection } from 'jsforce';
|
|
2
|
+
import { z } from 'zod/v4';
|
|
3
|
+
export declare const fieldManagementTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {
|
|
9
|
+
operation: {
|
|
10
|
+
type: string;
|
|
11
|
+
enum: string[];
|
|
12
|
+
};
|
|
13
|
+
objectName: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
fieldName: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
label: {
|
|
22
|
+
type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
type: {
|
|
26
|
+
type: string;
|
|
27
|
+
enum: string[];
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
required: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
unique: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
externalId: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
length: {
|
|
43
|
+
type: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
precision: {
|
|
47
|
+
type: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
scale: {
|
|
51
|
+
type: string;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
referenceTo: {
|
|
55
|
+
type: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
relationshipLabel: {
|
|
59
|
+
type: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
relationshipName: {
|
|
63
|
+
type: string;
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
deleteConstraint: {
|
|
67
|
+
type: string;
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
70
|
+
picklistValues: {
|
|
71
|
+
type: string;
|
|
72
|
+
items: {
|
|
73
|
+
type: string;
|
|
74
|
+
properties: {
|
|
75
|
+
label: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
isDefault: {
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
required: string[];
|
|
83
|
+
};
|
|
84
|
+
description: string;
|
|
85
|
+
};
|
|
86
|
+
description: {
|
|
87
|
+
type: string;
|
|
88
|
+
};
|
|
89
|
+
grantAccessTo: {
|
|
90
|
+
type: string;
|
|
91
|
+
items: {
|
|
92
|
+
type: string;
|
|
93
|
+
};
|
|
94
|
+
description: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
required: string[];
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export interface FieldManagementArgs {
|
|
101
|
+
operation: 'create' | 'update';
|
|
102
|
+
objectName: string;
|
|
103
|
+
fieldName: string;
|
|
104
|
+
label?: string;
|
|
105
|
+
type?: string;
|
|
106
|
+
required?: boolean;
|
|
107
|
+
unique?: boolean;
|
|
108
|
+
externalId?: boolean;
|
|
109
|
+
length?: number;
|
|
110
|
+
precision?: number;
|
|
111
|
+
scale?: number;
|
|
112
|
+
referenceTo?: string;
|
|
113
|
+
relationshipLabel?: string;
|
|
114
|
+
relationshipName?: string;
|
|
115
|
+
deleteConstraint?: string;
|
|
116
|
+
picklistValues?: Array<{
|
|
117
|
+
label: string;
|
|
118
|
+
isDefault?: boolean;
|
|
119
|
+
}>;
|
|
120
|
+
description?: string;
|
|
121
|
+
grantAccessTo?: string[];
|
|
122
|
+
}
|
|
123
|
+
export declare function handleFieldManagement(conn: Connection, args: FieldManagementArgs): Promise<{
|
|
124
|
+
content: {
|
|
125
|
+
type: "text";
|
|
126
|
+
text: string;
|
|
127
|
+
}[];
|
|
128
|
+
isError: boolean;
|
|
129
|
+
}>;
|
|
130
|
+
export declare const fieldManagementSchema: {
|
|
131
|
+
operation: z.ZodEnum<{
|
|
132
|
+
update: "update";
|
|
133
|
+
create: "create";
|
|
134
|
+
}>;
|
|
135
|
+
objectName: z.ZodString;
|
|
136
|
+
fieldName: z.ZodString;
|
|
137
|
+
label: z.ZodOptional<z.ZodString>;
|
|
138
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
139
|
+
Text: "Text";
|
|
140
|
+
Checkbox: "Checkbox";
|
|
141
|
+
Currency: "Currency";
|
|
142
|
+
Date: "Date";
|
|
143
|
+
DateTime: "DateTime";
|
|
144
|
+
Email: "Email";
|
|
145
|
+
Number: "Number";
|
|
146
|
+
Percent: "Percent";
|
|
147
|
+
Phone: "Phone";
|
|
148
|
+
Picklist: "Picklist";
|
|
149
|
+
MultiselectPicklist: "MultiselectPicklist";
|
|
150
|
+
TextArea: "TextArea";
|
|
151
|
+
LongTextArea: "LongTextArea";
|
|
152
|
+
Html: "Html";
|
|
153
|
+
Url: "Url";
|
|
154
|
+
Lookup: "Lookup";
|
|
155
|
+
MasterDetail: "MasterDetail";
|
|
156
|
+
}>>;
|
|
157
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
+
unique: z.ZodOptional<z.ZodBoolean>;
|
|
159
|
+
externalId: z.ZodOptional<z.ZodBoolean>;
|
|
160
|
+
length: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
precision: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
referenceTo: z.ZodOptional<z.ZodString>;
|
|
164
|
+
relationshipLabel: z.ZodOptional<z.ZodString>;
|
|
165
|
+
relationshipName: z.ZodOptional<z.ZodString>;
|
|
166
|
+
deleteConstraint: z.ZodOptional<z.ZodString>;
|
|
167
|
+
picklistValues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
168
|
+
label: z.ZodString;
|
|
169
|
+
isDefault: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
}, z.core.$strip>>>;
|
|
171
|
+
description: z.ZodOptional<z.ZodString>;
|
|
172
|
+
grantAccessTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
173
|
+
};
|
|
174
|
+
export declare const fieldManagementDescriptor: {
|
|
175
|
+
name: string;
|
|
176
|
+
description: string;
|
|
177
|
+
schema: {
|
|
178
|
+
operation: z.ZodEnum<{
|
|
179
|
+
update: "update";
|
|
180
|
+
create: "create";
|
|
181
|
+
}>;
|
|
182
|
+
objectName: z.ZodString;
|
|
183
|
+
fieldName: z.ZodString;
|
|
184
|
+
label: z.ZodOptional<z.ZodString>;
|
|
185
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
186
|
+
Text: "Text";
|
|
187
|
+
Checkbox: "Checkbox";
|
|
188
|
+
Currency: "Currency";
|
|
189
|
+
Date: "Date";
|
|
190
|
+
DateTime: "DateTime";
|
|
191
|
+
Email: "Email";
|
|
192
|
+
Number: "Number";
|
|
193
|
+
Percent: "Percent";
|
|
194
|
+
Phone: "Phone";
|
|
195
|
+
Picklist: "Picklist";
|
|
196
|
+
MultiselectPicklist: "MultiselectPicklist";
|
|
197
|
+
TextArea: "TextArea";
|
|
198
|
+
LongTextArea: "LongTextArea";
|
|
199
|
+
Html: "Html";
|
|
200
|
+
Url: "Url";
|
|
201
|
+
Lookup: "Lookup";
|
|
202
|
+
MasterDetail: "MasterDetail";
|
|
203
|
+
}>>;
|
|
204
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
205
|
+
unique: z.ZodOptional<z.ZodBoolean>;
|
|
206
|
+
externalId: z.ZodOptional<z.ZodBoolean>;
|
|
207
|
+
length: z.ZodOptional<z.ZodNumber>;
|
|
208
|
+
precision: z.ZodOptional<z.ZodNumber>;
|
|
209
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
referenceTo: z.ZodOptional<z.ZodString>;
|
|
211
|
+
relationshipLabel: z.ZodOptional<z.ZodString>;
|
|
212
|
+
relationshipName: z.ZodOptional<z.ZodString>;
|
|
213
|
+
deleteConstraint: z.ZodOptional<z.ZodString>;
|
|
214
|
+
picklistValues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
215
|
+
label: z.ZodString;
|
|
216
|
+
isDefault: z.ZodOptional<z.ZodBoolean>;
|
|
217
|
+
}, z.core.$strip>>>;
|
|
218
|
+
description: z.ZodOptional<z.ZodString>;
|
|
219
|
+
grantAccessTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
220
|
+
};
|
|
221
|
+
handler: typeof handleFieldManagement;
|
|
222
|
+
};
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { toolResponse, formatMetadataErrors } from '../utils/index.js';
|
|
3
|
+
export const fieldManagementTool = {
|
|
4
|
+
name: 'salesforce_manage_field',
|
|
5
|
+
description: 'Create or update custom fields on Salesforce objects. Supports all field types including Lookup, MasterDetail, Picklist, etc. Automatically grants Field Level Security to specified profiles after creation. Field name should not include __c suffix.',
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
operation: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
enum: ['create', 'update'],
|
|
12
|
+
},
|
|
13
|
+
objectName: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'The parent object API name (e.g., "Account", "MyObject__c").',
|
|
16
|
+
},
|
|
17
|
+
fieldName: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'Field name without __c suffix.',
|
|
20
|
+
},
|
|
21
|
+
label: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Field label (required for create).',
|
|
24
|
+
},
|
|
25
|
+
type: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
enum: ['Checkbox', 'Currency', 'Date', 'DateTime', 'Email', 'Number', 'Percent', 'Phone', 'Picklist', 'MultiselectPicklist', 'Text', 'TextArea', 'LongTextArea', 'Html', 'Url', 'Lookup', 'MasterDetail'],
|
|
28
|
+
description: 'Field type (required for create).',
|
|
29
|
+
},
|
|
30
|
+
required: { type: 'boolean', description: 'Whether the field is required.' },
|
|
31
|
+
unique: { type: 'boolean', description: 'Whether values must be unique.' },
|
|
32
|
+
externalId: { type: 'boolean', description: 'Whether this is an external ID field.' },
|
|
33
|
+
length: { type: 'number', description: 'For Text fields. Default: 255.' },
|
|
34
|
+
precision: { type: 'number', description: 'For Number fields. Total digits.' },
|
|
35
|
+
scale: { type: 'number', description: 'For Number fields. Decimal places. Default: 0.' },
|
|
36
|
+
referenceTo: { type: 'string', description: 'For Lookup/MasterDetail: target object API name.' },
|
|
37
|
+
relationshipLabel: { type: 'string', description: 'For Lookup/MasterDetail: child relationship label.' },
|
|
38
|
+
relationshipName: { type: 'string', description: 'For Lookup/MasterDetail: child relationship name.' },
|
|
39
|
+
deleteConstraint: { type: 'string', description: 'For Lookup: SetNull, Restrict, or Cascade.' },
|
|
40
|
+
picklistValues: {
|
|
41
|
+
type: 'array',
|
|
42
|
+
items: {
|
|
43
|
+
type: 'object',
|
|
44
|
+
properties: { label: { type: 'string' }, isDefault: { type: 'boolean' } },
|
|
45
|
+
required: ['label'],
|
|
46
|
+
},
|
|
47
|
+
description: 'For Picklist/MultiselectPicklist fields.',
|
|
48
|
+
},
|
|
49
|
+
description: { type: 'string' },
|
|
50
|
+
grantAccessTo: {
|
|
51
|
+
type: 'array',
|
|
52
|
+
items: { type: 'string' },
|
|
53
|
+
description: 'Profile names to grant FLS to after creation. Default: ["System Administrator"].',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
required: ['operation', 'objectName', 'fieldName'],
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
async function grantFieldLevelSecurity(conn, objectName, fieldApiName, profiles) {
|
|
60
|
+
const results = [];
|
|
61
|
+
for (const profileName of profiles) {
|
|
62
|
+
try {
|
|
63
|
+
const profileResult = await conn.query(`SELECT Id FROM Profile WHERE Name = '${profileName.replace(/'/g, "\\'")}'`);
|
|
64
|
+
if (!profileResult.records || profileResult.records.length === 0) {
|
|
65
|
+
results.push(`Profile "${profileName}" not found`);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const profileId = profileResult.records[0].Id;
|
|
69
|
+
const psResult = await conn.query(`SELECT Id FROM PermissionSet WHERE ProfileId = '${profileId}' AND IsOwnedByProfile = true`);
|
|
70
|
+
if (!psResult.records || psResult.records.length === 0) {
|
|
71
|
+
results.push(`No permission set found for profile "${profileName}"`);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const permSetId = psResult.records[0].Id;
|
|
75
|
+
const existingFp = await conn.query(`SELECT Id FROM FieldPermissions WHERE ParentId = '${permSetId}' AND SobjectType = '${objectName}' AND Field = '${objectName}.${fieldApiName}'`);
|
|
76
|
+
if (existingFp.records && existingFp.records.length > 0) {
|
|
77
|
+
await conn.sobject('FieldPermissions').update({
|
|
78
|
+
Id: existingFp.records[0].Id,
|
|
79
|
+
PermissionsRead: true,
|
|
80
|
+
PermissionsEdit: true,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
await conn.sobject('FieldPermissions').create({
|
|
85
|
+
ParentId: permSetId,
|
|
86
|
+
SobjectType: objectName,
|
|
87
|
+
Field: `${objectName}.${fieldApiName}`,
|
|
88
|
+
PermissionsRead: true,
|
|
89
|
+
PermissionsEdit: true,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
results.push(`FLS granted to "${profileName}"`);
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
results.push(`FLS grant failed for "${profileName}": ${err.message}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return results;
|
|
99
|
+
}
|
|
100
|
+
export async function handleFieldManagement(conn, args) {
|
|
101
|
+
const { operation, objectName, fieldName } = args;
|
|
102
|
+
const fieldApiName = fieldName.endsWith('__c') ? fieldName : `${fieldName}__c`;
|
|
103
|
+
const fullName = `${objectName}.${fieldApiName}`;
|
|
104
|
+
try {
|
|
105
|
+
if (operation === 'create') {
|
|
106
|
+
if (!args.label || !args.type) {
|
|
107
|
+
return toolResponse('Create requires "label" and "type" parameters.', true);
|
|
108
|
+
}
|
|
109
|
+
const metadata = {
|
|
110
|
+
fullName,
|
|
111
|
+
label: args.label,
|
|
112
|
+
type: args.type,
|
|
113
|
+
description: args.description,
|
|
114
|
+
required: args.required || false,
|
|
115
|
+
unique: args.unique || false,
|
|
116
|
+
externalId: args.externalId || false,
|
|
117
|
+
};
|
|
118
|
+
// Type-specific handling
|
|
119
|
+
if (args.type === 'Lookup' || args.type === 'MasterDetail') {
|
|
120
|
+
metadata.referenceTo = args.referenceTo;
|
|
121
|
+
metadata.relationshipName = args.relationshipName || fieldName.replace(/__c$/, '').replace(/_/g, '');
|
|
122
|
+
metadata.relationshipLabel = args.relationshipLabel || args.label;
|
|
123
|
+
if (args.type === 'Lookup') {
|
|
124
|
+
metadata.deleteConstraint = args.deleteConstraint || 'SetNull';
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else if (args.type === 'TextArea') {
|
|
128
|
+
metadata.type = 'LongTextArea';
|
|
129
|
+
metadata.length = 32768;
|
|
130
|
+
metadata.visibleLines = 3;
|
|
131
|
+
}
|
|
132
|
+
else if (args.type === 'LongTextArea' || args.type === 'Html') {
|
|
133
|
+
metadata.length = args.length || 32768;
|
|
134
|
+
metadata.visibleLines = 3;
|
|
135
|
+
}
|
|
136
|
+
else if (args.type === 'Text') {
|
|
137
|
+
metadata.length = args.length || 255;
|
|
138
|
+
}
|
|
139
|
+
else if (args.type === 'Number' || args.type === 'Currency' || args.type === 'Percent') {
|
|
140
|
+
metadata.precision = args.precision || 18;
|
|
141
|
+
metadata.scale = args.scale ?? 0;
|
|
142
|
+
}
|
|
143
|
+
else if (args.type === 'Picklist' || args.type === 'MultiselectPicklist') {
|
|
144
|
+
if (args.picklistValues && args.picklistValues.length > 0) {
|
|
145
|
+
metadata.valueSet = {
|
|
146
|
+
valueSetDefinition: {
|
|
147
|
+
sorted: false,
|
|
148
|
+
value: args.picklistValues.map(pv => ({
|
|
149
|
+
fullName: pv.label,
|
|
150
|
+
default: pv.isDefault || false,
|
|
151
|
+
label: pv.label,
|
|
152
|
+
})),
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
if (args.type === 'MultiselectPicklist') {
|
|
157
|
+
metadata.visibleLines = 4;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const result = await conn.metadata.create('CustomField', metadata);
|
|
161
|
+
if (!result.success) {
|
|
162
|
+
return toolResponse(`Failed to create field: ${formatMetadataErrors(result)}`, true);
|
|
163
|
+
}
|
|
164
|
+
// Wait for field to propagate then grant FLS
|
|
165
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
166
|
+
const profiles = args.grantAccessTo || ['System Administrator'];
|
|
167
|
+
const flsResults = await grantFieldLevelSecurity(conn, objectName, fieldApiName, profiles);
|
|
168
|
+
return toolResponse(`Field "${fullName}" created successfully.\n\nFLS Results:\n${flsResults.join('\n')}`);
|
|
169
|
+
}
|
|
170
|
+
// Update
|
|
171
|
+
const existing = await conn.metadata.read('CustomField', [fullName]);
|
|
172
|
+
if (!existing || (Array.isArray(existing) && existing.length === 0)) {
|
|
173
|
+
return toolResponse(`Field "${fullName}" not found.`, true);
|
|
174
|
+
}
|
|
175
|
+
const current = Array.isArray(existing) ? existing[0] : existing;
|
|
176
|
+
const updated = { ...current };
|
|
177
|
+
if (args.label)
|
|
178
|
+
updated.label = args.label;
|
|
179
|
+
if (args.description !== undefined)
|
|
180
|
+
updated.description = args.description;
|
|
181
|
+
if (args.required !== undefined)
|
|
182
|
+
updated.required = args.required;
|
|
183
|
+
if (args.picklistValues && args.picklistValues.length > 0) {
|
|
184
|
+
updated.valueSet = {
|
|
185
|
+
valueSetDefinition: {
|
|
186
|
+
sorted: false,
|
|
187
|
+
value: args.picklistValues.map(pv => ({
|
|
188
|
+
fullName: pv.label,
|
|
189
|
+
default: pv.isDefault || false,
|
|
190
|
+
label: pv.label,
|
|
191
|
+
})),
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
const result = await conn.metadata.update('CustomField', updated);
|
|
196
|
+
if (result.success) {
|
|
197
|
+
return toolResponse(`Field "${fullName}" updated successfully.`);
|
|
198
|
+
}
|
|
199
|
+
return toolResponse(`Failed to update field: ${formatMetadataErrors(result)}`, true);
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
return toolResponse(`Field ${operation} failed: ${error.message}`, true);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
export const fieldManagementSchema = {
|
|
206
|
+
operation: z.enum(['create', 'update']),
|
|
207
|
+
objectName: z.string().describe('The parent object API name (e.g., "Account", "MyObject__c").'),
|
|
208
|
+
fieldName: z.string().describe('Field name without __c suffix.'),
|
|
209
|
+
label: z.string().describe('Field label (required for create).').optional(),
|
|
210
|
+
type: z.enum(['Checkbox', 'Currency', 'Date', 'DateTime', 'Email', 'Number', 'Percent', 'Phone', 'Picklist', 'MultiselectPicklist', 'Text', 'TextArea', 'LongTextArea', 'Html', 'Url', 'Lookup', 'MasterDetail']).describe('Field type (required for create).').optional(),
|
|
211
|
+
required: z.boolean().describe('Whether the field is required.').optional(),
|
|
212
|
+
unique: z.boolean().describe('Whether values must be unique.').optional(),
|
|
213
|
+
externalId: z.boolean().describe('Whether this is an external ID field.').optional(),
|
|
214
|
+
length: z.number().describe('For Text fields. Default: 255.').optional(),
|
|
215
|
+
precision: z.number().describe('For Number fields. Total digits.').optional(),
|
|
216
|
+
scale: z.number().describe('For Number fields. Decimal places. Default: 0.').optional(),
|
|
217
|
+
referenceTo: z.string().describe('For Lookup/MasterDetail: target object API name.').optional(),
|
|
218
|
+
relationshipLabel: z.string().describe('For Lookup/MasterDetail: child relationship label.').optional(),
|
|
219
|
+
relationshipName: z.string().describe('For Lookup/MasterDetail: child relationship name.').optional(),
|
|
220
|
+
deleteConstraint: z.string().describe('For Lookup: SetNull, Restrict, or Cascade.').optional(),
|
|
221
|
+
picklistValues: z.array(z.object({
|
|
222
|
+
label: z.string(),
|
|
223
|
+
isDefault: z.boolean().optional(),
|
|
224
|
+
})).describe('For Picklist/MultiselectPicklist fields.').optional(),
|
|
225
|
+
description: z.string().optional(),
|
|
226
|
+
grantAccessTo: z.array(z.string()).describe('Profile names to grant FLS to after creation. Default: ["System Administrator"].').optional(),
|
|
227
|
+
};
|
|
228
|
+
export const fieldManagementDescriptor = {
|
|
229
|
+
name: 'salesforce_manage_field',
|
|
230
|
+
description: fieldManagementTool.description,
|
|
231
|
+
schema: fieldManagementSchema,
|
|
232
|
+
handler: handleFieldManagement,
|
|
233
|
+
};
|
|
234
|
+
//# sourceMappingURL=fieldManagement.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AC,QAAQ,EAAE;IAC9F,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KAClC,CAAC,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC,CAAC,QAAQ,EAAE;IACnE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,kFAAkF,CAAC,CAAC,QAAQ,EAAE;CAC3I,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,mBAAmB,CAAC,WAAW;IAC5C,MAAM,EAAE,qBAAqB;IAC7B,OAAO,EAAE,qBAAqB;CAC/B,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Connection } from 'jsforce';
|
|
2
|
+
import { z } from 'zod/v4';
|
|
3
|
+
export declare const fieldPermissionsTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {
|
|
9
|
+
operation: {
|
|
10
|
+
type: string;
|
|
11
|
+
enum: string[];
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
objectName: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
fieldName: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
profileNames: {
|
|
23
|
+
type: string;
|
|
24
|
+
items: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
permissionSetNames: {
|
|
30
|
+
type: string;
|
|
31
|
+
items: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
readable: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
editable: {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
required: string[];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export interface FieldPermissionsArgs {
|
|
49
|
+
operation: 'grant' | 'revoke' | 'list';
|
|
50
|
+
objectName: string;
|
|
51
|
+
fieldName: string;
|
|
52
|
+
profileNames?: string[];
|
|
53
|
+
permissionSetNames?: string[];
|
|
54
|
+
readable?: boolean;
|
|
55
|
+
editable?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare function handleFieldPermissions(conn: Connection, args: FieldPermissionsArgs): Promise<{
|
|
58
|
+
content: {
|
|
59
|
+
type: "text";
|
|
60
|
+
text: string;
|
|
61
|
+
}[];
|
|
62
|
+
isError: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
export declare const fieldPermissionsSchema: {
|
|
65
|
+
operation: z.ZodEnum<{
|
|
66
|
+
grant: "grant";
|
|
67
|
+
revoke: "revoke";
|
|
68
|
+
list: "list";
|
|
69
|
+
}>;
|
|
70
|
+
objectName: z.ZodString;
|
|
71
|
+
fieldName: z.ZodString;
|
|
72
|
+
profileNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
73
|
+
permissionSetNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
74
|
+
readable: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
editable: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
};
|
|
77
|
+
export declare const fieldPermissionsDescriptor: {
|
|
78
|
+
name: string;
|
|
79
|
+
description: string;
|
|
80
|
+
schema: {
|
|
81
|
+
operation: z.ZodEnum<{
|
|
82
|
+
grant: "grant";
|
|
83
|
+
revoke: "revoke";
|
|
84
|
+
list: "list";
|
|
85
|
+
}>;
|
|
86
|
+
objectName: z.ZodString;
|
|
87
|
+
fieldName: z.ZodString;
|
|
88
|
+
profileNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
89
|
+
permissionSetNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
90
|
+
readable: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
editable: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
+
};
|
|
93
|
+
handler: typeof handleFieldPermissions;
|
|
94
|
+
};
|