@salesforce/afv-skills 1.71.0 → 1.72.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.
Files changed (116) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-generate/SKILL.md +8 -0
  3. package/skills/agentforce-generate/assets/agents/README.md +1 -1
  4. package/skills/agentforce-generate/references/actions-reference.md +4 -0
  5. package/skills/agentforce-generate/references/mcp-actions-in-agent-script.md +233 -0
  6. package/skills/agentforce-generate/references/reference-map.md +1 -0
  7. package/skills/dx-packaging-convert-1gp-to-2gp-create/SKILL.md +9 -7
  8. package/skills/dx-packaging-convert-1gp-to-2gp-create/references/conversion-operations.md +78 -4
  9. package/skills/dx-packaging-move-to-2gp-migrate/SKILL.md +17 -13
  10. package/skills/dx-packaging-move-to-2gp-migrate/references/api-operations.md +110 -9
  11. package/skills/experience-app-mcp-generate/references/troubleshooting.md +1 -1
  12. package/skills/experience-app-mcp-generate/scripts/merge_tools.mjs +49 -18
  13. package/skills/experience-app-mcp-generate/scripts/render_eca.mjs +1 -1
  14. package/skills/experience-app-mcp-generate/scripts/render_mcp_server.mjs +1 -1
  15. package/skills/experience-app-mcp-generate/scripts/scan_tool_candidates.mjs +3 -1
  16. package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +32 -26
  17. package/skills/experience-ui-bundle-custom-app-generate/references/configure-metadata-custom-application.md +6 -24
  18. package/skills/nonprofit-fundraising-configure/references/mcp-invocation.md +4 -6
  19. package/skills/platform-apex-generate/SKILL.md +2 -1
  20. package/skills/platform-apex-generate/assets/abstract.cls +0 -4
  21. package/skills/platform-apex-generate/assets/invocable-action-extension.invocableactionextension-meta.xml +28 -0
  22. package/skills/platform-apex-generate/assets/invocable.cls +2 -0
  23. package/skills/platform-apex-generate/references/dml-declarations.md +69 -0
  24. package/skills/platform-metadata-discovery-get/SKILL.md +15 -10
  25. package/skills/platform-metadata-grounding-get/SKILL.md +5 -3
  26. package/skills/service-add-agents-to-contact-center-create/SKILL.md +138 -0
  27. package/skills/service-agentforce-contact-center-coordinate/SKILL.md +5 -5
  28. package/skills/service-agentforce-contact-center-coordinate/references/omni-flow-routing.md +3 -3
  29. package/skills/service-agentforce-contact-center-coordinate/scripts/create-routing-flows.sh +8 -3
  30. package/skills/service-agentforce-contact-center-coordinate/scripts/create-voice-agent.sh +5 -5
  31. package/skills/service-agentforce-contact-center-coordinate/scripts/resolve-acc-queue.sh +10 -1
  32. package/skills/service-agentforce-contact-center-coordinate/scripts/resolve-channel-line.sh +4 -0
  33. package/skills/service-agentforce-contact-center-coordinate/scripts/resolve-flow-definition.sh +5 -0
  34. package/skills/service-agentforce-contact-center-coordinate/scripts/verify-number-live.sh +6 -1
  35. package/skills/service-concierge-portal-generate/SKILL.md +1 -1
  36. package/skills/service-concierge-portal-generate/references/portal-deploy-runbook.md +21 -8
  37. package/skills/service-digital-engagement-channel-configure/SKILL.md +45 -32
  38. package/skills/service-digital-engagement-channel-configure/assets/public_key_certificate_set_jwks_template.xml +20 -0
  39. package/skills/service-digital-engagement-channel-configure/assets/public_key_certificate_set_jwks_url_template.xml +23 -0
  40. package/skills/service-digital-engagement-channel-configure/assets/public_key_certificate_template.xml +15 -0
  41. package/skills/service-digital-engagement-channel-configure/examples/asa_agent_channel.xml +1 -1
  42. package/skills/service-digital-engagement-channel-configure/examples/auth_queue_channel.xml +3 -3
  43. package/skills/service-digital-engagement-channel-configure/examples/jwks_upload_key.xml +11 -0
  44. package/skills/service-digital-engagement-channel-configure/examples/jwks_upload_keyset.xml +13 -0
  45. package/skills/service-digital-engagement-channel-configure/examples/jwks_url_keyset.xml +17 -0
  46. package/skills/service-digital-engagement-channel-configure/examples/omni_flow_channel.xml +3 -3
  47. package/skills/service-digital-engagement-channel-configure/examples/omni_queue_channel.xml +3 -3
  48. package/skills/service-digital-engagement-channel-configure/examples/user_channel.xml +1 -1
  49. package/skills/service-digital-engagement-channel-configure/references/_vendored/service-onboarding-delegation-guidelines.md +43 -0
  50. package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +1 -1
  51. package/skills/service-digital-engagement-channel-configure/references/keyset_settings.md +46 -0
  52. package/skills/service-digital-engagement-channel-configure/references/keyset_setup.md +42 -0
  53. package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +28 -27
  54. package/skills/service-digital-engagement-channel-configure/references/recaptcha_handoff.md +2 -5
  55. package/skills/service-digital-engagement-channel-configure/references/routing_transitions.md +2 -2
  56. package/skills/service-digital-engagement-channel-configure/references/user_verification.md +3 -4
  57. package/skills/service-digital-engagement-channel-configure/references/user_verification_client.md +51 -0
  58. package/skills/service-digital-engagement-channel-configure/scripts/check-api-version.sh +7 -0
  59. package/skills/service-digital-engagement-deployment-configure/SKILL.md +28 -10
  60. package/skills/service-digital-engagement-deployment-configure/references/_vendored/service-onboarding-delegation-guidelines.md +43 -0
  61. package/skills/service-digital-engagement-deployment-configure/references/branding_and_tooling.md +2 -2
  62. package/skills/service-digital-engagement-deployment-configure/references/code_snippet.md +2 -2
  63. package/skills/service-digital-engagement-deployment-configure/references/connect_api_creation.md +13 -7
  64. package/skills/service-digital-engagement-deployment-configure/references/custom_labels.md +127 -0
  65. package/skills/service-digital-engagement-deployment-configure/references/deployment_settings.md +2 -1
  66. package/skills/service-digital-engagement-deployment-configure/references/onboarding_contract.md +24 -25
  67. package/skills/service-digital-engagement-deployment-configure/references/prechat_forms.md +1 -1
  68. package/skills/service-digital-engagement-deployment-configure/scripts/check-api-version.sh +7 -0
  69. package/skills/service-email-to-case-configure/SKILL.md +89 -80
  70. package/skills/service-email-to-case-configure/assets/CaseSettings.settings-meta.xml +1 -1
  71. package/skills/service-email-to-case-configure/examples/CaseSettings-two-addresses.settings-meta.xml +6 -3
  72. package/skills/service-email-to-case-configure/references/_vendored/service-onboarding-delegation-guidelines.md +43 -0
  73. package/skills/service-email-to-case-configure/references/agent-delegation.md +22 -0
  74. package/skills/service-email-to-case-configure/references/apply-mechanics.md +15 -12
  75. package/skills/service-email-to-case-configure/references/end-to-end-proof.md +14 -0
  76. package/skills/service-email-to-case-configure/references/onboarding-delegated-run.md +66 -0
  77. package/skills/service-email-to-case-configure/references/routing_address_reference.md +6 -2
  78. package/skills/service-email-to-case-configure/references/troubleshooting.md +17 -9
  79. package/skills/service-email-to-case-configure/scripts/apply-casesettings.py +863 -925
  80. package/skills/service-email-to-case-configure/scripts/tests/_agent.py +162 -0
  81. package/skills/service-email-to-case-configure/scripts/tests/_fakeorg.py +119 -155
  82. package/skills/service-email-to-case-configure/scripts/tests/_run.py +10 -17
  83. package/skills/service-email-to-case-configure/scripts/tests/test_apply_org_scenarios.py +14 -14
  84. package/skills/service-email-to-case-configure/scripts/tests/test_dispatch_contract.py +316 -0
  85. package/skills/service-email-to-case-configure/scripts/tests/test_new_capabilities.py +12 -43
  86. package/skills/service-email-to-case-configure/scripts/tests/test_validate_casesettings.py +13 -0
  87. package/skills/service-email-to-case-configure/scripts/validate-casesettings.py +17 -5
  88. package/skills/service-itsm-agentic-setup-incident-management/references/status-checks.md +11 -11
  89. package/skills/service-remove-agents-from-contact-center-assign/SKILL.md +145 -0
  90. package/skills/service-voice-configuration-manage/SKILL.md +206 -0
  91. package/skills/service-voice-configuration-manage/assets/regions.json +23 -0
  92. package/skills/service-voice-configuration-manage/references/lookups.md +91 -0
  93. package/skills/service-voice-configuration-manage/references/voice_config_api.md +169 -0
  94. package/skills/service-voice-configuration-manage/scripts/create-configuration.sh +20 -0
  95. package/skills/service-voice-configuration-manage/scripts/delete-configuration.sh +31 -0
  96. package/skills/service-voice-configuration-manage/scripts/get-configuration.sh +18 -0
  97. package/skills/service-voice-configuration-manage/scripts/lib.sh +22 -0
  98. package/skills/service-voice-configuration-manage/scripts/list-configurations.sh +18 -0
  99. package/skills/service-voice-configuration-manage/scripts/lookup-caller-lines.sh +30 -0
  100. package/skills/service-voice-configuration-manage/scripts/lookup-flows.sh +29 -0
  101. package/skills/service-voice-configuration-manage/scripts/lookup-profiles.sh +29 -0
  102. package/skills/service-voice-configuration-manage/scripts/lookup-users.sh +29 -0
  103. package/skills/service-voice-configuration-manage/scripts/update-configuration.sh +20 -0
  104. package/skills/tableau-next-asset-create/SKILL.md +10 -4
  105. package/skills/tableau-next-asset-create/references/dashboard-design-principles.md +133 -0
  106. package/skills/tableau-next-asset-create/references/data-transform-gotchas.md +284 -128
  107. package/skills/tableau-next-asset-create/references/deep-reference-index.md +3 -3
  108. package/skills/tableau-next-asset-create/references/edit-dashboard.md +1 -1
  109. package/skills/tableau-next-asset-create/references/edit-visualization.md +678 -468
  110. package/skills/tableau-next-asset-create/references/shared-gates.md +1 -1
  111. package/skills/tableau-next-asset-create/references/tasks/create-data-transform.md +120 -42
  112. package/skills/tableau-next-asset-create/references/tasks/create-viz.md +8 -0
  113. package/skills/tableau-next-asset-create/references/tasks/edit-viz.md +7 -4
  114. package/skills/tableau-next-asset-create/references/tasks/promote-or-reuse.md +9 -4
  115. package/skills/tableau-next-asset-create/references/viz-authoring.md +1 -1
  116. package/skills/service-email-to-case-configure/scripts/tests/test_get_session.py +0 -134
