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 idString Async process id returned from previous deploy request includeDetailsBoolean <optional>
Sets the DeployResult object to include details information (default: false) callbackCallback.<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 idString Async process id returned from previous retrieve request callbackCallback.<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 idsString | Array.<String> The asynchronous process ID(s) callbackCallback.<(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 typeString The type of metadata to create metadataMetadata~MetadataInfo | Array.<Metadata~MetadataInfo> Metadata to create callbackCallback.<(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 typeString <optional>
The type of metadata to delete metadataString | 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. callbackCallback.<(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 typeString The type of metadata to delete metadataString | 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. callbackCallback.<(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 zipInputstream.Stream | Buffer Zipped file input source in readable stream or binary buffer optionsObject <optional>
Options used in deployment Properties
Name Type Argument Description allowMissingFilesBoolean <optional>
Specifies whether a deploy succeeds even if files that are specified in package.xml but are not in the .zip file or not. autoUpdatePackageBoolean <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. checkOnlyBoolean <optional>
Indicates whether Apex classes and triggers are saved to the organization as part of the deployment (false) or not (true). ignoreWarningsBoolean <optional>
Indicates whether a warning should allow a deployment to complete successfully (true) or not (false). Defaults to false. performRetrieveBoolean <optional>
Indicates whether a retrieve() call is performed immediately after the deployment (true) or not (false). purgeOnDeleteBoolean <optional>
If true, the deleted components in the destructiveChanges.xml manifest file aren't stored in the Recycle Bin. rollbackOnErrorBoolean <optional>
Indicates whether any failure causes a complete rollback (true) or not (false). runAllTestsBoolean <optional>
If true, all Apex tests defined in the organization are run. runTestsArray.<String> <optional>
A list of Apex tests to be run during deployment. singlePackageBoolean <optional>
Indicates whether the specified .zip file points to a directory structure with a single package (true) or a set of packages (false). callbackCallback.<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 versionString <optional>
The API version for which you want metadata; for example, 29.0 callbackCallback.<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 queriesMetadata~ListMetadataQuery | Array.<Metadata~ListMetadataQuery> The criteria object(s) specifing metadata to list versionString <optional>
The API version for which you want metadata; for example, 29.0 callbackCallback.<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 requestMetadata~RetrieveRequest Options for determining which packages or files are retrieved callbackCallback.<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 typeString The type of metadata to update updateMetadataMetadata~UpdateMetadataInfo | Array.<Metadata~UpdateMetadataInfo> Updating metadata callbackCallback.<(Metadata~AsyncResult|Array.<Metadata~AsyncResult>)> <optional>
Callback function - Source:
Returns:
Type Definitions
-
AsyncResult
-
Type:
- Object
- Source:
Properties:
Name Type Argument Description doneBoolean Indicates whether the call has completed or not idString ID of the component being created, updated, deleted, deployed, or retrieved stateString The state four possible values: Queued, InProgress, Completed, and Error. statusCodeString <optional>
If an error occurred during the create(), update(), or delete() call, a status code is returned messageString <optional>
Message corresponding to the statusCode field returned -
DeployResult
-
Type:
- Object
- Source:
Properties:
Name Type Argument Description idString ID of the component being deployed checkOnlyBoolean Indicates whether this deployment is being used to check the validity of the deployed files without making any changes in the organization or not completedDateString Timestamp for when the deployment process ended createdDateString Timestamp for when the deploy() call was received detailsArray.<Object> <optional>
Provides the details of a deployment that is in-progress or ended, if includeDetails is set to true in checkDeployStatus() call doneBoolean Indicates whether the server finished processing the deploy() call for the specified id errorMessageString <optional>
Message corresponding to the values in the errorStatusCode field errorStatusCodeString <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 ignoreWarningsBoolean <optional>
Specifies whether a deployment should continue even if the deployment generates warnings lastModifiedDateString Timestamp of the last update for the deployment process numberComponentErrorsNumber The number of components that generated errors during this deployment numberComponentsDeployedNumber The number of components deployed in the deployment process numberComponentsTotalNumber The total number of components in the deployment numberTestErrorsNumber The number of Apex tests that have generated errors during this deployment numberTestsCompletedNumber The number of completedApex tests for this deployment numberTestsTotalNumber The total number of Apex tests for this deployment rollbackOnErrorBoolean <optional>
Indicates whether any failure causes a complete rollback or not. Default is true. startDateString Timestamp for when the deployment process began statusString Indicates the current state of the deployment successBoolean Indicates whether the deployment was successful or not -
DescribeMetadataResult
-
Type:
- Object
- Source:
Properties:
Name Type Description metadataObjectsArray.<Object> One or more metadata components and their attributes Properties
Name Type Description childXmlNamesArray.<String> List of child sub-components for this component directoryNameString The name of the directory in the .zip file that contains this component inFolderBoolean Indicates whether the component is in a folder or not metaFileBoolean Indicates whether the component requires an accompanying metadata file suffixString The file suffix for this component xmlNameString The name of the root element in the metadata file for this component organizationNamespaceString The namespace of the organization partialSaveAllowedBoolean Indicates whether rollbackOnError is allowed or not testRequiredBoolean Indicates whether tests are required or not -
FileProperties
-
Type:
- Object
- Source:
Properties:
Name Type Argument Description typeString The metadata type, such as CustomObject, CustomField, or ApexClass createdByIdString ID of the user who created the file createdByNameString Name of the user who created the file createdDateString Date and time when the file was created fileNameString Name of the file fullNameString The file developer name used as a unique identifier for API access idString ID of the file lastModifiedByIdString ID of the user who last modified the file lastModifiedByNameString Name of the user who last modified the file lastModifiedDateString Date and time that the file was last modified manageableStateString <optional>
Indicates the manageable state of the specified component if it is contained in a package namespacePrefixString <optional>
The namespace prefix of the component -
ListMetadataQuery
-
Type:
- Object
- Source:
Properties:
Name Type Argument Description typeString The metadata type, such as CustomObject, CustomField, or ApexClass folderString <optional>
The folder associated with the component. -
MetadataInfo
-
Type:
- Object
- Source:
Properties:
Name Type Description fullNameString The name of the component -
RetrieveRequest
-
Type:
- Object
- Source:
-
RetrieveResult
-
Type:
- Object
- Source:
Properties:
Name Type Description filePropertiesArray.<Metadata~FileProperties> Contains information about the properties of each component in the .zip file, and the manifest file package.xml idString ID of the component being retrieved messagesArray.<Object> Contains information about the success or failure of the retrieve() call zipFileString The zip file returned by the retrieve request. Base 64-encoded binary data -
UpdateMetadataInfo
-
Type:
- Object
- Source:
Properties:
Name Type Description currentNameString The API name of the component or field before the update metadataMetadata~MetadataInfo Full specification of the component or field you wish to update