node-hp-scan-to 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -10
  3. package/dist/Destination.js +36 -84
  4. package/dist/Destination.js.map +1 -1
  5. package/dist/DeviceCapabilities.d.ts +4 -0
  6. package/dist/DeviceCapabilities.js +3 -0
  7. package/dist/DeviceCapabilities.js.map +1 -0
  8. package/dist/DiscoveryTree.d.ts +16 -0
  9. package/dist/DiscoveryTree.js +38 -0
  10. package/dist/DiscoveryTree.js.map +1 -0
  11. package/dist/Event.d.ts +1 -1
  12. package/dist/Event.js +24 -39
  13. package/dist/Event.js.map +1 -1
  14. package/dist/EventTable.d.ts +5 -0
  15. package/dist/EventTable.js +24 -18
  16. package/dist/EventTable.js.map +1 -1
  17. package/dist/HPApi.d.ts +26 -18
  18. package/dist/HPApi.js +386 -461
  19. package/dist/HPApi.js.map +1 -1
  20. package/dist/Job.d.ts +8 -7
  21. package/dist/Job.js +69 -86
  22. package/dist/Job.js.map +1 -1
  23. package/dist/JpegUtil.js +73 -82
  24. package/dist/JpegUtil.js.map +1 -1
  25. package/dist/KnownShortcut.d.ts +1 -0
  26. package/dist/KnownShortcut.js +3 -0
  27. package/dist/KnownShortcut.js.map +1 -0
  28. package/dist/PathHelper.d.ts +2 -1
  29. package/dist/PathHelper.js +41 -68
  30. package/dist/PathHelper.js.map +1 -1
  31. package/dist/ScanCaps.d.ts +7 -0
  32. package/dist/ScanCaps.js +17 -0
  33. package/dist/ScanCaps.js.map +1 -0
  34. package/dist/ScanContent.js +18 -73
  35. package/dist/ScanContent.js.map +1 -1
  36. package/dist/ScanJobManifest.d.ts +23 -0
  37. package/dist/ScanJobManifest.js +24 -0
  38. package/dist/ScanJobManifest.js.map +1 -0
  39. package/dist/ScanJobSettings.d.ts +3 -1
  40. package/dist/ScanJobSettings.js +48 -88
  41. package/dist/ScanJobSettings.js.map +1 -1
  42. package/dist/ScanStatus.d.ts +1 -0
  43. package/dist/ScanStatus.js +27 -28
  44. package/dist/ScanStatus.js.map +1 -1
  45. package/dist/WalkupScanDestination.d.ts +11 -13
  46. package/dist/WalkupScanDestination.js +32 -35
  47. package/dist/WalkupScanDestination.js.map +1 -1
  48. package/dist/WalkupScanDestinations.d.ts +1 -0
  49. package/dist/WalkupScanDestinations.js +21 -18
  50. package/dist/WalkupScanDestinations.js.map +1 -1
  51. package/dist/WalkupScanManifest.d.ts +23 -0
  52. package/dist/WalkupScanManifest.js +25 -0
  53. package/dist/WalkupScanManifest.js.map +1 -0
  54. package/dist/WalkupScanToCompCaps.d.ts +12 -0
  55. package/dist/WalkupScanToCompCaps.js +20 -0
  56. package/dist/WalkupScanToCompCaps.js.map +1 -0
  57. package/dist/WalkupScanToCompDestination.d.ts +10 -14
  58. package/dist/WalkupScanToCompDestination.js +32 -38
  59. package/dist/WalkupScanToCompDestination.js.map +1 -1
  60. package/dist/WalkupScanToCompDestinations.d.ts +1 -0
  61. package/dist/WalkupScanToCompDestinations.js +21 -18
  62. package/dist/WalkupScanToCompDestinations.js.map +1 -1
  63. package/dist/WalkupScanToCompEvent.d.ts +2 -1
  64. package/dist/WalkupScanToCompEvent.js +14 -11
  65. package/dist/WalkupScanToCompEvent.js.map +1 -1
  66. package/dist/WalkupScanToCompManifest.d.ts +23 -0
  67. package/dist/WalkupScanToCompManifest.js +25 -0
  68. package/dist/WalkupScanToCompManifest.js.map +1 -0
  69. package/dist/delay.d.ts +1 -0
  70. package/dist/delay.js +10 -0
  71. package/dist/delay.js.map +1 -0
  72. package/dist/fixJpegSize.d.ts +19 -0
  73. package/dist/fixJpegSize.js +292 -0
  74. package/dist/fixJpegSize.js.map +1 -0
  75. package/dist/index.js +209 -607
  76. package/dist/index.js.map +1 -1
  77. package/dist/listening.d.ts +9 -0
  78. package/dist/listening.js +108 -0
  79. package/dist/listening.js.map +1 -0
  80. package/dist/readDeviceCapabilities.d.ts +2 -0
  81. package/dist/readDeviceCapabilities.js +41 -0
  82. package/dist/readDeviceCapabilities.js.map +1 -0
  83. package/dist/scanProcess.d.ts +19 -0
  84. package/dist/scanProcess.js +292 -0
  85. package/dist/scanProcess.js.map +1 -0
  86. package/dist/scanProcessing.d.ts +20 -0
  87. package/dist/scanProcessing.js +320 -0
  88. package/dist/scanProcessing.js.map +1 -0
  89. package/dist/src/Destination.d.ts +8 -0
  90. package/dist/src/Destination.js +68 -0
  91. package/dist/src/Destination.js.map +1 -0
  92. package/dist/src/DiscoveryTree.d.ts +16 -0
  93. package/dist/src/DiscoveryTree.js +38 -0
  94. package/dist/src/DiscoveryTree.js.map +1 -0
  95. package/dist/src/Event.d.ts +21 -0
  96. package/dist/src/Event.js +32 -0
  97. package/dist/src/Event.js.map +1 -0
  98. package/dist/src/EventTable.d.ts +16 -0
  99. package/dist/src/EventTable.js +33 -0
  100. package/dist/src/EventTable.js.map +1 -0
  101. package/dist/src/HPApi.d.ts +50 -0
  102. package/dist/src/HPApi.js +454 -0
  103. package/dist/src/HPApi.js.map +1 -0
  104. package/dist/src/Job.d.ts +37 -0
  105. package/dist/src/Job.js +78 -0
  106. package/dist/src/Job.js.map +1 -0
  107. package/dist/src/JpegUtil.d.ts +26 -0
  108. package/dist/src/JpegUtil.js +229 -0
  109. package/dist/src/JpegUtil.js.map +1 -0
  110. package/dist/src/KnownShortcut.d.ts +1 -0
  111. package/dist/src/KnownShortcut.js +3 -0
  112. package/dist/src/KnownShortcut.js.map +1 -0
  113. package/dist/src/PathHelper.d.ts +6 -0
  114. package/dist/src/PathHelper.js +52 -0
  115. package/dist/src/PathHelper.js.map +1 -0
  116. package/dist/src/ScanCaps.d.ts +7 -0
  117. package/dist/src/ScanCaps.js +17 -0
  118. package/dist/src/ScanCaps.js.map +1 -0
  119. package/dist/src/ScanJobManifest.d.ts +23 -0
  120. package/dist/src/ScanJobManifest.js +24 -0
  121. package/dist/src/ScanJobManifest.js.map +1 -0
  122. package/dist/src/ScanJobSettings.d.ts +8 -0
  123. package/dist/src/ScanJobSettings.js +56 -0
  124. package/dist/src/ScanJobSettings.js.map +1 -0
  125. package/dist/src/ScanStatus.d.ts +19 -0
  126. package/dist/src/ScanStatus.js +35 -0
  127. package/dist/src/ScanStatus.js.map +1 -0
  128. package/dist/src/WalkupScanDestination.d.ts +22 -0
  129. package/dist/src/WalkupScanDestination.js +38 -0
  130. package/dist/src/WalkupScanDestination.js.map +1 -0
  131. package/dist/src/WalkupScanDestinations.d.ts +12 -0
  132. package/dist/src/WalkupScanDestinations.js +30 -0
  133. package/dist/src/WalkupScanDestinations.js.map +1 -0
  134. package/dist/src/WalkupScanManifest.d.ts +23 -0
  135. package/dist/src/WalkupScanManifest.js +25 -0
  136. package/dist/src/WalkupScanManifest.js.map +1 -0
  137. package/dist/src/WalkupScanToCompCaps.d.ts +12 -0
  138. package/dist/src/WalkupScanToCompCaps.js +20 -0
  139. package/dist/src/WalkupScanToCompCaps.js.map +1 -0
  140. package/dist/src/WalkupScanToCompDestination.d.ts +22 -0
  141. package/dist/src/WalkupScanToCompDestination.js +38 -0
  142. package/dist/src/WalkupScanToCompDestination.js.map +1 -0
  143. package/dist/src/WalkupScanToCompDestinations.d.ts +12 -0
  144. package/dist/src/WalkupScanToCompDestinations.js +30 -0
  145. package/dist/src/WalkupScanToCompDestinations.js.map +1 -0
  146. package/dist/src/WalkupScanToCompEvent.d.ts +11 -0
  147. package/dist/src/WalkupScanToCompEvent.js +20 -0
  148. package/dist/src/WalkupScanToCompEvent.js.map +1 -0
  149. package/dist/src/WalkupScanToCompManifest.d.ts +23 -0
  150. package/dist/src/WalkupScanToCompManifest.js +25 -0
  151. package/dist/src/WalkupScanToCompManifest.js.map +1 -0
  152. package/dist/src/delay.d.ts +1 -0
  153. package/dist/src/delay.js +10 -0
  154. package/dist/src/delay.js.map +1 -0
  155. package/dist/test/DiscoveryTree.test.d.ts +1 -0
  156. package/dist/test/DiscoveryTree.test.js +68 -0
  157. package/dist/test/DiscoveryTree.test.js.map +1 -0
  158. package/dist/test/EtagEventTable.test.d.ts +1 -0
  159. package/dist/test/EtagEventTable.test.js +93 -0
  160. package/dist/test/EtagEventTable.test.js.map +1 -0
  161. package/dist/test/Job.test.d.ts +1 -0
  162. package/dist/test/Job.test.js +104 -0
  163. package/dist/test/Job.test.js.map +1 -0
  164. package/dist/test/JpegUtil.test.d.ts +1 -0
  165. package/dist/test/JpegUtil.test.js +51 -0
  166. package/dist/test/JpegUtil.test.js.map +1 -0
  167. package/dist/test/PathHelper.test.d.ts +1 -0
  168. package/dist/test/PathHelper.test.js +99 -0
  169. package/dist/test/PathHelper.test.js.map +1 -0
  170. package/dist/test/ScanJobManifest.test.d.ts +1 -0
  171. package/dist/test/ScanJobManifest.test.js +56 -0
  172. package/dist/test/ScanJobManifest.test.js.map +1 -0
  173. package/dist/test/ScanJobSettings.test.d.ts +1 -0
  174. package/dist/test/ScanJobSettings.test.js +53 -0
  175. package/dist/test/ScanJobSettings.test.js.map +1 -0
  176. package/dist/test/ScanStatus.test.d.ts +1 -0
  177. package/dist/test/ScanStatus.test.js +75 -0
  178. package/dist/test/ScanStatus.test.js.map +1 -0
  179. package/dist/test/WalkupScanDestination.test.d.ts +1 -0
  180. package/dist/test/WalkupScanDestination.test.js +80 -0
  181. package/dist/test/WalkupScanDestination.test.js.map +1 -0
  182. package/dist/test/WalkupScanDestinations.test.d.ts +1 -0
  183. package/dist/test/WalkupScanDestinations.test.js +68 -0
  184. package/dist/test/WalkupScanDestinations.test.js.map +1 -0
  185. package/dist/test/WalkupScanManifest.test.d.ts +1 -0
  186. package/dist/test/WalkupScanManifest.test.js +46 -0
  187. package/dist/test/WalkupScanManifest.test.js.map +1 -0
  188. package/dist/test/WalkupScanToCompCaps.test.d.ts +1 -0
  189. package/dist/test/WalkupScanToCompCaps.test.js +56 -0
  190. package/dist/test/WalkupScanToCompCaps.test.js.map +1 -0
  191. package/dist/test/WalkupScanToCompDestination.test.d.ts +1 -0
  192. package/dist/test/WalkupScanToCompDestination.test.js +58 -0
  193. package/dist/test/WalkupScanToCompDestination.test.js.map +1 -0
  194. package/dist/test/WalkupScanToCompDestinations.test.d.ts +1 -0
  195. package/dist/test/WalkupScanToCompDestinations.test.js +58 -0
  196. package/dist/test/WalkupScanToCompDestinations.test.js.map +1 -0
  197. package/dist/test/WalkupScanToCompEvent.test.d.ts +1 -0
  198. package/dist/test/WalkupScanToCompEvent.test.js +46 -0
  199. package/dist/test/WalkupScanToCompEvent.test.js.map +1 -0
  200. package/dist/test/WalkupScanToCompManifest.test.d.ts +1 -0
  201. package/dist/test/WalkupScanToCompManifest.test.js +46 -0
  202. package/dist/test/WalkupScanToCompManifest.test.js.map +1 -0
  203. package/dist/test/clean.d.ts +1 -0
  204. package/dist/test/clean.js +21 -0
  205. package/dist/test/clean.js.map +1 -0
  206. package/package.json +27 -18
  207. package/src/Destination.ts +1 -1
  208. package/src/DeviceCapabilities.ts +4 -0
  209. package/src/DiscoveryTree.ts +56 -0
  210. package/src/Event.ts +17 -7
  211. package/src/EventTable.ts +20 -0
  212. package/src/HPApi.ts +245 -103
  213. package/src/Job.ts +51 -29
  214. package/src/JpegUtil.ts +8 -4
  215. package/src/KnownShortcut.ts +6 -0
  216. package/src/PathHelper.ts +47 -13
  217. package/src/ScanCaps.ts +19 -0
  218. package/src/ScanContent.ts +4 -1
  219. package/src/ScanJobManifest.ts +55 -0
  220. package/src/ScanJobSettings.ts +18 -3
  221. package/src/ScanStatus.ts +9 -0
  222. package/src/WalkupScanDestination.ts +42 -18
  223. package/src/WalkupScanDestinations.ts +12 -0
  224. package/src/WalkupScanManifest.ts +59 -0
  225. package/src/WalkupScanToCompCaps.ts +36 -0
  226. package/src/WalkupScanToCompDestination.ts +38 -24
  227. package/src/WalkupScanToCompDestinations.ts +12 -0
  228. package/src/WalkupScanToCompEvent.ts +15 -3
  229. package/src/WalkupScanToCompManifest.ts +59 -0
  230. package/src/delay.ts +5 -0
  231. package/src/index.ts +267 -465
  232. package/src/listening.ts +145 -0
  233. package/src/readDeviceCapabilities.ts +46 -0
  234. package/src/scanProcessing.ts +535 -0
  235. package/tsconfig.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Emmanuel Counasse
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,20 +1,29 @@
1
1
  # node-hp-scan-to