@@ -319,4 +319,4 @@ intent (single viz) or no narrative (dashboard), STOP and design first.
319
319
  explicit confirmation given *after* they've
320
320
  seen the draft — even if the original request already said "save it" in the
321
321
  same message as the edit. Same rule, same rationale, as `edit_visualization`
322
- → `update_visualization` (objective 9, `edit-visualization.md` §8).
322
+ → `update_visualization` (objective 9, `edit-visualization.md` "Persistence handoff").
@@ -1,51 +1,129 @@
1
- # Task: Create or update a Data Cloud SQL transform
1
+ # Task: Read, create, or update a data transform
2
2
 
3
- Materialize a **derived** DLO/DMO from one or more source objects via a Data
4
- Cloud SQL (DCSQL) transform. Use this when the user wants a new derived table
5
- or to change how an existing transform-backed table is produced — not for
6
- CSV ingest (`ingest-flat-file.md`) and not for semantic-model calculated
7
- fields (`enrich-model.md`).
3
+ Inspect an existing transform, create a derived DLO/DMO from one or more
4
+ sources, or update an existing transform-backed output. For CSV ingestion use
5
+ `ingest-flat-file.md`; for a semantic-model calculation use `enrich-model.md`.
8
6
 
9
7
  ## Gates (assert before any tool call) → `../shared-gates.md`
