wiki-saikou
Version:
The library provides the out of box accessing to MediaWiki API in both browsers & Node.js, and the syntax is very similar to vanilla `new mw.Api()`. TypeScript definition included~
74 lines (73 loc) • 1.71 kB
JavaScript
import { W as r, a as n, b as t, r as l } from "./WikiSaikou-DPIdN41C.js";
import { C as F, F as k, i as p, j as A, m as E, n as M, g as W, g as f, k as C, M as w, d as S, p as m, e as h, h as L, c as R, o as b, f as y, l as B, q as I } from "./WikiSaikou-DPIdN41C.js";
class c extends r {
async clientLogin(o, s, e) {
e ||= {}, !e.logincontinue && !e.loginreturnurl && (e.loginreturnurl = location?.origin);
const i = await this.postWithToken(
"login",
{
action: "clientlogin",
username: o,
password: s,
...e
},
{
tokenName: "logintoken"
}
);
if (i?.data?.clientlogin?.status === "PASS")
return i.data.clientlogin;
throw new n(
t.LOGIN_FAILED,
i.data.clientlogin.message,
i
);
}
}
class d extends c {
constructor(o, s, e) {
const i = l(
o,
{
credentials: "include",
mode: "cors",
...s
},
{
origin: location.origin,
...e
}
);
super(i);
}
}
export {
F as CallableInstance,
k as Fexios,
p as FexiosError,
A as FexiosErrorCodes,
E as FexiosHeaderBuilder,
M as FexiosQueryBuilder,
W as FexiosResponse,
f as FexiosResponseContext,
C as FexiosResponseError,
d as ForeignApi,
c as MediaWikiApi,
w as MediaWikiApiError,
d as MediaWikiForeignApi,
c as MwApi,
r as MwApiBase,
S as MwParamNormalizer,
r as WikiSaikouCore,
n as WikiSaikouError,
t as WikiSaikouErrorCode,
m as clone,
h as createFexios,
L as createFexiosResponse,
R as createFexiosSaikou,
b as deepMerge,
y as fexios,
B as isFexiosError,
I as isPlainObject
};
//# sourceMappingURL=index.mjs.map