Class WikiConfiguration

Wiki-wide configuration. This is applied to all users of the wiki, and has the potential to break things for EVERYONE if not set to proper values.

As much as possible, the correct configuration location should be protected to avoid vandalism or bad-faith changes.

This configuration works if specific settings are set. In other words, some features of Deputy are disabled unless Deputy has been configured. This is to avoid messing with existing on-wiki processes.

Hierarchy (view full)

Constructors

Properties

all: {
    ante: {
        enabled: Setting<boolean, boolean>;
    };
    cci: {
        collapseBottom: Setting<string, string>;
        collapseTop: Setting<string, string>;
        earwigRoot: Setting<string, URL>;
        enabled: Setting<boolean, boolean>;
        headingMatch: Setting<string, string>;
        resortRows: Setting<boolean, boolean>;
        rootPage: Setting<string, Title>;
    };
    core: {
        changeTag: Setting<string, string>;
        configVersion: Setting<number, number>;
        dispatchRoot: Setting<string, URL>;
        lastEdited: Setting<number, number>;
    };
    ia: {
        allowPresumptive: Setting<boolean, boolean>;
        batchListingPageWikitext: Setting<string, string>;
        batchListingWikitext: Setting<string, string>;
        enabled: Setting<boolean, boolean>;
        entirePageAppendBottom: Setting<boolean, boolean>;
        hideTemplate: Setting<string, string>;
        hideTemplateBottom: Setting<string, string>;
        listingWikitext: Setting<string, string>;
        listingWikitextMatch: Setting<string, string>;
        preload: Setting<string, string>;
        responses: Setting<CopyrightProblemsResponse[], CopyrightProblemsResponse[]>;
        rootPage: Setting<string, Title>;
        subpageFormat: Setting<string, string>;
    };
} = ...

Type declaration

  • ante: {
        enabled: Setting<boolean, boolean>;
    }
  • cci: {
        collapseBottom: Setting<string, string>;
        collapseTop: Setting<string, string>;
        earwigRoot: Setting<string, URL>;
        enabled: Setting<boolean, boolean>;
        headingMatch: Setting<string, string>;
        resortRows: Setting<boolean, boolean>;
        rootPage: Setting<string, Title>;
    }
  • core: {
        changeTag: Setting<string, string>;
        configVersion: Setting<number, number>;
        dispatchRoot: Setting<string, URL>;
        lastEdited: Setting<number, number>;
    }
    • changeTag: Setting<string, string>
    • configVersion: Setting<number, number>

      Numerical code that identifies this config version. Increments for every breaking configuration file change.

    • dispatchRoot: Setting<string, URL>
    • lastEdited: Setting<number, number>
  • ia: {
        allowPresumptive: Setting<boolean, boolean>;
        batchListingPageWikitext: Setting<string, string>;
        batchListingWikitext: Setting<string, string>;
        enabled: Setting<boolean, boolean>;
        entirePageAppendBottom: Setting<boolean, boolean>;
        hideTemplate: Setting<string, string>;
        hideTemplateBottom: Setting<string, string>;
        listingWikitext: Setting<string, string>;
        listingWikitextMatch: Setting<string, string>;
        preload: Setting<string, string>;
        responses: Setting<CopyrightProblemsResponse[], CopyrightProblemsResponse[]>;
        rootPage: Setting<string, Title>;
        subpageFormat: Setting<string, string>;
    }
    • allowPresumptive: Setting<boolean, boolean>
    • batchListingPageWikitext: Setting<string, string>

      $1 - Page to include

    • batchListingWikitext: Setting<string, string>

      $1 - Title of the batch $2 - List of pages (newlines should be added in batchListingPageWikitext). $3 - User comment

    • enabled: Setting<boolean, boolean>
    • entirePageAppendBottom: Setting<boolean, boolean>
    • hideTemplate: Setting<string, string>
    • hideTemplateBottom: Setting<string, string>
    • listingWikitext: Setting<string, string>
    • listingWikitextMatch: Setting<string, string>

      CopyrightProblemsListing#articleCvRegex

      This should match both normal and batch listings.

    • preload: Setting<string, string>
    • responses: Setting<CopyrightProblemsResponse[], CopyrightProblemsResponse[]>
    • rootPage: Setting<string, Title>
    • subpageFormat: Setting<string, string>
