salesforce-metadata-mcp 2.1.4 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -899,6 +899,12 @@ export const CreateAgentPlannerSchema = z.object({
899
899
  topicNames: z.array(z.string().min(1).max(80)).min(1).describe("Topic API names (GenAiPlugin developer names) to include, e.g. ['Create_Account_Topic', 'Create_Lead_Topic']. Topics must already exist."),
900
900
  dataLibraryName: z.string().max(80).optional().describe("API name of a Data Library (Knowledge Base) to attach to this planner for Knowledge-grounded agents."),
901
901
  }).strict();
902
+ export const ActivateAgentSchema = z.object({
903
+ agentApiName: z.string().min(1).max(80).describe("API name of the agent to activate, e.g. 'CRM_Record_Creator'"),
904
+ }).strict();
905
+ export const DeactivateAgentSchema = z.object({
906
+ agentApiName: z.string().min(1).max(80).describe("API name of the agent to deactivate, e.g. 'CRM_Record_Creator'"),
907
+ }).strict();
902
908
  export const GetAgentSchema = z.object({
903
909
  agentApiName: z.string().min(1).max(80).describe("Agent API name, e.g. 'CRM_Record_Creator'"),
904
910
  }).strict();
@@ -1032,11 +1038,379 @@ export const DeployMetadataSchema = z.object({
1032
1038
  runTests: z.array(z.string()).optional().describe("Test classes to run during deployment"),
1033
1039
  rollbackOnError: z.boolean().default(true).describe("Roll back all changes if any component fails"),
1034
1040
  waitMinutes: z.number().int().min(1).max(60).default(10).describe("Max minutes to wait for deploy to complete"),
1041
+ testLevel: z.enum(["NoTestRun","RunSpecifiedTests","RunLocalTests","RunAllTestsInOrg"]).optional().describe("Test level: NoTestRun, RunSpecifiedTests, RunLocalTests, or RunAllTestsInOrg"),
1035
1042
  }).strict();
1036
1043
  export const CheckDeployStatusSchema = z.object({
1037
1044
  deployId: z.string().min(1).describe("Deploy async job ID returned from sf_deploy_metadata"),
1038
1045
  }).strict();
