@reservation-studio/electron-types 0.0.11 → 0.0.12
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
|
@@ -40,7 +40,10 @@ Methods for working with certificates:
|
|
|
40
40
|
const certificates = await ReservationStudioElectron.certificates.list();
|
|
41
41
|
|
|
42
42
|
// Validate a certificate PIN
|
|
43
|
-
const isValid = await ReservationStudioElectron.certificates.isValidPin(
|
|
43
|
+
const isValid = await ReservationStudioElectron.certificates.isValidPin(
|
|
44
|
+
slot,
|
|
45
|
+
pin
|
|
46
|
+
);
|
|
44
47
|
```
|
|
45
48
|
|
|
46
49
|
### XML Signing
|
|
@@ -97,33 +100,36 @@ const devices = await ReservationStudioElectron.fiscalDevices.list();
|
|
|
97
100
|
await ReservationStudioElectron.fiscalDevices.setActiveDevice(serialNumber);
|
|
98
101
|
|
|
99
102
|
// Get the active fiscal device
|
|
100
|
-
const activeDevice =
|
|
103
|
+
const activeDevice =
|
|
104
|
+
await ReservationStudioElectron.fiscalDevices.getActiveDevice();
|
|
101
105
|
|
|
102
106
|
// Print a fiscal receipt
|
|
103
|
-
const receiptNumber =
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
107
|
+
const receiptNumber =
|
|
108
|
+
await ReservationStudioElectron.fiscalDevices.printReceipt({
|
|
109
|
+
operatorNumber: 1,
|
|
110
|
+
operatorPassword: '1',
|
|
111
|
+
items: [
|
|
112
|
+
{
|
|
113
|
+
name: 'Product 1',
|
|
114
|
+
price: 10.0,
|
|
115
|
+
quantity: 1,
|
|
116
|
+
vatGroup: 'A'
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
payments: [
|
|
120
|
+
{
|
|
121
|
+
type: 'cash',
|
|
122
|
+
amount: 10.0
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
});
|
|
121
126
|
|
|
122
127
|
// Print non-fiscal text
|
|
123
128
|
await ReservationStudioElectron.fiscalDevices.printText('Hello, World!');
|
|
124
129
|
|
|
125
130
|
// Get the last fiscal memory record
|
|
126
|
-
const lastRecord =
|
|
131
|
+
const lastRecord =
|
|
132
|
+
await ReservationStudioElectron.fiscalDevices.getLastFiscalRecord();
|
|
127
133
|
|
|
128
134
|
// Get the fiscal device status
|
|
129
135
|
const status = await ReservationStudioElectron.fiscalDevices.getStatus();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CertificateInfo } from './certificate-info.interface';
|
|
2
2
|
import { HttpOptions, HttpResponse } from './http.interface';
|
|
3
3
|
import { EnvironmentEnum } from '../enums/envirovment.enum';
|
|
4
|
-
import { FiscalDeviceStatus, FiscalMemoryRecord, FiscalReceipt } from './fiscal-device.interface';
|
|
4
|
+
import { FiscalDeviceInfo, FiscalDeviceStatus, FiscalMemoryRecord, FiscalReceipt } from './fiscal-device.interface';
|
|
5
5
|
export interface ApiInterface {
|
|
6
6
|
/**
|
|
7
7
|
* An object representing operations related to certificates.
|
|
@@ -88,30 +88,24 @@ export interface ApiInterface {
|
|
|
88
88
|
* Gets a list of all detected fiscal devices.
|
|
89
89
|
* Automatically initializes fiscal devices if needed.
|
|
90
90
|
*
|
|
91
|
-
* @return {Promise<
|
|
91
|
+
* @return {Promise<FiscalDeviceInfo[]>} A promise that resolves to an array of fiscal device information.
|
|
92
92
|
*/
|
|
93
|
-
list(): Promise<
|
|
94
|
-
manufacturer: string;
|
|
95
|
-
model: string;
|
|
96
|
-
serialNumber: string;
|
|
97
|
-
}>>;
|
|
93
|
+
list(): Promise<FiscalDeviceInfo[]>;
|
|
98
94
|
/**
|
|
99
95
|
* Sets the active fiscal device.
|
|
100
96
|
*
|
|
101
97
|
* @param {string} serialNumber - The serial number of the device to set as active.
|
|
102
|
-
* @return {Promise<
|
|
98
|
+
* @return {Promise<void>} A promise that resolves when the device is successfully set as active.
|
|
99
|
+
* @throws {Error} If the device with the specified serial number is not found.
|
|
103
100
|
*/
|
|
104
|
-
setActiveDevice(serialNumber: string): Promise<
|
|
101
|
+
setActiveDevice(serialNumber: string): Promise<void>;
|
|
105
102
|
/**
|
|
106
103
|
* Gets the active fiscal device.
|
|
107
104
|
*
|
|
108
|
-
* @return {Promise<
|
|
105
|
+
* @return {Promise<FiscalDeviceInfo>} A promise that resolves to the active fiscal device information.
|
|
106
|
+
* @throws {Error} If no active device is set.
|
|
109
107
|
*/
|
|
110
|
-
getActiveDevice(): Promise<
|
|
111
|
-
manufacturer: string;
|
|
112
|
-
model: string;
|
|
113
|
-
serialNumber: string;
|
|
114
|
-
} | null>;
|
|
108
|
+
getActiveDevice(): Promise<FiscalDeviceInfo>;
|
|
115
109
|
/**
|
|
116
110
|
* Prints a fiscal receipt using the active device.
|
|
117
111
|
*
|
|
@@ -202,3 +202,20 @@ export interface FiscalDeviceStatus {
|
|
|
202
202
|
*/
|
|
203
203
|
errorMessage?: string;
|
|
204
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Interface for fiscal device information in list responses
|
|
207
|
+
*/
|
|
208
|
+
export interface FiscalDeviceInfo {
|
|
209
|
+
/**
|
|
210
|
+
* The manufacturer of the fiscal device
|
|
211
|
+
*/
|
|
212
|
+
manufacturer: string;
|
|
213
|
+
/**
|
|
214
|
+
* The model name of the fiscal device
|
|
215
|
+
*/
|
|
216
|
+
model: string;
|
|
217
|
+
/**
|
|
218
|
+
* The serial number of the fiscal device
|
|
219
|
+
*/
|
|
220
|
+
serialNumber: string;
|
|
221
|
+
}
|