sf-plugin-data 0.4.0 → 0.5.1

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.
Files changed (35) hide show
  1. package/README.md +31 -12
  2. package/docs/capabilities.md +8 -8
  3. package/docs/git-workflow.md +5 -6
  4. package/docs/handover.md +32 -32
  5. package/lib/api.d.ts +7 -0
  6. package/lib/api.js +5 -1
  7. package/lib/commands/data360/delete.d.ts +57 -12
  8. package/lib/commands/data360/delete.js +193 -43
  9. package/lib/commands/data360/deploy.d.ts +14 -2
  10. package/lib/commands/data360/deploy.js +35 -22
  11. package/lib/commands/data360/list/dataspace.js +12 -5
  12. package/lib/commands/data360/publish.d.ts +2 -2
  13. package/lib/commands/data360/publish.js +18 -14
  14. package/lib/commands/data360/retrieve.js +15 -7
  15. package/lib/commands/data360/segment/members/export.js +4 -1
  16. package/lib/errors/codes/general.js +4 -2
  17. package/lib/errors/codes/segment.js +1 -1
  18. package/lib/services/command-native-data-graph.js +1 -1
  19. package/lib/services/delete-calculated-insight.js +1 -1
  20. package/lib/services/delete-identity-resolution.js +1 -1
  21. package/lib/services/delete-segment.js +1 -1
  22. package/lib/services/native-data-graph-crd.d.ts +2 -2
  23. package/lib/services/native-data-graph-crd.js +2 -2
  24. package/lib/services/operation-diagnostic.js +1 -1
  25. package/lib/services/publish-segment.d.ts +1 -1
  26. package/lib/services/run-delete.d.ts +43 -0
  27. package/lib/services/run-delete.js +111 -0
  28. package/lib/services/run-deploy.d.ts +51 -0
  29. package/lib/services/run-deploy.js +107 -0
  30. package/lib/services/run-options.d.ts +23 -0
  31. package/lib/services/run-options.js +38 -0
  32. package/lib/services/run-retrieve.js +3 -0
  33. package/lib/transport/connect-client.d.ts +8 -0
  34. package/lib/transport/connect-client.js +25 -1
  35. package/package.json +1 -1
@@ -19,7 +19,7 @@ import { preflightDataStream, executeDataStream, } from '../../services/command-
19
19
  import { verifyDataStreamInputDigest } from '../../artifacts/read-deploy-input.js';
20
20
  import { DataStreamError } from '../../artifacts/data-stream-document.js';
21
21
  import { dataStreamApiVersion } from '../../transport/api-version.js';
22
- import { ConnectClient } from '../../transport/connect-client.js';
22
+ import { ConnectClient, ConnectError } from '../../transport/connect-client.js';
23
23
  import { createDataStreamClient, createDataStreamReferenceReader, } from '../../transport/data-stream-rest.js';
24
24
  import { preflightMapping, executeMapping } from '../../services/command-native-mapping.js';
25
25
  import { createMappingClient } from '../../transport/mapping-rest.js';
@@ -101,8 +101,9 @@ const resolveTargetOrg = async (aliasOrUsername) => {
101
101
  };
102
102
  }
103
103
  catch (error) {
104
+ // A given --target-org that cannot be used is an authentication failure (cause kept).
104
105
  if (aliasOrUsername)
105
- throw error;
106
+ throw Object.assign(new ConnectError('AUTHENTICATION_FAILED'), { cause: error });
106
107
  return undefined;
107
108
  }
108
109
  };
@@ -150,11 +151,13 @@ function withDataSpacePrefix(options, prefix) {
150
151
  return [{ ...options[0], ...prefix }];
151
152
  return prefix.dataSpacePrefix === undefined ? [] : [prefix];
152
153
  }
154
+ /** Default wait per native data graph, in minutes. */
155
+ const defaultGraphWaitMinutes = 30;
153
156
  /** Preview or sequential guarded deployment of explicitly selected authored configuration. */