ante: {
    enabled: Setting<boolean, boolean>;
} = ...
cci: {
    collapseBottom: Setting<string, string>;
    collapseTop: Setting<string, string>;
    earwigRoot: Setting<string, URL>;
    enabled: Setting<boolean, boolean>;
    headingMatch: Setting<string, string>;
    resortRows: Setting<boolean, boolean>;
    rootPage: Setting<string, Title>;
} = ...
core: {
    changeTag: Setting<string, string>;
    configVersion: Setting<number, number>;
    dispatchRoot: Setting<string, URL>;
    lastEdited: Setting<number, number>;
} = ...

Type declaration

  • changeTag: Setting<string, string>
  • configVersion: Setting<number, number>

    Numerical code that identifies this config version. Increments for every breaking configuration file change.

  • dispatchRoot: Setting<string, URL>
  • lastEdited: Setting<number, number>
editable?: boolean

Whether the configuration is editable by the current user or not.

ia: {
    allowPresumptive: Setting<boolean, boolean>;
    batchListingPageWikitext: Setting<string, string>;
    batchListingWikitext: Setting<string, string>;
    enabled: Setting<boolean, boolean>;
    entirePageAppendBottom: Setting<boolean, boolean>;
    hideTemplate: Setting<string, string>;
    hideTemplateBottom: Setting<string, string>;
    listingWikitext: Setting<string, string>;
    listingWikitextMatch: Setting<string, string>;
    preload: Setting<string, string>;
    responses: Setting<CopyrightProblemsResponse[], CopyrightProblemsResponse[]>;
    rootPage: Setting<string, Title>;
    subpageFormat: Setting<string, string>;
} = ...

Type declaration

  • allowPresumptive: Setting<boolean, boolean>
  • batchListingPageWikitext: Setting<string, string>

    $1 - Page to include

  • batchListingWikitext: Setting<string, string>

    $1 - Title of the batch $2 - List of pages (newlines should be added in batchListingPageWikitext). $3 - User comment

  • enabled: Setting<boolean, boolean>
  • entirePageAppendBottom: Setting<boolean, boolean>
  • hideTemplate: Setting<string, string>
  • hideTemplateBottom: Setting<string, string>
  • listingWikitext: Setting<string, string>
  • listingWikitextMatch: Setting<string, string>

    CopyrightProblemsListing#articleCvRegex

    This should match both normal and batch listings.

  • preload: Setting<string, string>
  • responses: Setting<CopyrightProblemsResponse[], CopyrightProblemsResponse[]>
  • rootPage: Setting<string, Title>
  • subpageFormat: Setting<string, string>
outdated: boolean = false

Set to true when this configuration is outdated based on latest data. Usually adds banners to UI interfaces saying a new version of the configuration is available, and that it should be used whenever possible.

TODO: This doesn't do what the documentations says yet.

serializedData: any
sourcePage: Title
static: typeof WikiConfiguration = WikiConfiguration
type: "wiki" = ...
configLocations: string[] = WikiConfigurationLocations
configVersion: 2 = 2
optionKey: "userjs-deputy-wiki" = 'userjs-deputy-wiki'

Methods

  • Check if the current page being viewed is the active configuration page.

    Parameters

    • Optionalpage: Title

    Returns boolean

    true if the current page is the active configuration page.

  • Returns any

    the serialized version of the configuration. All undefined values are stripped from output. If a category remains unchanged from defaults, it is skipped. If the entire configuration remains unchanged, null is returned.

  • Check if the current page being viewed is a valid configuration page.

    Parameters

    • Optionalpage: Title

    Returns boolean

    true if the current page is a valid configuration page.

  • Loads the wiki configuration from localStorage and/or MediaWiki settings. This allows for faster loads at the expense of a (small) chance of outdated configuration.

    The localStorage layer allows fast browser-based caching. If a user is logging in again on another device, the user configuration will automatically be sent to the client, lessening turnaround time. If all else fails, the configuration will be loaded from the wiki.

    Returns Promise<WikiConfiguration>

    A WikiConfiguration object.