1 | import { URL } from 'node:url';
|
2 | export declare function getLoginAudienceCombos(audienceUrl: string, loginUrl: string): Array<[string, string]>;
|
3 | export declare class SfdcUrl extends URL {
|
4 | /**
|
5 | * Salesforce URLs
|
6 | */
|
7 | static readonly SANDBOX = "https://test.salesforce.com";
|
8 | static readonly PRODUCTION = "https://login.salesforce.com";
|
9 | private static readonly cache;
|
10 | private logger;
|
11 | private envVars;
|
12 | constructor(input: string | URL, base?: string | URL);
|
13 | static isValidUrl(input: string | URL): boolean;
|
14 | /**
|
15 | * Returns the appropriate jwt audience url for this url
|
16 | * Use SF_AUDIENCE_URL env var to override the audience url
|
17 | *
|
18 | * @param createdOrgInstance The Salesforce instance the org was created on. e.g. `cs42`
|
19 | * @return {Promise<string>} The audience url
|
20 | */
|
21 | getJwtAudienceUrl(createdOrgInstance?: string): Promise<string>;
|
22 | /**
|
23 | * Tests whether this url contains a Salesforce owned domain
|
24 | *
|
25 | * @return {boolean} true if this is a salesforce domain
|
26 | */
|
27 | isSalesforceDomain(): boolean;
|
28 | /**
|
29 | * Tests whether this url is an internal Salesforce domain
|
30 | *
|
31 | * @returns {boolean} true if this is an internal domain
|
32 | */
|
33 | isInternalUrl(): boolean;
|
34 | /**
|
35 | * Tests whether this url runs on a local machine
|
36 | *
|
37 | * @returns {boolean} true if this is a local machine
|
38 | */
|
39 | isLocalUrl(): boolean;
|
40 | toLightningDomain(): string;
|
41 | /**
|
42 | * Tests whether this url has the lightning domain extension
|
43 | * 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
|
44 | * If SF_DOMAIN_RETRY environment variable is set (number) it overrides the default timeout duration (240 seconds)
|
45 | *
|
46 | * @returns {Promise<true | never>} The resolved ip address or never
|
47 | * @throws {@link SfError} If can't resolve DNS.
|
48 | */
|
49 | checkLightningDomain(): Promise<true>;
|
50 | /**
|
51 | * Method that performs the dns lookup of the host. If the lookup fails the internal polling (1 second), client will try again until timeout
|
52 | * If SF_DOMAIN_RETRY environment variable is set (number) it overrides the default timeout duration (240 seconds)
|
53 | *
|
54 | * @returns the resolved ip address.
|
55 | * @throws {@link SfError} If can't resolve DNS.
|
56 | */
|
57 | lookup(): Promise<string>;
|
58 | /**
|
59 | * Test whether this url represents a lightning domain
|
60 | *
|
61 | * @returns {boolean} true if this domain is a lightning domain
|
62 | */
|
63 | isLightningDomain(): boolean;
|
64 | }
|