1 | /// <reference types="node" />
|
2 | import { URL } from 'url';
|
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 | constructor(input: string | URL, base?: string | URL);
|
12 | /**
|
13 | * Returns the appropiate jwt audience url for this url
|
14 | * Use SFDX_AUDIENCE_URL env var to override the audience url
|
15 | *
|
16 | * @param createdOrgInstance The Salesforce instance the org was created on. e.g. `cs42`
|
17 | * @return {Promise<string>} The audience url
|
18 | */
|
19 | getJwtAudienceUrl(createdOrgInstance?: string): Promise<string>;
|
20 | /**
|
21 | * Tests whether this url contains a Salesforce owned domain
|
22 | *
|
23 | * @return {boolean} true if this is a salesforce domain
|
24 | */
|
25 | isSalesforceDomain(): boolean;
|
26 | /**
|
27 | * Tests whether this url is an internal Salesforce domain
|
28 | *
|
29 | * @returns {boolean} true if this is a internal domain
|
30 | */
|
31 | isInternalUrl(): boolean;
|
32 | /**
|
33 | * Tests whether this url runs on a local machine
|
34 | *
|
35 | * @returns {boolean} true if this is a local machine
|
36 | */
|
37 | isLocalUrl(): boolean;
|
38 | toLightningDomain(): string;
|
39 | /**
|
40 | * Tests whether this url has the lightning domain extension
|
41 | * 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
|
42 | * If SFDX_DOMAIN_RETRY environment variable is set (number) it overrides the default timeout duration (240 seconds)
|
43 | *
|
44 | * @returns {Promise<true | never>} The resolved ip address or never
|
45 | * @throws {@link SfdxError} If can't resolve DNS.
|
46 | */
|
47 | checkLightningDomain(): Promise<true | never>;
|
48 | /**
|
49 | * Method that performs the dns lookup of the host. If the lookup fails the internal polling (1 second), client will try again untill timeout
|
50 | * If SFDX_DOMAIN_RETRY environment variable is set (number) it overrides the default timeout duration (240 seconds)
|
51 | *
|
52 | * @returns the resolved ip address.
|
53 | * @throws {@link SfdxError} If can't resolve DNS.
|
54 | */
|
55 | lookup(): Promise<string>;
|
56 | /**
|
57 | * Tests whether this url is a sandbox url
|
58 | *
|
59 | * @param createdOrgInstance The Salesforce instance the org was created on. e.g. `cs42`
|
60 | * @returns {boolean}
|
61 | */
|
62 | isSandboxUrl(createdOrgInstance?: string): boolean;
|
63 | /**
|
64 | * Tests whether this url is a sandbox url
|
65 | * otherwise tries to resolve dns cnames and then look if any is sandbox url
|
66 | *
|
67 | * @param createdOrgInstance The Salesforce instance the org was created on. e.g. `cs42`
|
68 | * @returns {Promise<boolean>} true if this domain resolves to sanbox url
|
69 | */
|
70 | private resolvesToSandbox;
|
71 | }
|