@reservation-studio/electron-types 0.0.31 → 0.0.32

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 (24) hide show
  1. package/dist/api/exports.d.ts +2 -5
  2. package/dist/api/exports.js +1 -4
  3. package/dist/interfaces/{api.interface.d.ts → public/api.interface.d.ts} +17 -16
  4. package/dist/interfaces/public/fiscal-device/device.types.d.ts +222 -0
  5. package/dist/interfaces/public/fiscal-device/diagnostics.types.d.ts +47 -0
  6. package/dist/interfaces/public/fiscal-device/diagnostics.types.js +2 -0
  7. package/dist/interfaces/public/fiscal-device/errors.types.d.ts +78 -0
  8. package/dist/interfaces/public/fiscal-device/errors.types.js +50 -0
  9. package/dist/interfaces/public/fiscal-device/index.d.ts +5 -0
  10. package/dist/interfaces/public/fiscal-device/index.js +21 -0
  11. package/dist/interfaces/public/fiscal-device/receipts.types.d.ts +170 -0
  12. package/dist/interfaces/{fiscal-device.interface.js → public/fiscal-device/receipts.types.js} +1 -8
  13. package/dist/interfaces/public/fiscal-device/shared.types.d.ts +36 -0
  14. package/dist/interfaces/public/fiscal-device/shared.types.js +10 -0
  15. package/dist/interfaces/public/http.interface.js +2 -0
  16. package/dist/interfaces/public/index.d.ts +4 -0
  17. package/dist/interfaces/public/index.js +20 -0
  18. package/package.json +1 -1
  19. package/dist/interfaces/fiscal-device.interface.d.ts +0 -469
  20. /package/dist/interfaces/{api.interface.js → public/api.interface.js} +0 -0
  21. /package/dist/interfaces/{certificate-info.interface.d.ts → public/certificate-info.interface.d.ts} +0 -0
  22. /package/dist/interfaces/{certificate-info.interface.js → public/certificate-info.interface.js} +0 -0
  23. /package/dist/interfaces/{http.interface.js → public/fiscal-device/device.types.js} +0 -0
  24. /package/dist/interfaces/{http.interface.d.ts → public/http.interface.d.ts} +0 -0
