npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@aurahelper/xml-definitions

v2.0.1

Published

Powerfull Libraries to get the XML Definitions of ALL XML Salesforce Metadata Files. Support All API Versions up to API 53.0. You can get the definition of one or more XML files for a specific version of Salesforce. For Example: You can get the XML Defini

Downloads

994

Readme

Aura Helper XML Definitions Module

Version Total Downloads Downloads/Month Issues Known Vulnerabilities Code Size License

Module to get any Salesforce Metadata XML Files Definition to process Metadata files properly. Yoy can get all Raw definitions, a Raw definition for a specific type or get All or specific definitions for a specific api version. For example, yo can get all Salesforce XML Definitions for API 45.0 or get the Custom Object XML File Definition for API 35.0.

The difference between the XML definition and the raw XML definition is that the raw definition is not processed, it returns the entire XML information. The XML definitions return the XML definition processed for a specific API version, omitting everything that does not correspond to the indicated version.

Support up to API 53.0

XMLDefinitions Class

Class with static methods to get the XML Definitions for one Metadata Type or get all XML Definitions for all types and specific Salesforce API Version. Also you can get a XML Raw definitions and Resolve Recursive definitions on some files.

Methods


getDefinition(type, apiVersion)

Method to get the Metadata Type's XML definition for an API Version.

Parameters:

  • type: Metadata Type API Name to get the XML definition
    • string
  • apiVersion: API Version number to get the version definition
    • string | number

Return:

Return the XML definition for the selected type and API version. If the type exists, but is not available in the selected API, return an empty object. If type not exists, return undefined.

  • { [key: string]: any } | undefined

Examples:

Get the Profile XML definition for API 45.0

    import { XMLDefinitions } from '@aurahelper/xml-definitions';

    const ProfileDefinition = XMLDefinitions.getDefinition('Profile', 45);
    console.log(ProfileDefinition);

Get the CustomObject XML definition for API 33.0

    import { XMLDefinitions } from '@aurahelper/xml-definitions';

    const CustomObjectDefinition = XMLDefinitions.getDefinition('CustomObject', 33);
    console.log(CustomObjectDefinition);    

getRawDefinition(type)

Method to get the Metadata Type's XML RAW definition

Parameters:

  • type: Metadata Type API Name to get the XML definition
    • string

Return:

Return the XML raw definition for the selected type. If type not exists, return undefined

  • { [key: string]: any } | undefined

Examples:

Get the ConnectedApp XML raw definition

    import { XMLDefinitions } from '@aurahelper/xml-definitions';

    const ConnectedAppDefinition = XMLDefinitions.getRawDefinition('ConnectedApp');
    console.log(ConnectedAppDefinition);

Get the CustomField XML raw definition

    import { XMLDefinitions } from '@aurahelper/xml-definitions';

    const CustomFieldDefinition = XMLDefinitions.getRawDefinition('CustomField');
    console.log(CustomFieldDefinition);

getAllDefinitions(apiVersion)

Method to get all XML Definitions for all Metadata Types for an specific API Version.

Parameters:

  • apiVersion: API Version number to get the version definition
    • string | number

Return:

Return an Object with all XML definitions for the selected API version. The object has the Type as key and the XML definition as value. If not exists any definition for the selected API return an empty object

  • { [key: string]: { [key: string]: any } }

Examples:

Get All XML Definitions for API 43.0

    import { XMLDefinitions } from '@aurahelper/xml-definitions';

    const AllDefinitions = XMLDefinitions.getAllDefinitions(43);

    const CustomObjectDefinition = AllDefinitions.CustomObject;
    const SkilDefinition = AllDefinitions['Skill'];

    console.log(CustomObjectDefinition);
    console.log(SkilDefinition);

getAllRawDefinitions()

Method to get all XML RAW Definitions for all Metadata Types

Return:

Return an Object with all XML raw definitions. The object has the Type as key and the XML definition as value

  • { [key: string]: { [key: string]: any } }

Examples:

Get All XML raw definitions

    import { XMLDefinitions } from '@aurahelper/xml-definitions';

    const AllRawDefinitions = XMLDefinitions.getAllRawDefinitions();

    const CustomFieldRawDefinition = AllRawDefinitions.CustomField;
    const WorkflowRawDefinition = AllRawDefinitions['Workflow'];

    console.log(CustomFieldRawDefinition);
    console.log(WorkflowRawDefinition);

resolveDefinitionReference(xmlDefinition, subFieldDefinition)

Method to resolve the recursive reference from some XML Definition files

Parameters:

  • typeDefinition: XML file Definition
    • any
  • subFieldDefinition: XML Field definition to resolve
    • any

Return:

Returns the XML Definition to the selected XML field

  • any

Examples:

Resolve the recursive definition references on an object like Bot Steps on Bot XML Definition

    import { XMLDefinitions } from '@aurahelper/xml-definitions';

    const BotDefinition = XMLDefinitions.getDefinition('Bot', 50);
    ...
    ...
    ...
    if(botStep.definitionRef){
        let botStepResolvedDefinition = XMLDefinitions.resolveDefinitionReference(BotDefinition, botStep);
    }