Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ai-addons/claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ For failures, use **`cs.error(...)`** (and **`cs.result(...)`** / **`cs.close()`

**Use `cs.runApiRequest(url, settings?)` (or `customScript.runApiRequest`) for all Metric Insights backend HTTP calls.** Do not use raw `fetch`, `XMLHttpRequest`, or manual AJAX for normal API access unless you have a rare, documented exception.

### Official MI API docs (partial coverage)

- Primary docs: **https://help.metricinsights.com/m/API_Access**
- Coverage is **not complete**. Some endpoints/fields/edge-case behaviors may be undocumented; confirm with runtime API responses, your MI instance behavior, and release notes/support when needed.

### Authentication

Metric Insights injects API authentication for you. Each request includes an HTTP header:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Scaffolded with `cs-helper`. Build: `npm run build` → `dist/`. The build scrip

**Use `cs.runApiRequest(url, settings?)` for every MI backend HTTP call** (not raw `fetch` / XHR by default).

### Official MI API docs (partial)

- Primary reference: **https://help.metricinsights.com/m/API_Access**
- Treat this documentation as **incomplete**. Some endpoints, behavior details, and version-specific quirks may be missing. Validate with runtime responses and MI support/release notes when implementation details are unclear.

- **Auth:** MI injects header **`token`:** same value as **`cs.apiToken`**. Do not set it manually for normal API use.
- **Token TTL:** Server-configured; often **≥ ~5 minutes** in typical setups, but **verify** your policy. Long-running scripts should implement **refresh**: **`GET`** **`/api/get_token`** → JSON **`{ token: string; expires: string }`**, then continue API calls with refreshed credentials per your MI version (schedule using **`expires`**).
- **Stack:** Wrapper over **jQuery.ajax** — **jQuery 1.2.x** on v6 (PhantomJS), **jQuery 3.x** on v7 (Puppeteer). **`settings`** = jQuery ajax options (`success`, `error`, `type`, `data`, …).
Expand Down
46 changes: 17 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@types/prompts": "^2.4.9",
"brace-expansion": "5.0.5",
"picomatch": "4.0.4",
"prettier": "^3.8.2",
"prettier": "^3.8.3",
"semantic-release": "^25.0.3"
},
"dependencies": {
Expand All @@ -99,8 +99,8 @@
"prompts": "^2.4.2",
"string-includes-polyfill": "^1.0.6",
"ts-loader": "^9.5.7",
"typescript": "^6.0.2",
"webpack": "^5.106.1"
"typescript": "^6.0.3",
"webpack": "^5.106.2"
Comment thread
sergak01 marked this conversation as resolved.
},
"bugs": {
"url": "https://github.com/mi-examples/cs-helper/issues"
Expand Down
2 changes: 1 addition & 1 deletion templates/custom-script-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"prettier": "^3.8.1"
"prettier": "^3.8.3"
},
"dependencies": {
"@metricinsights/cs-helper": "^%PLUGIN_VERSION%"
Expand Down
4 changes: 2 additions & 2 deletions templates/custom-script-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"author": "",
"license": "ISC",
"devDependencies": {
"prettier": "^3.8.1",
"typescript": "^5.9.3"
"prettier": "^3.8.3",
"typescript": "^6.0.3"
},
"dependencies": {
"@metricinsights/cs-helper": "^%PLUGIN_VERSION%"
Expand Down
Loading