vlocode-project - v2.4.3
    Preparing search index...

    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.

    Index

    Constructors

    Properties

    fieldPaths: Map<string, string[]> = ...

    Namespace normalized and split field paths cached by field name; see getFieldValue

    logger: Logger = ...
    namespaceService: VlocityNamespaceService
    salesforce: SalesforceService

    Methods

    • Normalize 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.

      Parameters

      • value: string

      Returns string

    • 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.

      Parameters

      • datapacks: DatapackDeploymentRecord[]

        Datapack records to lookup

      • OptionalcancelToken: CancellationToken

        Optional 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

      Returns Promise<Map<string, OrgRecordStatus>>

      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.

      Parameters

      • record: object

        Org record to read the field value from; supports relationship paths (e.g. Parent.Name)

      • field: string

        Field name or relationship path to compare

      • filterValue: any

        Expected value from the datapack

      • OptionalfieldDescribe: Field

        Optional field describe; when provided multi-select picklist values are compared as unordered sets

      Returns boolean

    • 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.

      Parameters

      • record: object

        Org record to read the field value from

      • field: string

        Field name or relationship path (e.g. Parent.Name)

      Returns unknown

    • 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.

      Parameters

      • value: unknown

      Returns string | undefined

    • 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.

      Parameters

      • record: object

        Org record to read the field value from

      • field: string

        Field name or relationship path

      Returns string

    • 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.

      Parameters

      • field: Field | undefined

        Field describe of the field to check; undefined when the field does not exist in the target org

      Returns field is Field

    • Determines if a (queried) org record satisfies the specified filter using fieldEquals semantics.

      Parameters

      • record: object

        Org record to check

      • filter: object

        Filter with the expected field values

      Returns boolean