10
8
 
11
- Required: **G1** · Conditional: **G2** (◐, source object must exist)
9
+ Required: **G1, G3** · Conditional: **G2** (◐, for externally discovered
10
+ sources)
12
11
 
13
12
  - **G1** (router-asserted): a `mcp__tableau-next-*__` tool must be connected.
14
- - **Tool names are written bare** — invoke each under your client's name for that `tableau-next-*` server tool (`shared-gates.md`).
15
- - **Confirmation (this guide):** never call `create_data_transform`,
16
- `update_data_transform`, or `run_data_transform` without an explicit "yes"
17
- after showing SQL + preview. Run is a **separate** yes from create/update.
18
- - **G2** (◐): the **source** relation must be a real `__dll` / `__dlm` from
19
- `browse_data_assets`. Do not invent the apiName.
13
+ - **Tool names are written bare** — invoke each under your client's name for
14
+ that `tableau-next-*` server tool (`shared-gates.md`).
15
+ - **G3:** use tool-verified identifiers; resolve labels in the steps below.
16
+ - **G2** (◐): do not build on an empty or unmaterialized discovered source.
17
+ - **Confirmation (this guide):** create, update, and run each require explicit
18
+ confirmation. Reading does not. Run requires a separate confirmation after
19
+ create/update.
20
20
 
