@salesforce/core
Version:
Core libraries to interact with SFDX projects, orgs, and APIs.
59 lines (58 loc) • 2.2 kB
TypeScript
import { JsonMap, Optional } from '@salesforce/ts-types';
/**
* Converts an 18 character Salesforce ID to 15 characters.
*
* @param id The id to convert.
*/
export declare function trimTo15(id: string): string;
export declare function trimTo15(id?: undefined): undefined;
export declare function trimTo15(id: string | undefined): string | undefined;
/**
* Tests whether an API version matches the format `i.0`.
*
* @param value The API version as a string.
*/
export declare const validateApiVersion: (value: string) => boolean;
/**
* Tests whether an email matches the format `me@my.org`
*
* @param value The email as a string.
*/
export declare const validateEmail: (value: string) => boolean;
/**
*
* @deprecated use `new SfdcUrl(url).isInternalUrl()`
* Tests whether a given url is an internal Salesforce domain
*
* @param url
*/
export declare const isInternalUrl: (url: string) => boolean;
/**
* Tests whether a Salesforce ID is in the correct format, a 15- or 18-character length string with only letters and numbers
*
* @param value The ID as a string.
*/
export declare const validateSalesforceId: (value: string) => boolean;
/**
* Tests whether a path is in the correct format; the value doesn't include the characters "[", "]", "?", "<", ">", "?", "|"
*
* @param value The path as a string.
*/
export declare const validatePathDoesNotContainInvalidChars: (value: string) => boolean;
/**
* @deprecated
* // TODO: move this to a module-scope function in sfProject
* Returns the first key within the object that has an upper case first letter.
*
* @param data The object in which to check key casing.
* @param sectionBlocklist properties in the object to exclude from the search. e.g. a blocklist of `["a"]` and data of `{ "a": { "B" : "b"}}` would ignore `B` because it is in the object value under `a`.
*/
export declare const findUpperCaseKeys: (data?: JsonMap, sectionBlocklist?: string[]) => Optional<string>;
export declare const accessTokenRegex: RegExp;
export declare const sfdxAuthUrlRegex: RegExp;
/**
* Tests whether a given string is an access token
*
* @param value
*/
export declare const matchesAccessToken: (value: string) => boolean;