@glen/wiki-rpc-client
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

Client for Wiki RPC Interface 2.0

TypeScript client for Wiki RPC Interface 2.0 (web.archive.org).

This is the Remote API interface that Dokuwiki implements.

Usage

import { WikiRpcClient } from "@glen/wiki-rpc-client";

const main = async () => {
  const url = "http://localhost/lib/exe/xmlrpc.php";
  const client = new WikiRpcClient(url);
  const data = await client.call("wiki.getPage", ["start"]);
  console.log(data);
};

main().catch((e: Error) => console.error(e));

Additionally, you can create client proxy and specify function signatures

import { WikiRpcClient, WikiService, DokuwikiService, DokuwikiPluginStructService } from "@glen/wiki-rpc-client";

// create client proxy with DokuwikiService service definitions
const client = WikiRpcClient.create<DokuwikiService>(url);

// the services can be combined as well:
const client = WikiRpcClient.create<WikiService & DokuwikiService>(url);

// combine with "struct" plugin methods:
const client = WikiRpcClient.create<WikiService & DokuwikiService & DokuwikiPluginStructService>(url);

const dwVersion = await client["dokuwiki.getVersion"]();
console.log(dwVersion);

const data = await client["wiki.getPage"]("start");
console.log(data);

Dependents (0)

Package Sidebar

Install

npm i @glen/wiki-rpc-client

Weekly Downloads

0

Version

0.4.0

License

MIT

Unpacked Size

19.5 kB

Total Files

24

Last publish

Collaborators

  • glen