@acquis-consulting/asm 1.0.10 → 1.0.12
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 +43 -16
- package/dist/index.js.map +1 -1
- package/dist/tools/appTabManagement.d.ts +57 -0
- package/dist/tools/appTabManagement.js +124 -0
- package/dist/tools/appTabManagement.js.map +1 -0
- package/dist/tools/createRecordPage.d.ts +219 -0
- package/dist/tools/createRecordPage.js +368 -0
- package/dist/tools/createRecordPage.js.map +1 -0
- package/dist/tools/debugLogs.d.ts +7 -0
- package/dist/tools/debugLogs.js +10 -2
- package/dist/tools/debugLogs.js.map +1 -1
- package/dist/tools/downloadFiles.d.ts +87 -0
- package/dist/tools/downloadFiles.js +1 -0
- package/dist/tools/executeAnonymous.js +3 -3
- package/dist/tools/executeAnonymous.js.map +1 -1
- package/dist/tools/fieldManagement.d.ts +7 -0
- package/dist/tools/fieldManagement.js +9 -0
- package/dist/tools/fieldManagement.js.map +1 -1
- package/dist/tools/metadataRead.js +13 -2
- package/dist/tools/metadataRead.js.map +1 -1
- package/dist/tools/objectManagement.d.ts +7 -0
- package/dist/tools/objectManagement.js +60 -3
- package/dist/tools/objectManagement.js.map +1 -1
- package/dist/tools/readApexClasses.js +4 -1
- package/dist/tools/readApexClasses.js.map +1 -1
- package/dist/tools/readApexTriggers.js +4 -1
- package/dist/tools/readApexTriggers.js.map +1 -1
- package/dist/utils/connection.js +6 -4
- package/dist/utils/connection.js.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/logCompressor.d.ts +1 -0
- package/dist/utils/logCompressor.js +55 -0
- package/dist/utils/logCompressor.js.map +1 -0
- package/dist/utils/orgGuard.d.ts +2 -0
- package/dist/utils/orgGuard.js +25 -0
- package/dist/utils/orgGuard.js.map +1 -0
- package/dist/utils/relatedComponents.d.ts +16 -0
- package/dist/utils/relatedComponents.js +149 -0
- package/dist/utils/relatedComponents.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 { assertWriteAllowed } from './utils/orgGuard.js';
|
|
9
10
|
import { objectSearchDescriptor } from './tools/objectSearch.js';
|
|
10
11
|
import { objectSchemaDescriptor } from './tools/objectSchema.js';
|
|
11
12
|
import { recordQueryDescriptor } from './tools/recordQuery.js';
|
|
@@ -46,29 +47,22 @@ import { retrieveJobStatusDescriptor } from './tools/retrieveJobStatus.js';
|
|
|
46
47
|
import { objectPermissionsDescriptor } from './tools/objectPermissions.js';
|
|
47
48
|
import { userPermissionsDescriptor } from './tools/userPermissions.js';
|
|
48
49
|
import { listUserPermissionsDescriptor } from './tools/listUserPermissions.js';
|
|
50
|
+
import { createRecordPageDescriptor } from './tools/createRecordPage.js';
|
|
51
|
+
import { appTabManagementDescriptor } from './tools/appTabManagement.js';
|
|
49
52
|
const DIST_DIR = import.meta.filename?.endsWith('.ts')
|
|
50
53
|
? path.join(import.meta.dirname, '..', 'dist')
|
|
51
54
|
: import.meta.dirname;
|
|
52
55
|
const server = new McpServer({ name: 'acquis-salesforce-mcp', version: '1.0.0' });
|
|
53
|
-
//
|
|
54
|
-
const
|
|
56
|
+
// Read-only tools — safe on any org
|
|
57
|
+
const readTools = [
|
|
55
58
|
objectSearchDescriptor,
|
|
56
59
|
objectSchemaDescriptor,
|
|
57
60
|
recordQueryDescriptor,
|
|
58
61
|
aggregateQueryDescriptor,
|
|
59
|
-
dmlDescriptor,
|
|
60
|
-
objectManagementDescriptor,
|
|
61
|
-
fieldManagementDescriptor,
|
|
62
|
-
fieldPermissionsDescriptor,
|
|
63
62
|
crossObjectSearchDescriptor,
|
|
64
63
|
readApexClassesDescriptor,
|
|
65
|
-
writeApexClassesDescriptor,
|
|
66
64
|
readApexTriggersDescriptor,
|
|
67
|
-
writeApexTriggersDescriptor,
|
|
68
|
-
executeAnonymousDescriptor,
|
|
69
|
-
debugLogsDescriptor,
|
|
70
65
|
toolingQueryDescriptor,
|
|
71
|
-
bulkExportStartDescriptor,
|
|
72
66
|
bulkExportStatusDescriptor,
|
|
73
67
|
bulkExportResultsDescriptor,
|
|
74
68
|
bulkExportAbortDescriptor,
|
|
@@ -76,16 +70,30 @@ const connectedTools = [
|
|
|
76
70
|
metadataListDescriptor,
|
|
77
71
|
metadataReadDescriptor,
|
|
78
72
|
metadataTypeSchemaDescriptor,
|
|
79
|
-
metadataImportDescriptor,
|
|
80
73
|
getDependenciesDescriptor,
|
|
81
|
-
//dmlDeleteDescriptor,
|
|
82
74
|
retrieveMetadataDescriptor,
|
|
83
75
|
//deployMetadataDescriptor,
|
|
84
76
|
//deployJobStatusDescriptor,
|
|
85
77
|
retrieveJobStatusDescriptor,
|
|
78
|
+
listUserPermissionsDescriptor,
|
|
79
|
+
];
|
|
80
|
+
// Write tools — blocked on production orgs unless ALLOW_PRODUCTION_WRITES=true
|
|
81
|
+
const writeTools = [
|
|
82
|
+
dmlDescriptor,
|
|
83
|
+
//dmlDeleteDescriptor,
|
|
84
|
+
objectManagementDescriptor,
|
|
85
|
+
fieldManagementDescriptor,
|
|
86
|
+
fieldPermissionsDescriptor,
|
|
87
|
+
writeApexClassesDescriptor,
|
|
88
|
+
writeApexTriggersDescriptor,
|
|
89
|
+
executeAnonymousDescriptor,
|
|
90
|
+
debugLogsDescriptor,
|
|
91
|
+
bulkExportStartDescriptor,
|
|
92
|
+
metadataImportDescriptor,
|
|
86
93
|
objectPermissionsDescriptor,
|
|
87
94
|
userPermissionsDescriptor,
|
|
88
|
-
|
|
95
|
+
createRecordPageDescriptor,
|
|
96
|
+
appTabManagementDescriptor,
|
|
89
97
|
];
|
|
90
98
|
// Tools that don't need a Salesforce connection
|
|
91
99
|
const standaloneTools = [
|
|
@@ -96,8 +104,26 @@ const SESSION_ID_SCHEMA = z
|
|
|
96
104
|
.string()
|
|
97
105
|
.optional()
|
|
98
106
|
.describe('Session ID returned by salesforce_login. Pass this to every Salesforce tool call to authenticate your session.');
|
|
99
|
-
// Register
|
|
100
|
-
for (const tool of
|
|
107
|
+
// Register read-only tools (safe on any org)
|
|
108
|
+
for (const tool of readTools) {
|
|
109
|
+
server.registerTool(tool.name, {
|
|
110
|
+
description: tool.description,
|
|
111
|
+
inputSchema: { ...tool.schema, session_id: SESSION_ID_SCHEMA },
|
|
112
|
+
}, async (args, extra) => {
|
|
113
|
+
const { session_id, ...toolArgs } = args;
|
|
114
|
+
const sessionId = session_id ?? extra?.sessionId;
|
|
115
|
+
console.error(`[session] tool=${tool.name} sessionId=${sessionId ?? '(none)'}`);
|
|
116
|
+
try {
|
|
117
|
+
const conn = await createConnection(undefined, sessionId);
|
|
118
|
+
return tool.handler(conn, toolArgs);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
return toolResponse(`Tool execution failed: ${error.message}`, true);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
// Register write tools (blocked on production orgs unless ALLOW_PRODUCTION_WRITES=true)
|
|
126
|
+
for (const tool of writeTools) {
|
|
101
127
|
server.registerTool(tool.name, {
|
|
102
128
|
description: tool.description,
|
|
103
129
|
inputSchema: { ...tool.schema, session_id: SESSION_ID_SCHEMA },
|
|
@@ -107,6 +133,7 @@ for (const tool of connectedTools) {
|
|
|
107
133
|
console.error(`[session] tool=${tool.name} sessionId=${sessionId ?? '(none)'}`);
|
|
108
134
|
try {
|
|
109
135
|
const conn = await createConnection(undefined, sessionId);
|
|
136
|
+
await assertWriteAllowed(conn, sessionId);
|
|
110
137
|
return tool.handler(conn, toolArgs);
|
|
111
138
|
}
|
|
112
139
|
catch (error) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.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,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,57 @@
|
|
|
1
|
+
import { Connection } from 'jsforce';
|
|
2
|
+
import { z } from 'zod/v4';
|
|
3
|
+
export declare const appTabManagementTool: {
|
|
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
|
+
tabName: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
appNames: {
|
|
19
|
+
type: string;
|
|
20
|
+
items: {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
required: string[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export interface AppTabManagementArgs {
|
|
30
|
+
operation: 'add' | 'remove' | 'list';
|
|
31
|
+
tabName?: string;
|
|
32
|
+
appNames?: string[];
|
|
33
|
+
}
|
|
34
|
+
export declare function handleAppTabManagement(conn: Connection, args: AppTabManagementArgs): Promise<any>;
|
|
35
|
+
export declare const appTabManagementSchema: {
|
|
36
|
+
operation: z.ZodEnum<{
|
|
37
|
+
list: "list";
|
|
38
|
+
add: "add";
|
|
39
|
+
remove: "remove";
|
|
40
|
+
}>;
|
|
41
|
+
tabName: z.ZodOptional<z.ZodString>;
|
|
42
|
+
appNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
+
};
|
|
44
|
+
export declare const appTabManagementDescriptor: {
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
schema: {
|
|
48
|
+
operation: z.ZodEnum<{
|
|
49
|
+
list: "list";
|
|
50
|
+
add: "add";
|
|
51
|
+
remove: "remove";
|
|
52
|
+
}>;
|
|
53
|
+
tabName: z.ZodOptional<z.ZodString>;
|
|
54
|
+
appNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
55
|
+
};
|
|
56
|
+
handler: typeof handleAppTabManagement;
|
|
57
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { toolResponse, formatMetadataErrors } from '../utils/index.js';
|
|
3
|
+
export const appTabManagementTool = {
|
|
4
|
+
name: 'salesforce_manage_app_tabs',
|
|
5
|
+
description: 'Add or remove a tab from one or more Lightning apps (CustomApplication). Use this after creating a custom object tab to make it discoverable in the App Launcher.',
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
operation: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
enum: ['add', 'remove', 'list'],
|
|
12
|
+
description: "'add' = add the tab to the specified apps. 'remove' = remove the tab from the specified apps. 'list' = show the tabs currently in the specified apps.",
|
|
13
|
+
},
|
|
14
|
+
tabName: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: "Tab API name to add or remove. For custom objects include the __c suffix (e.g. 'Music_Artist__c'). Not required for 'list'.",
|
|
17
|
+
},
|
|
18
|
+
appNames: {
|
|
19
|
+
type: 'array',
|
|
20
|
+
items: { type: 'string' },
|
|
21
|
+
description: "List of CustomApplication API names to update (e.g. ['Sales', 'standard__LightningInstrumentation']). Pass an empty array or omit to target ALL apps in the org.",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
required: ['operation'],
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export async function handleAppTabManagement(conn, args) {
|
|
28
|
+
const { operation, tabName, appNames: inputAppNames } = args;
|
|
29
|
+
if (operation !== 'list' && !tabName) {
|
|
30
|
+
return toolResponse(`'tabName' is required for the '${operation}' operation.`, true);
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
// Resolve which apps to work with
|
|
34
|
+
let targetAppNames = inputAppNames ?? [];
|
|
35
|
+
if (targetAppNames.length === 0) {
|
|
36
|
+
// List all apps in the org
|
|
37
|
+
const listed = await conn.metadata.list([{ type: 'CustomApplication' }]);
|
|
38
|
+
const listArr = Array.isArray(listed) ? listed : listed ? [listed] : [];
|
|
39
|
+
targetAppNames = listArr.map((a) => a.fullName).filter(Boolean);
|
|
40
|
+
if (targetAppNames.length === 0) {
|
|
41
|
+
return toolResponse('No CustomApplication records found in this org.');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Read all target apps
|
|
45
|
+
const appsRead = await conn.metadata.read('CustomApplication', targetAppNames);
|
|
46
|
+
const apps = Array.isArray(appsRead) ? appsRead : [appsRead];
|
|
47
|
+
const validApps = apps.filter((a) => a && a.fullName);
|
|
48
|
+
if (validApps.length === 0) {
|
|
49
|
+
return toolResponse(`No apps found for: ${targetAppNames.join(', ')}`, true);
|
|
50
|
+
}
|
|
51
|
+
if (operation === 'list') {
|
|
52
|
+
const lines = validApps.map((app) => {
|
|
53
|
+
const tabs = Array.isArray(app.tabs)
|
|
54
|
+
? app.tabs
|
|
55
|
+
: app.tabs
|
|
56
|
+
? [app.tabs]
|
|
57
|
+
: [];
|
|
58
|
+
return `${app.fullName}: ${tabs.length ? tabs.join(', ') : '(no tabs)'}`;
|
|
59
|
+
});
|
|
60
|
+
return toolResponse(lines.join('\n'));
|
|
61
|
+
}
|
|
62
|
+
// Build updates
|
|
63
|
+
const tab = tabName;
|
|
64
|
+
const updates = validApps.map((app) => {
|
|
65
|
+
let tabs = Array.isArray(app.tabs)
|
|
66
|
+
? [...app.tabs]
|
|
67
|
+
: app.tabs
|
|
68
|
+
? [app.tabs]
|
|
69
|
+
: [];
|
|
70
|
+
if (operation === 'add' && !tabs.includes(tab)) {
|
|
71
|
+
tabs.push(tab);
|
|
72
|
+
}
|
|
73
|
+
else if (operation === 'remove') {
|
|
74
|
+
tabs = tabs.filter((t) => t !== tab);
|
|
75
|
+
}
|
|
76
|
+
return { ...app, tabs };
|
|
77
|
+
});
|
|
78
|
+
const results = await conn.metadata.update('CustomApplication', updates);
|
|
79
|
+
const resultArr = Array.isArray(results) ? results : [results];
|
|
80
|
+
const succeeded = [];
|
|
81
|
+
const failed = [];
|
|
82
|
+
resultArr.forEach((r, i) => {
|
|
83
|
+
const name = validApps[i]?.fullName ?? `app[${i}]`;
|
|
84
|
+
if (r.success) {
|
|
85
|
+
succeeded.push(name);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
failed.push(`${name}: ${formatMetadataErrors(r)}`);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const lines = [];
|
|
92
|
+
if (succeeded.length) {
|
|
93
|
+
lines.push(`Tab "${tab}" ${operation === 'add' ? 'added to' : 'removed from'} ${succeeded.length} app(s): ${succeeded.join(', ')}.`);
|
|
94
|
+
}
|
|
95
|
+
if (failed.length) {
|
|
96
|
+
lines.push(`Failed for ${failed.length} app(s):`);
|
|
97
|
+
lines.push(...failed);
|
|
98
|
+
}
|
|
99
|
+
return toolResponse(lines.join('\n'));
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
return toolResponse(`App tab management failed: ${error.message}`, true);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export const appTabManagementSchema = {
|
|
106
|
+
operation: z
|
|
107
|
+
.enum(['add', 'remove', 'list'])
|
|
108
|
+
.describe("'add' = add the tab to the specified apps. 'remove' = remove the tab from the specified apps. 'list' = show tabs in the specified apps."),
|
|
109
|
+
tabName: z
|
|
110
|
+
.string()
|
|
111
|
+
.optional()
|
|
112
|
+
.describe("Tab API name to add or remove. For custom objects include the __c suffix (e.g. 'Music_Artist__c'). Not required for 'list'."),
|
|
113
|
+
appNames: z
|
|
114
|
+
.array(z.string())
|
|
115
|
+
.optional()
|
|
116
|
+
.describe("List of CustomApplication API names to update. Omit or pass empty array to target ALL apps in the org."),
|
|
117
|
+
};
|
|
118
|
+
export const appTabManagementDescriptor = {
|
|
119
|
+
name: 'salesforce_manage_app_tabs',
|
|
120
|
+
description: appTabManagementTool.description,
|
|
121
|
+
schema: appTabManagementSchema,
|
|
122
|
+
handler: handleAppTabManagement,
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=appTabManagement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appTabManagement.js","sourceRoot":"","sources":["../../src/tools/appTabManagement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,4BAA4B;IAClC,WAAW,EACT,mKAAmK;IACrK,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC;gBAC/B,WAAW,EACT,uJAAuJ;aAC1J;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,6HAA6H;aAChI;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EACT,kKAAkK;aACrK;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;CACF,CAAC;AAQF,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,IAAgB,EAChB,IAA0B;IAE1B,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IAE7D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AC,GAAG,CACzH,CAAC;QACJ,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,MAAM,UAAU,CAAC,CAAC;YAClD,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;QACxB,CAAC;QAED,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,YAAY,CAAC,8BAA8B,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS,EAAE,CAAC;SACT,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;SAC/B,QAAQ,CACP,yIAAyI,CAC1I;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,6HAA6H,CAC9H;IACH,QAAQ,EAAE,CAAC;SACR,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,wGAAwG,CACzG;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,oBAAoB,CAAC,WAAW;IAC7C,MAAM,EAAE,sBAAsB;IAC9B,OAAO,EAAE,sBAAsB;CAChC,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { Connection } from 'jsforce';
|
|
2
|
+
import { z } from 'zod/v4';
|
|
3
|
+
type TemplateName = 'OneColumn' | 'TwoColumn' | 'ThreeColumn' | 'HeaderLeftSidebar';
|
|
4
|
+
type FieldBehavior = 'Readonly' | 'Edit' | 'Required';
|
|
5
|
+
type StandardComponent = 'highlights' | 'activity' | 'chatter';
|
|
6
|
+
interface FieldSpec {
|
|
7
|
+
apiName: string;
|
|
8
|
+
behavior?: FieldBehavior;
|
|
9
|
+
}
|
|
10
|
+
interface SectionSpec {
|
|
11
|
+
label: string;
|
|
12
|
+
columns?: 1 | 2 | 3;
|
|
13
|
+
collapsible?: boolean;
|
|
14
|
+
fields: FieldSpec[];
|
|
15
|
+
}
|
|
16
|
+
type TabItem = {
|
|
17
|
+
type: 'fieldSection';
|
|
18
|
+
label: string;
|
|
19
|
+
columns?: 1 | 2 | 3;
|
|
20
|
+
collapsible?: boolean;
|
|
21
|
+
fields: FieldSpec[];
|
|
22
|
+
} | {
|
|
23
|
+
type: 'relatedList';
|
|
24
|
+
relationshipName: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'reportChart';
|
|
27
|
+
reportId: string;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'standard';
|
|
30
|
+
component: StandardComponent;
|
|
31
|
+
};
|
|
32
|
+
interface TabSpec {
|
|
33
|
+
label: string;
|
|
34
|
+
items: TabItem[];
|
|
35
|
+
}
|
|
36
|
+
export interface CreateRecordPageArgs {
|
|
37
|
+
pageName: string;
|
|
38
|
+
masterLabel: string;
|
|
39
|
+
sobjectType: string;
|
|
40
|
+
template: TemplateName;
|
|
41
|
+
sections: SectionSpec[];
|
|
42
|
+
relatedLists?: string[];
|
|
43
|
+
relatedListsPlacement?: 'main' | 'right';
|
|
44
|
+
tabs?: TabSpec[];
|
|
45
|
+
setAsAdminDefault?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare const createRecordPageTool: {
|
|
48
|
+
name: string;
|
|
49
|
+
description: string;
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: "object";
|
|
52
|
+
properties: {
|
|
53
|
+
pageName: {
|
|
54
|
+
type: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
masterLabel: {
|
|
58
|
+
type: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
sobjectType: {
|
|
62
|
+
type: string;
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
template: {
|
|
66
|
+
type: string;
|
|
67
|
+
enum: string[];
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
70
|
+
sections: {
|
|
71
|
+
type: string;
|
|
72
|
+
description: string;
|
|
73
|
+
};
|
|
74
|
+
tabs: {
|
|
75
|
+
type: string;
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
setAsAdminDefault: {
|
|
79
|
+
type: string;
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
required: string[];
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export declare const createRecordPageSchema: {
|
|
87
|
+
pageName: z.ZodString;
|
|
88
|
+
masterLabel: z.ZodString;
|
|
89
|
+
sobjectType: z.ZodString;
|
|
90
|
+
template: z.ZodEnum<{
|
|
91
|
+
OneColumn: "OneColumn";
|
|
92
|
+
TwoColumn: "TwoColumn";
|
|
93
|
+
ThreeColumn: "ThreeColumn";
|
|
94
|
+
HeaderLeftSidebar: "HeaderLeftSidebar";
|
|
95
|
+
}>;
|
|
96
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
97
|
+
label: z.ZodString;
|
|
98
|
+
columns: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
99
|
+
collapsible: z.ZodOptional<z.ZodBoolean>;
|
|
100
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
101
|
+
apiName: z.ZodString;
|
|
102
|
+
behavior: z.ZodOptional<z.ZodEnum<{
|
|
103
|
+
Edit: "Edit";
|
|
104
|
+
Readonly: "Readonly";
|
|
105
|
+
Required: "Required";
|
|
106
|
+
}>>;
|
|
107
|
+
}, z.core.$strip>>;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
relatedLists: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
110
|
+
relatedListsPlacement: z.ZodOptional<z.ZodEnum<{
|
|
111
|
+
main: "main";
|
|
112
|
+
right: "right";
|
|
113
|
+
}>>;
|
|
114
|
+
tabs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
115
|
+
label: z.ZodString;
|
|
116
|
+
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
117
|
+
type: z.ZodLiteral<"fieldSection">;
|
|
118
|
+
label: z.ZodString;
|
|
119
|
+
columns: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
120
|
+
collapsible: z.ZodOptional<z.ZodBoolean>;
|
|
121
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
122
|
+
apiName: z.ZodString;
|
|
123
|
+
behavior: z.ZodOptional<z.ZodEnum<{
|
|
124
|
+
Edit: "Edit";
|
|
125
|
+
Readonly: "Readonly";
|
|
126
|
+
Required: "Required";
|
|
127
|
+
}>>;
|
|
128
|
+
}, z.core.$strip>>;
|
|
129
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
130
|
+
type: z.ZodLiteral<"relatedList">;
|
|
131
|
+
relationshipName: z.ZodString;
|
|
132
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
133
|
+
type: z.ZodLiteral<"reportChart">;
|
|
134
|
+
reportId: z.ZodString;
|
|
135
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
136
|
+
type: z.ZodLiteral<"standard">;
|
|
137
|
+
component: z.ZodEnum<{
|
|
138
|
+
highlights: "highlights";
|
|
139
|
+
activity: "activity";
|
|
140
|
+
chatter: "chatter";
|
|
141
|
+
}>;
|
|
142
|
+
}, z.core.$strip>], "type">>;
|
|
143
|
+
}, z.core.$strip>>>;
|
|
144
|
+
setAsAdminDefault: z.ZodOptional<z.ZodBoolean>;
|
|
145
|
+
};
|
|
146
|
+
export declare function buildFlexiPageMetadata(args: CreateRecordPageArgs): any;
|
|
147
|
+
export declare function handleCreateRecordPage(conn: Connection, args: CreateRecordPageArgs): Promise<{
|
|
148
|
+
content: {
|
|
149
|
+
type: "text";
|
|
150
|
+
text: string;
|
|
151
|
+
}[];
|
|
152
|
+
isError: boolean;
|
|
153
|
+
}>;
|
|
154
|
+
export declare const createRecordPageDescriptor: {
|
|
155
|
+
name: string;
|
|
156
|
+
description: string;
|
|
157
|
+
schema: {
|
|
158
|
+
pageName: z.ZodString;
|
|
159
|
+
masterLabel: z.ZodString;
|
|
160
|
+
sobjectType: z.ZodString;
|
|
161
|
+
template: z.ZodEnum<{
|
|
162
|
+
OneColumn: "OneColumn";
|
|
163
|
+
TwoColumn: "TwoColumn";
|
|
164
|
+
ThreeColumn: "ThreeColumn";
|
|
165
|
+
HeaderLeftSidebar: "HeaderLeftSidebar";
|
|
166
|
+
}>;
|
|
167
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
168
|
+
label: z.ZodString;
|
|
169
|
+
columns: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
170
|
+
collapsible: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
172
|
+
apiName: z.ZodString;
|
|
173
|
+
behavior: z.ZodOptional<z.ZodEnum<{
|
|
174
|
+
Edit: "Edit";
|
|
175
|
+
Readonly: "Readonly";
|
|
176
|
+
Required: "Required";
|
|
177
|
+
}>>;
|
|
178
|
+
}, z.core.$strip>>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
relatedLists: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
181
|
+
relatedListsPlacement: z.ZodOptional<z.ZodEnum<{
|
|
182
|
+
main: "main";
|
|
183
|
+
right: "right";
|
|
184
|
+
}>>;
|
|
185
|
+
tabs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
186
|
+
label: z.ZodString;
|
|
187
|
+
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
188
|
+
type: z.ZodLiteral<"fieldSection">;
|
|
189
|
+
label: z.ZodString;
|
|
190
|
+
columns: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
191
|
+
collapsible: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
193
|
+
apiName: z.ZodString;
|
|
194
|
+
behavior: z.ZodOptional<z.ZodEnum<{
|
|
195
|
+
Edit: "Edit";
|
|
196
|
+
Readonly: "Readonly";
|
|
197
|
+
Required: "Required";
|
|
198
|
+
}>>;
|
|
199
|
+
}, z.core.$strip>>;
|
|
200
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
201
|
+
type: z.ZodLiteral<"relatedList">;
|
|
202
|
+
relationshipName: z.ZodString;
|
|
203
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
204
|
+
type: z.ZodLiteral<"reportChart">;
|
|
205
|
+
reportId: z.ZodString;
|
|
206
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
207
|
+
type: z.ZodLiteral<"standard">;
|
|
208
|
+
component: z.ZodEnum<{
|
|
209
|
+
highlights: "highlights";
|
|
210
|
+
activity: "activity";
|
|
211
|
+
chatter: "chatter";
|
|
212
|
+
}>;
|
|
213
|
+
}, z.core.$strip>], "type">>;
|
|
214
|
+
}, z.core.$strip>>>;
|
|
215
|
+
setAsAdminDefault: z.ZodOptional<z.ZodBoolean>;
|
|
216
|
+
};
|
|
217
|
+
handler: typeof handleCreateRecordPage;
|
|
218
|
+
};
|
|
219
|
+
export {};
|