21
21
  ## Steps
22
22
 
23
- Payloads, immutable-vs-editable fields, timeout recovery, SparkInternal
24
- substitutions, and error strings are in
25
- **`../data-transform-gotchas.md`**.
26
-
27
- 1. Disambiguate: **create** if the output object does not exist; **update**
28
- if it is already transform-backed (never a second transform on that table).
29
- 2. Resolve the source `assetApiName` (with suffix). Multiple matches → STOP
30
- and ask.
31
- 3. Generate DCSQL; validate (`validate_data_transform` and/or `run_query`
32
- with `rowLimit: 10`). **Every output SELECT alias / `fields[].name` must
33
- be `__c`-suffixed** — validate does not error on a bare alias, it
34
- silently renames the derived field, and the mismatch only fails later
35
- on `run_data_transform` (see the deep ref).
36
- 4. Confirm with the user (SQL + preview + output name).
37
- 5. Create (full nested `definitions`/`manifest`) or update (GET first; full
38
- replace; copy 🔒 fields). Create, update, and validate send the **same
39
- flat body** (`name` / `type` / `definitions` at the top level — no
40
- `dataTransformObject` / `dataTransform` envelope). On update timeout, GET
41
- and compare `compiled_code` — do not blindly retry.
42
- 6. Create-only: add the new output object to the workspace the user named
43
- (else list and ask).
44
- 7. Confirm, then `run_data_transform` only after the transform is `ACTIVE`
45
- (not `PROCESSING`). Runs may be sync or async; poll
46
- `get_data_transform_run_history` until the run succeeds or fails
47
- (typically 10–15 minutes). If status looks stuck, call
48
- `refresh_data_transform_status` then poll history again. Do **not** treat
49
- `get_data_transform` `ACTIVE` as “rows are ready.” BATCH definitions use
50
- `DCSQL`; STREAMING uses `SQL`. DMO outputs need `KQ_<pk>` (see the deep
51
- ref).
23
+ Payload construction, immutable update fields, timeout recovery, and the
24
+ run-time DCSQL rules are in **`../data-transform-gotchas.md`**.
25
+
26
+ Treat `local_rate_limited` as a transient server response, not evidence that
27
+ the SQL is invalid. Keep the request unchanged, wait with increasing backoff,
28
+ and make only a bounded number of retries. Diagnose or rewrite the SQL only
29
+ when the server returns a query or validation error.
30
+
31
+ Choose the **Read**, **Create**, or **Update** path by intent. Source inspection,
32
+ SQL preview, and validation apply to Create and Update.
33
+
34
+ Any edit to SQL, fields, manifest, or output metadata invalidates the earlier
35
+ validation. Re-preview changed SQL, then validate the exact final body again
36
+ before approval or create/update. Never retry creation with a revised body
37
+ that has not been re-validated.
38
+
39
+ **Read (existing transform; read-only)**
40
+
41
+ Apply `../data-transform-gotchas.md` §Reading saved transforms when reporting
42
+ history, schedule, or saved definition types. Resolve an unverified transform
43
+ label with `browse_data_assets_v2`, then choose by intent: definition/outputs →
44
+ `get_data_transform`; run records → `get_data_transform_run_history`; current
45
+ status → `refresh_data_transform_status`; schedule →
46
+ `get_data_transform_schedule`.
47
+
48
+ **Create**
49
+
50
+ 1. **Resolve sources.** Resolve every source label separately with
51
+ `browse_data_assets_v2` unless its exact id/apiName is already tool-verified.
52
+ Preserve returned `__dll` / `__dlm` suffixes. No match → report and stop;
53
+ ambiguous matches → ask. A matching label is still not an identifier.
54
+ 2. **Inspect columns.** Inspect every resolved source with a bounded
55
+ `run_query`. Collect its complete column inventory and a small sample.
56
+ `SELECT *` is allowed for inspection only; never save it as the transform
57
+ SQL.
58
+ 3. **Build and preview SQL.** Build explicit-column DCSQL and pass
59
+ **`../data-transform-gotchas.md`** §Before returning SQL. Preview the
60
+ complete transformation with `run_query` and inspect rows, types, joins,
61
+ and grain. For joins or unions, preview the combined result—not only each
62
+ source.
63
+ 4. **Validate the request.** Build the exact flat create body from
64
+ **`../data-transform-gotchas.md`** (§Payload (reference shape)) and pass it
65
+ unchanged to `validate_data_transform`. Both checks must pass: `run_query`
66
+ previews sampled results; transform validation checks the request contract.
67
+ Fix every returned validation issue before creation. Neither check overrides
68
+ the DCSQL rules. Apply the output-field naming and DMO qualifier rules in
69
+ the payload reference.
70
+ 5. **Confirm and create.** Show the resolved sources, output name, SQL, and a
71
+ short result preview. Call `create_data_transform` only after the user
72
+ confirms.
73
+ 6. **Offer next actions.** After creation, offer—but never automatically
74
+ perform—the optional workspace and data-space actions below.
75
+
76
+ **Update**
77
+
78
+ 1. **Resolve the transform.** Resolve its label with `browse_data_assets_v2`
79
+ unless its exact id/apiName is already tool-verified, then call
80
+ `get_data_transform`.
81
+ 2. **Preserve the contract.** Treat the update as a full replacement. Copy
82
+ every immutable field exactly as described in
83
+ **`../data-transform-gotchas.md`** (§Payload (reference shape)).
84
+ A saved `STL` definition can be read here, but cannot be rewritten through
85
+ this SQL workflow. Stop and explain that limitation rather than changing
86
+ its immutable definition type or substituting SQL for its definition.
87
+ 3. **Inspect sources.** Resolve and inspect every referenced DLO/DMO using
88
+ Create steps 1–2.
89
+ 4. **Build and preview SQL.** Apply Create step 3 to the **whole** revised
90
+ SQL, not only the changed lines—saved SQL can predate the current rules.
91
+ Preview the complete revised result with `run_query`.
92
+ 5. **Validate the request.** Pass the exact full replacement body to
93
+ `validate_data_transform`. Apply the same `__c` and DCSQL rule checks as
94
+ Create.
95
+ 6. **Confirm and update.** Show the revised SQL and preview. Call
96
+ `update_data_transform` only after the user confirms. Never create a second
97
+ transform as an update fallback. On timeout, follow
98
+ **`../data-transform-gotchas.md`** (§Timeout recovery): read the transform
99
+ back and compare the requested changes before retrying.
100
+
101
+ **Optional registration**
102
+
103
+ - **Workspace:** call `list_workspaces` and let the user choose unless the exact
104
+ workspace id/apiName is already verified. Convert the transform's `1dt…` id
105
+ with `get_data_transform_setup_id`, then pass the returned `1Dw…` setup id to
106
+ `add_workspace_asset` as `assetId`. Use `assetType:
107
+ "MktDataTransformSetup"` and `assetUsageType: "Created"` for a transform
108
+ created in this workflow; otherwise use `"Referenced"`. Pass flat top-level
109
+ arguments, not `body`.
110
+ - **Data space:** only output DLOs ending in `__dll` are accepted. Call
111
+ `list_data_spaces` and let the user choose by label. Pass the returned `name`
112
+ or `id` to `add_to_data_space` as `idOrName`, with
113
+ `members: { members: [{ memberName: "<output__dll>" }] }`. Check the
114
+ per-member errors list; empty means all DLOs were added.
115
+ - If the connected server does not advertise an operation, explain that the
116
+ user must complete it in Tableau Next.
117
+
118
+ **Run**
119
+
120
+ 1. **Wait for readiness.** Wait until the transform is `ACTIVE`, not
121
+ `PROCESSING`.
122
+ 2. **Confirm the run.** Ask separately whether to run it. Creation or update
123
+ confirmation does not authorize a run.
124
+ 3. **Run and monitor.** After confirmation, call `run_data_transform` and poll
125
+ `get_data_transform_run_history` until success or failure. If it appears
126
+ stuck, call `refresh_data_transform_status` and continue polling history.
127
+
128
+ `ACTIVE` proves only that the definition is ready; it does not prove that a
129
+ run completed or that output rows are ready.
@@ -49,6 +49,14 @@ picks the chart.** Don't jump straight to a bar chart:
49
49
 
