Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MyDomainResolver

A class used to resolve MyDomains. After a ScratchOrg is created it's host name my not be propagated to the Salesforce DNS service. This service is not exclusive to Salesforce My Domain URL and could be used for any hostname.

(async () => {
 const options: MyDomainResolver.Options = {
     url: new URL('http://mydomain.salesforce.com'),
     timeout: Duration.minutes(5),
     frequency: Duration.seconds(10)
 };
 const resolver: MyDomainResolver = await MyDomainResolver.create(options);
 const ipAddress: AnyJson = await resolver.resolve();
 console.log(`Successfully resolved host: ${options.url} to address: ${ipAddress}`);
})();

Hierarchy

  • AsyncOptionalCreatable<Options>
    • MyDomainResolver

Index

Interfaces

Constructors

Properties

Methods

Constructors

constructor

Properties

Static DEFAULT_DOMAIN

DEFAULT_DOMAIN: URL = new URL('https://login.salesforce.com')

Methods

Protected init

  • init(): Promise<void>
  • Used to initialize asynchronous components.

    Returns Promise<void>

resolve

  • resolve(): Promise<string>
  • Method that performs the dns lookup of the host. If the lookup fails the internal polling client will try again given the optional interval. Returns the resolved ip address.

    Returns Promise<string>

Static create

  • create<P, T>(this: object, options?: P): Promise<T>
  • Asynchronously constructs and initializes a new instance of a concrete subclass with the optional options.

    Type parameters

    • P

    • T: AsyncOptionalCreatable<P>

    Parameters

    • this: object
    • Optional options: P

      An options object providing initialization params to the async constructor.

    Returns Promise<T>