@salesforce/afv-skills 1.16.0 → 1.18.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 (69) hide show
  1. package/package.json +1 -1
  2. package/skills/activating-datacloud/SKILL.md +2 -2
  3. package/skills/analyzing-omnistudio-dependencies/SKILL.md +1 -1
  4. package/skills/building-sf-integrations/SKILL.md +1 -1
  5. package/skills/building-ui-bundle-app/SKILL.md +1 -1
  6. package/skills/configuring-code-analyzer/SKILL.md +482 -0
  7. package/skills/configuring-code-analyzer/examples/apex-project-config.yml +41 -0
  8. package/skills/configuring-code-analyzer/examples/ci-github-actions.yml +96 -0
  9. package/skills/configuring-code-analyzer/examples/fullstack-project-config.yml +46 -0
  10. package/skills/configuring-code-analyzer/examples/lwc-project-config.yml +26 -0
  11. package/skills/configuring-code-analyzer/references/ci-cd-templates.md +648 -0
  12. package/skills/configuring-code-analyzer/references/config-schema.md +257 -0
  13. package/skills/configuring-code-analyzer/references/diagnostic-flow.md +70 -0
  14. package/skills/configuring-code-analyzer/references/engine-prerequisites.md +276 -0
  15. package/skills/configuring-code-analyzer/references/rule-name-resolution.md +67 -0
  16. package/skills/configuring-code-analyzer/references/troubleshooting.md +298 -0
  17. package/skills/configuring-code-analyzer/scripts/check-prerequisites.sh +189 -0
  18. package/skills/configuring-code-analyzer/scripts/generate-config.sh +143 -0
  19. package/skills/configuring-code-analyzer/scripts/validate-config.sh +153 -0
  20. package/skills/connecting-datacloud/SKILL.md +2 -2
  21. package/skills/creating-b2b-commerce-store/SKILL.md +0 -1
  22. package/skills/developing-agentforce/SKILL.md +0 -1
  23. package/skills/generating-apex/SKILL.md +1 -0
  24. package/skills/generating-mermaid-diagrams/assets/datamodel/b2b-commerce-erd.md +1 -1
  25. package/skills/generating-mermaid-diagrams/assets/datamodel/campaigns-erd.md +1 -1
  26. package/skills/generating-mermaid-diagrams/assets/datamodel/consent-erd.md +1 -1
  27. package/skills/generating-mermaid-diagrams/assets/datamodel/files-erd.md +1 -1
  28. package/skills/generating-mermaid-diagrams/assets/datamodel/forecasting-erd.md +1 -1
  29. package/skills/generating-mermaid-diagrams/assets/datamodel/fsl-erd.md +1 -1
  30. package/skills/generating-mermaid-diagrams/assets/datamodel/party-model-erd.md +1 -1
  31. package/skills/generating-mermaid-diagrams/assets/datamodel/quote-order-erd.md +1 -1
  32. package/skills/generating-mermaid-diagrams/assets/datamodel/revenue-cloud-erd.md +1 -1
  33. package/skills/generating-mermaid-diagrams/assets/datamodel/sales-cloud-erd.md +1 -1
  34. package/skills/generating-mermaid-diagrams/assets/datamodel/salesforce-erd.md +1 -1
  35. package/skills/generating-mermaid-diagrams/assets/datamodel/scheduler-erd.md +1 -1
  36. package/skills/generating-mermaid-diagrams/assets/datamodel/service-cloud-erd.md +1 -1
  37. package/skills/generating-mermaid-diagrams/assets/datamodel/territory-management-erd.md +1 -1
  38. package/skills/generating-mermaid-diagrams/references/erd-conventions.md +1 -1
  39. package/skills/generating-mermaid-diagrams/references/preview-guide.md +2 -5
  40. package/skills/harmonizing-datacloud/SKILL.md +2 -2
  41. package/skills/implementing-ui-bundle-agentforce-conversation-client/SKILL.md +1 -2
  42. package/skills/investigating-agentforce-d360/SKILL.md +1 -1
  43. package/skills/managing-cdc-enablement/SKILL.md +164 -0
  44. package/skills/managing-cdc-enablement/assets/PlatformEventChannel-template.xml +5 -0
  45. package/skills/managing-cdc-enablement/assets/PlatformEventChannelMember-template.xml +11 -0
  46. package/skills/managing-cdc-enablement/references/deploy-troubleshooting.md +73 -0
  47. package/skills/managing-cdc-enablement/references/filter-expressions.md +93 -0
  48. package/skills/observing-agentforce/SKILL.md +0 -1
  49. package/skills/observing-agentforce/references/stdm-queries.md +3 -11
  50. package/skills/orchestrating-datacloud/README.md +5 -7
  51. package/skills/orchestrating-datacloud/SKILL.md +3 -3
  52. package/skills/orchestrating-datacloud/references/feature-readiness.md +2 -2
  53. package/skills/orchestrating-datacloud/references/plugin-setup.md +6 -8
  54. package/skills/orchestrating-datacloud/scripts/diagnose-org.mjs +1 -1
  55. package/skills/orchestrating-datacloud/scripts/verify-plugin.sh +2 -2
  56. package/skills/preparing-datacloud/SKILL.md +2 -2
  57. package/skills/retrieving-datacloud/SKILL.md +3 -3
  58. package/skills/reviewing-lwc-mobile-offline/SKILL.md +0 -1
  59. package/skills/running-code-analyzer/SKILL.md +264 -267
  60. package/skills/running-code-analyzer/references/post-scan-workflows.md +286 -0
  61. package/skills/running-code-analyzer/scripts/describe-rule.js +382 -0
  62. package/skills/running-code-analyzer/scripts/list-rules.js +260 -0
  63. package/skills/running-code-analyzer/scripts/query-results.js +230 -0
  64. package/skills/testing-agentforce/SKILL.md +0 -1
  65. package/skills/using-mobile-native-capabilities/SKILL.md +0 -1
  66. package/skills/using-salesforce-archive/SKILL.md +121 -0
  67. package/skills/using-salesforce-archive/examples/monitor-failed-jobs.md +47 -0
  68. package/skills/using-salesforce-archive/references/archive-activity-entity.md +59 -0
  69. package/skills/using-salesforce-archive/references/connect-api-operations.md +157 -0