1039
1046
  export const RetrieveMetadataSchema = z.object({
1040
1047
  components: z.array(ComponentRefSchema).min(1).describe("Metadata components to retrieve"),
1048
+ packageXml: z.string().optional().describe("Raw package.xml content for selective retrieve. If provided, components list is ignored."),
1049
+ }).strict();
1050
+ // ─── OBJECTS & FIELDS (v2.2.0) ───────────────────────────────────────────────
1051
+ export const UpdateCustomObjectSchema = z.object({
1052
+ objectApiName: z.string().min(1).describe("Custom object API name, e.g. 'MyObject__c'"),
1053
+ label: z.string().optional().describe("New singular label"),
1054
+ pluralLabel: z.string().optional().describe("New plural label"),
1055
+ description: z.string().optional().describe("New description"),
1056
+ enableHistory: z.boolean().optional().describe("Enable field history tracking"),
1057
+ enableReports: z.boolean().optional().describe("Allow in reports"),
1058
+ enableSearch: z.boolean().optional().describe("Allow in search"),
1059
+ enableActivities: z.boolean().optional().describe("Enable activities (tasks and events)"),
1060
+ }).strict();
1061
+ export const UpdateCustomFieldSchema = z.object({
1062
+ objectApiName: z.string().min(1).describe("Object API name, e.g. 'Account'"),
1063
+ fieldApiName: z.string().min(1).describe("Field API name, e.g. 'MyField__c'"),
1064
+ label: z.string().optional().describe("New field label"),
1065
+ description: z.string().optional().describe("New description"),
1066
+ helpText: z.string().optional().describe("New inline help text"),
1067
+ required: z.boolean().optional().describe("Make field required"),
1068
+ unique: z.boolean().optional().describe("Enforce uniqueness"),
1069
+ defaultValue: z.string().optional().describe("New default value"),
1070
+ }).strict();
1071
+ export const CreateRelationshipFieldSchema = z.object({
1072
+ objectApiName: z.string().min(1).describe("Object API name to create the field on, e.g. 'Contact'"),
1073
+ fieldName: z.string().min(1).max(40).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Field name without __c suffix, e.g. 'Account'"),
1074
+ label: z.string().min(1).describe("Field label"),
1075
+ relationshipType: z.enum(["Lookup","MasterDetail"]).describe("Lookup: optional reference field. MasterDetail: required parent-child relationship (child deleted with parent)."),
1076
+ relatedObject: z.string().min(1).describe("API name of the related (parent) object, e.g. 'Account'"),
1077
+ relationshipName: z.string().min(1).describe("Relationship API name used in SOQL, e.g. 'Account' (no spaces or double underscores)"),
1078
+ onDelete: z.enum(["SetNull","Restrict"]).default("SetNull").describe("Lookup only — what happens to child when parent is deleted: SetNull (clears field) or Restrict (blocks deletion)"),
1079
+ required: z.boolean().default(false).describe("Make field required (Lookup only; MasterDetail is always required)"),
1080
+ description: z.string().optional().describe("Field description"),
1081
+ }).strict();
1082
+ export const CreateFormulaFieldSchema = z.object({
1083
+ objectApiName: z.string().min(1).describe("Object API name, e.g. 'Opportunity'"),
1084
+ fieldName: z.string().min(1).max(40).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Field name without __c suffix"),
1085
+ label: z.string().min(1).describe("Field label"),
1086
+ returnType: z.enum(["Text","Number","Currency","Date","DateTime","Checkbox","Percent"]).describe("Formula return type"),
1087
+ formula: z.string().min(1).describe("Salesforce formula expression, e.g. 'MONTH(TODAY())' or 'Price__c * Quantity__c'"),
1088
+ scale: z.number().int().min(0).max(18).optional().describe("Decimal places for Number/Currency/Percent return types"),
1089
+ description: z.string().optional().describe("Field description"),
1090
+ }).strict();
1091
+ // ─── SECURITY & PERMISSIONS (v2.2.0) ─────────────────────────────────────────
1092
+ export const AssignPermissionSetSchema = z.object({
1093
+ permissionSetName: z.string().min(1).describe("Permission Set API name, e.g. 'Sales_Rep_PS'"),
1094
+ username: z.string().optional().describe("Username (email) of the user to assign to. Provide username OR userId."),
1095
+ userId: z.string().optional().describe("Salesforce User ID (15 or 18 char). Provide username OR userId."),
1096
+ }).strict();
1097
+ export const CreatePermissionSetGroupSchema = z.object({
1098
+ groupName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Permission Set Group API name"),
1099
+ label: z.string().min(1).describe("Display label"),
1100
+ description: z.string().optional().describe("Description"),
1101
+ permissionSets: z.array(z.string().min(1)).min(1).describe("Array of Permission Set API names to include in this group"),
1102
+ }).strict();
1103
+ const ObjPermSchema = z.object({
1104
+ object: z.string().min(1).describe("Object API name, e.g. 'Account'"),
1105
+ read: z.boolean().default(false),
1106
+ create: z.boolean().default(false),
1107
+ edit: z.boolean().default(false),
1108
+ delete: z.boolean().default(false),
1109
+ viewAll: z.boolean().default(false),
1110
+ modifyAll: z.boolean().default(false),
1111
+ });
1112
+ const FldPermSchema = z.object({
1113
+ field: z.string().min(1).describe("Field in Object.Field format, e.g. 'Account.AnnualRevenue'"),
1114
+ readable: z.boolean().default(true),
1115
+ editable: z.boolean().default(false),
1116
+ });
1117
+ export const UpdatePermissionSetSchema = z.object({
1118
+ permissionSetName: z.string().min(1).describe("Existing Permission Set API name to update"),
1119
+ objectPermissions: z.array(ObjPermSchema).optional().describe("Object permissions to set. Replaces existing permissions for specified objects."),
1120
+ fieldPermissions: z.array(FldPermSchema).optional().describe("Field-level security to set. Replaces existing FLS for specified fields."),
1121
+ }).strict();
1122
+ export const CreateMutingPermissionSetSchema = z.object({
1123
+ mutingPermSetName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Muting Permission Set API name"),
1124
+ label: z.string().min(1).describe("Display label"),
1125
+ permissionSetGroup: z.string().optional().describe("Permission Set Group API name to add this muting perm set to"),
1126
+ objectPermissions: z.array(ObjPermSchema).optional().describe("Object permissions to mute (suppress)"),
1127
+ fieldPermissions: z.array(FldPermSchema).optional().describe("Field permissions to mute"),
1128
+ }).strict();
1129
+ export const SetFieldLevelSecuritySchema = z.object({
1130
+ fieldApiName: z.string().min(1).describe("Field in Object.Field format, e.g. 'Account.AnnualRevenue'"),
1131
+ profiles: z.array(z.string()).optional().describe("Profile API names to update FLS for"),
1132
+ permissionSets: z.array(z.string()).optional().describe("Permission Set API names to update FLS for"),
1133
+ readable: z.boolean().describe("Grant read access to this field"),
1134
+ editable: z.boolean().describe("Grant edit access to this field (read is implied if editable)"),
1135
+ }).strict();
1136
+ export const SetOrgWideDefaultsSchema = z.object({
1137
+ objectApiName: z.string().min(1).describe("Object API name, e.g. 'Opportunity__c'. For standard objects like Account, use the object API name."),
1138
+ defaultInternal: z.enum(["Private","PublicRead","PublicReadWrite","ControlledByParent"]).describe("Internal org-wide default sharing model"),
1139
+ defaultExternal: z.enum(["Private","PublicRead","PublicReadWrite","ControlledByParent"]).optional().describe("External org-wide default (for orgs with external sharing model enabled)"),
1140
+ }).strict();
1141
+ export const CreateProfileSchema = z.object({
1142
+ profileName: z.string().min(1).max(80).describe("New profile API name"),
1143
+ label: z.string().min(1).describe("New profile display label"),
1144
+ cloneFrom: z.string().min(1).describe("API name of existing profile to clone, e.g. 'Standard User'"),
1145
+ }).strict();
1146
+ const ProfileObjPermSchema = z.object({
1147
+ object: z.string().min(1).describe("Object API name"),
1148
+ allowCreate: z.boolean().default(false),
1149
+ allowDelete: z.boolean().default(false),
1150
+ allowEdit: z.boolean().default(false),
1151
+ allowRead: z.boolean().default(true),
1152
+ viewAllRecords: z.boolean().default(false),
1153
+ modifyAllRecords: z.boolean().default(false),
1154
+ });
1155
+ export const UpdateProfileSchema = z.object({
1156
+ profileName: z.string().min(1).describe("Profile API name to update"),
1157
+ objectPermissions: z.array(ProfileObjPermSchema).optional().describe("Object permissions to set"),
1158
+ fieldPermissions: z.array(FldPermSchema).optional().describe("Field-level security to set"),
1159
+ tabVisibilities: z.array(z.object({ tab: z.string(), visibility: z.enum(["DefaultOn","DefaultOff","Hidden"]) })).optional().describe("Tab visibility settings"),
1160
+ applicationVisibilities: z.array(z.object({ application: z.string(), visible: z.boolean(), default: z.boolean().default(false) })).optional().describe("App visibility settings"),
1161
+ }).strict();
1162
+ // ─── PAGE LAYOUTS & UI (v2.2.0) ──────────────────────────────────────────────
1163
+ export const UpdatePageLayoutSchema = z.object({
1164
+ layoutName: z.string().min(1).describe("Layout full name in 'Object-Layout Name' format, e.g. 'Account-Account Layout'"),
1165
+ fieldsToAdd: z.array(z.object({ field: z.string(), section: z.string().optional(), column: z.number().int().min(0).max(1).default(0) })).optional().describe("Fields to add to the layout"),
1166
+ fieldsToRemove: z.array(z.string()).optional().describe("Field API names to remove from the layout"),
1167
+ relatedListsToAdd: z.array(z.string()).optional().describe("Related list API names to add, e.g. 'Contacts'"),
1168
+ relatedListsToRemove: z.array(z.string()).optional().describe("Related list API names to remove"),
1169
+ buttonsToAdd: z.array(z.string()).optional().describe("Custom button names to add to the layout"),
1170
+ }).strict();
1171
+ export const AssignPageLayoutSchema = z.object({
1172
+ objectApiName: z.string().min(1).describe("Object API name, e.g. 'Account'"),
1173
+ layoutName: z.string().min(1).describe("Layout name (without object prefix), e.g. 'Account Layout'"),
1174
+ profileName: z.string().min(1).describe("Profile API name to assign the layout to"),
1175
+ recordTypeName: z.string().optional().describe("Record type developer name (if assigning to a specific record type)"),
1176
+ }).strict();
1177
+ const FlexiComponentSchema = z.object({
1178
+ componentName: z.string().describe("LWC or Aura component API name, e.g. 'flexipage:recordDetail'"),
1179
+ region: z.string().describe("Page region, e.g. 'main', 'sidebar', 'left', 'center', 'right'"),
1180
+ order: z.number().int().optional().describe("Component order within region (0-based)"),
1181
+ properties: z.record(z.unknown()).optional().describe("Component property values"),
1182
+ });
1183
+ export const CreateLightningRecordPageSchema = z.object({
1184
+ pageName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("FlexiPage API name"),
1185
+ label: z.string().min(1).describe("Page display label"),
1186
+ objectApiName: z.string().min(1).describe("Object API name for the record page"),
1187
+ template: z.enum(["HeaderAndRightSidebar","HeaderAndThreeRegions","MosaicTemplate","FullWidth","LeftSidebar"]).default("HeaderAndRightSidebar").describe("Page template"),
1188
+ components: z.array(FlexiComponentSchema).optional().describe("Components to add to the page"),
1189
+ }).strict();
1190
+ export const CreateLightningHomePageSchema = z.object({
1191
+ pageName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("FlexiPage API name"),
1192
+ label: z.string().min(1).describe("Page display label"),
1193
+ template: z.string().default("Home").describe("Page template name"),
1194
+ components: z.array(FlexiComponentSchema).optional().describe("Components to add to the page"),
1195
+ }).strict();
1196
+ export const UpdateLightningPageSchema = z.object({
1197
+ pageApiName: z.string().min(1).describe("FlexiPage API name to update"),
1198
+ componentsToAdd: z.array(FlexiComponentSchema).optional().describe("Components to add"),
1199
+ componentsToRemove: z.array(z.string()).optional().describe("Component names to remove"),
1200
+ }).strict();
1201
+ export const AssignLightningPageSchema = z.object({
1202
+ pageApiName: z.string().min(1).describe("FlexiPage API name to assign"),
1203
+ assignmentType: z.enum(["org","app","recordType"]).describe("Assignment scope"),
1204
+ appName: z.string().optional().describe("Lightning App API name (required for app assignment)"),
1205
+ recordTypeName: z.string().optional().describe("Record Type developer name (for recordType assignment)"),
1206
+ objectApiName: z.string().optional().describe("Object API name (for record page assignments)"),
1207
+ }).strict();
1208
+ export const AssignCompactLayoutSchema = z.object({
1209
+ objectApiName: z.string().min(1).describe("Object API name, e.g. 'Account'"),
1210
+ compactLayoutName: z.string().min(1).describe("Compact layout API name to assign as default"),
1211
+ recordTypeName: z.string().optional().describe("Record type developer name (if assigning to a specific record type)"),
1212
+ }).strict();
1213
+ // ─── AUTOMATION (v2.2.0) ─────────────────────────────────────────────────────
1214
+ export const ActivateFlowSchema = z.object({
1215
+ flowApiName: z.string().min(1).describe("Flow API name (DeveloperName), e.g. 'My_Flow'"),
1216
+ action: z.enum(["activate","deactivate"]).describe("Whether to activate or deactivate the flow"),
1217
+ versionNumber: z.number().int().optional().describe("Specific version number to activate. Defaults to latest version."),
1218
+ }).strict();
1219
+ export const CreateQuickActionSchema = z.object({
1220
+ actionName: z.string().min(1).describe("Full API name. For object-specific: 'Object.ActionName'. For global: 'ActionName'."),
1221
+ label: z.string().min(1).describe("Action display label"),
1222
+ actionType: z.enum(["Create","Update","LogACall","CustomVF","LightningComponent"]).describe("Action type"),
1223
+ targetObject: z.string().optional().describe("Target object API name for Create/Update actions, e.g. 'Contact'"),
1224
+ targetFields: z.array(z.object({ field: z.string(), value: z.string() })).optional().describe("Pre-populated field values"),
1225
+ standardLabel: z.enum(["None","New","NewEvent","NewTask","LogACall","SendEmail","NewCase","NewOpportunity","NewContact","NewLead","NewNote","NewAccount","ScreenPop"]).optional().describe("Standard action label type"),
1226
+ description: z.string().optional().describe("Action description"),
1227
+ }).strict();
1228
+ // ─── APEX & LWC (v2.2.0) ─────────────────────────────────────────────────────
1229
+ export const UpdateApexClassSchema = z.object({
1230
+ className: z.string().min(1).describe("Apex class API name (without .cls extension)"),
1231
+ body: z.string().min(1).describe("Full updated Apex class source code"),
1232
+ apiVersion: z.string().default("66.0").describe("API version for the class"),
1233
+ }).strict();
1234
+ export const GetApexClassSchema = z.object({
1235
+ className: z.string().min(1).describe("Apex class name to retrieve"),
1236
+ }).strict();
1237
+ export const GetCodeCoverageSchema = z.object({
1238
+ className: z.string().optional().describe("Apex class or trigger name to get coverage for. Omit to get all classes."),
1239
+ }).strict();
1240
+ export const CreateVisualforcePageSchema = z.object({
1241
+ pageName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Visualforce page API name"),
1242
+ label: z.string().min(1).describe("Page label"),
1243
+ markup: z.string().min(1).describe("Full Visualforce page markup (including <apex:page> tag)"),
1244
+ apiVersion: z.string().default("66.0").describe("API version"),
1245
+ availableInTouch: z.boolean().default(false).describe("Make available in Salesforce mobile"),
1246
+ showHeader: z.boolean().default(true).describe("Show Salesforce header"),
1247
+ sidebar: z.boolean().default(true).describe("Show sidebar"),
1248
+ standardStylesheets: z.boolean().default(true).describe("Include standard Salesforce stylesheets"),
1249
+ }).strict();
1250
+ export const CreateAuraComponentSchema = z.object({
1251
+ componentName: z.string().min(1).max(40).regex(/^[A-Za-z][A-Za-z0-9]*$/).describe("Aura component name (camelCase, no underscores)"),
1252
+ description: z.string().optional().describe("Component description"),
1253
+ markup: z.string().min(1).describe("Component markup (.cmp file content, must include <aura:component> tag)"),
1254
+ controller: z.string().optional().describe("Controller JavaScript content"),
1255
+ helper: z.string().optional().describe("Helper JavaScript content"),
1256
+ style: z.string().optional().describe("CSS styles"),
1257
+ isExposed: z.boolean().default(false).describe("Expose component for use in Lightning App Builder"),
1258
+ targets: z.array(z.string()).optional().describe("App Builder targets, e.g. ['lightning__RecordPage', 'lightning__AppPage']"),
1259
+ }).strict();
1260
+ // ─── REPORTS & DASHBOARDS (v2.2.0) ───────────────────────────────────────────
1261
+ const ReportFilterSchema = z.object({
1262
+ field: z.string().describe("Field API name, e.g. 'ACCOUNT_NAME'"),
1263
+ operator: z.enum(["equals","notEqual","lessThan","greaterThan","lessOrEqual","greaterOrEqual","contains","notContain","startsWith","includes","excludes"]).describe("Filter operator"),
1264
+ value: z.string().describe("Filter value"),
1265
+ });
1266
+ export const CreateReportSchema = z.object({
1267
+ reportName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Report API name"),
1268
+ label: z.string().min(1).describe("Report display name"),
1269
+ reportType: z.string().min(1).describe("Report type API name, e.g. 'Account', 'Opportunity', 'AccountList'"),
1270
+ format: z.enum(["Tabular","Summary","Matrix","Joined"]).default("Tabular").describe("Report format"),
1271
+ groupByField: z.string().optional().describe("Field to group by (Summary/Matrix formats)"),
1272
+ columns: z.array(z.string()).min(1).describe("Field API names to include as columns, e.g. ['ACCOUNT_NAME', 'ANNUAL_REVENUE']"),
1273
+ filters: z.array(ReportFilterSchema).optional().describe("Report filters"),
1274
+ description: z.string().optional().describe("Report description"),
1275
+ }).strict();
1276
+ export const UpdateDashboardSchema = z.object({
1277
+ dashboardName: z.string().min(1).describe("Dashboard API name"),
1278
+ componentsToAdd: z.array(z.object({
1279
+ reportName: z.string().describe("Report API name to add as component"),
1280
+ chartType: z.enum(["Donut","Bar","Line","Column","Table","Metric","Gauge","HorizontalBar","Funnel"]).default("Table").describe("Chart type"),
1281
+ title: z.string().describe("Component title"),
1282
+ row: z.number().int().default(0).describe("Row position (0-based)"),
1283
+ column: z.number().int().default(0).describe("Column position (0-based)"),
1284
+ })).optional().describe("Dashboard components to add"),
1285
+ componentsToRemove: z.array(z.string()).optional().describe("Component titles to remove"),
1286
+ }).strict();
1287
+ export const CreateReportFolderSchema = z.object({
1288
+ folderName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Folder API name"),
1289
+ label: z.string().min(1).describe("Folder display name"),
1290
+ folderType: z.enum(["Report","Dashboard"]).describe("Whether this is a report or dashboard folder"),
1291
+ accessType: z.enum(["Hidden","Shared","Public"]).default("Shared").describe("Folder access type"),
1292
+ }).strict();
1293
+ export const ShareReportFolderSchema = z.object({
1294
+ folderName: z.string().min(1).describe("Folder API name to share"),
1295
+ folderType: z.enum(["Report","Dashboard"]).describe("Whether this is a report or dashboard folder"),
1296
+ shareWith: z.array(z.object({
1297
+ type: z.enum(["Role","Group","User","RoleAndSubordinates"]).describe("Sharing target type"),
1298
+ name: z.string().describe("API name/username of the role, group, or user"),
1299
+ accessLevel: z.enum(["View","Edit","Manage"]).default("View").describe("Access level"),
1300
+ })).min(1).describe("Who to share the folder with"),
1301
+ }).strict();
1302
+ // ─── USERS & DATA (v2.2.0) ───────────────────────────────────────────────────
1303
+ export const CreateUserSchema = z.object({
1304
+ firstName: z.string().min(1).describe("First name"),
1305
+ lastName: z.string().min(1).describe("Last name"),
1306
+ email: z.string().email().describe("Email address (also used for notifications)"),
1307
+ username: z.string().email().describe("Unique username (must be email format and unique across all Salesforce orgs)"),
1308
+ alias: z.string().min(1).max(8).describe("User alias (max 8 chars, shown in list views)"),
1309
+ profileName: z.string().min(1).describe("Profile name, e.g. 'Standard User', 'System Administrator'"),
1310
+ roleName: z.string().optional().describe("Role name to assign, e.g. 'CEO'"),
1311
+ timeZone: z.string().default("America/Los_Angeles").describe("Timezone, e.g. 'America/New_York'"),
1312
+ locale: z.string().default("en_US").describe("Locale, e.g. 'en_US'"),
1313
+ emailEncoding: z.string().default("UTF-8").describe("Email encoding"),
1314
+ languageLocale: z.string().default("en_US").describe("Language and locale, e.g. 'en_US'"),
1315
+ }).strict();
1316
+ export const UpdateUserSchema = z.object({
1317
+ username: z.string().min(1).describe("Username to identify the user to update"),
1318
+ profileName: z.string().optional().describe("New profile name"),
1319
+ roleName: z.string().optional().describe("New role name (or empty string to remove role)"),
1320
+ isActive: z.boolean().optional().describe("Activate or deactivate the user"),
1321
+ additionalFields: z.record(z.unknown()).optional().describe("Additional User SObject fields to update, e.g. {Department: 'Sales', Title: 'Manager'}"),
1322
+ }).strict();
1323
+ export const AssignQueueMemberSchema = z.object({
1324
+ queueDeveloperName: z.string().min(1).describe("Queue developer name (DeveloperName field on Group), e.g. 'Support_Tier1'"),
1325
+ users: z.array(z.string()).optional().describe("Usernames to add to the queue"),
1326
+ roles: z.array(z.string()).optional().describe("Role API names to add to the queue (adds all users in the role)"),
1327
+ }).strict();
1328
+ export const CreatePublicGroupSchema = z.object({
1329
+ groupName: z.string().min(1).max(80).describe("Group developer name (no spaces)"),
1330
+ label: z.string().min(1).describe("Group display name"),
1331
+ members: z.array(z.object({
1332
+ type: z.enum(["User","Role","RoleAndSubordinates","Group"]).describe("Member type"),
1333
+ name: z.string().describe("Username, role name, or group developer name"),
1334
+ })).optional().describe("Initial group members"),
1335
+ }).strict();
1336
+ export const QueryRecordsSchema = z.object({
1337
+ query: z.string().min(1).describe("Full SOQL query string, e.g. 'SELECT Id, Name FROM Account WHERE Industry = \\'Technology\\' LIMIT 10'"),
1338
+ limit: z.number().int().min(1).max(2000).default(200).describe("Maximum records to return (default 200)"),
1339
+ }).strict();
1340
+ export const CreateRecordSchema = z.object({
1341
+ objectApiName: z.string().min(1).describe("SObject API name, e.g. 'Account', 'Contact', 'My_Object__c'"),
1342
+ fields: z.record(z.unknown()).describe("Key-value pairs of field API names to values, e.g. {Name: 'Acme', Industry: 'Technology'}"),
1343
+ }).strict();
1344
+ export const UpdateRecordSchema = z.object({
1345
+ objectApiName: z.string().min(1).describe("SObject API name"),
1346
+ recordId: z.string().min(15).max(18).describe("Salesforce record ID (15 or 18 chars)"),
1347
+ fields: z.record(z.unknown()).describe("Key-value pairs of field API names to update values"),
1348
+ }).strict();
1349
+ export const BulkImportRecordsSchema = z.object({
1350
+ objectApiName: z.string().min(1).describe("SObject API name, e.g. 'Account'"),
1351
+ operation: z.enum(["insert","upsert","update","delete"]).describe("Bulk operation type"),
1352
+ records: z.array(z.record(z.unknown())).min(1).describe("Array of record objects with field API name to value mappings"),
1353
+ externalIdField: z.string().optional().describe("External ID field for upsert operations, e.g. 'External_Id__c'"),
1354
+ }).strict();
1355
+ // ─── INTEGRATION (v2.2.0) ─────────────────────────────────────────────────────
1356
+ export const CreateOutboundMessageSchema = z.object({
1357
+ messageName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Outbound message API name"),
1358
+ label: z.string().min(1).describe("Display label"),
1359
+ objectName: z.string().min(1).describe("Object API name this message fires from, e.g. 'Account'"),
1360
+ endpointUrl: z.string().url().describe("HTTPS endpoint URL to send the SOAP message to"),
1361
+ fields: z.array(z.string()).min(1).describe("Field API names to include in the outbound message payload"),
1362
+ useCallout: z.boolean().default(false).describe("Whether to use a named credential callout"),
1363
+ description: z.string().optional().describe("Description"),
1364
+ }).strict();
1365
+ export const CreateAuthProviderSchema = z.object({
1366
+ providerName: z.string().min(1).max(80).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Auth provider API name"),
1367
+ friendlyName: z.string().optional().describe("Display label (defaults to providerName)"),
1368
+ providerType: z.enum(["Salesforce","Google","Facebook","OpenIdConnect","MicrosoftAad","LinkedIn","Custom"]).describe("Provider type"),
1369
+ consumerKey: z.string().min(1).describe("OAuth consumer key / client ID"),
1370
+ consumerSecret: z.string().min(1).describe("OAuth consumer secret / client secret"),
1371
+ defaultScopes: z.string().optional().describe("Default OAuth scopes, e.g. 'openid email profile'"),
1372
+ customErrorUrl: z.string().url().optional().describe("Custom error page URL"),
1373
+ }).strict();
1374
+ // ─── DEPLOYMENT (v2.2.0) ──────────────────────────────────────────────────────
1375
+ export const ValidateDeploymentSchema = z.object({
1376
+ components: z.array(ComponentRefSchema).min(1).describe("Metadata components to validate"),
1377
+ testLevel: z.enum(["NoTestRun","RunLocalTests","RunAllTestsInOrg"]).default("RunLocalTests").describe("Test level for validation"),
1378
+ runTests: z.array(z.string()).optional().describe("Specific test classes to run"),
1379
+ waitMinutes: z.number().int().min(1).max(60).default(10).describe("Max minutes to wait for validation result"),
1380
+ }).strict();
1381
+ export const ListMetadataSchema = z.object({
1382
+ metadataType: z.string().min(1).describe("Metadata type to list, e.g. 'ApexClass', 'Flow', 'CustomObject', 'PermissionSet'"),
1383
+ }).strict();
1384
+ // ─── EXPERIENCE CLOUD (v2.2.0) ────────────────────────────────────────────────
1385
+ export const PublishExperienceSiteSchema = z.object({
1386
+ siteName: z.string().min(1).describe("Experience Cloud site API name"),
1387
+ }).strict();
1388
+ export const UpdateExperienceSiteSchema = z.object({
1389
+ siteName: z.string().min(1).describe("Experience Cloud site API name"),
1390
+ status: z.enum(["Active","Inactive","UnderConstruction"]).optional().describe("Site status"),
1391
+ description: z.string().optional().describe("Site description"),
1392
+ guestUserProfile: z.string().optional().describe("Guest user profile name"),
1393
+ }).strict();
1394
+ export const CreateNavigationMenuSchema = z.object({
1395
+ menuName: z.string().min(1).max(80).describe("Navigation menu API name"),
1396
+ label: z.string().min(1).describe("Menu label"),
1397
+ menuItems: z.array(z.object({
1398
+ label: z.string().describe("Menu item label"),
1399
+ type: z.enum(["SalesforceObject","ExternalUrl","NavigationalTopic","Event","MenuLabel","GlobalAction","ContentPage"]).describe("Menu item type"),
1400
+ target: z.string().describe("Target: object API name, URL, topic name, or event name"),
1401
+ position: z.number().int().optional().describe("Position (1-based)"),
1402
+ })).min(1).describe("Navigation menu items"),
1403
+ }).strict();
1404
+ export const CreateExperienceSiteMemberSchema = z.object({
1405
+ siteName: z.string().min(1).describe("Experience Cloud site API name"),
1406
+ profiles: z.array(z.string()).min(1).describe("Profile names to add as site members"),
1407
+ }).strict();
1408
+ export const SetExperienceSiteBrandingSchema = z.object({
1409
+ siteName: z.string().min(1).describe("Experience Cloud site API name"),
1410
+ primaryColor: z.string().optional().describe("Primary brand color as hex, e.g. '#0176D3'"),
1411
+ secondaryColor: z.string().optional().describe("Secondary brand color as hex"),
1412
+ backgroundColor: z.string().optional().describe("Page background color as hex"),
1413
+ headerBackgroundColor: z.string().optional().describe("Header background color as hex"),
1414
+ logoUrl: z.string().url().optional().describe("Logo image URL"),
1041
1415
  }).strict();
