/node-papercut

A node.js module for interacting with the PaperCut XML Web Services API

Primary LanguageJavaScriptMIT LicenseMIT

node-papercut

This module makes it slightly easier to interact with the PaperCut NG/MF XML Web Services API via your node.js application, and performs minimal validation of parameters for your API calls.

Using

const PaperCut = require('node-papercut');
const papercut = new PaperCut('my.server.address', 9192, 'my_auth_token');
papercut.getTotalUsers().then(n => console.log(`There are ${n} users`));

I've found that the online docs are often a bit outdated. The list of API methods below is more comprehensive and is based on the auto-generated ServerCommandProxy file included with PaperCut NG/MF. It's best to refer to this page for available methods.

The web API includes several overloaded methods (eg. adjustUserAccountBalance which may take four or five parameters) that are tricky to handle dynamically. Subsequent/variant methods of the same name are assigned a numeric suffix in this module, so you'll end up with:

papercut.adjustUserAccountBalance(username, adjustment, comment);
papercut.adjustUserAccountBalance_2(username, adjustment, comment, accountName);

therefore, again, it's best to refer to this page to see available methods.

Updating and Rebuilding

This module takes the dubious approach of scraping the HTML docs included with PaperCut NG/MF, then dynamically generating its own methods and docs based on the result. You can use this module without worrying about that, but this module may fall behind as new versions of PaperCut come out.

As a shortcut, you can use PaperCut.call_api(method, param[, ...]) to call an arbitrary API method without having to rebuild this module's data.

If you want to rebuild this module's list of methods, copy the file server/examples/webservices/java/docs/api/ServerCommandProxy.html from your PaperCut NG/MF application server into the root of this module and run the following commands:

npm run scrape
npm run docs

Occasionally, the format of ServerCommandProxy.html will change, and alterations will need to be made to scrape-api-docs.js to accommodate. Typically when this happens, the generated docs will show no methods.

I'd recommend working on a new branch in your own fork of the repo before running the above commands or making changes. If your update is successful and brings this module up to date with the latest version of PaperCut MF, a pull request would then be welcome. (If you're using PaperCut NG, remind me to verify that I won't lose any MF features by merging your branch. I haven't checked whether the same ServerCommandProxy.html file ships with both versions.)

PaperCut

An interface to the PaperCut XML web services API

Kind: global class

new PaperCut(host, port, token, path, tls)

Create an instance

Param Type Default Description
host string The PaperCut server's FQDN
port number Connect to this port number
token string Your API token
path string "/rpc/api/xmlrpc" The path to the XML web service
tls boolean true Use SSL/TLS

paperCut.call_api(method, ...param) ⇒ Promise

Call an arbitrary method on the API

Kind: instance method of PaperCut
Returns: Promise - Resolves with API response or rejects with error

Param Type Description
method string Method name, eg. 'getUserAccountBalance'
...param string | number | boolean Parameter(s) for the method call

paperCut.addAdminAccessGroup(groupName) ⇒ Promise

Adds a group as an admin group with the default admin rights.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
groupName string

paperCut.addAdminAccessUser(userName) ⇒ Promise

Adds a user as administrator with the default admin rights.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
userName string

paperCut.addNewGroup(groupName) ⇒ Promise

Add a new group to system's group list.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
groupName string

paperCut.addNewInternalUser(username, password, fullName, email, cardId, pin) ⇒ Promise

Creates and sets up a new internal user account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
password string
fullName string
email string
cardId string
pin string

paperCut.addNewSharedAccount(sharedAccountName) ⇒ Promise

Create a new shared account with the given name.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
sharedAccountName string

paperCut.addNewUser(username) ⇒ Promise

Trigger the process of adding a new user account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string

paperCut.addNewUsers() ⇒ Promise

Calling this method will start a specialized user and group synchronization process optimized for tracking down adding any new users that exist in the OS/Network/Domain user directory and not in the system.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

paperCut.addPrinterAccessGroup(serverName, printerName, groupName) ⇒ Promise

Adds the group to the printer access group list.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string
groupName string

paperCut.addPrinterGroup(serverName, printerName, printerGroupName) ⇒ Promise

Add a printer to a single printer group.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string
printerGroupName string

paperCut.addSharedAccountAccessGroup(sharedAccountName, groupName) ⇒ Promise

