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

    Class DatapackDeployment

    A datapack deployment task/job

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cancelToken?: CancellationToken
    connectionProvider: SalesforceConnectionProvider
    deltaComparison?: ReadonlyMap<string, DatapackRecordComparisonResult>
    deltaComparisonProvider?: DeltaComparisonProvider
    deltaComparisonValues?: ReadonlyMap<string, object>
    deployed: DatapackDeploymentRecord[] = ...
    errors: DatapackDeploymentRecord[] = ...
    isStarted: boolean = false
    logger: Logger
    lookupService: DatapackLookupService
    options: Readonly<
        DatapackDeploymentOptions & typeof datapackDeploymentDefaultOptions,
    >
    orgDependencyResolver: DatapackDependencyResolver
    recordGroups: Map<string, DatapackDeploymentRecordGroup> = ...
    recordGroupsErrors: Map<string, DatapackDeploymentError[]> = ...
    recordMatcher: DatapackRecordMatcher

    Matcher used to match embedded records without matching key against org data; used by the delta check to avoid deleting and recreating embedded records that are already in sync with the target org.

    records: Map<string, DatapackDeploymentRecord> = ...
    salesforceService: SalesforceService
    timer: Timer
    nonRetryableStatusCodes: Set<string> = ...

    Record error status codes that are deterministic and will fail again when retried with the same data; retrying these only slows down the deployment. All other record errors (such as UNABLE_TO_LOCK_ROW) may be transient or caused by records deployed later in the same deployment and are retried up to DatapackDeploymentOptions.maxRetries times.

    recordActionNames: Record<
        DeploymentAction,
        DatapackDeploymentRecordStatus["action"],
    > = ...
    recordStatusNames: Record<
        DeploymentStatus,
        DatapackDeploymentRecordStatus["status"],
    > = ...

    Accessors

    Methods

    • Add a Datapack level error to the deployment. This is used to add errors that are not related to a specific record but to a whole datapack, or to add errors that are related to a datapack for which the records could not added to the deployment.

      Parameters

      • datapackKey: string

        Group key of the datapack to which the error belongs

      • error: string | DatapackDeploymentError

        Error to add to the deployment

      Returns void

    • Match the pending dependents of the specified purge parents against the org data and skip dependents that are already in sync with the target org; a deployment would otherwise delete and recreate these records with identical data. Matching walks down the datapack tree: the dependents of a matched (preserved) record are matched against the org records under the preserved record.

      Parameters

      • parents: DatapackDeploymentRecord[]

        Deployed or skipped records whose dependents are about to be purged

      • dependentsBySourceKey: Map<
            string,
            {
                dependency: VlocityDatapackReference;
                field: string;
                record: DatapackDeploymentRecord;
            }[],
        >

        Pending records indexed by the source keys they depend on

      • predicate: RecordPurgePredicate

        Predicate that selects which dependents are purged

      Returns Promise<DatapackDeploymentRecord[]>

      The dependent records that were matched to an in-sync org record and skipped

    • Gets the deployment status of a Datapack by it's source key.

      • Returns the summary status of all records in the datapack.
      • Returns undefined if the datapack is not part of the deployment.

      Parameters

      • datapackKey: string

        Datapack key to get the deployment status for

      Returns DeploymentStatus | undefined

    • Retrieves the deployment messages for the datapack deployment.

      Parameters

      • Optionaloptions: { includeCascadeFailures?: boolean }

        An optional object that specifies additional options for retrieving the messages.

        • OptionalincludeCascadeFailures?: boolean

          A boolean indicating whether to include cascade failures in the messages. Default is false.

      Returns DatapackDeploymentRecordMessage[]

      An array of DatapackDeploymentRecordMessage objects representing the deployment messages.

    • Detect whether the dependency chain of a record loops back on itself. Returns the dependency path from the record into the detected cycle, or false when the chain is cycle free.

      Results are memoized in resolved so repeated checks (and shared sub-chains) resolve in constant time; pass the same map across calls to keep the overall complexity linear in the number of records and dependencies instead of exponential in the number of distinct paths.

      Parameters

      • record: DatapackDeploymentRecord

        Record to check

      • resolved: Map<string, false | string[]> = ...

        Memoized results per record source key; a string[] is the path into a cycle

      • active: Set<string> = ...

        Source keys on the current DFS path used to detect when a chain loops back

      Returns false | string[]

    • Checks if there is a circular dependency between two datapacks.

      Parameters

      • datapackKeyA: string

        The key of the first datapack.

      • datapackKeyB: string

        The key of the second datapack.

      • visited: Set<string> = ...

      Returns boolean

      True if there is a circular dependency, false otherwise.

    • Handles the error that occurs when emitting a callback event.

      Parameters

      • err: unknown

        The error that occurred.

      • event: string

        The name of the event.

      • failedCallback: EventReceiver<any>

        The failed callback event receiver.

      Returns void

    • Purge all records that depend on any of the records just deployed through their matching record key. Records that depend on other records from within the same Datapack have a relation to the parent datapack through Matching source key. This function will delete all child records that have a relationship parent record through a Matching source key

      Note this function will only delete records for parents that have been update and are deployed successfully

      Parameters

      Returns Promise<void>

    • Removes all listeners, or those of the specified event.

      It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).

      Returns a reference to the EventEmitter, so that calls can be chained.

      Type Parameters

      Parameters

      • Optionalevent: K

        event type to remove listeners for if not specified all listeners are removed

      Returns void

    • Resolve the dependencies either based on the records we are deploying -or- pass them on to the lookup resolver.

      Parameters

      • dependencies: DependencyResolutionRequest[]

        Dependency resolution requests to resolve

      Returns Promise<DependencyResolutionResult[]>

    • Internal

      Configure the comparison provider used to prepare a delta deployment. Datapack deployments created through DatapackDeployer receive a provider that runs the bulk comparer against this deployment's already-converted records.

      Parameters

      • provider: DeltaComparisonProvider

      Returns this