@salesforce/afv-skills 1.19.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/dx-app-analytics-use/SKILL.md +135 -0
- package/skills/platform-agentexchange-partner-offers-enable/SKILL.md +111 -0
- package/skills/platform-agentexchange-partner-offers-enable/assets/org-pref-template.md +27 -0
- package/skills/platform-agentexchange-partner-offers-enable/examples/org-preference-settings.xml +4 -0
package/package.json
CHANGED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dx-app-analytics-use
|
|
3
|
+
description: "ISV App Analytics metadata types — AppAnalyticsQueryRequest and AppAnalyticsSettings. Use this skill when the user asks about retrieving managed package usage data, configuring App Analytics simulation mode, querying subscriber snapshots, or understanding the AppAnalyticsQueryRequest lifecycle (New → Pending → Complete → Expired). TRIGGER when: user mentions App Analytics, AppAnalyticsQueryRequest, AppAnalyticsSettings, package usage data, subscriber analytics, ISV analytics, or simulation mode for app analytics. DO NOT TRIGGER when: the task is about standard Salesforce reports/dashboards (use reporting skills), custom SOQL on Account/Contact (use querying-soql), or Data Cloud query/search (use retrieving-datacloud)."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
minApiVersion: "56.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# App Analytics
|
|
10
|
+
|
|
11
|
+
## When This Skill Owns the Task
|
|
12
|
+
|
|
13
|
+
Use `dx-app-analytics-use` when the work involves:
|
|
14
|
+
- Creating `AppAnalyticsQueryRequest` records via the REST/sObject API
|
|
15
|
+
- Configuring `AppAnalyticsSettings` via the Metadata API (simulation mode, opt-out)
|
|
16
|
+
- Understanding the query lifecycle: New → Pending → Complete → Expired → Failed
|
|
17
|
+
- Choosing between dataType values: PackageUsageSummary, PackageUsageLog, SubscriberSnapshot
|
|
18
|
+
- File format and compression options for analytics downloads
|
|
19
|
+
- Time-range filtering with startTime, endTime, availableSince
|
|
20
|
+
- Troubleshooting failed or expired analytics queries
|
|
21
|
+
|
|
22
|
+
Delegate elsewhere when the user is:
|
|
23
|
+
- Running standard CRM SOQL queries → querying-soql
|
|
24
|
+
- Working with Data Cloud SQL or DMOs → retrieving-datacloud
|
|
25
|
+
- Building reports/dashboards on standard objects → reporting skills
|
|
26
|
+
- Deploying or retrieving generic metadata XML → deploying-metadata / retrieving-metadata
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Available Types
|
|
31
|
+
|
|
32
|
+
### AppAnalyticsQueryRequest (REST/sObject API)
|
|
33
|
+
|
|
34
|
+
An asynchronous query request that ISV partners use to retrieve usage analytics data for their managed packages from the ISV Intelligence Data Lake. Records are created via `POST /services/data/vXX.0/sobjects/AppAnalyticsQueryRequest` and polled via `GET /services/data/vXX.0/sobjects/AppAnalyticsQueryRequest/<id>`. The system processes the query and provides a presigned download URL upon completion.
|
|
35
|
+
|
|
36
|
+
**Fields (14 properties):**
|
|
37
|
+
|
|
38
|
+
| Field | Type | Description |
|
|
39
|
+
|-------|------|-------------|
|
|
40
|
+
| DataType | string (filterable) | Type of analytics data. Values: `PackageUsageSummary`, `PackageUsageLog`, `SubscriberSnapshot` |
|
|
41
|
+
| RequestState | string (filterable) | Processing status. Values: `New`, `Pending`, `Complete`, `Expired`, `Failed`, `NoData`, `Delivered` |
|
|
42
|
+
| StartTime | string | Start of time range for requested data |
|
|
43
|
+
| EndTime | string | End of time range. Should be set on an hour boundary |
|
|
44
|
+
| AvailableSince | string | Limits query to data indexed after this time (inclusive). Use for incremental retrieval |
|
|
45
|
+
| PackageIds | string | Comma-delimited list of managed package IDs (033-prefix) |
|
|
46
|
+
| OrganizationIds | string | Comma-delimited list of subscriber org IDs to filter results |
|
|
47
|
+
| DownloadUrl | string | Presigned URL for downloading results. Populated when RequestState is Complete |
|
|
48
|
+
| DownloadSize | long | Size in bytes of the result data file |
|
|
49
|
+
| DownloadExpirationTime | string | Time at which the download URL expires |
|
|
50
|
+
| FileType | string (filterable) | Output format. Values: `csv`, `parquet` |
|
|
51
|
+
| FileCompression | string (filterable) | Compression. Values: `none`, `gzip`, `snappy` |
|
|
52
|
+
| QuerySubmittedTime | string | Time the query was submitted to the Data Lake |
|
|
53
|
+
| ErrorMessage | string | Diagnostic message for failed queries |
|
|
54
|
+
|
|
55
|
+
### AppAnalyticsSettings (Metadata API)
|
|
56
|
+
|
|
57
|
+
Configuration settings for ISV App Analytics that control simulation mode and opt-out behavior. Deployed via the Metadata API (`sf project deploy`) or Tooling API.
|
|
58
|
+
|
|
59
|
+
**Fields (2 properties):**
|
|
60
|
+
|
|
61
|
+
| Field | Type | Description |
|
|
62
|
+
|-------|------|-------------|
|
|
63
|
+
| enableSimulationMode | boolean (filterable) | When true, allows querying sample usage logs for integration testing without real subscriber data |
|
|
64
|
+
| enableAppAnalyticsOptOut | boolean (filterable) | When true, opts this subscriber org out of AppExchange App Analytics data collection |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Request Lifecycle
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
New → Pending → Complete → (download within expiration window)
|
|
72
|
+
→ Expired (download URL no longer valid)
|
|
73
|
+
→ Delivered (download confirmed received)
|
|
74
|
+
→ Failed (check errorMessage)
|
|
75
|
+
→ NoData (no matching records for the criteria)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Common Patterns
|
|
81
|
+
|
|
82
|
+
### Query Package Usage Summary (last 7 days)
|
|
83
|
+
|
|
84
|
+
Create a record via the REST API:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
POST /services/data/v60.0/sobjects/AppAnalyticsQueryRequest
|
|
88
|
+
Content-Type: application/json
|
|
89
|
+
|
|
90
|
+
{
|
|
91
|
+
"DataType": "PackageUsageSummary",
|
|
92
|
+
"StartTime": "<7-days-ago>T00:00:00Z",
|
|
93
|
+
"EndTime": "<today-on-hour-boundary>T00:00:00Z",
|
|
94
|
+
"PackageIds": "033XXXXXXXXXXXX",
|
|
95
|
+
"FileType": "csv",
|
|
96
|
+
"FileCompression": "gzip"
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Poll the record via GET until `RequestState` reaches `Complete`, then download from `DownloadUrl`.
|
|
101
|
+
|
|
102
|
+
### Incremental Data Retrieval
|
|
103
|
+
|
|
104
|
+
Set `AvailableSince` to the timestamp of your last successful query completion to avoid re-downloading data you already have.
|
|
105
|
+
|
|
106
|
+
### Enable Simulation Mode for Testing
|
|
107
|
+
|
|
108
|
+
Deploy `AppAnalyticsSettings` via Metadata API with `enableSimulationMode: true` to query sample data without real subscribers.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## High-Signal Gotchas
|
|
113
|
+
|
|
114
|
+
- AppAnalyticsQueryRequest is an **sObject** — create and poll records via the REST Data API (`/sobjects/AppAnalyticsQueryRequest`), NOT via Metadata API XML deployment.
|
|
115
|
+
- AppAnalyticsQueryRequest does NOT have Apex triggers and does NOT flow through custom objects or Flows.
|
|
116
|
+
- Download URLs expire — always check `DownloadExpirationTime` before attempting download.
|
|
117
|
+
- `EndTime` should be set on an hour boundary for consistent results.
|
|
118
|
+
- `AvailableSince` is inclusive — data indexed at exactly that timestamp will be included.
|
|
119
|
+
- `PackageIds` uses 033-prefix IDs, not 04t (package version) IDs.
|
|
120
|
+
- Data is processed asynchronously by the ISV Intelligence Data Lake infrastructure. There is no synchronous query option.
|
|
121
|
+
- `FileType: parquet` with `FileCompression: snappy` gives optimal performance for large datasets.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Output Format
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
Analytics task: <query / configure / troubleshoot>
|
|
129
|
+
Data type: <PackageUsageSummary / PackageUsageLog / SubscriberSnapshot>
|
|
130
|
+
Package IDs: <033-prefixed IDs>
|
|
131
|
+
Time range: <startTime> to <endTime>
|
|
132
|
+
File format: <csv|parquet> / <none|gzip|snappy>
|
|
133
|
+
Request state: <current state>
|
|
134
|
+
Next step: <poll for completion / download / investigate failure>
|
|
135
|
+
```
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: platform-agentexchange-partner-offers-enable
|
|
3
|
+
description: "Enable or disable the org preference that controls whether a Salesforce org can receive partner offers from the Transactable Marketplace. Use this skill when the user wants to turn partner offer reception on or off for an org. TRIGGER when: user asks to enable or disable partner offers, configure TransactableMarketplaceReceivePartnerOffers, configure enableTransactableMarketplaceReceivePartnerOffers, set up marketplace partner offer reception, toggle the TM partner offers setting, edit a TransactableMarketplacePrivateOffer.settings file, or configure org preferences related to transactable marketplace. DO NOT TRIGGER when: user needs to create or manage the partner offer records themselves, configure marketplace listing settings, or work with SfdcPartnerOffer objects (use deploying-metadata or generating-apex instead)."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
minApiVersion: "67.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Enabling Transactable Marketplace Receive Partner Offers Org Preference
|
|
10
|
+
|
|
11
|
+
This skill configures the `enableTransactableMarketplaceReceivePartnerOffers` org preference via the `TransactableMarketplacePrivateOfferSettings` Metadata API type, which controls whether a Salesforce org is eligible to receive partner offers through the Transactable Marketplace. It is required for subscriber orgs that participate in the TM partner offer flow.
|
|
12
|
+
|
|
13
|
+
## Scope
|
|
14
|
+
|
|
15
|
+
- **In scope**: Reading the current value of the pref, enabling or disabling it via Metadata API (`TransactableMarketplacePrivateOfferSettings`), and verifying the change took effect.
|
|
16
|
+
- **Out of scope**: Creating or managing partner offer records, configuring marketplace listings, or any Apex/trigger changes related to offer processing.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Required Inputs
|
|
21
|
+
|
|
22
|
+
- **Target org alias or username**: The org where the pref should be set. Ask if not provided.
|
|
23
|
+
- **Desired state**: `true` (enable) or `false` (disable). Default: `true`.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Workflow
|
|
28
|
+
|
|
29
|
+
### Phase 1 — Check current state
|
|
30
|
+
|
|
31
|
+
1. **Query the current preference value** by running:
|
|
32
|
+
```bash
|
|
33
|
+
sf data query -q "SELECT Preference, Value FROM OrgPreference WHERE Preference = 'TransactableMarketplaceReceivePartnerOffers'" --target-org <alias> --use-tooling-api
|
|
34
|
+
```
|
|
35
|
+
If the record exists and `Value = true`, the pref is already enabled — confirm with the user before proceeding.
|
|
36
|
+
If the query returns no rows, the pref is not yet set (defaults to `false`).
|
|
37
|
+
|
|
38
|
+
2. **Resolve the org's package directory** to determine where to write metadata. Run this and use its output as `<packageDir>`:
|
|
39
|
+
```bash
|
|
40
|
+
jq -r '.packageDirectories[0].path // "force-app/main/default"' sfdx-project.json
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Phase 2 — Apply the preference
|
|
44
|
+
|
|
45
|
+
3. **Write the TransactableMarketplacePrivateOfferSettings metadata file** — load `assets/org-pref-template.md` for the exact XML structure, then write the file at:
|
|
46
|
+
```text
|
|
47
|
+
<packageDir>/settings/TransactableMarketplacePrivateOffer.settings
|
|
48
|
+
```
|
|
49
|
+
Set `<enableTransactableMarketplaceReceivePartnerOffers>true</enableTransactableMarketplaceReceivePartnerOffers>` (or `false` if disabling).
|
|
50
|
+
|
|
51
|
+
4. **Deploy the metadata** to the target org. Before running the deploy, confirm with the user:
|
|
52
|
+
- [ ] Confirmed the target org alias with the user (deploying to the wrong org is not easily reversible)
|
|
53
|
+
- [ ] Confirmed the desired state (`true`/`false`) matches the user's intent
|
|
54
|
+
```bash
|
|
55
|
+
sf project deploy start --metadata TransactableMarketplacePrivateOfferSettings --target-org <alias>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Phase 3 — Verify
|
|
59
|
+
|
|
60
|
+
5. **Confirm the change** by re-running the Tooling API query from step 1 and verifying the `Value` column matches the desired state.
|
|
61
|
+
|
|
62
|
+
6. **Report to the user** — see Output Expectations below.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Rules / Constraints
|
|
67
|
+
|
|
68
|
+
| Rule | Rationale |
|
|
69
|
+
|------|-----------|
|
|
70
|
+
| Always query the current value before writing metadata | Avoids unnecessary deploys and detects conflicting changes |
|
|
71
|
+
| Use `TransactableMarketplacePrivateOfferSettings` as the metadata type | This is the concrete type registered in the platform for this pref, not the generic `OrgPreferenceSettings` |
|
|
72
|
+
| The settings file must be named `TransactableMarketplacePrivateOffer.settings` | Metadata API requires the filename to match the settings node name |
|
|
73
|
+
| Do not hardcode `force-app/main/default/` | Always read `sfdx-project.json` for the actual package directory |
|
|
74
|
+
| Never deploy without confirming the org alias with the user | Deploying to the wrong org is not easily reversible |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Gotchas
|
|
79
|
+
|
|
80
|
+
| Issue | Resolution |
|
|
81
|
+
|-------|------------|
|
|
82
|
+
| Tooling API query returns no rows | Pref is unset (defaults to `false`). Safe to create a new settings file. |
|
|
83
|
+
| Deploy fails with `INVALID_TYPE` | The metadata type name is `TransactableMarketplacePrivateOfferSettings` — check the `--metadata` flag value. |
|
|
84
|
+
| Deploy succeeds but value doesn't change | Another settings file in the project may be overriding this one. Search for other `TransactableMarketplacePrivateOffer.settings` files in the project. |
|
|
85
|
+
| `INSUFFICIENT_ACCESS_OR_READONLY` on deploy | User running the deploy must have the "Modify All Data" or org preference admin permission in the target org. |
|
|
86
|
+
| Pref not visible in UI | `enableTransactableMarketplaceReceivePartnerOffers` is not surfaced in Setup UI — the Tooling API query is the only way to verify it. |
|
|
87
|
+
| Available from API version 67.0+ only | The type is available from API v67.0 — deploying against an older API version will fail. |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Output Expectations
|
|
92
|
+
|
|
93
|
+
After completing all phases, report:
|
|
94
|
+
|
|
95
|
+
```text
|
|
96
|
+
Org: <alias>
|
|
97
|
+
Preference: enableTransactableMarketplaceReceivePartnerOffers
|
|
98
|
+
Previous value: <true|false|unset>
|
|
99
|
+
New value: <true|false>
|
|
100
|
+
File written: <packageDir>/settings/TransactableMarketplacePrivateOffer.settings
|
|
101
|
+
Deploy status: Success
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Reference File Index
|
|
107
|
+
|
|
108
|
+
| File | When to read |
|
|
109
|
+
|------|-------------|
|
|
110
|
+
| `assets/org-pref-template.md` | Phase 2, step 3 — use as the exact XML structure for the settings file |
|
|
111
|
+
| `examples/org-preference-settings.xml` | To verify the generated file matches expected format |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# TransactableMarketplacePrivateOfferSettings XML Template
|
|
2
|
+
|
|
3
|
+
Use this exact structure when writing the settings metadata file.
|
|
4
|
+
|
|
5
|
+
## File path
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
<packageDir>/settings/TransactableMarketplacePrivateOffer.settings
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Template
|
|
12
|
+
|
|
13
|
+
```xml
|
|
14
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
15
|
+
<TransactableMarketplacePrivateOfferSettings xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
16
|
+
<enableTransactableMarketplaceReceivePartnerOffers>true</enableTransactableMarketplaceReceivePartnerOffers>
|
|
17
|
+
</TransactableMarketplacePrivateOfferSettings>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Replace `true` with `false` to disable.
|
|
21
|
+
|
|
22
|
+
## Notes
|
|
23
|
+
|
|
24
|
+
- The metadata type is `TransactableMarketplacePrivateOfferSettings`, available from API version 67.0+.
|
|
25
|
+
- This type is registered with `apiCreateAllowed="false"` and `apiDeleteAllowed="false"` — it can only be updated, not created or deleted via the API. This does NOT mean you should skip writing the file: the preference always exists in the org with a default value, so writing a new local settings file and deploying it is treated as an update by the Metadata API and is always valid.
|
|
26
|
+
- The `xmlns` attribute is required; omitting it causes a deploy parse error.
|
|
27
|
+
- The field name is `enableTransactableMarketplaceReceivePartnerOffers` (note the `enable` prefix).
|
package/skills/platform-agentexchange-partner-offers-enable/examples/org-preference-settings.xml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<TransactableMarketplacePrivateOfferSettings xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
3
|
+
<enableTransactableMarketplaceReceivePartnerOffers>true</enableTransactableMarketplaceReceivePartnerOffers>
|
|
4
|
+
</TransactableMarketplacePrivateOfferSettings>
|