Allow the given group access to the given shared account without using a pin.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
sharedAccountName string
groupName string

paperCut.addSharedAccountAccessUser(sharedAccountName, userName) ⇒ Promise

Allow the given user access to the given shared account without using a pin.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
sharedAccountName string
userName string

paperCut.addUserToGroup(userName, groupName) ⇒ Promise

Adds the user to the specified group.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
userName string
groupName string

paperCut.adjustSharedAccountAccountBalance(accountName, adjustment, comment) ⇒ Promise

Adjust a shared account's account balance by an adjustment amount.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
accountName string
adjustment double
comment string

paperCut.adjustUserAccountBalance(username, adjustment, comment) ⇒ Promise

Adjust a user's built-in/default account balance by an adjustment amount.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
adjustment double
comment string

paperCut.adjustUserAccountBalance_2(username, adjustment, comment, accountName) ⇒ Promise

Adjust a user's account balance by an adjustment amount.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
adjustment double
comment string
accountName string

paperCut.adjustUserAccountBalanceByCardNumber(cardNumber, adjustment, comment) ⇒ Promise

Adjust a user's account balance.

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
cardNumber string
adjustment double
comment string

paperCut.adjustUserAccountBalanceByCardNumber_2(cardNumber, adjustment, comment, accountName) ⇒ Promise

Adjust a user's account balance.

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
cardNumber string
adjustment double
comment string
accountName string

paperCut.adjustUserAccountBalanceByGroup(group, adjustment, comment) ⇒ Promise

Adjust the account balance of all users in a group by an adjustment amount.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
group string
adjustment double
comment string

paperCut.adjustUserAccountBalanceByGroup_2(group, adjustment, comment, accountName) ⇒ Promise

Adjust the account balance of all users in a group by an adjustment amount.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
group string
adjustment double
comment string
accountName string

paperCut.adjustUserAccountBalanceByGroupUpTo(group, adjustment, limit, comment) ⇒ Promise

Adjust the account balance of all users in a group by an adjustment amount.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
group string
adjustment double
limit double
comment string

paperCut.adjustUserAccountBalanceByGroupUpTo_2(group, adjustment, limit, comment, accountName) ⇒ Promise

Adjust the account balance of all users in a group by an adjustment amount.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
group string
adjustment double
limit double
comment string
accountName string

paperCut.adjustUserAccountBalanceIfAvailable(username, adjustment, comment) ⇒ Promise

Adjust a user's account balance by an adjustment amount (if there is credit available).

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
username string
adjustment double
comment string

paperCut.adjustUserAccountBalanceIfAvailable_2(username, adjustment, comment, accountName) ⇒ Promise

Adjust a user's account balance by an adjustment amount (if there is credit available).

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
username string
adjustment double
comment string
accountName string

paperCut.adjustUserAccountBalanceIfAvailableLeaveRemaining(username, adjustment, leaveRemaining, comment) ⇒ Promise

Adjust a user's account balance by an adjustment amount (if there is credit available to leave the specified amount still available in the account).

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
username string
adjustment double
leaveRemaining double
comment string

paperCut.adjustUserAccountBalanceIfAvailableLeaveRemaining_2(username, adjustment, leaveRemaining, comment, accountName) ⇒ Promise

Adjust a user's account balance by an adjustment amount (if there is credit available to leave the specified amount still available in the account).

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
username string
adjustment double
leaveRemaining double
comment string
accountName string

paperCut.applyDeviceSettings(deviceName) ⇒ Promise

Initiates an update to the device of any outstanding configuration changes applied via the set-printer-property or set-printer-properties commands

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
deviceName string

paperCut.batchImportInternalUsers(importFile, overwriteExistingPasswords, overwriteExistingPINs) ⇒ Promise

Import the internal users contained in the given tab-delimited import file.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
importFile string
overwriteExistingPasswords boolean
overwriteExistingPINs boolean

paperCut.batchImportPrinters(importFile) ⇒ Promise

Updates printers based on the details contained in the given tab-delimited import file, creating them if required.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
importFile string

paperCut.batchImportSharedAccounts(importFile, test, deleteNonExistentAccounts) ⇒ Promise

Import the shared accounts contained in the given tab-delimited import file.

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
importFile string
test boolean
deleteNonExistentAccounts boolean