50
50
  - Pick the chart type matched to intent + field roles — do not default every
51
51
  chart to a bar chart.
52
+ - **Precondition — open `../viz-authoring.md` BEFORE calling
53
+ `create_visualization`.** This guide does not carry the chart mechanics the
54
+ call needs: `marks.panes.type`, `layout`, the `encodings` array, and the
55
+ verified per-chart payload all live in `../viz-authoring.md` (§2, §11, §12).
56
+ Read the matching §11 payload for your chart type and copy its shape — do
57
+ **not** hand-construct `marks.panes.type` / `layout` / `encodings` from this
58
+ guide alone (guessing them triggers the §18 failures: `UNKNOWN_EXCEPTION`,
59
+ HTTP 500, `INVALID_VISUALIZATION_METADATA`).
52
60
  - Build with `create_visualization` (`fields` map + `visualSpecification`), only
53
61
  after Step 9 / G7 returns real data. FieldKeys in `fields` are pointers —
54
62
  they must exactly match `rows` / `columns` / encoding `fieldKey` strings.
@@ -1,9 +1,12 @@
1
1
  # Task: Edit an existing visualization
2
2
 
3
- Modify a visualization that already exists — add/remove/replace a shelf field,
4
- filter, forecast, sort, mark encoding, mark type, dual axis, reference line, table
5
- calc, or axis title — and, only on explicit request, save the result. For building a
6
- brand-new chart, use `create-viz.md` instead.
3
+ Modify a visualization that already exists — add/remove/replace/reorder a shelf
4
+ field, filter, forecast, sort, mark encoding, mark type, mark stacking/centering/
5
+ connector, layout, fit, dual axis, reference line, table calc, axis title, field
6
+ label, field/axis/header visibility, header rotation or size, number/date format,
7
+ global style, Measure Values, Flow (sankey) levels/link, or table totals — and,
8
+ only on explicit request, save the result. For building a brand-new chart, use
9
+ `create-viz.md` instead.
7
10
 