1042
1416
  //# sourceMappingURL=index.js.map
@@ -163,6 +163,28 @@ function lightningTypeFor(sfType) {
163
163
  return "lightning__textAreaType";
164
164
  return "lightning__textType";
165
165
  }
166
+ export async function buildVFPageZip(pageName, markup, apiVersion) {
167
+ const zip = new JSZip();
168
+ const packageXml = buildPackageXml([{ name: "ApexPage", members: [pageName] }], apiVersion);
169
+ zip.file("package.xml", packageXml);
170
+ zip.file(`pages/${pageName}.page`, markup);
171
+ zip.file(`pages/${pageName}.page-meta.xml`, `<?xml version="1.0" encoding="UTF-8"?>\n<ApexPage xmlns="http://soap.sforce.com/2006/04/metadata">\n <apiVersion>${apiVersion}</apiVersion>\n <availableInTouch>true</availableInTouch>\n <confirmationTokenRequired>false</confirmationTokenRequired>\n <label>${pageName}</label>\n</ApexPage>`);
172
+ const buffer = await zip.generateAsync({ type: "nodebuffer" });
173
+ return buffer.toString("base64");
174
+ }
175
+ export async function buildAuraZip(componentName, markup, controller, helper, style, apiVersion) {
176
+ const zip = new JSZip();
177
+ const packageXml = buildPackageXml([{ name: "AuraDefinitionBundle", members: [componentName] }], apiVersion);
178
+ zip.file("package.xml", packageXml);
179
+ const dir = `aura/${componentName}`;
180
+ zip.file(`${dir}/${componentName}.cmp`, markup || `<aura:component>\n</aura:component>`);
181
+ zip.file(`${dir}/${componentName}.cmp-meta.xml`, `<?xml version="1.0" encoding="UTF-8"?>\n<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">\n <apiVersion>${apiVersion}</apiVersion>\n <description>${componentName}</description>\n</AuraDefinitionBundle>`);
182
+ if (controller) zip.file(`${dir}/${componentName}Controller.js`, controller);
183
+ if (helper) zip.file(`${dir}/${componentName}Helper.js`, helper);
184
+ if (style) zip.file(`${dir}/${componentName}.css`, style);
185
+ const buffer = await zip.generateAsync({ type: "nodebuffer" });
186
+ return buffer.toString("base64");
187
+ }
166
188
  export async function buildGenericDeployZip(components, apiVersion) {
167
189
  const zip = new JSZip();
168
190
  const typeMap = new Map();
@@ -193,7 +215,8 @@ export async function deployZip(auth, base64Zip, options = {}) {
193
215
  <met:allowMissingFiles>false</met:allowMissingFiles>
194
216
  <met:autoUpdatePackage>false</met:autoUpdatePackage>
195
217
  <met:checkOnly>${options.checkOnly === true}</met:checkOnly>
196
- <met:runAllTests>false</met:runAllTests>
218
+ <met:runAllTests>${options.testLevel === "RunAllTestsInOrg" ? "true" : "false"}</met:runAllTests>
219
+ ${options.testLevel && options.testLevel !== "RunAllTestsInOrg" ? `<met:testLevel>${options.testLevel}</met:testLevel>` : ""}
197
220
  ${testsXml}
198
221
  <met:rollbackOnError>${options.rollbackOnError !== false}</met:rollbackOnError>
199
222
  <met:singlePackage>true</met:singlePackage>