paperCut.batchImportUserCardIdNumbers(importFile, overwriteExistingPINs) ⇒ Promise

Import the user card/ID numbers and PINs contained in the given tab-delimited import file.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
importFile string
overwriteExistingPINs boolean

paperCut.batchImportUsers(importFile, createNewUsers) ⇒ Promise

Import the user details contained in the given tab-delimited import file.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
importFile string
createNewUsers boolean

paperCut.changeInternalAdminPassword(newPassword) ⇒ Promise

Change the internal admin password.

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
newPassword string

paperCut.clearUserAdvancedPrinterSettings(userName) ⇒ Promise

Clear the User's Advanced Printer Settings, settings cleared are: dont-hold-jobs-in-release-station, dont-apply-printer-filter-rules, printer-cost-adjustment-rate-percent, dont-archive, auto-release-jobs

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
userName string

paperCut.createUserClientAccountsFile() ⇒ Promise

Requests that the server create the client accounts to a file.

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

paperCut.deleteExistingSharedAccount(sharedAccountName) ⇒ Promise

Delete a shared account from the system.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
sharedAccountName string

paperCut.deleteExistingUser(username) ⇒ Promise

Delete/remove an existing user from the user list.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string

paperCut.deleteExistingUser_2(username, redactUserData) ⇒ Promise

Delete/remove an existing user from the user list.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
redactUserData boolean

paperCut.deletePrinter(serverName, printerName) ⇒ Promise

Delete a printer.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string

paperCut.disableDeviceSnmpv3(deviceName) ⇒ Promise

Disable use of SNMPv3 on the device

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
deviceName string

paperCut.disablePrinter(serverName, printerName, disableMins) ⇒ Promise

Disable a printer for select period of time.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string
disableMins int

paperCut.disablePrinterSnmpv3(serverName, printerName) ⇒ Promise

Disable use of SNMPv3 on the printer

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string

paperCut.disablePrintingForUser(userName, disableMins) ⇒ Promise

Disable printing for a user.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
userName string
disableMins int

paperCut.disableSharedAccount(sharedAccountName, disableMins) ⇒ Promise

Disable shared account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
sharedAccountName string
disableMins int

paperCut.enableDeviceSnmpv3(deviceName, context, username, authPass, privPass, authProto, privProto) ⇒ Promise

Set the SNMPv3 device config details

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
deviceName string
context string
username string
authPass string
privPass string
authProto string
privProto string

paperCut.enablePrinter(serverName, printerName) ⇒ Promise

Enable a printer.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string

paperCut.enablePrinterSnmpv3(serverName, printerName, context, username, authPass, privPass, authProto, privProto) ⇒ Promise

Set the SNMPv3 printer config details

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string
context string
username string
authPass string
privPass string
authProto string
privProto string

paperCut.exportUserDataHistory(username, saveLocation) ⇒ Promise

Export user data based on a set of predefined CSV reports (The owner of these files will be the system account running the PaperCut process).

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
saveLocation string

paperCut.generateAdHocReport(reportType, dataParams, exportTypeExt, reportTitle, saveLocation) ⇒ Promise

Generates an AdHoc report

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
reportType string
dataParams string
exportTypeExt string
reportTitle string
saveLocation string

paperCut.generateScheduledReport(reportTitle, saveLocation) ⇒ Promise

Generate a specified scheduled report

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
reportTitle string
saveLocation string

paperCut.getConfigValue(configName) ⇒ Promise

Get the config value from the server.

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
configName string

paperCut.getDeviceSnmpv3(deviceName) ⇒ Promise

Get the SNMPv3 device config details

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
deviceName string

paperCut.getGroupMembers(groupName, offset, limit) ⇒ Promise

Retrieves a list of all users in the group.

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
groupName string
offset int
limit int

paperCut.getGroupQuota(groupName) ⇒ Promise

Get the group quota allocation settings on a given group.

Kind: instance method of PaperCut
Returns: Promise - Resolves with java.util.Hashtable<java.lang.String,​java.lang.Object>, rejects on error

Param Type
groupName string

paperCut.getPrinterCostSimple(serverName, printerName) ⇒ Promise

Get the page cost if, and only if, the printer is using the Simple Charging Model.

