@operato/scene-label 1.0.0-alpha.23 → 1.0.0-alpha.26

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.
@@ -1,35 +0,0 @@
1
- 2022-06-13T12:01:55+09:00 info: Initializing ConnectionManager...
2
- 2022-06-13T12:01:55+09:00 info: Connector 'echo-back-server' started to ready
3
- 2022-06-13T12:01:55+09:00 info: Connector 'echo-back' started to ready
4
- 2022-06-13T12:01:55+09:00 info: Connector 'http-connector' started to ready
5
- 2022-06-13T12:01:55+09:00 info: Connector 'graphql-connector' started to ready
6
- 2022-06-13T12:01:55+09:00 info: Connector 'sqlite-connector' started to ready
7
- 2022-06-13T12:01:55+09:00 info: Connector 'postgresql-connector' started to ready
8
- 2022-06-13T12:01:55+09:00 info: Connector 'mqtt-connector' started to ready
9
- 2022-06-13T12:01:55+09:00 info: Connector 'mssql-connector' started to ready
10
- 2022-06-13T12:01:55+09:00 info: Connector 'oracle-connector' started to ready
11
- 2022-06-13T12:01:55+09:00 info: Connector 'mysql-connector' started to ready
12
- 2022-06-13T12:01:55+09:00 info: Connector 'socket-server' started to ready
13
- 2022-06-13T12:01:55+09:00 info: echo-back-servers are ready
14
- 2022-06-13T12:01:55+09:00 info: echo-back connections are ready
15
- 2022-06-13T12:01:55+09:00 info: http-connector connections are ready
16
- 2022-06-13T12:01:55+09:00 info: graphql-connector connections are ready
17
- 2022-06-13T12:01:55+09:00 info: sqlite-connector connections are ready
18
- 2022-06-13T12:01:55+09:00 info: postgresql-connector connections are ready
19
- 2022-06-13T12:01:55+09:00 info: mqtt-connector connections are ready
20
- 2022-06-13T12:01:55+09:00 info: mssql-connector connections are ready
21
- 2022-06-13T12:01:55+09:00 info: oracle-connector connections are ready
22
- 2022-06-13T12:01:55+09:00 info: mysql-connector connections are ready
23
- 2022-06-13T12:01:55+09:00 info: socket servers are ready
24
- 2022-06-13T12:01:55+09:00 info: All connector for 'echo-back-server' ready
25
- 2022-06-13T12:01:55+09:00 info: All connector for 'echo-back' ready
26
- 2022-06-13T12:01:55+09:00 info: All connector for 'http-connector' ready
27
- 2022-06-13T12:01:55+09:00 info: All connector for 'graphql-connector' ready
28
- 2022-06-13T12:01:55+09:00 info: All connector for 'sqlite-connector' ready
29
- 2022-06-13T12:01:55+09:00 info: All connector for 'postgresql-connector' ready
30
- 2022-06-13T12:01:55+09:00 info: All connector for 'mqtt-connector' ready
31
- 2022-06-13T12:01:55+09:00 info: All connector for 'mssql-connector' ready
32
- 2022-06-13T12:01:55+09:00 info: All connector for 'oracle-connector' ready
33
- 2022-06-13T12:01:55+09:00 info: All connector for 'mysql-connector' ready
34
- 2022-06-13T12:01:55+09:00 info: All connector for 'socket-server' ready
35
- 2022-06-13T12:01:55+09:00 info: ConnectionManager initialization done:
@@ -1,35 +0,0 @@
1
- 2022-06-15T23:37:40+09:00 info: Initializing ConnectionManager...
2
- 2022-06-15T23:37:40+09:00 info: Connector 'echo-back-server' started to ready
3
- 2022-06-15T23:37:40+09:00 info: Connector 'echo-back' started to ready
4
- 2022-06-15T23:37:40+09:00 info: Connector 'http-connector' started to ready
5
- 2022-06-15T23:37:40+09:00 info: Connector 'graphql-connector' started to ready
6
- 2022-06-15T23:37:40+09:00 info: Connector 'sqlite-connector' started to ready
7
- 2022-06-15T23:37:40+09:00 info: Connector 'postgresql-connector' started to ready
8
- 2022-06-15T23:37:40+09:00 info: Connector 'mqtt-connector' started to ready
9
- 2022-06-15T23:37:40+09:00 info: Connector 'mssql-connector' started to ready
10
- 2022-06-15T23:37:40+09:00 info: Connector 'oracle-connector' started to ready
11
- 2022-06-15T23:37:40+09:00 info: Connector 'mysql-connector' started to ready
12
- 2022-06-15T23:37:40+09:00 info: Connector 'socket-server' started to ready
13
- 2022-06-15T23:37:40+09:00 info: echo-back-servers are ready
14
- 2022-06-15T23:37:40+09:00 info: echo-back connections are ready
15
- 2022-06-15T23:37:40+09:00 info: http-connector connections are ready
16
- 2022-06-15T23:37:40+09:00 info: graphql-connector connections are ready
17
- 2022-06-15T23:37:40+09:00 info: sqlite-connector connections are ready
18
- 2022-06-15T23:37:40+09:00 info: postgresql-connector connections are ready
19
- 2022-06-15T23:37:40+09:00 info: mqtt-connector connections are ready
20
- 2022-06-15T23:37:40+09:00 info: mssql-connector connections are ready
21
- 2022-06-15T23:37:40+09:00 info: oracle-connector connections are ready
22
- 2022-06-15T23:37:40+09:00 info: mysql-connector connections are ready
23
- 2022-06-15T23:37:40+09:00 info: socket servers are ready
24
- 2022-06-15T23:37:40+09:00 info: All connector for 'echo-back-server' ready
25
- 2022-06-15T23:37:40+09:00 info: All connector for 'echo-back' ready
26
- 2022-06-15T23:37:40+09:00 info: All connector for 'http-connector' ready
27
- 2022-06-15T23:37:40+09:00 info: All connector for 'graphql-connector' ready
28
- 2022-06-15T23:37:40+09:00 info: All connector for 'sqlite-connector' ready
29
- 2022-06-15T23:37:40+09:00 info: All connector for 'postgresql-connector' ready
30
- 2022-06-15T23:37:40+09:00 info: All connector for 'mqtt-connector' ready
31
- 2022-06-15T23:37:40+09:00 info: All connector for 'mssql-connector' ready
32
- 2022-06-15T23:37:40+09:00 info: All connector for 'oracle-connector' ready
33
- 2022-06-15T23:37:40+09:00 info: All connector for 'mysql-connector' ready
34
- 2022-06-15T23:37:40+09:00 info: All connector for 'socket-server' ready
35
- 2022-06-15T23:37:40+09:00 info: ConnectionManager initialization done:
@@ -1,35 +0,0 @@
1
- 2022-06-16T17:15:41+09:00 info: Initializing ConnectionManager...
2
- 2022-06-16T17:15:41+09:00 info: Connector 'echo-back-server' started to ready
3
- 2022-06-16T17:15:41+09:00 info: Connector 'echo-back' started to ready
4
- 2022-06-16T17:15:41+09:00 info: Connector 'http-connector' started to ready
5
- 2022-06-16T17:15:41+09:00 info: Connector 'graphql-connector' started to ready
6
- 2022-06-16T17:15:41+09:00 info: Connector 'sqlite-connector' started to ready
7
- 2022-06-16T17:15:41+09:00 info: Connector 'postgresql-connector' started to ready
8
- 2022-06-16T17:15:41+09:00 info: Connector 'mqtt-connector' started to ready
9
- 2022-06-16T17:15:41+09:00 info: Connector 'mssql-connector' started to ready
10
- 2022-06-16T17:15:41+09:00 info: Connector 'oracle-connector' started to ready
11
- 2022-06-16T17:15:41+09:00 info: Connector 'mysql-connector' started to ready
12
- 2022-06-16T17:15:41+09:00 info: Connector 'socket-server' started to ready
13
- 2022-06-16T17:15:41+09:00 info: echo-back-servers are ready
14
- 2022-06-16T17:15:41+09:00 info: echo-back connections are ready
15
- 2022-06-16T17:15:41+09:00 info: http-connector connections are ready
16
- 2022-06-16T17:15:41+09:00 info: graphql-connector connections are ready
17
- 2022-06-16T17:15:41+09:00 info: sqlite-connector connections are ready
18
- 2022-06-16T17:15:41+09:00 info: postgresql-connector connections are ready
19
- 2022-06-16T17:15:41+09:00 info: mqtt-connector connections are ready
20
- 2022-06-16T17:15:41+09:00 info: mssql-connector connections are ready
21
- 2022-06-16T17:15:41+09:00 info: oracle-connector connections are ready
22
- 2022-06-16T17:15:41+09:00 info: mysql-connector connections are ready
23
- 2022-06-16T17:15:41+09:00 info: socket servers are ready
24
- 2022-06-16T17:15:41+09:00 info: All connector for 'echo-back-server' ready
25
- 2022-06-16T17:15:41+09:00 info: All connector for 'echo-back' ready
26
- 2022-06-16T17:15:41+09:00 info: All connector for 'http-connector' ready
27
- 2022-06-16T17:15:41+09:00 info: All connector for 'graphql-connector' ready
28
- 2022-06-16T17:15:41+09:00 info: All connector for 'sqlite-connector' ready
29
- 2022-06-16T17:15:41+09:00 info: All connector for 'postgresql-connector' ready
30
- 2022-06-16T17:15:41+09:00 info: All connector for 'mqtt-connector' ready
31
- 2022-06-16T17:15:41+09:00 info: All connector for 'mssql-connector' ready
32
- 2022-06-16T17:15:41+09:00 info: All connector for 'oracle-connector' ready
33
- 2022-06-16T17:15:41+09:00 info: All connector for 'mysql-connector' ready
34
- 2022-06-16T17:15:41+09:00 info: All connector for 'socket-server' ready
35
- 2022-06-16T17:15:41+09:00 info: ConnectionManager initialization done:
@@ -1,21 +0,0 @@
1
- import ZebraBrowserPrintWrapper from 'zebra-browser-print-wrapper'
2
-
3
- export class BrowserPrinter {
4
- printer = new ZebraBrowserPrintWrapper()
5
-
6
- async print(content: string) {
7
- try {
8
- const defaultPrinter = await this.printer.getDefaultPrinter()
9
- this.printer.setPrinter(defaultPrinter)
10
-
11
- const status = await this.printer.checkPrinterStatus()
12
- if (status.isReadyToPrint) {
13
- this.printer.print(content)
14
- } else {
15
- throw new Error(`Browser Printer is not ready to print (${status.errors})`)
16
- }
17
- } catch (error) {
18
- throw new Error(error as string)
19
- }
20
- }
21
- }
@@ -1,84 +0,0 @@
1
- const DEFAULT_FILTERS = [
2
- {
3
- vendorId: 0x0a5f /* zebra */
4
- },
5
- {
6
- vendorId: 0x04f9 /* brother */
7
- },
8
- {
9
- vendorId: 0x0828 /* sato */
10
- }
11
- ]
12
-
13
- export class USBPrinter {
14
- filters: {
15
- vendorId: number
16
- }[] = DEFAULT_FILTERS
17
-
18
- device: any
19
-
20
- constructor(filters = DEFAULT_FILTERS) {
21
- this.filters = filters
22
- }
23
-
24
- async setup() {
25
- //@ts-ignore
26
- if (!navigator.usb) {
27
- throw new Error('Browser could not access USB device. You can print only https or localhost origin.')
28
- }
29
-
30
- //@ts-ignore
31
- var selectedDevice = await navigator.usb.requestDevice({
32
- filters: this.filters
33
- })
34
-
35
- this.device = selectedDevice
36
- console.log(this.device)
37
-
38
- await this.device.open()
39
- if (!this.device.configuration) {
40
- await this.device.selectConfiguration(1)
41
- }
42
- await this.device.claimInterface(0)
43
- if (!this.device.configuration.interfaces[0].alternate) {
44
- await this.device.selectAlternateInterface(0, 0)
45
- }
46
- }
47
-
48
- async read() {
49
- const { endpointNumber } = this.device.configuration.interfaces[0].alternate.endpoints[0]
50
-
51
- var result = await this.device.transferIn(endpointNumber, 64)
52
- var textDecoder = new TextDecoder()
53
-
54
- return textDecoder.decode(result.data)
55
- }
56
-
57
- async _print(content: string) {
58
- var encoder = new TextEncoder()
59
- var data = encoder.encode(content)
60
-
61
- const { endpointNumber } = this.device.configuration.interfaces[0].alternate.endpoints[1]
62
- await this.device.transferOut(endpointNumber, data)
63
- }
64
-
65
- async connectAndPrint(content: string) {
66
- this.print(content)
67
- }
68
-
69
- async print(content: string) {
70
- try {
71
- if (!this.device) {
72
- await this.setup()
73
- await this._print(content)
74
- } else {
75
- await this._print(content)
76
- }
77
- } catch (e) {
78
- console.log(e)
79
- delete this.device
80
-
81
- throw e
82
- }
83
- }
84
- }