├── .gitignore
├── README.md
├── backend
├── public
│ └── dorms.txt
└── server.js
├── examples
├── Get-Job-Attributes.js
├── Get-Jobs.js
├── Get-Printer-Attributes.js
├── Get-Printer-Attributes2.js
├── Identify-Printer.js
├── Print-URI.js
├── findPrinters.js
└── printPDF.js
├── ipp.js
├── lib
├── attributes.js
├── enums.js
├── ipputil.js
├── keywords.js
├── message.js
├── parser.js
├── printer.js
├── request.js
├── serializer.js
├── status-codes.js
├── tags.js
└── versions.js
├── package-lock.json
└── package.json
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | node_modules
4 | scratch.js
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Internet Printing Protocol (IPP) for nodejs
2 | ---
3 |
4 | A pure Javascript implementation of the IPP/2.0 protocol that has no dependencies.
5 |
6 | The IPP protocol was started in the 90's and is still being worked on today. It is a very indepth protocol that spans many
7 | RFCs- some of which are dead while others were herded into IPP/v2.x.
8 |
9 | There are millions of printers that support IPP. If you have one, this module will allow you to send/recieve data to/from
10 | the printer.
11 |
12 | To find out if your printer supports IPP:
13 |
14 | * Google your printer's specs
15 | * Try: `telnet YOUR_PRINTER 631`. If it connects, that's a good sign.
16 | * Use the ['/examples/findPrinters.js'](https://github.com/williamkapke/ipp/tree/master/examples/findPrinters.js) script.
17 |
18 | I have a pretty good starting point here. I created reference files
19 | (`attributes`, `enums`, `keywords`, `operations`, `status-codes`, `versions` and `tags`) and tried to include as many
20 | links in the comments to the ref docs as I could.
21 |
22 |
23 | ### Install
24 | ```bash
25 | $ npm install ipp
26 | ```
27 |
28 |
29 | ## Printer(url [,options])
30 | ```javascript
31 | var ipp = require('ipp');
32 | var PDFDocument = require('pdfkit');
33 |
34 | //make a PDF document
35 | var doc = new PDFDocument({margin:0});
36 | doc.text(".", 0, 780);
37 |
38 | doc.output(function(pdf){
39 | var printer = ipp.Printer("http://NPI977E4E.local.:631/ipp/printer");
40 | var msg = {
41 | "operation-attributes-tag": {
42 | "requesting-user-name": "William",
43 | "job-name": "My Test Job",
44 | "document-format": "application/pdf"
45 | },
46 | data: pdf
47 | };
48 | printer.execute("Print-Job", msg, function(err, res){
49 | console.log(res);
50 | });
51 | });
52 | ```
53 |
54 | To interact with a printer, create a `Printer` object.
55 |
56 | > Technically speaking: a `Printer` object does not need to be an actual printer. According to the IPP spec, it
57 | > could be any endpoint that accepts IPP messages. For example; the IPP object __could__ be persistant media- like a
58 | > CD ROM, hard drive, thumb drive, ...etc.
59 |
60 | **options:**
61 | * `charset` - Specifies the value for the 'attributes-charset' attribute of requests. Defaults to `utf-8`.
62 | * `language` - Specifies the value for the 'attributes-natural-language' attribute of requests. Defaults to `en-us`.
63 | * `uri` - Specifies the value for the 'printer-uri' attribute of requests. Defaults to `ipp://+url.host+url.path`.
64 | * `version` - Specifies the value for the 'version' attribute of requests. Defaults to `2.0`.
65 |
66 |
67 |
68 |
69 |
70 | ### printer.execute(operation, message, callback)
71 | Executes an IPP operation on the Printer object.
72 |
73 | * 'operation' - There are many operations defined by IPP. See: [/lib/enums.js](https://github.com/williamkapke/ipp/blob/master/lib/enums.js#L52).
74 | * 'message - A javascript object to be serealized into an IPP binary message.
75 | * 'callback(err, response)' - A function to callback with the Printer's response.
76 |
77 | ## ipp.parse(buffer)
78 |
79 | Parses a binary IPP message into a javascript object tree.
80 |
81 | ```javascript
82 | var ipp = require('ipp');
83 | var data = new Buffer(
84 | '0200' + //version 2.0
85 | '000B' + //Get-Printer-Attributes
86 | '00000001'+ //reqid
87 | '01' + //operation-attributes-tag
88 | //blah blah the required bloat of this protocol
89 | '470012617474726962757465732d6368617273657400057574662d3848001b617474726962757465732d6e61747572616c2d6c616e67756167650002656e' +
90 | '03' //end-of-attributes-tag
91 | ,'hex');
92 |
93 |
94 | var result = ipp.parse(data);
95 | console.log(JSON.stringify(result,null,2));
96 | // ta-da!
97 | //{
98 | // "version": "2.0",
99 | // "operation": 11,
100 | // "id": 1,
101 | // "operation-attributes-tag": {
102 | // "attributes-charset": "utf-8",
103 | // "attributes-natural-language": "en"
104 | // }
105 | //}
106 | ```
107 |
108 | ## ipp.serialize(msg)
109 | Converts an IPP message object to IPP binary.
110 |
111 | See [request](#request) for example.
112 |
113 |
114 | ## ipp.request(url, data, callback)
115 |
116 | Makes an IPP request to a url.
117 |
118 | ```javascript
119 | var ipp = require('ipp');
120 | var uri = "your_printer";
121 | var data = ipp.serialize({
122 | "operation":"Get-Printer-Attributes",
123 | "operation-attributes-tag": {
124 | "attributes-charset": "utf-8",
125 | "attributes-natural-language": "en",
126 | "printer-uri": uri
127 | }
128 | });
129 |
130 | ipp.request(uri, data, function(err, res){
131 | if(err){
132 | return console.log(err);
133 | }
134 | console.log(JSON.stringify(res,null,2));
135 | })
136 | // ta-da!.. hopefully you'll see a ton of stuff from your printer
137 | ```
138 |
139 | ## Browser Support?
140 | See [this thread](https://github.com/williamkapke/ipp/issues/3)
141 |
142 | ## License
143 |
144 | MIT
145 |
--------------------------------------------------------------------------------
/backend/public/dorms.txt:
--------------------------------------------------------------------------------
1 | 1222222
2 | 333
3 | 1
4 | 1
5 | 1
6 |
--------------------------------------------------------------------------------
/backend/server.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | var bodyParser = require('body-parser')
3 | const fileUpload = require('express-fileupload');
4 | const cors = require('cors')
5 | const ipp = require('../ipp.js')
6 | const mime = require('mime')
7 | const libre = require('libreoffice-convert');
8 | const fs = require('fs');
9 |
10 | var extension
11 | var buffer
12 | var Printer = ipp.Printer("http://192.168.66.50:631/printers/412_printer");
13 | const officeFormat = ['application/vnd.openxmlformats-officedocument.wordprocessingml.document',
14 | 'application/msword',
15 | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
16 | 'application/vnd.ms-excel',
17 | "application/vnd.ms-powerpoint",
18 | "application/vnd.openxmlformats-officedocument.presentationml.presentation"
19 | ]
20 | const validExtensions = ['application/pdf',
21 | 'image/jpeg',
22 | 'image/png'].concat(officeFormat)
23 |
24 |
25 | const app = express();
26 | app.use(bodyParser())
27 | // middleware
28 | app.use(express.static('public')); //to access the files in public folder
29 | app.use(cors()); // it enables all cors requests
30 | // once the file is uploaded,it can be accessed from req.files.*
31 | app.use(fileUpload({
32 | // 10MB
33 | limits: {fileSize: 10 * 1024 * 1024},
34 | }));
35 | // file upload api
36 | app.post('/upload', (req, res, next) => {
37 |
38 | if (!req.files) {
39 | return res.send({msg: "file is not found"})
40 | }
41 | extension = mime.getType(req.files.file.name)
42 | if (validExtensions.indexOf(extension) === -1) {
43 | return res.send({msg: "非法文件类型!"})
44 | }
45 | buffer = req.files.file.data
46 |
47 | if (officeFormat.indexOf(extension) !== -1) {
48 | // extension = 'application/pdf'
49 | ConvertDocToPdfPrint()
50 | .then(modifiedData => {
51 | var msg = {
52 | "operation-attributes-tag": {
53 | "last-document": true,
54 | "job-id": req.body['job-id'],
55 | "requesting-user-name": "normal user",
56 | // this is really problematic
57 | // "document-format": "application/octet-stream"
58 | "document-format": "application/pdf",
59 | //iso_a4_210x297mm
60 | },
61 | data: modifiedData
62 | };
63 |
64 | Printer.execute("Send-Document", msg, function (err, res_) {
65 | res.send(err || res_);
66 | });
67 | })
68 | .catch(err=>{res.send({msg: `${err}服务端错误`})})
69 | }else{
70 | var msg = {
71 | "operation-attributes-tag": {
72 | "last-document": true,
73 | "job-id": req.body['job-id'],
74 | "requesting-user-name": "normal user",
75 | // this is really problematic
76 | // "document-format": "application/octet-stream"
77 | "document-format": extension,
78 | //iso_a4_210x297mm
79 | },
80 | data: buffer
81 | };
82 |
83 | Printer.execute("Send-Document", msg, function (err, res_) {
84 | res.send(err || res_);
85 | });
86 | }
87 | // pass all the filter,then go to print stage
88 | })
89 |
90 |
91 | app.post('/query', (req, res) => {
92 | Printer.execute("Get-Printer-Attributes", null, function (err, res_) {
93 | availability = res_["printer-attributes-tag"]["printer-state"] == 'idle' && res_["printer-attributes-tag"]["printer-is-accepting-jobs"]
94 | queuedJob = res_["printer-attributes-tag"]["queued-job-count"]
95 | res.send({"status": availability, "wait": queuedJob})
96 | });
97 | })
98 |
99 |
100 | app.post('/create-job', (req, res) => {
101 | console.log('create a print job')
102 | var create_msg = {
103 | "operation-attributes-tag": {
104 | "requesting-user-name": "normal user"
105 | },
106 | // fix none A4 document bug
107 | "job-attributes-tag": {
108 | "copies": req.body.copies,
109 | // this is for routing and schedualing only
110 | // "job-impressions":req.body.number,
111 | // "job-media-sheets":(req.body.copies)*(req.body.number)
112 | }
113 | };
114 | fs.appendFileSync('./public/dorms.txt',req.body.dorm+'\n',function (err) {
115 | console.log(err)
116 | })
117 | try {
118 | Printer.execute("Create-Job", create_msg, function (err, res_) {
119 | // console.log(res_)
120 | if (!("job-id" in res_['job-attributes-tag'])) {
121 | return res.status(500).send({msg: "创建任务失败,请重试"})
122 | }
123 | let jobId = res_['job-attributes-tag']['job-id'];
124 | // console.log(jobId)
125 | res.send({"job-id": jobId})
126 | });
127 | } catch (e) {
128 | res.send(e)
129 | };
130 |
131 | })
132 |
133 | function ConvertDocToPdfPrint() {
134 | return new Promise((resolve,reject)=> {
135 | libre.convert(buffer, '.pdf', undefined, (err, done) => {
136 | return err ?
137 | reject(err) :
138 | resolve(done)
139 | });
140 | })
141 | }
142 |
143 |
144 | app.listen(4500, () => {
145 | console.log('server is running at port 4500');
146 | })
147 |
--------------------------------------------------------------------------------
/examples/Get-Job-Attributes.js:
--------------------------------------------------------------------------------
1 | var ipp = require('./../ipp');
2 | var printer = ipp.Printer("http://cp02.local.:631/ipp/printer");
3 | var msg = {
4 | "operation-attributes-tag": {
5 | 'job-uri': 'ipp://CP01.local/ipp/printer/0186'
6 | }
7 | };
8 | function go(){
9 | printer.execute("Get-Job-Attributes", msg, function(err, res){
10 | console.log(res);
11 | setTimeout(go, 0);
12 | });
13 | }
14 | go();
--------------------------------------------------------------------------------
/examples/Get-Jobs.js:
--------------------------------------------------------------------------------
1 | var ipp = require('./../ipp');
2 | var printer = ipp.Printer("ipp://cp02.local.:631/ipp/printer");
3 |
4 | var msg = {
5 | "operation-attributes-tag": {
6 | //use these to view completed jobs...
7 | // "limit": 10,
8 | "which-jobs": "completed",
9 |
10 | "requested-attributes": [
11 | "job-id",
12 | "job-uri",
13 | "job-state",
14 | "job-state-reasons",
15 | "job-name",
16 | "job-originating-user-name",
17 | "job-media-sheets-completed"
18 | ]
19 | }
20 | }
21 |
22 | printer.execute("Get-Jobs", msg, function(err, res){
23 | if (err) return console.log(err);
24 | console.log(res['job-attributes-tag']);
25 | });
26 |
--------------------------------------------------------------------------------
/examples/Get-Printer-Attributes.js:
--------------------------------------------------------------------------------
1 | var ipp = require('./../ipp');
2 | var id = 0x0123;//made up reqid
3 |
4 | var printer = ipp.Printer("http://cp02.local.:631/ipp/printer");
5 | printer.execute("Get-Printer-Attributes", null, function(err, res){
6 | console.log(res);
7 | });
8 |
--------------------------------------------------------------------------------
/examples/Get-Printer-Attributes2.js:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Poll the printer for a limited set of attributes
4 | */
5 |
6 | var ipp = require('./../ipp');
7 | var id = 0x0123;//made up reqid
8 |
9 | var printer = ipp.Printer("http://cp02.local.:631/ipp/printer");
10 | var msg = {
11 | "operation-attributes-tag": {
12 | "document-format": "application/pdf",
13 | "requested-attributes": [
14 | "queued-job-count",
15 | "marker-levels",
16 | "printer-state",
17 | "printer-state-reasons",
18 | "printer-up-time"
19 | ]
20 | }
21 | };
22 | function printer_info(){
23 | printer.execute("Get-Printer-Attributes", msg, function(err, res){
24 | console.log(JSON.stringify(res['printer-attributes-tag'], null, 2));
25 | setTimeout(printer_info, 1);
26 | });
27 | }
28 | printer_info();
29 |
--------------------------------------------------------------------------------
/examples/Identify-Printer.js:
--------------------------------------------------------------------------------
1 | var ipp = require('./../ipp');
2 | var id = 0x0123;//made up reqid
3 |
4 | var printer = ipp.Printer("http://cp02.local.:631/ipp/printer");
5 | var msg = {
6 | "operation-attributes-tag": {
7 | "requesting-user-name": "William",
8 | "message": "These are not the droids you are looking for"
9 | }
10 | };
11 | printer.execute("Identify-Printer", msg, function(err, res){
12 | console.log(res);
13 | });
14 |
--------------------------------------------------------------------------------
/examples/Print-URI.js:
--------------------------------------------------------------------------------
1 | var ipp = require('./../ipp');
2 | var PDFDocument = require('pdfkit');
3 |
4 | //make a PDF document
5 | var doc = new PDFDocument({margin:0});
6 | doc.text(".", 0, 0);
7 | //doc.addPage();
8 | //doc.text(".", 0, 0);
9 |
10 |
11 | var printer = ipp.Printer("http://cp02.local.:631/ipp/printer");
12 | var msg = {
13 | "operation-attributes-tag": {
14 | "requesting-user-name": "William",
15 | "job-name": "My Test Job",
16 | "document-format": "application/pdf",
17 | "document-uri": "http://192.168.20.114:5000/check"
18 | }
19 | };
20 | printer.execute("Print-URI", msg, function(err, res){
21 | console.log(res);
22 | });
23 |
--------------------------------------------------------------------------------
/examples/findPrinters.js:
--------------------------------------------------------------------------------
1 |
2 | var mdns = require('mdns'),
3 | browser = mdns.createBrowser(mdns.tcp('ipp'));
4 |
5 | mdns.Browser.defaultResolverSequence[1] = 'DNSServiceGetAddrInfo' in mdns.dns_sd ? mdns.rst.DNSServiceGetAddrInfo() : mdns.rst.getaddrinfo({families:[4]});
6 |
7 | browser.on('serviceUp', function (rec) {
8 | console.log(rec.name, 'http://'+rec.host+':'+rec.port+'/'+rec.txtRecord.rp);
9 | });
10 | browser.start();
11 |
12 | //example output...
13 | //HP LaserJet 400 M401dn (972E51) http://CP01.local:631/ipp/printer
14 | //HP LaserJet Professional P1102w http://P1102W.local:631/printers/Laserjet
15 | //Officejet Pro 8500 A910 [611B21] http://HPPRINTER.local:631/ipp/printer
16 |
--------------------------------------------------------------------------------
/examples/printPDF.js:
--------------------------------------------------------------------------------
1 | var ipp = require('./../ipp');
2 | var PDFDocument = require('pdfkit');
3 | var concat = require("concat-stream");
4 | var doc = new PDFDocument({margin: 0});
5 |
6 | doc.text('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in suscipit purus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus nec hendrerit felis. Morbi aliquam facilisis risus eu lacinia. Sed eu leo in turpis fringilla hendrerit. Ut nec accumsan nisl. Suspendisse rhoncus nisl posuere tortor tempus et dapibus elit porta. Cras leo neque, elementum a rhoncus ut, vestibulum non nibh. Phasellus pretium justo turpis. Etiam vulputate, odio vitae tincidunt ultricies, eros odio dapibus nisi, ut tincidunt lacus arcu eu elit. Aenean velit erat, vehicula eget lacinia ut, dignissim non tellus. Aliquam nec lacus mi, sed vestibulum nunc. Suspendisse potenti. Curabitur vitae sem turpis. Vestibulum sed neque eget dolor dapibus porttitor at sit amet sem. Fusce a turpis lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;',0,0);
7 |
8 |
9 | doc.pipe(concat(function (data) {
10 | var printer = ipp.Printer("http://rasberrypi.local:631/printers/ad");
11 | var msg = {
12 | "operation-attributes-tag": {
13 | "requesting-user-name": "owner",
14 | "job-name": "whatever.pdf",
15 | }
16 | , data: data
17 | };
18 | printer.execute("Print-Job", msg, function (err, res) {
19 | console.log(err);
20 | console.log(res);
21 | });
22 | }));
23 | doc.end();
24 |
--------------------------------------------------------------------------------
/ipp.js:
--------------------------------------------------------------------------------
1 |
2 | var util = require('./lib/ipputil');
3 |
4 | module.exports = {
5 | parse: require('./lib/parser'),
6 | serialize: require('./lib/serializer'),
7 | request: require('./lib/request'),
8 | Printer: require('./lib/printer'),
9 | versions: require('./lib/versions'),
10 | attributes: require('./lib/attributes'),
11 | keywords: require('./lib/keywords'),
12 | enums: require('./lib/enums'),
13 | tags: require('./lib/tags'),
14 | statusCodes: require('./lib/status-codes')
15 | };
16 | module.exports.operations = module.exports.enums['operations-supported'];
17 | module.exports.attribute = {
18 | //http://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml#ipp-registrations-7
19 | groups: util.xref(module.exports.tags.lookup.slice(0x00, 0x0F)),
20 | //http://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml#ipp-registrations-8
21 | values: util.xref(module.exports.tags.lookup.slice(0x10, 0x1F)),
22 | //http://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml#ipp-registrations-9
23 | syntaxes: util.xref(module.exports.tags.lookup.slice(0x20))
24 | }
25 |
--------------------------------------------------------------------------------
/lib/attributes.js:
--------------------------------------------------------------------------------
1 |
2 | /*
3 |
4 | The attributes and their syntaxes are complicated. The functions in this
5 | file serve as syntactic sugar that allow the attribute definitions to remain
6 | close to what you will see in the spec. A bit of processing is done at the end
7 | to convert it to one big object tree. If you want to understand what is going on,
8 | uncomment the console.log() at the end of this file.
9 |
10 | */
11 | var tags = require('./tags');
12 |
13 | function text(max){
14 | if(!max) max = 1023;
15 | return { type:'text', max: max };
16 | }
17 | function integer(min,max){
18 | if(max==MAX || max===undefined) max = 2147483647;
19 | if(min===undefined) min = -2147483648;
20 | return { type:'integer', tag:tags['integer'], min: min, max: max };
21 | }
22 | function rangeOfInteger(min,max){
23 | if(max==MAX || max===undefined) max = 2147483647;
24 | if(min===undefined) min = -2147483648;
25 | return { type:'rangeOfInteger', tag:tags['rangeOfInteger'], min: min, max: max };
26 | }
27 | function boolean(){
28 | return { type:'boolean', tag:tags['boolean'] };
29 | }
30 | function charset(){
31 | return { type:'charset', tag:tags['charset'], max: 63 };
32 | }
33 | function keyword(){
34 | return { type:'keyword', tag:tags['keyword'], min:1, max:1023 };
35 | }
36 | function naturalLanguage(){
37 | return { type:'naturalLanguage', tag:tags['naturalLanguage'], max: 63 };
38 | }
39 | function dateTime(){
40 | return { type:'dateTime', tag:tags['dateTime'] };
41 | }
42 | function mimeMediaType(){
43 | return { type:'mimeMediaType', tag:tags['mimeMediaType'], max: 255 };
44 | }
45 | function uri(max){
46 | return { type:'uri', tag:tags['uri'], max: max||1023 };
47 | }
48 | function uriScheme(){
49 | return { type:'uriScheme', tag:tags['uriScheme'], max: 63 };
50 | }
51 | function enumeration(){
52 | return { type:'enumeration', tag:tags['enum'] };
53 | }
54 | function resolution(){
55 | return { type:'resolution', tag:tags['resolution'] };
56 | }
57 | function unknown(){
58 | return { type:'unknown', tag:tags['unknown'] };
59 | }
60 | function name(max){
61 | return { type:'name', max: max||1023 };
62 | }
63 | function novalue(){
64 | return { type:'novalue', tag:tags['no-value'] };
65 | }
66 | function octetString(max){
67 | return { type:'octetString', tag:tags['octetString'], max: max||1023 };
68 | }
69 |
70 | //Some attributes allow alternate value syntaxes.
71 | //I want to keep the look and feel of the code close to
72 | //that of the RFCs. So, this _ (underscore) function is
73 | //used to group alternates and not be intrusive visually.
74 | function _(arg1, arg2, arg3){
75 | var args = Array.prototype.slice.call(arguments);
76 | args.lookup = {};
77 | const deferred = createDeferred(function(){
78 | args.forEach(function(a,i){
79 | if(typeof a==="function")
80 | args[i] = a();
81 | args.lookup[args[i].type] = args[i];
82 | });
83 | args.alts = Object.keys(args.lookup).sort().join();
84 | return args;
85 | })
86 | return args.some(function(a){ return isDeferred(a) }) ? deferred : deferred();
87 | }
88 | const createDeferred = function (deferred) {
89 | deferred.isDeferred = true;
90 | return deferred;
91 | }
92 |
93 | const isDeferred = function (type) {
94 | return typeof type === "function" && type.isDeferred
95 | }
96 |
97 | // In IPP, "1setOf" just means "Array"... but it must 1 or more items
98 | // In javascript, functions can't start with a number- so let's just use...
99 | function setof(type){
100 | if(isDeferred(type)){
101 | return createDeferred(function(){
102 | type = type();
103 | type.setof=true;
104 | return type;
105 | })
106 | }
107 | if(typeof type === "function" && !isDeferred(type)){
108 | type = type();
109 | }
110 | type.setof=true;
111 | return type;
112 | }
113 |
114 | // In IPP, a "collection" is an set of name-value
115 | // pairs. In javascript, we call them "Objects".
116 | function collection(group, name){
117 | if(!arguments.length)
118 | return { type: "collection", tag:tags.begCollection }
119 |
120 | if(typeof group === "string"){
121 | return createDeferred(function(){
122 | return {
123 | type: "collection",
124 | tag:tags.begCollection,
125 | members: attributes[group][name].members
126 | }
127 | });
128 | }
129 | var defer = Object.keys(group).some(function(key){
130 | return isDeferred(group[key])
131 | })
132 | const deferred = createDeferred(function(){
133 | return {
134 | type: "collection",
135 | tag:tags.begCollection,
136 | members: resolve(group)
137 | }
138 | })
139 | return defer? deferred : deferred();
140 | }
141 |
142 |
143 |
144 | var MAX = {};
145 |
146 | var attributes = {};
147 | attributes["Document Description"] = {
148 | "attributes-charset": charset,
149 | "attributes-natural-language": naturalLanguage,
150 | "compression": keyword,
151 | "copies-actual": setof(integer(1,MAX)),
152 | "cover-back-actual": setof(collection("Job Template","cover-back")),
153 | "cover-front-actual": setof(collection("Job Template", "cover-front")),
154 | "current-page-order": keyword,
155 | "date-time-at-completed": _(dateTime, novalue),
156 | "date-time-at-creation": dateTime,
157 | "date-time-at-processing": _(dateTime, novalue),
158 | "detailed-status-messages": setof(text),
159 | "document-access-errors": setof(text),
160 | "document-charset": charset,
161 | "document-digital-signature": keyword,
162 | "document-format": mimeMediaType,
163 | "document-format-details": setof(collection("Operation", "document-format-details")),
164 | "document-format-details-detected": setof(collection("Operation","document-format-details")),
165 | "document-format-detected": mimeMediaType,
166 | "document-format-version": text(127),
167 | "document-format-version-detected": text(127),
168 | "document-job-id": integer(1, MAX),
169 | "document-job-uri": uri,
170 | "document-message": text,
171 | "document-metadata": setof(octetString),
172 | "document-name": name,
173 | "document-natural-language": naturalLanguage,
174 | "document-number": integer(1,MAX),
175 | "document-printer-uri": uri,
176 | "document-state": enumeration,
177 | "document-state-message": text,
178 | "document-state-reasons": setof(keyword),
179 | "document-uri": uri,
180 | "document-uuid": uri(45),
181 | "errors-count": integer(0,MAX),
182 | "finishings-actual": setof(enumeration),
183 | "finishings-col-actual": setof(collection("Job Template","finishings-col")),
184 | "force-front-side-actual": setof(integer(1,MAX)),
185 | "imposition-template-actual": setof(_(keyword, name)),
186 | "impressions": integer(0,MAX),
187 | "impressions-completed": integer(0,MAX),
188 | "impressions-completed-current-copy": integer(0,MAX),
189 | "insert-sheet-actual": setof(collection("Job Template","insert-sheet")),
190 | "k-octets": integer(0,MAX),
191 | "k-octets-processed": integer(0,MAX),
192 | "last-document": boolean,
193 | "media-actual": setof(_(keyword, name)),
194 | "media-col-actual": setof(collection("Job Template","media-col")),
195 | "media-input-tray-check-actual": setof(_(keyword, name)),
196 | "media-sheets": integer(0,MAX),
197 | "media-sheets-completed": integer(0,MAX),
198 | "more-info": uri,
199 | "number-up-actual": setof(integer),
200 | "orientation-requested-actual": setof(enumeration),
201 | "output-bin-actual": setof(name),
202 | "output-device-assigned": name(127),
203 | "overrides-actual": setof(collection("Document Template","overrides")),
204 | "page-delivery-actual": setof(keyword),
205 | "page-order-received-actual": setof(keyword),
206 | "page-ranges-actual": setof(rangeOfInteger(1,MAX)),
207 | "pages": integer(0,MAX),
208 | "pages-completed": integer(0,MAX),
209 | "pages-completed-current-copy": integer(0,MAX),
210 | "presentation-direction-number-up-actual": setof(keyword),
211 | "print-content-optimize-actual": setof(keyword),
212 | "print-quality-actual": setof(enumeration),
213 | "printer-resolution-actual": setof(resolution),
214 | "printer-up-time": integer(1,MAX),
215 | "separator-sheets-actual": setof(collection("Job Template","separator-sheets")),
216 | "sheet-completed-copy-number": integer(0,MAX),
217 | "sides-actual": setof(keyword),
218 | "time-at-completed": _(integer, novalue),
219 | "time-at-creation": integer,
220 | "time-at-processing": _(integer, novalue),
221 | "x-image-position-actual": setof(keyword),
222 | "x-image-shift-actual": setof(integer),
223 | "x-side1-image-shift-actual": setof(integer),
224 | "x-side2-image-shift-actual": setof(integer),
225 | "y-image-position-actual": setof(keyword),
226 | "y-image-shift-actual": setof(integer),
227 | "y-side1-image-shift-actual": setof(integer),
228 | "y-side2-image-shift-actual": setof(integer)
229 | };
230 | attributes["Document Template"] = {
231 | "copies": integer(1,MAX),
232 | "cover-back": collection("Job Template","cover-back"),
233 | "cover-front": collection("Job Template","cover-front"),
234 | "feed-orientation": keyword,
235 | "finishings": setof(enumeration),
236 | "finishings-col": collection("Job Template","finishings-col"),
237 | "font-name-requested": name,
238 | "font-size-requested": integer(1,MAX),
239 | "force-front-side": setof(integer(1,MAX)),
240 | "imposition-template": _(keyword, name),
241 | "insert-sheet": setof(collection("Job Template","insert-sheet")),
242 | "media": _(keyword, name),
243 | "media-col": collection("Job Template","media-col"),
244 | "media-input-tray-check": _(keyword, name),
245 | "number-up": integer(1,MAX),
246 | "orientation-requested": enumeration,
247 | "overrides": setof(collection({
248 | //Any Document Template attribute (TODO)
249 | "document-copies": setof(rangeOfInteger),
250 | "document-numbers": setof(rangeOfInteger),
251 | "pages": setof(rangeOfInteger)
252 | })),
253 | "page-delivery": keyword,
254 | "page-order-received": keyword,
255 | "page-ranges": setof(rangeOfInteger(1,MAX)),
256 | "pdl-init-file": setof(collection("Job Template","pdl-init-file")),
257 | "presentation-direction-number-up": keyword,
258 | "print-color-mode": keyword,
259 | "print-content-optimize": keyword,
260 | "print-quality": enumeration,
261 | "print-rendering-intent": keyword,
262 | "printer-resolution": resolution,
263 | "separator-sheets": collection("Job Template","separator-sheets"),
264 | "sheet-collate": keyword,
265 | "sides": keyword,
266 | "x-image-position": keyword,
267 | "x-image-shift": integer,
268 | "x-side1-image-shift": integer,
269 | "x-side2-image-shift": integer,
270 | "y-image-position": keyword,
271 | "y-image-shift": integer,
272 | "y-side1-image-shift": integer,
273 | "y-side2-image-shift": integer
274 | };
275 | attributes["Event Notifications"] = {
276 | "notify-subscribed-event": keyword,
277 | "notify-text": text
278 | };
279 | attributes["Job Description"] = {
280 | "attributes-charset": charset,
281 | "attributes-natural-language": naturalLanguage,
282 | "compression-supplied": keyword,
283 | "copies-actual": setof(integer(1,MAX)),
284 | "cover-back-actual": setof(collection("Job Template","cover-back")),
285 | "cover-front-actual": setof(collection("Job Template","cover-front")),
286 | "current-page-order": keyword,
287 | "date-time-at-completed": _(dateTime, novalue),
288 | "date-time-at-creation": dateTime,
289 | "date-time-at-processing": _(dateTime, novalue),
290 | "document-charset-supplied": charset,
291 | "document-digital-signature-supplied": keyword,
292 | "document-format-details-supplied": setof(collection("Operation","document-format-details")),
293 | "document-format-supplied": mimeMediaType,
294 | "document-format-version-supplied": text(127),
295 | "document-message-supplied": text,
296 | "document-metadata": setof(octetString),
297 | "document-name-supplied": name,
298 | "document-natural-language-supplied": naturalLanguage,
299 | "document-overrides-actual": setof(collection),
300 | "errors-count": integer(0,MAX),
301 | "finishings-actual": setof(enumeration),
302 | "finishings-col-actual": setof(collection("Job Template","finishings-col")),
303 | "force-front-side-actual": setof(setof(integer(1, MAX))),
304 | "imposition-template-actual": setof(_(keyword, name)),
305 | "impressions-completed-current-copy": integer(0,MAX),
306 | "insert-sheet-actual": setof(collection("Job Template","insert-sheet")),
307 | "job-account-id-actual": setof(name),
308 | "job-accounting-sheets-actual": setof(collection("Job Template","job-accounting-sheets")),
309 | "job-accounting-user-id-actual": setof(name),
310 | "job-attribute-fidelity": boolean,
311 | "job-collation-type": enumeration,
312 | "job-collation-type-actual": setof(keyword),
313 | "job-copies-actual": setof(integer(1,MAX)),
314 | "job-cover-back-actual": setof(collection("Job Template","cover-back")),
315 | "job-cover-front-actual": setof(collection("Job Template","cover-front")),
316 | "job-detailed-status-messages": setof(text),
317 | "job-document-access-errors": setof(text),
318 | "job-error-sheet-actual": setof(collection("Job Template","job-error-sheet")),
319 | "job-finishings-actual": setof(enumeration),
320 | "job-finishings-col-actual": setof(collection("Job Template","media-col")),
321 | "job-hold-until-actual": setof(_(keyword, name)),
322 | "job-id": integer(1,MAX),
323 | "job-impressions": integer(0,MAX),
324 | "job-impressions-completed": integer(0,MAX),
325 | "job-k-octets": integer(0,MAX),
326 | "job-k-octets-processed": integer(0,MAX),
327 | "job-mandatory-attributes": setof(keyword),
328 | "job-media-sheets": integer(0,MAX),
329 | "job-media-sheets-completed": integer(0,MAX),
330 | "job-message-from-operator": text(127),
331 | "job-message-to-operator-actual": setof(text),
332 | "job-more-info": uri,
333 | "job-name": name,
334 | "job-originating-user-name": name,
335 | "job-originating-user-uri": uri,
336 | "job-pages": integer(0,MAX),
337 | "job-pages-completed": integer(0,MAX),
338 | "job-pages-completed-current-copy": integer(0,MAX),
339 | "job-printer-up-time": integer(1,MAX),
340 | "job-printer-uri": uri,
341 | "job-priority-actual": setof(integer(1,100)),
342 | "job-save-printer-make-and-model": text(127),
343 | "job-sheet-message-actual": setof(text),
344 | "job-sheets-actual": setof(_(keyword, name)),
345 | "job-sheets-col-actual": setof(collection("Job Template","job-sheets-col")),
346 | "job-state": _(enumeration, unknown),
347 | "job-state-message": text,
348 | "job-state-reasons": setof(keyword),
349 | "job-uri": uri,
350 | "job-uuid": uri(45),
351 | "media-actual": setof(_(keyword, name)),
352 | "media-col-actual": setof(collection("Job Template","media-col")),
353 | "media-input-tray-check-actual": setof(_(keyword, name)),
354 | "multiple-document-handling-actual": setof(keyword),
355 | "number-of-documents": integer(0,MAX),
356 | "number-of-intervening-jobs": integer(0,MAX),
357 | "number-up-actual": setof(integer(1,MAX)),
358 | "orientation-requested-actual": setof(enumeration),
359 | "original-requesting-user-name": name,
360 | "output-bin-actual": setof(_(keyword, name)),
361 | "output-device-actual": setof(name(127)),
362 | "output-device-assigned": name(127),
363 | "overrides-actual": setof(collection("Job Template","overrides")),
364 | "page-delivery-actual": setof(keyword),
365 | "page-order-received-actual": setof(keyword),
366 | "page-ranges-actual": setof(rangeOfInteger(1,MAX)),
367 | "presentation-direction-number-up-actual": setof(keyword),
368 | "print-content-optimize-actual": setof(keyword),
369 | "print-quality-actual": setof(enumeration),
370 | "printer-resolution-actual": setof(resolution),
371 | "separator-sheets-actual": setof(collection("Job Template", "separator-sheets")),
372 | "sheet-collate-actual": setof(keyword),
373 | "sheet-completed-copy-number": integer(0,MAX),
374 | "sheet-completed-document-number": integer(0,MAX),
375 | "sides-actual": setof(keyword),
376 | "time-at-completed": _(integer, novalue),
377 | "time-at-creation": integer,
378 | "time-at-processing": _(integer, novalue),
379 | "warnings-count": integer(0,MAX),
380 | "x-image-position-actual": setof(keyword),
381 | "x-image-shift-actual": setof(integer),
382 | "x-side1-image-shift-actual": setof(integer),
383 | "x-side2-image-shift-actual": setof(integer),
384 | "y-image-position-actual": setof(keyword),
385 | "y-image-shift-actual": setof(integer),
386 | "y-side1-image-shift-actual": setof(integer),
387 | "y-side2-image-shift-actual": setof(integer)
388 | };
389 | attributes["Job Template"] = {
390 | "copies": integer(1,MAX),
391 | "cover-back": collection({
392 | "cover-type": keyword,
393 | "media": _(keyword, name),
394 | "media-col": collection("Job Template","media-col")
395 | }),
396 | "cover-front": collection({
397 | "cover-type": keyword,
398 | "media": _(keyword, name),
399 | "media-col": collection("Job Template","media-col")
400 | }),
401 | "feed-orientation": keyword,
402 | "finishings": setof(enumeration),
403 | "finishings-col": collection({
404 | "finishing-template": name,
405 | "stitching": collection({
406 | "stitching-locations": setof(integer(0,MAX)),
407 | "stitching-offset": integer(0,MAX),
408 | "stitching-reference-edge": keyword
409 | })
410 | }),
411 | "font-name-requested": name,
412 | "font-size-requested": integer(1,MAX),
413 | "force-front-side": setof(integer(1,MAX)),
414 | "imposition-template": _(keyword, name),
415 | "insert-sheet": setof(collection({
416 | "insert-after-page-number": integer(0,MAX),
417 | "insert-count": integer(0,MAX),
418 | "media": _(keyword, name),
419 | "media-col": collection("Job Template","media-col")
420 | })),
421 | "job-account-id": name,
422 | "job-accounting-sheets": collection({
423 | "job-accounting-output-bin": _(keyword, name),
424 | "job-accounting-sheets-type": _(keyword, name),
425 | "media": _(keyword, name),
426 | "media-col": collection("Job Template","media-col")
427 | }),
428 | "job-accounting-user-id": name,
429 | "job-copies": integer(1,MAX),
430 | "job-cover-back": collection("Job Template","cover-back"),
431 | "job-cover-front": collection("Job Template","cover-front"),
432 | "job-delay-output-until": _(keyword, name),
433 | "job-delay-output-until-time": dateTime,
434 | "job-error-action": keyword,
435 | "job-error-sheet": collection({
436 | "job-error-sheet-type": _(keyword, name),
437 | "job-error-sheet-when": keyword,
438 | "media": _(keyword, name),
439 | "media-col": collection("Job Template","media-col")
440 | }),
441 | "job-finishings": setof(enumeration),
442 | "job-finishings-col": collection("Job Template","finishings-col"),
443 | "job-hold-until": _(keyword, name),
444 | "job-hold-until-time": dateTime,
445 | "job-message-to-operator": text,
446 | "job-phone-number": uri,
447 | "job-priority": integer(1,100),
448 | "job-recipient-name": name,
449 | "job-save-disposition": collection({
450 | "save-disposition": keyword,
451 | "save-info": setof(collection({
452 | "save-document-format": mimeMediaType,
453 | "save-location": uri,
454 | "save-name": name
455 | }))
456 | }),
457 | "job-sheet-message": text,
458 | "job-sheets": _(keyword, name),
459 | "job-sheets-col": collection({
460 | "job-sheets": _(keyword,name),
461 | "media": _(keyword,name),
462 | "media-col": collection("Job Template","media-col")
463 | }),
464 | "media": _(keyword,name),
465 | "media-col": collection({
466 | "media-back-coating": _(keyword,name),
467 | "media-bottom-margin": integer(0,MAX),
468 | "media-color": _(keyword,name),
469 | "media-front-coating": _(keyword,name),
470 | "media-grain": _(keyword,name),
471 | "media-hole-count": integer(0,MAX),
472 | "media-info": text(255),
473 | "media-key": _(keyword,name),
474 | "media-left-margin": integer(0,MAX),
475 | "media-order-count": integer(1,MAX),
476 | "media-pre-printed": _(keyword,name),
477 | "media-recycled": _(keyword,name),
478 | "media-right-margin": integer(0,MAX),
479 | "media-size": collection({
480 | "x-dimension": integer(0,MAX),
481 | "y-dimension": integer(0,MAX),
482 | }),
483 | "media-size-name": _(keyword,name),
484 | "media-source": _(keyword,name),
485 | "media-thickness": integer(1,MAX),
486 | "media-tooth": _(keyword,name),
487 | "media-top-margin": integer(0,MAX),
488 | "media-type": _(keyword,name),
489 | "media-weight-metric": integer(0,MAX)
490 | }),
491 | "media-input-tray-check": _(keyword, name),
492 | "multiple-document-handling": keyword,
493 | "number-up": integer(1,MAX),
494 | "orientation-requested": enumeration,
495 | "output-bin": _(keyword, name),
496 | "output-device": name(127),
497 | "overrides": setof(collection({
498 | //Any Job Template attribute (TODO)
499 | "document-copies": setof(rangeOfInteger),
500 | "document-numbers": setof(rangeOfInteger),
501 | "pages": setof(rangeOfInteger)
502 | })),
503 | "page-delivery": keyword,
504 | "page-order-received": keyword,
505 | "page-ranges": setof(rangeOfInteger(1,MAX)),
506 | "pages-per-subset": setof(integer(1,MAX)),
507 | "pdl-init-file": collection({
508 | "pdl-init-file-entry": name,
509 | "pdl-init-file-location": uri,
510 | "pdl-init-file-name": name
511 | }),
512 | "presentation-direction-number-up": keyword,
513 | "print-color-mode": keyword,
514 | "print-content-optimize": keyword,
515 | "print-quality": enumeration,
516 | "print-rendering-intent": keyword,
517 | "printer-resolution": resolution,
518 | "print-scaling": keyword,
519 | "proof-print": collection({
520 | "media": _(keyword, name),
521 | "media-col": collection("Job Template", "media-col"),
522 | "proof-print-copies": integer(0,MAX)
523 | }),
524 | "separator-sheets": collection({
525 | "media": _(keyword, name),
526 | "media-col": collection("Job Template", "media-col"),
527 | "separator-sheets-type": setof(keyword)
528 | }),
529 | "sheet-collate": keyword,
530 | "sides": keyword,
531 | "x-image-position": keyword,
532 | "x-image-shift": integer,
533 | "x-side1-image-shift": integer,
534 | "x-side2-image-shift": integer,
535 | "y-image-position": keyword,
536 | "y-image-shift": integer,
537 | "y-side1-image-shift": integer,
538 | "y-side2-image-shift": integer
539 | };
540 | attributes["Operation"] = {
541 | "attributes-charset": charset,
542 | "attributes-natural-language": naturalLanguage,
543 | "compression": keyword,
544 | "detailed-status-message": text,
545 | "document-access-error": text,
546 | "document-charset": charset,
547 | "document-digital-signature": keyword,
548 | "document-format": mimeMediaType,
549 | "document-format-details": setof(collection({
550 | "document-format": mimeMediaType,
551 | "document-format-device-id": text(127),
552 | "document-format-version": text(127),
553 | "document-natural-language": setof(naturalLanguage),
554 | "document-source-application-name": name,
555 | "document-source-application-version": text(127),
556 | "document-source-os-name": name(40),
557 | "document-source-os-version": text(40)
558 | })),
559 | "document-message": text,
560 | "document-metadata": setof(octetString),
561 | "document-name": name,
562 | "document-natural-language": naturalLanguage,
563 | "document-password": octetString,
564 | "document-uri": uri,
565 | "first-index": integer(1,MAX),
566 | "identify-actions": setof(keyword),
567 | "ipp-attribute-fidelity": boolean,
568 | "job-hold-until": _(keyword, name),
569 | "job-id": integer(1,MAX),
570 | "job-ids": setof(integer(1,MAX)),
571 | "job-impressions": integer(0,MAX),
572 | "job-k-octets": integer(0,MAX),
573 | "job-mandatory-attributes": setof(keyword),
574 | "job-media-sheets": integer(0,MAX),
575 | "job-message-from-operator": text(127),
576 | "job-name": name,
577 | "job-password": octetString(255),
578 | "job-password-encryption": _(keyword, name),
579 | "job-state": enumeration,
580 | "job-state-message": text,
581 | "job-state-reasons": setof(keyword),
582 | "job-uri": uri,
583 | "last-document": boolean,
584 | "limit": integer(1,MAX),
585 | "message": text(127),
586 | "my-jobs": boolean,
587 | "original-requesting-user-name": name,
588 | "preferred-attributes": collection,
589 | "printer-message-from-operator": text(127),
590 | "printer-uri": uri,
591 | "requested-attributes": setof(keyword),
592 | "requesting-user-name": name,
593 | "requesting-user-uri": uri,
594 | "status-message": text(255),
595 | "which-jobs": keyword
596 | };attributes["Printer Description"] = {
597 | "charset-configured": charset,
598 | "charset-supported": setof(charset),
599 | "color-supported": boolean,
600 | "compression-supported": setof(keyword),
601 | "copies-default": integer(1,MAX),
602 | "copies-supported": rangeOfInteger(1,MAX),
603 | "cover-back-default": collection("Job Template","cover-back"),
604 | "cover-back-supported": setof(keyword),
605 | "cover-front-default": collection("Job Template","cover-front"),
606 | "cover-front-supported": setof(keyword),
607 | "device-service-count": integer(1,MAX),
608 | "device-uuid": uri(45),
609 | "document-charset-default": charset,
610 | "document-charset-supported": setof(charset),
611 | "document-creation-attributes-supported": setof(keyword),
612 | "document-digital-signature-default": keyword,
613 | "document-digital-signature-supported": setof(keyword),
614 | "document-format-default": mimeMediaType,
615 | "document-format-details-default": collection("Operation","document-format-details"),
616 | "document-format-details-supported": setof(keyword),
617 | "document-format-supported": setof(mimeMediaType),
618 | "document-format-varying-attributes": setof(keyword),
619 | "document-format-version-default": text(127),
620 | "document-format-version-supported": setof(text(127)),
621 | "document-natural-language-default": naturalLanguage,
622 | "document-natural-language-supported": setof(naturalLanguage),
623 | "document-password-supported": integer(0,1023),
624 | "feed-orientation-default": keyword,
625 | "feed-orientation-supported": keyword,
626 | "finishings-col-default": collection("Job Template","finishings-col"),
627 | "finishings-col-ready": setof(collection("Job Template","finishings-col")),
628 | "finishings-col-supported": setof(keyword),
629 | "finishings-default": setof(enumeration),
630 | "finishings-ready": setof(enumeration),
631 | "finishings-supported": setof(enumeration),
632 | "font-name-requested-default": name,
633 | "font-name-requested-supported": setof(name),
634 | "font-size-requested-default": integer(1,MAX),
635 | "font-size-requested-supported": setof(rangeOfInteger(1,MAX)),
636 | "force-front-side-default (under review)": setof(integer(1,MAX)),
637 | "force-front-side-supported (under review)": rangeOfInteger(1,MAX),
638 | "generated-natural-language-supported": setof(naturalLanguage),
639 | "identify-actions-default": setof(keyword),
640 | "identify-actions-supported": setof(keyword),
641 | "imposition-template-default": _(keyword, name),
642 | "imposition-template-supported": setof(_(keyword, name)),
643 | "insert-after-page-number-supported": rangeOfInteger(0,MAX),
644 | "insert-count-supported": rangeOfInteger(0,MAX),
645 | "insert-sheet-default": setof(collection("Job Template","insert-sheet")),
646 | "insert-sheet-supported": setof(keyword),
647 | "ipp-features-supported": setof(keyword),
648 | "ipp-versions-supported": setof(keyword),
649 | "ippget-event-life": integer(15,MAX),
650 | "job-account-id-default": _(name, novalue),
651 | "job-account-id-supported": boolean,
652 | "job-accounting-sheets-default": _(collection("Job Template", "job-accounting-sheets"), novalue),
653 | "job-accounting-sheets-supported": setof(keyword),
654 | "job-accounting-user-id-default": _(name, novalue),
655 | "job-accounting-user-id-supported": boolean,
656 | "job-constraints-supported": setof(collection),
657 | "job-copies-default": integer(1,MAX),
658 | "job-copies-supported": rangeOfInteger(1,MAX),
659 | "job-cover-back-default": collection("Job Template","cover-back"),
660 | "job-cover-back-supported": setof(keyword),
661 | "job-cover-front-default": collection("Job Template","cover-front"),
662 | "job-cover-front-supported": setof(keyword),
663 | "job-creation-attributes-supported": setof(keyword),
664 | "job-delay-output-until-default": _(keyword, name),
665 | "job-delay-output-until-supported": setof(_(keyword, name)),
666 | "job-delay-output-until-time-supported": rangeOfInteger(0,MAX),
667 | "job-error-action-default": keyword,
668 | "job-error-action-supported": setof(keyword),
669 | "job-error-sheet-default": _(collection("Job Template", "job-error-sheet"), novalue),
670 | "job-error-sheet-supported": setof(keyword),
671 | "job-finishings-col-default": collection("Job Template","finishings-col"),
672 | "job-finishings-col-ready": setof(collection("Job Template","finishings-col")),
673 | "job-finishings-col-supported": setof(keyword),
674 | "job-finishings-default": setof(enumeration),
675 | "job-finishings-ready": setof(enumeration),
676 | "job-finishings-supported": setof(enumeration),
677 | "job-hold-until-default": _(keyword, name),
678 | "job-hold-until-supported": setof(_(keyword, name)),
679 | "job-hold-until-time-supported": rangeOfInteger(0,MAX),
680 | "job-ids-supported": boolean,
681 | "job-impressions-supported": rangeOfInteger(0,MAX),
682 | "job-k-octets-supported": rangeOfInteger(0,MAX),
683 | "job-media-sheets-supported": rangeOfInteger(0,MAX),
684 | "job-message-to-operator-default": text,
685 | "job-message-to-operator-supported": boolean,
686 | "job-password-encryption-supported": setof(_(keyword, name)),
687 | "job-password-supported": integer(0,255),
688 | "job-phone-number-default": _(uri, novalue),
689 | "job-phone-number-supported": boolean,
690 | "job-priority-default": integer(1,100),
691 | "job-priority-supported": integer(1,100),
692 | "job-recipient-name-default": _(name, novalue),
693 | "job-recipient-name-supported": boolean,
694 | "job-resolvers-supported": setof(collection({
695 | "resolver-name": name
696 | })),
697 | "job-settable-attributes-supported": setof(keyword),
698 | "job-sheet-message-default": text,
699 | "job-sheet-message-supported": boolean,
700 | "job-sheets-col-default": collection("Job Template","job-sheets-col"),
701 | "job-sheets-col-supported": setof(keyword),
702 | "job-sheets-default": _(keyword, name),
703 | "job-sheets-supported": setof(_(keyword, name)),
704 | "job-spooling-supported": keyword,
705 | "max-save-info-supported": integer(1,MAX),
706 | "max-stitching-locations-supported": integer(1,MAX),
707 | "media-back-coating-supported": setof(_(keyword, name)),
708 | "media-bottom-margin-supported": setof(integer(0,MAX)),
709 | "media-col-database": setof(collection({
710 | //TODO: Member attributes are the same as the
711 | // "media-col" Job Template attribute
712 | "media-source-properties": collection({
713 | "media-source-feed-direction": keyword,
714 | "media-source-feed-orientation": enumeration
715 | })
716 | })),
717 | "media-col-default": collection("Job Template","media-col"),
718 | "media-col-ready": setof(collection({
719 | //TODO: Member attributes are the same as the
720 | // "media-col" Job Template attribute
721 | "media-source-properties": collection({
722 | "media-source-feed-direction": keyword,
723 | "media-source-feed-orientation": enumeration
724 | })
725 | })),
726 | "media-col-supported": setof(keyword),
727 | "media-color-supported": setof(_(keyword, name)),
728 | "media-default": _(keyword, name, novalue),
729 | "media-front-coating-supported": setof(_(keyword, name)),
730 | "media-grain-supported": setof(_(keyword, name)),
731 | "media-hole-count-supported": setof(rangeOfInteger(0,MAX)),
732 | "media-info-supported": boolean,
733 | "media-input-tray-check-default": _(keyword, name, novalue),
734 | "media-input-tray-check-supported": setof(_(keyword, name)),
735 | "media-key-supported": setof(_(keyword, name)),
736 | "media-left-margin-supported": setof(integer(0,MAX)),
737 | "media-order-count-supported": setof(rangeOfInteger(1,MAX)),
738 | "media-pre-printed-supported": setof(_(keyword, name)),
739 | "media-ready": setof(_(keyword, name)),
740 | "media-recycled-supported": setof(_(keyword, name)),
741 | "media-right-margin-supported": setof(integer(0,MAX)),
742 | "media-size-supported": setof(collection({
743 | "x-dimension": _(integer(1,MAX),rangeOfInteger(1,MAX)),
744 | "y-dimension": _(integer(1,MAX),rangeOfInteger(1,MAX))
745 | })),
746 | "media-source-supported": setof(_(keyword, name)),
747 | "media-supported": setof(_(keyword, name)),
748 | "media-thickness-supported": rangeOfInteger(1,MAX),
749 | "media-tooth-supported": setof(_(keyword, name)),
750 | "media-top-margin-supported": setof(integer(0,MAX)),
751 | "media-type-supported": setof(_(keyword, name)),
752 | "media-weight-metric-supported": setof(rangeOfInteger(0,MAX)),
753 | "multiple-document-handling-default": keyword,
754 | "multiple-document-handling-supported": setof(keyword),
755 | "multiple-document-jobs-supported": boolean,
756 | "multiple-operation-time-out": integer(1,MAX),
757 | "multiple-operation-timeout-action": keyword,
758 | "natural-language-configured": naturalLanguage,
759 | "number-up-default": integer(1,MAX),
760 | "number-up-supported": _(integer(1,MAX), rangeOfInteger(1,MAX)),
761 | "operations-supported": setof(enumeration),
762 | "orientation-requested-default": _(novalue, enumeration),
763 | "orientation-requested-supported": setof(enumeration),
764 | "output-bin-default": _(keyword, name),
765 | "output-bin-supported": setof(_(keyword, name)),
766 | "output-device-supported": setof(name(127)),
767 | "overrides-supported": setof(keyword),
768 | "page-delivery-default": keyword,
769 | "page-delivery-supported": setof(keyword),
770 | "page-order-received-default": keyword,
771 | "page-order-received-supported": setof(keyword),
772 | "page-ranges-supported": boolean,
773 | "pages-per-minute": integer(0,MAX),
774 | "pages-per-minute-color": integer(0,MAX),
775 | "pages-per-subset-supported": boolean,
776 | "parent-printers-supported": setof(uri),
777 | "pdl-init-file-default": _(collection("Job Template","pdl-init-file"), novalue),
778 | "pdl-init-file-entry-supported": setof(name),
779 | "pdl-init-file-location-supported": setof(uri),
780 | "pdl-init-file-name-subdirectory-supported": boolean,
781 | "pdl-init-file-name-supported": setof(name),
782 | "pdl-init-file-supported": setof(keyword),
783 | "pdl-override-supported": keyword,
784 | "preferred-attributes-supported": boolean,
785 | "presentation-direction-number-up-default": keyword,
786 | "presentation-direction-number-up-supported": setof(keyword),
787 | "print-color-mode-default": keyword,
788 | "print-color-mode-supported": setof(keyword),
789 | "print-content-optimize-default": keyword,
790 | "print-content-optimize-supported": setof(keyword),
791 | "print-quality-default": enumeration,
792 | "print-quality-supported": setof(enumeration),
793 | "print-rendering-intent-default": keyword,
794 | "print-rendering-intent-supported": setof(keyword),
795 | "printer-alert": setof(octetString),
796 | "printer-alert-description": setof(text),
797 | "printer-charge-info": text,
798 | "printer-charge-info-uri": uri,
799 | "printer-current-time": dateTime,
800 | "printer-detailed-status-messages": setof(text),
801 | "printer-device-id": text(1023),
802 | "printer-driver-installer": uri,
803 | "printer-geo-location": uri,
804 | "printer-get-attributes-supported": setof(keyword),
805 | "printer-icc-profiles": setof(collection({
806 | "xri-authentication": name,
807 | "profile-url": uri
808 | })),
809 | "printer-icons": setof(uri),
810 | "printer-info": text(127),
811 | "printer-is-accepting-jobs": boolean,
812 | "printer-location": text(127),
813 | "printer-make-and-model": text(127),
814 | "printer-mandatory-job-attributes": setof(keyword),
815 | "printer-message-date-time": dateTime,
816 | "printer-message-from-operator": text(127),
817 | "printer-message-time": integer,
818 | "printer-more-info": uri,
819 | "printer-more-info-manufacturer": uri,
820 | "printer-name": name(127),
821 | "printer-organization": setof(text),
822 | "printer-organizational-unit": setof(text),
823 | "printer-resolution-default": resolution,
824 | "printer-resolution-supported": resolution,
825 | "printer-settable-attributes-supported": setof(keyword),
826 | "printer-state": enumeration,
827 | "printer-state-change-date-time": dateTime,
828 | "printer-state-change-time": integer(1,MAX),
829 | "printer-state-message": text,
830 | "printer-state-reasons": setof(keyword),
831 | "printer-supply": setof(octetString),
832 | "printer-supply-description": setof(text),
833 | "printer-supply-info-uri": uri,
834 | "printer-up-time": integer(1,MAX),
835 | "printer-uri-supported": setof(uri),
836 | "printer-uuid": uri(45),
837 | "printer-xri-supported": setof(collection({
838 | "xri-authentication": keyword,
839 | "xri-security": keyword,
840 | "xri-uri": uri
841 | })),
842 | "proof-print-default": _(collection("Job Template", "proof-print"), novalue),
843 | "proof-print-supported": setof(keyword),
844 | "pwg-raster-document-resolution-supported": setof(resolution),
845 | "pwg-raster-document-sheet-back": keyword,
846 | "pwg-raster-document-type-supported": setof(keyword),
847 | "queued-job-count": integer(0,MAX),
848 | "reference-uri-schemes-supported": setof(uriScheme),
849 | "repertoire-supported": setof(_(keyword, name)),
850 | "requesting-user-uri-supported": boolean,
851 | "save-disposition-supported": setof(keyword),
852 | "save-document-format-default": mimeMediaType,
853 | "save-document-format-supported": setof(mimeMediaType),
854 | "save-location-default": uri,
855 | "save-location-supported": setof(uri),
856 | "save-name-subdirectory-supported": boolean,
857 | "save-name-supported": boolean,
858 | "separator-sheets-default": collection("Job Template","separator-sheets"),
859 | "separator-sheets-supported": setof(keyword),
860 | "sheet-collate-default": keyword,
861 | "sheet-collate-supported": setof(keyword),
862 | "sides-default": keyword,
863 | "sides-supported": setof(keyword),
864 | "stitching-locations-supported": setof(_(integer(0,MAX), rangeOfInteger(0,MAX))),
865 | "stitching-offset-supported": setof(_(integer(0,MAX), rangeOfInteger(0,MAX))),
866 | "subordinate-printers-supported": setof(uri),
867 | "uri-authentication-supported": setof(keyword),
868 | "uri-security-supported": setof(keyword),
869 | "user-defined-values-supported": setof(keyword),
870 | "which-jobs-supported": setof(keyword),
871 | "x-image-position-default": keyword,
872 | "x-image-position-supported": setof(keyword),
873 | "x-image-shift-default": integer,
874 | "x-image-shift-supported": rangeOfInteger,
875 | "x-side1-image-shift-default": integer,
876 | "x-side1-image-shift-supported": rangeOfInteger,
877 | "x-side2-image-shift-default": integer,
878 | "x-side2-image-shift-supported": rangeOfInteger,
879 | "xri-authentication-supported": setof(keyword),
880 | "xri-security-supported": setof(keyword),
881 | "xri-uri-scheme-supported": setof(uriScheme),
882 | "y-image-position-default": keyword,
883 | "y-image-position-supported": setof(keyword),
884 | "y-image-shift-default": integer,
885 | "y-image-shift-supported": rangeOfInteger,
886 | "y-side1-image-shift-default": integer,
887 | "y-side1-image-shift-supported": rangeOfInteger,
888 | "y-side2-image-shift-default": integer,
889 | "y-side2-image-shift-supported": rangeOfInteger
890 | };
891 | attributes["Subscription Description"] = {
892 | "notify-job-id": integer(1,MAX),
893 | "notify-lease-expiration-time": integer(0,MAX),
894 | "notify-printer-up-time": integer(1,MAX),
895 | "notify-printer-uri": uri,
896 | "notify-sequence-number": integer(0,MAX),
897 | "notify-subscriber-user-name": name,
898 | "notify-subscriber-user-uri": uri,
899 | "notify-subscription-id": integer(1,MAX),
900 | "subscription-uuid": uri
901 | };
902 | attributes["Subscription Template"] = {
903 | "notify-attributes": setof(keyword),
904 | "notify-attributes-supported": setof(keyword),
905 | "notify-charset": charset,
906 | "notify-events": setof(keyword),
907 | "notify-events-default": setof(keyword),
908 | "notify-events-supported": setof(keyword),
909 | "notify-lease-duration": integer(0,67108863),
910 | "notify-lease-duration-default": integer(0,67108863),
911 | "notify-lease-duration-supported": setof(_(integer(0, 67108863), rangeOfInteger(0, 67108863))),
912 | "notify-max-events-supported": integer(2,MAX),
913 | "notify-natural-language": naturalLanguage,
914 | "notify-pull-method": keyword,
915 | "notify-pull-method-supported": setof(keyword),
916 | "notify-recipient-uri": uri,
917 | "notify-schemes-supported": setof(uriScheme),
918 | "notify-time-interval": integer(0,MAX),
919 | "notify-user-data": octetString(63)
920 | };
921 |
922 | //convert all the syntactical sugar to an object tree
923 | function resolve(obj){
924 | if(obj.type) return obj;
925 | Object.keys(obj).forEach(function(name){
926 | var item = obj[name];
927 | if(typeof item === "function")
928 | obj[name] = item();
929 | else if(typeof item === "object" && !item.type)
930 | obj[name] = resolve(item);
931 | });
932 | // this is for recursive
933 | return obj;
934 | }
935 | resolve(attributes);
936 |
937 | module.exports = attributes;
938 | //console.log("var x = ",JSON.stringify(attributes, null, '\t'));
939 |
--------------------------------------------------------------------------------
/lib/enums.js:
--------------------------------------------------------------------------------
1 |
2 | var xref = require('./ipputil').xref;
3 | var enums = {
4 | "document-state": xref([ // ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippdocobject10-20031031-5100.5.pdf
5 | ,,, // 0x00-0x02
6 | "pending", // 0x03
7 | , // 0x04
8 | "processing", // 0x05
9 | , // 0x06
10 | "canceled", // 0x07
11 | "aborted", // 0x08
12 | "completed" // 0x09
13 | ]),
14 | "finishings": xref([
15 | ,,, // 0x00 - 0x02
16 | "none", // 0x03 http://tools.ietf.org/html/rfc2911#section-4.2.6
17 | "staple", // 0x04 http://tools.ietf.org/html/rfc2911#section-4.2.6
18 | "punch", // 0x05 http://tools.ietf.org/html/rfc2911#section-4.2.6
19 | "cover", // 0x06 http://tools.ietf.org/html/rfc2911#section-4.2.6
20 | "bind", // 0x07 http://tools.ietf.org/html/rfc2911#section-4.2.6
21 | "saddle-stitch", // 0x08 http://tools.ietf.org/html/rfc2911#section-4.2.6
22 | "edge-stitch", // 0x09 http://tools.ietf.org/html/rfc2911#section-4.2.6
23 | "fold", // 0x0A http://tools.ietf.org/html/rfc2911#section-4.2.6
24 | "trim", // 0x0B ftp://ftp.pwg.org/pub/pwg/ipp/new_VAL/pwg5100.1.pdf
25 | "bale", // 0x0C ftp://ftp.pwg.org/pub/pwg/ipp/new_VAL/pwg5100.1.pdf
26 | "booklet-maker", // 0x0D ftp://ftp.pwg.org/pub/pwg/ipp/new_VAL/pwg5100.1.pdf
27 | "jog-offset", // 0x0E ftp://ftp.pwg.org/pub/pwg/ipp/new_VAL/pwg5100.1.pdf
28 | ,,,,, // 0x0F - 0x13 reserved for future generic finishing enum values.
29 | "staple-top-left", // 0x14 http://tools.ietf.org/html/rfc2911#section-4.2.6
30 | "staple-bottom-left", // 0x15 http://tools.ietf.org/html/rfc2911#section-4.2.6
31 | "staple-top-right", // 0x16 http://tools.ietf.org/html/rfc2911#section-4.2.6
32 | "staple-bottom-right", // 0x17 http://tools.ietf.org/html/rfc2911#section-4.2.6
33 | "edge-stitch-left", // 0x18 http://tools.ietf.org/html/rfc2911#section-4.2.6
34 | "edge-stitch-top", // 0x19 http://tools.ietf.org/html/rfc2911#section-4.2.6
35 | "edge-stitch-right", // 0x1A http://tools.ietf.org/html/rfc2911#section-4.2.6
36 | "edge-stitch-bottom", // 0x1B http://tools.ietf.org/html/rfc2911#section-4.2.6
37 | "staple-dual-left", // 0x1C http://tools.ietf.org/html/rfc2911#section-4.2.6
38 | "staple-dual-top", // 0x1D http://tools.ietf.org/html/rfc2911#section-4.2.6
39 | "staple-dual-right", // 0x1E http://tools.ietf.org/html/rfc2911#section-4.2.6
40 | "staple-dual-bottom", // 0x1F http://tools.ietf.org/html/rfc2911#section-4.2.6
41 | ,,,,,,,,,,,,,,,,,, // 0x20 - 0x31 reserved for future specific stapling and stitching enum values.
42 | "bind-left", // 0x32 ftp://ftp.pwg.org/pub/pwg/ipp/new_VAL/pwg5100.1.pdf
43 | "bind-top", // 0x33 ftp://ftp.pwg.org/pub/pwg/ipp/new_VAL/pwg5100.1.pdf
44 | "bind-right", // 0x34 ftp://ftp.pwg.org/pub/pwg/ipp/new_VAL/pwg5100.1.pdf
45 | "bind-bottom", // 0x35 ftp://ftp.pwg.org/pub/pwg/ipp/new_VAL/pwg5100.1.pdf
46 | ,,,,,, // 0x36 - 0x3B
47 | "trim-after-pages", // 0x3C ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf (IPP Everywhere)
48 | "trim-after-documents", // 0x3D ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf (IPP Everywhere)
49 | "trim-after-copies", // 0x3E ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf (IPP Everywhere)
50 | "trim-after-job" // 0x3F ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf (IPP Everywhere)
51 | ]),
52 | "operations-supported": xref([
53 | , // 0x00
54 | , // 0x01
55 | "Print-Job", // 0x02 http://tools.ietf.org/html/rfc2911#section-3.2.1
56 | "Print-URI", // 0x03 http://tools.ietf.org/html/rfc2911#section-3.2.2
57 | "Validate-Job", // 0x04 http://tools.ietf.org/html/rfc2911#section-3.2.3
58 | "Create-Job", // 0x05 http://tools.ietf.org/html/rfc2911#section-3.2.4
59 | "Send-Document", // 0x06 http://tools.ietf.org/html/rfc2911#section-3.3.1
60 | "Send-URI", // 0x07 http://tools.ietf.org/html/rfc2911#section-3.3.2
61 | "Cancel-Job", // 0x08 http://tools.ietf.org/html/rfc2911#section-3.3.3
62 | "Get-Job-Attributes", // 0x09 http://tools.ietf.org/html/rfc2911#section-3.3.4
63 | "Get-Jobs", // 0x0A http://tools.ietf.org/html/rfc2911#section-3.2.6
64 | "Get-Printer-Attributes", // 0x0B http://tools.ietf.org/html/rfc2911#section-3.2.5
65 | "Hold-Job", // 0x0C http://tools.ietf.org/html/rfc2911#section-3.3.5
66 | "Release-Job", // 0x0D http://tools.ietf.org/html/rfc2911#section-3.3.6
67 | "Restart-Job", // 0x0E http://tools.ietf.org/html/rfc2911#section-3.3.7
68 | , // 0x0F
69 | "Pause-Printer", // 0x10 http://tools.ietf.org/html/rfc2911#section-3.2.7
70 | "Resume-Printer", // 0x11 http://tools.ietf.org/html/rfc2911#section-3.2.8
71 | "Purge-Jobs", // 0x12 http://tools.ietf.org/html/rfc2911#section-3.2.9
72 | "Set-Printer-Attributes", // 0x13 IPP2.1 http://tools.ietf.org/html/rfc3380#section-4.1
73 | "Set-Job-Attributes", // 0x14 IPP2.1 http://tools.ietf.org/html/rfc3380#section-4.2
74 | "Get-Printer-Supported-Values", // 0x15 IPP2.1 http://tools.ietf.org/html/rfc3380#section-4.3
75 | "Create-Printer-Subscriptions", // 0x16 IPP2.1 http://tools.ietf.org/html/rfc3995#section-7.1 && http://tools.ietf.org/html/rfc3995#section-11.1.2
76 | "Create-Job-Subscription", // 0x17 IPP2.1 http://tools.ietf.org/html/rfc3995#section-7.1 && http://tools.ietf.org/html/rfc3995#section-11.1.1
77 | "Get-Subscription-Attributes", // 0x18 IPP2.1 http://tools.ietf.org/html/rfc3995#section-7.1 && http://tools.ietf.org/html/rfc3995#section-11.2.4
78 | "Get-Subscriptions", // 0x19 IPP2.1 http://tools.ietf.org/html/rfc3995#section-7.1 && http://tools.ietf.org/html/rfc3995#section-11.2.5
79 | "Renew-Subscription", // 0x1A IPP2.1 http://tools.ietf.org/html/rfc3995#section-7.1 && http://tools.ietf.org/html/rfc3995#section-11.2.6
80 | "Cancel-Subscription", // 0x1B IPP2.1 http://tools.ietf.org/html/rfc3995#section-7.1 && http://tools.ietf.org/html/rfc3995#section-11.2.7
81 | "Get-Notifications", // 0x1C IPP2.1 IPP2.1 http://tools.ietf.org/html/rfc3996#section-9.2 && http://tools.ietf.org/html/rfc3996#section-5
82 | "ipp-indp-method", // 0x1D did not get standardized
83 | "Get-Resource-Attributes", // 0x1E http://tools.ietf.org/html/draft-ietf-ipp-get-resource-00#section-4.1 did not get standardized
84 | "Get-Resource-Data", // 0x1F http://tools.ietf.org/html/draft-ietf-ipp-get-resource-00#section-4.2 did not get standardized
85 | "Get-Resources", // 0x20 http://tools.ietf.org/html/draft-ietf-ipp-get-resource-00#section-4.3 did not get standardized
86 | "ipp-install", // 0x21 did not get standardized
87 | "Enable-Printer", // 0x22 http://tools.ietf.org/html/rfc3998#section-3.1.1
88 | "Disable-Printer", // 0x23 http://tools.ietf.org/html/rfc3998#section-3.1.2
89 | "Pause-Printer-After-Current-Job", // 0x24 http://tools.ietf.org/html/rfc3998#section-3.2.1
90 | "Hold-New-Jobs", // 0x25 http://tools.ietf.org/html/rfc3998#section-3.3.1
91 | "Release-Held-New-Jobs", // 0x26 http://tools.ietf.org/html/rfc3998#section-3.3.2
92 | "Deactivate-Printer", // 0x27 http://tools.ietf.org/html/rfc3998#section-3.4.1
93 | "Activate-Printer", // 0x28 http://tools.ietf.org/html/rfc3998#section-3.4.2
94 | "Restart-Printer", // 0x29 http://tools.ietf.org/html/rfc3998#section-3.5.1
95 | "Shutdown-Printer", // 0x2A http://tools.ietf.org/html/rfc3998#section-3.5.2
96 | "Startup-Printer", // 0x2B http://tools.ietf.org/html/rfc3998#section-3.5.3
97 | "Reprocess-Job", // 0x2C http://tools.ietf.org/html/rfc3998#section-4.1
98 | "Cancel-Current-Job", // 0x2D http://tools.ietf.org/html/rfc3998#section-4.2
99 | "Suspend-Current-Job", // 0x2E http://tools.ietf.org/html/rfc3998#section-4.3.1
100 | "Resume-Job", // 0x2F http://tools.ietf.org/html/rfc3998#section-4.3.2
101 | "Promote-Job", // 0x30 http://tools.ietf.org/html/rfc3998#section-4.4.1
102 | "Schedule-Job-After", // 0x31 http://tools.ietf.org/html/rfc3998#section-4.4.2
103 | , // 0x32
104 | "Cancel-Document", // 0x33 ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippdocobject10-20031031-5100.5.pdf
105 | "Get-Document-Attributes", // 0x34 ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippdocobject10-20031031-5100.5.pdf
106 | "Get-Documents", // 0x35 ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippdocobject10-20031031-5100.5.pdf
107 | "Delete-Document", // 0x36 ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippdocobject10-20031031-5100.5.pdf
108 | "Set-Document-Attributes", // 0x37 ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippdocobject10-20031031-5100.5.pdf
109 | "Cancel-Jobs", // 0x38 ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext10-20101030-5100.11.pdf
110 | "Cancel-My-Jobs", // 0x39 ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext10-20101030-5100.11.pdf
111 | "Resubmit-Job", // 0x3A ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext10-20101030-5100.11.pdf
112 | "Close-Job", // 0x3B ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext10-20101030-5100.11.pdf
113 | "Identify-Printer", // 0x3C ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf
114 | "Validate-Document" // 0x3D ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf
115 | ]),
116 | "job-collation-type": xref([ // IPP2.1 http://tools.ietf.org/html/rfc3381#section-6.3
117 | "other", // 0x01
118 | "unknown", // 0x02
119 | "uncollated-documents", // 0x03
120 | 'collated-documents', // 0x04
121 | 'uncollated-documents' // 0x05
122 | ]),
123 | "job-state": xref([ // http://tools.ietf.org/html/rfc2911#section-4.3.7
124 | ,,, // 0x00-0x02
125 | "pending", // 0x03
126 | "pending-held", // 0x04
127 | "processing", // 0x05
128 | "processing-stopped", // 0x06
129 | "canceled", // 0x07
130 | "aborted", // 0x08
131 | "completed" // 0x09
132 | ]),
133 | "orientation-requested": xref([ // http://tools.ietf.org/html/rfc2911#section-4.2.10
134 | ,,, // 0x00-0x02
135 | "portrait", // 0x03
136 | "landscape", // 0x04
137 | "reverse-landscape", // 0x05
138 | "reverse-portrait", // 0x06
139 | "none" // 0x07 ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf
140 | ]),
141 | "print-quality": xref([ // http://tools.ietf.org/html/rfc2911#section-4.2.13
142 | ,,, // 0x00-0x02
143 | "draft", // 0x03
144 | "normal", // 0x04
145 | "high" // 0x05
146 | ]),
147 | "printer-state": xref([ // http://tools.ietf.org/html/rfc2911#section-4.4.11
148 | ,,, // 0x00-0x02
149 | "idle", // 0x03
150 | "processing", // 0x04
151 | "stopped" // 0x05
152 | ])
153 | };
154 | enums["finishings-default"] = enums.finishings;
155 | enums["finishings-ready"] = enums.finishings;
156 | enums["finishings-supported"] = enums.finishings;
157 | enums["media-source-feed-orientation"] = enums["orientation-requested"];
158 | enums["orientation-requested-default"] = enums["orientation-requested"];
159 | enums["orientation-requested-supported"] = enums["orientation-requested"];//1setOf
160 | enums["print-quality-default"] = enums["print-quality"];
161 | enums["print-quality-supported"] = enums["print-quality"];//1setOf
162 |
163 |
164 |
165 | module.exports = enums;
--------------------------------------------------------------------------------
/lib/ipputil.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | // To serialize and deserialize, we need to be able to look
4 | // things up by key or by value. This little helper just
5 | // converts the arrays to objects and tacks on a 'lookup' property.
6 | function xref(arr){
7 | var obj = {};
8 | arr.forEach(function(item, index){
9 | obj[item] = index;
10 | });
11 | obj.lookup = arr;
12 | return obj;
13 | }
14 |
15 | exports.xref = xref;
16 |
17 | exports.extend = function extend(destination, source) {
18 | for(var property in source) {
19 | if (source[property] && source[property].constructor === Object) {
20 | destination[property] = destination[property] || {};
21 | extend(destination[property], source[property]);
22 | }
23 | else {
24 | destination[property] = source[property];
25 | }
26 | }
27 | return destination;
28 | };
29 |
--------------------------------------------------------------------------------
/lib/keywords.js:
--------------------------------------------------------------------------------
1 |
2 | var attributes = require('./attributes');
3 |
4 | //the only possible values for the keyword
5 | function keyword(arr){
6 | arr = arr.slice(0);
7 | arr.type = "keyword";
8 | return arr;
9 | }
10 | //some values for the keyword- but can include other 'name's
11 | function keyword_name(arr){
12 | arr = arr.slice(0);
13 | arr.type = "keyword | name";
14 | return arr;
15 | }
16 | //a keyword, name, or empty value
17 | function keyword_name_novalue(arr){
18 | arr = arr.slice(0);
19 | arr.type = "keyword | name | no-value";
20 | return arr;
21 | }
22 | //a keyword that groups another keyword's values together
23 | function setof_keyword(arr){
24 | arr = arr.slice(0);
25 | arr.type = "1setOf keyword";
26 | return arr;
27 | }
28 | //a keyword that groups [another keyword's values] or [names] together
29 | function setof_keyword_name(arr){
30 | arr = arr.slice(0);
31 | arr.type = "1setOf keyword | name";
32 | return arr;
33 | }
34 |
35 | //media is different from the others because it has sub-groups
36 | var media = {
37 | "size name": [
38 | "a",
39 | "arch-a",
40 | "arch-b",
41 | "arch-c",
42 | "arch-d",
43 | "arch-e",
44 | "asme_f_28x40in",
45 | "b",
46 | "c",
47 | "choice_iso_a4_210x297mm_na_letter_8.5x11in",
48 | "d",
49 | "e",
50 | "executive",
51 | "f",
52 | "folio",
53 | "invoice",
54 | "iso-a0",
55 | "iso-a1",
56 | "iso-a2",
57 | "iso-a3",
58 | "iso-a4",
59 | "iso-a5",
60 | "iso-a6",
61 | "iso-a7",
62 | "iso-a8",
63 | "iso-a9",
64 | "iso-a10",
65 | "iso-b0",
66 | "iso-b1",
67 | "iso-b2",
68 | "iso-b3",
69 | "iso-b4",
70 | "iso-b5",
71 | "iso-b6",
72 | "iso-b7",
73 | "iso-b8",
74 | "iso-b9",
75 | "iso-b10",
76 | "iso-c3",
77 | "iso-c4",
78 | "iso-c5",
79 | "iso-c6",
80 | "iso-designated-long",
81 | "iso_2a0_1189x1682mm",
82 | "iso_a0_841x1189mm",
83 | "iso_a1_594x841mm",
84 | "iso_a1x3_841x1783mm",
85 | "iso_a1x4_841x2378mm",
86 | "iso_a2_420x594mm",
87 | "iso_a2x3_594x1261mm",
88 | "iso_a2x4_594x1682mm",
89 | "iso_a2x5_594x2102mm",
90 | "iso_a3-extra_322x445mm",
91 | "iso_a3_297x420mm",
92 | "iso_a0x3_1189x2523mm",
93 | "iso_a3x3_420x891mm",
94 | "iso_a3x4_420x1189mm",
95 | "iso_a3x5_420x1486mm",
96 | "iso_a3x6_420x1783mm",
97 | "iso_a3x7_420x2080mm",
98 | "iso_a4-extra_235.5x322.3mm",
99 | "iso_a4-tab_225x297mm",
100 | "iso_a4_210x297mm",
101 | "iso_a4x3_297x630mm",
102 | "iso_a4x4_297x841mm",
103 | "iso_a4x5_297x1051mm",
104 | "iso_a4x6_297x1261mm",
105 | "iso_a4x7_297x1471mm",
106 | "iso_a4x8_297x1682mm",
107 | "iso_a4x9_297x1892mm",
108 | "iso_a5-extra_174x235mm",
109 | "iso_a5_148x210mm",
110 | "iso_a6_105x148mm",
111 | "iso_a7_74x105mm",
112 | "iso_a8_52x74mm",
113 | "iso_a9_37x52mm",
114 | "iso_a10_26x37mm",
115 | "iso_b0_1000x1414mm",
116 | "iso_b1_707x1000mm",
117 | "iso_b2_500x707mm",
118 | "iso_b3_353x500mm",
119 | "iso_b4_250x353mm",
120 | "iso_b5-extra_201x276mm",
121 | "iso_b5_176x250mm",
122 | "iso_b6_125x176mm",
123 | "iso_b6c4_125x324mm",
124 | "iso_b7_88x125mm",
125 | "iso_b8_62x88mm",
126 | "iso_b9_44x62mm",
127 | "iso_b10_31x44mm",
128 | "iso_c0_917x1297mm",
129 | "iso_c1_648x917mm",
130 | "iso_c2_458x648mm",
131 | "iso_c3_324x458mm",
132 | "iso_c4_229x324mm",
133 | "iso_c5_162x229mm",
134 | "iso_c6_114x162mm",
135 | "iso_c6c5_114x229mm",
136 | "iso_c7_81x114mm",
137 | "iso_c7c6_81x162mm",
138 | "iso_c8_57x81mm",
139 | "iso_c9_40x57mm",
140 | "iso_c10_28x40mm",
141 | "iso_dl_110x220mm",
142 | "iso_ra0_860x1220mm",
143 | "iso_ra1_610x860mm",
144 | "iso_ra2_430x610mm",
145 | "iso_sra0_900x1280mm",
146 | "iso_sra1_640x900mm",
147 | "iso_sra2_450x640mm",
148 | "jis-b0",
149 | "jis-b1",
150 | "jis-b2",
151 | "jis-b3",
152 | "jis-b4",
153 | "jis-b5",
154 | "jis-b6",
155 | "jis-b7",
156 | "jis-b8",
157 | "jis-b9",
158 | "jis-b10",
159 | "jis_b0_1030x1456mm",
160 | "jis_b1_728x1030mm",
161 | "jis_b2_515x728mm",
162 | "jis_b3_364x515mm",
163 | "jis_b4_257x364mm",
164 | "jis_b5_182x257mm",
165 | "jis_b6_128x182mm",
166 | "jis_b7_91x128mm",
167 | "jis_b8_64x91mm",
168 | "jis_b9_45x64mm",
169 | "jis_b10_32x45mm",
170 | "jis_exec_216x330mm",
171 | "jpn_chou2_111.1x146mm",
172 | "jpn_chou3_120x235mm",
173 | "jpn_chou4_90x205mm",
174 | "jpn_hagaki_100x148mm",
175 | "jpn_kahu_240x322.1mm",
176 | "jpn_kaku2_240x332mm",
177 | "jpn_oufuku_148x200mm",
178 | "jpn_you4_105x235mm",
179 | "ledger",
180 | "monarch",
181 | "na-5x7",
182 | "na-6x9",
183 | "na-7x9",
184 | "na-8x10",
185 | "na-9x11",
186 | "na-9x12",
187 | "na-10x13",
188 | "na-10x14",
189 | "na-10x15",
190 | "na-legal",
191 | "na-letter",
192 | "na-number-9",
193 | "na-number-10",
194 | "na_5x7_5x7in",
195 | "na_6x9_6x9in",
196 | "na_7x9_7x9in",
197 | "na_9x11_9x11in",
198 | "na_10x11_10x11in",
199 | "na_10x13_10x13in",
200 | "na_10x14_10x14in",
201 | "na_10x15_10x15in",
202 | "na_11x12_11x12in",
203 | "na_11x15_11x15in",
204 | "na_12x19_12x19in",
205 | "na_a2_4.375x5.75in",
206 | "na_arch-a_9x12in",
207 | "na_arch-b_12x18in",
208 | "na_arch-c_18x24in",
209 | "na_arch-d_24x36in",
210 | "na_arch-e_36x48in",
211 | "na_b-plus_12x19.17in",
212 | "na_c5_6.5x9.5in",
213 | "na_c_17x22in",
214 | "na_d_22x34in",
215 | "na_e_34x44in",
216 | "na_edp_11x14in",
217 | "na_eur-edp_12x14in",
218 | "na_executive_7.25x10.5in",
219 | "na_f_44x68in",
220 | "na_fanfold-eur_8.5x12in",
221 | "na_fanfold-us_11x14.875in",
222 | "na_foolscap_8.5x13in",
223 | "na_govt-legal_8x13in",
224 | "na_govt-letter_8x10in",
225 | "na_index-3x5_3x5in",
226 | "na_index-4x6-ext_6x8in",
227 | "na_index-4x6_4x6in",
228 | "na_index-5x8_5x8in",
229 | "na_invoice_5.5x8.5in",
230 | "na_ledger_11x17in",
231 | "na_legal-extra_9.5x15in",
232 | "na_legal_8.5x14in",
233 | "na_letter-extra_9.5x12in",
234 | "na_letter-plus_8.5x12.69in",
235 | "na_letter_8.5x11in",
236 | "na_monarch_3.875x7.5in",
237 | "na_number-9_3.875x8.875in",
238 | "na_number-10_4.125x9.5in",
239 | "na_number-11_4.5x10.375in",
240 | "na_number-12_4.75x11in",
241 | "na_number-14_5x11.5in",
242 | "na_personal_3.625x6.5in",
243 | "na_quarto_8.5x10.83in",
244 | "na_super-a_8.94x14in",
245 | "na_super-b_13x19in",
246 | "na_wide-format_30x42in",
247 | "om_dai-pa-kai_275x395mm",
248 | "om_folio-sp_215x315mm",
249 | "om_folio_210x330mm",
250 | "om_invite_220x220mm",
251 | "om_italian_110x230mm",
252 | "om_juuro-ku-kai_198x275mm",
253 | "om_large-photo_200x300",
254 | "om_pa-kai_267x389mm",
255 | "om_postfix_114x229mm",
256 | "om_small-photo_100x150mm",
257 | "prc_1_102x165mm",
258 | "prc_2_102x176mm",
259 | "prc_3_125x176mm",
260 | "prc_4_110x208mm",
261 | "prc_5_110x220mm",
262 | "prc_6_120x320mm",
263 | "prc_7_160x230mm",
264 | "prc_8_120x309mm",
265 | "prc_10_324x458mm",
266 | "prc_16k_146x215mm",
267 | "prc_32k_97x151mm",
268 | "quarto",
269 | "roc_8k_10.75x15.5in",
270 | "roc_16k_7.75x10.75in",
271 | "super-b",
272 | "tabloid"
273 | ],
274 | "media name": [
275 | "a-translucent",
276 | "a-transparent",
277 | "a-white",
278 | "arch-a-translucent",
279 | "arch-a-transparent",
280 | "arch-a-white",
281 | "arch-axsynchro-translucent",
282 | "arch-axsynchro-transparent",
283 | "arch-axsynchro-white",
284 | "arch-b-translucent",
285 | "arch-b-transparent",
286 | "arch-b-white",
287 | "arch-bxsynchro-translucent",
288 | "arch-bxsynchro-transparent",
289 | "arch-bxsynchro-white",
290 | "arch-c-translucent",
291 | "arch-c-transparent",
292 | "arch-c-white",
293 | "arch-cxsynchro-translucent",
294 | "arch-cxsynchro-transparent",
295 | "arch-cxsynchro-white",
296 | "arch-d-translucent",
297 | "arch-d-transparent",
298 | "arch-d-white",
299 | "arch-dxsynchro-translucent",
300 | "arch-dxsynchro-transparent",
301 | "arch-dxsynchro-white",
302 | "arch-e-translucent",
303 | "arch-e-transparent",
304 | "arch-e-white",
305 | "arch-exsynchro-translucent",
306 | "arch-exsynchro-transparent",
307 | "arch-exsynchro-white",
308 | "auto-fixed-size-translucent",
309 | "auto-fixed-size-transparent",
310 | "auto-fixed-size-white",
311 | "auto-synchro-translucent",
312 | "auto-synchro-transparent",
313 | "auto-synchro-white",
314 | "auto-translucent",
315 | "auto-transparent",
316 | "auto-white",
317 | "axsynchro-translucent",
318 | "axsynchro-transparent",
319 | "axsynchro-white",
320 | "b-translucent",
321 | "b-transparent",
322 | "b-white",
323 | "bxsynchro-translucent",
324 | "bxsynchro-transparent",
325 | "bxsynchro-white",
326 | "c-translucent",
327 | "c-transparent",
328 | "c-white",
329 | "custom1",
330 | "custom2",
331 | "custom3",
332 | "custom4",
333 | "custom5",
334 | "custom6",
335 | "custom7",
336 | "custom8",
337 | "custom9",
338 | "custom10",
339 | "cxsynchro-translucent",
340 | "cxsynchro-transparent",
341 | "cxsynchro-white",
342 | "d-translucent",
343 | "d-transparent",
344 | "d-white",
345 | "default",
346 | "dxsynchro-translucent",
347 | "dxsynchro-transparent",
348 | "dxsynchro-white",
349 | "e-translucent",
350 | "e-transparent",
351 | "e-white",
352 | "executive-white",
353 | "exsynchro-translucent",
354 | "exsynchro-transparent",
355 | "exsynchro-white",
356 | "folio-white",
357 | "invoice-white",
358 | "iso-a0-translucent",
359 | "iso-a0-transparent",
360 | "iso-a0-white",
361 | "iso-a0xsynchro-translucent",
362 | "iso-a0xsynchro-transparent",
363 | "iso-a0xsynchro-white",
364 | "iso-a1-translucent",
365 | "iso-a1-transparent",
366 | "iso-a1-white",
367 | "iso-a1x3-translucent",
368 | "iso-a1x3-transparent",
369 | "iso-a1x3-white",
370 | "iso-a1x4- translucent",
371 | "iso-a1x4-transparent",
372 | "iso-a1x4-white",
373 | "iso-a1xsynchro-translucent",
374 | "iso-a1xsynchro-transparent",
375 | "iso-a1xsynchro-white",
376 | "iso-a2-translucent",
377 | "iso-a2-transparent",
378 | "iso-a2-white",
379 | "iso-a2x3-translucent",
380 | "iso-a2x3-transparent",
381 | "iso-a2x3-white",
382 | "iso-a2x4-translucent",
383 | "iso-a2x4-transparent",
384 | "iso-a2x4-white",
385 | "iso-a2x5-translucent",
386 | "iso-a2x5-transparent",
387 | "iso-a2x5-white",
388 | "iso-a2xsynchro-translucent",
389 | "iso-a2xsynchro-transparent",
390 | "iso-a2xsynchro-white",
391 | "iso-a3-colored",
392 | "iso-a3-translucent",
393 | "iso-a3-transparent",
394 | "iso-a3-white",
395 | "iso-a3x3-translucent",
396 | "iso-a3x3-transparent",
397 | "iso-a3x3-white",
398 | "iso-a3x4-translucent",
399 | "iso-a3x4-transparent",
400 | "iso-a3x4-white",
401 | "iso-a3x5-translucent",
402 | "iso-a3x5-transparent",
403 | "iso-a3x5-white",
404 | "iso-a3x6-translucent",
405 | "iso-a3x6-transparent",
406 | "iso-a3x6-white",
407 | "iso-a3x7-translucent",
408 | "iso-a3x7-transparent",
409 | "iso-a3x7-white",
410 | "iso-a3xsynchro-translucent",
411 | "iso-a3xsynchro-transparent",
412 | "iso-a3xsynchro-white",
413 | "iso-a4-colored",
414 | "iso-a4-translucent",
415 | "iso-a4-transparent",
416 | "iso-a4-white",
417 | "iso-a4x3-translucent",
418 | "iso-a4x3-transparent",
419 | "iso-a4x3-white",
420 | "iso-a4x4-translucent",
421 | "iso-a4x4-transparent",
422 | "iso-a4x4-white",
423 | "iso-a4x5-translucent",
424 | "iso-a4x5-transparent",
425 | "iso-a4x5-white",
426 | "iso-a4x6-translucent",
427 | "iso-a4x6-transparent",
428 | "iso-a4x6-white",
429 | "iso-a4x7-translucent",
430 | "iso-a4x7-transparent",
431 | "iso-a4x7-white",
432 | "iso-a4x8-translucent",
433 | "iso-a4x8-transparent",
434 | "iso-a4x8-white",
435 | "iso-a4x9-translucent",
436 | "iso-a4x9-transparent",
437 | "iso-a4x9-white",
438 | "iso-a4xsynchro-translucent",
439 | "iso-a4xsynchro-transparent",
440 | "iso-a4xsynchro-white",
441 | "iso-a5-colored",
442 | "iso-a5-translucent",
443 | "iso-a5-transparent",
444 | "iso-a5-white",
445 | "iso-a6-white",
446 | "iso-a7-white",
447 | "iso-a8-white",
448 | "iso-a9-white",
449 | "iso-a10-white",
450 | "iso-b0-white",
451 | "iso-b1-white",
452 | "iso-b2-white",
453 | "iso-b3-white",
454 | "iso-b4-colored",
455 | "iso-b4-white",
456 | "iso-b5-colored",
457 | "iso-b5-white",
458 | "iso-b6-white",
459 | "iso-b7-white",
460 | "iso-b8-white",
461 | "iso-b9-white",
462 | "iso-b10-white",
463 | "jis-b0-translucent",
464 | "jis-b0-transparent",
465 | "jis-b0-white",
466 | "jis-b1-translucent",
467 | "jis-b1-transparent",
468 | "jis-b1-white",
469 | "jis-b2-translucent",
470 | "jis-b2-transparent",
471 | "jis-b2-white",
472 | "jis-b3-translucent",
473 | "jis-b3-transparent",
474 | "jis-b3-white",
475 | "jis-b4-colored",
476 | "jis-b4-translucent",
477 | "jis-b4-transparent",
478 | "jis-b4-white",
479 | "jis-b5-colored",
480 | "jis-b5-translucent",
481 | "jis-b5-transparent",
482 | "jis-b5-white",
483 | "jis-b6-white",
484 | "jis-b7-white",
485 | "jis-b8-white",
486 | "jis-b9-white",
487 | "jis-b10-white",
488 | "ledger-white",
489 | "na-legal-colored",
490 | "na-legal-white",
491 | "na-letter-colored",
492 | "na-letter-transparent",
493 | "na-letter-white",
494 | "quarto-white"
495 | ],
496 | "media type": [
497 | "bond",
498 | "heavyweight",
499 | "labels",
500 | "letterhead",
501 | "plain",
502 | "pre-printed",
503 | "pre-punched",
504 | "recycled",
505 | "transparency"
506 | ],
507 | "input tray": [
508 | "bottom",
509 | "by-pass-tray",
510 | "envelope",
511 | "large-capacity",
512 | "main",
513 | "manual",
514 | "middle",
515 | "side",
516 | "top",
517 | "tray-1",
518 | "tray-2",
519 | "tray-3",
520 | "tray-4",
521 | "tray-5",
522 | "tray-6",
523 | "tray-7",
524 | "tray-8",
525 | "tray-9",
526 | "tray-10"
527 | ],
528 | "envelope name": [
529 | "iso-b4-envelope",
530 | "iso-b5-envelope",
531 | "iso-c3-envelope",
532 | "iso-c4-envelope",
533 | "iso-c5-envelope",
534 | "iso-c6-envelope",
535 | "iso-designated-long-envelope",
536 | "monarch-envelope",
537 | "na-6x9-envelope",
538 | "na-7x9-envelope",
539 | "na-9x11-envelope",
540 | "na-9x12-envelope",
541 | "na-10x13-envelope",
542 | "na-10x14-envelope",
543 | "na-10x15-envelope",
544 | "na-number-9-envelope",
545 | "na-number-10-envelope"
546 | ]
547 | }
548 |
549 | var Job_Template_attribute_names = Object.keys(attributes["Job Template"]);
550 | var Job_Template_and_Operation_attribute_names = Job_Template_attribute_names.concat(Object.keys(attributes["Operation"]))
551 | var Printer_attribute_names = Object.keys(attributes["Job Template"]).concat(["none"]);
552 | var media_name_or_size = media["media name"].concat(media["size name"]);
553 |
554 | var keywords = {};
555 | keywords["compression"] = keyword([
556 | "compress",
557 | "deflate",
558 | "gzip",
559 | "none"
560 | ]);
561 | keywords["compression-supported"] = setof_keyword(
562 | keywords["compression"]
563 | );
564 | keywords["cover-back-supported"] = setof_keyword([
565 | "cover-type",
566 | "media",
567 | "media-col"
568 | ]);
569 | keywords["cover-front-supported"] = setof_keyword(
570 | keywords["cover-back-supported"]
571 | );
572 | keywords["cover-type"] = keyword([
573 | "no-cover",
574 | "print-back",
575 | "print-both",
576 | "print-front",
577 | "print-none"
578 | ]);
579 | keywords["document-digital-signature"] = keyword([
580 | "dss",
581 | "none",
582 | "pgp",
583 | "smime",
584 | "xmldsig"
585 | ]);
586 | keywords["document-digital-signature-default"] = keyword(
587 | keywords["document-digital-signature"]
588 | );
589 | keywords["document-digital-signature-supported"] = setof_keyword(
590 | keywords["document-digital-signature"]
591 | );
592 | keywords["document-format-details-supported"] = setof_keyword([
593 | "document-format",
594 | "document-format-device-id",
595 | "document-format-version",
596 | "document-natural-language",
597 | "document-source-application-name",
598 | "document-source-application-version",
599 | "document-source-os-name",
600 | "document-source-os-version"
601 | ]);
602 | keywords["document-format-varying-attributes"] = setof_keyword(
603 | //Any Printer attribute keyword name
604 | Printer_attribute_names
605 | );
606 | keywords["document-state-reasons"] = setof_keyword([
607 | "aborted-by-system",
608 | "canceled-at-device",
609 | "canceled-by-operator",
610 | "canceled-by-user",
611 | "completed-successfully",
612 | "completed-with-errors",
613 | "completed-with-warnings",
614 | "compression-error",
615 | "data-insufficient",
616 | "digital-signature-did-not-verify",
617 | "digital-signature-type-not-supported",
618 | "digital-signature-wait",
619 | "document-access-error",
620 | "document-format-error",
621 | "document-password-error",
622 | "document-permission-error",
623 | "document-security-error",
624 | "document-unprintable-error",
625 | "errors-detected",
626 | "incoming",
627 | "interpreting",
628 | "none",
629 | "outgoing",
630 | "printing",
631 | "processing-to-stop-point",
632 | "queued",
633 | "queued-for-marker",
634 | "queued-in-device",
635 | "resources-are-not-ready",
636 | "resources-are-not-supported",
637 | "submission-interrupted",
638 | "transforming",
639 | "unsupported-compression",
640 | "unsupported-document-format",
641 | "warnings-detected"
642 | ]);
643 | keywords["feed-orientation"] = keyword([
644 | "long-edge-first",
645 | "short-edge-first"
646 | ]);
647 | keywords["feed-orientation-supported"] = setof_keyword(
648 | keywords["feed-orientation"]
649 | );
650 | keywords["finishings-col-supported"] = setof_keyword([
651 | "finishing-template",
652 | "stitching"
653 | ]);
654 | keywords["identify-actions"] = setof_keyword([
655 | "display",
656 | "flash",
657 | "sound",
658 | "speak"
659 | ]);
660 | keywords["identify-actions-default"] = setof_keyword(
661 | keywords["identify-actions"]
662 | );
663 | keywords["identify-actions-supported"] = setof_keyword(
664 | keywords["identify-actions"]
665 | );
666 | keywords["imposition-template"] = keyword_name([
667 | "none",
668 | "signature"
669 | ]);
670 | keywords["ipp-features-supported"] = setof_keyword([
671 | "document-object",
672 | "ipp-everywhere",
673 | "job-save",
674 | "none",
675 | "page-overrides",
676 | "proof-print",
677 | "subscription-object"
678 | ]);
679 | keywords["ipp-versions-supported"] = setof_keyword([
680 | "1.0",
681 | "1.1",
682 | "2.0",
683 | "2.1",
684 | "2.2"
685 | ]);
686 | keywords["job-accounting-sheets-type"] = keyword_name([
687 | "none",
688 | "standard"
689 | ]);
690 | keywords["job-cover-back-supported"] = setof_keyword(
691 | keywords["cover-back-supported"]
692 | );
693 | keywords["job-cover-front-supported"] = setof_keyword(
694 | keywords["cover-front-supported"]
695 | );
696 | keywords["job-creation-attributes-supported"] = setof_keyword(
697 | // Any Job Template attribute
698 | // Any job creation Operation attribute keyword name
699 | Job_Template_and_Operation_attribute_names
700 | );
701 | keywords["job-error-action"] = keyword([
702 | "abort-job",
703 | "cancel-job",
704 | "continue-job",
705 | "suspend-job"
706 | ]);
707 | keywords["job-error-action-default"] = keyword(
708 | keywords["job-error-action"]
709 | );
710 | keywords["job-error-action-supported"] = setof_keyword(
711 | keywords["job-error-action"]
712 | );
713 | keywords["job-error-sheet-type"] = keyword_name([
714 | "none",
715 | "standard"
716 | ]);
717 | keywords["job-error-sheet-when"] = keyword([
718 | "always",
719 | "on-error"
720 | ]);
721 | keywords["job-finishings-col-supported"] = setof_keyword(
722 | keywords["finishings-col-supported"]
723 | );
724 | keywords["job-hold-until"] = keyword_name([
725 | "day-time",
726 | "evening",
727 | "indefinite",
728 | "night",
729 | "no-hold",
730 | "second-shift",
731 | "third-shift",
732 | "weekend"
733 | ]);
734 | keywords["job-hold-until-default"] = keyword_name(
735 | keywords["job-hold-until"]
736 | );
737 | keywords["job-hold-until-supported"] = setof_keyword_name(
738 | keywords["job-hold-until"]
739 | );
740 | keywords["job-mandatory-attributes"] = setof_keyword(
741 | // Any Job Template attribute
742 | Job_Template_attribute_names
743 | );
744 | keywords["job-password-encryption"] = keyword_name([
745 | "md2",
746 | "md4",
747 | "md5",
748 | "none",
749 | "sha"
750 | ]);
751 | keywords["job-password-encryption-supported"] = setof_keyword_name(
752 | keywords["job-password-encryption"]
753 | );
754 | keywords["job-save-disposition-supported"] = setof_keyword([
755 | "save-disposition",
756 | "save-info"
757 | ]);
758 | keywords["job-settable-attributes-supported"] = setof_keyword(
759 | // Any Job Template attribute
760 | Job_Template_attribute_names
761 | );
762 | keywords["job-sheets"] = keyword_name([
763 | "first-print-stream-page",
764 | "job-both-sheet",
765 | "job-end-sheet",
766 | "job-start-sheet",
767 | "none",
768 | "standard"
769 | ]);
770 | keywords["job-sheets-default"] = keyword_name(
771 | keywords["job-sheets"]
772 | );
773 | keywords["job-sheets-supported"] = setof_keyword_name(
774 | keywords["job-sheets"]
775 | );
776 | keywords["job-spooling-supported"] = keyword([
777 | "automatic",
778 | "spool",
779 | "stream"
780 | ]);
781 | keywords["job-state-reasons"] = setof_keyword([
782 | "aborted-by-system",
783 | "compression-error",
784 | "digital-signature-did-not-verify",
785 | "digital-signature-type-not-supported",
786 | "document-access-error",
787 | "document-format-error",
788 | "document-password-error",
789 | "document-permission-error",
790 | "document-security-error",
791 | "document-unprintable-error",
792 | "errors-detected",
793 | "job-canceled-at-device",
794 | "job-canceled-by-operator",
795 | "job-canceled-by-user",
796 | "job-completed-successfully",
797 | "job-completed-with-errors",
798 | "job-completed-with-warnings",
799 | "job-data-insufficient",
800 | "job-delay-output-until-specified",
801 | "job-digital-signature-wait",
802 | "job-hold-until-specified",
803 | "job-incoming",
804 | "job-interpreting",
805 | "job-outgoing",
806 | "job-password-wait",
807 | "job-printed-successfully",
808 | "job-printed-with-errors",
809 | "job-printed-with-warnings",
810 | "job-printing",
811 | "job-queued",
812 | "job-queued-for-marker",
813 | "job-restartable",
814 | "job-resuming",
815 | "job-saved-successfully",
816 | "job-saved-with-errors",
817 | "job-saved-with-warnings",
818 | "job-saving",
819 | "job-spooling",
820 | "job-streaming",
821 | "job-suspended",
822 | "job-suspended-by-operator",
823 | "job-suspended-by-system",
824 | "job-suspended-by-user",
825 | "job-suspending",
826 | "job-transforming",
827 | "none",
828 | "printer-stopped",
829 | "printer-stopped-partly",
830 | "processing-to-stop-point",
831 | "queued-in-device",
832 | "resources-are-not-ready",
833 | "resources-are-not-supported",
834 | "service-off-line",
835 | "submission-interrupted",
836 | "unsupported-compression",
837 | "unsupported-document-format",
838 | "warnings-detected"
839 | ]);
840 | keywords["media"] = keyword_name(
841 | [].concat(media["size name"],
842 | media["media name"],
843 | media["media type"],
844 | media["input tray"],
845 | media["envelope name"]
846 | )
847 | );
848 | keywords["media-back-coating"] = keyword_name([
849 | "glossy",
850 | "high-gloss",
851 | "matte",
852 | "none",
853 | "satin",
854 | "semi-gloss"
855 | ]);
856 | keywords["media-back-coating-supported"] = setof_keyword_name(
857 | keywords["media-back-coating"]
858 | );
859 | keywords["media-col-supported"] = setof_keyword([
860 | "media-bottom-margin",
861 | "media-left-margin",
862 | "media-right-margin",
863 | "media-size-name",
864 | "media-source",
865 | "media-top-margin"
866 | ]);
867 | keywords["media-color"] = keyword_name([
868 | "blue",
869 | "buff",
870 | "goldenrod",
871 | "gray",
872 | "green",
873 | "ivory",
874 | "no-color",
875 | "orange",
876 | "pink",
877 | "red",
878 | "white",
879 | "yellow"
880 | ]);
881 | keywords["media-color-supported"] = setof_keyword_name(
882 | keywords["media-color"]
883 | );
884 | keywords["media-default"] = keyword_name_novalue(
885 | keywords["media"]
886 | );
887 | keywords["media-front-coating"] = keyword_name(
888 | keywords["media-back-coating"]
889 | );
890 | keywords["media-front-coating-supported"] = setof_keyword_name(
891 | keywords["media-back-coating"]
892 | );
893 | keywords["media-grain"] = keyword_name([
894 | "x-direction",
895 | "y-direction"
896 | ]);
897 | keywords["media-grain-supported"] = setof_keyword_name(
898 | keywords["media-grain"]
899 | );
900 | keywords["media-input-tray-check"] = keyword_name([
901 | media["input tray"]
902 | ]);
903 | keywords["media-input-tray-check-default"] = keyword_name([
904 | media["input tray"]
905 | ]);
906 | keywords["media-input-tray-check-supported"] = setof_keyword_name(
907 | media["input tray"]
908 | );
909 | keywords["media-key"] = keyword_name(
910 | // Any "media" media or size keyword value
911 | media_name_or_size
912 | );
913 | keywords["media-key-supported"] = setof_keyword_name([
914 | // Any "media" media or size keyword value
915 | media_name_or_size
916 | ]);
917 | keywords["media-pre-printed"] = keyword_name([
918 | "blank",
919 | "letter-head",
920 | "pre-printed"
921 | ]);
922 | keywords["media-pre-printed-supported"] = keyword_name(
923 | keywords["media-pre-printed"]
924 | );
925 | keywords["media-ready"] = setof_keyword_name([
926 | // Any "media" media or size keyword value
927 | media_name_or_size
928 | ]);
929 | keywords["media-recycled"] = keyword_name([
930 | "none",
931 | "standard"
932 | ]);
933 | keywords["media-recycled-supported"] = keyword_name(
934 | keywords["media-recycled"]
935 | );
936 | keywords["media-source"] = keyword_name([
937 | "alternate",
938 | "alternate-roll",
939 | "auto",
940 | "bottom",
941 | "by-pass-tray",
942 | "center",
943 | "disc",
944 | "envelope",
945 | "hagaki",
946 | "large-capacity",
947 | "left",
948 | "main",
949 | "main-roll",
950 | "manual",
951 | "middle",
952 | "photo",
953 | "rear",
954 | "right",
955 | "roll-1",
956 | "roll-2",
957 | "roll-3",
958 | "roll-4",
959 | "roll-5",
960 | "roll-6",
961 | "roll-7",
962 | "roll-8",
963 | "roll-9",
964 | "roll-10",
965 | "side",
966 | "top",
967 | "tray-1",
968 | "tray-2",
969 | "tray-3",
970 | "tray-4",
971 | "tray-5",
972 | "tray-6",
973 | "tray-7",
974 | "tray-8",
975 | "tray-9",
976 | "tray-10",
977 | "tray-11",
978 | "tray-12",
979 | "tray-13",
980 | "tray-14",
981 | "tray-15",
982 | "tray-16",
983 | "tray-17",
984 | "tray-18",
985 | "tray-19",
986 | "tray-20"
987 | ]);
988 | keywords["media-source-feed-direction"] = keyword(
989 | keywords["feed-orientation"]
990 | );
991 | keywords["media-source-supported"] = setof_keyword_name(
992 | keywords["media-source"]
993 | );
994 | keywords["media-supported"] = setof_keyword_name(
995 | keywords["media"]
996 | );
997 | keywords["media-tooth"] = keyword_name([
998 | "antique",
999 | "calendared",
1000 | "coarse",
1001 | "fine",
1002 | "linen",
1003 | "medium",
1004 | "smooth",
1005 | "stipple",
1006 | "uncalendared",
1007 | "vellum"
1008 | ]);
1009 | keywords["media-tooth-supported"] = setof_keyword_name(
1010 | keywords["media-tooth"]
1011 | );
1012 | keywords["media-type"] = keyword_name([
1013 | "aluminum",
1014 | "back-print-film",
1015 | "cardboard",
1016 | "cardstock",
1017 | "cd",
1018 | "continuous",
1019 | "continuous-long",
1020 | "continuous-short",
1021 | "corrugated-board",
1022 | "disc",
1023 | "double-wall",
1024 | "dry-film",
1025 | "dvd",
1026 | "embossing-foil",
1027 | "end-board",
1028 | "envelope",
1029 | "envelope-plain",
1030 | "envelope-window",
1031 | "film",
1032 | "flexo-base",
1033 | "flexo-photo-polymer",
1034 | "flute",
1035 | "foil",
1036 | "full-cut-tabs",
1037 | "gravure-cylinder",
1038 | "image-setter-paper",
1039 | "imaging-cylinder",
1040 | "labels",
1041 | "laminating-foil",
1042 | "letterhead",
1043 | "mounting-tape",
1044 | "multi-layer",
1045 | "multi-part-form",
1046 | "other",
1047 | "paper",
1048 | "photographic",
1049 | "photographic-film",
1050 | "photographic-glossy",
1051 | "photographic-high-gloss",
1052 | "photographic-matte",
1053 | "photographic-satin",
1054 | "photographic-semi-gloss",
1055 | "plate",
1056 | "polyester",
1057 | "pre-cut-tabs",
1058 | "roll",
1059 | "screen",
1060 | "screen-paged",
1061 | "self-adhesive",
1062 | "shrink-foil",
1063 | "single-face",
1064 | "single-wall",
1065 | "sleeve",
1066 | "stationery",
1067 | "stationery-coated",
1068 | "stationery-fine",
1069 | "stationery-heavyweight",
1070 | "stationery-inkjet",
1071 | "stationery-letterhead",
1072 | "stationery-lightweight",
1073 | "stationery-preprinted",
1074 | "stationery-prepunched",
1075 | "tab-stock",
1076 | "tractor",
1077 | "transparency",
1078 | "triple-wall",
1079 | "wet-film"
1080 | ]);
1081 | keywords["media-type-supported"] = setof_keyword_name(
1082 | keywords["media-type"]
1083 | );
1084 | keywords["multiple-document-handling"] = keyword([
1085 | "separate-documents-collated-copies",
1086 | "separate-documents-uncollated-copies",
1087 | "single-document",
1088 | "single-document-new-sheet"
1089 | ]);
1090 | keywords["multiple-document-handling-default"] = keyword(
1091 | keywords["multiple-document-handling"]
1092 | );
1093 | keywords["multiple-document-handling-supported"] = setof_keyword(
1094 | keywords["multiple-document-handling"]
1095 | );
1096 | keywords["multiple-operation-timeout-action"] = keyword([
1097 | "abort-job",
1098 | "hold-job",
1099 | "process-job"
1100 | ]);
1101 | keywords["notify-events"] = setof_keyword([
1102 | "job-completed",
1103 | "job-config-changed",
1104 | "job-created",
1105 | "job-progress",
1106 | "job-state-changed",
1107 | "job-stopped",
1108 | "none",
1109 | "printer-config-changed",
1110 | "printer-finishings-changed",
1111 | "printer-media-changed",
1112 | "printer-queue-order-changed",
1113 | "printer-restarted",
1114 | "printer-shutdown",
1115 | "printer-state-changed",
1116 | "printer-stopped"
1117 | ]);
1118 | keywords["notify-events-default"] = setof_keyword(
1119 | keywords["notify-events"]
1120 | );
1121 | keywords["notify-events-supported"] = setof_keyword(
1122 | keywords["notify-events"]
1123 | );
1124 | keywords["notify-pull-method"] = keyword([
1125 | "ippget"
1126 | ]);
1127 | keywords["notify-pull-method-supported"] = setof_keyword(
1128 | keywords["notify-pull-method"]
1129 | );
1130 | keywords["notify-subscribed-event"] = keyword(
1131 | keywords["notify-events"]
1132 | );
1133 | keywords["output-bin"] = keyword_name([
1134 | "bottom",
1135 | "center",
1136 | "face-down",
1137 | "face-up",
1138 | "large-capacity",
1139 | "left",
1140 | "mailbox-1",
1141 | "mailbox-2",
1142 | "mailbox-3",
1143 | "mailbox-4",
1144 | "mailbox-5",
1145 | "mailbox-6",
1146 | "mailbox-7",
1147 | "mailbox-8",
1148 | "mailbox-9",
1149 | "mailbox-10",
1150 | "middle",
1151 | "my-mailbox",
1152 | "rear",
1153 | "right",
1154 | "side",
1155 | "stacker-1",
1156 | "stacker-2",
1157 | "stacker-3",
1158 | "stacker-4",
1159 | "stacker-5",
1160 | "stacker-6",
1161 | "stacker-7",
1162 | "stacker-8",
1163 | "stacker-9",
1164 | "stacker-10",
1165 | "top",
1166 | "tray-1",
1167 | "tray-2",
1168 | "tray-3",
1169 | "tray-4",
1170 | "tray-5",
1171 | "tray-6",
1172 | "tray-7",
1173 | "tray-8",
1174 | "tray-9",
1175 | "tray-10"
1176 | ]);
1177 | keywords["job-accounting-output-bin"] = keyword_name(
1178 | keywords["output-bin"]
1179 | );
1180 | keywords["output-bin-default"] = keyword_name(
1181 | keywords["output-bin"]
1182 | );
1183 | keywords["output-bin-supported"] = setof_keyword_name(
1184 | keywords["output-bin"]
1185 | );
1186 | keywords["page-delivery"] = keyword([
1187 | "reverse-order-face-down",
1188 | "reverse-order-face-up",
1189 | "same-order-face-down",
1190 | "same-order-face-up",
1191 | "system-specified"
1192 | ]);
1193 | keywords["page-delivery-default"] = keyword(
1194 | keywords["page-delivery"]
1195 | );
1196 | keywords["page-delivery-supported"] = setof_keyword(
1197 | keywords["page-delivery"]
1198 | );
1199 | keywords["page-order-received"] = keyword([
1200 | "1-to-n-order",
1201 | "n-to-1-order"
1202 | ]);
1203 | keywords["page-order-received-default"] = keyword(
1204 | keywords["page-order-received"]
1205 | );
1206 | keywords["page-order-received-supported"] = setof_keyword(
1207 | keywords["page-order-received"]
1208 | );
1209 | keywords["current-page-order"] = keyword(
1210 | keywords["page-order-received"]
1211 | );
1212 | keywords["pdl-init-file-supported"] = setof_keyword([
1213 | "pdl-init-file-entry",
1214 | "pdl-init-file-location",
1215 | "pdl-init-file-name"
1216 | ]);
1217 | keywords["pdl-override-supported"] = keyword([
1218 | "attempted",
1219 | "guaranteed",
1220 | "not-attempted"
1221 | ]);
1222 | keywords["presentation-direction-number-up"] = keyword([
1223 | "tobottom-toleft",
1224 | "tobottom-toright",
1225 | "toleft-tobottom",
1226 | "toleft-totop",
1227 | "toright-tobottom",
1228 | "toright-totop",
1229 | "totop-toleft",
1230 | "totop-toright"
1231 | ]);
1232 | keywords["presentation-direction-number-up-default"] = keyword(
1233 | keywords["presentation-direction-number-up"]
1234 | );
1235 | keywords["presentation-direction-number-up-supported"] = setof_keyword(
1236 | keywords["presentation-direction-number-up"]
1237 | );
1238 | keywords["print-color-mode"] = keyword([
1239 | "auto",
1240 | "bi-level",
1241 | "color",
1242 | "highlight",
1243 | "monochrome",
1244 | "process-bi-level",
1245 | "process-monochrome"
1246 | ]);
1247 | keywords["print-color-mode-default"] = keyword(
1248 | keywords["print-color-mode"]
1249 | );
1250 | keywords["print-color-mode-supported"] = setof_keyword(
1251 | keywords["print-color-mode"]
1252 | );
1253 | keywords["print-content-optimize"] = keyword([
1254 | "auto",
1255 | "graphic",
1256 | "photo",
1257 | "text",
1258 | "text-and-graphic"
1259 | ]);
1260 | keywords["print-content-optimize-default"] = keyword(
1261 | keywords["print-content-optimize"]
1262 | );
1263 | keywords["print-content-optimize-supported"] = setof_keyword(
1264 | keywords["print-content-optimize"]
1265 | );
1266 | keywords["print-rendering-intent"] = keyword([
1267 | "absolute",
1268 | "auto",
1269 | "perceptual",
1270 | "relative",
1271 | "relative-bpc",
1272 | "saturation"
1273 | ]);
1274 | keywords["print-rendering-intent-default"] = keyword(
1275 | keywords["print-rendering-intent"]
1276 | );
1277 | keywords["print-rendering-intent-supported"] = setof_keyword(
1278 | keywords["print-rendering-intent"]
1279 | );
1280 | keywords["printer-get-attributes-supported"] = setof_keyword(
1281 | // Any Job Template attribute
1282 | // Any job creation Operation attribute keyword name
1283 | Job_Template_and_Operation_attribute_names
1284 | );
1285 | keywords["printer-mandatory-job-attributes"] = setof_keyword(
1286 | // Any Job Template attribute
1287 | // Any Operation attribute at the job level
1288 | //this probably isn't quite right...
1289 | Job_Template_and_Operation_attribute_names
1290 | );
1291 | keywords["printer-settable-attributes-supported"] = setof_keyword(
1292 | // Any read-write Printer attribute keyword name
1293 | Printer_attribute_names
1294 | );
1295 | keywords["printer-state-reasons"] = setof_keyword([
1296 | "alert-removal-of-binary-change-entry",
1297 | "bander-added",
1298 | "bander-almost-empty",
1299 | "bander-almost-full",
1300 | "bander-at-limit",
1301 | "bander-closed",
1302 | "bander-configuration-change",
1303 | "bander-cover-closed",
1304 | "bander-cover-open",
1305 | "bander-empty",
1306 | "bander-full",
1307 | "bander-interlock-closed",
1308 | "bander-interlock-open",
1309 | "bander-jam",
1310 | "bander-life-almost-over",
1311 | "bander-life-over",
1312 | "bander-memory-exhausted",
1313 | "bander-missing",
1314 | "bander-motor-failure",
1315 | "bander-near-limit",
1316 | "bander-offline",
1317 | "bander-opened",
1318 | "bander-over-temperature",
1319 | "bander-power-saver",
1320 | "bander-recoverable-failure",
1321 | "bander-recoverable-storage-error",
1322 | "bander-removed",
1323 | "bander-resource-added",
1324 | "bander-resource-removed",
1325 | "bander-thermistor-failure",
1326 | "bander-timing-failure",
1327 | "bander-turned-off",
1328 | "bander-turned-on",
1329 | "bander-under-temperature",
1330 | "bander-unrecoverable-failure",
1331 | "bander-unrecoverable-storage-error",
1332 | "bander-warming-up",
1333 | "binder-added",
1334 | "binder-almost-empty",
1335 | "binder-almost-full",
1336 | "binder-at-limit",
1337 | "binder-closed",
1338 | "binder-configuration-change",
1339 | "binder-cover-closed",
1340 | "binder-cover-open",
1341 | "binder-empty",
1342 | "binder-full",
1343 | "binder-interlock-closed",
1344 | "binder-interlock-open",
1345 | "binder-jam",
1346 | "binder-life-almost-over",
1347 | "binder-life-over",
1348 | "binder-memory-exhausted",
1349 | "binder-missing",
1350 | "binder-motor-failure",
1351 | "binder-near-limit",
1352 | "binder-offline",
1353 | "binder-opened",
1354 | "binder-over-temperature",
1355 | "binder-power-saver",
1356 | "binder-recoverable-failure",
1357 | "binder-recoverable-storage-error",
1358 | "binder-removed",
1359 | "binder-resource-added",
1360 | "binder-resource-removed",
1361 | "binder-thermistor-failure",
1362 | "binder-timing-failure",
1363 | "binder-turned-off",
1364 | "binder-turned-on",
1365 | "binder-under-temperature",
1366 | "binder-unrecoverable-failure",
1367 | "binder-unrecoverable-storage-error",
1368 | "binder-warming-up",
1369 | "cleaner-life-almost-over",
1370 | "cleaner-life-over",
1371 | "configuration-change",
1372 | "connecting-to-device",
1373 | "cover-open",
1374 | "deactivated",
1375 | "developer-empty",
1376 | "developer-low",
1377 | "die-cutter-added",
1378 | "die-cutter-almost-empty",
1379 | "die-cutter-almost-full",
1380 | "die-cutter-at-limit",
1381 | "die-cutter-closed",
1382 | "die-cutter-configuration-change",
1383 | "die-cutter-cover-closed",
1384 | "die-cutter-cover-open",
1385 | "die-cutter-empty",
1386 | "die-cutter-full",
1387 | "die-cutter-interlock-closed",
1388 | "die-cutter-interlock-open",
1389 | "die-cutter-jam",
1390 | "die-cutter-life-almost-over",
1391 | "die-cutter-life-over",
1392 | "die-cutter-memory-exhausted",
1393 | "die-cutter-missing",
1394 | "die-cutter-motor-failure",
1395 | "die-cutter-near-limit",
1396 | "die-cutter-offline",
1397 | "die-cutter-opened",
1398 | "die-cutter-over-temperature",
1399 | "die-cutter-power-saver",
1400 | "die-cutter-recoverable-failure",
1401 | "die-cutter-recoverable-storage-error",
1402 | "die-cutter-removed",
1403 | "die-cutter-resource-added",
1404 | "die-cutter-resource-removed",
1405 | "die-cutter-thermistor-failure",
1406 | "die-cutter-timing-failure",
1407 | "die-cutter-turned-off",
1408 | "die-cutter-turned-on",
1409 | "die-cutter-under-temperature",
1410 | "die-cutter-unrecoverable-failure",
1411 | "die-cutter-unrecoverable-storage-error",
1412 | "die-cutter-warming-up",
1413 | "door-open",
1414 | "folder-added",
1415 | "folder-almost-empty",
1416 | "folder-almost-full",
1417 | "folder-at-limit",
1418 | "folder-closed",
1419 | "folder-configuration-change",
1420 | "folder-cover-closed",
1421 | "folder-cover-open",
1422 | "folder-empty",
1423 | "folder-full",
1424 | "folder-interlock-closed",
1425 | "folder-interlock-open",
1426 | "folder-jam",
1427 | "folder-life-almost-over",
1428 | "folder-life-over",
1429 | "folder-memory-exhausted",
1430 | "folder-missing",
1431 | "folder-motor-failure",
1432 | "folder-near-limit",
1433 | "folder-offline",
1434 | "folder-opened",
1435 | "folder-over-temperature",
1436 | "folder-power-saver",
1437 | "folder-recoverable-failure",
1438 | "folder-recoverable-storage-error",
1439 | "folder-removed",
1440 | "folder-resource-added",
1441 | "folder-resource-removed",
1442 | "folder-thermistor-failure",
1443 | "folder-timing-failure",
1444 | "folder-turned-off",
1445 | "folder-turned-on",
1446 | "folder-under-temperature",
1447 | "folder-unrecoverable-failure",
1448 | "folder-unrecoverable-storage-error",
1449 | "folder-warming-up",
1450 | "fuser-over-temp",
1451 | "fuser-under-temp",
1452 | "imprinter-added",
1453 | "imprinter-almost-empty",
1454 | "imprinter-almost-full",
1455 | "imprinter-at-limit",
1456 | "imprinter-closed",
1457 | "imprinter-configuration-change",
1458 | "imprinter-cover-closed",
1459 | "imprinter-cover-open",
1460 | "imprinter-empty",
1461 | "imprinter-full",
1462 | "imprinter-interlock-closed",
1463 | "imprinter-interlock-open",
1464 | "imprinter-jam",
1465 | "imprinter-life-almost-over",
1466 | "imprinter-life-over",
1467 | "imprinter-memory-exhausted",
1468 | "imprinter-missing",
1469 | "imprinter-motor-failure",
1470 | "imprinter-near-limit",
1471 | "imprinter-offline",
1472 | "imprinter-opened",
1473 | "imprinter-over-temperature",
1474 | "imprinter-power-saver",
1475 | "imprinter-recoverable-failure",
1476 | "imprinter-recoverable-storage-error",
1477 | "imprinter-removed",
1478 | "imprinter-resource-added",
1479 | "imprinter-resource-removed",
1480 | "imprinter-thermistor-failure",
1481 | "imprinter-timing-failure",
1482 | "imprinter-turned-off",
1483 | "imprinter-turned-on",
1484 | "imprinter-under-temperature",
1485 | "imprinter-unrecoverable-failure",
1486 | "imprinter-unrecoverable-storage-error",
1487 | "imprinter-warming-up",
1488 | "input-cannot-feed-size-selected",
1489 | "input-manual-input-request",
1490 | "input-media-color-change",
1491 | "input-media-form-parts-change",
1492 | "input-media-size-change",
1493 | "input-media-type-change",
1494 | "input-media-weight-change",
1495 | "input-tray-elevation-failure",
1496 | "input-tray-missing",
1497 | "input-tray-position-failure",
1498 | "inserter-added",
1499 | "inserter-almost-empty",
1500 | "inserter-almost-full",
1501 | "inserter-at-limit",
1502 | "inserter-closed",
1503 | "inserter-configuration-change",
1504 | "inserter-cover-closed",
1505 | "inserter-cover-open",
1506 | "inserter-empty",
1507 | "inserter-full",
1508 | "inserter-interlock-closed",
1509 | "inserter-interlock-open",
1510 | "inserter-jam",
1511 | "inserter-life-almost-over",
1512 | "inserter-life-over",
1513 | "inserter-memory-exhausted",
1514 | "inserter-missing",
1515 | "inserter-motor-failure",
1516 | "inserter-near-limit",
1517 | "inserter-offline",
1518 | "inserter-opened",
1519 | "inserter-over-temperature",
1520 | "inserter-power-saver",
1521 | "inserter-recoverable-failure",
1522 | "inserter-recoverable-storage-error",
1523 | "inserter-removed",
1524 | "inserter-resource-added",
1525 | "inserter-resource-removed",
1526 | "inserter-thermistor-failure",
1527 | "inserter-timing-failure",
1528 | "inserter-turned-off",
1529 | "inserter-turned-on",
1530 | "inserter-under-temperature",
1531 | "inserter-unrecoverable-failure",
1532 | "inserter-unrecoverable-storage-error",
1533 | "inserter-warming-up",
1534 | "interlock-closed",
1535 | "interlock-open",
1536 | "interpreter-cartridge-added",
1537 | "interpreter-cartridge-deleted",
1538 | "interpreter-complex-page-encountered",
1539 | "interpreter-memory-decrease",
1540 | "interpreter-memory-increase",
1541 | "interpreter-resource-added",
1542 | "interpreter-resource-deleted",
1543 | "interpreter-resource-unavailable",
1544 | "make-envelope-added",
1545 | "make-envelope-almost-empty",
1546 | "make-envelope-almost-full",
1547 | "make-envelope-at-limit",
1548 | "make-envelope-closed",
1549 | "make-envelope-configuration-change",
1550 | "make-envelope-cover-closed",
1551 | "make-envelope-cover-open",
1552 | "make-envelope-empty",
1553 | "make-envelope-full",
1554 | "make-envelope-interlock-closed",
1555 | "make-envelope-interlock-open",
1556 | "make-envelope-jam",
1557 | "make-envelope-life-almost-over",
1558 | "make-envelope-life-over",
1559 | "make-envelope-memory-exhausted",
1560 | "make-envelope-missing",
1561 | "make-envelope-motor-failure",
1562 | "make-envelope-near-limit",
1563 | "make-envelope-offline",
1564 | "make-envelope-opened",
1565 | "make-envelope-over-temperature",
1566 | "make-envelope-power-saver",
1567 | "make-envelope-recoverable-failure",
1568 | "make-envelope-recoverable-storage-error",
1569 | "make-envelope-removed",
1570 | "make-envelope-resource-added",
1571 | "make-envelope-resource-removed",
1572 | "make-envelope-thermistor-failure",
1573 | "make-envelope-timing-failure",
1574 | "make-envelope-turned-off",
1575 | "make-envelope-turned-on",
1576 | "make-envelope-under-temperature",
1577 | "make-envelope-unrecoverable-failure",
1578 | "make-envelope-unrecoverable-storage-error",
1579 | "make-envelope-warming-up",
1580 | "marker-adjusting-print-quality",
1581 | "marker-developer-almost-empty",
1582 | "marker-developer-empty",
1583 | "marker-fuser-thermistor-failure",
1584 | "marker-fuser-timing-failure",
1585 | "marker-ink-almost-empty",
1586 | "marker-ink-empty",
1587 | "marker-print-ribbon-almost-empty",
1588 | "marker-print-ribbon-empty",
1589 | "marker-supply-empty",
1590 | "marker-supply-low",
1591 | "marker-toner-cartridge-missing",
1592 | "marker-waste-almost-full",
1593 | "marker-waste-full",
1594 | "marker-waste-ink-receptacle-almost-full",
1595 | "marker-waste-ink-receptacle-full",
1596 | "marker-waste-toner-receptacle-almost-full",
1597 | "marker-waste-toner-receptacle-full",
1598 | "media-empty",
1599 | "media-jam",
1600 | "media-low",
1601 | "media-needed",
1602 | "media-path-cannot-duplex-media-selected",
1603 | "media-path-media-tray-almost-full",
1604 | "media-path-media-tray-full",
1605 | "media-path-media-tray-missing",
1606 | "moving-to-paused",
1607 | "none",
1608 | "opc-life-over",
1609 | "opc-near-eol",
1610 | "other",
1611 | "output-area-almost-full",
1612 | "output-area-full",
1613 | "output-mailbox-select-failure",
1614 | "output-tray-missing",
1615 | "paused",
1616 | "perforater-added",
1617 | "perforater-almost-empty",
1618 | "perforater-almost-full",
1619 | "perforater-at-limit",
1620 | "perforater-closed",
1621 | "perforater-configuration-change",
1622 | "perforater-cover-closed",
1623 | "perforater-cover-open",
1624 | "perforater-empty",
1625 | "perforater-full",
1626 | "perforater-interlock-closed",
1627 | "perforater-interlock-open",
1628 | "perforater-jam",
1629 | "perforater-life-almost-over",
1630 | "perforater-life-over",
1631 | "perforater-memory-exhausted",
1632 | "perforater-missing",
1633 | "perforater-motor-failure",
1634 | "perforater-near-limit",
1635 | "perforater-offline",
1636 | "perforater-opened",
1637 | "perforater-over-temperature",
1638 | "perforater-power-saver",
1639 | "perforater-recoverable-failure",
1640 | "perforater-recoverable-storage-error",
1641 | "perforater-removed",
1642 | "perforater-resource-added",
1643 | "perforater-resource-removed",
1644 | "perforater-thermistor-failure",
1645 | "perforater-timing-failure",
1646 | "perforater-turned-off",
1647 | "perforater-turned-on",
1648 | "perforater-under-temperature",
1649 | "perforater-unrecoverable-failure",
1650 | "perforater-unrecoverable-storage-error",
1651 | "perforater-warming-up",
1652 | "power-down",
1653 | "power-up",
1654 | "printer-manual-reset",
1655 | "printer-nms-reset",
1656 | "printer-ready-to-print",
1657 | "puncher-added",
1658 | "puncher-almost-empty",
1659 | "puncher-almost-full",
1660 | "puncher-at-limit",
1661 | "puncher-closed",
1662 | "puncher-configuration-change",
1663 | "puncher-cover-closed",
1664 | "puncher-cover-open",
1665 | "puncher-empty",
1666 | "puncher-full",
1667 | "puncher-interlock-closed",
1668 | "puncher-interlock-open",
1669 | "puncher-jam",
1670 | "puncher-life-almost-over",
1671 | "puncher-life-over",
1672 | "puncher-memory-exhausted",
1673 | "puncher-missing",
1674 | "puncher-motor-failure",
1675 | "puncher-near-limit",
1676 | "puncher-offline",
1677 | "puncher-opened",
1678 | "puncher-over-temperature",
1679 | "puncher-power-saver",
1680 | "puncher-recoverable-failure",
1681 | "puncher-recoverable-storage-error",
1682 | "puncher-removed",
1683 | "puncher-resource-added",
1684 | "puncher-resource-removed",
1685 | "puncher-thermistor-failure",
1686 | "puncher-timing-failure",
1687 | "puncher-turned-off",
1688 | "puncher-turned-on",
1689 | "puncher-under-temperature",
1690 | "puncher-unrecoverable-failure",
1691 | "puncher-unrecoverable-storage-error",
1692 | "puncher-warming-up",
1693 | "separation-cutter-added",
1694 | "separation-cutter-almost-empty",
1695 | "separation-cutter-almost-full",
1696 | "separation-cutter-at-limit",
1697 | "separation-cutter-closed",
1698 | "separation-cutter-configuration-change",
1699 | "separation-cutter-cover-closed",
1700 | "separation-cutter-cover-open",
1701 | "separation-cutter-empty",
1702 | "separation-cutter-full",
1703 | "separation-cutter-interlock-closed",
1704 | "separation-cutter-interlock-open",
1705 | "separation-cutter-jam",
1706 | "separation-cutter-life-almost-over",
1707 | "separation-cutter-life-over",
1708 | "separation-cutter-memory-exhausted",
1709 | "separation-cutter-missing",
1710 | "separation-cutter-motor-failure",
1711 | "separation-cutter-near-limit",
1712 | "separation-cutter-offline",
1713 | "separation-cutter-opened",
1714 | "separation-cutter-over-temperature",
1715 | "separation-cutter-power-saver",
1716 | "separation-cutter-recoverable-failure",
1717 | "separation-cutter-recoverable-storage-error",
1718 | "separation-cutter-removed",
1719 | "separation-cutter-resource-added",
1720 | "separation-cutter-resource-removed",
1721 | "separation-cutter-thermistor-failure",
1722 | "separation-cutter-timing-failure",
1723 | "separation-cutter-turned-off",
1724 | "separation-cutter-turned-on",
1725 | "separation-cutter-under-temperature",
1726 | "separation-cutter-unrecoverable-failure",
1727 | "separation-cutter-unrecoverable-storage-error",
1728 | "separation-cutter-warming-up",
1729 | "sheet-rotator-added",
1730 | "sheet-rotator-almost-empty",
1731 | "sheet-rotator-almost-full",
1732 | "sheet-rotator-at-limit",
1733 | "sheet-rotator-closed",
1734 | "sheet-rotator-configuration-change",
1735 | "sheet-rotator-cover-closed",
1736 | "sheet-rotator-cover-open",
1737 | "sheet-rotator-empty",
1738 | "sheet-rotator-full",
1739 | "sheet-rotator-interlock-closed",
1740 | "sheet-rotator-interlock-open",
1741 | "sheet-rotator-jam",
1742 | "sheet-rotator-life-almost-over",
1743 | "sheet-rotator-life-over",
1744 | "sheet-rotator-memory-exhausted",
1745 | "sheet-rotator-missing",
1746 | "sheet-rotator-motor-failure",
1747 | "sheet-rotator-near-limit",
1748 | "sheet-rotator-offline",
1749 | "sheet-rotator-opened",
1750 | "sheet-rotator-over-temperature",
1751 | "sheet-rotator-power-saver",
1752 | "sheet-rotator-recoverable-failure",
1753 | "sheet-rotator-recoverable-storage-error",
1754 | "sheet-rotator-removed",
1755 | "sheet-rotator-resource-added",
1756 | "sheet-rotator-resource-removed",
1757 | "sheet-rotator-thermistor-failure",
1758 | "sheet-rotator-timing-failure",
1759 | "sheet-rotator-turned-off",
1760 | "sheet-rotator-turned-on",
1761 | "sheet-rotator-under-temperature",
1762 | "sheet-rotator-unrecoverable-failure",
1763 | "sheet-rotator-unrecoverable-storage-error",
1764 | "sheet-rotator-warming-up",
1765 | "shutdown",
1766 | "slitter-added",
1767 | "slitter-almost-empty",
1768 | "slitter-almost-full",
1769 | "slitter-at-limit",
1770 | "slitter-closed",
1771 | "slitter-configuration-change",
1772 | "slitter-cover-closed",
1773 | "slitter-cover-open",
1774 | "slitter-empty",
1775 | "slitter-full",
1776 | "slitter-interlock-closed",
1777 | "slitter-interlock-open",
1778 | "slitter-jam",
1779 | "slitter-life-almost-over",
1780 | "slitter-life-over",
1781 | "slitter-memory-exhausted",
1782 | "slitter-missing",
1783 | "slitter-motor-failure",
1784 | "slitter-near-limit",
1785 | "slitter-offline",
1786 | "slitter-opened",
1787 | "slitter-over-temperature",
1788 | "slitter-power-saver",
1789 | "slitter-recoverable-failure",
1790 | "slitter-recoverable-storage-error",
1791 | "slitter-removed",
1792 | "slitter-resource-added",
1793 | "slitter-resource-removed",
1794 | "slitter-thermistor-failure",
1795 | "slitter-timing-failure",
1796 | "slitter-turned-off",
1797 | "slitter-turned-on",
1798 | "slitter-under-temperature",
1799 | "slitter-unrecoverable-failure",
1800 | "slitter-unrecoverable-storage-error",
1801 | "slitter-warming-up",
1802 | "spool-area-full",
1803 | "stacker-added",
1804 | "stacker-almost-empty",
1805 | "stacker-almost-full",
1806 | "stacker-at-limit",
1807 | "stacker-closed",
1808 | "stacker-configuration-change",
1809 | "stacker-cover-closed",
1810 | "stacker-cover-open",
1811 | "stacker-empty",
1812 | "stacker-full",
1813 | "stacker-interlock-closed",
1814 | "stacker-interlock-open",
1815 | "stacker-jam",
1816 | "stacker-life-almost-over",
1817 | "stacker-life-over",
1818 | "stacker-memory-exhausted",
1819 | "stacker-missing",
1820 | "stacker-motor-failure",
1821 | "stacker-near-limit",
1822 | "stacker-offline",
1823 | "stacker-opened",
1824 | "stacker-over-temperature",
1825 | "stacker-power-saver",
1826 | "stacker-recoverable-failure",
1827 | "stacker-recoverable-storage-error",
1828 | "stacker-removed",
1829 | "stacker-resource-added",
1830 | "stacker-resource-removed",
1831 | "stacker-thermistor-failure",
1832 | "stacker-timing-failure",
1833 | "stacker-turned-off",
1834 | "stacker-turned-on",
1835 | "stacker-under-temperature",
1836 | "stacker-unrecoverable-failure",
1837 | "stacker-unrecoverable-storage-error",
1838 | "stacker-warming-up",
1839 | "stapler-added",
1840 | "stapler-almost-empty",
1841 | "stapler-almost-full",
1842 | "stapler-at-limit",
1843 | "stapler-closed",
1844 | "stapler-configuration-change",
1845 | "stapler-cover-closed",
1846 | "stapler-cover-open",
1847 | "stapler-empty",
1848 | "stapler-full",
1849 | "stapler-interlock-closed",
1850 | "stapler-interlock-open",
1851 | "stapler-jam",
1852 | "stapler-life-almost-over",
1853 | "stapler-life-over",
1854 | "stapler-memory-exhausted",
1855 | "stapler-missing",
1856 | "stapler-motor-failure",
1857 | "stapler-near-limit",
1858 | "stapler-offline",
1859 | "stapler-opened",
1860 | "stapler-over-temperature",
1861 | "stapler-power-saver",
1862 | "stapler-recoverable-failure",
1863 | "stapler-recoverable-storage-error",
1864 | "stapler-removed",
1865 | "stapler-resource-added",
1866 | "stapler-resource-removed",
1867 | "stapler-thermistor-failure",
1868 | "stapler-timing-failure",
1869 | "stapler-turned-off",
1870 | "stapler-turned-on",
1871 | "stapler-under-temperature",
1872 | "stapler-unrecoverable-failure",
1873 | "stapler-unrecoverable-storage-error",
1874 | "stapler-warming-up",
1875 | "stitcher-added",
1876 | "stitcher-almost-empty",
1877 | "stitcher-almost-full",
1878 | "stitcher-at-limit",
1879 | "stitcher-closed",
1880 | "stitcher-configuration-change",
1881 | "stitcher-cover-closed",
1882 | "stitcher-cover-open",
1883 | "stitcher-empty",
1884 | "stitcher-full",
1885 | "stitcher-interlock-closed",
1886 | "stitcher-interlock-open",
1887 | "stitcher-jam",
1888 | "stitcher-life-almost-over",
1889 | "stitcher-life-over",
1890 | "stitcher-memory-exhausted",
1891 | "stitcher-missing",
1892 | "stitcher-motor-failure",
1893 | "stitcher-near-limit",
1894 | "stitcher-offline",
1895 | "stitcher-opened",
1896 | "stitcher-over-temperature",
1897 | "stitcher-power-saver",
1898 | "stitcher-recoverable-failure",
1899 | "stitcher-recoverable-storage-error",
1900 | "stitcher-removed",
1901 | "stitcher-resource-added",
1902 | "stitcher-resource-removed",
1903 | "stitcher-thermistor-failure",
1904 | "stitcher-timing-failure",
1905 | "stitcher-turned-off",
1906 | "stitcher-turned-on",
1907 | "stitcher-under-temperature",
1908 | "stitcher-unrecoverable-failure",
1909 | "stitcher-unrecoverable-storage-error",
1910 | "stitcher-warming-up",
1911 | "stopped-partly",
1912 | "stopping",
1913 | "subunit-added",
1914 | "subunit-almost-empty",
1915 | "subunit-almost-full",
1916 | "subunit-at-limit",
1917 | "subunit-closed",
1918 | "subunit-empty",
1919 | "subunit-full",
1920 | "subunit-life-almost-over",
1921 | "subunit-life-over",
1922 | "subunit-memory-exhausted",
1923 | "subunit-missing",
1924 | "subunit-motor-failure",
1925 | "subunit-near-limit",
1926 | "subunit-offline",
1927 | "subunit-opened",
1928 | "subunit-over-temperature",
1929 | "subunit-power-saver",
1930 | "subunit-recoverable-failure",
1931 | "subunit-recoverable-storage-error",
1932 | "subunit-removed",
1933 | "subunit-resource-added",
1934 | "subunit-resource-removed",
1935 | "subunit-thermistor-failure",
1936 | "subunit-timing-Failure",
1937 | "subunit-turned-off",
1938 | "subunit-turned-on",
1939 | "subunit-under-temperature",
1940 | "subunit-unrecoverable-failure",
1941 | "subunit-unrecoverable-storage-error",
1942 | "subunit-warming-up",
1943 | "timed-out",
1944 | "toner-empty",
1945 | "toner-low",
1946 | "trimmer-added",
1947 | "trimmer-added",
1948 | "trimmer-almost-empty",
1949 | "trimmer-almost-empty",
1950 | "trimmer-almost-full",
1951 | "trimmer-almost-full",
1952 | "trimmer-at-limit",
1953 | "trimmer-at-limit",
1954 | "trimmer-closed",
1955 | "trimmer-closed",
1956 | "trimmer-configuration-change",
1957 | "trimmer-configuration-change",
1958 | "trimmer-cover-closed",
1959 | "trimmer-cover-closed",
1960 | "trimmer-cover-open",
1961 | "trimmer-cover-open",
1962 | "trimmer-empty",
1963 | "trimmer-empty",
1964 | "trimmer-full",
1965 | "trimmer-full",
1966 | "trimmer-interlock-closed",
1967 | "trimmer-interlock-closed",
1968 | "trimmer-interlock-open",
1969 | "trimmer-interlock-open",
1970 | "trimmer-jam",
1971 | "trimmer-jam",
1972 | "trimmer-life-almost-over",
1973 | "trimmer-life-almost-over",
1974 | "trimmer-life-over",
1975 | "trimmer-life-over",
1976 | "trimmer-memory-exhausted",
1977 | "trimmer-memory-exhausted",
1978 | "trimmer-missing",
1979 | "trimmer-missing",
1980 | "trimmer-motor-failure",
1981 | "trimmer-motor-failure",
1982 | "trimmer-near-limit",
1983 | "trimmer-near-limit",
1984 | "trimmer-offline",
1985 | "trimmer-offline",
1986 | "trimmer-opened",
1987 | "trimmer-opened",
1988 | "trimmer-over-temperature",
1989 | "trimmer-over-temperature",
1990 | "trimmer-power-saver",
1991 | "trimmer-power-saver",
1992 | "trimmer-recoverable-failure",
1993 | "trimmer-recoverable-failure",
1994 | "trimmer-recoverable-storage-error",
1995 | "trimmer-removed",
1996 | "trimmer-resource-added",
1997 | "trimmer-resource-removed",
1998 | "trimmer-thermistor-failure",
1999 | "trimmer-timing-failure",
2000 | "trimmer-turned-off",
2001 | "trimmer-turned-on",
2002 | "trimmer-under-temperature",
2003 | "trimmer-unrecoverable-failure",
2004 | "trimmer-unrecoverable-storage-error",
2005 | "trimmer-warming-up",
2006 | "unknown",
2007 | "wrapper-added",
2008 | "wrapper-almost-empty",
2009 | "wrapper-almost-full",
2010 | "wrapper-at-limit",
2011 | "wrapper-closed",
2012 | "wrapper-configuration-change",
2013 | "wrapper-cover-closed",
2014 | "wrapper-cover-open",
2015 | "wrapper-empty",
2016 | "wrapper-full",
2017 | "wrapper-interlock-closed",
2018 | "wrapper-interlock-open",
2019 | "wrapper-jam",
2020 | "wrapper-life-almost-over",
2021 | "wrapper-life-over",
2022 | "wrapper-memory-exhausted",
2023 | "wrapper-missing",
2024 | "wrapper-motor-failure",
2025 | "wrapper-near-limit",
2026 | "wrapper-offline",
2027 | "wrapper-opened",
2028 | "wrapper-over-temperature",
2029 | "wrapper-power-saver",
2030 | "wrapper-recoverable-failure",
2031 | "wrapper-recoverable-storage-error",
2032 | "wrapper-removed",
2033 | "wrapper-resource-added",
2034 | "wrapper-resource-removed",
2035 | "wrapper-thermistor-failure",
2036 | "wrapper-timing-failure",
2037 | "wrapper-turned-off",
2038 | "wrapper-turned-on",
2039 | "wrapper-under-temperature",
2040 | "wrapper-unrecoverable-failure",
2041 | "wrapper-unrecoverable-storage-error",
2042 | "wrapper-warming-up"
2043 | ]);
2044 | keywords["proof-print-supported"] = setof_keyword([
2045 | "media",
2046 | "media-col",
2047 | "proof-print-copies"
2048 | ]);
2049 | keywords["pwg-raster-document-sheet-back"] = keyword([
2050 | "flipped",
2051 | "manual-tumble",
2052 | "normal",
2053 | "rotated"
2054 | ]);
2055 | keywords["pwg-raster-document-type-supported"] = setof_keyword([
2056 | "adobe-rgb_8",
2057 | "adobe-rgb_16",
2058 | "black_1",
2059 | "black_8",
2060 | "black_16",
2061 | "cmyk_8",
2062 | "cmyk_16",
2063 | "device1_8",
2064 | "device1_16",
2065 | "device2_8",
2066 | "device2_16",
2067 | "device3_8",
2068 | "device3_16",
2069 | "device4_8",
2070 | "device4_16",
2071 | "device5_8",
2072 | "device5_16",
2073 | "device6_8",
2074 | "device6_16",
2075 | "device7_8",
2076 | "device7_16",
2077 | "device8_8",
2078 | "device8_16",
2079 | "device9_8",
2080 | "device9_16",
2081 | "device10_8",
2082 | "device10_16",
2083 | "device11_8",
2084 | "device11_16",
2085 | "device12_8",
2086 | "device12_16",
2087 | "device13_8",
2088 | "device13_16",
2089 | "device14_8",
2090 | "device14_16",
2091 | "device15_8",
2092 | "device15_16",
2093 | "rgb_8",
2094 | "rgb_16",
2095 | "sgray_1",
2096 | "sgray_8",
2097 | "sgray_16",
2098 | "srgb_8",
2099 | "srgb_16"
2100 | ]);
2101 | keywords["requested-attributes"] = keyword([
2102 | "all",
2103 | "document-description",
2104 | "document-template",
2105 | "job-description",
2106 | "job-template",
2107 | "printer-description",
2108 | "subscription-description",
2109 | "subscription-template"
2110 | ]);
2111 | keywords["save-disposition"] = keyword([
2112 | "none",
2113 | "print-save",
2114 | "save-only"
2115 | ]);
2116 | keywords["save-disposition-supported"] = setof_keyword(
2117 | keywords["save-disposition"]
2118 | );
2119 | keywords["save-info-supported"] = setof_keyword([
2120 | "save-document-format",
2121 | "save-location",
2122 | "save-name"
2123 | ]);
2124 | keywords["separator-sheets-type"] = keyword_name([
2125 | "both-sheets",
2126 | "end-sheet",
2127 | "none",
2128 | "slip-sheets",
2129 | "start-sheet"
2130 | ]);
2131 | keywords["separator-sheets-type-supported"] = setof_keyword_name(
2132 | keywords["separator-sheets-type"]
2133 | );
2134 | keywords["sheet-collate"] = keyword([
2135 | "collated",
2136 | "uncollated"
2137 | ]);
2138 | keywords["sheet-collate-default"] = keyword(
2139 | keywords["sheet-collate"]
2140 | );
2141 | keywords["sheet-collate-supported"] = setof_keyword(
2142 | keywords["sheet-collate"]
2143 | );
2144 | keywords["sides"] = keyword([
2145 | "one-sided",
2146 | "two-sided-long-edge",
2147 | "two-sided-short-edge"
2148 | ]);
2149 | keywords["sides-default"] = keyword(
2150 | keywords["sides"]
2151 | );
2152 | keywords["sides-supported"] = setof_keyword(
2153 | keywords["sides"]
2154 | );
2155 | keywords["stitching-reference-edge"] = keyword([
2156 | "bottom",
2157 | "left",
2158 | "right",
2159 | "top"
2160 | ]);
2161 | keywords["stitching-reference-edge-supported"] = setof_keyword(
2162 | keywords["stitching-reference-edge"]
2163 | );
2164 | keywords["stitching-supported"] = setof_keyword([
2165 | "stitching-locations",
2166 | "stitching-offset",
2167 | "stitching-reference-edge"
2168 | ]);
2169 | keywords["uri-authentication-supported"] = setof_keyword([
2170 | "basic",
2171 | "certificate",
2172 | "digest",
2173 | "negotiate",
2174 | "none",
2175 | "requesting-user-name"
2176 | ]);
2177 | keywords["uri-security-supported"] = setof_keyword([
2178 | "none",
2179 | "ssl3",
2180 | "tls"
2181 | ]);
2182 | keywords["which-jobs"] = keyword([
2183 | "aborted",
2184 | "all",
2185 | "canceled",
2186 | "completed",
2187 | "not-completed",
2188 | "pending",
2189 | "pending-held",
2190 | "processing",
2191 | "processing-stopped",
2192 | "proof-print",
2193 | "saved"
2194 | ]);
2195 | keywords["which-jobs-supported"] = setof_keyword(
2196 | keywords["which-jobs"]
2197 | );
2198 | keywords["x-image-position"] = keyword([
2199 | "center",
2200 | "left",
2201 | "none",
2202 | "right"
2203 | ]);
2204 | keywords["x-image-position-default"] = keyword(
2205 | keywords["x-image-position"]
2206 | );
2207 | keywords["x-image-position-supported"] = setof_keyword(
2208 | keywords["x-image-position"]
2209 | );
2210 | keywords["xri-authentication-supported"] = setof_keyword([
2211 | "basic",
2212 | "certificate",
2213 | "digest",
2214 | "none",
2215 | "requesting-user-name"
2216 | ]);
2217 | keywords["xri-security-supported"] = setof_keyword([
2218 | "none",
2219 | "ssl3",
2220 | "tls"
2221 | ]);
2222 | keywords["y-image-position"] = keyword([
2223 | "bottom",
2224 | "center",
2225 | "none",
2226 | "top"
2227 | ]);
2228 | keywords["y-image-position-default"] = keyword(
2229 | keywords["y-image-position"]
2230 | );
2231 | keywords["y-image-position-supported"] = setof_keyword(
2232 | keywords["y-image-position"]
2233 | );
2234 |
2235 | module.exports = keywords;
--------------------------------------------------------------------------------
/lib/message.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | var tag = require('./tags');
4 |
5 |
6 | function msg(host, operation, id){
7 | var buf = new Buffer(1024);
8 | var position = 0;
9 | function write1(val){
10 | buf.writeUInt8(val, position);
11 | position+=1;
12 | }
13 | function write2(val){
14 | buf.writeUInt16BE(val, position);
15 | position+=2;
16 | }
17 | function write4(val){
18 | buf.writeUInt32BE(val, position);
19 | position+=4;
20 | }
21 | function write(str){
22 | var length = Buffer.byteLength(str);
23 | write2(length);
24 | buf.write(str, position, length);
25 | position+=length;
26 | }
27 | function attr(tag, name, values){
28 | write1(tag);
29 | write(name);
30 | for(var i=0;i= 0x0F) {// delimiters are between 0x00 to 0x0F
48 | readAttr(group);
49 | }
50 | }
51 | function readAttr(group){
52 | var tag = read1();
53 | //TODO: find a test for this
54 | if (tag === 0x7F){//tags.extension
55 | tag = read4();
56 | }
57 | var name = read(read2());
58 | group[name] = readValues(tag, name)
59 | }
60 | function hasAdditionalValue(){
61 | var current = buf[position];
62 | return current !== 0x4A //tags.memberAttrName
63 | && current !== 0x37 //tags.endCollection
64 | && current !== 0x03 //tags.end-of-attributes-tag
65 | && buf[position+1] === 0x00 && buf[position+2] === 0x00;
66 | }
67 | function readValues(type, name){
68 | var value = readValue(type, name);
69 | if(hasAdditionalValue()){
70 | value = [value];
71 | do{
72 | type = read1();
73 | read2();//empty name
74 | value.push(readValue(type, name));
75 | }
76 | while(hasAdditionalValue())
77 | }
78 | return value;
79 | }
80 | function readValue(tag, name){
81 | var length = read2();
82 | //http://tools.ietf.org/html/rfc2910#section-3.9
83 | switch (tag) {
84 | case tags.enum:
85 | var val = read4();
86 | return (enums[name] && enums[name].lookup[val]) || val;
87 | case tags.integer:
88 | return read4();
89 |
90 | case tags.boolean:
91 | return !!read1();
92 |
93 | case tags.rangeOfInteger:
94 | return [read4(), read4()];
95 |
96 | case tags.resolution:
97 | return [read4(), read4(), read1()===0x03? 'dpi':'dpcm'];
98 |
99 | case tags.dateTime:
100 | // http://tools.ietf.org/html/rfc1903 page 17
101 | var date = new Date(read2(), read1(), read1(), read1(), read1(), read1(), read1());
102 | //silly way to add on the timezone
103 | return new Date(date.toISOString().substr(0,23).replace('T',',') +','+ String.fromCharCode(read(1)) + read(1) + ':' + read(1));
104 |
105 | case tags.textWithLanguage:
106 | case tags.nameWithLanguage:
107 | var lang = read(read2());
108 | var subval = read(read2());
109 | return lang+RS+subval;
110 |
111 | case tags.nameWithoutLanguage:
112 | case tags.textWithoutLanguage:
113 | case tags.octetString:
114 | case tags.memberAttrName:
115 | return read(length);
116 |
117 | case tags.keyword:
118 | case tags.uri:
119 | case tags.uriScheme:
120 | case tags.charset:
121 | case tags.naturalLanguage:
122 | case tags.mimeMediaType:
123 | return read(length, 'ascii');
124 |
125 | case tags.begCollection:
126 | //the spec says a value could be present- but can be ignored
127 | read(length);
128 | return readCollection();
129 |
130 | case tags['no-value']:
131 | default:
132 | debugger;
133 | return module.exports.handleUnknownTag(tag, name, length, read)
134 | }
135 | }
136 | function readCollection(){
137 | var tag;
138 | var collection = {};
139 |
140 | while((tag = read1()) !== 0x37){//tags.endCollection
141 | if(tag !== 0x4A){
142 | console.log("unexpected:", tags.lookup[tag]);
143 | return;
144 | }
145 | //read nametag name and discard it
146 | read(read2());
147 | var name = readValue(0x4A);
148 | var values = readCollectionItemValue();
149 | collection[name] = values;
150 | }
151 | //Read endCollection name & value and discard it.
152 | //The spec says that they MAY have contents in the
153 | // future- so we can't assume they are empty.
154 | read(read2());
155 | read(read2());
156 |
157 | return collection;
158 | }
159 | function readCollectionItemValue(name){
160 | var tag = read1();
161 | //TODO: find a test for this
162 | if (tag === 0x7F){//tags.extension
163 | tag = read4();
164 | }
165 | //read valuetag name and discard it
166 | read(read2());
167 |
168 | return readValues(tag, name);
169 | }
170 |
171 | obj.version = read1() + '.' + read1();
172 | var bytes2and3 = read2();
173 | //byte[2] and byte[3] are used to define the 'operation' on
174 | //requests, but used to hold the statusCode on responses. We
175 | //can almost detect if it is a req or a res- but sadly, six
176 | //values overlap. In these cases, the parser will give both and
177 | //the consumer can ignore (or delete) whichever they don't want.
178 | if(bytes2and3 >= 0x02 || bytes2and3 <= 0x3D)
179 | obj.operation = operations.lookup[bytes2and3];
180 |
181 | if(bytes2and3 <= 0x0007 || bytes2and3 >= 0x0400)
182 | obj.statusCode = statusCodes.lookup[bytes2and3];
183 | obj.id = read4();
184 | readGroups();
185 |
186 | if(position buf.length){
48 | buf = Buffer.concat([buf], 2 * buf.length);
49 | }
50 | }
51 | var special = {'attributes-charset':1, 'attributes-natural-language':2};
52 | var groupmap = {
53 | "job-attributes-tag": ['Job Template', 'Job Description'],
54 | 'operation-attributes-tag': 'Operation',
55 | 'printer-attributes-tag': 'Printer Description',
56 | "unsupported-attributes-tag": '',//??
57 | "subscription-attributes-tag": 'Subscription Description',
58 | "event-notification-attributes-tag": 'Event Notifications',
59 | "resource-attributes-tag": '',//??
60 | "document-attributes-tag": 'Document Description'
61 | };
62 | function writeGroup(tag){
63 | var attrs = msg[tag];
64 | if(!attrs) return;
65 | var keys = Object.keys(attrs);
66 | //'attributes-charset' and 'attributes-natural-language' need to come first- so we sort them to the front
67 | if(tag==tags['operation-attributes-tag'])
68 | keys = keys.sort(function(a,b){ return (special[a]||3)-(special[b]||3); });
69 | var groupname = groupmap[tag];
70 | write1(tags[tag]);
71 | keys.forEach(function(name){
72 | attr(groupname, name, attrs);
73 | });
74 | }
75 | function attr(group, name, obj){
76 | var groupName = Array.isArray(group)
77 | ? group.find( function (grp) { return attributes[grp][name] })
78 | : group;
79 | if(!groupName) throw "Unknown attribute: " + name;
80 |
81 | var syntax = attributes[groupName][name];
82 |
83 | if(!syntax) throw "Unknown attribute: " + name;
84 |
85 | var value = obj[name];
86 | if(!Array.isArray(value))
87 | value = [value];
88 |
89 | value.forEach(function(value, i){
90 | //we need to re-evaluate the alternates every time
91 | var syntax2 = Array.isArray(syntax)? resolveAlternates(syntax, name, value) : syntax;
92 | var tag = getTag(syntax2, name, value);
93 | if(tag===tags.enum)
94 | value = enums[name][value];
95 |
96 | write1(tag);
97 | if(i==0){
98 | write(name);
99 | }
100 | else {
101 | write2(0x0000);//empty name
102 | }
103 |
104 | writeValue(tag, value, syntax2.members);
105 | });
106 | }
107 | function getTag(syntax, name, value){
108 | var tag = syntax.tag;
109 | if(!tag){
110 | var hasRS = !!~value.indexOf(RS);
111 | tag = tags[syntax.type+(hasRS?'With':'Without')+'Language'];
112 | }
113 | return tag;
114 | }
115 | function resolveAlternates(array, name, value){
116 | switch(array.alts){
117 | case 'keyword,name':
118 | case 'keyword,name,novalue':
119 | if(value===null && array.lookup['novalue']) return array.lookup['novalue'];
120 | return ~keywords[name].indexOf(value)? array.lookup.keyword : array.lookup.name;
121 | case 'integer,rangeOfInteger':
122 | return Array.isArray(value)? array.lookup.rangeOfInteger : array.lookup.integer;
123 | case 'dateTime,novalue':
124 | return !IsNaN(date.parse(value))? array.lookup.dateTime : array.lookup['novalue'];
125 | case 'integer,novalue':
126 | return !IsNaN(value)? array.lookup.integer : array.lookup['novalue'];
127 | case 'name,novalue':
128 | return value!==null? array.lookup.name : array.lookup['novalue'];
129 | case 'novalue,uri':
130 | return value!==null? array.lookup.uri : array.lookup['novalue'];
131 | case 'enumeration,unknown':
132 | return enums[name][value]? array.lookup['enumeration'] : array.lookup.unknown;
133 | case 'enumeration,novalue':
134 | return value!==null? array.lookup['enumeration'] : array.lookup['novalue'];
135 | case 'collection,novalue':
136 | return value!==null? array.lookup['enumeration'] : array.lookup['novalue'];
137 | default:
138 | throw "Unknown atlernates";
139 | }
140 | }
141 | function writeValue(tag, value, submembers){
142 | switch(tag){
143 | case tags.enum:
144 | write2(0x0004);
145 | return write4(value);
146 | case tags.integer:
147 | write2(0x0004);
148 | return write4(value);
149 |
150 | case tags.boolean:
151 | write2(0x0001);
152 | return write1(Number(value));
153 |
154 | case tags.rangeOfInteger:
155 | write2(0x0008);
156 | write4(value.min);
157 | write4(value.max);
158 | return;
159 |
160 | case tags.resolution:
161 | write2(0x0009);
162 | write4(value[0]);
163 | write4(value[1]);
164 | write1(value[2]==='dpi'? 0x03 : 0x04);
165 | return;
166 |
167 | case tags.dateTime:
168 | write2(0x000B);
169 | write2(value.getFullYear());
170 | write1(value.getMonth() + 1);
171 | write1(value.getDate());
172 | write1(value.getHours());
173 | write1(value.getMinutes());
174 | write1(value.getSeconds());
175 | write1(Math.floor(value.getMilliseconds() / 100));
176 | var tz = timezone(value);
177 | writeStr(tz[0]);// + or -
178 | write1(tz[1]);//hours
179 | write1(tz[2]);//minutes
180 | return;
181 |
182 | case tags.textWithLanguage:
183 | case tags.nameWithLanguage:
184 | write2(parts[0].length);
185 | write2(parts[0]);
186 | write2(parts[1].length);
187 | write2(parts[1]);
188 | return;
189 |
190 | case tags.nameWithoutLanguage:
191 | case tags.textWithoutLanguage:
192 | case tags.octetString:
193 | case tags.memberAttrName:
194 | return write(value);
195 |
196 | case tags.keyword:
197 | case tags.uri:
198 | case tags.uriScheme:
199 | case tags.charset:
200 | case tags.naturalLanguage:
201 | case tags.mimeMediaType:
202 | return write(value, 'ascii');
203 |
204 | case tags.begCollection:
205 | write2(0);//empty value
206 | return writeCollection(value, submembers);
207 |
208 | case tags["no-value"]:
209 | //empty value? I can't find where this is defined in any spec.
210 | return write2(0);
211 |
212 | default:
213 | debugger;
214 | console.error(tag, "not handled");
215 | }
216 | }
217 | function writeCollection(value, members){
218 | Object.keys(value).forEach(function(key){
219 | var subvalue = value[key];
220 | var subsyntax = members[key];
221 |
222 | if(Array.isArray(subsyntax))
223 | subsyntax = resolveAlternates(subsyntax, key, subvalue);
224 |
225 | var tag = getTag(subsyntax, key, subvalue);
226 | if(tag===tags.enum)
227 | subvalue = enums[key][subvalue];
228 |
229 | write1(tags.memberAttrName)
230 | write2(0)//empty name
231 | writeValue(tags.memberAttrName, key);
232 | write1(tag)
233 | write2(0)//empty name
234 | writeValue(tag, subvalue, subsyntax.members);
235 | });
236 | write1(tags.endCollection)
237 | write2(0)//empty name
238 | write2(0)//empty value
239 | }
240 |
241 | write2(versions[msg.version||'2.0']);
242 | write2(msg.operation? operations[msg.operation] : statusCodes[msg.statusCode]);
243 | write4(msg.id||random());//request-id
244 |
245 | writeGroup('operation-attributes-tag');
246 | writeGroup('job-attributes-tag');
247 | writeGroup('printer-attributes-tag');
248 | writeGroup('document-attributes-tag');
249 | //TODO... add the others
250 |
251 | write1(0x03);//end
252 |
253 |
254 | if(!msg.data)
255 | return buf.slice(0, position);
256 |
257 | if(!Buffer.isBuffer(msg.data))
258 | throw "data must be a Buffer"
259 |
260 | var buf2 = new Buffer(position + msg.data.length);
261 | buf.copy(buf2, 0, 0, position);
262 | msg.data.copy(buf2, position, 0);
263 | return buf2;
264 | };
265 | function timezone(d) {
266 | var z = d.getTimezoneOffset();
267 | return [
268 | z > 0 ? "-" : "+",
269 | ~~(Math.abs(z) / 60),
270 | Math.abs(z) % 60
271 | ];
272 | }
273 |
--------------------------------------------------------------------------------
/lib/status-codes.js:
--------------------------------------------------------------------------------
1 |
2 | var xref = require('./ipputil').xref;
3 |
4 | var status = [];
5 | /* Success 0x0000 - 0x00FF */
6 | status[0x0000] = 'successful-ok'; //http://tools.ietf.org/html/rfc2911#section-13.1.2.1
7 | status[0x0001] = 'successful-ok-ignored-or-substituted-attributes'; //http://tools.ietf.org/html/rfc2911#section-13.1.2.2 & http://tools.ietf.org/html/rfc3995#section-13.5
8 | status[0x0002] = 'successful-ok-conflicting-attributes'; //http://tools.ietf.org/html/rfc2911#section-13.1.2.3
9 | status[0x0003] = 'successful-ok-ignored-subscriptions'; //http://tools.ietf.org/html/rfc3995#section-12.1
10 | status[0x0004] = 'successful-ok-ignored-notifications'; //http://tools.ietf.org/html/draft-ietf-ipp-indp-method-05#section-9.1.1 did not get standardized
11 | status[0x0005] = 'successful-ok-too-many-events'; //http://tools.ietf.org/html/rfc3995#section-13.4
12 | status[0x0006] = 'successful-ok-but-cancel-subscription'; //http://tools.ietf.org/html/draft-ietf-ipp-indp-method-05#section-9.2.2 did not get standardized
13 | status[0x0007] = 'successful-ok-events-complete'; //http://tools.ietf.org/html/rfc3996#section-10.1
14 |
15 | status[0x0400] = 'client-error-bad-request'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.1
16 | status[0x0401] = 'client-error-forbidden'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.2
17 | status[0x0402] = 'client-error-not-authenticated'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.3
18 | status[0x0403] = 'client-error-not-authorized'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.4
19 | status[0x0404] = 'client-error-not-possible'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.5
20 | status[0x0405] = 'client-error-timeout'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.6
21 | status[0x0406] = 'client-error-not-found'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.7
22 | status[0x0407] = 'client-error-gone'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.8
23 | status[0x0408] = 'client-error-request-entity-too-large'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.9
24 | status[0x0409] = 'client-error-request-value-too-long'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.1
25 | status[0x040A] = 'client-error-document-format-not-supported'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.11
26 | status[0x040B] = 'client-error-attributes-or-values-not-supported'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.12 & http://tools.ietf.org/html/rfc3995#section-13.2
27 | status[0x040C] = 'client-error-uri-scheme-not-supported'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.13 & http://tools.ietf.org/html/rfc3995#section-13.1
28 | status[0x040D] = 'client-error-charset-not-supported'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.14
29 | status[0x040E] = 'client-error-conflicting-attributes'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.15
30 | status[0x040F] = 'client-error-compression-not-supported'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.16
31 | status[0x0410] = 'client-error-compression-error'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.17
32 | status[0x0411] = 'client-error-document-format-error'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.18
33 | status[0x0412] = 'client-error-document-access-error'; //http://tools.ietf.org/html/rfc2911#section-13.1.4.19
34 | status[0x0413] = 'client-error-attributes-not-settable'; //http://tools.ietf.org/html/rfc3380#section-7.1
35 | status[0x0414] = 'client-error-ignored-all-subscriptions'; //http://tools.ietf.org/html/rfc3995#section-12.2
36 | status[0x0415] = 'client-error-too-many-subscriptions'; //http://tools.ietf.org/html/rfc3995#section-13.2
37 | status[0x0416] = 'client-error-ignored-all-notifications'; //http://tools.ietf.org/html/draft-ietf-ipp-indp-method-06#section-9.1.2 did not get standardized
38 | status[0x0417] = 'client-error-client-print-support-file-not-found'; //http://tools.ietf.org/html/draft-ietf-ipp-install-04#section-10.1 did not get standardized
39 | status[0x0418] = 'client-error-document-password-error'; //ftp://ftp.pwg.org/pub/pwg/ipp/wd/wd-ippjobprinterext3v10-20120420.pdf did not get standardized
40 | status[0x0419] = 'client-error-document-permission-error'; //ftp://ftp.pwg.org/pub/pwg/ipp/wd/wd-ippjobprinterext3v10-20120420.pdf did not get standardized
41 | status[0x041A] = 'client-error-document-security-error'; //ftp://ftp.pwg.org/pub/pwg/ipp/wd/wd-ippjobprinterext3v10-20120420.pdf did not get standardized
42 | status[0x041B] = 'client-error-document-unprintable-error'; //ftp://ftp.pwg.org/pub/pwg/ipp/wd/wd-ippjobprinterext3v10-20120420.pdf did not get standardized
43 | /* Server error 0x0500 - 0x05FF */
44 | status[0x0500] = 'server-error-internal-error'; //http://tools.ietf.org/html/rfc2911#section-13.1.5.1
45 | status[0x0501] = 'server-error-operation-not-supported'; //http://tools.ietf.org/html/rfc2911#section-13.1.5.2
46 | status[0x0502] = 'server-error-service-unavailable'; //http://tools.ietf.org/html/rfc2911#section-13.1.5.3
47 | status[0x0503] = 'server-error-version-not-supported'; //http://tools.ietf.org/html/rfc2911#section-13.1.5.4
48 | status[0x0504] = 'server-error-device-error'; //http://tools.ietf.org/html/rfc2911#section-13.1.5.5
49 | status[0x0505] = 'server-error-temporary-error'; //http://tools.ietf.org/html/rfc2911#section-13.1.5.6
50 | status[0x0506] = 'server-error-not-accepting-jobs'; //http://tools.ietf.org/html/rfc2911#section-13.1.5.7
51 | status[0x0507] = 'server-error-busy'; //http://tools.ietf.org/html/rfc2911#section-13.1.5.8
52 | status[0x0508] = 'server-error-job-canceled'; //http://tools.ietf.org/html/rfc2911#section-13.1.5.9
53 | status[0x0509] = 'server-error-multiple-document-jobs-not-supported'; //http://tools.ietf.org/html/rfc2911#section-13.1.5.10
54 | status[0x050A] = 'server-error-printer-is-deactivated'; //http://tools.ietf.org/html/rfc3998#section-5.1
55 | status[0x050B] = 'server-error-too-many-jobs'; //ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobext10-20031031-5100.7.pdf
56 | status[0x050C] = 'server-error-too-many-documents'; //ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippjobext10-20031031-5100.7.pdf
57 |
58 | module.exports = xref(status);
59 |
--------------------------------------------------------------------------------
/lib/tags.js:
--------------------------------------------------------------------------------
1 |
2 | var xref = require('./ipputil').xref;
3 |
4 | //http://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml#ipp-registrations-7
5 | //http://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml#ipp-registrations-8
6 | //http://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml#ipp-registrations-9
7 | var tags = [
8 | , // 0x00 http://tools.ietf.org/html/rfc2910#section-3.5.1
9 | "operation-attributes-tag", // 0x01 http://tools.ietf.org/html/rfc2910#section-3.5.1
10 | "job-attributes-tag", // 0x02 http://tools.ietf.org/html/rfc2910#section-3.5.1
11 | "end-of-attributes-tag", // 0x03 http://tools.ietf.org/html/rfc2910#section-3.5.1
12 | "printer-attributes-tag", // 0x04 http://tools.ietf.org/html/rfc2910#section-3.5.1
13 | "unsupported-attributes-tag", // 0x05 http://tools.ietf.org/html/rfc2910#section-3.5.1
14 | "subscription-attributes-tag", // 0x06 http://tools.ietf.org/html/rfc3995#section-14
15 | "event-notification-attributes-tag", // 0x07 http://tools.ietf.org/html/rfc3995#section-14
16 | "resource-attributes-tag", // 0x08 http://tools.ietf.org/html/draft-ietf-ipp-get-resource-00#section-11 did not get standardized
17 | "document-attributes-tag", // 0x09 ftp://ftp.pwg.org/pub/pwg/candidates/cs-ippdocobject10-20031031-5100.5.pdf
18 | ,,,,,, // 0x0A - 0x0F
19 | "unsupported", // 0x10 http://tools.ietf.org/html/rfc2910#section-3.5.2
20 | "default", // 0x11 http://tools.ietf.org/html/rfc2910#section-3.5.2
21 | "unknown", // 0x12 http://tools.ietf.org/html/rfc2910#section-3.5.2
22 | "no-value", // 0x13 http://tools.ietf.org/html/rfc2910#section-3.5.2
23 | , // 0x14
24 | "not-settable", // 0x15 http://tools.ietf.org/html/rfc3380#section-8.1
25 | "delete-attribute", // 0x16 http://tools.ietf.org/html/rfc3380#section-8.2
26 | "admin-define", // 0x17 http://tools.ietf.org/html/rfc3380#section-8.3
27 | ,,,,,,,,, // 0x18 - 0x20
28 | "integer", // 0x21 http://tools.ietf.org/html/rfc2910#section-3.5.2
29 | "boolean", // 0x22 http://tools.ietf.org/html/rfc2910#section-3.5.2
30 | "enum", // 0x23 http://tools.ietf.org/html/rfc2910#section-3.5.2
31 | ,,,,,,,,,,,, // 0x24 - 0x2F
32 | "octetString", // 0x30 http://tools.ietf.org/html/rfc2910#section-3.5.2
33 | "dateTime", // 0x31 http://tools.ietf.org/html/rfc2910#section-3.5.2
34 | "resolution", // 0x32 http://tools.ietf.org/html/rfc2910#section-3.5.2
35 | "rangeOfInteger", // 0x33 http://tools.ietf.org/html/rfc2910#section-3.5.2
36 | "begCollection", // 0x34 http://tools.ietf.org/html/rfc3382#section-7.1
37 | "textWithLanguage", // 0x35 http://tools.ietf.org/html/rfc2910#section-3.5.2
38 | "nameWithLanguage", // 0x36 http://tools.ietf.org/html/rfc2910#section-3.5.2
39 | "endCollection", // 0x37 http://tools.ietf.org/html/rfc3382#section-7.1
40 | ,,,,,,,,, // 0x38 - 0x40
41 | "textWithoutLanguage", // 0x41 http://tools.ietf.org/html/rfc2910#section-3.5.2
42 | "nameWithoutLanguage", // 0x42 http://tools.ietf.org/html/rfc2910#section-3.5.2
43 | , // 0x43
44 | "keyword", // 0x44 http://tools.ietf.org/html/rfc2910#section-3.5.2
45 | "uri", // 0x45 http://tools.ietf.org/html/rfc2910#section-3.5.2
46 | "uriScheme", // 0x46 http://tools.ietf.org/html/rfc2910#section-3.5.2
47 | "charset", // 0x47 http://tools.ietf.org/html/rfc2910#section-3.5.2
48 | "naturalLanguage", // 0x48 http://tools.ietf.org/html/rfc2910#section-3.5.2
49 | "mimeMediaType", // 0x49 http://tools.ietf.org/html/rfc2910#section-3.5.2
50 | "memberAttrName" // 0x4A http://tools.ietf.org/html/rfc3382#section-7.1
51 | ];
52 | tags[0x7F] = "extension"; // http://tools.ietf.org/html/rfc2910#section-3.5.2
53 | module.exports = xref(tags);
54 |
--------------------------------------------------------------------------------
/lib/versions.js:
--------------------------------------------------------------------------------
1 |
2 | var versions = [];
3 | versions[0x0100] = '1.0';
4 | versions[0x0101] = '1.1';
5 | versions[0x0200] = '2.0';
6 | versions[0x0201] = '2.1';
7 |
8 | module.exports = require('./ipputil').xref(versions);
9 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ipp",
3 | "version": "2.0.0",
4 | "description": "Internet Printing Protocol (IPP) for nodejs",
5 | "keywords": [
6 | "ipp",
7 | "print",
8 | "printing"
9 | ],
10 | "homepage": "http://github.com/williamkapke/ipp",
11 | "repository": {
12 | "type": "git",
13 | "url": "https://github.com/williamkapke/ipp.git"
14 | },
15 | "author": {
16 | "name": "William Kapke",
17 | "email": "william.kapke@gmail.com"
18 | },
19 | "devDependencies": {
20 | "concat-stream": "^1.6.0",
21 | "cors": "^2.8.5",
22 | "express": "^4.17.1",
23 | "express-fileupload": "^1.2.1",
24 | "mdns": "^2.3.3",
25 | "mime": "^3.0.0",
26 | "multer": "^1.4.3",
27 | "nodemon": "^2.0.15",
28 | "pdfkit": "^0.8.3"
29 | },
30 | "main": "ipp.js",
31 | "engines": {
32 | "node": "<4.0.0"
33 | },
34 | "licenses": [
35 | {
36 | "type": "MIT",
37 | "url": "http://www.opensource.org/licenses/MIT"
38 | }
39 | ],
40 | "dependencies": {
41 | "body-parser": "^1.19.0",
42 | "libreoffice-convert": "^1.3.5",
43 | "sync": "^0.2.5",
44 | "tmp": "^0.2.1"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------