UNPKG

@salesforce/core

Version:

Core libraries to interact with SFDX projects, orgs, and APIs.

73 lines (72 loc) 2.93 kB
/// <reference types="node" /> import { URL } from 'url'; export declare function getLoginAudienceCombos(audienceUrl: string, loginUrl: string): [string, string][]; export declare class SfdcUrl extends URL { /** * Salesforce URLs */ static readonly SANDBOX = "https://test.salesforce.com"; static readonly PRODUCTION = "https://login.salesforce.com"; private static readonly cache; private logger; constructor(input: string | URL, base?: string | URL); static isValidUrl(input: string | URL): boolean; /** * Returns the appropriate jwt audience url for this url * Use SFDX_AUDIENCE_URL env var to override the audience url * * @param createdOrgInstance The Salesforce instance the org was created on. e.g. `cs42` * @return {Promise<string>} The audience url */ getJwtAudienceUrl(createdOrgInstance?: string): Promise<string>; /** * Tests whether this url contains a Salesforce owned domain * * @return {boolean} true if this is a salesforce domain */ isSalesforceDomain(): boolean; /** * Tests whether this url is an internal Salesforce domain * * @returns {boolean} true if this is an internal domain */ isInternalUrl(): boolean; /** * Tests whether this url runs on a local machine * * @returns {boolean} true if this is a local machine */ isLocalUrl(): boolean; toLightningDomain(): string; /** * Tests whether this url has the lightning domain extension * This method that performs the dns lookup of the host. If the lookup fails the internal polling (1 second), client will try again until timeout * If SFDX_DOMAIN_RETRY environment variable is set (number) it overrides the default timeout duration (240 seconds) * * @returns {Promise<true | never>} The resolved ip address or never * @throws {@link SfError} If can't resolve DNS. */ checkLightningDomain(): Promise<true | never>; /** * Method that performs the dns lookup of the host. If the lookup fails the internal polling (1 second), client will try again until timeout * If SFDX_DOMAIN_RETRY environment variable is set (number) it overrides the default timeout duration (240 seconds) * * @returns the resolved ip address. * @throws {@link SfError} If can't resolve DNS. */ lookup(): Promise<string>; /** * Tests whether this url is a sandbox url * * @Deprecated - identification of a sandbox instance by URL alone is not deterministic * @param createdOrgInstance The Salesforce instance the org was created on. e.g. `cs42` * @returns {boolean} */ isSandboxUrl(createdOrgInstance?: string): boolean; /** * Test whether this url represents a lightning domain * * @returns {boolean} true if this domain is a lightning domain */ isLightningDomain(): boolean; }