Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Commit

Permalink
fix: add more child types of complex Metadata
Browse files Browse the repository at this point in the history
This enables `force-dev-tool changeset create` to handle e.g.
`customSettingAccesses ` of `CustomObject`.

Closes #218
  • Loading branch information
amtrack committed May 12, 2020
1 parent 5531c8c commit aa318e6
Show file tree
Hide file tree
Showing 10 changed files with 1,443 additions and 30 deletions.
85 changes: 55 additions & 30 deletions lib/describe-metadata-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ var _ = require('underscore');
var path = require('path');

var childTypes = [{
xmlName: 'ActionOverride',
tagName: 'actionOverrides',
parent: 'CustomObject',
key: 'actionName'
}, {
xmlName: 'AssignmentRule',
tagName: 'assignmentRule',
parent: 'AssignmentRules',
Expand All @@ -20,27 +15,44 @@ var childTypes = [{
parent: 'AutoResponseRules',
key: 'fullName',
isNamed: true
}, {
xmlName: 'ActionOverride',
tagName: 'actionOverrides',
parent: 'CustomObject',
key: 'actionName'
}, {
xmlName: 'BusinessProcess',
tagName: 'businessProcesses',
parent: 'CustomObject',
key: 'fullName',
isNamed: true
}, {
xmlName: 'CompactLayout',
tagName: 'compactLayouts',
parent: 'CustomObject',
key: 'fullName',
isNamed: true
}, {
xmlName: 'CustomField',
tagName: 'fields',
parent: 'CustomObject',
key: 'fullName',
isNamed: true
}, {
xmlName: 'Index',
tagName: 'indexes',
xmlName: 'FieldSet',
tagName: 'fieldSets',
parent: 'CustomObject',
key: 'fullName',
isNamed: true
}, {
xmlName: 'BusinessProcess',
tagName: 'businessProcesses',
xmlName: 'Index',
tagName: 'indexes',
parent: 'CustomObject',
key: 'fullName',
isNamed: true
}, {
xmlName: 'CompactLayout',
tagName: 'compactLayouts',
xmlName: 'ListView',
tagName: 'listViews',
parent: 'CustomObject',
key: 'fullName',
isNamed: true
Expand All @@ -51,20 +63,25 @@ var childTypes = [{
key: 'fullName',
isNamed: true
}, {
xmlName: 'WebLink',
tagName: 'webLinks',
xmlName: 'SharingReason',
tagName: 'sharingReasons',
parent: 'CustomObject',
key: 'fullName',
isNamed: true
}, {
xmlName: 'SharingRecalculation',
tagName: 'sharingRecalculations',
parent: 'CustomObject',
key: 'className'
}, {
xmlName: 'ValidationRule',
tagName: 'validationRules',
parent: 'CustomObject',
key: 'fullName',
isNamed: true
}, {
xmlName: 'SharingReason',
tagName: 'sharingReasons',
xmlName: 'WebLink',
tagName: 'webLinks',
parent: 'CustomObject',
key: 'fullName',
isNamed: true
Expand All @@ -80,18 +97,6 @@ var childTypes = [{
parent: 'SharingRules',
key: 'fullName',
isNamed: true
}, {
xmlName: 'ListView',
tagName: 'listViews',
parent: 'CustomObject',
key: 'fullName',
isNamed: true
}, {
xmlName: 'FieldSet',
tagName: 'fieldSets',
parent: 'CustomObject',
key: 'fullName',
isNamed: true
}, {
xmlName: 'WorkflowFieldUpdate',
tagName: 'fieldUpdates',
Expand Down Expand Up @@ -158,21 +163,31 @@ var childTypes = [{
tagName: 'applicationVisibilities',
parent: 'Profile',
key: 'application'
}, {
xmlName: 'ProfileCategoryGroupVisibility',
tagName: 'categoryGroupVisibilities',
parent: 'Profile',
key: 'dataCategoryGroup'
}, {
xmlName: 'ProfileApexClassAccess',
tagName: 'classAccesses',
parent: 'Profile',
key: 'apexClass'
}, {
xmlName: 'ProfileApexPageAccess',
tagName: 'pageAccesses',
xmlName: 'ProfileCustomMetadataTypeAccess',
tagName: 'customMetadataTypeAccesses',
parent: 'Profile',
key: 'apexPage'
key: 'name'
}, {
xmlName: 'ProfileCustomPermissions',
tagName: 'customPermissions',
parent: 'Profile',
key: 'name'
}, {
xmlName: 'ProfileCustomSettingAccesses',
tagName: 'customSettingAccesses',
parent: 'Profile',
key: 'name'
}, {
xmlName: 'ProfileExternalDataSourceAccess',
tagName: 'externalDataSourceAccesses',
Expand All @@ -194,6 +209,16 @@ var childTypes = [{
tagName: 'objectPermissions',
parent: 'Profile',
key: 'object'
}, {
xmlName: 'ProfileApexPageAccess',
tagName: 'pageAccesses',
parent: 'Profile',
key: 'apexPage'
}, {
xmlName: 'ProfileActionOverride',
tagName: 'profileActionOverrides',
parent: 'Profile',
key: 'actionName'
}, {
xmlName: 'ProfileRecordTypeVisibility',
tagName: 'recordTypeVisibilities',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Admin</members>
<name>Profile</name>
</types>
<version>48.0</version>
</Package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns="http://soap.sforce.com/2006/04/metadata">
<customSettingAccesses>
<enabled>true</enabled>
<name>MyCustomSetting__c</name>
</customSettingAccesses>
</Profile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<customSettingsType>Hierarchy</customSettingsType>
<enableFeeds>false</enableFeeds>
<label>My Custom Setting</label>
<visibility>Public</visibility>
</CustomObject>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>MyCustomSetting__c</members>
<name>CustomObject</name>
</types>
<types>
<members>Admin</members>
<name>Profile</name>
</types>
<version>48.0</version>
</Package>
Loading

0 comments on commit aa318e6

Please sign in to comment.