Kind: instance method of PaperCut
Returns: Promise - Resolves with double, rejects on error

Param Type
serverName string
printerName string

paperCut.getPrinterProperties(authToken, serverName, printerName, propertyNames) ⇒ Promise

Get multiple printer properties at once (to save multiple calls).

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
authToken string
serverName string
printerName string
propertyNames array

paperCut.getPrinterProperty(serverName, printerName, propertyName) ⇒ Promise

Gets a printer property.

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
serverName string
printerName string
propertyName string

paperCut.getPrinterSnmpv3(serverName, printerName) ⇒ Promise

Get the SNMPv3 printer config details

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
serverName string
printerName string

paperCut.getSharedAccountAccountBalance(accountName) ⇒ Promise

The current account balance associated with a shared account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with double, rejects on error

Param Type
accountName string

paperCut.getSharedAccountOverdraftMode(accountName) ⇒ Promise

Get the shared account's overdraft mode

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
accountName string

paperCut.getSharedAccountProperties(sharedAccountName, propertyNames) ⇒ Promise

Get multiple shared account properties at once (to save multiple calls).

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
sharedAccountName string
propertyNames array

paperCut.getSharedAccountProperty(sharedAccountName, propertyName) ⇒ Promise

Gets a shared account property.

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
sharedAccountName string
propertyName string

paperCut.getTaskStatus() ⇒ Promise

Return the status (completed flag and any status message text) associated with a long running task such as a sync operation started by the performGroupSync API.

Kind: instance method of PaperCut
Returns: Promise - Resolves with object, rejects on error

paperCut.getTotalUsers() ⇒ Promise

Get the count of all users in the system.

Kind: instance method of PaperCut
Returns: Promise - Resolves with int, rejects on error

paperCut.getUserAccountBalance(username) ⇒ Promise

The a user's current account balance.

Kind: instance method of PaperCut
Returns: Promise - Resolves with double, rejects on error

Param Type
username string

paperCut.getUserAccountBalance_2(username, accountName) ⇒ Promise

The a user's current account balance.

Kind: instance method of PaperCut
Returns: Promise - Resolves with double, rejects on error

Param Type
username string
accountName string

paperCut.getUserGroups(userName) ⇒ Promise

Retrieves a list of a user's group memberships.

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
userName string

paperCut.getUserOverdraftMode(username) ⇒ Promise

Get the user's overdraft mode

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
username string

paperCut.getUserProperties(userName, propertyNames) ⇒ Promise

Get multiple user properties at once (to save multiple calls).

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
userName string
propertyNames array

paperCut.getUserProperty(userName, propertyName) ⇒ Promise

Gets a user property.

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
userName string
propertyName string

paperCut.installLicense(licenseFile) ⇒ Promise

Install a new license

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
licenseFile string

paperCut.isGroupExists(groupName) ⇒ Promise

Checks if group exists or not.

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
groupName string

paperCut.isSharedAccountExists(accountName) ⇒ Promise

Test to see if a shared account exists.

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
accountName string

paperCut.isUserExists(username) ⇒ Promise

Test to see if a user associated with "username" exists in the system.

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
username string

paperCut.listPrinters(offset, limit) ⇒ Promise

List all printers sorted by printer name.

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
offset int
limit int

paperCut.listSharedAccounts(offset, limit) ⇒ Promise

List all shared accounts (sorted by account name) starting at offset and ending at limit.

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
offset int
limit int

paperCut.listUserAccounts(offset, limit) ⇒ Promise

List all user accounts (sorted by username) starting at offset and ending at limit.

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
offset int
limit int

paperCut.listUserGroups(offset, limit) ⇒ Promise

List user groups.

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
offset int
limit int

paperCut.listUserSharedAccounts(userName, offset, limit) ⇒ Promise

List all shared accounts (sorted by account name) that the user has access to, starting at offset and listing only limit accounts.

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
userName string
offset int
limit int

paperCut.listUserSharedAccounts_2(userName, offset, limit, ignoreAccountMode) ⇒ Promise

List all shared accounts (sorted by account name) that the user has access to, starting at offset and listing only limit accounts.

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
userName string
offset int
limit int
ignoreAccountMode boolean

paperCut.lookUpUserNameByCardNo(cardNo) ⇒ Promise