8
11
  ## Gates (assert before any tool call) → `../shared-gates.md`
9
12
 
@@ -28,7 +28,10 @@ filters, HTTP 400, and the client-side convert/`gh` procedure are in
28
28
  **`../sharing-and-promotion.md`** (§Promote).
29
29
 
30
30
  1. Confirm Personal Org context. Create is rejected outside it.
31
- 2. `create_reuse_promotion_request` with a non-empty `requesterComment`
31
+ 2. **Before the first `create_reuse_promotion_request` call, Read
32
+ `../sharing-and-promotion.md` § "Promote: request lifecycle"** (create
33
+ params are flat top-level with no body wrapper; `workspaceIdOrApiName` is
34
+ an id, not the label). Then call it with a non-empty `requesterComment`
32
35
  (max 254 chars).
33
36
  Reuse: prod `assetId` + Personal Org destination workspace. Promotion:
34
37
  Personal Org `assetId` + the workspace that contains it.
@@ -41,6 +44,8 @@ filters, HTTP 400, and the client-side convert/`gh` procedure are in
41
44
  4. Survey outstanding Reuse work with `list_promotion_reuse_requests` and
42
45
  top-level `requestType=reuse` (not a `requestParams` wrapper). For one
43
46
  known id, get-by-id.
44
- 5. Promotion only, after user confirm: `create_promotion_pull_request`, then
45
- the download / `sf` convert / copy / `gh pr create` recovery path in the
46
- deep ref. Stop if `sf` is missing.
47
+ 5. Promotion only, after user confirm: **Read `../sharing-and-promotion.md`
48
+ § "Promote: pull-request recovery" first.** `create_promotion_pull_request`
49
+ does **not** open the GitHub PR — it returns a 5-minute presigned URL; the
50
+ download / `sf` convert / copy / `gh pr create` steps are client-side and
51
+ are in that section. Stop if `sf` is missing.
@@ -977,7 +977,7 @@ visualization saves.
977
977
 
