You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(insights): add getElementStats to MaestroProcesses and Cases [PLT-102911] (#416)
* feat(insights): add getElementCountByStatus to ProcessInstances and CaseInstances
Add Insights RTM endpoint for retrieving per-element execution counts
and duration percentile metrics (min, max, avg, p50, p95, p99) for
BPMN elements.
- Use Date input for startTime/endTime, convert internally via
.getTime()
- CaseInstancesService delegates to ProcessInstancesService
- Extract getElementCountByStatusImpl to avoid double @track
- Add JSDoc, type annotations, and trailing newlines
PLT-102911
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: sync CaseInstances.getElementCountByStatus JSDoc with ServiceModel
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add @internal to getElementCountByStatusImpl and sync ProcessInstances JSDoc
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor(tests): reduce duplication in ElementCountByStatus tests
- Extract mock response data to MAESTRO_TEST_CONSTANTS
- Remove redundant error/empty tests from case-instances (delegation-only)
- Add shared expectValidElementCountByStatus helper for integration tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tests): add error test for CaseInstances.getElementCountByStatus
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor(tests): extract shared testGetElementCountByStatus integration helper
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: extract fetchElementCountByStatus to shared insights helper
Removes ProcessInstancesService dependency from CaseInstancesService.
Both services now call the shared function directly via their own
BaseService.post method.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tests): update stale test descriptions and remove dead test
- Fix CaseInstances test descriptions referencing old delegation pattern
- Remove isCaseManagement absence test (field was never set)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor(insights): move getElementCountByStatus to MaestroProcesses and Cases
Move getElementCountByStatus from ProcessInstances/CaseInstances to
MaestroProcesses/Cases, aligning with other Insights aggregate methods
(getTopRunCount, getTopFaultedCount, etc.).
- Use positional params instead of options object (all required)
- Add bound methods on process/case objects (startTime, endTime, version)
- Replace fetchElementCountByStatus with buildElementCountByStatusBody
- Add CaseMethods interface and createCaseWithMethods factory for Cases
- Update tests: comprehensive in processes, minimal in cases
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: rename version param to packageVersion
Aligns with the packageVersions field on process/case objects.
The API body field remains "version" — mapped in
buildElementCountByStatusBody.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: sync service class JSDoc with model interfaces
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address PR review — move integration tests, add model tests
- Move getElementCountByStatus integration tests from instance files
to processes/cases integration files
- Update helper to match MaestroProcesses/Cases getAll() signature
- Fix orphaned extractCaseName JSDoc in cases.ts
- Add model tests for bound methods (processes.test.ts, cases.test.ts)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(tests): update stale test descriptions and remove dead test
- Skip integration tests (insightsrtm_ requires OAuth, not PAT)
- Remove out-of-scope getIncidents model tests
- Keep only success test for cases (minimal pattern)
- Fix stale @returns JSDoc on CasesServiceModel.getAll
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: fix oauth-scopes formatting for getElementCountByStatus in Cases and Processes
Co-authored-by: Shreyash <ninja-shreyash@users.noreply.github.com>
* refactor: rename getElementCountByStatus to getElementStats
Rename public method and type for brevity:
- getElementCountByStatus() → getElementStats()
- ElementCountByStatus → ElementStats
- Internal names unchanged (endpoint constant, body builder, API path)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Shreyash <ninja-shreyash@users.noreply.github.com>
0 commit comments