Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
printnode-client
Advanced tools
Cloud Printing wrapper for the PrintNode API.
Install nodejs + npm.
Clone repo and install dependencies:
// clone repo
git clone https://github.com/miketownsend/PrintNode-NodeJS.git
// install dependencies
cd PrintNode-NodeJS && npm install
Require and instantiate a client:
var PrintNodeClient = require('~/path/to/printnode-client/index.js');
var client = new PrintNodeClient({ api_key: "DUMMY_API_KEY", default_printer_id: 123456 });
// fetch metadata about account
client.whoami().then(console.log);
// fetch account credits
client.credits().then(console.log);
// fetch computers
client.fetchComputers().then(...);
// Fetch printers
client.fetchPrinters().then(...);
// Fetch printers for a specific computer
client.fetchPrinters(computer_id).then(...);
// Fetch a specific printer (returns array of one)
client.fetchPrinters(printer_id).then(...);
// Fetch a specific printer from a computer
client.fetchPrinters(computer_id, printer_id).then(...);
Fetching:
// Fetch all print jobs
client.fetchPrintJob().then(...);
// Fetch a specific print jobs (returns array of one)
client.fetchPrintJob(printjob_id).then(...);
// Fetch all print jobs for a specific printer
client.fetchPrintJobsForPrinter(printer_id).then(...);
// Fetch a specific printer from a printer (returns array of one)
client.fetchPrintJobForPrinter(printer_id, printjob_id).then(...);
Creating Full options for creation of PrintJobs are available in the API documentation.
// Create a print job
var options = {
title: "Printing example 1",
source: "PrintNode-NodeJS", // defaults to this
content: "https://app.printnode.com/testpdfs/4x6_combo_vertical_ol829.pdf",
contentType: "pdf_uri"
};
client.createPrintJob(options).then(console.log); // returns printjob id only
// Create a print job from a local PDF file
var options = {
title: "Printing example 2",
filename: "./test/examples/label.pdf"
};
client.createPrintJobFromPdf().then(...);
// Create a print job from a local raw print file
var options = {
title: "Printing example 2",
filename: "./test/examples/label.pdf"
};
client.createPrintJobFromRaw().then(...);
// Retrieves a single scale by computer_id, device_name and device_number.
client.fetchScale(computer_id, device_name, device_number).then(...);
// Retrieves an array of scales for a specific computer
client.fetchScalesForComputer(computer_id).then(...);
// Retrieves an array of scales for a specific computer with a specific device name
client.fetchScalesForComputerByDeviceName(computer_id, device_name).then(...);
The tests in place at the moment are simply testing for positive responses, they are not looking at the detail of the response.
Requirements:
Running the tests
npm test
FAQs
Cloud printing using PrintNode API
The npm package printnode-client receives a total of 411 weekly downloads. As such, printnode-client popularity was classified as not popular.
We found that printnode-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.