978
978
  A per-measure-field knob (`fields.<key>.referenceLine`), distinct from
979
979
  `edit_visualization`'s `addReferenceLine`/`editReferenceLine` operations
980
- (`edit-visualization.md` §6) which target an already-saved viz. Values:
980
+ (`edit-visualization.md` "Reference line") which target an already-saved viz. Values:
981
981
  `Average`/`Sum`/`Min`/`Max` (computed line) or `Target` with a required
982
982
  `referenceLineValue` (constant quota/threshold) — no `Median`. Keep to at
983
983
  most one per chart.
@@ -1,134 +0,0 @@
1
- """Tests for get_session's access-token acquisition and _usable_access_token.
2
-
3
- The FakeOrg-based suites patch get_session wholesale, so they never exercise the
4
- token-selection logic. This module covers it directly:
5
-
6
- * _usable_access_token — accept a live `<orgId>!<secret>` token, reject the
7
- `[REDACTED ...]` marker recent CLIs emit, and reject None/empty/non-string.
8
- * get_session — prefer `sf org auth show-access-token`; on a redacted or
9
- missing primary token, fall back to a `--verbose` `sf org display`; hard-fail
10
- when neither yields a usable token.
11
-
12
- All `sf` invocations are mocked at the sf_json / sf_json_optional layer — no
13
- live org required.
14
- """
15
- from __future__ import annotations
16
-
17
- import unittest
18
- from unittest import mock
19
-
20
- from . import _bootstrap
21
-
22
- apply_mod = _bootstrap.load_apply()
23
-
24
- # A value shaped like a live Salesforce session token: <orgId>!<secret>.
25
- REAL_TOKEN = "00D000000000001AAA!AQ" + "x" * 90
26
- # The marker recent CLIs return from `sf org display` in place of the token.
27
- REDACTED = "[REDACTED] Use 'sf org auth show-access-token' to view the token"
28
-
29
- DISPLAY = {
30
- "instanceUrl": "https://example.my.salesforce.com",
31
- "username": "auth@example.com",
32
- "apiVersion": "68.0",
33
- }
34
-
35
-
36
- def _dispatch(show_at, verbose):
37
- """Build an sf_json_optional stand-in that returns ``show_at`` for the
38
- show-access-token call and ``verbose`` for the `--verbose` display call."""
39
- def _impl(args):
40
- if "show-access-token" in args:
41
- return show_at
42
- if "--verbose" in args:
43
- return verbose
44
- return None
45
- return _impl
46
-
47
-
48
- class UsableAccessToken(unittest.TestCase):
49
- """_usable_access_token: live token has '!' and is not the redaction marker."""
50
-
51
- def test_real_token(self):
52
- self.assertTrue(apply_mod._usable_access_token(REAL_TOKEN))
53
-
54
- def test_redaction_marker_rejected(self):
55
- self.assertFalse(apply_mod._usable_access_token(REDACTED))
56
-
57
- def test_none_rejected(self):
58
- self.assertFalse(apply_mod._usable_access_token(None))
59
-
60
- def test_empty_rejected(self):
61
- self.assertFalse(apply_mod._usable_access_token(""))
62
-
63
- def test_token_without_separator_rejected(self):
64
- self.assertFalse(apply_mod._usable_access_token("noseparator" + "x" * 40))
65
-
66
- def test_non_string_rejected(self):
67
- self.assertFalse(apply_mod._usable_access_token(12345))
68
-
69
-
70
- class GetSessionTokenAcquisition(unittest.TestCase):
71
- """get_session: primary show-access-token, verbose fallback, hard-fail."""
72
-
73
- def setUp(self):
74
- # get_session derives API_VERSION from the org unless forced; keep the
75
- # derivation path deterministic regardless of test ordering.
76
- apply_mod._API_VERSION_EXPLICIT = False
77
-
78
- def _run(self, show_at, verbose):
79
- opt = mock.MagicMock(side_effect=_dispatch(show_at, verbose))
80
- with mock.patch.object(apply_mod, "sf_json", return_value=dict(DISPLAY)), \
81
- mock.patch.object(apply_mod, "sf_json_optional", opt):
82
- result = apply_mod.get_session("myorg")
83
- return result, opt
84
-
85
- @staticmethod
86
- def _verbose_calls(opt):
87
- return [c for c in opt.call_args_list if "--verbose" in c.args[0]]
88
-
89
- def test_primary_path_uses_show_access_token(self):
90
- (token, md_url, inst, user), opt = self._run(
91
- show_at={"accessToken": REAL_TOKEN},
92
- verbose={"accessToken": "should-not-be-used!"})
93
- self.assertEqual(token, REAL_TOKEN)
94
- self.assertEqual(inst, DISPLAY["instanceUrl"])
95
- self.assertEqual(user, DISPLAY["username"])
96
- self.assertEqual(
97
- md_url, f"{DISPLAY['instanceUrl']}/services/Soap/m/68.0")
98
- # Happy path must not issue the verbose fallback display.
99
- self.assertEqual(self._verbose_calls(opt), [])
100
-
101
- def test_primary_path_accepts_bare_string_result(self):
102
- # Defensive: if a CLI version returns the token as a bare string in
103
- # `result` (not an {accessToken} object), get_session must still use it.
104
- (token, *_), opt = self._run(
105
- show_at=REAL_TOKEN,
106
- verbose={"accessToken": "should-not-be-used!"})
107
- self.assertEqual(token, REAL_TOKEN)
108
- self.assertEqual(self._verbose_calls(opt), [])
109
-
110
- def test_redacted_primary_falls_back_to_verbose_display(self):
111
- (token, *_), opt = self._run(
112
- show_at={"accessToken": REDACTED},
113
- verbose={"accessToken": REAL_TOKEN})
114
- self.assertEqual(token, REAL_TOKEN)
115
- self.assertEqual(len(self._verbose_calls(opt)), 1)
116
-
117
- def test_missing_subcommand_falls_back_to_verbose_display(self):
118
- (token, *_), opt = self._run(
119
- show_at=None, verbose={"accessToken": REAL_TOKEN})
120
- self.assertEqual(token, REAL_TOKEN)
121
- self.assertEqual(len(self._verbose_calls(opt)), 1)
122
-
123
- def test_redacted_everywhere_exits(self):
124
- with self.assertRaises(SystemExit):
125
- self._run(show_at={"accessToken": REDACTED},
126
- verbose={"accessToken": REDACTED})
127
-
128
- def test_no_token_anywhere_exits(self):
129
- with self.assertRaises(SystemExit):
130
- self._run(show_at=None, verbose=None)
131
-
132
-
133
- if __name__ == "__main__":
134
- unittest.main()