@reservation-studio/electron-types 0.0.17 → 0.0.18

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,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 { DeviceInfo, FiscalDeviceInfo, FiscalDeviceStatus, FiscalMemoryRecord, FiscalReceipt, FiscalResponse, ReversalReceipt } from './fiscal-device.interface';
4
+ import { DeviceInfo, FiscalDeviceResponse, FiscalDeviceStatus, FiscalMemoryRecord, FiscalReceipt, FiscalResponse, ReversalReceipt } from './fiscal-device.interface';
5
5
  export interface ApiInterface {
6
6
  /**
7
7
  * An object representing operations related to certificates.
@@ -85,12 +85,11 @@ export interface ApiInterface {
85
85
  */
86
86
  fiscalDevices: {
87
87
  /**
88
- * Gets a list of all detected fiscal devices.
89
- * Automatically initializes fiscal devices if needed.
88
+ * Retrieves a list of fiscal devices.
90
89
  *
91
- * @return {Promise<FiscalDeviceInfo[]>} A promise that resolves to an array of fiscal device information.
90
+ * @return {Promise<FiscalDeviceResponse[]>} A promise that resolves to an array of fiscal device responses.
92
91
  */
93
- list(): Promise<FiscalDeviceInfo[]>;
92
+ list(): Promise<FiscalDeviceResponse[]>;
94
93
  /**
95
94
  * Sets the active fiscal device.
96
95
  *
@@ -102,10 +101,10 @@ export interface ApiInterface {
102
101
  /**
103
102
  * Gets the active fiscal device.
104
103
  *
105
- * @return {Promise<FiscalDeviceInfo>} A promise that resolves to the active fiscal device information.
104
+ * @return {Promise<FiscalDeviceResponse>} A promise that resolves to the active fiscal device information.
106
105
  * @throws {Error} If no active device is set.
107
106
  */
108
- getActiveDevice(): Promise<FiscalDeviceInfo>;
107
+ getActiveDevice(): Promise<FiscalDeviceResponse>;
109
108
  /**
110
109
  * Gets detailed information about the active device.
111
110
  *
@@ -120,6 +119,13 @@ export interface ApiInterface {
120
119
  * @return {Promise<FiscalResponse>} A promise that resolves to the fiscal response.
121
120
  */
122
121
  printReceipt(receipt: FiscalReceipt): Promise<FiscalResponse>;
122
+ /**
123
+ * Prints a non-fiscal receipt using the given receipt data.
124
+ *
125
+ * @param {FiscalReceipt} receipt - The receipt object containing details to be printed as a non-fiscal receipt.
126
+ * @return {Promise<FiscalResponse>} A promise that resolves to a FiscalResponse object indicating the result of the operation.
127
+ */
128
+ printNonFiscalReceipt(receipt: FiscalReceipt): Promise<FiscalResponse>;
123
129
  /**
124
130
  * Prints a reversal receipt using the active device.
125
131
  *
@@ -43,6 +43,13 @@ export interface FiscalDeviceInterface {
43
43
  * @returns {Promise<FiscalResponse>} A promise that resolves to the fiscal response
44
44
  */
45
45
  printReceipt(receipt: FiscalReceipt): Promise<FiscalResponse>;
46
+ /**
47
+ * Prints a non-fiscal receipt based on the provided receipt details.
48
+ *
49
+ * @param {FiscalReceipt} receipt - The receipt object containing all relevant data for generating the non-fiscal receipt.
50
+ * @return {Promise<FiscalResponse>} A promise that resolves to a FiscalResponse object containing the status and details of the print operation.
51
+ */
52
+ printNonFiscalReceipt(receipt: FiscalReceipt): Promise<FiscalResponse>;
46
53
  /**
47
54
  * Prints a reversal receipt
48
55
  *
@@ -126,13 +133,21 @@ export interface FiscalDeviceInterface {
126
133
  */
127
134
  export interface FiscalReceipt {
128
135
  /**
129
- * The operator number
130
- */
131
- operatorNumber: number;
132
- /**
133
- * The operator password
134
- */
135
- operatorPassword: string;
136
+ * An object representing various operator-related properties.
137
+ */
138
+ operator: {
139
+ /**
140
+ * Represents a numerical value.
141
+ * This variable can store any valid number, including integers and floating-point values.
142
+ */
143
+ number: number;
144
+ /**
145
+ * A string representing the password for authentication or security purposes.
146
+ * This variable typically holds sensitive information and should be handled securely.
147
+ * Ensure this value is kept private and not exposed in any logs or outputs.
148
+ */
149
+ password: string;
150
+ };
136
151
  /**
137
152
  * The unique sale number
138
153
  */
@@ -158,10 +173,21 @@ export interface FiscalReceiptItem {
158
173
  * The name of the item
159
174
  */
160
175
  name: string;
176
+ /**
177
+ * Optional description providing additional information or context.
178
+ * This can be used to supply user-friendly details or explanations
179
+ * associated with a particular resource, item, or operation.
180
+ */
181
+ description?: string;
161
182
  /**
162
183
  * The price of the item
163
184
  */
164
- price: number;
185
+ unitPrice: number;
186
+ /**
187
+ * Represents the currency code in ISO 4217 format (e.g., 'USD', 'EUR', 'JPY').
188
+ * Typically used to indicate the currency of a monetary value.
189
+ */
190
+ currency: string;
165
191
  /**
166
192
  * The quantity of the item
167
193
  */
@@ -283,7 +309,7 @@ export interface FiscalDeviceStatus {
283
309
  /**
284
310
  * Interface for fiscal device information in list responses
285
311
  */
286
- export interface FiscalDeviceInfo {
312
+ export interface FiscalDeviceResponse {
287
313
  /**
288
314
  * The manufacturer of the fiscal device
289
315
  */
@@ -301,10 +327,6 @@ export interface FiscalDeviceInfo {
301
327
  * Interface for detailed device information
302
328
  */
303
329
  export interface DeviceInfo {
304
- /**
305
- * The URI of the fiscal device
306
- */
307
- uri: string;
308
330
  /**
309
331
  * The serial number of the fiscal device
310
332
  */
@@ -328,7 +350,7 @@ export interface DeviceInfo {
328
350
  /**
329
351
  * The current date and time of the fiscal device
330
352
  */
331
- currentDateTime?: Date;
353
+ currentDateTime?: string;
332
354
  /**
333
355
  * The maximum length of item text
334
356
  */
@@ -357,19 +379,31 @@ export interface FiscalResponse {
357
379
  /**
358
380
  * The receipt number (if applicable)
359
381
  */
360
- receiptNumber?: string;
382
+ number?: string;
383
+ /**
384
+ * Represents a unique identifier for a receipt generated for a particular sale.
385
+ * This variable is used to ensure that each sale has a distinct and traceable number.
386
+ * It may be undefined if no sale has been processed or the number has not been generated yet.
387
+ */
388
+ generatedUniqueSaleNumber?: string;
361
389
  /**
362
390
  * The receipt date and time (if applicable)
363
391
  */
364
- receiptDateTime?: Date;
392
+ datetime?: string;
365
393
  /**
366
394
  * The receipt amount (if applicable)
367
395
  */
368
- receiptAmount?: number;
396
+ amount?: number;
369
397
  /**
370
- * The fiscal memory serial number (if applicable)
398
+ * Represents an optional piece of information regarding a device.
399
+ * This variable can store details such as the device's specifications,
400
+ * status, or metadata, depending on the structure of the `DeviceInfo` type.
401
+ *
402
+ * The value of `deviceInfo` may be undefined if no device information is available.
403
+ *
404
+ * @type {DeviceInfo | undefined}
371
405
  */
372
- fiscalMemorySerialNumber?: string;
406
+ deviceInfo?: DeviceInfo;
373
407
  /**
374
408
  * The messages returned by the fiscal device
375
409
  */
@@ -425,12 +459,12 @@ export declare enum ReversalReason {
425
459
  * Enum for fiscal VAT groups
426
460
  */
427
461
  export declare enum FiscalVATGroup {
428
- A = "\u0410",// 20%
429
- B = "\u0411",// 9%
430
- C = "\u0412",// 0%
431
- D = "\u0413",// Exempt
432
- E = "\u0414",// Special rate 1
433
- F = "\u0415",// Special rate 2
434
- G = "\u0416",// Special rate 3
435
- H = "\u0417"
462
+ A = "1",// 20%
463
+ B = "2",// 9%
464
+ C = "3",// 0%
465
+ D = "4",// Exempt
466
+ E = "5",// Special rate 1
467
+ F = "6",// Special rate 2
468
+ G = "7",// Special rate 3
469
+ H = "8"
436
470
  }
@@ -25,12 +25,12 @@ var ReversalReason;
25
25
  */
26
26
  var FiscalVATGroup;
27
27
  (function (FiscalVATGroup) {
28
- FiscalVATGroup["A"] = "\u0410";
29
- FiscalVATGroup["B"] = "\u0411";
30
- FiscalVATGroup["C"] = "\u0412";
31
- FiscalVATGroup["D"] = "\u0413";
32
- FiscalVATGroup["E"] = "\u0414";
33
- FiscalVATGroup["F"] = "\u0415";
34
- FiscalVATGroup["G"] = "\u0416";
35
- FiscalVATGroup["H"] = "\u0417"; // Special rate 4
28
+ FiscalVATGroup["A"] = "1";
29
+ FiscalVATGroup["B"] = "2";
30
+ FiscalVATGroup["C"] = "3";
31
+ FiscalVATGroup["D"] = "4";
32
+ FiscalVATGroup["E"] = "5";
33
+ FiscalVATGroup["F"] = "6";
34
+ FiscalVATGroup["G"] = "7";
35
+ FiscalVATGroup["H"] = "8"; // Special rate 4
36
36
  })(FiscalVATGroup || (exports.FiscalVATGroup = FiscalVATGroup = {}));
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@reservation-studio/electron-types",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "TypeScript типове за ReservationStudioElectron",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.json",
7
7
  "prebuild": "rimraf ./dist",
8
8
  "release": "npm run build && npm publish --access public"
9
9
  },
10
- "main": "./dist/api/exports.ts",
10
+ "main": "./dist/api/exports.js",
11
11
  "types": "./dist/api/exports.d.ts",
12
12
  "keywords": [
13
13
  "typescript",