Looks up the user with the given user card number and returns their user name.

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
cardNo string

paperCut.lookUpUserNameByEmail(email) ⇒ Promise

Looks up the user with the given email and returns their user name.

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
email string

paperCut.lookUpUserNameByIDNo(idNo) ⇒ Promise

Looks up the user with the given user id number and returns their user name.

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
idNo string

paperCut.lookUpUserNameBySecondaryUserName(secondaryUserName) ⇒ Promise

Looks up the user with the specified secondary user name and returns their primary user name.

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
secondaryUserName string

paperCut.lookUpUsersByFullName(fullName) ⇒ Promise

Looks up the users with the given full name and returns their user names.

Kind: instance method of PaperCut
Returns: Promise - Resolves with array, rejects on error

Param Type
fullName string

paperCut.performGroupSync() ⇒ Promise

Start the process of synchronizing the system's group membership with the OS/Network/Domain's group membership.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

paperCut.performOnlineBackup() ⇒ Promise

Instigate an online backup.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

paperCut.performUserAndGroupSync() ⇒ Promise

Start a full user and group synchronization.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

paperCut.performUserAndGroupSyncAdvanced(deleteNonExistentUsers, updateUserDetails) ⇒ Promise

An advanced version of the user and group synchronization process providing control over the sync behaviour.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
deleteNonExistentUsers boolean
updateUserDetails boolean

paperCut.processJob(jobDetails) ⇒ Promise

Takes the details of a job and logs and charges as if it were a "real" job.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
jobDetails string

paperCut.reapplyInitialUserSettings(username) ⇒ Promise

Re-applies initial user settings on the given user.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string

paperCut.removeAdminAccessGroup(groupName) ⇒ Promise

Removes a group from the list of admin groups.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
groupName string

paperCut.removeAdminAccessUser(userName) ⇒ Promise

Removes an admin user from the list of admins.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
userName string

paperCut.removeGroup(groupName) ⇒ Promise

Removes an already existing group.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
groupName string

paperCut.removePrinterAccessGroup(serverName, printerName, groupName) ⇒ Promise

Removes the group from the printer access group list.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string
groupName string

paperCut.removeSharedAccountAccessGroup(sharedAccountName, groupName) ⇒ Promise

Revoke the given group's access to the given shared account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
sharedAccountName string
groupName string

paperCut.removeSharedAccountAccessUser(sharedAccountName, userName) ⇒ Promise

Revoke the given user's access to the given shared account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
sharedAccountName string
userName string

paperCut.removeUserFromGroup(userName, groupName) ⇒ Promise

Removes the user from the specified group.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
userName string
groupName string

paperCut.renamePrinter(serverName, printerName, newServerName, newPrinterName) ⇒ Promise

Rename a printer.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string
newServerName string
newPrinterName string

paperCut.renameSharedAccount(currentSharedAccountName, newSharedAccountName) ⇒ Promise

Rename an existing shared account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
currentSharedAccountName string
newSharedAccountName string

paperCut.renameUserAccount(currentUserName, newUserName) ⇒ Promise

Rename a user account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
currentUserName string
newUserName string

paperCut.resetPrinterCounts(serverName, printerName, resetBy) ⇒ Promise

Reset the counts (pages and job counts) associated with a printer.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string
resetBy string

paperCut.resetUserCounts(username, resetBy) ⇒ Promise

Reset the counts (pages and job counts) associated with a user account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
resetBy string

paperCut.runCommand(commandName, args) ⇒ Promise

Runs a custom command on the server.

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
commandName string
args array

paperCut.saveThreadSnapshot() ⇒ Promise

Saves the server thread snapshot to the debug log.

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

paperCut.setConfigValue(configName, configValue) ⇒ Promise

Set the config value from the server.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
configName string
configValue string

paperCut.setGroupQuota(groupName, quotaAmount, period, quotaMaxAccumulation) ⇒ Promise

Set the group quota allocation settings on a given group.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
groupName string
quotaAmount double
period string
quotaMaxAccumulation double

paperCut.setPrinterCostSimple(serverName, printerName, costPerPage) ⇒ Promise

Method to set a simple single page cost using the Simple Charging Model.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string
costPerPage double

paperCut.setPrinterGroups(serverName, printerName, printerGroupNames) ⇒ Promise

