1 | import { JsonMap, Optional } from '@salesforce/ts-types';
|
2 | /**
|
3 | * Converts an 18 character Salesforce ID to 15 characters.
|
4 | *
|
5 | * @param id The id to convert.
|
6 | */
|
7 | export declare function trimTo15(id: string): string;
|
8 | export declare function trimTo15(id?: undefined): undefined;
|
9 | export declare function trimTo15(id: string | undefined): string | undefined;
|
10 | /**
|
11 | * Tests whether an API version matches the format `i.0`.
|
12 | *
|
13 | * @param value The API version as a string.
|
14 | */
|
15 | export declare const validateApiVersion: (value: string) => boolean;
|
16 | /**
|
17 | * Tests whether an email matches the format `me@my.org`
|
18 | *
|
19 | * @param value The email as a string.
|
20 | */
|
21 | export declare const validateEmail: (value: string) => boolean;
|
22 | /**
|
23 | * Tests whether a given url is an internal Salesforce domain
|
24 | *
|
25 | * @param url
|
26 | */
|
27 | export declare const isInternalUrl: (url: string) => boolean;
|
28 | /**
|
29 | * Tests whether a Salesforce ID is in the correct format, a 15- or 18-character length string with only letters and numbers
|
30 | *
|
31 | * @param value The ID as a string.
|
32 | */
|
33 | export declare const validateSalesforceId: (value: string) => boolean;
|
34 | /**
|
35 | * Tests whether a path is in the correct format; the value doesn't include the characters "[", "]", "?", "<", ">", "?", "|"
|
36 | *
|
37 | * @param value The path as a string.
|
38 | */
|
39 | export declare const validatePathDoesNotContainInvalidChars: (value: string) => boolean;
|
40 | /**
|
41 | * Returns the first key within the object that has an upper case first letter.
|
42 | *
|
43 | * @param data The object in which to check key casing.
|
44 | * @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`.
|
45 | */
|
46 | export declare const findUpperCaseKeys: (data?: JsonMap, sectionBlocklist?: string[]) => Optional<string>;
|
47 | /**
|
48 | * Tests whether a given string is an access token
|
49 | *
|
50 | * @param value
|
51 | */
|
52 | export declare const matchesAccessToken: (value: string) => boolean;
|
53 | /** @deprecated import the individual functions instead of the whole object */
|
54 | export declare const sfdc: {
|
55 | trimTo15: typeof trimTo15;
|
56 | validateApiVersion: (value: string) => boolean;
|
57 | validateEmail: (value: string) => boolean;
|
58 | isInternalUrl: (url: string) => boolean;
|
59 | matchesAccessToken: (value: string) => boolean;
|
60 | validateSalesforceId: (value: string) => boolean;
|
61 | validatePathDoesNotContainInvalidChars: (value: string) => boolean;
|
62 | findUpperCaseKeys: (data?: JsonMap, sectionBlocklist?: string[]) => Optional<string>;
|
63 | };
|