@timokunze/node-printer 0.6.4 → 0.6.5

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.
package/README.md CHANGED
@@ -4,6 +4,8 @@ Native bind printers on POSIX and Windows OS from Node.js, electron and node-web
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/@timokunze%2Fnode-printer.svg)](https://www.npmjs.com/package/@timokunze/node-printer) [![Prebuild Binaries and Publish](https://github.com/TimoKunze/node-printer/actions/workflows/prebuild-main.yml/badge.svg)](https://github.com/TimoKunze/node-printer/actions/workflows/prebuild-main.yml)
6
6
 
7
+ > Me (TimoKunze) created this fork to upgrade dependencies since I ran into various issues with current versions of Node and Electron.
8
+
7
9
  > It just works with Node 12 because of @thiagoelg in his [PR](https://github.com/tojocky/node-printer/pull/261)
8
10
 
9
11
  > Prebuild and CI integration courtesy of @ekoeryanto in his [FORK](https://github.com/ekoeryanto/node-printer)
@@ -52,7 +54,7 @@ See [examples](https://github.com/TimoKunze/node-printer/tree/main/examples)
52
54
 
53
55
  ### Contibutors:
54
56
 
55
- * Timo Kunze
57
+ * Timo Kunze, @timokunze
56
58
  * Thiago Lugli, @thiagoelg
57
59
  * Eko Eryanto, @ekoeryanto
58
60
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@timokunze/node-printer",
3
3
  "description": "Node.js printer bindings",
4
- "version": "0.6.4",
4
+ "version": "0.6.5",
5
5
  "homepage": "https://github.com/TimoKunze/node-printer",
6
6
  "author": {
7
7
  "name": "Ion Lupascu",
@@ -76,6 +76,7 @@ namespace{
76
76
  #define STATUS_PRINTER_ADD(value, type) result.insert(std::make_pair(value, type))
77
77
  STATUS_PRINTER_ADD("BUSY", PRINTER_STATUS_BUSY);
78
78
  STATUS_PRINTER_ADD("DOOR-OPEN", PRINTER_STATUS_DOOR_OPEN);
79
+ STATUS_PRINTER_ADD("DRIVER_UPDATE_NEEDED", PRINTER_STATUS_DRIVER_UPDATE_NEEDED);
79
80
  STATUS_PRINTER_ADD("ERROR", PRINTER_STATUS_ERROR);
80
81
  STATUS_PRINTER_ADD("INITIALIZING", PRINTER_STATUS_INITIALIZING);
81
82
  STATUS_PRINTER_ADD("IO-ACTIVE", PRINTER_STATUS_IO_ACTIVE);
@@ -94,6 +95,7 @@ namespace{
94
95
  STATUS_PRINTER_ADD("POWER-SAVE", PRINTER_STATUS_POWER_SAVE);
95
96
  STATUS_PRINTER_ADD("PRINTING", PRINTER_STATUS_PRINTING);
96
97
  STATUS_PRINTER_ADD("PROCESSING", PRINTER_STATUS_PROCESSING);
98
+ STATUS_PRINTER_ADD("SERVER-OFFLINE", PRINTER_STATUS_SERVER_OFFLINE);
97
99
  STATUS_PRINTER_ADD("SERVER-UNKNOWN", PRINTER_STATUS_SERVER_UNKNOWN);
98
100
  STATUS_PRINTER_ADD("TONER-LOW", PRINTER_STATUS_TONER_LOW);
99
101
  STATUS_PRINTER_ADD("USER-INTERVENTION", PRINTER_STATUS_USER_INTERVENTION);
@@ -150,6 +152,7 @@ namespace{
150
152
  #define ATTRIBUTE_PRINTER_ADD(value, type) result.insert(std::make_pair(value, type))
151
153
  ATTRIBUTE_PRINTER_ADD("DIRECT", PRINTER_ATTRIBUTE_DIRECT);
152
154
  ATTRIBUTE_PRINTER_ADD("DO-COMPLETE-FIRST", PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST);
155
+ ATTRIBUTE_PRINTER_ADD("ENABLE-BIDI", PRINTER_ATTRIBUTE_ENABLE_BIDI);
153
156
  ATTRIBUTE_PRINTER_ADD("ENABLE-DEVQ", PRINTER_ATTRIBUTE_ENABLE_DEVQ);
154
157
  ATTRIBUTE_PRINTER_ADD("HIDDEN", PRINTER_ATTRIBUTE_HIDDEN);
155
158
  ATTRIBUTE_PRINTER_ADD("KEEPPRINTEDJOBS", PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS);
@@ -170,6 +173,7 @@ namespace{
170
173
  ATTRIBUTE_PRINTER_ADD("MACHINE", PRINTER_ATTRIBUTE_MACHINE);
171
174
  ATTRIBUTE_PRINTER_ADD("PUSHED-USER", PRINTER_ATTRIBUTE_PUSHED_USER);
172
175
  ATTRIBUTE_PRINTER_ADD("PUSHED-MACHINE", PRINTER_ATTRIBUTE_PUSHED_MACHINE);
176
+ ATTRIBUTE_PRINTER_ADD("TS_GENERIC_DRIVER", PRINTER_ATTRIBUTE_TS_GENERIC_DRIVER);
173
177
  #endif
174
178
  // server 2003
175
179
  #ifdef PRINTER_ATTRIBUTE_TS
package/types/index.d.ts CHANGED
@@ -54,4 +54,6 @@ export interface JobDetails {
54
54
  processingTime: Date;
55
55
  }
56
56
 
57
- export type JobStatus = 'PAUSED' | 'PRINTING' | 'PRINTED' | 'CANCELLED' | 'PENDING' | 'ABORTED';
57
+ export type JobStatus = 'PAUSED' | 'PRINTING' | 'PRINTED' | 'CANCELLED' | 'PENDING' | 'ABORTED';
58
+
59
+ declare module '@timokunze/node-printer';
@@ -1,10 +0,0 @@
1
- #!/bin/bash
2
- VERSION=$1
3
-
4
- # # Build Electron Linux 64bit
5
- node-pre-gyp configure --target=$VERSION --arch=x64 --dist-url=https://electronjs.org/headers --module_name=node_printer --module_path=../lib/
6
- node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=x64 --build-from-source
7
-
8
- # #Build Electron Linux 32bit
9
- node-pre-gyp configure --target=$VERSION --arch=ia32 --dist-url=https://electronjs.org/headers --module_name=node_printer --module_path=../lib/
10
- node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=ia32 --build-from-source
@@ -1,20 +0,0 @@
1
- #
2
- # Usage: buildElectronWindows.ps1 <version>
3
- #
4
-
5
- if ($args.Length -ne 1) {
6
- echo "Must Supply only 1 argument - Version"
7
- return
8
- }
9
-
10
- $version = $args[0]
11
-
12
- echo "Building Electron Version -> $version"
13
-
14
- # Build Electron Windows 64bit
15
- node_modules\.bin\node-pre-gyp.cmd configure --target=$version --arch=x64 --dist-url=https://electronjs.org/headers --module_name=node_printer
16
- node_modules\.bin\node-pre-gyp.cmd build package --runtime=electron --target=$version --target_arch=x64 --build-from-source
17
-
18
- # Build Electron Windows 32bit
19
- node_modules\.bin\node-pre-gyp.cmd configure --target=$version --arch=ia32 --dist-url=https://electronjs.org/headers --module_name=node_printer
20
- node_modules\.bin\node-pre-gyp.cmd build package --runtime=electron --target=$version --target_arch=ia32 --build-from-source
@@ -1,23 +0,0 @@
1
- # Build Win32 64bit
2
- # node_modules\.bin\node-pre-gyp.cmd configure --target=$env:nodejs_version
3
- # node_modules\.bin\node-pre-gyp.cmd build package --target=$env:nodejs_version --target_arch=x64
4
-
5
- # Build Win32 32bit
6
- # node_modules\.bin\node-pre-gyp.cmd configure --target=$env:nodejs_version
7
- # node_modules\.bin\node-pre-gyp.cmd build package --target=$env:nodejs_version --target_arch=ia32
8
-
9
- if ($env:build_electron -ne "true") {
10
- echo "Skipping Electron Build as flag not set"
11
- return
12
- }
13
-
14
- # Build Electron Versions
15
- ./tools/buildElectronWindows.ps1 1.2.8
16
- ./tools/buildElectronWindows.ps1 1.3.8
17
- ./tools/buildElectronWindows.ps1 1.4.6
18
- ./tools/buildElectronWindows.ps1 1.7.12
19
- ./tools/buildElectronWindows.ps1 2.0.18
20
- ./tools/buildElectronWindows.ps1 3.1.13
21
- ./tools/buildElectronWindows.ps1 4.2.10
22
- ./tools/buildElectronWindows.ps1 5.0.10
23
- ./tools/buildElectronWindows.ps1 6.0.7
@@ -1,59 +0,0 @@
1
- #!/bin/bash
2
-
3
- RELEASE_VERSION=$1
4
- PACKAGE_VERSION=$(node -pe "require('./package.json').version")
5
- SOURCE_PATH="${BASH_SOURCE%/*}/.."
6
-
7
- declare -a node_versions=(
8
- "0.10.48"
9
- "0.12.18"
10
- "4.9.1"
11
- "5.9.1"
12
- "6.17.1"
13
- "8.16.1"
14
- "10.16.0"
15
- "11.15.0"
16
- "12.10.0"
17
- )
18
-
19
- declare -a electron_versions=(
20
- "1.2.8"
21
- "1.3.8"
22
- "1.4.6"
23
- "1.7.12"
24
- "2.0.18"
25
- "3.1.13"
26
- "4.2.10"
27
- "5.0.10"
28
- "6.0.7"
29
- )
30
-
31
- # remove old build directory
32
- rm -rf "$SOURCHE_PATH/build" > /dev/null
33
-
34
- # create release path
35
- mkdir -p "$SOURCE_PATH/releases/$RELEASE_VERSION" > /dev/null
36
-
37
- for version in "${node_versions[@]}"
38
- do
39
- echo "Building for node version: $version..."
40
- node-pre-gyp configure --target=$version --module_name=node_printer --silent
41
- node-pre-gyp build package --target=$version --target_arch=x64 --build-from-source --silent
42
- node-pre-gyp configure --target=$version --module_name=node_printer --silent
43
- node-pre-gyp build package --target=$version --target_arch=ia32 --build-from-source --silent
44
- rsync -a -v "$SOURCE_PATH/build/stage/$PACKAGE_VERSION/" "$SOURCE_PATH/releases/$RELEASE_VERSION/" --remove-source-files > /dev/null
45
- echo "Done"
46
- done
47
-
48
- for version in "${electron_versions[@]}"
49
- do
50
- echo "Building for electron version: $version..."
51
- node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent
52
- node-pre-gyp build package --target=$version --target_arch=x64 --runtime=electron --build-from-source --silent
53
- node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent
54
- node-pre-gyp build package --target=$version --target_arch=ia32 --runtime=electron --build-from-source --silent
55
- rsync -a -v "$SOURCE_PATH/build/stage/$PACKAGE_VERSION/" "$SOURCE_PATH/releases/$RELEASE_VERSION/" --remove-source-files > /dev/null
56
- echo "Done"
57
- done
58
-
59
- echo "Finished succesfully!"
@@ -1,63 +0,0 @@
1
- param (
2
- [Parameter(Mandatory=$true)][string]$release
3
- )
4
-
5
- $SOURCE_PATH = split-path -parent $MyInvocation.MyCommand.Definition
6
- $RELEASE_VERSION = $release
7
- $PACKAGE_VERSION = node -pe "require('./package.json').version"
8
-
9
- echo $SOURCE_PATH
10
-
11
- $node_versions = @(
12
- "0.10.48",
13
- "0.12.18",
14
- "4.9.1",
15
- "5.9.1",
16
- "6.17.1",
17
- "8.16.1",
18
- "10.16.0",
19
- "11.15.0",
20
- "12.10.0"
21
- )
22
-
23
- $electron_versions = @(
24
- "1.2.8",
25
- "1.3.8",
26
- "1.4.6",
27
- "1.7.12",
28
- "2.0.18",
29
- "3.1.13",
30
- "4.2.10",
31
- "5.0.10",
32
- "6.0.7"
33
- )
34
-
35
- # remove old build directory
36
- Remove-Item -Recurse -Force $SOURCE_PATH'\..\build' -ErrorAction Ignore | Out-Null
37
-
38
- # create release path
39
- New-Item $SOURCE_PATH'\..\releases\'$RELEASE_VERSION -ItemType Directory -ea 0 | Out-Null
40
-
41
- foreach ($version in $node_versions) {
42
- Write-Output "Building for node version: $version..."
43
- node-pre-gyp configure --target=$version --module_name=node_printer --silent | Out-Null
44
- node-pre-gyp build package --target=$version --target_arch=x64 --build-from-source --silent | Out-Null
45
- node-pre-gyp configure --target=$version --module_name=node_printer --silent | Out-Null
46
- node-pre-gyp build package --target=$version --target_arch=ia32 --build-from-source --silent | Out-Null
47
- Copy-item -Force -Recurse $SOURCE_PATH'\..\build\stage\'$PACKAGE_VERSION\* -Destination $SOURCE_PATH'\..\releases\'$RELEASE_VERSION -ErrorAction Ignore | Out-Null
48
- Remove-Item -Recurse -Force $SOURCE_PATH'\..\build\stage' | Out-Null
49
- Write-Output "Done"
50
- }
51
-
52
- foreach ($version in $electron_versions) {
53
- Write-Output "Building for electron version: $version..."
54
- node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent | Out-Null
55
- node-pre-gyp build package --target=$version --target_arch=x64 --runtime=electron --build-from-source --silent | Out-Null
56
- node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent | Out-Null
57
- node-pre-gyp build package --target=$version --target_arch=ia32 --runtime=electron --build-from-source --silent | Out-Null
58
- Copy-item -Force -Recurse $SOURCE_PATH'\..\build\stage\'$PACKAGE_VERSION\* -Destination $SOURCE_PATH'\..\releases\'$RELEASE_VERSION -ErrorAction Ignore | Out-Null
59
- Remove-Item -Recurse -Force $SOURCE_PATH'\..\build\stage' | Out-Null
60
- Write-Output "Done"
61
- }
62
-
63
- Write-Output "Finished succesfully!"