salesforce-metadata
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

salesforce-metadata

npm version

Read and write Salesforce Metadata files in TypeScript.

WARNING: this project is not stable yet and any API can change.

Types

All the metadata types were generated from salesforce-wsdl-consumer.

Every property is optional and explicitArray for reading an XML file is set to true (always put child nodes in an array).

Usage

Currently, this version can only read and write XML Metadata files, i.e. even though the Profile type extends Metadata type, the "fullName" property from Metadata type won't be processed while reading and writing a file.

Exported functions:

  • readMetadataXML(file: string): Promise<MetadataFile>
  • writeMetadataXML(file: string, metadata: MetadataFile, options?: OptionsV2): Promise<void>
readMetadataXML(profilePath)
    .then((profile: {Profile: Profile}) => {
        profile.Profile.userPermissions?.forEach((perm: ProfileUserPermission) => {
            // ...
        });
        return writeMetadataXML(profilePath, profile);
    });

Package Sidebar

Install

npm i salesforce-metadata

Weekly Downloads

44

Version

0.0.10

License

Apache-2.0

Unpacked Size

637 kB

Total Files

25

Last publish

Collaborators

  • kratoon