Skip to content

fix: Add missing * value - #9

Open
Derugon wants to merge 2 commits into
wikimedia-gadgets:mainfrom
Derugon:allspecifier
Open

fix: Add missing * value#9
Derugon wants to merge 2 commits into
wikimedia-gadgets:mainfrom
Derugon:allspecifier

Conversation

@Derugon

@Derugon Derugon commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Issue

Some parameters accept one or multiple string values, such as ApiBlockParams.pagerestrictions.
For example, all following calls are valid:

  • api.post( { action: "block", pagerestrictions: "Foo", ... } )
  • api.post( { action: "block", pagerestrictions: ["Foo", "Bar", "Foo Bar"]], ... } )

And a few of these parameters alternatively accept a * value (equivalent to a list of all possible values), such as ApiBlockParams.namespacerestrictions.
For example, all following calls are valid:

  • api.post( { action: "block", namespacerestrictions: 2, ... } )
  • api.post( { action: "block", namespacerestrictions: [2, 3, 11], ... } )
  • api.post( { action: "block", namespacerestrictions: "*", ... } )

However, this * value is currently not included in interfaces.
For example, the current definition of ApiBlockParams.namespacerestriction is:

export interface ApiBlockParams extends ApiParams {
    namespacerestrictions?: namespace | namespace[];
    ...
}

Proposed changes

This information is provided by a allspecifier property in a module parameter. This PR allows its use as a single value.
For example, the definition of ApiBlockParams.namespacerestriction becomes:

export interface ApiBlockParams extends ApiParams {
    namespacerestrictions?: namespace | namespace[] | "*";
    ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant