new Metadata(conn)
Class for Salesforce Metadata API
Parameters:
Name | Type | Description |
---|---|---|
conn |
Connection | Connection object |
- Source:
Classes
Members
-
pollInterval :Number
-
Polling interval in milliseconds
Type:
- Number
- Source:
-
pollTimeout :Number
-
Polling timeout in milliseconds
Type:
- Number
- Source:
Methods
-
checkDeployStatus(id, includeDetails, callback) → {Promise.<Metadata~DeployResult>}
-
Checks the status of declarative metadata call deploy()
Parameters:
Name Type Argument Description id
String Async process id returned from previous deploy request includeDetails
Boolean <optional>
Sets the DeployResult object to include details information (default: false) callback
Callback.<Metadata~DeployResult> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<Metadata~DeployResult>
-
checkRetrieveStatus(id, callback) → {Promise.<Metadata~RetrieveResult>}
-
Checks the status of declarative metadata call retrieve() and returns the zip file contents
Parameters:
Name Type Argument Description id
String Async process id returned from previous retrieve request callback
Callback.<Metadata~RetrieveResult> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<Metadata~RetrieveResult>
-
checkStatus(ids, callback) → {Metadata~AsyncResultLocator}
-
Checks the status of asynchronous metadata calls
Parameters:
Name Type Argument Description ids
String | Array.<String> The asynchronous process ID(s) callback
Callback.<(Metadata~AsyncResult|Array.<Metadata~AsyncResult>)> <optional>
Callback function - Source:
Returns:
-
create(type, metadata, callback) → {Metadata~AsyncResultLocator}
-
Adds one or more new metadata components to your organization's data.
Parameters:
Name Type Argument Description type
String The type of metadata to create metadata
Metadata~MetadataInfo | Array.<Metadata~MetadataInfo> Metadata to create callback
Callback.<(Metadata~AsyncResult|Array.<Metadata~AsyncResult>)> <optional>
Callback function - Source:
Returns:
-
del(type, metadata, callback) → {Metadata~AsyncResultLocator}
-
Synonym of Metadata#delete().
Parameters:
Name Type Argument Description type
String <optional>
The type of metadata to delete metadata
String | Metadata~MetadataInfo | Array.<String> | Array.<Metadata~MetadataInfo> The fullName of metadata or metadata info to delete. If it is passed in fullName, the type parameter should not be empty. callback
Callback.<(Metadata~AsyncResult|Array.<Metadata~AsyncResult>)> <optional>
Callback function - Source:
Returns:
-
delete(type, metadata, callback) → {Metadata~AsyncResultLocator}
-
Deletes one or more components from your organization's data.
Parameters:
Name Type Argument Description type
String The type of metadata to delete metadata
String | Metadata~MetadataInfo | Array.<String> | Array.<Metadata~MetadataInfo> The fullName of metadata or metadata info to delete. If it is passed in fullName, the type parameter should not be empty. callback
Callback.<(Metadata~AsyncResult|Array.<Metadata~AsyncResult>)> <optional>
Callback function - Source:
Returns:
-
deploy(zipInput, options, callback) → {Metadata~DeployResultLocator}
-
Deploy components into an organization using zipped file representations
Parameters:
Name Type Argument Description zipInput
stream.Stream | Buffer Zipped file input source in readable stream or binary buffer options
Object <optional>
Options used in deployment Properties
Name Type Argument Description allowMissingFiles
Boolean <optional>
Specifies whether a deploy succeeds even if files that are specified in package.xml but are not in the .zip file or not. autoUpdatePackage
Boolean <optional>
If a file is in the .zip file but not specified in package.xml, specifies whether the file should be automatically added to the package or not. checkOnly
Boolean <optional>
Indicates whether Apex classes and triggers are saved to the organization as part of the deployment (false) or not (true). ignoreWarnings
Boolean <optional>
Indicates whether a warning should allow a deployment to complete successfully (true) or not (false). Defaults to false. performRetrieve
Boolean <optional>
Indicates whether a retrieve() call is performed immediately after the deployment (true) or not (false). purgeOnDelete
Boolean <optional>
If true, the deleted components in the destructiveChanges.xml manifest file aren't stored in the Recycle Bin. rollbackOnError
Boolean <optional>
Indicates whether any failure causes a complete rollback (true) or not (false). runAllTests
Boolean <optional>
If true, all Apex tests defined in the organization are run. runTests
Array.<String> <optional>
A list of Apex tests to be run during deployment. singlePackage
Boolean <optional>
Indicates whether the specified .zip file points to a directory structure with a single package (true) or a set of packages (false). callback
Callback.<Metadata~AsyncResult> <optional>
Callback function - Source:
Returns:
-
describe(version, callback) → {Promise.<Metadata~DescribeMetadataResult>}
-
Retrieves the metadata which describes your organization, including Apex classes and triggers, custom objects, custom fields on standard objects, tab sets that define an app, and many other components.
Parameters:
Name Type Argument Description version
String <optional>
The API version for which you want metadata; for example, 29.0 callback
Callback.<Metadata~DescribeMetadataResult> <optional>
Callback function - Source:
Returns:
-
list(queries, version, callback) → {Promise.<Array.<Metadata~FileProperties>>}
-
Retrieves property information about metadata components in your organization
Parameters:
Name Type Argument Description queries
Metadata~ListMetadataQuery | Array.<Metadata~ListMetadataQuery> The criteria object(s) specifing metadata to list version
String <optional>
The API version for which you want metadata; for example, 29.0 callback
Callback.<Array.<Metadata~FileProperties>> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<Array.<Metadata~FileProperties>>
-
retrieve(request, callback) → {Metadata~RetrieveResultLocator}
-
Retrieves XML file representations of components in an organization
Parameters:
Name Type Argument Description request
Metadata~RetrieveRequest Options for determining which packages or files are retrieved callback
Callback.<Metadata~AsyncResult> <optional>
Callback function - Source:
Returns:
-
update(type, updateMetadata, callback) → {Metadata~AsyncResultLocator}
-
Updates one or more components in your organization's data.
Parameters:
Name Type Argument Description type
String The type of metadata to update updateMetadata
Metadata~UpdateMetadataInfo | Array.<Metadata~UpdateMetadataInfo> Updating metadata callback
Callback.<(Metadata~AsyncResult|Array.<Metadata~AsyncResult>)> <optional>
Callback function - Source:
Returns:
Type Definitions
-
AsyncResult
-
Type:
- Object
- Source:
Properties:
Name Type Argument Description done
Boolean Indicates whether the call has completed or not id
String ID of the component being created, updated, deleted, deployed, or retrieved state
String The state four possible values: Queued, InProgress, Completed, and Error. statusCode
String <optional>
If an error occurred during the create(), update(), or delete() call, a status code is returned message
String <optional>
Message corresponding to the statusCode field returned -
DeployResult
-
Type:
- Object
- Source:
Properties:
Name Type Argument Description id
String ID of the component being deployed checkOnly
Boolean Indicates whether this deployment is being used to check the validity of the deployed files without making any changes in the organization or not completedDate
String Timestamp for when the deployment process ended createdDate
String Timestamp for when the deploy() call was received details
Array.<Object> <optional>
Provides the details of a deployment that is in-progress or ended, if includeDetails is set to true in checkDeployStatus() call done
Boolean Indicates whether the server finished processing the deploy() call for the specified id errorMessage
String <optional>
Message corresponding to the values in the errorStatusCode field errorStatusCode
String <optional>
If an error occurred during the deploy() call, a status code is returned, and the message corresponding to the status code is returned in the errorMessagefield ignoreWarnings
Boolean <optional>
Specifies whether a deployment should continue even if the deployment generates warnings lastModifiedDate
String Timestamp of the last update for the deployment process numberComponentErrors
Number The number of components that generated errors during this deployment numberComponentsDeployed
Number The number of components deployed in the deployment process numberComponentsTotal
Number The total number of components in the deployment numberTestErrors
Number The number of Apex tests that have generated errors during this deployment numberTestsCompleted
Number The number of completedApex tests for this deployment numberTestsTotal
Number The total number of Apex tests for this deployment rollbackOnError
Boolean <optional>
Indicates whether any failure causes a complete rollback or not. Default is true. startDate
String Timestamp for when the deployment process began status
String Indicates the current state of the deployment success
Boolean Indicates whether the deployment was successful or not -
DescribeMetadataResult
-
Type:
- Object
- Source:
Properties:
Name Type Description metadataObjects
Array.<Object> One or more metadata components and their attributes Properties
Name Type Description childXmlNames
Array.<String> List of child sub-components for this component directoryName
String The name of the directory in the .zip file that contains this component inFolder
Boolean Indicates whether the component is in a folder or not metaFile
Boolean Indicates whether the component requires an accompanying metadata file suffix
String The file suffix for this component xmlName
String The name of the root element in the metadata file for this component organizationNamespace
String The namespace of the organization partialSaveAllowed
Boolean Indicates whether rollbackOnError is allowed or not testRequired
Boolean Indicates whether tests are required or not -
FileProperties
-
Type:
- Object
- Source:
Properties:
Name Type Argument Description type
String The metadata type, such as CustomObject, CustomField, or ApexClass createdById
String ID of the user who created the file createdByName
String Name of the user who created the file createdDate
String Date and time when the file was created fileName
String Name of the file fullName
String The file developer name used as a unique identifier for API access id
String ID of the file lastModifiedById
String ID of the user who last modified the file lastModifiedByName
String Name of the user who last modified the file lastModifiedDate
String Date and time that the file was last modified manageableState
String <optional>
Indicates the manageable state of the specified component if it is contained in a package namespacePrefix
String <optional>
The namespace prefix of the component -
ListMetadataQuery
-
Type:
- Object
- Source:
Properties:
Name Type Argument Description type
String The metadata type, such as CustomObject, CustomField, or ApexClass folder
String <optional>
The folder associated with the component. -
MetadataInfo
-
Type:
- Object
- Source:
Properties:
Name Type Description fullName
String The name of the component -
RetrieveRequest
-
Type:
- Object
- Source:
-
RetrieveResult
-
Type:
- Object
- Source:
Properties:
Name Type Description fileProperties
Array.<Metadata~FileProperties> Contains information about the properties of each component in the .zip file, and the manifest file package.xml id
String ID of the component being retrieved messages
Array.<Object> Contains information about the success or failure of the retrieve() call zipFile
String The zip file returned by the retrieve request. Base 64-encoded binary data -
UpdateMetadataInfo
-
Type:
- Object
- Source:
Properties:
Name Type Description currentName
String The API name of the component or field before the update metadata
Metadata~MetadataInfo Full specification of the component or field you wish to update