@@ -0,0 +1,59 @@
1
+ # ArchiveActivity — Data Model Reference
2
+
3
+ `ArchiveActivity` is the platform entity that records **job metadata for Salesforce Archive jobs** (archive, purge, analyze, unarchive, export). Every archive job produces one `ArchiveActivity` record; you read it to learn a job's status, progress, and outcome, and you use its `Id` + `Type` to download the job's logs.
4
+
5
+ ## Entity facts
6
+
7
+ | Property | Value |
8
+ |----------|-------|
9
+ | API name | `ArchiveActivity` |
10
+ | Key prefix | `8qv` (record Ids start `8qv…`) |
11
+ | Owning product | Salesforce Archive (Trusted Services Archive) |
12
+ | Kind | **Standard platform entity** (not a custom object) |
13
+ | License gate | Requires the Trusted Services Archive add-on (`TrustedServicesArchive.hasTrustedServicesArchive`) — absent on orgs without the add-on |
14
+ | Name field | Auto-number, mask `ARCV-{0000000000}` |
15
+ | Flow-enabled? | **No** — `isProcessEnabled=false`. A Flow "Get Records" element on it fails: "You can't get ArchiveActivity records in a flow." Query via SOQL / Connect / Reports. |
16
+
17
+ ## Fields
18
+
19
+ | Field | Type | Meaning |
20
+ |-------|------|---------|
21
+ | `Name` | Auto-number | `ARCV-…` job identifier |
22
+ | `Status` | enum `ArchiveActivityStatus` | Lifecycle: scheduled, running / **In Progress**, completed, **Failed**, canceled, **Ended With Errors** |
23
+ | `Type` | enum `ArchiveActivityType` | The job mode: Archive, Purge, Analyze(r), Unarchive, Export-to-external-bucket, Export-and-download. **This is the `reportType` for log downloads.** |
24
+ | `StartTime` | DateTime | When execution began |
25
+ | `EndTime` | DateTime | When execution finished/terminated (blank while running) |
26
+ | `ArchivePolicyDefinition` | Lookup (FK) | Parent `ArchivePolicyDefinition`; child relationship `ArchiveActivities` |
27
+ | `RootEntityName` | Text | API name of the target sObject being archived |
28
+ | `TotalRecordCount` | Long | Records initially selected (succeeded + failed + skipped) |
29
+ | `AttemptedRootRecordsCount` | Long (formula) | `SkippedRootRecordsCount + FailedCount + SucceededCount` — top-level records actually attempted |
30
+ | `SkippedRootRecordsCount` | Long | Top-level records skipped (validation, exclusion filters, data-protection thresholds) |
31
+ | `SucceededCount` | Long | Records processed without error |
32
+ | `FailedCount` | Long | Records that failed (validation, missing refs, exceptions) |
33
+ | `ProgressPercentage` | Double | Percent complete |
34
+ | `FailureReason` | Long text | Why the job failed/partially completed (system error messages or policy-level failures) |
35
+ | `RecordsSizeInMb` | Text | Estimated total size of processed records (MB) |
36
+
37
+ > The entity also defines a `ProgressIcon` display formula for list views; it is not useful for programmatic monitoring — read `Status`, `ProgressPercentage`, and the count fields directly.
38
+
39
+ ## How ArchiveActivity links to the Connect API
40
+
41
+ The log-download endpoints (`get-execution-details-stream-url`, `get-failed-records-stream-url`) take:
42
+
43
+ - `requestId` = an `ArchiveActivity` **`Id`** (`8qv…`) of a completed, log-producing job, and
44
+ - `reportType` = that same activity's **`Type`** value.
45
+
46
+ So the monitoring pattern is: **query `ArchiveActivity` → pick the job(s) of interest → pass each job's `Id` and `Type` to the stream-url operation → check `url != null`.** See `../examples/monitor-failed-jobs.md`.
47
+
48
+ ## Example SOQL
49
+
50
+ ```sql
51
+ -- Failed or in-progress jobs in the last 7 days, newest first
52
+ SELECT Id, Name, Status, Type, StartTime, EndTime, ProgressPercentage,
53
+ TotalRecordCount, SucceededCount, FailedCount, SkippedRootRecordsCount,
54
+ RootEntityName, FailureReason, ArchivePolicyDefinitionId
55
+ FROM ArchiveActivity
56
+ WHERE (Status = 'Failed' OR Status = 'In Progress' OR Status = 'Ended With Errors')
57
+ AND StartTime >= LAST_N_DAYS:7
58
+ ORDER BY StartTime DESC
59
+ ```
@@ -0,0 +1,157 @@
1
+ # Salesforce Archive Connect API — Operations Reference
2
+
3
+ All operations are under the base path `/platform/data-resilience/archive/`. Contracts verified live against archived data. Read the operation you need before constructing the call — several contracts are non-obvious.
4
+
5
+ ## Operations Summary
6
+
7
+ | Operation | Purpose | Method + Path | Verify with |
8
+ |-----------|---------|---------------|-------------|
9
+ | `search-archived-records` | read | `POST /search` | — |
10
+ | `search-archived-records-with-sharing-rules` | read (Agentforce) | `POST /search/with-sharing-rules` | — |
11
+ | `get-search-archived-records-next-page` | read | `GET /search/next/{scrollId}` | — |
12
+ | `run-analyzer` | write | `POST /analyzer/run` | `get-analyzer-report` |
13
+ | `get-analyzer-report` | read | `GET /analyzer/report` | — |
14
+ | `unarchive-records` | write | `POST /unarchive` | re-run `search-archived-records` |
15
+ | `forget-archived-records` (RTBF) | write | `POST /rtbf` | `get-rtbf-status` |
16
+ | `get-rtbf-status` | read | `GET /rtbf/{requestId}` | — |
17
+ | `mask-archived-records` | write | `POST /mask` | `get-masking-status` |
18
+ | `get-masking-status` | read | `GET /mask/{requestId}` | — |
19
+ | `get-execution-details-stream-url` | read | `GET /log/execution-details-stream-url` | — |
20
+ | `get-failed-records-stream-url` | read | `GET /log/failed-records-stream-url` | — |
21
+ | `get-archive-storage-used` | read | `GET /storage/archive-used` | — |
22
+
23
+ **Deprecated — do not use** (no successor; currently 500): `global-search-by-id`, `get-global-search-results`, `view-archived-records`. Use `search-archived-records` (+ `get-search-archived-records-next-page`) for all archived-record lookups.
24
+
25
+ ### Verify-after-write dependencies
26
+
27
+ ```mermaid
28
+ graph TD
29
+ run_analyzer["run-analyzer"] -.verify.-> get_analyzer_report["get-analyzer-report"]
30
+ forget_archived_records["forget-archived-records"] -.verify.-> get_rtbf_status["get-rtbf-status"]
31
+ mask_archived_records["mask-archived-records"] -.verify.-> get_masking_status["get-masking-status"]
32
+ unarchive_records["unarchive-records"] -.verify.-> search_archived_records["search-archived-records"]
33
+ ```
34
+
35
+ ---
36
+
37
+ ## search-archived-records (`POST /search`)
38
+
39
+ Search archived records by object, filters, date ranges, and sort.
40
+
41
+ **Required**: `sobjectName` + at least 1 filter. Missing them returns a clean envelope validation error (`statusCode 400`).
42
+
43
+ **Inputs**:
44
+ - `sobjectName` *(string)* — API name of the sObject to search.
45
+ - `filters` *(array)* — Filter conditions, each `{field, value}` where **both are required strings**. `value` is a single string — **not** an array, **not** nullable (null/omitted → `400 "This field may not be null"`). There is **no `operator` field**. **At least 1, up to 6 filters, combined with AND only** (OR is not supported). Example: `[{"field":"Subject","value":"Foo"}]`.
46
+ - `dateRanges` *(array)* — Primary date filter: array of `{field, from, to}`. `from`/`to` must be full ISO-8601 datetime (`"2020-01-01T00:00:00Z"`); date-only → `400 JSON_PARSER_ERROR` (xsd:dateTime). Use the special field `archive_date` to filter by archive date instead of `CreatedDate`/`ModifiedDate`.
47
+ - `dateRange` *(object)* — Optional **singular** convenience range `{field, from, to}`; the controller folds it into `dateRanges` (one-element equivalent). Same singular shape that `unarchive-records` uses.
48
+ - `fields` *(array)* — Field API names to return.
49
+ - `pageSize` *(integer)* — Records per page; default 25, max 1000.
50
+ - `sortDirection` *(string)* — `asc`/`desc`, case-insensitive, default `asc`; an invalid value → 400.
51
+
52
+ **Output**: HTTP **201**, `body = { records[], total_result_count, scroll_id }`, `body.statusCode = 200`, `errorMessage` null on success. **Branch on `body.statusCode`, not the HTTP code** — once past framework validation the response is always 200/201 even on logical failure, with the error in `errorMessage` + `statusCode`.
53
+
54
+ **Excluded objects**: `Feed`, `History`, `Relation`, `Share` are not searchable; Files/Attachments are not retrievable.
55
+
56
+ ### Pagination
57
+
58
+ Read records inline from each response. If `body.scroll_id != "-1"`, call `get-search-archived-records-next-page` with that `scroll_id`. **STOP when `scroll_id == "-1"`** — calling next-page with `"-1"` (the terminal sentinel) → 500. There is no separate fetch-by-requestId step.
59
+
60
+ ## get-search-archived-records-next-page (`GET /search/next/{scrollId}`)
61
+
62
+ **Input**: `scrollId` *(string, path param)* — the `body.scroll_id` from a prior search. Stop when it is `"-1"`; never call with `"-1"`.
63
+ **Output**: `body` (next page), `errorMessage`, `statusCode` — same envelope as search.
64
+
65
+ ---
66
+
67
+ ## search-archived-records-with-sharing-rules (`POST /search/with-sharing-rules`)
68
+
69
+ Archive search **optimized for Agentforce agents**. (There is no `/search/related` endpoint — this is the operation that takes the JSON filter map.) Gated by the **`ViewArchivedRecords`** user permission (unlike plain `search-archived-records`, which uses `ViewSearchPage`).
70
+
71
+ **Required**: `objectName`, `filtersJson`.
72
+
73
+ **Inputs**:
74
+ - `objectName` *(string)* — API name of the sObject.
75
+ - `filtersJson` *(string)* — JSON-encoded **OBJECT MAP** of `fieldName → value`, e.g. `"{\"Subject\":\"Foo\",\"Status\":\"New\"}"`. **NOT** an array of `{field,value}` objects — the array form is rejected with `isSuccess:false "No valid filters provided. Please provide filtersJson"`.
76
+ - `dateField` *(string)* — API name of the date field for temporal filtering.
77
+ - `startDate` / `endDate` *(string)* — search window bounds (ISO-8601).
78
+ - `maxResults` *(integer)* — max records to return; default 100.
79
+
80
+ **Output**: `isSuccess` *(boolean — **branch on THIS, not the HTTP status**)*, `totalResultCount`, `records` (rich-text summary of ~5 key fields per record), `recordsJson` (HTML-entity-encoded JSON string), `errorMessage`, `message`, `warnings` (schema-validation/auto-fix advisories). **Validation failures surface as HTTP 201 + `isSuccess:false` + `errorMessage`, never a 4xx.** Pattern: `isSuccess:false` + `errorMessage` → caller bug; `isSuccess:true` + `recordsJson` → success.
81
+
82
+ ---
83
+
84
+ ## run-analyzer (`POST /analyzer/run`) + get-analyzer-report (`GET /analyzer/report`)
85
+
86
+ `run-analyzer` triggers the analyzer; HTTP 201, output `message` *(string, human-readable status)*. **`isRunning` is ALWAYS `null`** — the controller only populates `message`; never branch on `isRunning`. Poll `get-analyzer-report` to confirm completion. Non-destructive / idempotent.
87
+
88
+ `get-analyzer-report` returns `body` with: `topRecords[]` (`{objectName, objectLabel, objectIcon, size, count, usagePercent}` per archivable sObject), `topFiles[]` (parallel shape for files), `fileGeneralStorage`/`dataGeneralStorage` (`{storageUsed, storageRemaining, usagePercent}`), and `createdDateReport` (`"DD/MM/YYYY HH:MM:SS"`).
89
+
90
+ ---
91
+
92
+ ## unarchive-records (`POST /unarchive`)
93
+
94
+ Restore archived records back into live storage by criteria.
95
+
96
+ **Inputs**:
97
+ - `sobjectName` *(string)* — sObject whose records to unarchive.
98
+ - `filters` *(array)* — criteria identifying which archived records to restore.
99
+ - `dateRange` *(object)* — optional **SINGULAR** range `{field, from, to}` (reads `getDateRange()`, unlike `/search` which uses plural `dateRanges`); full ISO-8601 datetimes. Omit to unarchive by filters alone.
100
+
101
+ **Caps**: ≤1000 matched records (else not processed); ≤50 unarchive requests/hour/org. Restores the **whole archived hierarchy** of each match. Requires the **`UnarchiveSdk`** user permission (on top of org-level Archive enablement).
102
+
103
+ **Output**: `body` (unarchive job details incl. job id), `errorMessage`, `statusCode`. **Verify** by re-running `search-archived-records`. **Rollback**: re-archive via a new archive job with the same criteria.
104
+
105
+ ---
106
+
107
+ ## forget-archived-records / RTBF (`POST /rtbf`) + get-rtbf-status (`GET /rtbf/{requestId}`)
108
+
109
+ Submits a Right-To-Be-Forgotten erasure request.
110
+
111
+ **Input**: `criteria` *(array of `{sobject, field, value}`)* — ≤10 items, **one per object type**; ≤10,000 root records erased per org/day; field/object names case-insensitive. Deletes the **entire archived hierarchy** of each match (no partial deletion). Note: the criterion must match a record archived **as a root** — filtering a parent (e.g. Account by Id) when only its children were archived matches nothing.
112
+
113
+ **Output**: HTTP 201, `body.request_id` *(UUID)*. Poll `get-rtbf-status` (path param `requestId` = that UUID) → `body.status` (e.g. `"Request is open. Scan is still in progress"`). **Rollback**: none — RTBF erasure is permanent.
114
+
115
+ ---
116
+
117
+ ## mask-archived-records (`POST /mask`) + get-masking-status (`GET /mask/{requestId}`)
118
+
119
+ Submits a PII-masking (anonymization) request — irreversibly replaces detected PII values with placeholders (e.g. `redacted@example.com`) while keeping the record + non-PII fields searchable.
120
+
121
+ **Input**: `criteria` *(array of `{sobject, field, value}`)* — same shape as RTBF.
122
+
123
+ **Behavior**: permanent; one-time per record (re-requests on an already-masked record are ignored); shares the 10,000/day RTBF rate limit; **PII fields are auto-detected** (you cannot choose them); records under legal hold / retention lock are excluded; cascades to child records. Available **only via this API** (not in the Archive UI).
124
+
125
+ **Permission**: gated by the **`Rtbf`** user permission — the SAME permission as RTBF (`maskArchivedRecords` runs the RTBF access check), not a separate masking entitlement.
126
+
127
+ **Output**: HTTP 201, `body.request_id` *(UUID)*. Poll `get-masking-status` (path param `requestId`); status reaches **HANDLED** when complete. **Rollback**: none — anonymization is permanent.
128
+
129
+ ---
130
+
131
+ ## Log Downloads — get-execution-details-stream-url / get-failed-records-stream-url
132
+
133
+ Both are `GET /log/...` and mint a one-time presigned download URL. `get-execution-details-stream-url` → the execution-detail log; `get-failed-records-stream-url` → the failed-records log (records that did not process). Identical contract.
134
+
135
+ **Output**: `{ url }`. **`url != null` is success; `url: null` means no log was resolved** (missing/incorrect `requestId`/`reportType`, or the activity produced no such log) — always check `url != null`; never treat `url:null` or the 201 status alone as success.
136
+
137
+ **Required inputs**:
138
+ - `requestId` *(string)* — the **`ArchiveActivity` Id** (`8qv…` key) of a completed, log-producing job present in the archiver backend — **not** a search requestId. A missing/non-matching id → `url:null`.
139
+ - `reportType` *(string)* — that activity's `Type`: `Archive | Unarchive | Analyzer | Purge | Export-to-external-bucket | Export-and-download`. Omitting it → `url:null`.
140
+ - `sobjectName` *(string, optional)* — the backend self-resolves it.
141
+
142
+ This is the bridge between `ArchiveActivity` (see `archive-activity-entity.md`) and downloadable logs.
143
+
144
+ ---
145
+
146
+ ## get-archive-storage-used (`GET /storage/archive-used`)
147
+
148
+ Returns `body.usedStorage[4]` (doubles — per-tier bytes consumed) and `body.availableStorage[4]` (per-tier capacity) — two **parallel positional arrays** (NOT a flat metric, NOT key/value maps). The 4 slots are the same in both:
149
+
150
+ | Index | Meaning |
151
+ |-------|---------|
152
+ | 0 | Salesforce org **DATA** storage |
153
+ | 1 | Salesforce org **FILE** storage |
154
+ | 2 | Archive-tier **RECORDS** storage |
155
+ | 3 | Archive-tier **FILE** storage |
156
+
157
+ **`availableStorage[2]` and `[3]` (the archive tier) are ALWAYS 0**: the controller hardcodes them (`ARCHIVER_AVAILABLE_STORAGE = 0`) because archive storage is unmetered, so a `0` there means "not tracked", NOT "no space left". Only `availableStorage[0]`/`[1]` (live org data/file remaining) are real. All values rounded to 2 decimals.