mediawiki.api.edit: Add edit() and create() methods

Authored by Krinkle on Jun 27 2016, 4:08 PM.

Unpublished Commit · Learn More

Publishing Disabled: All publishing is disabled for this repository.


mediawiki.api.edit: Add edit() and create() methods

Doing edits "The Right Way" is non-trivial due there being mulitple strict options that
need to be known and enabled. By default, the API encourages bad behaviour:

  • Edit is unexpectedly saved as anon after session becomes invalid.
  • Other edits are silently overwritten.
  • Accidentally re-creates a deleted page.
  • Accidentally creates a new page when an edit was intended (eg. if title was wrong).

Implement abstraction methods for edit and create that handle all this.
Thus guarding JS edits with the same protections as EditPage.

Change-Id: Ic6a35902cbae262971c704b9b8127e54733dac79