154
157
  export default class Deploy extends SfCommand {
155
158
  static aliases = ['datacloud:deploy', 'd360:deploy', 'dc:deploy'];
156
159
  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.';
160
+ 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
161
  static flags = {
159
162
  'target-org': Flags.string({
160
163
  char: 'o',
@@ -170,7 +173,6 @@ export default class Deploy extends SfCommand {
170
173
  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
174
  }),
172
175
  'source-dir': Flags.string({
173
- char: 'd',
174
176
  multiple: true,
175
177
  multipleNonGreedy: true,
176
178
  summary: 'Explicit authored JSON file or directory; repeatable.',
@@ -196,7 +198,6 @@ export default class Deploy extends SfCommand {
196
198
  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
199
  }),
198
200
  'allow-cross-dataspace': Flags.boolean({
199
- char: 'c',
200
201
  default: false,
201
202
  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
203
  }),
@@ -208,9 +209,10 @@ export default class Deploy extends SfCommand {
208
209
  default: false,
209
210
  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
211
  }),
211
- 'wait-timeout': Flags.integer({
212
+ wait: Flags.integer({
213
+ char: 'w',
212
214
  min: 1,
213
- summary: 'Wait budget in seconds for each selected native data graph; default 1800, no write retries.',
215
+ summary: 'Wait budget in whole minutes for each selected native data graph; default 30, no write retries.',
214
216
  }),
215
217
  draft: Flags.boolean({
216
218
  default: false,
@@ -221,6 +223,22 @@ export default class Deploy extends SfCommand {
221
223
  summary: 'Strictly read-only target comparison; never executes deployment.',
222
224
  }),
223
225
  };
226
+ /**
227
+ * Report data graph progress while the deploy waits. oclif logToStderr suppresses output in
228
+ * JSON mode; progress must remain visible.
229
+ * @param {string} message One progress line.
230
+ */
231
+ graphProgress(message) {
232
+ process.stderr.write(`${message}\n`);
233
+ }
234
+ /**
235
+ * The project root: where data360/ lives, relative --source-dir paths resolve and the Git
236
+ * selection runs. The CLI uses the current directory.
237
+ * @returns {string} Absolute project root.
238
+ */
239
+ projectDirectory() {
240
+ return process.cwd();
241
+ }
224
242
  createDataTransformClient = createDataTransformClient;
225
243
  preflightDataTransform = preflightDataTransformDeploy;
226
244
  executeDataTransform = executeDataTransformDeploy;
@@ -445,7 +463,7 @@ export default class Deploy extends SfCommand {
445
463
  }).prefixOf(effectiveScope);
446
464
  return prefix === undefined ? {} : { dataSpacePrefix: prefix };
447
465
  };
448
- const cwd = process.cwd();
466
+ const cwd = this.projectDirectory();
449
467
  /**
450
468
  * A file path as the output shows it: relative to the working directory.
451
469
  * @param {string} file Absolute path.
@@ -605,7 +623,7 @@ export default class Deploy extends SfCommand {
605
623
  ? `Copy file not written for ${shown(copy.source)}: ${copy.reason}.`
606
624
  : `Copy file ${copy.outcome === 'written' ? 'written' : 'unchanged (same content)'}: ${shown(copy.path)}.`);
607
625
  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>'} --confirm-delete after a --preview).`);
626
+ 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
627
  for (const warning of envelope.diagnostics.warnings)
610
628
  if (warning.startsWith('Skipped ') ||
611
629
  prefixWarnings.has(warning) ||
@@ -809,11 +827,9 @@ export default class Deploy extends SfCommand {
809
827
  if (resolvedInputs.length === 0 && changedSince === undefined)
810
828
  return finish('blocked', 'INVALID_SELECTION');
811
829
  const graphInputs = resolvedInputs.filter((input) => input.document.kind === 'native-data-graph');
812
- if (flags['wait-timeout'] !== undefined &&
813
- (graphInputs.length === 0 ||
814
- !Number.isSafeInteger(flags['wait-timeout']) ||
815
- flags['wait-timeout'] < 1))
816
- return finish('blocked', 'INVALID_WAIT_TIMEOUT_SCOPE');
830
+ if (flags.wait !== undefined &&
831
+ (graphInputs.length === 0 || !Number.isSafeInteger(flags.wait) || flags.wait < 1))
832
+ return finish('blocked', 'INVALID_WAIT_SCOPE');
817
833
  if (graphInputs.length > 0) {
818
834
  try {
819
835
  operationApiVersion(flags['api-version'], 'data-graph');
@@ -1159,7 +1175,7 @@ export default class Deploy extends SfCommand {
1159
1175
  if (current.length !== stageGitDlos.length ||
1160
1176
  stageGitDlos.some((captured) => !current.some((input) => input.path === captured.path &&
1161
1177
  input.inputDigest === captured.inputDigest &&
1162
- // A translated DLO (-c) still binds to the file's own document.
1178
+ // A translated DLO (--allow-cross-dataspace) still binds to the file's own document.
1163
1179
  JSON.stringify(authoredDocument(input)) === JSON.stringify(captured.document))))
1164
1180
  throw new GitSelectionError('INVALID_GIT_SELECTION');
1165
1181
  for (const input of stageGitDlos)
@@ -1181,7 +1197,7 @@ export default class Deploy extends SfCommand {
1181
1197
  stageGitCalculatedInsights.some((captured) => !current.some((input) => input.path === captured.path &&
1182
1198
  input.companionPath === captured.companionPath &&
1183
1199
  input.inputDigest === captured.inputDigest &&
1184
- // A translated insight (-c) still binds to the files' own insight.
1200
+ // A translated insight (--allow-cross-dataspace) still binds to the files' own insight.
1185
1201
  JSON.stringify(authoredNative(input)) === JSON.stringify(captured.native))))
1186
1202
  throw new GitSelectionError('INVALID_GIT_SELECTION');
1187
1203
  for (const captured of stageGitCalculatedInsights)
@@ -2084,11 +2100,8 @@ export default class Deploy extends SfCommand {
2084
2100
  operation: 'deploy',
2085
2101
  preview: flags.preview,
2086
2102
  confirmed: flags['allow-processing'] === true,
2087
- waitTimeoutSeconds: flags['wait-timeout'] ?? 1800,
2088
- progress: (message) => {
2089
- // oclif logToStderr suppresses output in JSON mode; progress must remain visible.
2090
- process.stderr.write(`${message}\n`);
2091
- },
2103
+ waitTimeoutSeconds: (flags.wait ?? defaultGraphWaitMinutes) * 60,
2104
+ progress: (message) => this.graphProgress(message),
2092
2105
  verifyInput,
2093
2106
  });
2094
2107
  if (flags.preview)
@@ -2141,7 +2154,7 @@ export default class Deploy extends SfCommand {
2141
2154
  ? [
2142
2155
  {
2143
2156
  code: 'DATA_GRAPH_CREATE_UNCONFIRMED',
2144
- message: `The create request was sent but ${result.failedCheck === 'deadline' ? '--wait-timeout 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.`,
2157
+ 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
2158
  },
2146
2159
  ]
2147
2160
  : (result.diagnostics ?? []),
@@ -58,11 +58,18 @@ export default class ListDataSpace extends SfCommand {
58
58
  connection = await this.resolveConnection(flags['target-org']);
59
59
  }
60
60
  catch {
61
- envelope.diagnostics.errors.push({
62
- code: 'TARGET_ORG_REQUIRED',
63
- message: 'No usable target org: pass -o with an authenticated alias or username, or set target-org.',
64
- retryable: false,
65
- });
61
+ // A given --target-org that cannot be used is an authentication failure.
62
+ envelope.diagnostics.errors.push(flags['target-org'] === undefined
63
+ ? {
64
+ code: 'TARGET_ORG_REQUIRED',
65
+ message: 'No usable target org: pass -o with an authenticated alias or username, or set target-org.',
66
+ retryable: false,
67
+ }
68
+ : {
69
+ code: 'AUTHENTICATION_FAILED',
70
+ message: 'The target org given with -o is unknown or not authenticated: log in to it with sf org login web, or pass another alias or username.',
71
+ retryable: false,
72
+ });
66
73
  return this.finish(envelope);
67
74
  }
68
75
  try {
@@ -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 = "Segment: -m segment:Name (the segment as the org holds it) or -d 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-timeout sets that wait in whole seconds (default 1800; 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-timeout 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.";
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
- 'wait-timeout': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
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 = 'Segment: -m segment:Name (the segment as the org holds it) or -d 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-timeout sets that wait in whole seconds (default 1800; 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-timeout 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.';
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-timeout'],
37
- summary: 'Start the publish and return at once (status accepted, exit 0) without waiting for the result; not with --wait-timeout.',
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
- 'wait-timeout': Flags.integer({
40
+ wait: Flags.integer({
41
+ char: 'w',
42
+ min: 1,
40
43
  exclusive: ['async'],
41
- summary: `Segment only: seconds to wait for SUCCESS or FAILED (default ${segmentPublishWait.timeoutSeconds}); when it runs out, status processing, exit 69.`,
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 = 'INVALID_WAIT_TIMEOUT_SCOPE';
109
- const waitTimeout = flags['wait-timeout'];
110
- if (waitTimeout !== undefined &&
111
- (!segment || !Number.isSafeInteger(waitTimeout) || waitTimeout < 1))
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.
@@ -135,7 +137,8 @@ export default class Publish extends SfCommand {
135
137
  await this.verifyCalculatedInsightInput(input);
136
138
  };
137
139
  await verifyInput();
138
- code = 'TARGET_ORG_REQUIRED';
140
+ // A given --target-org that cannot be used is an authentication failure.
141
+ code = flags['target-org'] === undefined ? 'TARGET_ORG_REQUIRED' : 'AUTHENTICATION_FAILED';
139
142
  const connection = await this.resolveConnection(flags['target-org']);
140
143
  code = 'CI_ADMISSION_FAILED';
141
144
  const context = this.calculatedInsightContext(connection, dataSpace);
@@ -223,12 +226,13 @@ export default class Publish extends SfCommand {
223
226
  await this.verifySegmentInput(input);
224
227
  };
225
228
  await verifyInput();
226
- code = 'TARGET_ORG_REQUIRED';
229
+ // A given --target-org that cannot be used is an authentication failure.
230
+ code = flags['target-org'] === undefined ? 'TARGET_ORG_REQUIRED' : 'AUTHENTICATION_FAILED';
227
231
  const connection = await this.resolveConnection(flags['target-org']);
228
232
  const result = await this.publishSegment(apiName, connection, { requested: '68.0', restSelector: 'v68.0', soapNumeric: '68.0' }, {
229
233
  preview: flags.preview,
230
234
  ...(flags.async ? { async: true } : {}),
231
- waitTimeoutSeconds: flags['wait-timeout'] ?? segmentPublishWait.timeoutSeconds,
235
+ waitTimeoutSeconds: (flags.wait ?? defaultWaitMinutes) * 60,
232
236
  desired,
233
237
  dataSpace,
234
238
  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
  }),
@@ -628,7 +627,9 @@ export default class Retrieve extends SfCommand {
628
627
  org = await this.resolveOrg(flags['target-org']);
629
628
  }
630
629
  catch {
631
- return { status: 'blocked', selection: selectors, code: 'TARGET_ORG_REQUIRED' };
630
+ // A given --target-org that cannot be used is an authentication failure.
631
+ const code = flags['target-org'] === undefined ? 'TARGET_ORG_REQUIRED' : 'AUTHENTICATION_FAILED';
632
+ return { status: 'blocked', selection: selectors, code };
632
633
  }
633
634
  const connection = org.getConnection('68.0');
634
635
  envelope.provenance.sourceOrgId ??= org.getOrgId();
@@ -742,7 +743,9 @@ export default class Retrieve extends SfCommand {
742
743
  org = await this.resolveOrg(flags['target-org']);
743
744
  }
744
745
  catch {
745
- return { status: 'blocked', selection: selectors, code: 'TARGET_ORG_REQUIRED' };
746
+ // A given --target-org that cannot be used is an authentication failure.
747
+ const code = flags['target-org'] === undefined ? 'TARGET_ORG_REQUIRED' : 'AUTHENTICATION_FAILED';
748
+ return { status: 'blocked', selection: selectors, code };
746
749
  }
747
750
  const connection = org.getConnection(version);
748
751
  const target = flags['target-org'] ?? connection.getUsername();
@@ -1009,7 +1012,9 @@ export default class Retrieve extends SfCommand {
1009
1012
  org = await this.resolveOrg(flags['target-org']);
1010
1013
  }
1011
1014
  catch {
1012
- return { status: 'blocked', selection: selectors, code: 'TARGET_ORG_REQUIRED' };
1015
+ // A given --target-org that cannot be used is an authentication failure.
1016
+ const code = flags['target-org'] === undefined ? 'TARGET_ORG_REQUIRED' : 'AUTHENTICATION_FAILED';
1017
+ return { status: 'blocked', selection: selectors, code };
1013
1018
  }
1014
1019
  const connection = org.getConnection(version);
1015
1020
  const target = flags['target-org'] ?? connection.getUsername();
@@ -1336,7 +1341,9 @@ export default class Retrieve extends SfCommand {
1336
1341
  org = await this.resolveOrg(flags['target-org']);
1337
1342
  }
1338
1343
  catch {
1339
- return { status: 'blocked', selection: selectors, code: 'TARGET_ORG_REQUIRED' };
1344
+ // A given --target-org that cannot be used is an authentication failure.
1345
+ const code = flags['target-org'] === undefined ? 'TARGET_ORG_REQUIRED' : 'AUTHENTICATION_FAILED';
1346
+ return { status: 'blocked', selection: selectors, code };
1340
1347
  }
1341
1348
  let selection = selectors;
1342
1349
  const before = envelope.diagnostics.errors.length;
@@ -1878,7 +1885,7 @@ export default class Retrieve extends SfCommand {
1878
1885
  */
1879
1886
  async retrieveOutcome(flags) {
1880
1887
  const effectiveScope = flags.dataspace ?? 'default';
1881
- // Writers require an absolute project root; resolve a relative -d against the cwd once.
1888
+ // Writers require an absolute project root; resolve a relative --output-dir against the cwd once.
1882
1889
  const outputDirectory = path.resolve(flags['output-dir'] ?? process.cwd());
1883
1890
  const plugin = {
1884
1891
  name: packageMetadata.name,
@@ -1961,7 +1968,8 @@ export default class Retrieve extends SfCommand {
1961
1968
  org = await this.resolveOrg(flags['target-org']);
1962
1969
  }
1963
1970
  catch {
1964
- throw new DataSpaceError('TARGET_ORG_REQUIRED');
1971
+ // A given --target-org that cannot be used is an authentication failure.
1972
+ throw new DataSpaceError(flags['target-org'] === undefined ? 'TARGET_ORG_REQUIRED' : 'AUTHENTICATION_FAILED');
1965
1973
  }
1966
1974
  const connection = org.getConnection('68.0');
1967
1975
  return openBoundSsot(flags['target-org'] ?? '', '68.0', async () => connection);
@@ -163,7 +163,10 @@ export default class SegmentMembersExport extends SfCommand {
163
163
  connection = await this.resolveConnection(flags['target-org']);
164
164
  }
165
165
  catch {
166
- return fail('TARGET_ORG_REQUIRED', 'No usable target org: pass -o with an authenticated alias or username, or set target-org.');
166
+ // A given --target-org that cannot be used is an authentication failure.
167
+ return flags['target-org'] === undefined
168
+ ? fail('TARGET_ORG_REQUIRED', 'No usable target org: pass -o with an authenticated alias or username, or set target-org.')
169
+ : fail('AUTHENTICATION_FAILED', 'The target org given with -o is unknown or not authenticated: log in to it with sf org login web, or pass another alias or username.');
167
170
  }
168
171
  const sender = this.createSender
169
172
  ? this.createSender(connection, version)
@@ -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 &amp; or &#39;) 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
- INVALID_WAIT_TIMEOUT_SCOPE: '--wait-timeout applies only to a deploy that holds a data graph or to a segment publish, and must be whole seconds. Remove it, or select a data graph or a segment.',
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-timeout ran out. It did not fail and was not resent; read the segment later for the result.',
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-timeout.
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', 'DESTRUCTIVE_CONFIRMATION_REQUIRED');
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', 'DESTRUCTIVE_CONFIRMATION_REQUIRED');
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', 'DESTRUCTIVE_CONFIRMATION_REQUIRED');
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-timeout).
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-timeout).
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.