Code like …
- StatementChangeOpFactory.php
- ClaimsChanger.js
… does have optional index parameters, but they are never used, at least not in the Wikibase code base.
The parameter should not be removed from RepoApi.js because this may be used from user scripts and gadgets.