Private ReadonlyfieldNamespace normalized and split field paths cached by field name; see getFieldValue
Private ReadonlyloggerPrivate ReadonlynamespacePrivate ReadonlysalesforceNormalize a string to the canonical form used by fieldEquals for equality: 18-character Salesforce IDs are reduced to their 15-character form and other values are namespace normalized, lower cased and trimmed. Values with the same canonical form compare as equal in fieldEquals, which allows indexing values for fast record matching.
Compare datapack records with an ID (see DatapackDeploymentRecord.recordId) to org data and return per record details if the record is up to date with the org.
Only fields present in the datapack record are compared; fields that do not exist in the target org or that cannot be updated (see isComparableField) are ignored.
Datapack records to lookup
OptionalcancelToken: CancellationTokenOptional cancellation token to abort the comparison
OptionalorgRecords: ReadonlyMap<string, object>Optional pre-fetched org records keyed by record ID; when provided the org data is not queried and the records are compared against the provided data instead
Record org status returned as map keyed by both record ID and source key
Compares the value of a field on a (queried) org record against the expected value from a datapack using
Salesforce equality semantics: 15 and 18-character IDs are considered equal, strings are compared case-insensitive
with namespace normalization and without trailing spaces, date-like strings are compared as dates and
null equals an empty string.
Org record to read the field value from; supports relationship paths (e.g. Parent.Name)
Field name or relationship path to compare
Expected value from the datapack
OptionalfieldDescribe: FieldOptional field describe; when provided multi-select picklist values are compared as unordered sets
Read the value of a field (or relationship path) from a (queried) org record applying namespace normalization on the field name; uses the same field access as fieldEquals. The normalized field paths are cached as this function is called for every compared field of every record.
Org record to read the field value from
Field name or relationship path (e.g. Parent.Name)
Get the canonical index key form of an expected (datapack or filter) value; returns undefined
when the value cannot be indexed exactly -- date-like strings that fieldEquals matches
fuzzily and non-primitive values -- in which case the caller falls back to comparing per record.
Mirrors getRecordIndexValue for the expected side of an index.
Get the canonical index key form (canonicalMatchValue) of a field value on a (queried) org record; used to index org records for fast matching against expected values.
Org record to read the field value from
Field name or relationship path
Determines if a field can be compared between a datapack record and the target org. Fields that do
not exist in the target org (undefined), auto-number fields, formula fields and fields that are
not updateable cannot be deployed and are excluded from any comparison.
Field describe of the field to check; undefined when the field does not exist in the target org
Returns true when the value could be matched fuzzily by fieldEquals (i.e. as a date) and
therefore cannot be captured by an exact index on the canonicalMatchValue form.
PrivatenormalizeNormalize a string for comparison in fieldEquals: case-insensitive with CRLF line endings normalized to LF.
PrivatepicklistNormalize a multi-select picklist value into an order insensitive comparable form.
Determines if a (queried) org record satisfies the specified filter using fieldEquals semantics.
Org record to check
Filter with the expected field values
Compares datapack deployment records against the record data in the target org. Used by the deployment delta check as well as the DatapackComparer to determine if records are in sync with the target org.