Skip to content

Marketing skills for Claude Code and AI agents. CRO, copywriting, SEO, analytics, and growth engineering.

fix(adobe): list the report suite collection resource

Rudy Celeklia50da0b2bcd0
diff --git a/tests/clis/adobe-report-suites.test.cjs b/tests/clis/adobe-report-suites.test.cjs
new file mode 100644
index 0000000..04f181b
--- /dev/null
+++ b/tests/clis/adobe-report-suites.test.cjs
@@ -0,0 +1,28 @@
+const { test } = require('node:test')
+const assert = require('node:assert/strict')
+const { spawnSync } = require('node:child_process')
+const path = require('node:path')
+const cli = path.resolve(__dirname, '../../tools/clis/adobe-analytics.js')
+const suites=[{rsid:'owned-suite',id:'owned-suite',name:'Owned suite',timezoneZoneinfo:'US/Pacific'}]
+function run(args, oracle='') {
+ const fixture=`global.fetch=async(url,options)=>{const assert=require('node:assert/strict');${oracle}
+ assert.equal(options.headers.Authorization,'Bearer fixture-token');assert.equal(options.headers['x-api-key'],'fixture-client');assert.equal(options.headers['x-proxy-global-company-id'],'owned-company');
+ return new Response(JSON.stringify(${JSON.stringify(suites)}),{status:200});
+ };process.argv=['node',${JSON.stringify(cli)},...${JSON.stringify(args)}];require(${JSON.stringify(cli)});`
+ return spawnSync(process.execPath,['-e',fixture],{encoding:'utf8',timeout:10000,env:{...process.env,ADOBE_ACCESS_TOKEN:'fixture-token',ADOBE_CLIENT_ID:'fixture-client',ADOBE_COMPANY_ID:'owned-company'}})
+}
+function output(result){assert.equal(result.status,0,result.stderr);return JSON.parse(result.stdout)}
+test('suite listing reaches the documented collection resource and preserves its array',()=>{
+ const result=output(run(['reportsuites','list'],"assert.equal(url,'https://analytics.adobe.io/api/owned-company/reportsuites/collections/suites');assert.equal(options.method,'GET');assert.equal(options.body,undefined)"))
+ assert.deepEqual(result,suites)
+})
+test('suite listing preview shows the same collection and masks credentials',()=>{
+ const result=output(run(['reportsuites','list','--dry-run'],"throw new Error('unexpected request')"))
+ assert.equal(result.url,'https://analytics.adobe.io/api/owned-company/reportsuites/collections/suites');assert.equal(result.headers.Authorization,'***');assert.equal(result.headers['x-api-key'],'***');assert.equal(result.headers['x-proxy-global-company-id'],'owned-company')
+})
+test('dimension discovery retains the report-suite query',()=>{
+ output(run(['dimensions','list','--rsid','owned-suite'],"assert.equal(url,'https://analytics.adobe.io/api/owned-company/dimensions?rsid=owned-suite');assert.equal(options.method,'GET')"))
+})
+test('report requests keep their existing reporting endpoint and body',()=>{
+ output(run(['reports','run','--rsid','owned-suite','--start-date','2026-09-01','--end-date','2026-09-30','--metrics','metrics/visits'],"assert.equal(url,'https://analytics.adobe.io/api/owned-company/reports');assert.equal(options.method,'POST');const body=JSON.parse(options.body);assert.equal(body.rsid,'owned-suite');assert.deepEqual(body.metricContainer,{metrics:[{id:'metrics/visits'}]})"))
+})
diff --git a/tools/clis/adobe-analytics.js b/tools/clis/adobe-analytics.js
index 1edd71c..3131aff 100755
--- a/tools/clis/adobe-analytics.js
+++ b/tools/clis/adobe-analytics.js
@@ -64,7 +64,7 @@ async function main() {
case 'reportsuites':
switch (sub) {
case 'list':
- result = await api('GET', '/reportsuites')
+ result = await api('GET', '/reportsuites/collections/suites')
break
default:
result = { error: 'Unknown reportsuites subcommand. Use: list' }
diff --git a/tools/integrations/adobe-analytics.md b/tools/integrations/adobe-analytics.md
index b4f4922..0fc20af 100644
--- a/tools/integrations/adobe-analytics.md
+++ b/tools/integrations/adobe-analytics.md
@@ -22,12 +22,21 @@ Enterprise analytics platform for cross-channel measurement and attribution.
### Get report suite info
```bash
-GET https://analytics.adobe.io/api/{company_id}/reportsuites
+GET https://analytics.adobe.io/api/{company_id}/reportsuites/collections/suites
Authorization: Bearer {access_token}
x-api-key: {client_id}
```
+The CLI's `reportsuites list` uses this collection endpoint and returns the
+provider's suite array unchanged. Read each suite's `rsid` before using the
+existing dimension, metric, or report commands. `--dry-run` previews the same
+resource with credentials masked. Availability depends on the account's
+permissions; an empty collection does not prove that no suites exist in the
+organization.
+
+Reference: [official Report Suites API](https://developer.adobe.com/analytics-apis/docs/2.0/guides/endpoints/report-suites).
+
### Get dimensions
```bash