sf-plugin-data 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -12
- package/docs/capabilities.md +8 -8
- package/docs/git-workflow.md +5 -6
- package/docs/handover.md +32 -32
- package/lib/api.d.ts +7 -0
- package/lib/api.js +5 -1
- package/lib/commands/data360/delete.d.ts +57 -12
- package/lib/commands/data360/delete.js +190 -41
- package/lib/commands/data360/deploy.d.ts +14 -2
- package/lib/commands/data360/deploy.js +32 -20
- package/lib/commands/data360/publish.d.ts +2 -2
- package/lib/commands/data360/publish.js +14 -12
- package/lib/commands/data360/retrieve.js +1 -2
- package/lib/errors/codes/general.js +4 -2
- package/lib/errors/codes/segment.js +1 -1
- package/lib/services/command-native-data-graph.js +1 -1
- package/lib/services/delete-calculated-insight.js +1 -1
- package/lib/services/delete-identity-resolution.js +1 -1
- package/lib/services/delete-segment.js +1 -1
- package/lib/services/native-data-graph-crd.d.ts +2 -2
- package/lib/services/native-data-graph-crd.js +2 -2
- package/lib/services/operation-diagnostic.js +1 -1
- package/lib/services/publish-segment.d.ts +1 -1
- package/lib/services/run-delete.d.ts +43 -0
- package/lib/services/run-delete.js +111 -0
- package/lib/services/run-deploy.d.ts +51 -0
- package/lib/services/run-deploy.js +107 -0
- package/lib/services/run-options.d.ts +23 -0
- package/lib/services/run-options.js +38 -0
- package/lib/services/run-retrieve.js +3 -0
- package/lib/transport/connect-client.d.ts +8 -0
- package/lib/transport/connect-client.js +25 -1
- package/package.json +1 -1
|
@@ -150,11 +150,13 @@ function withDataSpacePrefix(options, prefix) {
|
|
|
150
150
|
return [{ ...options[0], ...prefix }];
|
|
151
151
|
return prefix.dataSpacePrefix === undefined ? [] : [prefix];
|
|
152
152
|
}
|
|
153
|
+
/** Default wait per native data graph, in minutes. */
|
|
154
|
+
const defaultGraphWaitMinutes = 30;
|
|
153
155
|
/** Preview or sequential guarded deployment of explicitly selected authored configuration. */
|
|
154
156
|
export default class Deploy extends SfCommand {
|
|
155
157
|
static aliases = ['datacloud:deploy', 'd360:deploy', 'dc:deploy'];
|
|
156
158
|
static summary = 'Deploy explicit authored Data360 configuration or preview without writes.';
|
|
157
|
-
static description = 'Data transforms (data-transform:Name, data360/dataTransforms/Name.dataTransform.json, auto/API68, in the run data space: c__dataSpace must name it and equal definition.dataSpaceName when the definition names one; TRANSFORM_DATASPACE_MISMATCH otherwise, also for an org transform of that name in another data space, resolved from its dataSpaceName or, without one, from its MktDataTransform record read with SOQL (one without any data space is handled in default only); a create outside default needs definition.dataSpaceName) deploy by name: the complete transform list is read, no match creates, one match updates or is unchanged (the file equals the transform as retrieve writes it), a match that differs only in letter case is refused (TRANSFORM_IDENTITY_MISMATCH), two or more are refused (TRANSFORM_TARGET_NOT_RESOLVED). The file is sent as written and Salesforce decides, for a transform of any owner (Salesforce refuses writes to system transforms; a 4xx answer to the first write is reported as rejected); --allow-processing is not needed. Create is validated by Salesforce first; preview is GET-only. The optional schedule key of the file is the desired schedule: absent leaves the schedule alone; otherwise, when it differs from the org schedule as retrieve projects it, it is sent with one schedule PUT after the definition and read back, and an explicit {"frequency":"None"} turns it off (retrieve leaves the key out for a transform without a schedule). A deployed schedule makes the transform run in the target org (TRANSFORM_SCHEDULE_CHANGE in preview and deploy). No run writes. Several transforms deploy one after another in their phase, selected by member, file, directory or --changed-since. Exact data-stream:ApiName deploys canonical data360/data-stream/ApiName.data-stream-meta.json using auto/API68 in the run data space: its c__dataSpace list must name it and, for an existing stream, equal the data spaces of its DLO (a new stream lists the run data space alone, sent as the DLO dataspaceInfo of the create); data spaces change only through the DLO file (STREAM_DATASPACE_MISMATCH). An Ingestion API stream file is sent as written and Salesforce decides: create carries the primary key, the additive and formula mappings and the refresh mode (Salesforce creates UPSERT only); update sends new, changed and removed additive and formula mappings in one PATCH, a removed one as an empty formula (Salesforce refuses changing or removing an existing mapping; reported as rejected). Refused before any write: an additive mapping whose source label names no event field, or several (UNSUPPORTED_STREAM_MAPPING_SOURCE; Salesforce would store a mapping that never carries data), and a change of the refresh mode, DLO label, category, event time field or primary key (UNSUPPORTED_STREAM_SETTINGS_CHANGE; Salesforce answers 200 and keeps the old value). Create/update requires --allow-processing. A stream file of any other connector (connectorInfo.connectorType, for example SalesforceDotCom; only Salesforce CRM is tested live) is translated into the create input (GET spellings renamed, plain field mappings left out) and sent as written: absent (404) creates, otherwise one PATCH of datastreamType and the changed parts, or unchanged; Salesforce decides and its answer is reported (it refuses a CRM refresh mode change); a plain mapping change cannot be sent (UNSUPPORTED_STREAM_SETTINGS_CHANGE). A stream label change (CRM and Ingestion API) is sent as one Metadata API updateMetadata of the DataStreamDefinition of the stream (refusal STREAM_LABEL_UPDATE_REJECTED; a failed read of the record before it STREAM_LABEL_READ_FAILED, with nothing sent; a label still unchanged is STREAM_CHANGE_NOT_APPLIED). Generated target identities are independently resolved; mismatching label intent blocks. Requires explicit files/directories OR exact family:ApiName selectors OR --changed-since Git selection (every family; files deleted in the range are reported in result.selection.deletions and never deleted by deploy (sf data360 delete --changed-since deletes them)). Canonical native DLO/DMO/mapping/relationship JSON defaults to API68 (auto); numeric pins >=61 are retained without upgrade. Any mix of families runs in phases: data streams, then native DLO/DMO/mapping/relationship, then data transforms, then IR/CI/Segment, then data graphs; a phase starts only after every item of the previous phase settled, and the first blocked or failed item stops the run. A DLO file named like the landing DLO of a stream this deploy creates is refused after the read-only comparison of that stream and before any write (DATA_STREAM_DLO_COLLISION); beside an existing stream it deploys and Salesforce decides. Native mixed selections execute DLO then DMO then mapping then relationship, independently settling parents before mapping and relationship dependency checks. A selection with a mapping or relationship may also hold IR, CI and Segment inputs: they run afterwards in the ordered batch, only once every native item settled; preview reports items whose parent an earlier phase creates as planned-dependencies (DEPENDENCIES_PLANNED; MAPPING_DEPENDENCIES_PLANNED for a mapping): a mapping or transform on the landing DLO of a stream preview creates, items on a DLO or DMO the native phase creates, and a graph on a DMO or IR output created earlier. An IR runs before a CI or Segment that uses its unified or link DMO (name derived from the ruleset file), and those start only after the IR is PUBLISHED. A relationship (relationship:Name, data360/relationship/Name.relationship-meta.json) is matched to the org by the name in the file, otherwise by its binding (source DMO and field, target object and field; the target may be a DMO or a CRM object with owner SObject): absent is created with one POST and read back until ACTIVE (a stated label is then set), present with the values of the file (and stated label) is unchanged, and other values are sent as one Metadata API updateMetadata of the whole FieldSrcTrgtRelationship record over the connection of the command and read back (updated); Salesforce decides, and its refusal is RELATIONSHIP_UPDATE_REJECTED (it accepts label, cardinality, source and target field, not target object or owner); after an UNKNOWN_EXCEPTION answer the relationship is read again and, if unchanged, the update is sent once more. Deploy never deletes relationships. The source DMO and a target DMO must be mapped; otherwise Salesforce answers 400 and that answer is reported. Mapping uses exact mapping:ApiName from data360/mapping/ApiName.mapping-meta.json, unique target binding lookup and server-generated target names; create and unchanged repeats are supported; desired-state updates at native API 61 and up remove the authored pairs the file drops, one at a time, then add the new pairs in one batch; any data type, same-name or not, and one source onto several targets are sent as listed and Salesforce decides (preview names pairs of different data types with MAPPING_FIELD_TYPES_DIFFER). The key pair, its key-qualifier pair and the system pairs are never removed (MAPPING_PROTECTED_PAIR_REQUIRED when a file drops one; MAPPING_PROTECTED_LAYOUT_UNPROVEN when the key pair cannot be identified). Generated/key pairs and retained selectors are protected. A pair is removed even when another mapping of the same DMO targets the same field; the field stays mapped until the last such pair is gone. The optional label of a mapping file (spec.label; absent leaves the org label alone) is compared with the org label read through the Metadata API; when it differs, one Metadata API updateMetadata of the ObjectSourceTargetMap record is sent after the create or pair writes settled, carrying the new label and every pair the mapping currently has and no other (a pair left out is kept, a pair sent is added), and the label and pairs are read back; preview shows the planned change (labelChange). A refusal is MAPPING_LABEL_UPDATE_REJECTED (rejected when the label is the only change, unknown after other writes); a failed read MAPPING_LABEL_READ_FAILED. Any DMO may be the mapping target and Salesforce decides (it refuses platform-generated DMOs; that answer is reported). On a target other than an unprefixed custom DMO the generated system and key qualifier pairs are recognised from the target read and never sent, and the first mapping onto a standard DMO (creationType Standard) that is not yet enabled activates it permanently: preview and create carry the notice MAPPING_ACTIVATES_STANDARD_DMO without changing outcome or exit status. Qualification is limited to empty custom fixtures; populated-data behavior is not established. Preview never writes and reports planned dependencies without claiming nonexistent parents are ready. A native DMO changed since a Git reference or selected beside Segment/CI/IR inputs joins the ordered batch on the native route. Prerequisites are checked, never pulled in: each must be selected explicitly or already exist in the target. Native DMO target-name lookup selects confirmed-404 POST or existing-name PATCH with independent GET confirmation. A custom DMO field missing from the file blocks the update unless --allow-field-removal is set; then one Metadata API destructive change for CustomField removes those fields after the PATCH, and readback confirms their absence. A mapped field is removed only when the same selection contains every mapping holding its pair and each mapping file omits that pair; all-native selections check this before the first write (DMO_FIELD_REMOVAL_MAPPED otherwise), then remove the field in the DMO position with one Metadata API destructive change. Salesforce drops the mapping pairs of the field with it; reads before and after confirm that exactly those pairs went and nothing else changed (DMO_FIELD_REMOVAL_SIDE_EFFECT otherwise), and the mappings deployed afterwards find the pairs already gone. A deploy never removes the primary key or a standard, system or generated field: retrieve leaves generated fields out of the file, so a field missing from the file is kept. Platform-owned fields are removed only with sf data360 delete --field. An existing DMO other than an unprefixed custom one (a standard DMO, a platform-generated one such as Derived, Bridge or Adg, or a namespaced custom DMO) takes custom-field additions, label edits and removals plus object label and description changes only: its standard, system and generated fields are never sent or removed by a deploy, may be absent from the file and must match the target when listed (UNSUPPORTED_DMO_FIELD_CHANGE); a new field must be a plain custom field (UNSUPPORTED_DMO_FIELD_ADDITION); its category is ignored and its label is sent only when it differs. A new namespaced name is refused (UNSUPPORTED_DMO_TARGET); Salesforce answers for the rest. Native DLOs use dlo:Name__dll from data360/dlo/Name__dll.dlo-meta.json, whose top-level c__dataSpace list names every data space of the DLO and must hold the run data space (DLO_DATASPACE_MISMATCH); before any read or write the run data space and every listed name are checked against the org (one GET /ssot/data-spaces; UNKNOWN_DATASPACE). A new DLO is created in the run data space, then added to the other listed ones; an existing one is added to listed data spaces it is not in (one PUT naming only this DLO, which keeps every other member, then the DLO is read until it lists them) and removed from unlisted ones only with --allow-dataspace-removal (DLO_DATASPACE_REMOVAL_NOT_ALLOWED otherwise). Target lookup selects PATCH by target ID, or POST only on confirmed HTTP404; auth/permission/lookup failures stop. Preview is read-only; native DLO deploy does not require --allow-processing. Inventory is unavailable. Graph artifacts (*.native-dataGraph.json) use native API68 (auto or explicit 68.0; other versions are rejected) in the run data space (c__dataSpace; definition.dataspaceName, when present, must equal it, and the create sends it; a file of another data space, or an org graph of that name in another one, is DATA_GRAPH_DATASPACE_MISMATCH before any write; a root DMO the read names in another data space is DATA_GRAPH_DEPENDENCY_OTHER_DATASPACE): confirmed absence creates with --allow-processing; an existing graph is updated with one PUT of the file as written, confirmed by independent ready reads; Salesforce decides and a 4xx answer is reported as rejected (it refuses removed fields and related objects, a root change and another related object in place of an existing one). Key-qualifier fields Salesforce added are kept when the file leaves them out. A join change of an existing related object is refused before any write (DATA_GRAPH_JOIN_CHANGE), because Salesforce accepts it but keeps the old join; a graph read back with another join than sent is DATA_GRAPH_CHANGE_NOT_APPLIED. Settings the file leaves out keep their org values; clearing one needs an explicit value. Name and data space identify the graph: a file with another name creates or addresses another graph, and the old graph is not renamed. Identical ready configuration is unchanged without acknowledgement. --wait-timeout sets the native Graph invocation budget in integer seconds (default 1800); readiness retries wait at least 20 seconds with stderr progress. Processing can take seconds to many minutes, up to 30 minutes depending on objects, fields, data volume and service load. In a mixed deploy graphs run last; a graph whose root or related object is the unified or link DMO of a selected IR starts only after that IR is PUBLISHED. --wait-timeout applies to every graph and needs at least one graph in the selection. Calculated insights (calculated-insight:Name__cio, data360/calculatedInsights/Name__cio.calculatedInsight-meta.json joined with its .calculatedInsight-meta.sql) use auto or 68.0 in the run data space, which c__dataSpace in the JSON must name (CI_DATASPACE_MISMATCH); c__dataSpace is sent as dataSpaceName in every create and update. The insight is read by name: absent (HTTP 404) creates it with one POST, present is unchanged when the org holds every key of the file and is updated with one PATCH otherwise; afterwards it is read until it holds the file. The file is sent as written and Salesforce decides (a 4xx answer is reported as rejected); only what the create/update input names differently is translated: dataSpace as dataSpaceName, isFromPackage as createdFromPackage, sourceCiDevName as sourceDeveloperName, UPPER_SNAKE values of definitionType, publishScheduleInterval, historyPublishScheduleInterval and queryDialect as PascalCase, null values are left out, and a PATCH leaves out a definitionType equal to the org value (Salesforce refuses any definitionType on PATCH). The insight runs after the selected DMOs, IRs and insights its SQL names. --draft creates a draft and sends draft: true on update; an update of a DRAFT insight stays a draft. Publication is never implicit (sf data360 publish). --allow-processing is not needed. Repeated selections coalesce. Bare types and implicit deploy-all are forbidden. Preview is strictly read-only. Each phase stage preflights all of its own items before its first write: a batch of Segment, CI or IR inputs (with DLO/DMO beside them when no mapping or relationship is selected) is preflighted as a whole, and an IR dependent stage only after the IR is PUBLISHED; all-native DLO/DMO/mapping execution admits each ordered item only after earlier parents settle. In a selection that also holds a mapping or relationship, only the local checks of the IR/CI/Segment inputs (version, data space, file shape, dependency identities and order) run before the native writes; their Git snapshot, prerequisite and target checks run in their later stage, so a blocker there can follow earlier native writes, which stay reported. Preview runs every stage read-only, also after a blocked one. Segment (segment:Name, the portable Name.segment.json joined with one Name.segment.<model>.sql per model; a missing or extra SQL file or SQL left in the JSON is INVALID_SOURCE) uses auto or 68.0 in the run data space, which c__dataSpace must name (SEGMENT_DATASPACE_MISMATCH); its segmentOn DMO and Waterfall children are in the same data space (SEGMENT_DEPENDENCY_OTHER_DATASPACE). The file carries the name Salesforce stores (<prefix>_<Name> in a non-default data space; a name without the prefix is SEGMENT_NAME_NOT_STORED), sent unchanged; the create names the data space (?dataspace=). Other versions are refused (INVALID_SCOPE). It is read by its exact name: absent (HTTP 404 ITEM_NOT_FOUND) creates it with one POST, present updates it with one PATCH or is unchanged. The authored definition (label, description, segmentOn DMO, DBT SQL models, UI criteria or another segment type, lookback) is sent as written and Salesforce decides; its error is reported. The optional schedule key of the file is the desired refresh schedule: absent leaves the schedule alone; otherwise, when it differs from the org schedule as retrieve projects it, the POST or PATCH carries it, and an explicit {"frequency":"None"} turns it off (Salesforce refuses that for DBT segments; retrieve leaves the key out for a segment without a schedule). A deployed schedule makes the segment publish in the target org (SEGMENT_SCHEDULE_CHANGE in preview and deploy). The segmentOn DMO must exist (one native read binds its ID for the readback). A Waterfall file lists its child segments by API name (childSegments): each is read in the target and sent by its ID there, a selected child is deployed first (preview: planned-dependencies), and the children the selection does not hold are read before the first write of the run, so a child neither in the target nor selected stops it before any write (SEGMENT_CHILD_NOT_FOUND); a file without childSegments keeps the children of the org segment. Create and update require --allow-processing; identical configuration is unchanged without acknowledgement. Parameters have no write in the API, so a segment with parameters is retrieved as-is (UNSUPPORTED_SEGMENT_VARIANT). Segment XML is unsupported input. Segment deletion is separate: sf data360 delete -m segment:Name reads the segment from the org by name and runs fresh checks. Native IR uses auto or numeric68 in the run data space (c__dataSpace; every DMO, field, DLO source and output it names is in that data space, named as stored there, ds2_Individual__dlm with FirstName__c outside default; the ruleset name is <prefix>_<type>_<rulesetId> outside default, IDENTITY_RESOLUTION_NAME_NOT_STORED before any write otherwise; a ruleset or component of another data space is IDENTITY_RESOLUTION_DATASPACE_MISMATCH or IDENTITY_RESOLUTION_DEPENDENCY_OTHER_DATASPACE): confirmed exact absence supports CREATE with --allow-processing acknowledging processing and generated-output provisioning; existing settled owners support complete matching and reconciliation PATCH with --allow-processing or read-only identical no-op without acknowledgement. Ordered source priorities, object defaults and explicit field overrides are preserved; fields:[] restores inheritance. Automatic run, explicit run and delete are unsupported; no API67 fallback is attempted. --async (IR only) returns as soon as Salesforce accepts an IR create or update (creation-processing / update-processing, mutation acknowledged-processing) instead of waiting minutes for PUBLISHED: publish, settings and generated outputs are not confirmed; rerun the same deploy to check (IDENTITY_RESOLUTION_NOT_SETTLED while in flight, unchanged once settled). --async is refused when the selection holds a graph, CI or Segment on the unified DMO of that IR (IDENTITY_RESOLUTION_ASYNC_DEPENDENTS). Selections mixing IR with other non-native families require auto. Other changes block before writes. Stops on first blocked or failed item; no retry or rollback. No local report/artifact writes.';
|
|
159
|
+
static description = 'Data transforms (data-transform:Name, data360/dataTransforms/Name.dataTransform.json, auto/API68, in the run data space: c__dataSpace must name it and equal definition.dataSpaceName when the definition names one; TRANSFORM_DATASPACE_MISMATCH otherwise, also for an org transform of that name in another data space, resolved from its dataSpaceName or, without one, from its MktDataTransform record read with SOQL (one without any data space is handled in default only); a create outside default needs definition.dataSpaceName) deploy by name: the complete transform list is read, no match creates, one match updates or is unchanged (the file equals the transform as retrieve writes it), a match that differs only in letter case is refused (TRANSFORM_IDENTITY_MISMATCH), two or more are refused (TRANSFORM_TARGET_NOT_RESOLVED). The file is sent as written and Salesforce decides, for a transform of any owner (Salesforce refuses writes to system transforms; a 4xx answer to the first write is reported as rejected); --allow-processing is not needed. Create is validated by Salesforce first; preview is GET-only. The optional schedule key of the file is the desired schedule: absent leaves the schedule alone; otherwise, when it differs from the org schedule as retrieve projects it, it is sent with one schedule PUT after the definition and read back, and an explicit {"frequency":"None"} turns it off (retrieve leaves the key out for a transform without a schedule). A deployed schedule makes the transform run in the target org (TRANSFORM_SCHEDULE_CHANGE in preview and deploy). No run writes. Several transforms deploy one after another in their phase, selected by member, file, directory or --changed-since. Exact data-stream:ApiName deploys canonical data360/data-stream/ApiName.data-stream-meta.json using auto/API68 in the run data space: its c__dataSpace list must name it and, for an existing stream, equal the data spaces of its DLO (a new stream lists the run data space alone, sent as the DLO dataspaceInfo of the create); data spaces change only through the DLO file (STREAM_DATASPACE_MISMATCH). An Ingestion API stream file is sent as written and Salesforce decides: create carries the primary key, the additive and formula mappings and the refresh mode (Salesforce creates UPSERT only); update sends new, changed and removed additive and formula mappings in one PATCH, a removed one as an empty formula (Salesforce refuses changing or removing an existing mapping; reported as rejected). Refused before any write: an additive mapping whose source label names no event field, or several (UNSUPPORTED_STREAM_MAPPING_SOURCE; Salesforce would store a mapping that never carries data), and a change of the refresh mode, DLO label, category, event time field or primary key (UNSUPPORTED_STREAM_SETTINGS_CHANGE; Salesforce answers 200 and keeps the old value). Create/update requires --allow-processing. A stream file of any other connector (connectorInfo.connectorType, for example SalesforceDotCom; only Salesforce CRM is tested live) is translated into the create input (GET spellings renamed, plain field mappings left out) and sent as written: absent (404) creates, otherwise one PATCH of datastreamType and the changed parts, or unchanged; Salesforce decides and its answer is reported (it refuses a CRM refresh mode change); a plain mapping change cannot be sent (UNSUPPORTED_STREAM_SETTINGS_CHANGE). A stream label change (CRM and Ingestion API) is sent as one Metadata API updateMetadata of the DataStreamDefinition of the stream (refusal STREAM_LABEL_UPDATE_REJECTED; a failed read of the record before it STREAM_LABEL_READ_FAILED, with nothing sent; a label still unchanged is STREAM_CHANGE_NOT_APPLIED). Generated target identities are independently resolved; mismatching label intent blocks. Requires explicit files/directories OR exact family:ApiName selectors OR --changed-since Git selection (every family; files deleted in the range are reported in result.selection.deletions and never deleted by deploy (sf data360 delete --changed-since deletes them)). Canonical native DLO/DMO/mapping/relationship JSON defaults to API68 (auto); numeric pins >=61 are retained without upgrade. Any mix of families runs in phases: data streams, then native DLO/DMO/mapping/relationship, then data transforms, then IR/CI/Segment, then data graphs; a phase starts only after every item of the previous phase settled, and the first blocked or failed item stops the run. A DLO file named like the landing DLO of a stream this deploy creates is refused after the read-only comparison of that stream and before any write (DATA_STREAM_DLO_COLLISION); beside an existing stream it deploys and Salesforce decides. Native mixed selections execute DLO then DMO then mapping then relationship, independently settling parents before mapping and relationship dependency checks. A selection with a mapping or relationship may also hold IR, CI and Segment inputs: they run afterwards in the ordered batch, only once every native item settled; preview reports items whose parent an earlier phase creates as planned-dependencies (DEPENDENCIES_PLANNED; MAPPING_DEPENDENCIES_PLANNED for a mapping): a mapping or transform on the landing DLO of a stream preview creates, items on a DLO or DMO the native phase creates, and a graph on a DMO or IR output created earlier. An IR runs before a CI or Segment that uses its unified or link DMO (name derived from the ruleset file), and those start only after the IR is PUBLISHED. A relationship (relationship:Name, data360/relationship/Name.relationship-meta.json) is matched to the org by the name in the file, otherwise by its binding (source DMO and field, target object and field; the target may be a DMO or a CRM object with owner SObject): absent is created with one POST and read back until ACTIVE (a stated label is then set), present with the values of the file (and stated label) is unchanged, and other values are sent as one Metadata API updateMetadata of the whole FieldSrcTrgtRelationship record over the connection of the command and read back (updated); Salesforce decides, and its refusal is RELATIONSHIP_UPDATE_REJECTED (it accepts label, cardinality, source and target field, not target object or owner); after an UNKNOWN_EXCEPTION answer the relationship is read again and, if unchanged, the update is sent once more. Deploy never deletes relationships. The source DMO and a target DMO must be mapped; otherwise Salesforce answers 400 and that answer is reported. Mapping uses exact mapping:ApiName from data360/mapping/ApiName.mapping-meta.json, unique target binding lookup and server-generated target names; create and unchanged repeats are supported; desired-state updates at native API 61 and up remove the authored pairs the file drops, one at a time, then add the new pairs in one batch; any data type, same-name or not, and one source onto several targets are sent as listed and Salesforce decides (preview names pairs of different data types with MAPPING_FIELD_TYPES_DIFFER). The key pair, its key-qualifier pair and the system pairs are never removed (MAPPING_PROTECTED_PAIR_REQUIRED when a file drops one; MAPPING_PROTECTED_LAYOUT_UNPROVEN when the key pair cannot be identified). Generated/key pairs and retained selectors are protected. A pair is removed even when another mapping of the same DMO targets the same field; the field stays mapped until the last such pair is gone. The optional label of a mapping file (spec.label; absent leaves the org label alone) is compared with the org label read through the Metadata API; when it differs, one Metadata API updateMetadata of the ObjectSourceTargetMap record is sent after the create or pair writes settled, carrying the new label and every pair the mapping currently has and no other (a pair left out is kept, a pair sent is added), and the label and pairs are read back; preview shows the planned change (labelChange). A refusal is MAPPING_LABEL_UPDATE_REJECTED (rejected when the label is the only change, unknown after other writes); a failed read MAPPING_LABEL_READ_FAILED. Any DMO may be the mapping target and Salesforce decides (it refuses platform-generated DMOs; that answer is reported). On a target other than an unprefixed custom DMO the generated system and key qualifier pairs are recognised from the target read and never sent, and the first mapping onto a standard DMO (creationType Standard) that is not yet enabled activates it permanently: preview and create carry the notice MAPPING_ACTIVATES_STANDARD_DMO without changing outcome or exit status. Qualification is limited to empty custom fixtures; populated-data behavior is not established. Preview never writes and reports planned dependencies without claiming nonexistent parents are ready. A native DMO changed since a Git reference or selected beside Segment/CI/IR inputs joins the ordered batch on the native route. Prerequisites are checked, never pulled in: each must be selected explicitly or already exist in the target. Native DMO target-name lookup selects confirmed-404 POST or existing-name PATCH with independent GET confirmation. A custom DMO field missing from the file blocks the update unless --allow-field-removal is set; then one Metadata API destructive change for CustomField removes those fields after the PATCH, and readback confirms their absence. A mapped field is removed only when the same selection contains every mapping holding its pair and each mapping file omits that pair; all-native selections check this before the first write (DMO_FIELD_REMOVAL_MAPPED otherwise), then remove the field in the DMO position with one Metadata API destructive change. Salesforce drops the mapping pairs of the field with it; reads before and after confirm that exactly those pairs went and nothing else changed (DMO_FIELD_REMOVAL_SIDE_EFFECT otherwise), and the mappings deployed afterwards find the pairs already gone. A deploy never removes the primary key or a standard, system or generated field: retrieve leaves generated fields out of the file, so a field missing from the file is kept. Platform-owned fields are removed only with sf data360 delete --field. An existing DMO other than an unprefixed custom one (a standard DMO, a platform-generated one such as Derived, Bridge or Adg, or a namespaced custom DMO) takes custom-field additions, label edits and removals plus object label and description changes only: its standard, system and generated fields are never sent or removed by a deploy, may be absent from the file and must match the target when listed (UNSUPPORTED_DMO_FIELD_CHANGE); a new field must be a plain custom field (UNSUPPORTED_DMO_FIELD_ADDITION); its category is ignored and its label is sent only when it differs. A new namespaced name is refused (UNSUPPORTED_DMO_TARGET); Salesforce answers for the rest. Native DLOs use dlo:Name__dll from data360/dlo/Name__dll.dlo-meta.json, whose top-level c__dataSpace list names every data space of the DLO and must hold the run data space (DLO_DATASPACE_MISMATCH); before any read or write the run data space and every listed name are checked against the org (one GET /ssot/data-spaces; UNKNOWN_DATASPACE). A new DLO is created in the run data space, then added to the other listed ones; an existing one is added to listed data spaces it is not in (one PUT naming only this DLO, which keeps every other member, then the DLO is read until it lists them) and removed from unlisted ones only with --allow-dataspace-removal (DLO_DATASPACE_REMOVAL_NOT_ALLOWED otherwise). Target lookup selects PATCH by target ID, or POST only on confirmed HTTP404; auth/permission/lookup failures stop. Preview is read-only; native DLO deploy does not require --allow-processing. Inventory is unavailable. Graph artifacts (*.native-dataGraph.json) use native API68 (auto or explicit 68.0; other versions are rejected) in the run data space (c__dataSpace; definition.dataspaceName, when present, must equal it, and the create sends it; a file of another data space, or an org graph of that name in another one, is DATA_GRAPH_DATASPACE_MISMATCH before any write; a root DMO the read names in another data space is DATA_GRAPH_DEPENDENCY_OTHER_DATASPACE): confirmed absence creates with --allow-processing; an existing graph is updated with one PUT of the file as written, confirmed by independent ready reads; Salesforce decides and a 4xx answer is reported as rejected (it refuses removed fields and related objects, a root change and another related object in place of an existing one). Key-qualifier fields Salesforce added are kept when the file leaves them out. A join change of an existing related object is refused before any write (DATA_GRAPH_JOIN_CHANGE), because Salesforce accepts it but keeps the old join; a graph read back with another join than sent is DATA_GRAPH_CHANGE_NOT_APPLIED. Settings the file leaves out keep their org values; clearing one needs an explicit value. Name and data space identify the graph: a file with another name creates or addresses another graph, and the old graph is not renamed. Identical ready configuration is unchanged without acknowledgement. --wait (-w) sets the native Graph invocation budget in whole minutes (default 30); readiness retries wait at least 20 seconds with stderr progress. Processing can take seconds to many minutes, up to 30 minutes depending on objects, fields, data volume and service load. In a mixed deploy graphs run last; a graph whose root or related object is the unified or link DMO of a selected IR starts only after that IR is PUBLISHED. --wait applies to every graph and needs at least one graph in the selection. Calculated insights (calculated-insight:Name__cio, data360/calculatedInsights/Name__cio.calculatedInsight-meta.json joined with its .calculatedInsight-meta.sql) use auto or 68.0 in the run data space, which c__dataSpace in the JSON must name (CI_DATASPACE_MISMATCH); c__dataSpace is sent as dataSpaceName in every create and update. The insight is read by name: absent (HTTP 404) creates it with one POST, present is unchanged when the org holds every key of the file and is updated with one PATCH otherwise; afterwards it is read until it holds the file. The file is sent as written and Salesforce decides (a 4xx answer is reported as rejected); only what the create/update input names differently is translated: dataSpace as dataSpaceName, isFromPackage as createdFromPackage, sourceCiDevName as sourceDeveloperName, UPPER_SNAKE values of definitionType, publishScheduleInterval, historyPublishScheduleInterval and queryDialect as PascalCase, null values are left out, and a PATCH leaves out a definitionType equal to the org value (Salesforce refuses any definitionType on PATCH). The insight runs after the selected DMOs, IRs and insights its SQL names. --draft creates a draft and sends draft: true on update; an update of a DRAFT insight stays a draft. Publication is never implicit (sf data360 publish). --allow-processing is not needed. Repeated selections coalesce. Bare types and implicit deploy-all are forbidden. Preview is strictly read-only. Each phase stage preflights all of its own items before its first write: a batch of Segment, CI or IR inputs (with DLO/DMO beside them when no mapping or relationship is selected) is preflighted as a whole, and an IR dependent stage only after the IR is PUBLISHED; all-native DLO/DMO/mapping execution admits each ordered item only after earlier parents settle. In a selection that also holds a mapping or relationship, only the local checks of the IR/CI/Segment inputs (version, data space, file shape, dependency identities and order) run before the native writes; their Git snapshot, prerequisite and target checks run in their later stage, so a blocker there can follow earlier native writes, which stay reported. Preview runs every stage read-only, also after a blocked one. Segment (segment:Name, the portable Name.segment.json joined with one Name.segment.<model>.sql per model; a missing or extra SQL file or SQL left in the JSON is INVALID_SOURCE) uses auto or 68.0 in the run data space, which c__dataSpace must name (SEGMENT_DATASPACE_MISMATCH); its segmentOn DMO and Waterfall children are in the same data space (SEGMENT_DEPENDENCY_OTHER_DATASPACE). The file carries the name Salesforce stores (<prefix>_<Name> in a non-default data space; a name without the prefix is SEGMENT_NAME_NOT_STORED), sent unchanged; the create names the data space (?dataspace=). Other versions are refused (INVALID_SCOPE). It is read by its exact name: absent (HTTP 404 ITEM_NOT_FOUND) creates it with one POST, present updates it with one PATCH or is unchanged. The authored definition (label, description, segmentOn DMO, DBT SQL models, UI criteria or another segment type, lookback) is sent as written and Salesforce decides; its error is reported. The optional schedule key of the file is the desired refresh schedule: absent leaves the schedule alone; otherwise, when it differs from the org schedule as retrieve projects it, the POST or PATCH carries it, and an explicit {"frequency":"None"} turns it off (Salesforce refuses that for DBT segments; retrieve leaves the key out for a segment without a schedule). A deployed schedule makes the segment publish in the target org (SEGMENT_SCHEDULE_CHANGE in preview and deploy). The segmentOn DMO must exist (one native read binds its ID for the readback). A Waterfall file lists its child segments by API name (childSegments): each is read in the target and sent by its ID there, a selected child is deployed first (preview: planned-dependencies), and the children the selection does not hold are read before the first write of the run, so a child neither in the target nor selected stops it before any write (SEGMENT_CHILD_NOT_FOUND); a file without childSegments keeps the children of the org segment. Create and update require --allow-processing; identical configuration is unchanged without acknowledgement. Parameters have no write in the API, so a segment with parameters is retrieved as-is (UNSUPPORTED_SEGMENT_VARIANT). Segment XML is unsupported input. Segment deletion is separate: sf data360 delete -m segment:Name reads the segment from the org by name and runs fresh checks. Native IR uses auto or numeric68 in the run data space (c__dataSpace; every DMO, field, DLO source and output it names is in that data space, named as stored there, ds2_Individual__dlm with FirstName__c outside default; the ruleset name is <prefix>_<type>_<rulesetId> outside default, IDENTITY_RESOLUTION_NAME_NOT_STORED before any write otherwise; a ruleset or component of another data space is IDENTITY_RESOLUTION_DATASPACE_MISMATCH or IDENTITY_RESOLUTION_DEPENDENCY_OTHER_DATASPACE): confirmed exact absence supports CREATE with --allow-processing acknowledging processing and generated-output provisioning; existing settled owners support complete matching and reconciliation PATCH with --allow-processing or read-only identical no-op without acknowledgement. Ordered source priorities, object defaults and explicit field overrides are preserved; fields:[] restores inheritance. Automatic run, explicit run and delete are unsupported; no API67 fallback is attempted. --async (IR only) returns as soon as Salesforce accepts an IR create or update (creation-processing / update-processing, mutation acknowledged-processing) instead of waiting minutes for PUBLISHED: publish, settings and generated outputs are not confirmed; rerun the same deploy to check (IDENTITY_RESOLUTION_NOT_SETTLED while in flight, unchanged once settled). --async is refused when the selection holds a graph, CI or Segment on the unified DMO of that IR (IDENTITY_RESOLUTION_ASYNC_DEPENDENTS). Selections mixing IR with other non-native families require auto. Other changes block before writes. Stops on first blocked or failed item; no retry or rollback. No local report/artifact writes.';
|
|
158
160
|
static flags = {
|
|
159
161
|
'target-org': Flags.string({
|
|
160
162
|
char: 'o',
|
|
@@ -170,7 +172,6 @@ export default class Deploy extends SfCommand {
|
|
|
170
172
|
summary: 'The run data space; omitted means default, and the org must have it. --data-space is a compatibility alias. A DLO or data stream file must list it in c__dataSpace; every other file must name it in c__dataSpace (or use --allow-cross-dataspace).',
|
|
171
173
|
}),
|
|
172
174
|
'source-dir': Flags.string({
|
|
173
|
-
char: 'd',
|
|
174
175
|
multiple: true,
|
|
175
176
|
multipleNonGreedy: true,
|
|
176
177
|
summary: 'Explicit authored JSON file or directory; repeatable.',
|
|
@@ -196,7 +197,6 @@ export default class Deploy extends SfCommand {
|
|
|
196
197
|
summary: 'Native DMO only: remove custom target fields missing from the file with a Metadata API destructive change. A mapped field needs every mapping holding its pair, without the pair, in the same selection; Salesforce drops the pair together with the field. The primary key and standard, system or generated fields missing from the file are kept, never removed (retrieve leaves generated fields out); sf data360 delete --field removes those.',
|
|
197
198
|
}),
|
|
198
199
|
'allow-cross-dataspace': Flags.boolean({
|
|
199
|
-
char: 'c',
|
|
200
200
|
default: false,
|
|
201
201
|
summary: 'Only with more than one data space: deploy files of another data space into --dataspace. DMO, mapping, relationship, DLO (membership only), UI, Waterfall and SQL (DBT) segment, calculated insight, data graph, identity resolution, STL transform (load, join, formula, filter, sqlFilter, aggregate, appendV2 and output nodes) and DCSQL transform files are translated in memory by rule, the SQL of insights, DBT segments and DCSQL transforms and STL expressions name by name (prefix, ssot__; identity resolution outputs from the ruleset list when their ruleset is not deployed with them); each translated file gets a copy file under its new name after it deployed. Other kinds and any name that cannot be placed exactly are refused before any write. With --preview it lists every rewrite (for SQL with its file, line and column).',
|
|
202
202
|
}),
|
|
@@ -208,9 +208,10 @@ export default class Deploy extends SfCommand {
|
|
|
208
208
|
default: false,
|
|
209
209
|
summary: 'IR only: return once Salesforce accepts the IR create/update instead of waiting for PUBLISHED. Skips confirming publish, settings and generated outputs; rerun the same deploy to check.',
|
|
210
210
|
}),
|
|
211
|
-
|
|
211
|
+
wait: Flags.integer({
|
|
212
|
+
char: 'w',
|
|
212
213
|
min: 1,
|
|
213
|
-
summary: 'Wait budget in
|
|
214
|
+
summary: 'Wait budget in whole minutes for each selected native data graph; default 30, no write retries.',
|
|
214
215
|
}),
|
|
215
216
|
draft: Flags.boolean({
|
|
216
217
|
default: false,
|
|
@@ -221,6 +222,22 @@ export default class Deploy extends SfCommand {
|
|
|
221
222
|
summary: 'Strictly read-only target comparison; never executes deployment.',
|
|
222
223
|
}),
|
|
223
224
|
};
|
|
225
|
+
/**
|
|
226
|
+
* Report data graph progress while the deploy waits. oclif logToStderr suppresses output in
|
|
227
|
+
* JSON mode; progress must remain visible.
|
|
228
|
+
* @param {string} message One progress line.
|
|
229
|
+
*/
|
|
230
|
+
graphProgress(message) {
|
|
231
|
+
process.stderr.write(`${message}\n`);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* The project root: where data360/ lives, relative --source-dir paths resolve and the Git
|
|
235
|
+
* selection runs. The CLI uses the current directory.
|
|
236
|
+
* @returns {string} Absolute project root.
|
|
237
|
+
*/
|
|
238
|
+
projectDirectory() {
|
|
239
|
+
return process.cwd();
|
|
240
|
+
}
|
|
224
241
|
createDataTransformClient = createDataTransformClient;
|
|
225
242
|
preflightDataTransform = preflightDataTransformDeploy;
|
|
226
243
|
executeDataTransform = executeDataTransformDeploy;
|
|
@@ -445,7 +462,7 @@ export default class Deploy extends SfCommand {
|
|
|
445
462
|
}).prefixOf(effectiveScope);
|
|
446
463
|
return prefix === undefined ? {} : { dataSpacePrefix: prefix };
|
|
447
464
|
};
|
|
448
|
-
const cwd =
|
|
465
|
+
const cwd = this.projectDirectory();
|
|
449
466
|
/**
|
|
450
467
|
* A file path as the output shows it: relative to the working directory.
|
|
451
468
|
* @param {string} file Absolute path.
|
|
@@ -605,7 +622,7 @@ export default class Deploy extends SfCommand {
|
|
|
605
622
|
? `Copy file not written for ${shown(copy.source)}: ${copy.reason}.`
|
|
606
623
|
: `Copy file ${copy.outcome === 'written' ? 'written' : 'unchanged (same content)'}: ${shown(copy.path)}.`);
|
|
607
624
|
for (const deletion of envelope.result.selection.deletions ?? [])
|
|
608
|
-
this.log(`Not deleted: ${deletion.family}:${deletion.apiName} (file deleted in the Git range; deploy never deletes; delete it with sf data360 delete --changed-since ${envelope.result.selection.changedSince ?? '<ref>'}
|
|
625
|
+
this.log(`Not deleted: ${deletion.family}:${deletion.apiName} (file deleted in the Git range; deploy never deletes; delete it with sf data360 delete --changed-since ${envelope.result.selection.changedSince ?? '<ref>'} after a --preview).`);
|
|
609
626
|
for (const warning of envelope.diagnostics.warnings)
|
|
610
627
|
if (warning.startsWith('Skipped ') ||
|
|
611
628
|
prefixWarnings.has(warning) ||
|
|
@@ -809,11 +826,9 @@ export default class Deploy extends SfCommand {
|
|
|
809
826
|
if (resolvedInputs.length === 0 && changedSince === undefined)
|
|
810
827
|
return finish('blocked', 'INVALID_SELECTION');
|
|
811
828
|
const graphInputs = resolvedInputs.filter((input) => input.document.kind === 'native-data-graph');
|
|
812
|
-
if (flags
|
|
813
|
-
(graphInputs.length === 0 ||
|
|
814
|
-
|
|
815
|
-
flags['wait-timeout'] < 1))
|
|
816
|
-
return finish('blocked', 'INVALID_WAIT_TIMEOUT_SCOPE');
|
|
829
|
+
if (flags.wait !== undefined &&
|
|
830
|
+
(graphInputs.length === 0 || !Number.isSafeInteger(flags.wait) || flags.wait < 1))
|
|
831
|
+
return finish('blocked', 'INVALID_WAIT_SCOPE');
|
|
817
832
|
if (graphInputs.length > 0) {
|
|
818
833
|
try {
|
|
819
834
|
operationApiVersion(flags['api-version'], 'data-graph');
|
|
@@ -1159,7 +1174,7 @@ export default class Deploy extends SfCommand {
|
|
|
1159
1174
|
if (current.length !== stageGitDlos.length ||
|
|
1160
1175
|
stageGitDlos.some((captured) => !current.some((input) => input.path === captured.path &&
|
|
1161
1176
|
input.inputDigest === captured.inputDigest &&
|
|
1162
|
-
// A translated DLO (-
|
|
1177
|
+
// A translated DLO (--allow-cross-dataspace) still binds to the file's own document.
|
|
1163
1178
|
JSON.stringify(authoredDocument(input)) === JSON.stringify(captured.document))))
|
|
1164
1179
|
throw new GitSelectionError('INVALID_GIT_SELECTION');
|
|
1165
1180
|
for (const input of stageGitDlos)
|
|
@@ -1181,7 +1196,7 @@ export default class Deploy extends SfCommand {
|
|
|
1181
1196
|
stageGitCalculatedInsights.some((captured) => !current.some((input) => input.path === captured.path &&
|
|
1182
1197
|
input.companionPath === captured.companionPath &&
|
|
1183
1198
|
input.inputDigest === captured.inputDigest &&
|
|
1184
|
-
// A translated insight (-
|
|
1199
|
+
// A translated insight (--allow-cross-dataspace) still binds to the files' own insight.
|
|
1185
1200
|
JSON.stringify(authoredNative(input)) === JSON.stringify(captured.native))))
|
|
1186
1201
|
throw new GitSelectionError('INVALID_GIT_SELECTION');
|
|
1187
1202
|
for (const captured of stageGitCalculatedInsights)
|
|
@@ -2084,11 +2099,8 @@ export default class Deploy extends SfCommand {
|
|
|
2084
2099
|
operation: 'deploy',
|
|
2085
2100
|
preview: flags.preview,
|
|
2086
2101
|
confirmed: flags['allow-processing'] === true,
|
|
2087
|
-
waitTimeoutSeconds: flags
|
|
2088
|
-
progress: (message) =>
|
|
2089
|
-
// oclif logToStderr suppresses output in JSON mode; progress must remain visible.
|
|
2090
|
-
process.stderr.write(`${message}\n`);
|
|
2091
|
-
},
|
|
2102
|
+
waitTimeoutSeconds: (flags.wait ?? defaultGraphWaitMinutes) * 60,
|
|
2103
|
+
progress: (message) => this.graphProgress(message),
|
|
2092
2104
|
verifyInput,
|
|
2093
2105
|
});
|
|
2094
2106
|
if (flags.preview)
|
|
@@ -2141,7 +2153,7 @@ export default class Deploy extends SfCommand {
|
|
|
2141
2153
|
? [
|
|
2142
2154
|
{
|
|
2143
2155
|
code: 'DATA_GRAPH_CREATE_UNCONFIRMED',
|
|
2144
|
-
message: `The create request was sent but ${result.failedCheck === 'deadline' ? '--wait
|
|
2156
|
+
message: `The create request was sent but ${result.failedCheck === 'deadline' ? '--wait ran out before the graph was confirmed' : `the ${result.failedCheck} check could not confirm the graph`}; it may exist. Retrieve it or deploy again to reconcile.`,
|
|
2145
2157
|
},
|
|
2146
2158
|
]
|
|
2147
2159
|
: (result.diagnostics ?? []),
|
|
@@ -51,13 +51,13 @@ export type PublishEnvelope = {
|
|
|
51
51
|
export default class Publish extends SfCommand<PublishEnvelope> {
|
|
52
52
|
static readonly aliases: string[];
|
|
53
53
|
static readonly summary = "Publish one Data360 Calculated Insight draft or one segment.";
|
|
54
|
-
static readonly description
|
|
54
|
+
static readonly description: string;
|
|
55
55
|
static readonly flags: {
|
|
56
56
|
'target-org': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
57
57
|
'source-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
58
58
|
metadata: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
59
59
|
async: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
60
|
-
|
|
60
|
+
wait: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
61
61
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
62
62
|
dataspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
63
63
|
preview: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -9,6 +9,8 @@ import { publishCalculatedInsight } from '../../services/publish-calculated-insi
|
|
|
9
9
|
import { calculatedInsightReadContext } from '../../services/native-calculated-insight.js';
|
|
10
10
|
import { annotateDiagnostics, formatDiagnostic } from '../../errors/registry.js';
|
|
11
11
|
import { exitCodeOf } from '../../exit-code.js';
|
|
12
|
+
/** Default segment publish wait in minutes (the service default, rounded up to a whole minute). */
|
|
13
|
+
const defaultWaitMinutes = Math.ceil(segmentPublishWait.timeoutSeconds / 60);
|
|
12
14
|
/**
|
|
13
15
|
* Publish one native Calculated Insight draft (JSON plus SQL file) without deploying or
|
|
14
16
|
* scheduling it, or publish one segment and wait for the result (--async: return once started).
|
|
@@ -16,14 +18,13 @@ import { exitCodeOf } from '../../exit-code.js';
|
|
|
16
18
|
export default class Publish extends SfCommand {
|
|
17
19
|
static aliases = ['datacloud:publish', 'd360:publish', 'dc:publish'];
|
|
18
20
|
static summary = 'Publish one Data360 Calculated Insight draft or one segment.';
|
|
19
|
-
static description =
|
|
21
|
+
static description = `Segment: -m segment:Name (the segment as the org holds it) or --source-dir data360/segments/Name.segment.json (or one of its .segment.<model>.sql files; the org must hold the definition of the file, otherwise SEGMENT_PUBLISH_DEFINITION_MISMATCH: deploy it first). A file retrieved as-is (verbatim) is refused with VERBATIM_NOT_DEPLOYABLE. --api-version auto (68.0) or 68.0, in the run data space (--dataspace; a segment or file of another data space is SEGMENT_DATASPACE_MISMATCH). The segment is read by name (absent is SEGMENT_PUBLISH_ADMISSION_FAILED), then one API 68 POST /ssot/segments/{marketSegmentId}/actions/publish without a body starts the publish; it runs on command, needs no acknowledgement flag and is never resent. Salesforce decides whether the segment can be published now, also while it is PROCESSING or COUNTING; a 4xx answer is reported with its text (SEGMENT_PUBLISH_REJECTED). The segment is then read every 30 seconds (progress on stderr) until publishStatus is SUCCESS (published) or FAILED (SEGMENT_PUBLISH_FAILED) for this publish. --wait (-w) sets that wait in whole minutes (default ${defaultWaitMinutes}; a publish took about 15 minutes in a test); when it runs out the result is publishing (status processing, exit 69, SEGMENT_PUBLISH_STILL_PROCESSING): still processing, not failed, and not resent. --async returns right after Salesforce accepted the POST, without any read afterwards: outcome publishing, mutation acknowledged-processing, status accepted, exit 0, SEGMENT_PUBLISH_STARTED (started, not finished); --async and --wait cannot be combined. Members are readable only after SUCCESS. --preview reads the segment and reports what would be published without publishing. Calculated insight: requires one exact --source-dir data360/calculatedInsights/Name__cio.calculatedInsight-meta.json or its .calculatedInsight-meta.sql file (the JSON is joined with its SQL; a missing SQL file or another Name__cio.calculatedInsight-meta.* file beside them is refused with INVALID_SOURCE), --api-version auto (68.0) or 68.0 and the run data space (--dataspace, default: default; --data-space is a compatibility alias), which c__dataSpace in the file must name (CI_DATASPACE_MISMATCH otherwise). The insight must exist (create it with sf data360 deploy, --draft for a draft). An ACTIVE insight that holds every key of the file is unchanged; otherwise one API 68 PATCH sends the file (translated like deploy) with draft: false, and the insight is read until it is ACTIVE with the file; with --async it is not read after Salesforce accepted the PATCH (outcome publishing, mutation acknowledged-processing, status accepted, exit 0, CI_PUBLISH_STARTED). Salesforce decides; a 4xx answer is reported as rejected. --preview is read-only. An unknown outcome is not retried or rolled back.`;
|
|
20
22
|
static flags = {
|
|
21
23
|
'target-org': Flags.string({
|
|
22
24
|
char: 'o',
|
|
23
25
|
summary: 'Authenticated target org alias or username.',
|
|
24
26
|
}),
|
|
25
27
|
'source-dir': Flags.string({
|
|
26
|
-
char: 'd',
|
|
27
28
|
summary: 'One exact CI JSON file or its SQL file, or one segment JSON or SQL file.',
|
|
28
29
|
}),
|
|
29
30
|
metadata: Flags.string({
|
|
@@ -33,12 +34,14 @@ export default class Publish extends SfCommand {
|
|
|
33
34
|
}),
|
|
34
35
|
async: Flags.boolean({
|
|
35
36
|
default: false,
|
|
36
|
-
exclusive: ['wait
|
|
37
|
-
summary: 'Start the publish and return at once (status accepted, exit 0) without waiting for the result; not with --wait
|
|
37
|
+
exclusive: ['wait'],
|
|
38
|
+
summary: 'Start the publish and return at once (status accepted, exit 0) without waiting for the result; not with --wait.',
|
|
38
39
|
}),
|
|
39
|
-
|
|
40
|
+
wait: Flags.integer({
|
|
41
|
+
char: 'w',
|
|
42
|
+
min: 1,
|
|
40
43
|
exclusive: ['async'],
|
|
41
|
-
summary: `Segment only:
|
|
44
|
+
summary: `Segment only: whole minutes to wait for SUCCESS or FAILED (default ${defaultWaitMinutes}); when it runs out, status processing, exit 69.`,
|
|
42
45
|
}),
|
|
43
46
|
'api-version': Flags.string({ summary: 'Native lifecycle route: auto (68.0) or 68.0.' }),
|
|
44
47
|
dataspace: Flags.string({
|
|
@@ -105,11 +108,10 @@ export default class Publish extends SfCommand {
|
|
|
105
108
|
(!segmentFile && !/\.calculatedInsight-meta\.(?:json|sql)$/u.test(source))))
|
|
106
109
|
throw new Error('Selection');
|
|
107
110
|
const segment = segmentMember || segmentFile;
|
|
108
|
-
code = '
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
111
|
-
|
|
112
|
-
throw new Error('Wait timeout');
|
|
111
|
+
code = 'INVALID_WAIT_SCOPE';
|
|
112
|
+
const wait = flags.wait;
|
|
113
|
+
if (wait !== undefined && (!segment || !Number.isSafeInteger(wait) || wait < 1))
|
|
114
|
+
throw new Error('Wait');
|
|
113
115
|
code = 'INVALID_SCOPE';
|
|
114
116
|
const dataSpace = flags.dataspace ?? 'default';
|
|
115
117
|
// A calculated insight or segment is published in the run's data space.
|
|
@@ -228,7 +230,7 @@ export default class Publish extends SfCommand {
|
|
|
228
230
|
const result = await this.publishSegment(apiName, connection, { requested: '68.0', restSelector: 'v68.0', soapNumeric: '68.0' }, {
|
|
229
231
|
preview: flags.preview,
|
|
230
232
|
...(flags.async ? { async: true } : {}),
|
|
231
|
-
waitTimeoutSeconds: flags
|
|
233
|
+
waitTimeoutSeconds: (flags.wait ?? defaultWaitMinutes) * 60,
|
|
232
234
|
desired,
|
|
233
235
|
dataSpace,
|
|
234
236
|
verifyInput,
|
|
@@ -237,7 +237,6 @@ export default class Retrieve extends SfCommand {
|
|
|
237
237
|
summary: 'Repeat to mix families in one run. Native dlo/dmo/mapping type or type:ApiName JSON selections; bare dlo is every DLO the API lists; omitted selects every family below, each bare. relationship:Dmo__dlm (relationships whose source is that DMO), data-stream:ApiName, data-transform:Name, data-graph:ApiName, segment:ApiName, identity-resolution:ExactObjectApiName and calculated-insight:ApiName__cio, or the bare family name for every one the API lists (bare relationship: those of every listed DMO).',
|
|
238
238
|
}),
|
|
239
239
|
'output-dir': Flags.directory({
|
|
240
|
-
char: 'd',
|
|
241
240
|
exists: false,
|
|
242
241
|
summary: 'Project root for JSON; defaults to the current directory.',
|
|
243
242
|
}),
|
|
@@ -1878,7 +1877,7 @@ export default class Retrieve extends SfCommand {
|
|
|
1878
1877
|
*/
|
|
1879
1878
|
async retrieveOutcome(flags) {
|
|
1880
1879
|
const effectiveScope = flags.dataspace ?? 'default';
|
|
1881
|
-
// Writers require an absolute project root; resolve a relative -
|
|
1880
|
+
// Writers require an absolute project root; resolve a relative --output-dir against the cwd once.
|
|
1882
1881
|
const outputDirectory = path.resolve(flags['output-dir'] ?? process.cwd());
|
|
1883
1882
|
const plugin = {
|
|
1884
1883
|
name: packageMetadata.name,
|
|
@@ -3,11 +3,13 @@ export const hints = {
|
|
|
3
3
|
ACQUISITION_FAILED: 'The plugin could not read a DMO definition through the Metadata API. Check that the org session is valid and the DMO exists in the target, then rerun.',
|
|
4
4
|
AUTHENTICATION_FAILED: 'Salesforce rejected the session or the org could not be loaded. Check the org with sf org display, log in again with sf org login web if needed, then rerun.',
|
|
5
5
|
BLOCKED_GIT_LIFECYCLE: 'The Git changes include a rename (also one split across commit, index and worktree), a conflict or a deleted file the plugin cannot identify. Stage renames so Git can detect them, or select the files with --source-dir or -m.',
|
|
6
|
+
CONFIRMATION_REQUIRED: 'Deleting needs a yes at the confirmation question, and nobody could answer it here. Run the delete in a terminal, or pass --no-prompt after checking it with --preview.',
|
|
6
7
|
CROSS_DATASPACE_COPY_CONFLICT: 'The translated copy of a file would go to a path that already holds other content. Existing files are never changed, so nothing was sent. Move or remove that file, then rerun.',
|
|
7
8
|
CROSS_DATASPACE_RULESETS_READ_FAILED: 'A file of another data space names an identity resolution output, and the ruleset list that places it could not be read. Nothing was sent; check the org session, then rerun.',
|
|
8
9
|
CROSS_DATASPACE_UNRESOLVED: "A name in a file of another data space cannot be placed in the run's data space by rule, so nothing was sent. Read which name and why, change the selection or the file, then rerun.",
|
|
9
10
|
CROSS_DATASPACE_UNSUPPORTED: '--allow-cross-dataspace cannot translate this kind of file yet (STL transforms with an unknown node, transforms other than STL and DCSQL, streams). Nothing was sent. Deploy those in their own data space.',
|
|
10
11
|
DATASPACE_READ_FAILED: 'The list of data spaces could not be read completely from the org, so nothing was read or written. Check the org session and Data Cloud access, then rerun.',
|
|
12
|
+
DELETE_CANCELLED: 'The delete was not confirmed (no, no answer within 30 seconds, or the question failed), so nothing was sent. Rerun it and answer yes, or pass --no-prompt.',
|
|
11
13
|
DELETE_FAILED: 'The delete stopped for a reason without a more specific code. Read the message, check the item outcome and inspect the target before trying again; nothing is retried.',
|
|
12
14
|
DELETE_PHASE_NOT_SETTLED: 'Salesforce is still processing a deletion of this run, so the later phases were not started. Wait until it reads absent, then rerun the same delete.',
|
|
13
15
|
DEPLOY_EXECUTION_BLOCKED: 'At least one item was blocked, so the deploy stopped before or between writes. Read the item lines above for the reason, fix it, then rerun the same deploy.',
|
|
@@ -15,7 +17,6 @@ export const hints = {
|
|
|
15
17
|
DEPLOY_FRESH_ADMISSION_BLOCKED: 'Right before writing this item, a fresh check found something different from the earlier check, so it and later items were not written. Run deploy --preview to see the current state, then rerun.',
|
|
16
18
|
DEPLOY_PREVIEW_BLOCKED: 'The preview found at least one item that a deploy would refuse. Read the item lines above for the reason and fix it before running the deploy without --preview.',
|
|
17
19
|
DEPLOY_PREVIEW_FAILED: 'The preview could not finish. Read the message for the cause, such as session, selection or target access, fix it and run the preview again. Nothing was written.',
|
|
18
|
-
DESTRUCTIVE_CONFIRMATION_REQUIRED: 'A delete with --changed-since needs explicit confirmation. Check it with --preview first, then rerun the same delete with --confirm-delete.',
|
|
19
20
|
DUPLICATE_IDENTITY: 'Two selected files describe the same component. Keep one file per component in the selection, for example by narrowing --source-dir, then rerun.',
|
|
20
21
|
EXECUTION_UNCONFIRMED: 'A write was sent but its result could not be confirmed, so it may have taken effect. Inspect the target with retrieve or deploy --preview before running the deploy again.',
|
|
21
22
|
HTML_ESCAPED_FILE: 'The file holds HTML-escaped text (such as & or ') where the org holds the character itself; Salesforce would store the entities literally, so nothing was written. Retrieve the component again, or write the characters themselves.',
|
|
@@ -24,11 +25,12 @@ export const hints = {
|
|
|
24
25
|
INVALID_DRAFT_SCOPE: '--draft applies only to calculated insights at API auto or 68.0. Select only calculated insights and drop other API versions.',
|
|
25
26
|
INVALID_FIELD_DELETE_SELECTION: '--field needs exactly one -m dmo:<Name__dlm> and no other selector, --changed-since or --delete-dlo; --output-dir works only with --field.',
|
|
26
27
|
INVALID_GIT_SELECTION: 'The --changed-since reference or the Git output could not be used. Pass a commit, branch or tag that exists locally and run the command inside the Git repository.',
|
|
28
|
+
INVALID_OPTION: 'A library call got options the Salesforce CLI would refuse while parsing its flags, so nothing was read or sent. Fix the options named in the message, then call again.',
|
|
27
29
|
INVALID_REQUEST: 'The plugin refused to build the Salesforce request from these inputs. Check --target-org, --api-version and the selected names, and that the org uses an https instance URL.',
|
|
28
30
|
INVALID_SCOPE: 'This family does not support the requested --api-version, or the run could not use the data space. Use --api-version auto (or a version the family allows), then rerun.',
|
|
29
31
|
INVALID_SELECTION: 'The selection is not valid for this command. Check the -m type:ApiName syntax, the --source-dir paths and flags that cannot be combined, then rerun.',
|
|
30
32
|
INVALID_SOURCE: 'A selected file is not a valid definition for its file type, or its content names a different component than its file name. Fix the file, or retrieve it again, then rerun.',
|
|
31
|
-
|
|
33
|
+
INVALID_WAIT_SCOPE: '--wait applies only to a deploy that holds a data graph or to a segment publish, and must be whole minutes (1 or more). Remove it, or select a data graph or a segment.',
|
|
32
34
|
LEGACY_DATASPACE_KEY: 'The file still has an old data space key (identity.dataSpace, spec.segmentOn.dataSpace, or dataSpace in a calculated insight or an identity resolution reference). Move it to the top-level c__dataSpace key, or retrieve again.',
|
|
33
35
|
LOCAL_FILE_REMOVAL_FAILED: 'The deletion in the org is confirmed, but a local file was not removed. Do not repeat the delete; check the file named in the message and remove it yourself.',
|
|
34
36
|
LOCAL_REFRESH_FAILED: 'The fields were deleted in the org, but some project files were not refreshed. Do not repeat the delete; run sf data360 retrieve for the DMO and its mappings.',
|
|
@@ -33,7 +33,7 @@ export const hints = {
|
|
|
33
33
|
SEGMENT_PUBLISH_FAILED: 'Salesforce ran the publish and reports publishStatus FAILED. Check the segment and its source DMO in Data Cloud before publishing again; nothing was resent.',
|
|
34
34
|
SEGMENT_PUBLISH_REJECTED: 'Salesforce refused the publish request; its answer is in the message. Fix the cause it names, then run the publish again; nothing was resent.',
|
|
35
35
|
SEGMENT_PUBLISH_STARTED: 'With --async the publish was started and Salesforce accepted it; the command did not wait for the result. Read the segment later for its publish status; nothing was resent.',
|
|
36
|
-
SEGMENT_PUBLISH_STILL_PROCESSING: 'Salesforce accepted the publish and is still processing it when --wait
|
|
36
|
+
SEGMENT_PUBLISH_STILL_PROCESSING: 'Salesforce accepted the publish and is still processing it when --wait ran out. It did not fail and was not resent; read the segment later for the result.',
|
|
37
37
|
SEGMENT_PUBLISH_UNCONFIRMED: 'The publish was sent, but its answer or the status after it could not be read, so the publish may be running. Read the segment before publishing again; nothing was resent.',
|
|
38
38
|
SEGMENT_READBACK_MISMATCH: 'After the write, the segment read back differently from the file, or other settings or its DMO changed. Inspect the segment in the org before any further deploy.',
|
|
39
39
|
SEGMENT_SCHEDULE_CHANGE: 'The deploy sends the schedule of the file, so the segment publishes on that schedule in the target org ({ "frequency": "None" } turns it off). Remove the schedule key from the file to leave the org schedule alone.',
|
|
@@ -397,7 +397,7 @@ export async function operateNativeDataGraph(value, context, client, options) {
|
|
|
397
397
|
safeToDelete: async () => false,
|
|
398
398
|
pause: options.pause,
|
|
399
399
|
now,
|
|
400
|
-
// Keep waiting while the created graph is still building, up to --wait
|
|
400
|
+
// Keep waiting while the created graph is still building, up to --wait.
|
|
401
401
|
creation: { started, end, pause: waitPause, progress },
|
|
402
402
|
});
|
|
403
403
|
creating = true;
|
|
@@ -73,7 +73,7 @@ export async function deleteCalculatedInsight(value, connection, selection, data
|
|
|
73
73
|
if (options.preview === true)
|
|
74
74
|
return result('delete', 'not-attempted');
|
|
75
75
|
if (options.confirmDelete !== true)
|
|
76
|
-
return result('blocked', 'not-attempted', '
|
|
76
|
+
return result('blocked', 'not-attempted', 'CONFIRMATION_REQUIRED');
|
|
77
77
|
const client = options.nativeClient ?? createCalculatedInsightClient(connection, '68.0', dataSpace);
|
|
78
78
|
context.check();
|
|
79
79
|
attempted = true;
|
|
@@ -233,7 +233,7 @@ export async function deleteIdentityResolution(value, connection, selection, dat
|
|
|
233
233
|
if (preview)
|
|
234
234
|
return result('delete');
|
|
235
235
|
if (options.confirmDelete !== true)
|
|
236
|
-
return result('blocked', '
|
|
236
|
+
return result('blocked', 'CONFIRMATION_REQUIRED');
|
|
237
237
|
attempted = true;
|
|
238
238
|
await client.deleteIdentityResolution(id);
|
|
239
239
|
check();
|
|
@@ -206,7 +206,7 @@ export async function deleteSegment(value, connection, selection, dataSpace, opt
|
|
|
206
206
|
if (preview)
|
|
207
207
|
return result('delete');
|
|
208
208
|
if (options.confirmDelete !== true)
|
|
209
|
-
return result('blocked', '
|
|
209
|
+
return result('blocked', 'CONFIRMATION_REQUIRED');
|
|
210
210
|
check();
|
|
211
211
|
attempted = true;
|
|
212
212
|
// HTTP204 proves only acknowledgement. A failed/uncertain DELETE never becomes success.
|
|
@@ -105,7 +105,7 @@ export declare function settleNativeDataGraph(context: NativeGraphContext, docum
|
|
|
105
105
|
* @param {object} timing Invocation clock, deadline, delay and progress sink.
|
|
106
106
|
* @param {Function} timing.now Invocation clock.
|
|
107
107
|
* @param {number} timing.started Invocation start time.
|
|
108
|
-
* @param {number} timing.end Invocation deadline (--wait
|
|
108
|
+
* @param {number} timing.end Invocation deadline (--wait).
|
|
109
109
|
* @param {Function} timing.pause Read-only delay.
|
|
110
110
|
* @param {Function} timing.progress Stderr-only progress sink.
|
|
111
111
|
* @returns {Promise<NativeGraphAcquisition>} Ready evidence or unknown.
|
|
@@ -238,7 +238,7 @@ export type NativeGraphCreateCheck = 'request' | 'response' | 'settlement' | 'id
|
|
|
238
238
|
* @param {Function} [guards.pause] Injectable polling delay.
|
|
239
239
|
* @param {object} [guards.creation] Invocation budget; create settlement waits while building.
|
|
240
240
|
* @param {number} guards.creation.started Invocation start time.
|
|
241
|
-
* @param {number} guards.creation.end Invocation deadline (--wait
|
|
241
|
+
* @param {number} guards.creation.end Invocation deadline (--wait).
|
|
242
242
|
* @param {Function} guards.creation.pause Paced read-only delay.
|
|
243
243
|
* @param {Function} guards.creation.progress Stderr-only progress sink.
|
|
244
244
|
* @returns {{create: Function; delete: Function}} Internal lifecycle, no UPDATE or name-only delete.
|
|
@@ -324,7 +324,7 @@ export async function settleNativeDataGraph(context, document, goal, pause = del
|
|
|
324
324
|
* @param {object} timing Invocation clock, deadline, delay and progress sink.
|
|
325
325
|
* @param {Function} timing.now Invocation clock.
|
|
326
326
|
* @param {number} timing.started Invocation start time.
|
|
327
|
-
* @param {number} timing.end Invocation deadline (--wait
|
|
327
|
+
* @param {number} timing.end Invocation deadline (--wait).
|
|
328
328
|
* @param {Function} timing.pause Read-only delay.
|
|
329
329
|
* @param {Function} timing.progress Stderr-only progress sink.
|
|
330
330
|
* @returns {Promise<NativeGraphAcquisition>} Ready evidence or unknown.
|
|
@@ -684,7 +684,7 @@ export async function updateNativeDataGraph(context, client, document, baseline,
|
|
|
684
684
|
* @param {Function} [guards.pause] Injectable polling delay.
|
|
685
685
|
* @param {object} [guards.creation] Invocation budget; create settlement waits while building.
|
|
686
686
|
* @param {number} guards.creation.started Invocation start time.
|
|
687
|
-
* @param {number} guards.creation.end Invocation deadline (--wait
|
|
687
|
+
* @param {number} guards.creation.end Invocation deadline (--wait).
|
|
688
688
|
* @param {Function} guards.creation.pause Paced read-only delay.
|
|
689
689
|
* @param {Function} guards.creation.progress Stderr-only progress sink.
|
|
690
690
|
* @returns {{create: Function; delete: Function}} Internal lifecycle, no UPDATE or name-only delete.
|
|
@@ -223,7 +223,7 @@ export function explainSpaceMismatch(error, apiName, fileSpace, runSpace, crossS
|
|
|
223
223
|
* @returns {string} The sentence, with a leading space.
|
|
224
224
|
*/
|
|
225
225
|
export function crossSpaceSentence(runSpace) {
|
|
226
|
-
return ` To deploy it into ${printableKey(runSpace)} instead, add --allow-cross-dataspace
|
|
226
|
+
return ` To deploy it into ${printableKey(runSpace)} instead, add --allow-cross-dataspace.`;
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
229
229
|
* Reuse existing diagnostic messages while distinguishing local verification from API rejection.
|
|
@@ -13,7 +13,7 @@ export type SegmentPublishOptions = {
|
|
|
13
13
|
async?: boolean;
|
|
14
14
|
/** Seconds to wait for SUCCESS or FAILED after Salesforce accepted the publish. */
|
|
15
15
|
waitTimeoutSeconds: number;
|
|
16
|
-
/** The segment file of a
|
|
16
|
+
/** The segment file of a `--source-dir` selection: the org must hold this definition. */
|
|
17
17
|
desired?: SegmentDocument;
|
|
18
18
|
/** The run's data space: the segment read must name it (default: default). */
|
|
19
19
|
dataSpace?: string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Connection } from '@salesforce/core';
|
|
2
|
+
import type { DeleteEnvelope } from '../commands/data360/delete.js';
|
|
3
|
+
/** The flags of `sf data360 delete`, for a caller that holds its own Connection. */
|
|
4
|
+
export type DeleteOptions = {
|
|
5
|
+
/** `--preview`: look up and report only, nothing deleted; default false. */
|
|
6
|
+
preview?: boolean;
|
|
7
|
+
/** Selectors (`-m`), e.g. `dlo:Name__dll`; not with `changedSince`. */
|
|
8
|
+
metadata?: string[];
|
|
9
|
+
/** `--changed-since`: Git reference; deletes the components whose files were deleted since. */
|
|
10
|
+
changedSince?: string;
|
|
11
|
+
/** Run data space (`--dataspace`); default `default`. */
|
|
12
|
+
dataspace?: string;
|
|
13
|
+
/** `--api-version`; default `auto`. */
|
|
14
|
+
apiVersion?: string;
|
|
15
|
+
/** Project root holding data360/ and the Git repository; default the current directory. */
|
|
16
|
+
projectDir?: string;
|
|
17
|
+
/** `--delete-dlo` (data streams only); default false. */
|
|
18
|
+
deleteDlo?: boolean;
|
|
19
|
+
/** `--field`: custom fields removed from the one selected `dmo:Name__dlm`. */
|
|
20
|
+
field?: string[];
|
|
21
|
+
/** `--keep-local-files`; default false (a confirmed deletion removes its local file). */
|
|
22
|
+
keepLocalFiles?: boolean;
|
|
23
|
+
/** `--output-dir` (with `field` only), relative to `projectDir`; default `projectDir`. */
|
|
24
|
+
outputDir?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Run `sf data360 delete` over a Connection the caller holds and return its envelope (what
|
|
28
|
+
* `--json` shows). It never asks: the caller confirmed the delete (as `--no-prompt`). Nothing is
|
|
29
|
+
* printed and `process.exitCode` is left alone; use exitCodeOf on the envelope for the Salesforce
|
|
30
|
+
* CLI exit code. A refusal is returned as a blocked envelope, not thrown. The delete services run
|
|
31
|
+
* at API 68.0 on the Connection; its API version is restored afterwards.
|
|
32
|
+
*
|
|
33
|
+
* Every REST and Metadata API call goes over the given Connection. The one exception: a mapping
|
|
34
|
+
* delete and a field-level delete (`field`) send their Metadata API destructive change through
|
|
35
|
+
* the Salesforce CLI child `sf project deploy start -o <username>`, so they need a global `sf`
|
|
36
|
+
* and a stored sf CLI authorization for the Connection's username.
|
|
37
|
+
* @param {Connection} connection Authenticated @salesforce/core Connection of the target org.
|
|
38
|
+
* @param {DeleteOptions} [options] The command's flags.
|
|
39
|
+
* @returns {Promise<DeleteEnvelope>} The delete envelope.
|
|
40
|
+
* @throws {OptionError} For flag misuse the CLI refuses at parse time (exit 2): `changedSince`
|
|
41
|
+
* with `metadata`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function runDelete(connection: Connection, options?: DeleteOptions): Promise<DeleteEnvelope>;
|