@@ -1,469 +0,0 @@
1
- /**
2
- * Types for fiscal device communication between renderer and main process.
3
- */
4
- export type DeviceId = string;
5
- export type TransportType = 'serial' | 'tcp' | 'bluetooth-spp' | 'bluetooth-ble' | 'hid' | 'sdk';
6
- /**
7
- * Interface for operator information
8
- */
9
- export interface OperatorInfo {
10
- /**
11
- * The operator number
12
- */
13
- number: number;
14
- /**
15
- * A string representing the password for authentication or security purposes.
16
- * This variable typically holds sensitive information and should be handled securely.
17
- * Ensure this value is kept private and not exposed in any logs or outputs.
18
- */
19
- password: string;
20
- /**
21
- * Optional operator code. If not provided, driver may derive it from operator number.
22
- */
23
- code?: string;
24
- }
25
- export interface DeviceCapabilities {
26
- supportedOperations: {
27
- printFiscalReceipt: boolean;
28
- printNonFiscalReceipt: boolean;
29
- printReversalReceipt: boolean;
30
- printXReport: boolean;
31
- printZReport: boolean;
32
- printDuplicate: boolean;
33
- depositMoney: boolean;
34
- withdrawMoney: boolean;
35
- getCashAmount: boolean;
36
- setDateTime: boolean;
37
- getDateTime: boolean;
38
- getLastFiscalRecord: boolean;
39
- getStatus: boolean;
40
- printBarcode: boolean;
41
- };
42
- supportsInvoices: boolean;
43
- supportsRefunds: boolean;
44
- supportsCreditNotes: boolean;
45
- maxItemTextLength: number;
46
- maxCommentTextLength: number;
47
- maxOperatorPasswordLength: number;
48
- vatGroups: FiscalVATGroup[];
49
- paymentTypes: FiscalPaymentType[];
50
- }
51
- /**
52
- * Common payload fields shared by fiscal and non-fiscal receipts.
53
- */
54
- export interface BaseReceipt {
55
- /**
56
- * Operator information
57
- */
58
- operator: OperatorInfo;
59
- /**
60
- * The items in the receipt
61
- */
62
- items: FiscalReceiptItem[];
63
- /**
64
- * The client information (for invoice receipts)
65
- */
66
- client?: FiscalClient;
67
- /**
68
- * Optional text lines to be printed immediately after the receipt header.
69
- */
70
- headerText?: string[];
71
- /**
72
- * Optional text lines to be printed at the end of the receipt (before payments).
73
- */
74
- footerText?: string[];
75
- /**
76
- * Optional barcode to be printed at the end of the receipt (footer).
77
- * Useful for loyalty programs, order tracking, or return vouchers.
78
- */
79
- footerBarcode?: BarcodeData;
80
- }
81
- /**
82
- * Interface for fiscal receipt
83
- */
84
- export interface FiscalReceipt extends BaseReceipt {
85
- /**
86
- * Numeric string up to 7 digits, used as part of the UNP.
87
- */
88
- uniqueSaleNumber: string;
89
- /**
90
- * The payments in the receipt. The total must cover the receipt amount to close.
91
- */
92
- payments: FiscalPayment[];
93
- }
94
- /**
95
- * Interface for non-fiscal (service) receipt
96
- */
97
- export interface NonFiscalReceipt extends BaseReceipt {
98
- /**
99
- * Optional informational payments printed on the receipt.
100
- */
101
- payments?: FiscalPayment[];
102
- }
103
- /**
104
- * Interface for fiscal receipt item
105
- */
106
- export interface FiscalReceiptItem {
107
- /**
108
- * The name of the item
109
- */
110
- name: string;
111
- /**
112
- * Optional description providing additional information or context.
113
- * This can be used to supply user-friendly details or explanations
114
- * associated with a particular resource, item, or operation.
115
- */
116
- description?: string;
117
- /**
118
- * The price of the item including tax (VAT inclusive).
119
- * This price will be sent directly to the fiscal device and must include all applicable taxes.
120
- */
121
- unitPrice: number;
122
- /**
123
- * The quantity of the item
124
- */
125
- quantity: number;
126
- /**
127
- * The VAT group of the item
128
- */
129
- vatGroup: FiscalVATGroup;
130
- /**
131
- * Discount percentage (optional). Use 0-100, no surcharges.
132
- */
133
- discount?: number;
134
- }
135
- /**
136
- * Interface for fiscal payment
137
- */
138
- export interface FiscalPayment {
139
- /**
140
- * The payment type
141
- */
142
- type: FiscalPaymentType;
143
- /**
144
- * The amount of the payment
145
- */
146
- amount: number;
147
- }
148
- /**
149
- * Enum for fiscal payment types
150
- */
151
- export declare enum FiscalPaymentType {
152
- CASH = "cash",
153
- CARD = "card",
154
- CHECK = "check",
155
- TRANSFER = "transfer"
156
- }
157
- /**
158
- * Interface for fiscal client information
159
- */
160
- export interface FiscalClient {
161
- /**
162
- * The name of the client
163
- */
164
- name: string;
165
- /**
166
- * The address of the client
167
- */
168
- address?: string;
169
- /**
170
- * The tax number of the client
171
- */
172
- taxNumber?: string;
173
- /**
174
- * The VAT number of the client
175
- */
176
- vatNumber?: string;
177
- }
178
- /**
179
- * Interface for fiscal memory record
180
- */
181
- export interface FiscalMemoryRecord {
182
- /**
183
- * The number of the record
184
- */
185
- number: string;
186
- /**
187
- * The date of the record
188
- */
189
- date: Date;
190
- /**
191
- * The total amount of the record
192
- */
193
- total: number;
194
- }
195
- /**
196
- * Interface for fiscal device status
197
- */
198
- export interface FiscalDeviceStatus {
199
- /**
200
- * Whether the device is connected
201
- */
202
- connected?: boolean;
203
- /**
204
- * Whether the device has paper
205
- */
206
- hasPaper?: boolean;
207
- /**
208
- * Whether the fiscal memory is full
209
- */
210
- fiscalMemoryFull?: boolean;
211
- /**
212
- * Whether a fiscal receipt is currently open
213
- */
214
- fiscalReceiptOpen?: boolean;
215
- /**
216
- * Whether a non-fiscal receipt is currently open
217
- */
218
- nonFiscalReceiptOpen?: boolean;
219
- /**
220
- * Whether printing is allowed
221
- */
222
- printingAllowed?: boolean;
223
- /**
224
- * The messages returned by the fiscal device
225
- */
226
- messages: FiscalResponseMessage[];
227
- /**
228
- * Raw status bytes, if available
229
- */
230
- rawStatusBytes?: number[];
231
- }
232
- /**
233
- * Interface for fiscal device information in list responses
234
- */
235
- export interface FiscalDeviceResponse {
236
- /**
237
- * Device identifier (stable for the device model/serial)
238
- */
239
- deviceId: DeviceId;
240
- /**
241
- * The manufacturer of the fiscal device
242
- */
243
- manufacturer: string;
244
- /**
245
- * The model name of the fiscal device
246
- */
247
- model: string;
248
- /**
249
- * The serial number of the fiscal device
250
- */
251
- serialNumber: string;
252
- /**
253
- * Transport type used to access the device
254
- */
255
- transport?: TransportType;
256
- /**
257
- * Device capabilities
258
- */
259
- capabilities?: DeviceCapabilities;
260
- }
261
- export type FiscalDeviceDiagnosticStepName = 'deviceInfo' | 'status' | 'lastFiscalRecord' | 'cashAmount' | 'nonFiscalReceipt';
262
- export interface FiscalDeviceDiagnosticStepBase {
263
- name: FiscalDeviceDiagnosticStepName;
264
- ok: boolean;
265
- startedAt: string;
266
- finishedAt: string;
267
- skipped?: boolean;
268
- skipReason?: string;
269
- error?: string;
270
- }
271
- export interface FiscalDeviceDiagnosticStepDeviceInfo extends FiscalDeviceDiagnosticStepBase {
272
- name: 'deviceInfo';
273
- data?: DeviceInfo;
274
- }
275
- export interface FiscalDeviceDiagnosticStepStatus extends FiscalDeviceDiagnosticStepBase {
276
- name: 'status';
277
- data?: FiscalDeviceStatus;
278
- }
279
- export interface FiscalDeviceDiagnosticStepLastFiscalRecord extends FiscalDeviceDiagnosticStepBase {
280
- name: 'lastFiscalRecord';
281
- data?: FiscalMemoryRecord;
282
- }
283
- export interface FiscalDeviceDiagnosticStepCashAmount extends FiscalDeviceDiagnosticStepBase {
284
- name: 'cashAmount';
285
- data?: number;
286
- }
287
- export interface FiscalDeviceDiagnosticStepNonFiscalReceipt extends FiscalDeviceDiagnosticStepBase {
288
- name: 'nonFiscalReceipt';
289
- data?: FiscalResponse;
290
- }
291
- export type FiscalDeviceDiagnosticStep = FiscalDeviceDiagnosticStepDeviceInfo | FiscalDeviceDiagnosticStepStatus | FiscalDeviceDiagnosticStepLastFiscalRecord | FiscalDeviceDiagnosticStepCashAmount | FiscalDeviceDiagnosticStepNonFiscalReceipt;
292
- export interface FiscalDeviceDiagnosticsOptions {
293
- operator: OperatorInfo;
294
- amount?: number;
295
- vatGroup?: FiscalVATGroup;
296
- itemName?: string;
297
- }
298
- export interface FiscalDeviceDiagnosticsResult {
299
- deviceId: DeviceId;
300
- ok: boolean;
301
- startedAt: string;
302
- finishedAt: string;
303
- steps: FiscalDeviceDiagnosticStep[];
304
- }
305
- /**
306
- * Interface for detailed device information
307
- */
308
- export interface DeviceInfo {
309
- /**
310
- * Device identifier (stable for the device model/serial)
311
- */
312
- deviceId: DeviceId;
313
- /**
314
- * The serial number of the fiscal device
315
- */
316
- serialNumber: string;
317
- /**
318
- * The fiscal memory serial number
319
- */
320
- fiscalMemorySerialNumber: string;
321
- /**
322
- * The manufacturer of the fiscal device
323
- */
324
- manufacturer: string;
325
- /**
326
- * The model name of the fiscal device
327
- */
328
- model: string;
329
- /**
330
- * Driver identifier
331
- */
332
- driverId?: string;
333
- /**
334
- * Transport type
335
- */
336
- transport?: TransportType;
337
- /**
338
- * The firmware version of the fiscal device
339
- */
340
- firmwareVersion: string;
341
- /**
342
- * The current date and time of the fiscal device
343
- */
344
- currentDateTime?: string;
345
- /**
346
- * The maximum length of item text
347
- */
348
- itemTextMaxLength: number;
349
- /**
350
- * The maximum length of comment text
351
- */
352
- commentTextMaxLength: number;
353
- /**
354
- * The maximum length of operator password
355
- */
356
- operatorPasswordMaxLength: number;
357
- /**
358
- * The supported payment types
359
- */
360
- supportedPaymentTypes: FiscalPaymentType[];
361
- }
362
- /**
363
- * Interface for fiscal response
364
- */
365
- export interface FiscalResponse {
366
- /**
367
- * The receipt number (if applicable)
368
- */
369
- number?: string;
370
- /**
371
- * Represents a unique identifier for a receipt generated for a particular sale.
372
- * This variable is used to ensure that each sale has a distinct and traceable number.
373
- * It may be undefined if no sale has been processed or the number has not been generated yet.
374
- */
375
- generatedUniqueSaleNumber?: string;
376
- /**
377
- * The receipt date and time (if applicable)
378
- */
379
- datetime?: string;
380
- /**
381
- * The receipt amount (if applicable)
382
- */
383
- amount?: number;
384
- /**
385
- * Represents an optional piece of information regarding a device.
386
- * This variable can store details such as the device's specifications,
387
- * status, or metadata, depending on the structure of the `DeviceInfo` type.
388
- *
389
- * The value of `deviceInfo` may be undefined if no device information is available.
390
- *
391
- * @type {DeviceInfo | undefined}
392
- */
393
- deviceInfo?: DeviceInfo;
394
- /**
395
- * The messages returned by the fiscal device
396
- */
397
- messages: FiscalResponseMessage[];
398
- }
399
- /**
400
- * Interface for fiscal response message
401
- */
402
- export interface FiscalResponseMessage {
403
- /**
404
- * The type of the message
405
- */
406
- type: 'info' | 'warning' | 'error';
407
- /**
408
- * The code of the message (if applicable)
409
- */
410
- code?: string;
411
- /**
412
- * The text of the message
413
- */
414
- text: string;
415
- }
416
- /**
417
- * Interface for reversal receipt
418
- */
419
- export interface ReversalReceipt extends FiscalReceipt {
420
- /**
421
- * The reason for the reversal
422
- */
423
- reason: ReversalReason;
424
- /**
425
- * The original receipt number
426
- */
427
- originalReceiptNumber: string;
428
- /**
429
- * The original receipt date and time
430
- */
431
- originalReceiptDateTime: Date;
432
- /**
433
- * The original fiscal memory serial number
434
- */
435
- originalFiscalMemorySerialNumber: string;
436
- }
437
- /**
438
- * Enum for reversal reasons
439
- */
440
- export declare enum ReversalReason {
441
- VOID = "void",
442
- REFUND = "refund",
443
- TAX_BASE_REDUCTION = "tax-base-reduction"
444
- }
445
- /**
446
- * Enum for fiscal VAT groups
447
- */
448
- export declare enum FiscalVATGroup {
449
- A = "1",// 20%
450
- B = "2",// 9%
451
- C = "3",// 0%
452
- D = "4",// Exempt
453
- E = "5",// Special rate 1
454
- F = "6",// Special rate 2
455
- G = "7",// Special rate 3
456
- H = "8"
457
- }
458
- export declare enum BarcodeType {
459
- EAN8 = "EAN8",
460
- EAN13 = "EAN13",
461
- CODE128 = "CODE128",
462
- QR = "QR"
463
- }
464
- export interface BarcodeData {
465
- type: BarcodeType;
466
- data: string;
467
- height?: number;
468
- printText?: boolean;
469
- }