npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-xmpp-serviceadmin

v0.3.0

Published

Service Administration (XEP-0133) library for node-xmpp

Downloads

7

Readme

node-xmpp-serviceadmin

Jabber Service Administration XEP-0133 library for node-xmpp.

Build Status Dependency Status NPM version

Installation

With package manager npm:

npm install --save node-xmpp-serviceadmin

Usage

First of all make sure your server is configured correctly (see "Configuring your server"). Then you can require and use the module like that:

var xmpp          = require("node-xmpp");
var ServiceAdmin  = require("node-xmpp-serviceadmin");

// define the host
var service = "example.org";

// define the JID that has the admin privileges
var root = "[email protected]";

// create the xmpp connection
var comp = new xmpp.Component({
  jid       : "mycomponent",
  password  : "secret",
  host      : "127.0.0.1",
  port      : "8888"
});

var sa = new ServiceAdmin(root, comp, service);

// wait until the component is online
comp.on("online", function(){

  // creating a new user
  sa.addUser(
    "[email protected]",
    "secret",
    { name: "Der Weihnachtsmann" },
    function(err){ /*...*/ }
  );

  // changing a user password
  sa.changeUserPassword(
    "[email protected]",
    "newSecret",
    function(err){ /*...*/ }
  );

  // receive a user's password
  sa.getUserPassword(
    "[email protected]",
    function(err){ /*...*/ }
  );

  // delete a user
  sa.deleteUser(
    "[email protected]",
    function(err){ /*...*/ }
  );

  // delete multiple users at once
  sa.deleteUser(
    ["[email protected]","[email protected]"],
    function(err){ /*...*/ }
  );

});

Configuring your server

Make sure that:

  1. The server supports XEP-0133
  2. The JID of your component has admin privileges
  3. XEP-0133 is enabled

Prosody

admins = { "[email protected]", "[email protected]" }

modules_enabled = {
  --
  "admin_adhoc";
  --
};

ejabberd

v2.13 and older

{acl, admin, {user, "root", "example.org"}}.
{acl, admin, {user, "admin", "component.example.org"}}.

v13.10 and newer

acl:
  admin:
    user:
      - "root":  "example.org"
      - "admin": "component.example.org"

Implemented methods

  • 4.1. Add User
  • 4.2. Delete User
  • 4.5. End User Session
  • 4.6. Get User Password
  • 4.7. Change User Password

Missing methods

  • 4.3. Disable User
  • 4.4. Re-Enable User
  • 4.8. Get User Roster
  • 4.9. Get User Last Login Time
  • 4.10. Get User Statistics
  • 4.11. Edit Blacklist
  • 4.12. Edit Whitelist
  • 4.13. Get Number of Registered Users
  • 4.14. Get Number of Disabled Users
  • 4.15. Get Number of Online Users
  • 4.16. Get Number of Active Users
  • 4.17. Get Number of Idle Users
  • 4.18. Get List of Registered Users
  • 4.19. Get List of Disabled Users
  • 4.20. Get List of Online Users
  • 4.21. Get List of Active Users
  • 4.22. Get List of Idle Users
  • 4.23. Send Announcement to Online Users
  • 4.24. Set Message of the Day
  • 4.25. Edit Message of the Day
  • 4.26. Delete Message of the Day
  • 4.27. Set Welcome Message
  • 4.28. Delete Welcome Message
  • 4.29. Edit Admin List
  • 4.30. Restart Service
  • 4.31. Shut Down Service

Running tests

npm install
npm test

License

node-xmpp-serviceadmin is licensed under the MIT-Licence (see LICENSE.txt)