Set the printer groups a printer belongs to, overwriting any existing group.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string
printerGroupNames string

paperCut.setPrinterProperties(authToken, serverName, printerName, propertyNamesAndValues) ⇒ Promise

Set multiple printer properties at once (to save multiple calls).

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
authToken string
serverName string
printerName string
propertyNamesAndValues array

paperCut.setPrinterProperty(serverName, printerName, propertyName, propertyValue) ⇒ Promise

Sets a printer property.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
serverName string
printerName string
propertyName string
propertyValue string

paperCut.setSharedAccountAccountBalance(accountName, balance, comment) ⇒ Promise

Set the balance on a shared account to a set value.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
accountName string
balance double
comment string

paperCut.setSharedAccountOverdraftMode(accountName, mode) ⇒ Promise

Set the shared account's overdraft mode

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
accountName string
mode string

paperCut.setSharedAccountProperties(sharedAccountName, propertyNamesAndValues) ⇒ Promise

Set multiple shared account properties at once (to save multiple calls).

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
sharedAccountName string
propertyNamesAndValues array

paperCut.setSharedAccountProperty(sharedAccountName, propertyName, propertyValue) ⇒ Promise

Sets a shared account property.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
sharedAccountName string
propertyName string
propertyValue string

paperCut.setUserAccountBalance(username, balance, comment) ⇒ Promise

Set the balance on a user's account to a set value.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
balance double
comment string

paperCut.setUserAccountBalance_2(username, balance, comment, accountName) ⇒ Promise

Set the balance on a user's account to a set value.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
balance double
comment string
accountName string

paperCut.setUserAccountBalanceByGroup(group, balance, comment) ⇒ Promise

Set the balance for each member of a group to the given value.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
group string
balance double
comment string

paperCut.setUserAccountBalanceByGroup_2(group, balance, comment, accountName) ⇒ Promise

Set the balance for each member of a group to the given value.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
group string
balance double
comment string
accountName string

paperCut.setUserAccountSelectionAdvancedPopup(username, allowPersonal, chargeToPersonalWhenSharedSelected, defaultSharedAccount) ⇒ Promise

Change a user's account selection setting to use the advanced account selection pop-up.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
allowPersonal boolean
chargeToPersonalWhenSharedSelected boolean
defaultSharedAccount string

paperCut.setUserAccountSelectionAutoChargePersonal(username, withPopupConfirmation) ⇒ Promise

Sets the user to auto charge to it's personal account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
withPopupConfirmation boolean

paperCut.setUserAccountSelectionAutoSelectSharedAccount(username, accountName, chargeToPersonal) ⇒ Promise

Change a user's account selection setting to automatically charge to a single shared account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
accountName string
chargeToPersonal boolean

paperCut.setUserAccountSelectionStandardPopup(username, allowPersonal, allowListSelection, allowPinCode, allowPrintingAsOtherUser, chargeToPersonalWhenSharedSelected, defaultSharedAccount) ⇒ Promise

Change a user's account selection setting to use the standard account selection pop-up.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
allowPersonal boolean
allowListSelection boolean
allowPinCode boolean
allowPrintingAsOtherUser boolean
chargeToPersonalWhenSharedSelected boolean
defaultSharedAccount string

paperCut.setUserOverdraftMode(username, mode) ⇒ Promise

Set the user's overdraft mode

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
username string
mode string

paperCut.setUserProperties(userName, propertyNamesAndValues) ⇒ Promise

Set multiple user properties at once (to save multiple calls).

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
userName string
propertyNamesAndValues array

paperCut.setUserProperty(userName, propertyName, propertyValue) ⇒ Promise

Sets a user property.

Kind: instance method of PaperCut
Returns: Promise - Resolves with undefined, rejects on error

Param Type
userName string
propertyName string
propertyValue string

paperCut.syncGroup(groupName) ⇒ Promise

Syncs an existing group with the configured directory server, updates the group membership.

Kind: instance method of PaperCut
Returns: Promise - Resolves with boolean, rejects on error

Param Type
groupName string

paperCut.useCard(userName, cardNumber) ⇒ Promise

Add the value of the a card to a user's account.

Kind: instance method of PaperCut
Returns: Promise - Resolves with string, rejects on error

Param Type
userName string
cardNumber string