2
2
 
3
+ ![build](https://github.com/manuc66/node-hp-scan-to/actions/workflows/docker-image.yml/badge.svg)
3
4
  [![Build Status](https://app.travis-ci.com/manuc66/node-hp-scan-to.svg?branch=master)](https://app.travis-ci.com/manuc66/node-hp-scan-to)
5
+ ![npm](https://img.shields.io/npm/v/node-hp-scan-to)
4
6
  [![npm](https://img.shields.io/npm/dt/node-hp-scan-to)](https://www.npmjs.com/package/node-hp-scan-to)
5
7
  [![Docker Pulls](https://img.shields.io/docker/pulls/manuc66/node-hp-scan-to)](https://hub.docker.com/repository/docker/manuc66/node-hp-scan-to)
6
8
  [![Gitter](https://badges.gitter.im/node-hp-scan-to/community.svg)](https://gitter.im/node-hp-scan-to/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
9
+ [![CodeFactor](https://www.codefactor.io/repository/github/manuc66/node-hp-scan-to/badge)](https://www.codefactor.io/repository/github/manuc66/node-hp-scan-to)
10
+ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmanuc66%2Fnode-hp-scan-to.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmanuc66%2Fnode-hp-scan-to?ref=badge_shield)
7
11
 
8
12
  Little command line program that allow to send scan from device to computer.
9
13
 
14
+ Can be run with npx : `npx node-hp-scan-to` or with Docker (see below)
15
+
10
16
  Developed and tested for the following HP All-in-One Printers:
11
17
  - HP Officejet 6500A Plus
12
18
  - HP Deskjet 3520
13
19
  - HP Smart Tank Plus 570 series
14
20
 
15
21
  The following printer are also working:
16
- - Officejet 6700 premium
22
+ - HP Deskjet 3050 All-in-One Printer - J610a
23
+ - HP Officejet 5230
24
+ - HP Officejet 6700 premium
17
25
  - HP Officejet 5740
26
+ - HP Officejet 6950
18
27
  - HP OfficeJet Pro 8025e
19
28
 
20
29
  There are good chances it also works on your HP All-in-One Printer.
@@ -22,7 +31,34 @@ For this purpose, the original HP Windows application's interaction with the dev
22
31
 
23
32
  This project is not endorsed by nor affiliated with HP.
24
33
 
34
+ ## Supported features
35
+ - ✔️ JPG scan output
36
+ - ✔️ PDF document scan output
37
+ - ✔️ Scan from automatic document feeder
38
+ - ✔️ Dual side with automatic document feeder
39
+ - ✔️ Multi page from platen
40
+ - ✔️ Automatic IP address discovery
41
+ - ✔️ Prebuilt Docker images (multi arch)
42
+ - ✔️ Command line support (Cross platform)
43
+ - ✔️ Customizable file names
44
+ - ✔️ Customizable resolution
45
+ - ✔️ Customizable label on the device
46
+
25
47
  ## Usage
48
+
49
+ ### Command line
50
+ `npx node-hp-scan-to`
51
+
52
+ - `-ip` or `--address` followed by the ip address of the printer, i.e. `-ip 192.168.0.5`. This overrides `-p`.
53
+ - `-l` or `--label` The label to display on the printer (default is the hostname).
54
+ - `-n` or `--name` followed by the printer name, it probably contains spaces, so it needs to be quoted, i.e. `-name "Officejet 6500 E710n-z"`
55
+ - `-d` or `--directory` followed by the directory path where the scanned documents should be saved, i.e. `-d ~/Documents/Scans`. Defaults to `/tmp/scan-to-pc<random value>` when not set.
56
+ - `-t` or `--temp-directory` Temp directory used for processing. Defaults to `/tmp/scan-to-pc<random value>` when not set.
57
+ - `-p` or `--pattern` followed by the pattern for the filename without file extension, i.e. `"scan"_dd.mm.yyyy_hh:MM:ss` to name the scanned file `scan_19.04.2021_17:26:47`. Date and time patterns are replaced by the current date and time, text that should not be replaced need to be inside quotes. Documentation for the pattern can be found [here](https://www.npmjs.com/package/dateformat) in the section `Mask options`. Defaults to `scan<increasing number>_page<page number>` when not set.
58
+ - `-r` or `--resolution` Resolution in DPI of the scans (defaults is 200).
59
+ - `-D, --debug"` enables debug logs.
60
+
61
+ If you wish to test it by cloning this repository:
26
62
  ```sh
27
63
  git clone ...
28
64
  cd node-hp-scan-to
@@ -32,13 +68,6 @@ yarn build
32
68
  node dist/index.js -ip 192.168.1.4 # or -n "Officejet 6500 E710n-z"
33
69
  ```
34
70
 
35
- ### Command line options
36
- - `-ip` or `--address` followed by the ip address of the printer, i.e. `-ip 192.168.0.5`. This overrides `-p`.
37
- - `-n` or `--name` followed by the printer name, it probably contains spaces, so it needs to be quoted, i.e. `-name "Officejet 6500 E710n-z"`
38
- - `-d` or `--directory` followed by the directory path where the scanned documents should be saved, i.e. `-d ~/Documents/Scans`. Defaults to `/tmp/scan-to-pc<random value>` when not set.
39
- - `-p` or `--pattern` followed by the pattern for the filename without file extension, i.e. `"scan"_dd.mm.yyyy_hh:MM:ss` to name the scanned file `scan_19.04.2021_17:26:47`. Date and time patterns are replaced by the current date and time, text that should not be replaced need to be inside quotes. Documentation for the pattern can be found [here](https://www.npmjs.com/package/dateformat) in the section `Mask options`. Defaults to `scan<increasing number>_page<page number>` when not set.
40
- - `-D, --debug"` enables debug logs.
41
-
42
71
  ### Run with docker
43
72
  Be aware that with docker you have to specify the ip address of the printer via the `IP` environment variable, because
44
73
  bonjour service discovery uses multicast network traffic which by default doesn't work in docker.
@@ -47,7 +76,7 @@ You could however use docker's macvlan networking, this way you can use service
47
76
  All scanned files are written to the volume `/scan`, the filename can be changed with the `PATTERN` environment variable.
48
77
  For the correct permissions to the volume set the environment variables `PUID` and `PGID`.
49
78
 
50
- To enable debug logs set the environment variable `CMDLINE` to `-D`. Can also be used for any other command line parameters.
79
+ __To enable debug logs set the environment variable `CMDLINE` to `-D`.__ Can also be used for any other command line parameters.
51
80
 
52
81
  The name shown on the printer's display is the hostname of the docker container, which defaults to a random value, so you may want to specify it via the `-hostname` argument.
53
82
 
@@ -85,8 +114,18 @@ Then run `docker-compose up -d --build`.
85
114
  To
86
115
 
87
116
  Public Pre-built Docker image:
88
- - https://hub.docker.com/repository/docker/manuc66/node-hp-scan-to
117
+ - https://hub.docker.com/repository/docker/manuc66/node-hp-scan-to (take master: `docker pull manuc66/node-hp-scan-to:master`)
89
118
 
90
119
  ## Debugging
91
120
  I'm using Visual Studio Code to debug this application, so instead of running ts-node just enter `code .` and press F5 to start debugging.
92
121
  You may want to set your printers ip or name in `.vscode/launch.json`.
122
+
123
+
124
+ ## 💖 Support this project
125
+ If this project helped you save money or time or simply makes your life also easier, you can give me a cup of coffee =)
126
+
127
+ - [![Support via PayPal](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://www.paypal.me/manuc66)
128
+ - Bitcoin — You can send me bitcoins at this address: `33gxVjey6g4Beha26fSQZLFfWWndT1oY3F`
129
+
130
+ ## License
131
+ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmanuc66%2Fnode-hp-scan-to.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmanuc66%2Fnode-hp-scan-to?ref=badge_large)
@@ -22,95 +22,47 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
- function verb(n) { return function (v) { return step([n, v]); }; }
38
- function step(op) {
39
- if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
41
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
- if (y = 0, t) op = [op[0] & 2, t.value];
43
- switch (op[0]) {
44
- case 0: case 1: t = op; break;
45
- case 4: _.label++; return { value: op[1], done: false };
46
- case 5: _.label++; y = op[1]; op = [0]; continue;
47
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
- default:
49
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
- if (t[2]) _.ops.pop();
54
- _.trys.pop(); continue;
55
- }
56
- op = body.call(thisArg, _);
57
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
- }
60
- };
61
25
  Object.defineProperty(exports, "__esModule", { value: true });
62
- var xml2js_1 = require("xml2js");
63
- var util = __importStar(require("util"));
64
- var parser = new xml2js_1.Parser();
65
- var Destination = /** @class */ (function () {
66
- function Destination(name, hostname, toComp) {
26
+ const xml2js_1 = require("xml2js");
27
+ const util = __importStar(require("util"));
28
+ const parser = new xml2js_1.Parser();
29
+ class Destination {
30
+ constructor(name, hostname, toComp) {
67
31
  this.name = name;
68
32
  this.hostname = hostname;
69
33
  this.linkType = "Network";
70
34
  this.toComp = toComp;
71
35
  }
72
- Destination.prototype.toXML = function () {
73
- return __awaiter(this, void 0, void 0, function () {
74
- var rawDestination, parsed, builder, xml;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0:
78
- rawDestination = '<?xml version="1.0" encoding="UTF-8"?>\n';
79
- if (this.toComp) {
80
- rawDestination +=
81
- '<WalkupScanDestination xmlns="http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
82
- 'xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28 WalkupScan.xsd">\n';
83
- }
84
- else {
85
- rawDestination +=
86
- '<WalkupScanDestination xmlns="http://www.hp.com/schemas/imaging/con/rest/walkupscan/2009/09/21" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \n' +
87
- 'xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/rest/walkupscan/2009/09/21 WalkupScanDestinations.xsd">\n';
88
- }
89
- rawDestination +=
90
- '\t<Hostname xmlns="http://www.hp.com/schemas/imaging/con/dictionaries/2009/04/06"></Hostname>\n' +
91
- '\t<Name xmlns="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/"></Name>\n' +
92
- "\t<LinkType>Network</LinkType>\n" +
93
- "</WalkupScanDestination>";
94
- return [4 /*yield*/, util.promisify(parser.parseString)(rawDestination)];
95
- case 1:
96
- parsed = _a.sent();
97
- parsed.WalkupScanDestination.Hostname[0]._ = this.hostname;
98
- parsed.WalkupScanDestination.Name[0]._ = this.name;
99
- parsed.WalkupScanDestination.LinkType[0] = this.linkType;
100
- builder = new xml2js_1.Builder();
101
- xml = builder.buildObject(parsed);
102
- if (this.toComp) {
103
- return [2 /*return*/, xml.replace(/WalkupScan/g, "WalkupScanToComp")];
104
- }
105
- else {
106
- return [2 /*return*/, xml];
107
- }
108
- return [2 /*return*/];
109
- }
110
- });
111
- });
112
- };
113
- return Destination;
114
- }());
36
+ async toXML() {
37
+ let rawDestination = '<?xml version="1.0" encoding="UTF-8"?>\n';
38
+ if (this.toComp) {
39
+ rawDestination +=
40
+ '<WalkupScanDestination xmlns="http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
41
+ 'xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28 WalkupScan.xsd">\n';
42
+ }
43
+ else {
44
+ rawDestination +=
45
+ '<WalkupScanDestination xmlns="http://www.hp.com/schemas/imaging/con/rest/walkupscan/2009/09/21" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \n' +
46
+ 'xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/rest/walkupscan/2009/09/21 WalkupScanDestinations.xsd">\n';
47
+ }
48
+ rawDestination +=
49
+ '\t<Hostname xmlns="http://www.hp.com/schemas/imaging/con/dictionaries/2009/04/06"></Hostname>\n' +
50
+ '\t<Name xmlns="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/"></Name>\n' +
51
+ "\t<LinkType>Network</LinkType>\n" +
52
+ "</WalkupScanDestination>";
53
+ const parsed = await util.promisify(parser.parseString)(rawDestination);
54
+ parsed.WalkupScanDestination.Hostname[0]._ = this.hostname;
55
+ parsed.WalkupScanDestination.Name[0]._ = this.name;
56
+ parsed.WalkupScanDestination.LinkType[0] = this.linkType;
57
+ let builder = new xml2js_1.Builder();
58
+ let xml = builder.buildObject(parsed);
59
+ if (this.toComp) {
60
+ return xml.replace(/WalkupScan/g, "WalkupScanToComp");
61
+ }
62
+ else {
63
+ return xml;
64
+ }
65
+ }
66
+ }
115
67
  exports.default = Destination;
116
68
  //# sourceMappingURL=Destination.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Destination.js","sourceRoot":"","sources":["../src/Destination.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,iCAAuC;AACvC,yCAA6B;AAE7B,IAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;AAU5B;IAME,qBAAY,IAAY,EAAE,QAAgB,EAAE,MAAe;QACzD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEK,2BAAK,GAAX;;;;;;wBACM,cAAc,GAAW,0CAA0C,CAAC;wBACxE,IAAI,IAAI,CAAC,MAAM,EAAE;4BACf,cAAc;gCACZ,wJAAwJ;oCACxJ,yGAAyG,CAAC;yBAC7G;6BAAM;4BACL,cAAc;gCACZ,0JAA0J;oCAC1J,qHAAqH,CAAC;yBACzH;wBAED,cAAc;4BACZ,iGAAiG;gCACjG,mFAAmF;gCACnF,kCAAkC;gCAClC,0BAA0B,CAAC;wBAEd,qBAAM,IAAI,CAAC,SAAS,CACjC,MAAM,CAAC,WAAW,CACnB,CAAC,cAAc,CAAC,EAAA;;wBAFX,MAAM,GAAG,SAEE;wBAEjB,MAAM,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;wBAC3D,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;wBACnD,MAAM,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;wBAErD,OAAO,GAAG,IAAI,gBAAO,EAAE,CAAC;wBACxB,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;wBACtC,IAAI,IAAI,CAAC,MAAM,EAAE;4BACf,sBAAO,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,kBAAkB,CAAC,EAAC;yBACvD;6BAAM;4BACL,sBAAO,GAAG,EAAC;yBACZ;;;;;KACF;IACH,kBAAC;AAAD,CAAC,AA/CD,IA+CC","sourcesContent":["\"use strict\";\n\nimport {Parser, Builder} from \"xml2js\";\nimport * as util from \"util\";\n\nconst parser = new Parser();\n\ntype WalkupScanDestinationData = {\n WalkupScanDestination: {\n Hostname: { _: string }[];\n Name: { _: string }[];\n LinkType: string[];\n };\n};\n\nexport default class Destination {\n private readonly name: string;\n private readonly hostname: string;\n private readonly linkType: string;\n private readonly toComp: boolean;\n\n constructor(name: string, hostname: string, toComp: boolean) {\n this.name = name;\n this.hostname = hostname;\n this.linkType = \"Network\";\n this.toComp = toComp;\n }\n\n async toXML() {\n let rawDestination: string = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n';\n if (this.toComp) {\n rawDestination +=\n '<WalkupScanDestination xmlns=\"http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ' +\n 'xsi:schemaLocation=\"http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28 WalkupScan.xsd\">\\n';\n } else {\n rawDestination +=\n '<WalkupScanDestination xmlns=\"http://www.hp.com/schemas/imaging/con/rest/walkupscan/2009/09/21\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \\n' +\n 'xsi:schemaLocation=\"http://www.hp.com/schemas/imaging/con/rest/walkupscan/2009/09/21 WalkupScanDestinations.xsd\">\\n';\n }\n\n rawDestination +=\n '\\t<Hostname xmlns=\"http://www.hp.com/schemas/imaging/con/dictionaries/2009/04/06\"></Hostname>\\n' +\n '\\t<Name xmlns=\"http://www.hp.com/schemas/imaging/con/dictionaries/1.0/\"></Name>\\n' +\n \"\\t<LinkType>Network</LinkType>\\n\" +\n \"</WalkupScanDestination>\";\n\n const parsed = await util.promisify<string, WalkupScanDestinationData>(\n parser.parseString\n )(rawDestination);\n\n parsed.WalkupScanDestination.Hostname[0]._ = this.hostname;\n parsed.WalkupScanDestination.Name[0]._ = this.name;\n parsed.WalkupScanDestination.LinkType[0] = this.linkType;\n\n let builder = new Builder();\n let xml = builder.buildObject(parsed);\n if (this.toComp) {\n return xml.replace(/WalkupScan/g, \"WalkupScanToComp\");\n } else {\n return xml;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"Destination.js","sourceRoot":"","sources":["../src/Destination.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,mCAAyC;AACzC,2CAA6B;AAE7B,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;AAU5B,MAAqB,WAAW;IAM9B,YAAY,IAAY,EAAE,QAAgB,EAAE,MAAe;QACzD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,cAAc,GAAW,0CAA0C,CAAC;QACxE,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,cAAc;gBACZ,wJAAwJ;oBACxJ,yGAAyG,CAAC;SAC7G;aAAM;YACL,cAAc;gBACZ,0JAA0J;oBAC1J,qHAAqH,CAAC;SACzH;QAED,cAAc;YACZ,iGAAiG;gBACjG,mFAAmF;gBACnF,kCAAkC;gBAClC,0BAA0B,CAAC;QAE7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CACjC,MAAM,CAAC,WAAW,CACnB,CAAC,cAAc,CAAC,CAAC;QAElB,MAAM,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC3D,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QACnD,MAAM,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QAEzD,IAAI,OAAO,GAAG,IAAI,gBAAO,EAAE,CAAC;QAC5B,IAAI,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,OAAO,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;SACvD;aAAM;YACL,OAAO,GAAG,CAAC;SACZ;IACH,CAAC;CACF;AA/CD,8BA+CC","sourcesContent":["\"use strict\";\n\nimport { Parser, Builder } from \"xml2js\";\nimport * as util from \"util\";\n\nconst parser = new Parser();\n\ntype WalkupScanDestinationData = {\n WalkupScanDestination: {\n Hostname: { _: string }[];\n Name: { _: string }[];\n LinkType: string[];\n };\n};\n\nexport default class Destination {\n private readonly name: string;\n private readonly hostname: string;\n private readonly linkType: string;\n private readonly toComp: boolean;\n\n constructor(name: string, hostname: string, toComp: boolean) {\n this.name = name;\n this.hostname = hostname;\n this.linkType = \"Network\";\n this.toComp = toComp;\n }\n\n async toXML() {\n let rawDestination: string = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n';\n if (this.toComp) {\n rawDestination +=\n '<WalkupScanDestination xmlns=\"http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ' +\n 'xsi:schemaLocation=\"http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28 WalkupScan.xsd\">\\n';\n } else {\n rawDestination +=\n '<WalkupScanDestination xmlns=\"http://www.hp.com/schemas/imaging/con/rest/walkupscan/2009/09/21\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \\n' +\n 'xsi:schemaLocation=\"http://www.hp.com/schemas/imaging/con/rest/walkupscan/2009/09/21 WalkupScanDestinations.xsd\">\\n';\n }\n\n rawDestination +=\n '\\t<Hostname xmlns=\"http://www.hp.com/schemas/imaging/con/dictionaries/2009/04/06\"></Hostname>\\n' +\n '\\t<Name xmlns=\"http://www.hp.com/schemas/imaging/con/dictionaries/1.0/\"></Name>\\n' +\n \"\\t<LinkType>Network</LinkType>\\n\" +\n \"</WalkupScanDestination>\";\n\n const parsed = await util.promisify<string, WalkupScanDestinationData>(\n parser.parseString\n )(rawDestination);\n\n parsed.WalkupScanDestination.Hostname[0]._ = this.hostname;\n parsed.WalkupScanDestination.Name[0]._ = this.name;\n parsed.WalkupScanDestination.LinkType[0] = this.linkType;\n\n let builder = new Builder();\n let xml = builder.buildObject(parsed);\n if (this.toComp) {\n return xml.replace(/WalkupScan/g, \"WalkupScanToComp\");\n } else {\n return xml;\n }\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export interface DeviceCapabilities {
2
+ supportsMultiItemScanFromPlaten: boolean;
3
+ useWalkupScanToComp: boolean;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DeviceCapabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceCapabilities.js","sourceRoot":"","sources":["../src/DeviceCapabilities.ts"],"names":[],"mappings":"","sourcesContent":["export interface DeviceCapabilities {\n supportsMultiItemScanFromPlaten: boolean;\n useWalkupScanToComp: boolean;\n}\n"]}
@@ -0,0 +1,16 @@
1
+ export interface DiscoveryTreeData {
2
+ "ledm:DiscoveryTree": {
3
+ "ledm:SupportedIfc": {
4
+ "ledm:ManifestURI": string[];
5
+ "dd:ResourceType": string[];
6
+ }[];
7
+ };
8
+ }
9
+ export default class DiscoveryTree {
10
+ private readonly data;
11
+ constructor(data: DiscoveryTreeData);
12
+ static createDiscoveryTree(content: string): Promise<DiscoveryTree>;
13
+ get WalkupScanToCompManifestURI(): string | null;
14
+ get WalkupScanManifestURI(): string | null;
15
+ get ScanJobManifestURI(): string | null;
16
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const xml2js_1 = require("xml2js");
4
+ const parser = new xml2js_1.Parser();
5
+ const util_1 = require("util");
6
+ const parseString = (0, util_1.promisify)(parser.parseString);
7
+ class DiscoveryTree {
8
+ constructor(data) {
9
+ this.data = data;
10
+ }
11
+ static async createDiscoveryTree(content) {
12
+ const parsed = await parseString(content);
13
+ return new DiscoveryTree(parsed);
14
+ }
15
+ get WalkupScanToCompManifestURI() {
16
+ const hpLedmWalkupScanToCompManifest = this.data["ledm:DiscoveryTree"]["ledm:SupportedIfc"].find((x) => x["dd:ResourceType"][0] === "ledm:hpLedmWalkupScanToCompManifest");
17
+ if (hpLedmWalkupScanToCompManifest !== undefined) {
18
+ return hpLedmWalkupScanToCompManifest["ledm:ManifestURI"][0];
19
+ }
20
+ return null;
21
+ }
22
+ get WalkupScanManifestURI() {
23
+ const hpLedmWalkupScanToCompManifest = this.data["ledm:DiscoveryTree"]["ledm:SupportedIfc"].find((x) => x["dd:ResourceType"][0] === "hpCnxWalkupScanManifest");
24
+ if (hpLedmWalkupScanToCompManifest === undefined) {
25
+ return null;
26
+ }
27
+ return hpLedmWalkupScanToCompManifest["ledm:ManifestURI"][0];
28
+ }
29
+ get ScanJobManifestURI() {
30
+ const hpLedmWalkupScanToCompManifest = this.data["ledm:DiscoveryTree"]["ledm:SupportedIfc"].find((x) => x["dd:ResourceType"][0] === "ledm:hpLedmScanJobManifest");
31
+ if (hpLedmWalkupScanToCompManifest === undefined) {
32
+ return null;
33
+ }
34
+ return hpLedmWalkupScanToCompManifest["ledm:ManifestURI"][0];
35
+ }
36
+ }
37
+ exports.default = DiscoveryTree;
38
+ //# sourceMappingURL=DiscoveryTree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiscoveryTree.js","sourceRoot":"","sources":["../src/DiscoveryTree.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,mCAAgC;AAChC,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;AAC5B,+BAAiC;AACjC,MAAM,WAAW,GAAG,IAAA,gBAAS,EAA4B,MAAM,CAAC,WAAW,CAAC,CAAC;AAW7E,MAAqB,aAAa;IAGhC,YAAY,IAAuB;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,OAAe;QAC9C,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,2BAA2B;QAC7B,MAAM,8BAA8B,GAAG,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CACpE,mBAAmB,CACpB,CAAC,IAAI,CACJ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAAK,qCAAqC,CACzE,CAAC;QACF,IAAI,8BAA8B,KAAK,SAAS,EAAE;YAChD,OAAO,8BAA8B,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;SAC9D;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,qBAAqB;QACvB,MAAM,8BAA8B,GAAG,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CACpE,mBAAmB,CACpB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAAK,yBAAyB,CAAC,CAAC;QACrE,IAAI,8BAA8B,KAAK,SAAS,EAAE;YAChD,OAAO,IAAI,CAAC;SACb;QACD,OAAO,8BAA8B,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;IACD,IAAI,kBAAkB;QACpB,MAAM,8BAA8B,GAAG,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CACpE,mBAAmB,CACpB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAAK,4BAA4B,CAAC,CAAC;QACxE,IAAI,8BAA8B,KAAK,SAAS,EAAE;YAChD,OAAO,IAAI,CAAC;SACb;QACD,OAAO,8BAA8B,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;CACF;AAxCD,gCAwCC","sourcesContent":["\"use strict\";\nimport { Parser } from \"xml2js\";\nconst parser = new Parser();\nimport { promisify } from \"util\";\nconst parseString = promisify<string, DiscoveryTreeData>(parser.parseString);\n\nexport interface DiscoveryTreeData {\n \"ledm:DiscoveryTree\": {\n \"ledm:SupportedIfc\": {\n \"ledm:ManifestURI\": string[];\n \"dd:ResourceType\": string[];\n }[];\n };\n}\n\nexport default class DiscoveryTree {\n private readonly data: DiscoveryTreeData;\n\n constructor(data: DiscoveryTreeData) {\n this.data = data;\n }\n static async createDiscoveryTree(content: string): Promise<DiscoveryTree> {\n const parsed = await parseString(content);\n return new DiscoveryTree(parsed);\n }\n\n get WalkupScanToCompManifestURI(): string | null {\n const hpLedmWalkupScanToCompManifest = this.data[\"ledm:DiscoveryTree\"][\n \"ledm:SupportedIfc\"\n ].find(\n (x) => x[\"dd:ResourceType\"][0] === \"ledm:hpLedmWalkupScanToCompManifest\"\n );\n if (hpLedmWalkupScanToCompManifest !== undefined) {\n return hpLedmWalkupScanToCompManifest[\"ledm:ManifestURI\"][0];\n }\n return null;\n }\n get WalkupScanManifestURI(): string | null {\n const hpLedmWalkupScanToCompManifest = this.data[\"ledm:DiscoveryTree\"][\n \"ledm:SupportedIfc\"\n ].find((x) => x[\"dd:ResourceType\"][0] === \"hpCnxWalkupScanManifest\");\n if (hpLedmWalkupScanToCompManifest === undefined) {\n return null;\n }\n return hpLedmWalkupScanToCompManifest[\"ledm:ManifestURI\"][0];\n }\n get ScanJobManifestURI(): string | null {\n const hpLedmWalkupScanToCompManifest = this.data[\"ledm:DiscoveryTree\"][\n \"ledm:SupportedIfc\"\n ].find((x) => x[\"dd:ResourceType\"][0] === \"ledm:hpLedmScanJobManifest\");\n if (hpLedmWalkupScanToCompManifest === undefined) {\n return null;\n }\n return hpLedmWalkupScanToCompManifest[\"ledm:ManifestURI\"][0];\n }\n}\n"]}
package/dist/Event.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type EventData = {
1
+ export type EventData = {
2
2
  "dd:UnqualifiedEventCategory": string[];
3
3
  "dd:AgingStamp": string[];
4
4
  "ev:Payload": {
package/dist/Event.js CHANGED
@@ -1,47 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var Event = /** @class */ (function () {
4
- function Event(data) {
3
+ class Event {
4
+ constructor(data) {
5
5
  this.data = data;
6
6
  }
7
- Object.defineProperty(Event.prototype, "unqualifiedEventCategory", {
8
- get: function () {
9
- return this.data["dd:UnqualifiedEventCategory"][0];
10
- },
11
- enumerable: false,
12
- configurable: true
13
- });
14
- Object.defineProperty(Event.prototype, "agingStamp", {
15
- get: function () {
16
- return this.data["dd:AgingStamp"][0];
17
- },
18
- enumerable: false,
19
- configurable: true
20
- });
21
- Object.defineProperty(Event.prototype, "destinationURI", {
22
- get: function () {
23
- var destination = this.data["ev:Payload"].find(function (v) { return v["dd:ResourceType"]["0"].includes("Destination"); });
7
+ get unqualifiedEventCategory() {
8
+ return this.data["dd:UnqualifiedEventCategory"][0];
9
+ }
10
+ get agingStamp() {
11
+ return this.data["dd:AgingStamp"][0];
12
+ }
13
+ get destinationURI() {
14
+ if (this.data.hasOwnProperty("ev:Payload")) {
15
+ const destination = this.data["ev:Payload"].find((v) => v["dd:ResourceType"]["0"].includes("Destination"));
24
16
  return destination ? destination["dd:ResourceURI"]["0"] : undefined;
25
- },
26
- enumerable: false,
27
- configurable: true
28
- });
29
- Object.defineProperty(Event.prototype, "compEventURI", {
30
- get: function () {
31
- var compEvent = this.data["ev:Payload"].find(function (v) { return v["dd:ResourceType"]["0"].includes("CompEvent"); });
17
+ }
18
+ return undefined;
19
+ }
20
+ get compEventURI() {
21
+ if (this.data.hasOwnProperty("ev:Payload")) {
22
+ const compEvent = this.data["ev:Payload"].find((v) => v["dd:ResourceType"]["0"].includes("CompEvent"));
32
23
  return compEvent ? compEvent["dd:ResourceURI"]["0"] : undefined;
33
- },
34
- enumerable: false,
35
- configurable: true
36
- });
37
- Object.defineProperty(Event.prototype, "isScanEvent", {
38
- get: function () {
39
- return this.unqualifiedEventCategory === "ScanEvent";
40
- },
41
- enumerable: false,
42
- configurable: true
43
- });
44
- return Event;
45
- }());
24
+ }
25
+ return undefined;
26
+ }
27
+ get isScanEvent() {
28
+ return this.unqualifiedEventCategory === "ScanEvent";
29
+ }
30
+ }
46
31
  exports.default = Event;
47
32
  //# sourceMappingURL=Event.js.map
package/dist/Event.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Event.js","sourceRoot":"","sources":["../src/Event.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAeb;IAEE,eAAY,IAAe;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,sBAAI,2CAAwB;aAA5B;YACE,OAAO,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC;;;OAAA;IAED,sBAAI,6BAAU;aAAd;YACE,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,CAAC;;;OAAA;IAED,sBAAI,iCAAc;aAAlB;YACE,IAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAjD,CAAiD,CAAC,CAAC;YAEzG,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACtE,CAAC;;;OAAA;IAED,sBAAI,+BAAY;aAAhB;YACE,IAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,EAA/C,CAA+C,CAAC,CAAC;YAErG,OAAO,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAClE,CAAC;;;OAAA;IAED,sBAAI,8BAAW;aAAf;YACE,OAAO,IAAI,CAAC,wBAAwB,KAAK,WAAW,CAAC;QACvD,CAAC;;;OAAA;IACH,YAAC;AAAD,CAAC,AA7BD,IA6BC","sourcesContent":["\"use strict\";\n\nexport type EventData = {\n \"dd:UnqualifiedEventCategory\": string[];\n \"dd:AgingStamp\": string[];\n \"ev:Payload\": {\n \"dd:ResourceURI\": {\n \"0\": string;\n },\n \"dd:ResourceType\": {\n \"0\": string;\n };\n }[];\n};\n\nexport default class Event {\n private readonly data: EventData;\n constructor(data: EventData) {\n this.data = data;\n }\n\n get unqualifiedEventCategory(): string {\n return this.data[\"dd:UnqualifiedEventCategory\"][0];\n }\n\n get agingStamp(): string {\n return this.data[\"dd:AgingStamp\"][0];\n }\n\n get destinationURI(): string | undefined {\n const destination = this.data[\"ev:Payload\"].find(v => v[\"dd:ResourceType\"][\"0\"].includes(\"Destination\"));\n\n return destination ? destination[\"dd:ResourceURI\"][\"0\"] : undefined;\n }\n\n get compEventURI(): string | undefined {\n const compEvent = this.data[\"ev:Payload\"].find(v => v[\"dd:ResourceType\"][\"0\"].includes(\"CompEvent\"));\n\n return compEvent ? compEvent[\"dd:ResourceURI\"][\"0\"] : undefined;\n }\n\n get isScanEvent(): boolean {\n return this.unqualifiedEventCategory === \"ScanEvent\";\n }\n}\n"]}
1
+ {"version":3,"file":"Event.js","sourceRoot":"","sources":["../src/Event.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAeb,MAAqB,KAAK;IAExB,YAAY,IAAe;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,cAAc;QAChB,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE;YAC1C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACrD,CAAC,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAClD,CAAC;YAEF,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;SACrE;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,YAAY;QACd,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE;YAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACnD,CAAC,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAChD,CAAC;YAEF,OAAO,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;SACjE;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,wBAAwB,KAAK,WAAW,CAAC;IACvD,CAAC;CACF;AAvCD,wBAuCC","sourcesContent":["\"use strict\";\n\nexport type EventData = {\n \"dd:UnqualifiedEventCategory\": string[];\n \"dd:AgingStamp\": string[];\n \"ev:Payload\": {\n \"dd:ResourceURI\": {\n \"0\": string;\n };\n \"dd:ResourceType\": {\n \"0\": string;\n };\n }[];\n};\n\nexport default class Event {\n private readonly data: EventData;\n constructor(data: EventData) {\n this.data = data;\n }\n\n get unqualifiedEventCategory(): string {\n return this.data[\"dd:UnqualifiedEventCategory\"][0];\n }\n\n get agingStamp(): string {\n return this.data[\"dd:AgingStamp\"][0];\n }\n\n get destinationURI(): string | undefined {\n if (this.data.hasOwnProperty(\"ev:Payload\")) {\n const destination = this.data[\"ev:Payload\"].find((v) =>\n v[\"dd:ResourceType\"][\"0\"].includes(\"Destination\")\n );\n\n return destination ? destination[\"dd:ResourceURI\"][\"0\"] : undefined;\n }\n return undefined;\n }\n\n get compEventURI(): string | undefined {\n if (this.data.hasOwnProperty(\"ev:Payload\")) {\n const compEvent = this.data[\"ev:Payload\"].find((v) =>\n v[\"dd:ResourceType\"][\"0\"].includes(\"CompEvent\")\n );\n\n return compEvent ? compEvent[\"dd:ResourceURI\"][\"0\"] : undefined;\n }\n return undefined;\n }\n\n get isScanEvent(): boolean {\n return this.unqualifiedEventCategory === \"ScanEvent\";\n }\n}\n"]}
@@ -1,4 +1,8 @@
1
1
  import Event, { EventData } from "./Event";
2
+ export interface EtagEventTable {
3
+ etag: string;
4
+ eventTable: EventTable;
5
+ }
2
6
  export interface EventTableData {
3
7
  "ev:EventTable"?: {
4
8
  "ev:Event"?: EventData[];
@@ -7,5 +11,6 @@ export interface EventTableData {
7
11
  export default class EventTable {
8
12
  private readonly data;
9
13
  constructor(data: EventTableData);
14
+ static createEtagEventTable(content: string, etagReceived: string): Promise<EtagEventTable>;
10
15
  get events(): Event[];
11
16
  }
@@ -3,25 +3,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var Event_1 = __importDefault(require("./Event"));
7
- var EventTable = /** @class */ (function () {
8
- function EventTable(data) {
6
+ const Event_1 = __importDefault(require("./Event"));
7
+ const xml2js_1 = require("xml2js");
8
+ const parser = new xml2js_1.Parser();
9
+ const util_1 = require("util");
10
+ const parseString = (0, util_1.promisify)(parser.parseString);
11
+ class EventTable {
12
+ constructor(data) {
9
13
  this.data = data;
10
14
  }
11
- Object.defineProperty(EventTable.prototype, "events", {
12
- get: function () {
13
- var eventTable = this.data["ev:EventTable"];
14
- if (eventTable != null && eventTable["ev:Event"] != null) {
15
- return eventTable["ev:Event"].map(function (x) { return new Event_1.default(x); });
16
- }
17
- else {
18
- return [];
19
- }
20
- },
21
- enumerable: false,
22
- configurable: true
23
- });
24
- return EventTable;
25
- }());
15
+ static async createEtagEventTable(content, etagReceived) {
16
+ const parsed = await parseString(content);
17
+ return {
18
+ etag: etagReceived,
19
+ eventTable: new EventTable(parsed),
20
+ };
21
+ }
22
+ get events() {
23
+ let eventTable = this.data["ev:EventTable"];
24
+ if (eventTable != null && eventTable["ev:Event"] != null) {
25
+ return eventTable["ev:Event"].map((x) => new Event_1.default(x));
26
+ }
27
+ else {
28
+ return [];
29
+ }
30
+ }
31
+ }
26
32
  exports.default = EventTable;
27
33
  //# sourceMappingURL=EventTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventTable.js","sourceRoot":"","sources":["../src/EventTable.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,kDAA2C;AAQ3C;IAEE,oBAAY,IAAoB;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,sBAAI,8BAAM;aAAV;YACE,IAAI,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YAC5C,IAAI,UAAU,IAAI,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE;gBACxD,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,IAAI,eAAK,CAAC,CAAC,CAAC,EAAZ,CAAY,CAAC,CAAC;aACxD;iBAAM;gBACL,OAAO,EAAE,CAAC;aACX;QACH,CAAC;;;OAAA;IACH,iBAAC;AAAD,CAAC,AAdD,IAcC","sourcesContent":["\"use strict\";\n\nimport Event, { EventData } from \"./Event\";\n\nexport interface EventTableData {\n \"ev:EventTable\"?: {\n \"ev:Event\"?: EventData[];\n };\n}\n\nexport default class EventTable {\n private readonly data: EventTableData;\n constructor(data: EventTableData) {\n this.data = data;\n }\n\n get events() {\n let eventTable = this.data[\"ev:EventTable\"];\n if (eventTable != null && eventTable[\"ev:Event\"] != null) {\n return eventTable[\"ev:Event\"].map((x) => new Event(x));\n } else {\n return [];\n }\n }\n}\n"]}
1
+ {"version":3,"file":"EventTable.js","sourceRoot":"","sources":["../src/EventTable.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,oDAA2C;AAC3C,mCAAgC;AAChC,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;AAC5B,+BAAiC;AACjC,MAAM,WAAW,GAAG,IAAA,gBAAS,EAAyB,MAAM,CAAC,WAAW,CAAC,CAAC;AAa1E,MAAqB,UAAU;IAE7B,YAAY,IAAoB;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAC/B,OAAe,EACf,YAAoB;QAEpB,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO;YACL,IAAI,EAAE,YAAY;YAClB,UAAU,EAAE,IAAI,UAAU,CAAC,MAAM,CAAC;SACnC,CAAC;IACJ,CAAC;IAED,IAAI,MAAM;QACR,IAAI,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5C,IAAI,UAAU,IAAI,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE;YACxD,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,eAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SACxD;aAAM;YACL,OAAO,EAAE,CAAC;SACX;IACH,CAAC;CACF;AAzBD,6BAyBC","sourcesContent":["\"use strict\";\n\nimport Event, { EventData } from \"./Event\";\nimport { Parser } from \"xml2js\";\nconst parser = new Parser();\nimport { promisify } from \"util\";\nconst parseString = promisify<string, EventTableData>(parser.parseString);\n\nexport interface EtagEventTable {\n etag: string;\n eventTable: EventTable;\n}\n\nexport interface EventTableData {\n \"ev:EventTable\"?: {\n \"ev:Event\"?: EventData[];\n };\n}\n\nexport default class EventTable {\n private readonly data: EventTableData;\n constructor(data: EventTableData) {\n this.data = data;\n }\n\n static async createEtagEventTable(\n content: string,\n etagReceived: string\n ): Promise<EtagEventTable> {\n const parsed = await parseString(content);\n return {\n etag: etagReceived,\n eventTable: new EventTable(parsed),\n };\n }\n\n get events() {\n let eventTable = this.data[\"ev:EventTable\"];\n if (eventTable != null && eventTable[\"ev:Event\"] != null) {\n return eventTable[\"ev:Event\"].map((x) => new Event(x));\n } else {\n return [];\n }\n }\n}\n"]}
package/dist/HPApi.d.ts CHANGED
@@ -1,37 +1,45 @@
1
- import WalkupScanDestination from "./WalkupScanDestination";
2
- import WalkupScanToCompDestination from "./WalkupScanToCompDestination";
3
- import { AxiosRequestHeaders } from "axios";
4
- import EventTable from "./EventTable";
1
+ import { RawAxiosRequestHeaders } from "axios";
2
+ import { EtagEventTable } from "./EventTable";
5
3
  import Job from "./Job";
6
4
  import ScanStatus from "./ScanStatus";
5
+ import WalkupScanDestination from "./WalkupScanDestination";
6
+ import WalkupScanToCompDestination from "./WalkupScanToCompDestination";
7
7
  import WalkupScanDestinations from "./WalkupScanDestinations";
8
8
  import WalkupScanToCompDestinations from "./WalkupScanToCompDestinations";
9
9
  import ScanJobSettings from "./ScanJobSettings";
10
10
  import Destination from "./Destination";
11
11
  import WalkupScanToCompEvent from "./WalkupScanToCompEvent";
12
+ import DiscoveryTree from "./DiscoveryTree";
13
+ import WalkupScanToCompManifest from "./WalkupScanToCompManifest";
14
+ import WalkupScanToCompCaps from "./WalkupScanToCompCaps";
15
+ import WalkupScanManifest from "./WalkupScanManifest";
16
+ import ScanJobManifest from "./ScanJobManifest";
17
+ import ScanCaps from "./ScanCaps";
12
18
  export default class HPApi {
13
- static setPrinterIP(ip: string): void;
19
+ static setDeviceIP(ip: string): void;
14
20
  static setDebug(dbg: boolean): void;
15
21
  private static logDebug;
16
22
  private static callAxios;
17
- static getWalkupScanDestinations(): Promise<WalkupScanDestinations>;
23
+ static isAlive(timeout?: number | null): Promise<boolean>;
24
+ static waitDeviceUp(deviceUpPollingInterval: number): Promise<void>;
25
+ static getDiscoveryTree(): Promise<DiscoveryTree>;
26
+ static getWalkupScanDestinations(uri?: string): Promise<WalkupScanDestinations>;
18
27
  static getWalkupScanToCompDestinations(): Promise<WalkupScanToCompDestinations>;
19
- static getWalkupScanToCompCaps(): Promise<boolean>;
28
+ static getWalkupScanManifest(uri: string): Promise<WalkupScanManifest>;
29
+ static getWalkupScanToCompManifest(uri: string): Promise<WalkupScanToCompManifest>;
30
+ static getScanJobManifest(uri: string): Promise<ScanJobManifest>;
31
+ static getScanCaps(uri: string): Promise<ScanCaps>;
32
+ static getWalkupScanToCompCaps(uri: string): Promise<WalkupScanToCompCaps>;
20
33
  static getWalkupScanToCompEvent(compEventURI: string): Promise<WalkupScanToCompEvent>;
21
- static removeDestination(walkupScanDestination: WalkupScanDestination): Promise<boolean>;
22
- static registerDestination(destination: Destination, toComp: boolean): Promise<string>;
23
- static getEvents(etag?: string, timeout?: number): Promise<{
24
- etag: string;
25
- eventTable: EventTable;
26
- }>;
27
- static placeETagHeader(etag: string, headers: AxiosRequestHeaders): AxiosRequestHeaders;
34
+ static removeDestination(walkupScanDestination: WalkupScanDestination | WalkupScanToCompDestination): Promise<boolean>;
35
+ static registerWalkupScanDestination(destination: Destination): Promise<string>;
36
+ static registerWalkupScanToCompDestination(destination: Destination): Promise<string>;
37
+ static getEvents(etag?: string, decisecondTimeout?: number): Promise<EtagEventTable>;
38
+ static placeETagHeader(etag: string, headers: RawAxiosRequestHeaders): RawAxiosRequestHeaders;
28
39
  static appendTimeout(url: string, timeout?: number | null): string;
29
40
  static getDestination(destinationURL: string): Promise<WalkupScanDestination | WalkupScanToCompDestination>;
30
- static createWalkupScanDestination(content: string): Promise<WalkupScanDestination>;
31
- static createWalkupScanToCompDestination(content: string): Promise<WalkupScanToCompDestination>;
32
- static createWalkupScanToCompEvent(content: string): Promise<WalkupScanToCompEvent>;
33
41
  static getScanStatus(): Promise<ScanStatus>;
34
- static delay(t: number): Promise<unknown>;
42
+ static delay(t: number): Promise<void>;
35
43
  static postJob(job: ScanJobSettings): Promise<string>;
36
44
  /**
37
45
  * @param jobURL