@dodobrands/pos-receipts-plugin-contracts 5.13.0 → 5.13.2
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/dist/index.cjs +1 -99
- package/dist/index.d.cts +503 -3
- package/dist/index.d.ts +503 -3
- package/dist/index.js +1 -66
- package/package.json +2 -2
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,99 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
Business: () => Business,
|
|
24
|
-
DigitalReceiptNotificationPreference: () => DigitalReceiptNotificationPreference,
|
|
25
|
-
KnownCountryCodes: () => KnownCountryCodes,
|
|
26
|
-
OrderSource: () => OrderSource,
|
|
27
|
-
OrderType: () => OrderType,
|
|
28
|
-
OwnerType: () => OwnerType,
|
|
29
|
-
PaymentType: () => PaymentType
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(src_exports);
|
|
32
|
-
|
|
33
|
-
// ../../shared/pos-plugins-shared-models/dist/index.js
|
|
34
|
-
var Business = /* @__PURE__ */ ((Business2) => {
|
|
35
|
-
Business2["DodoPizza"] = `dodoPizza`;
|
|
36
|
-
Business2["Drinkit"] = `drinkit`;
|
|
37
|
-
Business2["Doner42"] = `doner42`;
|
|
38
|
-
return Business2;
|
|
39
|
-
})(Business || {});
|
|
40
|
-
var KnownCountryCodes = /* @__PURE__ */ ((KnownCountryCodes2) => {
|
|
41
|
-
KnownCountryCodes2[KnownCountryCodes2["Belarus"] = 112] = "Belarus";
|
|
42
|
-
KnownCountryCodes2[KnownCountryCodes2["Kazakhstan"] = 398] = "Kazakhstan";
|
|
43
|
-
KnownCountryCodes2[KnownCountryCodes2["Russia"] = 643] = "Russia";
|
|
44
|
-
KnownCountryCodes2[KnownCountryCodes2["Uzbekistan"] = 860] = "Uzbekistan";
|
|
45
|
-
KnownCountryCodes2[KnownCountryCodes2["Kyrgyzstan"] = 417] = "Kyrgyzstan";
|
|
46
|
-
return KnownCountryCodes2;
|
|
47
|
-
})(KnownCountryCodes || {});
|
|
48
|
-
var OwnerType = /* @__PURE__ */ ((OwnerType2) => {
|
|
49
|
-
OwnerType2[OwnerType2["Resail"] = 0] = "Resail";
|
|
50
|
-
OwnerType2[OwnerType2["OwnProduction"] = 1] = "OwnProduction";
|
|
51
|
-
OwnerType2[OwnerType2["Service"] = 2] = "Service";
|
|
52
|
-
return OwnerType2;
|
|
53
|
-
})(OwnerType || {});
|
|
54
|
-
var OrderType = /* @__PURE__ */ ((OrderType2) => {
|
|
55
|
-
OrderType2[OrderType2["Delivery"] = 1] = "Delivery";
|
|
56
|
-
OrderType2[OrderType2["Pickup"] = 2] = "Pickup";
|
|
57
|
-
OrderType2[OrderType2["Stationary"] = 3] = "Stationary";
|
|
58
|
-
OrderType2[OrderType2["PersonalFood"] = 4] = "PersonalFood";
|
|
59
|
-
OrderType2[OrderType2["ShopWindowSupply"] = 5] = "ShopWindowSupply";
|
|
60
|
-
return OrderType2;
|
|
61
|
-
})(OrderType || {});
|
|
62
|
-
var OrderSource = /* @__PURE__ */ ((OrderSource2) => {
|
|
63
|
-
OrderSource2[OrderSource2["Telephone"] = 0] = "Telephone";
|
|
64
|
-
OrderSource2[OrderSource2["Site"] = 1] = "Site";
|
|
65
|
-
OrderSource2[OrderSource2["Restaurant"] = 2] = "Restaurant";
|
|
66
|
-
OrderSource2[OrderSource2["DefectOrder"] = 3] = "DefectOrder";
|
|
67
|
-
OrderSource2[OrderSource2["Mobile"] = 4] = "Mobile";
|
|
68
|
-
OrderSource2[OrderSource2["Pizzeria"] = 5] = "Pizzeria";
|
|
69
|
-
OrderSource2[OrderSource2["Aggregator"] = 6] = "Aggregator";
|
|
70
|
-
OrderSource2[OrderSource2["Kiosk"] = 7] = "Kiosk";
|
|
71
|
-
return OrderSource2;
|
|
72
|
-
})(OrderSource || {});
|
|
73
|
-
var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
|
|
74
|
-
PaymentType2[PaymentType2["Cash"] = 0] = "Cash";
|
|
75
|
-
PaymentType2[PaymentType2["BankCard"] = 1] = "BankCard";
|
|
76
|
-
PaymentType2[PaymentType2["InternetAcquiring"] = 2] = "InternetAcquiring";
|
|
77
|
-
PaymentType2[PaymentType2["Aggregator"] = 3] = "Aggregator";
|
|
78
|
-
return PaymentType2;
|
|
79
|
-
})(PaymentType || {});
|
|
80
|
-
|
|
81
|
-
// src/PrintParams.ts
|
|
82
|
-
var DigitalReceiptNotificationPreference = /* @__PURE__ */ ((DigitalReceiptNotificationPreference2) => {
|
|
83
|
-
DigitalReceiptNotificationPreference2["NotSpecified"] = `NotSpecified`;
|
|
84
|
-
DigitalReceiptNotificationPreference2["None"] = `None`;
|
|
85
|
-
DigitalReceiptNotificationPreference2["Email"] = `Email`;
|
|
86
|
-
DigitalReceiptNotificationPreference2["PhoneSms"] = `PhoneSms`;
|
|
87
|
-
return DigitalReceiptNotificationPreference2;
|
|
88
|
-
})(DigitalReceiptNotificationPreference || {});
|
|
89
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
90
|
-
0 && (module.exports = {
|
|
91
|
-
Business,
|
|
92
|
-
DigitalReceiptNotificationPreference,
|
|
93
|
-
KnownCountryCodes,
|
|
94
|
-
OrderSource,
|
|
95
|
-
OrderType,
|
|
96
|
-
OwnerType,
|
|
97
|
-
PaymentType
|
|
98
|
-
});
|
|
99
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
"use strict";var r=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var e=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var b=(a,t)=>{for(var o in t)r(a,o,{get:t[o],enumerable:!0})},A=(a,t,o,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of e(t))!N.call(a,i)&&i!==o&&r(a,i,{get:()=>t[i],enumerable:!(f=R(t,i))||f.enumerable});return a};var D=a=>A(r({},"__esModule",{value:!0}),a);var P={};b(P,{Business:()=>x,DigitalReceiptNotificationPreference:()=>z,KnownCountryCodes:()=>l,OrderSource:()=>p,OrderType:()=>m,OwnerType:()=>g,PaymentMode:()=>n,PaymentSource:()=>s,PaymentStatus:()=>k,PaymentType:()=>v,RefundSource:()=>h});module.exports=D(P);var x=(a=>(a.DodoPizza="dodoPizza",a.Drinkit="drinkit",a.Doner42="doner42",a))(x||{}),l=(a=>(a[a.Belarus=112]="Belarus",a[a.Kazakhstan=398]="Kazakhstan",a[a.Russia=643]="Russia",a[a.Uzbekistan=860]="Uzbekistan",a[a.Kyrgyzstan=417]="Kyrgyzstan",a))(l||{}),g=(a=>(a[a.Resail=0]="Resail",a[a.OwnProduction=1]="OwnProduction",a[a.Service=2]="Service",a))(g||{}),n=(a=>(a.Card="Card",a.QR="QR",a))(n||{}),s=(a=>(a[a.RestaurantCashier=0]="RestaurantCashier",a[a.Kiosk=1]="Kiosk",a))(s||{}),k=(a=>(a.NotFound="NotFound",a.PaymentPending="PaymentPending",a.PaymentCompleted="PaymentCompleted",a.RefundPending="RefundPending",a.RefundCompleted="RefundCompleted",a.NotNeeded="NotNeeded",a))(k||{}),h=(a=>(a.RestaurantCashier="RestaurantCashier",a.RefundJob="RefundJob",a.Kiosk="Kiosk",a))(h||{}),m=(a=>(a[a.Delivery=1]="Delivery",a[a.Pickup=2]="Pickup",a[a.Stationary=3]="Stationary",a[a.PersonalFood=4]="PersonalFood",a[a.ShopWindowSupply=5]="ShopWindowSupply",a))(m||{}),p=(a=>(a[a.Telephone=0]="Telephone",a[a.Site=1]="Site",a[a.Restaurant=2]="Restaurant",a[a.DefectOrder=3]="DefectOrder",a[a.Mobile=4]="Mobile",a[a.Pizzeria=5]="Pizzeria",a[a.Aggregator=6]="Aggregator",a[a.Kiosk=7]="Kiosk",a))(p||{}),v=(a=>(a[a.Cash=0]="Cash",a[a.BankCard=1]="BankCard",a[a.InternetAcquiring=2]="InternetAcquiring",a[a.Aggregator=3]="Aggregator",a))(v||{});var z=(i=>(i.NotSpecified="NotSpecified",i.None="None",i.Email="Email",i.PhoneSms="PhoneSms",i))(z||{});0&&(module.exports={Business,DigitalReceiptNotificationPreference,KnownCountryCodes,OrderSource,OrderType,OwnerType,PaymentMode,PaymentSource,PaymentStatus,PaymentType,RefundSource});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,505 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Enum with supported business types.
|
|
3
|
+
*/
|
|
4
|
+
declare enum Business {
|
|
5
|
+
/**
|
|
6
|
+
* Dodo Pizza business.
|
|
7
|
+
*/
|
|
8
|
+
DodoPizza = "dodoPizza",
|
|
9
|
+
/**
|
|
10
|
+
* Drinkit business.
|
|
11
|
+
*/
|
|
12
|
+
Drinkit = "drinkit",
|
|
13
|
+
/**
|
|
14
|
+
* Doner42 business.
|
|
15
|
+
*/
|
|
16
|
+
Doner42 = "doner42"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Card information.
|
|
21
|
+
*/
|
|
22
|
+
type CardInfo = {
|
|
23
|
+
/**
|
|
24
|
+
* Masked card number, e.g. ************1234.
|
|
25
|
+
*/
|
|
26
|
+
maskedPan: string;
|
|
27
|
+
/**
|
|
28
|
+
* Card expiration date in format MM/YY.
|
|
29
|
+
*/
|
|
30
|
+
expDate: string | null;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Country model
|
|
35
|
+
*/
|
|
36
|
+
interface Country {
|
|
37
|
+
code: CountryIsoCode;
|
|
38
|
+
}
|
|
39
|
+
/** Country code based on [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_numeric)
|
|
40
|
+
* @example 643, 705, 566
|
|
41
|
+
*/
|
|
42
|
+
type CountryIsoCode = number;
|
|
43
|
+
declare enum KnownCountryCodes {
|
|
44
|
+
Belarus = 112,
|
|
45
|
+
Kazakhstan = 398,
|
|
46
|
+
Russia = 643,
|
|
47
|
+
Uzbekistan = 860,
|
|
48
|
+
Kyrgyzstan = 417
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | KyrgyzstanProductData | null;
|
|
52
|
+
interface UzbekistanProductData {
|
|
53
|
+
/** Identification code of products and services for Uzbekistan */
|
|
54
|
+
ikpu: string;
|
|
55
|
+
/** 0 - resail; 1 - own production; 2 - service */
|
|
56
|
+
ownerType?: OwnerType;
|
|
57
|
+
/** code of measurement type */
|
|
58
|
+
units: string;
|
|
59
|
+
/** related with ikpu */
|
|
60
|
+
barcode: string;
|
|
61
|
+
}
|
|
62
|
+
declare enum OwnerType {
|
|
63
|
+
Resail = 0,
|
|
64
|
+
OwnProduction = 1,
|
|
65
|
+
Service = 2
|
|
66
|
+
}
|
|
67
|
+
interface KazakhstanProductData {
|
|
68
|
+
/** Identification code of products */
|
|
69
|
+
gtin?: string;
|
|
70
|
+
ntin?: string;
|
|
71
|
+
}
|
|
72
|
+
interface KyrgyzstanProductData {
|
|
73
|
+
/** `product` — if entry is resold, `service` — if entry is prepared in-house. */
|
|
74
|
+
entryType?: 'product' | 'service';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type Message = {
|
|
78
|
+
content: string;
|
|
79
|
+
} & MessageMetadata;
|
|
80
|
+
type MessageWith<T> = Message & T;
|
|
81
|
+
type MessageMetadata = {
|
|
82
|
+
area?: string;
|
|
83
|
+
};
|
|
84
|
+
type MessageMetadataWith<T> = MessageMetadata & T;
|
|
85
|
+
type ErrorMessageMetadataWith<T> = MessageMetadataWith<T> & {
|
|
86
|
+
error?: Error;
|
|
87
|
+
};
|
|
88
|
+
type CreateScopeOptions = {
|
|
89
|
+
/** If this feature is on: each time when the logger is created,
|
|
90
|
+
* all enabled plugins will launch the optional `registerLogger` call.
|
|
91
|
+
*
|
|
92
|
+
* This allows the plugins to respect the scope of child loggers and select
|
|
93
|
+
* which logger to use under-the-hood while being registered from the original logger.
|
|
94
|
+
*
|
|
95
|
+
* Defaults to `false` */
|
|
96
|
+
propagateUpdatedScopeToPlugins?: boolean;
|
|
97
|
+
};
|
|
98
|
+
interface ILogger<TScope extends Record<string, unknown> = never> {
|
|
99
|
+
createScope<TNewScope>(scope: TNewScope, options?: CreateScopeOptions): ILogger<TScope & TNewScope>;
|
|
100
|
+
diminishScope<TOldScope extends Record<string, unknown>>(scopeToDiminish: TOldScope, options?: CreateScopeOptions): ILogger<Omit<TScope, keyof TOldScope>>;
|
|
101
|
+
trace<T>(message: string, metadata?: MessageMetadataWith<T>): void;
|
|
102
|
+
debug<T>(message: string, metadata?: MessageMetadataWith<T>): void;
|
|
103
|
+
info<T>(message: string, metadata?: MessageMetadataWith<T>): void;
|
|
104
|
+
warn<T>(message: string, metadata?: MessageMetadataWith<T>): void;
|
|
105
|
+
error<T>(message: string, error?: unknown, metadata?: ErrorMessageMetadataWith<T>): void;
|
|
106
|
+
fatal<T>(message: string, error?: unknown, metadata?: ErrorMessageMetadataWith<T>): void;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Unique identifier of the transaction
|
|
111
|
+
*/
|
|
112
|
+
type TransactionId = string;
|
|
113
|
+
type TransactionIdIdentifier = {
|
|
114
|
+
/**
|
|
115
|
+
* Unique identifier of the transaction
|
|
116
|
+
*/
|
|
117
|
+
transactionId: TransactionId;
|
|
118
|
+
/**
|
|
119
|
+
* Retrieval Reference Number (RRN) of the transaction
|
|
120
|
+
*/
|
|
121
|
+
rrn?: never;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Retrieval Reference Number (RRN) of the transaction
|
|
125
|
+
*/
|
|
126
|
+
type RRN = string;
|
|
127
|
+
type RRNIdentifier = {
|
|
128
|
+
/**
|
|
129
|
+
* Unique identifier of the transaction
|
|
130
|
+
*/
|
|
131
|
+
transactionId?: never;
|
|
132
|
+
/**
|
|
133
|
+
* Retrieval Reference Number (RRN) of the transaction
|
|
134
|
+
*/
|
|
135
|
+
rrn: RRN;
|
|
136
|
+
};
|
|
137
|
+
type OperationIdentifiers = TransactionIdIdentifier | RRNIdentifier | {
|
|
138
|
+
/**
|
|
139
|
+
* Unique identifier of the transaction
|
|
140
|
+
*/
|
|
141
|
+
transactionId: TransactionId;
|
|
142
|
+
/**
|
|
143
|
+
* Retrieval Reference Number (RRN) of the transaction
|
|
144
|
+
*/
|
|
145
|
+
rrn: RRN;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
type PaymentInfo = OperationIdentifiers;
|
|
149
|
+
|
|
150
|
+
declare enum PaymentMode {
|
|
151
|
+
Card = "Card",
|
|
152
|
+
QR = "QR"
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
type QRIdType = 'qrId';
|
|
156
|
+
type HTMLContentType = 'htmlContent';
|
|
157
|
+
type QRIdData = {
|
|
158
|
+
type: QRIdType;
|
|
159
|
+
/**
|
|
160
|
+
* URL or ID of the QR code.
|
|
161
|
+
*/
|
|
162
|
+
qrId: string;
|
|
163
|
+
};
|
|
164
|
+
type HTMLContentData = {
|
|
165
|
+
type: HTMLContentType;
|
|
166
|
+
/**
|
|
167
|
+
* HTML content that can be used to display the QR code.
|
|
168
|
+
*/
|
|
169
|
+
html: string;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* QR code data.
|
|
173
|
+
*/
|
|
174
|
+
type QRData = QRIdData | HTMLContentData;
|
|
175
|
+
|
|
176
|
+
type TextSlipType = 'text';
|
|
177
|
+
/**
|
|
178
|
+
* Represents the slip type for CARD payment request
|
|
179
|
+
* In the future it could be extended with other types like 'html' or 'pdf'
|
|
180
|
+
*/
|
|
181
|
+
type SlipType = TextSlipType;
|
|
182
|
+
type TextSlipData = {
|
|
183
|
+
type: TextSlipType;
|
|
184
|
+
textLines: string[];
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Represents the slip data for CARD payment request
|
|
188
|
+
* In the future it could be extended with other types like HtmlSlipData or PdfSlipData
|
|
189
|
+
*/
|
|
190
|
+
type SlipData = TextSlipData;
|
|
191
|
+
|
|
192
|
+
type QrPaymentResult = {
|
|
193
|
+
/**
|
|
194
|
+
* Information about the payment.
|
|
195
|
+
*/
|
|
196
|
+
paymentInfo: PaymentInfo;
|
|
197
|
+
/**
|
|
198
|
+
* QR code data
|
|
199
|
+
*/
|
|
200
|
+
qrData: QRData;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Represents the payment result for CARD payment request
|
|
204
|
+
*/
|
|
205
|
+
type CardPaymentResult = {
|
|
206
|
+
/**
|
|
207
|
+
* Information about the payment.
|
|
208
|
+
*/
|
|
209
|
+
paymentInfo: PaymentInfo;
|
|
210
|
+
/**
|
|
211
|
+
* Data for slip
|
|
212
|
+
*/
|
|
213
|
+
slip: SlipData | null;
|
|
214
|
+
/**
|
|
215
|
+
* Card information
|
|
216
|
+
*/
|
|
217
|
+
card: CardInfo | null;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Represents the result of a payment operation.
|
|
221
|
+
*/
|
|
222
|
+
type PaymentResult<T extends PaymentMode = PaymentMode.Card> = T extends PaymentMode.Card ? CardPaymentResult : T extends PaymentMode.QR ? QrPaymentResult : never;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The result of a payment operation for an order.
|
|
226
|
+
* Discriminated union on the shape of the result — add new payment results here as needed.
|
|
227
|
+
*/
|
|
228
|
+
type OrderPaymentResult = CardPaymentResult | QrPaymentResult;
|
|
229
|
+
|
|
230
|
+
type RefundInfo = OperationIdentifiers;
|
|
231
|
+
type BaseRefundResult = {
|
|
232
|
+
refundInfo: RefundInfo;
|
|
233
|
+
};
|
|
234
|
+
type CardRefundResult = BaseRefundResult & {
|
|
235
|
+
slip: SlipData | null;
|
|
236
|
+
};
|
|
237
|
+
type QrRefundResult = BaseRefundResult;
|
|
238
|
+
/**
|
|
239
|
+
* Represents the result of a refund operation.
|
|
240
|
+
*/
|
|
241
|
+
type RefundResult<T extends PaymentMode = PaymentMode.Card> = T extends PaymentMode.Card ? CardRefundResult : T extends PaymentMode.QR ? QrRefundResult : never;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* The result of a refund operation for an order.
|
|
245
|
+
* Discriminated union on the shape of the result — add new refund results here as needed.
|
|
246
|
+
*/
|
|
247
|
+
type OrderRefundResult = CardRefundResult | QrRefundResult;
|
|
248
|
+
|
|
249
|
+
/** The name of the payment provider (e.g. "Ibox", "KaspiQr", "Json_Electron_PosPlugin"). */
|
|
250
|
+
type PaymentProvider = string;
|
|
251
|
+
|
|
252
|
+
declare enum PaymentSource {
|
|
253
|
+
RestaurantCashier = 0,
|
|
254
|
+
Kiosk = 1
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
declare enum PaymentStatus {
|
|
258
|
+
NotFound = "NotFound",
|
|
259
|
+
PaymentPending = "PaymentPending",
|
|
260
|
+
PaymentCompleted = "PaymentCompleted",
|
|
261
|
+
RefundPending = "RefundPending",
|
|
262
|
+
RefundCompleted = "RefundCompleted",
|
|
263
|
+
NotNeeded = "NotNeeded"
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
declare enum RefundSource {
|
|
267
|
+
RestaurantCashier = "RestaurantCashier",
|
|
268
|
+
RefundJob = "RefundJob",
|
|
269
|
+
Kiosk = "Kiosk"
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
interface Taxpayer {
|
|
273
|
+
/** A tax identification number. It is used for value added tax purposes.
|
|
274
|
+
* The formal name may differ from country to country: It could be NIP for Poland, INN for Russia, or VAT number.
|
|
275
|
+
* https://en.wikipedia.org/wiki/VAT_identification_number */
|
|
276
|
+
IdentificationNumber: string | null;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
interface Receipt {
|
|
280
|
+
/** Order for this receipt */
|
|
281
|
+
Order: Order;
|
|
282
|
+
/** Country code based on ISO 3166-1 numeric */
|
|
283
|
+
CountryCode: number;
|
|
284
|
+
/** Customer information */
|
|
285
|
+
Customer: Customer;
|
|
286
|
+
/** Taxpayer information */
|
|
287
|
+
Taxpayer: Taxpayer;
|
|
288
|
+
/** Cash register from which the receipt is printed */
|
|
289
|
+
CashRegister: CashRegister;
|
|
290
|
+
/** Previous receipts that were printed for this order, including refunds */
|
|
291
|
+
PreviousReceipts: PreviousReceipt[];
|
|
292
|
+
/** Information about the organization that printed the receipt */
|
|
293
|
+
Organization: Organization;
|
|
294
|
+
/** Information about the store in which the purchase is occurring */
|
|
295
|
+
Store: Store;
|
|
296
|
+
/** Information needed for the loyalty program. */
|
|
297
|
+
Loyalty?: Loyalty;
|
|
298
|
+
/** Cash from the customer (if paid in cash) */
|
|
299
|
+
CashFromCustomer: number;
|
|
300
|
+
/** Information about the person taking the order. */
|
|
301
|
+
Cashier?: Cashier;
|
|
302
|
+
/** Url of the image to print on the receipt. */
|
|
303
|
+
Image?: Image;
|
|
304
|
+
/** @internal */
|
|
305
|
+
IdempotencyKey: string;
|
|
306
|
+
}
|
|
307
|
+
interface Cashier {
|
|
308
|
+
/** Cashier name */
|
|
309
|
+
Name: string;
|
|
310
|
+
/** Cashier INN in russia and its analogues in other countries. */
|
|
311
|
+
TaxIdentificationNumber?: string;
|
|
312
|
+
}
|
|
313
|
+
interface Image {
|
|
314
|
+
/** Url of the image to print on the receipt. */
|
|
315
|
+
Url?: string;
|
|
316
|
+
/** Image data in base64 format. (ONLY FOR RUSSIA ATOL) */
|
|
317
|
+
Base64Data?: string;
|
|
318
|
+
}
|
|
319
|
+
interface Loyalty {
|
|
320
|
+
/** Customer Phone number */
|
|
321
|
+
PhoneNumber: string;
|
|
322
|
+
/** Amount of the bonus points awarded for the loyalty program. */
|
|
323
|
+
AwardedBonus: number;
|
|
324
|
+
}
|
|
325
|
+
interface Order {
|
|
326
|
+
/** Internal order identifier */
|
|
327
|
+
Id: string;
|
|
328
|
+
/** Order number seen by customers (e.g. "1-3") */
|
|
329
|
+
Number: string;
|
|
330
|
+
/** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
|
|
331
|
+
CreateDate: string;
|
|
332
|
+
/** Products in cart */
|
|
333
|
+
Products: Product[];
|
|
334
|
+
Price: OrderPrice;
|
|
335
|
+
/** @deprecated Please switch to PaymentTypeEnum. */
|
|
336
|
+
PaymentType: 'Cash' | 'BankCard';
|
|
337
|
+
PaymentTypeEnum: PaymentType;
|
|
338
|
+
OrderSource: OrderSource;
|
|
339
|
+
/** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
|
|
340
|
+
DeliveryDate?: string;
|
|
341
|
+
OrderType: OrderType;
|
|
342
|
+
}
|
|
343
|
+
declare enum OrderType {
|
|
344
|
+
Delivery = 1,
|
|
345
|
+
Pickup = 2,
|
|
346
|
+
Stationary = 3,
|
|
347
|
+
PersonalFood = 4,
|
|
348
|
+
ShopWindowSupply = 5
|
|
349
|
+
}
|
|
350
|
+
/** Shows the source from where the order has been taken. */
|
|
351
|
+
declare enum OrderSource {
|
|
352
|
+
Telephone = 0,
|
|
353
|
+
Site = 1,
|
|
354
|
+
Restaurant = 2,
|
|
355
|
+
DefectOrder = 3,
|
|
356
|
+
Mobile = 4,
|
|
357
|
+
/** Shift manager order from call center. */
|
|
358
|
+
Pizzeria = 5,
|
|
359
|
+
Aggregator = 6,
|
|
360
|
+
Kiosk = 7
|
|
361
|
+
}
|
|
362
|
+
/** Shows how the order has been paid. Please expect frequent updates in the future. */
|
|
363
|
+
declare enum PaymentType {
|
|
364
|
+
Cash = 0,
|
|
365
|
+
BankCard = 1,
|
|
366
|
+
InternetAcquiring = 2,
|
|
367
|
+
Aggregator = 3
|
|
368
|
+
}
|
|
369
|
+
interface OrderPrice {
|
|
370
|
+
/** The total price of the order (how much the customer actually paid) */
|
|
371
|
+
TotalPrice: number;
|
|
372
|
+
/** Total price of the order excluding tax */
|
|
373
|
+
TotalPriceWithoutTax?: number;
|
|
374
|
+
/** Total discount for the entire order (excluding discounts for individual products in the order) */
|
|
375
|
+
Discount: number;
|
|
376
|
+
/** Total sales tax amount for the order */
|
|
377
|
+
SaleTax?: number;
|
|
378
|
+
/** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */
|
|
379
|
+
RoundedCashAmount?: number;
|
|
380
|
+
}
|
|
381
|
+
interface Product {
|
|
382
|
+
/** Internal product identifier */
|
|
383
|
+
Id: string;
|
|
384
|
+
/** The product's name */
|
|
385
|
+
Name: string;
|
|
386
|
+
/** The quantity of this product in the order */
|
|
387
|
+
Quantity: number;
|
|
388
|
+
PricePerProduct: ProductPrice;
|
|
389
|
+
/** List of ingredients removed from the product */
|
|
390
|
+
RemovedIngredients: string[];
|
|
391
|
+
/** Additional ingredients added to the product */
|
|
392
|
+
AddedIngredients: AddedIngredient[];
|
|
393
|
+
/** The marking data used in some countries to pass scanned barcode value to the cash register. */
|
|
394
|
+
Marking?: MarkingCodes;
|
|
395
|
+
/** The product excise information */
|
|
396
|
+
Excise?: {
|
|
397
|
+
isExcise: boolean;
|
|
398
|
+
};
|
|
399
|
+
/** Additional data that can be defined for specific country */
|
|
400
|
+
CountrySpecific?: {
|
|
401
|
+
Uzbekistan?: UzbekistanProductData;
|
|
402
|
+
Kazakhstan?: KazakhstanProductData;
|
|
403
|
+
Kyrgyzstan?: KyrgyzstanProductData;
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
interface ProductPrice {
|
|
407
|
+
/** Price for 1 product excluding discount but with added ingredients */
|
|
408
|
+
Price: number;
|
|
409
|
+
/** Discount for 1 product (excluding the discount for the entire order) */
|
|
410
|
+
Discount: number;
|
|
411
|
+
Taxes: Tax[];
|
|
412
|
+
}
|
|
413
|
+
interface Tax {
|
|
414
|
+
/** Type of tax: value added or sales */
|
|
415
|
+
Type: 'VAT' | 'Sales' | 'Unknown';
|
|
416
|
+
/** Rate in percents */
|
|
417
|
+
Rate: number;
|
|
418
|
+
}
|
|
419
|
+
interface AddedIngredient {
|
|
420
|
+
/** Ingredient name */
|
|
421
|
+
Name: string;
|
|
422
|
+
/** The amount of ingredients added in portions */
|
|
423
|
+
Quantity: number;
|
|
424
|
+
/** Ingredient price added to the product */
|
|
425
|
+
Price: number;
|
|
426
|
+
}
|
|
427
|
+
interface Customer {
|
|
428
|
+
/** The name of the customer that he gave to the cashier */
|
|
429
|
+
Name: string;
|
|
430
|
+
/** Customer's mailing address, which he set in his personal account */
|
|
431
|
+
Email: string | null;
|
|
432
|
+
/** Any additional identifiers, e.g. customer's Tax Identification Number */
|
|
433
|
+
Identifiers: {
|
|
434
|
+
[index: string]: string;
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
interface CashRegister {
|
|
438
|
+
/** Internal cash register identifier */
|
|
439
|
+
UUId: string;
|
|
440
|
+
/** */
|
|
441
|
+
Number: string;
|
|
442
|
+
/** To calculate or not to calculate VAT */
|
|
443
|
+
ShouldCalculateTax: boolean;
|
|
444
|
+
}
|
|
445
|
+
interface PreviousReceipt {
|
|
446
|
+
/** ID of the receipt returned by the POS printer. `null` if a print error has occurred. It is temporary field. Then it will be removed. Use `Identifier` instead of `Id` */
|
|
447
|
+
Id: number | null;
|
|
448
|
+
/** Printed receipt type: sales receipt or refund receipt */
|
|
449
|
+
Type: 'Sell' | 'Refund';
|
|
450
|
+
/** Date in format ISO 8601 (e.g. 2021-04-30T10:50:00.0000000+04:00) */
|
|
451
|
+
PrintDateTime: string;
|
|
452
|
+
/** ID of the receipt returned by the POS printer */
|
|
453
|
+
Identifier: string | null;
|
|
454
|
+
CashboxId: string;
|
|
455
|
+
/** Data returned by cash register after printing receipt */
|
|
456
|
+
CashRegisterOutput?: string;
|
|
457
|
+
/** Previous receipt payment type */
|
|
458
|
+
PaymentType: PaymentType;
|
|
459
|
+
}
|
|
460
|
+
interface Organization {
|
|
461
|
+
/** Full name of the organization */
|
|
462
|
+
Name: string;
|
|
463
|
+
/** Legal address */
|
|
464
|
+
Address: string;
|
|
465
|
+
/** Organization payment details */
|
|
466
|
+
Requisites: {
|
|
467
|
+
[index: string]: string;
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
interface Store {
|
|
471
|
+
/** Actual address */
|
|
472
|
+
Address: string;
|
|
473
|
+
}
|
|
474
|
+
type RussiaMarkingCode = {
|
|
475
|
+
/** Russian country iso code */
|
|
476
|
+
country: 643;
|
|
477
|
+
/** In Russia it's the string of digits, letters, special symbols and group separator. */
|
|
478
|
+
markingCode: string;
|
|
479
|
+
};
|
|
480
|
+
type BelarusMarkingCodes = {
|
|
481
|
+
/** Belarus country iso code */
|
|
482
|
+
country: 112;
|
|
483
|
+
/** Маркировка унифицированными контрольными знаками (УКЗ) */
|
|
484
|
+
ukzCode?: string;
|
|
485
|
+
/** Маркировка средствами идентификации (СИ) */
|
|
486
|
+
siCode?: string;
|
|
487
|
+
/** Маркировка с использованием штрихкода GTIN */
|
|
488
|
+
gtinCode?: string;
|
|
489
|
+
};
|
|
490
|
+
type ArmeniaMarkingCode = {
|
|
491
|
+
/** Armenia country iso code */
|
|
492
|
+
country: 51;
|
|
493
|
+
/** In Armenia it's the string of digits letters, special symbols and group separator. */
|
|
494
|
+
markingCode: string;
|
|
495
|
+
};
|
|
496
|
+
type UzbekistanMarkingCode = {
|
|
497
|
+
/** Uzbekistan country iso code */
|
|
498
|
+
country: 860;
|
|
499
|
+
/** In Uzbekistan it's the string of digits letters, special symbols and group separator. */
|
|
500
|
+
markingCode: string;
|
|
501
|
+
};
|
|
502
|
+
type MarkingCodes = RussiaMarkingCode | BelarusMarkingCodes | ArmeniaMarkingCode | UzbekistanMarkingCode | undefined;
|
|
3
503
|
|
|
4
504
|
type Money = {
|
|
5
505
|
amount: number;
|
|
@@ -252,4 +752,4 @@ declare enum DigitalReceiptNotificationPreference {
|
|
|
252
752
|
PhoneSms = "PhoneSms"
|
|
253
753
|
}
|
|
254
754
|
|
|
255
|
-
export { type CashRegisterSettings, type DepositCashOptions, DigitalReceiptNotificationPreference, type DigitalReceiptView, type DigitalReceiptViewType, type Fields, type HandleRefundRequest, type HandleRefundRequestClear, type HandleSaleRequest, type HandleSaleRequestClear, type ICashRegister, type IDigitalReceipt, type InitializationOptions, type JobRefundInfo, type KioskPaymentInfo, type KioskRefundInfo, type MakeZReportOptions, type Money, type PrintParams, type PrintTextOptions, type PrintedFiscalReceipt, type PrintedNonFiscalReceipt, type PrintedReceipt, type PrintedRefundReceipt, type ReceiptPaymentInfo, type ReceiptRefundInfo, type RestaurantCashierPaymentInfo, type RestaurantCashierRefundInfo, type WithdrawCashOptions };
|
|
755
|
+
export { type AddedIngredient, Business, type CardInfo, type CardPaymentResult, type CardRefundResult, type CashRegister, type CashRegisterSettings, type Cashier, type Country, type CountryIsoCode, type CreateScopeOptions, type Customer, type DepositCashOptions, DigitalReceiptNotificationPreference, type DigitalReceiptView, type DigitalReceiptViewType, type ErrorMessageMetadataWith, type Fields, type HTMLContentData, type HTMLContentType, type HandleRefundRequest, type HandleRefundRequestClear, type HandleSaleRequest, type HandleSaleRequestClear, type ICashRegister, type IDigitalReceipt, type ILogger, type Image, type InitializationOptions, type JobRefundInfo, type KazakhstanProductData, type KioskPaymentInfo, type KioskRefundInfo, KnownCountryCodes, type KyrgyzstanProductData, type Loyalty, type MakeZReportOptions, type MarkingCodes, type Message, type MessageMetadata, type MessageMetadataWith, type MessageWith, type Money, type OperationIdentifiers, type Order, type OrderPaymentResult, type OrderPrice, type OrderRefundResult, OrderSource, OrderType, type Organization, OwnerType, type PaymentInfo, PaymentMode, type PaymentProvider, type PaymentResult, PaymentSource, PaymentStatus, PaymentType, type PreviousReceipt, type PrintParams, type PrintTextOptions, type PrintedFiscalReceipt, type PrintedNonFiscalReceipt, type PrintedReceipt, type PrintedRefundReceipt, type Product, type ProductPrice, type ProductSpecificData, type QRData, type QRIdData, type QRIdType, type QrPaymentResult, type QrRefundResult, type Receipt, type ReceiptPaymentInfo, type ReceiptRefundInfo, type RefundInfo, type RefundResult, RefundSource, type RestaurantCashierPaymentInfo, type RestaurantCashierRefundInfo, type SlipData, type SlipType, type Store, type Tax, type Taxpayer, type TextSlipData, type TextSlipType, type UzbekistanProductData, type WithdrawCashOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,505 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Enum with supported business types.
|
|
3
|
+
*/
|
|
4
|
+
declare enum Business {
|
|
5
|
+
/**
|
|
6
|
+
* Dodo Pizza business.
|
|
7
|
+
*/
|
|
8
|
+
DodoPizza = "dodoPizza",
|
|
9
|
+
/**
|
|
10
|
+
* Drinkit business.
|
|
11
|
+
*/
|
|
12
|
+
Drinkit = "drinkit",
|
|
13
|
+
/**
|
|
14
|
+
* Doner42 business.
|
|
15
|
+
*/
|
|
16
|
+
Doner42 = "doner42"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Card information.
|
|
21
|
+
*/
|
|
22
|
+
type CardInfo = {
|
|
23
|
+
/**
|
|
24
|
+
* Masked card number, e.g. ************1234.
|
|
25
|
+
*/
|
|
26
|
+
maskedPan: string;
|
|
27
|
+
/**
|
|
28
|
+
* Card expiration date in format MM/YY.
|
|
29
|
+
*/
|
|
30
|
+
expDate: string | null;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Country model
|
|
35
|
+
*/
|
|
36
|
+
interface Country {
|
|
37
|
+
code: CountryIsoCode;
|
|
38
|
+
}
|
|
39
|
+
/** Country code based on [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_numeric)
|
|
40
|
+
* @example 643, 705, 566
|
|
41
|
+
*/
|
|
42
|
+
type CountryIsoCode = number;
|
|
43
|
+
declare enum KnownCountryCodes {
|
|
44
|
+
Belarus = 112,
|
|
45
|
+
Kazakhstan = 398,
|
|
46
|
+
Russia = 643,
|
|
47
|
+
Uzbekistan = 860,
|
|
48
|
+
Kyrgyzstan = 417
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | KyrgyzstanProductData | null;
|
|
52
|
+
interface UzbekistanProductData {
|
|
53
|
+
/** Identification code of products and services for Uzbekistan */
|
|
54
|
+
ikpu: string;
|
|
55
|
+
/** 0 - resail; 1 - own production; 2 - service */
|
|
56
|
+
ownerType?: OwnerType;
|
|
57
|
+
/** code of measurement type */
|
|
58
|
+
units: string;
|
|
59
|
+
/** related with ikpu */
|
|
60
|
+
barcode: string;
|
|
61
|
+
}
|
|
62
|
+
declare enum OwnerType {
|
|
63
|
+
Resail = 0,
|
|
64
|
+
OwnProduction = 1,
|
|
65
|
+
Service = 2
|
|
66
|
+
}
|
|
67
|
+
interface KazakhstanProductData {
|
|
68
|
+
/** Identification code of products */
|
|
69
|
+
gtin?: string;
|
|
70
|
+
ntin?: string;
|
|
71
|
+
}
|
|
72
|
+
interface KyrgyzstanProductData {
|
|
73
|
+
/** `product` — if entry is resold, `service` — if entry is prepared in-house. */
|
|
74
|
+
entryType?: 'product' | 'service';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type Message = {
|
|
78
|
+
content: string;
|
|
79
|
+
} & MessageMetadata;
|
|
80
|
+
type MessageWith<T> = Message & T;
|
|
81
|
+
type MessageMetadata = {
|
|
82
|
+
area?: string;
|
|
83
|
+
};
|
|
84
|
+
type MessageMetadataWith<T> = MessageMetadata & T;
|
|
85
|
+
type ErrorMessageMetadataWith<T> = MessageMetadataWith<T> & {
|
|
86
|
+
error?: Error;
|
|
87
|
+
};
|
|
88
|
+
type CreateScopeOptions = {
|
|
89
|
+
/** If this feature is on: each time when the logger is created,
|
|
90
|
+
* all enabled plugins will launch the optional `registerLogger` call.
|
|
91
|
+
*
|
|
92
|
+
* This allows the plugins to respect the scope of child loggers and select
|
|
93
|
+
* which logger to use under-the-hood while being registered from the original logger.
|
|
94
|
+
*
|
|
95
|
+
* Defaults to `false` */
|
|
96
|
+
propagateUpdatedScopeToPlugins?: boolean;
|
|
97
|
+
};
|
|
98
|
+
interface ILogger<TScope extends Record<string, unknown> = never> {
|
|
99
|
+
createScope<TNewScope>(scope: TNewScope, options?: CreateScopeOptions): ILogger<TScope & TNewScope>;
|
|
100
|
+
diminishScope<TOldScope extends Record<string, unknown>>(scopeToDiminish: TOldScope, options?: CreateScopeOptions): ILogger<Omit<TScope, keyof TOldScope>>;
|
|
101
|
+
trace<T>(message: string, metadata?: MessageMetadataWith<T>): void;
|
|
102
|
+
debug<T>(message: string, metadata?: MessageMetadataWith<T>): void;
|
|
103
|
+
info<T>(message: string, metadata?: MessageMetadataWith<T>): void;
|
|
104
|
+
warn<T>(message: string, metadata?: MessageMetadataWith<T>): void;
|
|
105
|
+
error<T>(message: string, error?: unknown, metadata?: ErrorMessageMetadataWith<T>): void;
|
|
106
|
+
fatal<T>(message: string, error?: unknown, metadata?: ErrorMessageMetadataWith<T>): void;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Unique identifier of the transaction
|
|
111
|
+
*/
|
|
112
|
+
type TransactionId = string;
|
|
113
|
+
type TransactionIdIdentifier = {
|
|
114
|
+
/**
|
|
115
|
+
* Unique identifier of the transaction
|
|
116
|
+
*/
|
|
117
|
+
transactionId: TransactionId;
|
|
118
|
+
/**
|
|
119
|
+
* Retrieval Reference Number (RRN) of the transaction
|
|
120
|
+
*/
|
|
121
|
+
rrn?: never;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Retrieval Reference Number (RRN) of the transaction
|
|
125
|
+
*/
|
|
126
|
+
type RRN = string;
|
|
127
|
+
type RRNIdentifier = {
|
|
128
|
+
/**
|
|
129
|
+
* Unique identifier of the transaction
|
|
130
|
+
*/
|
|
131
|
+
transactionId?: never;
|
|
132
|
+
/**
|
|
133
|
+
* Retrieval Reference Number (RRN) of the transaction
|
|
134
|
+
*/
|
|
135
|
+
rrn: RRN;
|
|
136
|
+
};
|
|
137
|
+
type OperationIdentifiers = TransactionIdIdentifier | RRNIdentifier | {
|
|
138
|
+
/**
|
|
139
|
+
* Unique identifier of the transaction
|
|
140
|
+
*/
|
|
141
|
+
transactionId: TransactionId;
|
|
142
|
+
/**
|
|
143
|
+
* Retrieval Reference Number (RRN) of the transaction
|
|
144
|
+
*/
|
|
145
|
+
rrn: RRN;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
type PaymentInfo = OperationIdentifiers;
|
|
149
|
+
|
|
150
|
+
declare enum PaymentMode {
|
|
151
|
+
Card = "Card",
|
|
152
|
+
QR = "QR"
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
type QRIdType = 'qrId';
|
|
156
|
+
type HTMLContentType = 'htmlContent';
|
|
157
|
+
type QRIdData = {
|
|
158
|
+
type: QRIdType;
|
|
159
|
+
/**
|
|
160
|
+
* URL or ID of the QR code.
|
|
161
|
+
*/
|
|
162
|
+
qrId: string;
|
|
163
|
+
};
|
|
164
|
+
type HTMLContentData = {
|
|
165
|
+
type: HTMLContentType;
|
|
166
|
+
/**
|
|
167
|
+
* HTML content that can be used to display the QR code.
|
|
168
|
+
*/
|
|
169
|
+
html: string;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* QR code data.
|
|
173
|
+
*/
|
|
174
|
+
type QRData = QRIdData | HTMLContentData;
|
|
175
|
+
|
|
176
|
+
type TextSlipType = 'text';
|
|
177
|
+
/**
|
|
178
|
+
* Represents the slip type for CARD payment request
|
|
179
|
+
* In the future it could be extended with other types like 'html' or 'pdf'
|
|
180
|
+
*/
|
|
181
|
+
type SlipType = TextSlipType;
|
|
182
|
+
type TextSlipData = {
|
|
183
|
+
type: TextSlipType;
|
|
184
|
+
textLines: string[];
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Represents the slip data for CARD payment request
|
|
188
|
+
* In the future it could be extended with other types like HtmlSlipData or PdfSlipData
|
|
189
|
+
*/
|
|
190
|
+
type SlipData = TextSlipData;
|
|
191
|
+
|
|
192
|
+
type QrPaymentResult = {
|
|
193
|
+
/**
|
|
194
|
+
* Information about the payment.
|
|
195
|
+
*/
|
|
196
|
+
paymentInfo: PaymentInfo;
|
|
197
|
+
/**
|
|
198
|
+
* QR code data
|
|
199
|
+
*/
|
|
200
|
+
qrData: QRData;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Represents the payment result for CARD payment request
|
|
204
|
+
*/
|
|
205
|
+
type CardPaymentResult = {
|
|
206
|
+
/**
|
|
207
|
+
* Information about the payment.
|
|
208
|
+
*/
|
|
209
|
+
paymentInfo: PaymentInfo;
|
|
210
|
+
/**
|
|
211
|
+
* Data for slip
|
|
212
|
+
*/
|
|
213
|
+
slip: SlipData | null;
|
|
214
|
+
/**
|
|
215
|
+
* Card information
|
|
216
|
+
*/
|
|
217
|
+
card: CardInfo | null;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Represents the result of a payment operation.
|
|
221
|
+
*/
|
|
222
|
+
type PaymentResult<T extends PaymentMode = PaymentMode.Card> = T extends PaymentMode.Card ? CardPaymentResult : T extends PaymentMode.QR ? QrPaymentResult : never;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The result of a payment operation for an order.
|
|
226
|
+
* Discriminated union on the shape of the result — add new payment results here as needed.
|
|
227
|
+
*/
|
|
228
|
+
type OrderPaymentResult = CardPaymentResult | QrPaymentResult;
|
|
229
|
+
|
|
230
|
+
type RefundInfo = OperationIdentifiers;
|
|
231
|
+
type BaseRefundResult = {
|
|
232
|
+
refundInfo: RefundInfo;
|
|
233
|
+
};
|
|
234
|
+
type CardRefundResult = BaseRefundResult & {
|
|
235
|
+
slip: SlipData | null;
|
|
236
|
+
};
|
|
237
|
+
type QrRefundResult = BaseRefundResult;
|
|
238
|
+
/**
|
|
239
|
+
* Represents the result of a refund operation.
|
|
240
|
+
*/
|
|
241
|
+
type RefundResult<T extends PaymentMode = PaymentMode.Card> = T extends PaymentMode.Card ? CardRefundResult : T extends PaymentMode.QR ? QrRefundResult : never;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* The result of a refund operation for an order.
|
|
245
|
+
* Discriminated union on the shape of the result — add new refund results here as needed.
|
|
246
|
+
*/
|
|
247
|
+
type OrderRefundResult = CardRefundResult | QrRefundResult;
|
|
248
|
+
|
|
249
|
+
/** The name of the payment provider (e.g. "Ibox", "KaspiQr", "Json_Electron_PosPlugin"). */
|
|
250
|
+
type PaymentProvider = string;
|
|
251
|
+
|
|
252
|
+
declare enum PaymentSource {
|
|
253
|
+
RestaurantCashier = 0,
|
|
254
|
+
Kiosk = 1
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
declare enum PaymentStatus {
|
|
258
|
+
NotFound = "NotFound",
|
|
259
|
+
PaymentPending = "PaymentPending",
|
|
260
|
+
PaymentCompleted = "PaymentCompleted",
|
|
261
|
+
RefundPending = "RefundPending",
|
|
262
|
+
RefundCompleted = "RefundCompleted",
|
|
263
|
+
NotNeeded = "NotNeeded"
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
declare enum RefundSource {
|
|
267
|
+
RestaurantCashier = "RestaurantCashier",
|
|
268
|
+
RefundJob = "RefundJob",
|
|
269
|
+
Kiosk = "Kiosk"
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
interface Taxpayer {
|
|
273
|
+
/** A tax identification number. It is used for value added tax purposes.
|
|
274
|
+
* The formal name may differ from country to country: It could be NIP for Poland, INN for Russia, or VAT number.
|
|
275
|
+
* https://en.wikipedia.org/wiki/VAT_identification_number */
|
|
276
|
+
IdentificationNumber: string | null;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
interface Receipt {
|
|
280
|
+
/** Order for this receipt */
|
|
281
|
+
Order: Order;
|
|
282
|
+
/** Country code based on ISO 3166-1 numeric */
|
|
283
|
+
CountryCode: number;
|
|
284
|
+
/** Customer information */
|
|
285
|
+
Customer: Customer;
|
|
286
|
+
/** Taxpayer information */
|
|
287
|
+
Taxpayer: Taxpayer;
|
|
288
|
+
/** Cash register from which the receipt is printed */
|
|
289
|
+
CashRegister: CashRegister;
|
|
290
|
+
/** Previous receipts that were printed for this order, including refunds */
|
|
291
|
+
PreviousReceipts: PreviousReceipt[];
|
|
292
|
+
/** Information about the organization that printed the receipt */
|
|
293
|
+
Organization: Organization;
|
|
294
|
+
/** Information about the store in which the purchase is occurring */
|
|
295
|
+
Store: Store;
|
|
296
|
+
/** Information needed for the loyalty program. */
|
|
297
|
+
Loyalty?: Loyalty;
|
|
298
|
+
/** Cash from the customer (if paid in cash) */
|
|
299
|
+
CashFromCustomer: number;
|
|
300
|
+
/** Information about the person taking the order. */
|
|
301
|
+
Cashier?: Cashier;
|
|
302
|
+
/** Url of the image to print on the receipt. */
|
|
303
|
+
Image?: Image;
|
|
304
|
+
/** @internal */
|
|
305
|
+
IdempotencyKey: string;
|
|
306
|
+
}
|
|
307
|
+
interface Cashier {
|
|
308
|
+
/** Cashier name */
|
|
309
|
+
Name: string;
|
|
310
|
+
/** Cashier INN in russia and its analogues in other countries. */
|
|
311
|
+
TaxIdentificationNumber?: string;
|
|
312
|
+
}
|
|
313
|
+
interface Image {
|
|
314
|
+
/** Url of the image to print on the receipt. */
|
|
315
|
+
Url?: string;
|
|
316
|
+
/** Image data in base64 format. (ONLY FOR RUSSIA ATOL) */
|
|
317
|
+
Base64Data?: string;
|
|
318
|
+
}
|
|
319
|
+
interface Loyalty {
|
|
320
|
+
/** Customer Phone number */
|
|
321
|
+
PhoneNumber: string;
|
|
322
|
+
/** Amount of the bonus points awarded for the loyalty program. */
|
|
323
|
+
AwardedBonus: number;
|
|
324
|
+
}
|
|
325
|
+
interface Order {
|
|
326
|
+
/** Internal order identifier */
|
|
327
|
+
Id: string;
|
|
328
|
+
/** Order number seen by customers (e.g. "1-3") */
|
|
329
|
+
Number: string;
|
|
330
|
+
/** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
|
|
331
|
+
CreateDate: string;
|
|
332
|
+
/** Products in cart */
|
|
333
|
+
Products: Product[];
|
|
334
|
+
Price: OrderPrice;
|
|
335
|
+
/** @deprecated Please switch to PaymentTypeEnum. */
|
|
336
|
+
PaymentType: 'Cash' | 'BankCard';
|
|
337
|
+
PaymentTypeEnum: PaymentType;
|
|
338
|
+
OrderSource: OrderSource;
|
|
339
|
+
/** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
|
|
340
|
+
DeliveryDate?: string;
|
|
341
|
+
OrderType: OrderType;
|
|
342
|
+
}
|
|
343
|
+
declare enum OrderType {
|
|
344
|
+
Delivery = 1,
|
|
345
|
+
Pickup = 2,
|
|
346
|
+
Stationary = 3,
|
|
347
|
+
PersonalFood = 4,
|
|
348
|
+
ShopWindowSupply = 5
|
|
349
|
+
}
|
|
350
|
+
/** Shows the source from where the order has been taken. */
|
|
351
|
+
declare enum OrderSource {
|
|
352
|
+
Telephone = 0,
|
|
353
|
+
Site = 1,
|
|
354
|
+
Restaurant = 2,
|
|
355
|
+
DefectOrder = 3,
|
|
356
|
+
Mobile = 4,
|
|
357
|
+
/** Shift manager order from call center. */
|
|
358
|
+
Pizzeria = 5,
|
|
359
|
+
Aggregator = 6,
|
|
360
|
+
Kiosk = 7
|
|
361
|
+
}
|
|
362
|
+
/** Shows how the order has been paid. Please expect frequent updates in the future. */
|
|
363
|
+
declare enum PaymentType {
|
|
364
|
+
Cash = 0,
|
|
365
|
+
BankCard = 1,
|
|
366
|
+
InternetAcquiring = 2,
|
|
367
|
+
Aggregator = 3
|
|
368
|
+
}
|
|
369
|
+
interface OrderPrice {
|
|
370
|
+
/** The total price of the order (how much the customer actually paid) */
|
|
371
|
+
TotalPrice: number;
|
|
372
|
+
/** Total price of the order excluding tax */
|
|
373
|
+
TotalPriceWithoutTax?: number;
|
|
374
|
+
/** Total discount for the entire order (excluding discounts for individual products in the order) */
|
|
375
|
+
Discount: number;
|
|
376
|
+
/** Total sales tax amount for the order */
|
|
377
|
+
SaleTax?: number;
|
|
378
|
+
/** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */
|
|
379
|
+
RoundedCashAmount?: number;
|
|
380
|
+
}
|
|
381
|
+
interface Product {
|
|
382
|
+
/** Internal product identifier */
|
|
383
|
+
Id: string;
|
|
384
|
+
/** The product's name */
|
|
385
|
+
Name: string;
|
|
386
|
+
/** The quantity of this product in the order */
|
|
387
|
+
Quantity: number;
|
|
388
|
+
PricePerProduct: ProductPrice;
|
|
389
|
+
/** List of ingredients removed from the product */
|
|
390
|
+
RemovedIngredients: string[];
|
|
391
|
+
/** Additional ingredients added to the product */
|
|
392
|
+
AddedIngredients: AddedIngredient[];
|
|
393
|
+
/** The marking data used in some countries to pass scanned barcode value to the cash register. */
|
|
394
|
+
Marking?: MarkingCodes;
|
|
395
|
+
/** The product excise information */
|
|
396
|
+
Excise?: {
|
|
397
|
+
isExcise: boolean;
|
|
398
|
+
};
|
|
399
|
+
/** Additional data that can be defined for specific country */
|
|
400
|
+
CountrySpecific?: {
|
|
401
|
+
Uzbekistan?: UzbekistanProductData;
|
|
402
|
+
Kazakhstan?: KazakhstanProductData;
|
|
403
|
+
Kyrgyzstan?: KyrgyzstanProductData;
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
interface ProductPrice {
|
|
407
|
+
/** Price for 1 product excluding discount but with added ingredients */
|
|
408
|
+
Price: number;
|
|
409
|
+
/** Discount for 1 product (excluding the discount for the entire order) */
|
|
410
|
+
Discount: number;
|
|
411
|
+
Taxes: Tax[];
|
|
412
|
+
}
|
|
413
|
+
interface Tax {
|
|
414
|
+
/** Type of tax: value added or sales */
|
|
415
|
+
Type: 'VAT' | 'Sales' | 'Unknown';
|
|
416
|
+
/** Rate in percents */
|
|
417
|
+
Rate: number;
|
|
418
|
+
}
|
|
419
|
+
interface AddedIngredient {
|
|
420
|
+
/** Ingredient name */
|
|
421
|
+
Name: string;
|
|
422
|
+
/** The amount of ingredients added in portions */
|
|
423
|
+
Quantity: number;
|
|
424
|
+
/** Ingredient price added to the product */
|
|
425
|
+
Price: number;
|
|
426
|
+
}
|
|
427
|
+
interface Customer {
|
|
428
|
+
/** The name of the customer that he gave to the cashier */
|
|
429
|
+
Name: string;
|
|
430
|
+
/** Customer's mailing address, which he set in his personal account */
|
|
431
|
+
Email: string | null;
|
|
432
|
+
/** Any additional identifiers, e.g. customer's Tax Identification Number */
|
|
433
|
+
Identifiers: {
|
|
434
|
+
[index: string]: string;
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
interface CashRegister {
|
|
438
|
+
/** Internal cash register identifier */
|
|
439
|
+
UUId: string;
|
|
440
|
+
/** */
|
|
441
|
+
Number: string;
|
|
442
|
+
/** To calculate or not to calculate VAT */
|
|
443
|
+
ShouldCalculateTax: boolean;
|
|
444
|
+
}
|
|
445
|
+
interface PreviousReceipt {
|
|
446
|
+
/** ID of the receipt returned by the POS printer. `null` if a print error has occurred. It is temporary field. Then it will be removed. Use `Identifier` instead of `Id` */
|
|
447
|
+
Id: number | null;
|
|
448
|
+
/** Printed receipt type: sales receipt or refund receipt */
|
|
449
|
+
Type: 'Sell' | 'Refund';
|
|
450
|
+
/** Date in format ISO 8601 (e.g. 2021-04-30T10:50:00.0000000+04:00) */
|
|
451
|
+
PrintDateTime: string;
|
|
452
|
+
/** ID of the receipt returned by the POS printer */
|
|
453
|
+
Identifier: string | null;
|
|
454
|
+
CashboxId: string;
|
|
455
|
+
/** Data returned by cash register after printing receipt */
|
|
456
|
+
CashRegisterOutput?: string;
|
|
457
|
+
/** Previous receipt payment type */
|
|
458
|
+
PaymentType: PaymentType;
|
|
459
|
+
}
|
|
460
|
+
interface Organization {
|
|
461
|
+
/** Full name of the organization */
|
|
462
|
+
Name: string;
|
|
463
|
+
/** Legal address */
|
|
464
|
+
Address: string;
|
|
465
|
+
/** Organization payment details */
|
|
466
|
+
Requisites: {
|
|
467
|
+
[index: string]: string;
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
interface Store {
|
|
471
|
+
/** Actual address */
|
|
472
|
+
Address: string;
|
|
473
|
+
}
|
|
474
|
+
type RussiaMarkingCode = {
|
|
475
|
+
/** Russian country iso code */
|
|
476
|
+
country: 643;
|
|
477
|
+
/** In Russia it's the string of digits, letters, special symbols and group separator. */
|
|
478
|
+
markingCode: string;
|
|
479
|
+
};
|
|
480
|
+
type BelarusMarkingCodes = {
|
|
481
|
+
/** Belarus country iso code */
|
|
482
|
+
country: 112;
|
|
483
|
+
/** Маркировка унифицированными контрольными знаками (УКЗ) */
|
|
484
|
+
ukzCode?: string;
|
|
485
|
+
/** Маркировка средствами идентификации (СИ) */
|
|
486
|
+
siCode?: string;
|
|
487
|
+
/** Маркировка с использованием штрихкода GTIN */
|
|
488
|
+
gtinCode?: string;
|
|
489
|
+
};
|
|
490
|
+
type ArmeniaMarkingCode = {
|
|
491
|
+
/** Armenia country iso code */
|
|
492
|
+
country: 51;
|
|
493
|
+
/** In Armenia it's the string of digits letters, special symbols and group separator. */
|
|
494
|
+
markingCode: string;
|
|
495
|
+
};
|
|
496
|
+
type UzbekistanMarkingCode = {
|
|
497
|
+
/** Uzbekistan country iso code */
|
|
498
|
+
country: 860;
|
|
499
|
+
/** In Uzbekistan it's the string of digits letters, special symbols and group separator. */
|
|
500
|
+
markingCode: string;
|
|
501
|
+
};
|
|
502
|
+
type MarkingCodes = RussiaMarkingCode | BelarusMarkingCodes | ArmeniaMarkingCode | UzbekistanMarkingCode | undefined;
|
|
3
503
|
|
|
4
504
|
type Money = {
|
|
5
505
|
amount: number;
|
|
@@ -252,4 +752,4 @@ declare enum DigitalReceiptNotificationPreference {
|
|
|
252
752
|
PhoneSms = "PhoneSms"
|
|
253
753
|
}
|
|
254
754
|
|
|
255
|
-
export { type CashRegisterSettings, type DepositCashOptions, DigitalReceiptNotificationPreference, type DigitalReceiptView, type DigitalReceiptViewType, type Fields, type HandleRefundRequest, type HandleRefundRequestClear, type HandleSaleRequest, type HandleSaleRequestClear, type ICashRegister, type IDigitalReceipt, type InitializationOptions, type JobRefundInfo, type KioskPaymentInfo, type KioskRefundInfo, type MakeZReportOptions, type Money, type PrintParams, type PrintTextOptions, type PrintedFiscalReceipt, type PrintedNonFiscalReceipt, type PrintedReceipt, type PrintedRefundReceipt, type ReceiptPaymentInfo, type ReceiptRefundInfo, type RestaurantCashierPaymentInfo, type RestaurantCashierRefundInfo, type WithdrawCashOptions };
|
|
755
|
+
export { type AddedIngredient, Business, type CardInfo, type CardPaymentResult, type CardRefundResult, type CashRegister, type CashRegisterSettings, type Cashier, type Country, type CountryIsoCode, type CreateScopeOptions, type Customer, type DepositCashOptions, DigitalReceiptNotificationPreference, type DigitalReceiptView, type DigitalReceiptViewType, type ErrorMessageMetadataWith, type Fields, type HTMLContentData, type HTMLContentType, type HandleRefundRequest, type HandleRefundRequestClear, type HandleSaleRequest, type HandleSaleRequestClear, type ICashRegister, type IDigitalReceipt, type ILogger, type Image, type InitializationOptions, type JobRefundInfo, type KazakhstanProductData, type KioskPaymentInfo, type KioskRefundInfo, KnownCountryCodes, type KyrgyzstanProductData, type Loyalty, type MakeZReportOptions, type MarkingCodes, type Message, type MessageMetadata, type MessageMetadataWith, type MessageWith, type Money, type OperationIdentifiers, type Order, type OrderPaymentResult, type OrderPrice, type OrderRefundResult, OrderSource, OrderType, type Organization, OwnerType, type PaymentInfo, PaymentMode, type PaymentProvider, type PaymentResult, PaymentSource, PaymentStatus, PaymentType, type PreviousReceipt, type PrintParams, type PrintTextOptions, type PrintedFiscalReceipt, type PrintedNonFiscalReceipt, type PrintedReceipt, type PrintedRefundReceipt, type Product, type ProductPrice, type ProductSpecificData, type QRData, type QRIdData, type QRIdType, type QrPaymentResult, type QrRefundResult, type Receipt, type ReceiptPaymentInfo, type ReceiptRefundInfo, type RefundInfo, type RefundResult, RefundSource, type RestaurantCashierPaymentInfo, type RestaurantCashierRefundInfo, type SlipData, type SlipType, type Store, type Tax, type Taxpayer, type TextSlipData, type TextSlipType, type UzbekistanProductData, type WithdrawCashOptions };
|
package/dist/index.js
CHANGED
|
@@ -1,66 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var Business = /* @__PURE__ */ ((Business2) => {
|
|
3
|
-
Business2["DodoPizza"] = `dodoPizza`;
|
|
4
|
-
Business2["Drinkit"] = `drinkit`;
|
|
5
|
-
Business2["Doner42"] = `doner42`;
|
|
6
|
-
return Business2;
|
|
7
|
-
})(Business || {});
|
|
8
|
-
var KnownCountryCodes = /* @__PURE__ */ ((KnownCountryCodes2) => {
|
|
9
|
-
KnownCountryCodes2[KnownCountryCodes2["Belarus"] = 112] = "Belarus";
|
|
10
|
-
KnownCountryCodes2[KnownCountryCodes2["Kazakhstan"] = 398] = "Kazakhstan";
|
|
11
|
-
KnownCountryCodes2[KnownCountryCodes2["Russia"] = 643] = "Russia";
|
|
12
|
-
KnownCountryCodes2[KnownCountryCodes2["Uzbekistan"] = 860] = "Uzbekistan";
|
|
13
|
-
KnownCountryCodes2[KnownCountryCodes2["Kyrgyzstan"] = 417] = "Kyrgyzstan";
|
|
14
|
-
return KnownCountryCodes2;
|
|
15
|
-
})(KnownCountryCodes || {});
|
|
16
|
-
var OwnerType = /* @__PURE__ */ ((OwnerType2) => {
|
|
17
|
-
OwnerType2[OwnerType2["Resail"] = 0] = "Resail";
|
|
18
|
-
OwnerType2[OwnerType2["OwnProduction"] = 1] = "OwnProduction";
|
|
19
|
-
OwnerType2[OwnerType2["Service"] = 2] = "Service";
|
|
20
|
-
return OwnerType2;
|
|
21
|
-
})(OwnerType || {});
|
|
22
|
-
var OrderType = /* @__PURE__ */ ((OrderType2) => {
|
|
23
|
-
OrderType2[OrderType2["Delivery"] = 1] = "Delivery";
|
|
24
|
-
OrderType2[OrderType2["Pickup"] = 2] = "Pickup";
|
|
25
|
-
OrderType2[OrderType2["Stationary"] = 3] = "Stationary";
|
|
26
|
-
OrderType2[OrderType2["PersonalFood"] = 4] = "PersonalFood";
|
|
27
|
-
OrderType2[OrderType2["ShopWindowSupply"] = 5] = "ShopWindowSupply";
|
|
28
|
-
return OrderType2;
|
|
29
|
-
})(OrderType || {});
|
|
30
|
-
var OrderSource = /* @__PURE__ */ ((OrderSource2) => {
|
|
31
|
-
OrderSource2[OrderSource2["Telephone"] = 0] = "Telephone";
|
|
32
|
-
OrderSource2[OrderSource2["Site"] = 1] = "Site";
|
|
33
|
-
OrderSource2[OrderSource2["Restaurant"] = 2] = "Restaurant";
|
|
34
|
-
OrderSource2[OrderSource2["DefectOrder"] = 3] = "DefectOrder";
|
|
35
|
-
OrderSource2[OrderSource2["Mobile"] = 4] = "Mobile";
|
|
36
|
-
OrderSource2[OrderSource2["Pizzeria"] = 5] = "Pizzeria";
|
|
37
|
-
OrderSource2[OrderSource2["Aggregator"] = 6] = "Aggregator";
|
|
38
|
-
OrderSource2[OrderSource2["Kiosk"] = 7] = "Kiosk";
|
|
39
|
-
return OrderSource2;
|
|
40
|
-
})(OrderSource || {});
|
|
41
|
-
var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
|
|
42
|
-
PaymentType2[PaymentType2["Cash"] = 0] = "Cash";
|
|
43
|
-
PaymentType2[PaymentType2["BankCard"] = 1] = "BankCard";
|
|
44
|
-
PaymentType2[PaymentType2["InternetAcquiring"] = 2] = "InternetAcquiring";
|
|
45
|
-
PaymentType2[PaymentType2["Aggregator"] = 3] = "Aggregator";
|
|
46
|
-
return PaymentType2;
|
|
47
|
-
})(PaymentType || {});
|
|
48
|
-
|
|
49
|
-
// src/PrintParams.ts
|
|
50
|
-
var DigitalReceiptNotificationPreference = /* @__PURE__ */ ((DigitalReceiptNotificationPreference2) => {
|
|
51
|
-
DigitalReceiptNotificationPreference2["NotSpecified"] = `NotSpecified`;
|
|
52
|
-
DigitalReceiptNotificationPreference2["None"] = `None`;
|
|
53
|
-
DigitalReceiptNotificationPreference2["Email"] = `Email`;
|
|
54
|
-
DigitalReceiptNotificationPreference2["PhoneSms"] = `PhoneSms`;
|
|
55
|
-
return DigitalReceiptNotificationPreference2;
|
|
56
|
-
})(DigitalReceiptNotificationPreference || {});
|
|
57
|
-
export {
|
|
58
|
-
Business,
|
|
59
|
-
DigitalReceiptNotificationPreference,
|
|
60
|
-
KnownCountryCodes,
|
|
61
|
-
OrderSource,
|
|
62
|
-
OrderType,
|
|
63
|
-
OwnerType,
|
|
64
|
-
PaymentType
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
var t=(a=>(a.DodoPizza="dodoPizza",a.Drinkit="drinkit",a.Doner42="doner42",a))(t||{}),o=(a=>(a[a.Belarus=112]="Belarus",a[a.Kazakhstan=398]="Kazakhstan",a[a.Russia=643]="Russia",a[a.Uzbekistan=860]="Uzbekistan",a[a.Kyrgyzstan=417]="Kyrgyzstan",a))(o||{}),r=(a=>(a[a.Resail=0]="Resail",a[a.OwnProduction=1]="OwnProduction",a[a.Service=2]="Service",a))(r||{}),f=(a=>(a.Card="Card",a.QR="QR",a))(f||{}),x=(a=>(a[a.RestaurantCashier=0]="RestaurantCashier",a[a.Kiosk=1]="Kiosk",a))(x||{}),l=(a=>(a.NotFound="NotFound",a.PaymentPending="PaymentPending",a.PaymentCompleted="PaymentCompleted",a.RefundPending="RefundPending",a.RefundCompleted="RefundCompleted",a.NotNeeded="NotNeeded",a))(l||{}),g=(a=>(a.RestaurantCashier="RestaurantCashier",a.RefundJob="RefundJob",a.Kiosk="Kiosk",a))(g||{}),n=(a=>(a[a.Delivery=1]="Delivery",a[a.Pickup=2]="Pickup",a[a.Stationary=3]="Stationary",a[a.PersonalFood=4]="PersonalFood",a[a.ShopWindowSupply=5]="ShopWindowSupply",a))(n||{}),s=(a=>(a[a.Telephone=0]="Telephone",a[a.Site=1]="Site",a[a.Restaurant=2]="Restaurant",a[a.DefectOrder=3]="DefectOrder",a[a.Mobile=4]="Mobile",a[a.Pizzeria=5]="Pizzeria",a[a.Aggregator=6]="Aggregator",a[a.Kiosk=7]="Kiosk",a))(s||{}),k=(a=>(a[a.Cash=0]="Cash",a[a.BankCard=1]="BankCard",a[a.InternetAcquiring=2]="InternetAcquiring",a[a.Aggregator=3]="Aggregator",a))(k||{});var h=(i=>(i.NotSpecified="NotSpecified",i.None="None",i.Email="Email",i.PhoneSms="PhoneSms",i))(h||{});export{t as Business,h as DigitalReceiptNotificationPreference,o as KnownCountryCodes,s as OrderSource,n as OrderType,r as OwnerType,f as PaymentMode,x as PaymentSource,l as PaymentStatus,k as PaymentType,g as RefundSource};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dodobrands/pos-receipts-plugin-contracts",
|
|
3
|
-
"version": "5.13.
|
|
3
|
+
"version": "5.13.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
|
-
"build": "tsup src/index.ts --format cjs,esm --dts --clean --
|
|
34
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --dts-resolve --clean --minify",
|
|
35
35
|
"lint": "eslint \"{**/*,*}.{ts,tsx,js,jsx,json,mjs,cjs}\"",
|
|
36
36
|
"lint:fix": "yarn lint --fix"
|
|
37
37
|
},
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../../../shared/pos-plugins-shared-models/src/Business.ts","../../../shared/pos-plugins-shared-models/src/Country.ts","../../../shared/pos-plugins-shared-models/src/CountrySpecificData.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentMode.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentSource.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentStatus.ts","../../../shared/pos-plugins-shared-models/src/payment/RefundSource.ts","../../../shared/pos-plugins-shared-models/src/receipt/Receipt.ts","../src/PrintParams.ts"],"sourcesContent":["export { Business } from '@dodobrands/pos-plugins-shared-models';\nexport { Country, CountryIsoCode, KnownCountryCodes } from '@dodobrands/pos-plugins-shared-models';\n\nexport * from './cashCollection/DepositCashOptions';\nexport * from './cashCollection/Money';\nexport * from './cashCollection/WithdrawCashOptions';\nexport * from './CashRegisterSettings';\nexport * from './CountrySpecificData';\nexport * from './HandleRefundRequest';\nexport * from './HandleSaleRequest';\nexport * from './ICashRegister';\nexport * from './IDigitalReceipt';\nexport * from './InitializationOptions';\nexport * from './MakeZReportOptions';\nexport * from './PrintedReceipt';\nexport * from './PrintedRefundReceipt';\nexport * from './PrintParams';\nexport * from './PrintTextOptions';\nexport * from './Receipt';\nexport * from './ReceiptPaymentInfo';\nexport * from './ReceiptRefundInfo';\nexport * from './Taxpayer';\n","/**\n * Enum with supported business types.\n */\nexport enum Business {\n\t/**\n\t * Dodo Pizza business.\n\t */\n\tDodoPizza = `dodoPizza`,\n\t/**\n\t * Drinkit business.\n\t */\n\tDrinkit = `drinkit`,\n\t/**\n\t * Doner42 business.\n\t */\n\tDoner42 = `doner42`,\n}\n","/**\n * Country model\n */\nexport interface Country {\n\tcode: CountryIsoCode;\n}\n\n/** Country code based on [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_numeric)\n * @example 643, 705, 566\n */\nexport type CountryIsoCode = number;\n\nexport enum KnownCountryCodes {\n\tBelarus = 112,\n\tKazakhstan = 398,\n\tRussia = 643,\n\tUzbekistan = 860,\n\tKyrgyzstan = 417,\n}\n","export type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | KyrgyzstanProductData | null;\n\nexport interface UzbekistanProductData {\n\t/** Identification code of products and services for Uzbekistan */\n\tikpu: string;\n\t/** 0 - resail; 1 - own production; 2 - service */\n\townerType?: OwnerType;\n\t/** code of measurement type */\n\tunits: string;\n\t/** related with ikpu */\n\tbarcode: string;\n}\n\nexport enum OwnerType {\n\tResail = 0,\n\tOwnProduction = 1,\n\tService = 2,\n}\n\nexport interface KazakhstanProductData {\n\t/** Identification code of products */\n\tgtin?: string;\n\tntin?: string;\n}\n\nexport interface KyrgyzstanProductData {\n\t/** `product` — if entry is resold, `service` — if entry is prepared in-house. */\n\tentryType?: 'product' | 'service';\n}\n","export enum PaymentMode {\n\tCard = `Card`,\n\tQR = `QR`,\n}\n","export enum PaymentSource {\n\tRestaurantCashier = 0,\n\tKiosk = 1,\n}\n","export enum PaymentStatus {\n\tNotFound = `NotFound`,\n\tPaymentPending = `PaymentPending`,\n\tPaymentCompleted = `PaymentCompleted`,\n\tRefundPending = `RefundPending`,\n\tRefundCompleted = `RefundCompleted`,\n\tNotNeeded = `NotNeeded`,\n}\n","export enum RefundSource {\n\tRestaurantCashier = `RestaurantCashier`,\n\tRefundJob = `RefundJob`,\n\tKiosk = `Kiosk`,\n}\n","/* eslint-disable @typescript-eslint/no-magic-numbers */\nimport {\n\ttype KazakhstanProductData,\n\ttype KyrgyzstanProductData,\n\ttype UzbekistanProductData,\n} from '../CountrySpecificData';\nimport { type Taxpayer } from './Taxpayer';\n\nexport interface Receipt {\n\t/** Order for this receipt */\n\tOrder: Order;\n\t/** Customer information */\n\tCustomer: Customer;\n\t/** Taxpayer information */\n\tTaxpayer: Taxpayer;\n\t/** Cash register from which the receipt is printed */\n\tCashRegister: CashRegister;\n\t/** Previous receipts that were printed for this order, including refunds */\n\tPreviousReceipts: PreviousReceipt[];\n\t/** Information about the organization that printed the receipt */\n\tOrganization: Organization;\n\t/** Information about the store in which the purchase is occurring */\n\tStore: Store;\n\n\t/** Information needed for the loyalty program. */\n\tLoyalty?: Loyalty;\n\n\t/** Cash from the customer (if paid in cash) */\n\tCashFromCustomer: number;\n\n\t/** Information about the person taking the order. */\n\tCashier?: Cashier;\n\n\t/** Url of the image to print on the receipt. */\n\tImage?: Image;\n}\n\nexport interface Cashier {\n\t/** Cashier name */\n\tName: string;\n\n\t/** Cashier INN in russia and its analogues in other countries. */\n\tTaxIdentificationNumber?: string;\n}\n\nexport interface Image {\n\t/** Url of the image to print on the receipt. */\n\tUrl?: string;\n\n\t/** Image data in base64 format. (ONLY FOR RUSSIA ATOL) */\n\tBase64Data?: string;\n}\n\nexport interface Loyalty {\n\t/** Customer Phone number */\n\tPhoneNumber: string;\n\t/** Amount of the bonus points awarded for the loyalty program. */\n\tAwardedBonus: number;\n}\n\nexport interface Order {\n\t/** Internal order identifier */\n\tId: string;\n\t/** Order number seen by customers (e.g. \"1-3\") */\n\tNumber: string; // from OrderNumber\n\t/** Current time in ISO 8601 format (e.g. \"2021-04-30T10:50:00.0000000+04:00\") */\n\tCreateDate: string;\n\t/** Products in cart */\n\tProducts: Product[];\n\tPrice: OrderPrice;\n\t/** @deprecated Please switch to PaymentTypeEnum. */\n\tPaymentType: 'Cash' | 'BankCard';\n\tPaymentTypeEnum: PaymentType;\n\tOrderSource: OrderSource;\n\n\t/** Current time in ISO 8601 format (e.g. \"2021-04-30T10:50:00.0000000+04:00\") */\n\tDeliveryDate?: string;\n\tOrderType: OrderType;\n}\n\nexport enum OrderType {\n\tDelivery = 1,\n\tPickup = 2,\n\tStationary = 3,\n\tPersonalFood = 4,\n\tShopWindowSupply = 5,\n}\n\n/** Shows the source from where the order has been taken. */\nexport enum OrderSource {\n\tTelephone = 0,\n\tSite = 1,\n\tRestaurant = 2,\n\tDefectOrder = 3,\n\tMobile = 4,\n\t/** Shift manager order from call center. */\n\tPizzeria = 5,\n\tAggregator = 6,\n\tKiosk = 7,\n}\n\n/** Shows how the order has been paid. Please expect frequent updates in the future. */\nexport enum PaymentType {\n\tCash = 0,\n\tBankCard = 1,\n\tInternetAcquiring = 2,\n\tAggregator = 3,\n}\n\nexport interface OrderPrice {\n\t/** The total price of the order (how much the customer actually paid) */\n\tTotalPrice: number;\n\t/** Total price of the order excluding tax */\n\tTotalPriceWithoutTax?: number;\n\t/** Total discount for the entire order (excluding discounts for individual products in the order) */\n\tDiscount: number;\n\t/** Total sales tax amount for the order */\n\tSaleTax?: number;\n\t/** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */\n\tRoundedCashAmount?: number;\n}\n\nexport interface Product {\n\t/** Internal product identifier */\n\tId: string;\n\t/** The product's name */\n\tName: string;\n\t/** The quantity of this product in the order */\n\tQuantity: number;\n\tPricePerProduct: ProductPrice;\n\t/** List of ingredients removed from the product */\n\tRemovedIngredients: string[];\n\t/** Additional ingredients added to the product */\n\tAddedIngredients: AddedIngredient[];\n\n\t/** The marking data used in some countries to pass scanned barcode value to the cash register. */\n\tMarking?: MarkingCodes;\n\n\t/** The product excise information */\n\tExcise?: {\n\t\tisExcise: boolean;\n\t};\n\n\t/** Additional data that can be defined for specific country */\n\tCountrySpecific?: {\n\t\tUzbekistan?: UzbekistanProductData;\n\t\tKazakhstan?: KazakhstanProductData;\n\t\tKyrgyzstan?: KyrgyzstanProductData;\n\t};\n}\n\nexport interface ProductPrice {\n\t/** Price for 1 product excluding discount but with added ingredients */\n\tPrice: number;\n\t/** Discount for 1 product (excluding the discount for the entire order) */\n\tDiscount: number;\n\tTaxes: Tax[];\n}\n\nexport interface Tax {\n\t/** Type of tax: value added or sales */\n\tType: 'VAT' | 'Sales' | 'Unknown';\n\t/** Rate in percents */\n\tRate: number;\n\t// TODO add later: Value: number\n}\n\nexport interface AddedIngredient {\n\t/** Ingredient name */\n\tName: string;\n\t/** The amount of ingredients added in portions */\n\tQuantity: number;\n\t/** Ingredient price added to the product */\n\tPrice: number;\n}\n\nexport interface Customer {\n\t/** The name of the customer that he gave to the cashier */\n\tName: string;\n\t/** Customer's mailing address, which he set in his personal account */\n\tEmail: string | null;\n\t/** Any additional identifiers, e.g. customer's Tax Identification Number */\n\tIdentifiers: { [index: string]: string };\n}\n\nexport interface CashRegister {\n\t/** Internal cash register identifier */\n\tUUId: string;\n\t/** */\n\tNumber: string;\n\t/** To calculate or not to calculate VAT */\n\tShouldCalculateTax: boolean;\n}\n\nexport interface PreviousReceipt {\n\t/** ID of the receipt returned by the POS printer. `null` if a print error has occurred. It is temporary field. Then it will be removed. Use `Identifier` instead of `Id` */\n\tId: number | null;\n\t/** Printed receipt type: sales receipt or refund receipt */\n\tType: 'Sell' | 'Refund';\n\t/** Date in format ISO 8601 (e.g. 2021-04-30T10:50:00.0000000+04:00) */\n\tPrintDateTime: string;\n\t/** ID of the receipt returned by the POS printer */\n\tIdentifier: string | null;\n\n\tCashboxId: string;\n\n\t/** Data returned by cash register after printing receipt */\n\tCashRegisterOutput?: string;\n\t/** Previous receipt payment type */\n\tPaymentType: PaymentType;\n}\n\nexport interface Organization {\n\t/** Full name of the organization */\n\tName: string;\n\t/** Legal address */\n\tAddress: string;\n\t/** Organization payment details */\n\tRequisites: { [index: string]: string };\n}\n\nexport interface Store {\n\t/** Actual address */\n\tAddress: string;\n}\n\ntype RussiaMarkingCode = {\n\t/** Russian country iso code */\n\tcountry: 643;\n\t/** In Russia it's the string of digits, letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\ntype BelarusMarkingCodes = {\n\t/** Belarus country iso code */\n\tcountry: 112;\n\t/** Маркировка унифицированными контрольными знаками (УКЗ) */\n\tukzCode?: string;\n\t/** Маркировка средствами идентификации (СИ) */\n\tsiCode?: string;\n\t/** Маркировка с использованием штрихкода GTIN */\n\tgtinCode?: string;\n};\n\ntype ArmeniaMarkingCode = {\n\t/** Armenia country iso code */\n\tcountry: 51;\n\t/** In Armenia it's the string of digits letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\ntype UzbekistanMarkingCode = {\n\t/** Uzbekistan country iso code */\n\tcountry: 860;\n\t/** In Uzbekistan it's the string of digits letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\nexport type MarkingCodes =\n\t| RussiaMarkingCode\n\t| BelarusMarkingCodes\n\t| ArmeniaMarkingCode\n\t| UzbekistanMarkingCode\n\t| undefined;\n","export interface PrintParams {\n\t/** Has true value when receipt was sent to plugin in background for building Digital version of receipt */\n\tWithoutPaper: boolean;\n\tDigitalReceiptNotificationPreference: DigitalReceiptNotificationPreference;\n}\n\n/** The way we can notify the client about the receipt for the accepted order. */\nexport enum DigitalReceiptNotificationPreference {\n\t/** Client did not specify how they want to receive digital receipt. Default value. Should be set as `NotSpecified` when the receipt is expected to be NOT digital. */\n\tNotSpecified = `NotSpecified`,\n\t/** Client selected 'I don't want a receipt' */\n\tNone = `None`,\n\t/** Client selected 'I want the receipt on my email' */\n\tEmail = `Email`,\n\t/** Client selected 'I want the receipt link by phone via SMS' */\n\tPhoneSms = `PhoneSms`,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAK,WAAL,kBAAKA,cAAL;AAINA,YAAA,WAAA,IAAY;AAIZA,YAAA,SAAA,IAAU;AAIVA,YAAA,SAAA,IAAU;AAZC,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;ACSL,IAAK,oBAAL,kBAAKC,uBAAL;AACNA,qBAAAA,mBAAA,SAAA,IAAU,GAAA,IAAV;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AACAA,qBAAAA,mBAAA,QAAA,IAAS,GAAA,IAAT;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AALW,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;ACCL,IAAK,YAAL,kBAAKC,eAAL;AACNA,aAAAA,WAAA,QAAA,IAAS,CAAA,IAAT;AACAA,aAAAA,WAAA,eAAA,IAAgB,CAAA,IAAhB;AACAA,aAAAA,WAAA,SAAA,IAAU,CAAA,IAAV;AAHW,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AKmEL,IAAK,YAAL,kBAAKC,eAAL;AACNA,aAAAA,WAAA,UAAA,IAAW,CAAA,IAAX;AACAA,aAAAA,WAAA,QAAA,IAAS,CAAA,IAAT;AACAA,aAAAA,WAAA,YAAA,IAAa,CAAA,IAAb;AACAA,aAAAA,WAAA,cAAA,IAAe,CAAA,IAAf;AACAA,aAAAA,WAAA,kBAAA,IAAmB,CAAA,IAAnB;AALW,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AASL,IAAK,cAAL,kBAAKC,iBAAL;AACNA,eAAAA,aAAA,WAAA,IAAY,CAAA,IAAZ;AACAA,eAAAA,aAAA,MAAA,IAAO,CAAA,IAAP;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AACAA,eAAAA,aAAA,aAAA,IAAc,CAAA,IAAd;AACAA,eAAAA,aAAA,QAAA,IAAS,CAAA,IAAT;AAEAA,eAAAA,aAAA,UAAA,IAAW,CAAA,IAAX;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AACAA,eAAAA,aAAA,OAAA,IAAQ,CAAA,IAAR;AATW,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAaL,IAAK,cAAL,kBAAKC,iBAAL;AACNA,eAAAA,aAAA,MAAA,IAAO,CAAA,IAAP;AACAA,eAAAA,aAAA,UAAA,IAAW,CAAA,IAAX;AACAA,eAAAA,aAAA,mBAAA,IAAoB,CAAA,IAApB;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AAJW,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;;;AC/FL,IAAK,uCAAL,kBAAKC,0CAAL;AAEN,EAAAA,sCAAA,kBAAe;AAEf,EAAAA,sCAAA,UAAO;AAEP,EAAAA,sCAAA,WAAQ;AAER,EAAAA,sCAAA,cAAW;AARA,SAAAA;AAAA,GAAA;","names":["Business","KnownCountryCodes","OwnerType","OrderType","OrderSource","PaymentType","DigitalReceiptNotificationPreference"]}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../shared/pos-plugins-shared-models/src/Business.ts","../../../shared/pos-plugins-shared-models/src/Country.ts","../../../shared/pos-plugins-shared-models/src/CountrySpecificData.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentMode.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentSource.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentStatus.ts","../../../shared/pos-plugins-shared-models/src/payment/RefundSource.ts","../../../shared/pos-plugins-shared-models/src/receipt/Receipt.ts","../src/PrintParams.ts"],"sourcesContent":["/**\n * Enum with supported business types.\n */\nexport enum Business {\n\t/**\n\t * Dodo Pizza business.\n\t */\n\tDodoPizza = `dodoPizza`,\n\t/**\n\t * Drinkit business.\n\t */\n\tDrinkit = `drinkit`,\n\t/**\n\t * Doner42 business.\n\t */\n\tDoner42 = `doner42`,\n}\n","/**\n * Country model\n */\nexport interface Country {\n\tcode: CountryIsoCode;\n}\n\n/** Country code based on [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_numeric)\n * @example 643, 705, 566\n */\nexport type CountryIsoCode = number;\n\nexport enum KnownCountryCodes {\n\tBelarus = 112,\n\tKazakhstan = 398,\n\tRussia = 643,\n\tUzbekistan = 860,\n\tKyrgyzstan = 417,\n}\n","export type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | KyrgyzstanProductData | null;\n\nexport interface UzbekistanProductData {\n\t/** Identification code of products and services for Uzbekistan */\n\tikpu: string;\n\t/** 0 - resail; 1 - own production; 2 - service */\n\townerType?: OwnerType;\n\t/** code of measurement type */\n\tunits: string;\n\t/** related with ikpu */\n\tbarcode: string;\n}\n\nexport enum OwnerType {\n\tResail = 0,\n\tOwnProduction = 1,\n\tService = 2,\n}\n\nexport interface KazakhstanProductData {\n\t/** Identification code of products */\n\tgtin?: string;\n\tntin?: string;\n}\n\nexport interface KyrgyzstanProductData {\n\t/** `product` — if entry is resold, `service` — if entry is prepared in-house. */\n\tentryType?: 'product' | 'service';\n}\n","export enum PaymentMode {\n\tCard = `Card`,\n\tQR = `QR`,\n}\n","export enum PaymentSource {\n\tRestaurantCashier = 0,\n\tKiosk = 1,\n}\n","export enum PaymentStatus {\n\tNotFound = `NotFound`,\n\tPaymentPending = `PaymentPending`,\n\tPaymentCompleted = `PaymentCompleted`,\n\tRefundPending = `RefundPending`,\n\tRefundCompleted = `RefundCompleted`,\n\tNotNeeded = `NotNeeded`,\n}\n","export enum RefundSource {\n\tRestaurantCashier = `RestaurantCashier`,\n\tRefundJob = `RefundJob`,\n\tKiosk = `Kiosk`,\n}\n","/* eslint-disable @typescript-eslint/no-magic-numbers */\nimport {\n\ttype KazakhstanProductData,\n\ttype KyrgyzstanProductData,\n\ttype UzbekistanProductData,\n} from '../CountrySpecificData';\nimport { type Taxpayer } from './Taxpayer';\n\nexport interface Receipt {\n\t/** Order for this receipt */\n\tOrder: Order;\n\t/** Customer information */\n\tCustomer: Customer;\n\t/** Taxpayer information */\n\tTaxpayer: Taxpayer;\n\t/** Cash register from which the receipt is printed */\n\tCashRegister: CashRegister;\n\t/** Previous receipts that were printed for this order, including refunds */\n\tPreviousReceipts: PreviousReceipt[];\n\t/** Information about the organization that printed the receipt */\n\tOrganization: Organization;\n\t/** Information about the store in which the purchase is occurring */\n\tStore: Store;\n\n\t/** Information needed for the loyalty program. */\n\tLoyalty?: Loyalty;\n\n\t/** Cash from the customer (if paid in cash) */\n\tCashFromCustomer: number;\n\n\t/** Information about the person taking the order. */\n\tCashier?: Cashier;\n\n\t/** Url of the image to print on the receipt. */\n\tImage?: Image;\n}\n\nexport interface Cashier {\n\t/** Cashier name */\n\tName: string;\n\n\t/** Cashier INN in russia and its analogues in other countries. */\n\tTaxIdentificationNumber?: string;\n}\n\nexport interface Image {\n\t/** Url of the image to print on the receipt. */\n\tUrl?: string;\n\n\t/** Image data in base64 format. (ONLY FOR RUSSIA ATOL) */\n\tBase64Data?: string;\n}\n\nexport interface Loyalty {\n\t/** Customer Phone number */\n\tPhoneNumber: string;\n\t/** Amount of the bonus points awarded for the loyalty program. */\n\tAwardedBonus: number;\n}\n\nexport interface Order {\n\t/** Internal order identifier */\n\tId: string;\n\t/** Order number seen by customers (e.g. \"1-3\") */\n\tNumber: string; // from OrderNumber\n\t/** Current time in ISO 8601 format (e.g. \"2021-04-30T10:50:00.0000000+04:00\") */\n\tCreateDate: string;\n\t/** Products in cart */\n\tProducts: Product[];\n\tPrice: OrderPrice;\n\t/** @deprecated Please switch to PaymentTypeEnum. */\n\tPaymentType: 'Cash' | 'BankCard';\n\tPaymentTypeEnum: PaymentType;\n\tOrderSource: OrderSource;\n\n\t/** Current time in ISO 8601 format (e.g. \"2021-04-30T10:50:00.0000000+04:00\") */\n\tDeliveryDate?: string;\n\tOrderType: OrderType;\n}\n\nexport enum OrderType {\n\tDelivery = 1,\n\tPickup = 2,\n\tStationary = 3,\n\tPersonalFood = 4,\n\tShopWindowSupply = 5,\n}\n\n/** Shows the source from where the order has been taken. */\nexport enum OrderSource {\n\tTelephone = 0,\n\tSite = 1,\n\tRestaurant = 2,\n\tDefectOrder = 3,\n\tMobile = 4,\n\t/** Shift manager order from call center. */\n\tPizzeria = 5,\n\tAggregator = 6,\n\tKiosk = 7,\n}\n\n/** Shows how the order has been paid. Please expect frequent updates in the future. */\nexport enum PaymentType {\n\tCash = 0,\n\tBankCard = 1,\n\tInternetAcquiring = 2,\n\tAggregator = 3,\n}\n\nexport interface OrderPrice {\n\t/** The total price of the order (how much the customer actually paid) */\n\tTotalPrice: number;\n\t/** Total price of the order excluding tax */\n\tTotalPriceWithoutTax?: number;\n\t/** Total discount for the entire order (excluding discounts for individual products in the order) */\n\tDiscount: number;\n\t/** Total sales tax amount for the order */\n\tSaleTax?: number;\n\t/** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */\n\tRoundedCashAmount?: number;\n}\n\nexport interface Product {\n\t/** Internal product identifier */\n\tId: string;\n\t/** The product's name */\n\tName: string;\n\t/** The quantity of this product in the order */\n\tQuantity: number;\n\tPricePerProduct: ProductPrice;\n\t/** List of ingredients removed from the product */\n\tRemovedIngredients: string[];\n\t/** Additional ingredients added to the product */\n\tAddedIngredients: AddedIngredient[];\n\n\t/** The marking data used in some countries to pass scanned barcode value to the cash register. */\n\tMarking?: MarkingCodes;\n\n\t/** The product excise information */\n\tExcise?: {\n\t\tisExcise: boolean;\n\t};\n\n\t/** Additional data that can be defined for specific country */\n\tCountrySpecific?: {\n\t\tUzbekistan?: UzbekistanProductData;\n\t\tKazakhstan?: KazakhstanProductData;\n\t\tKyrgyzstan?: KyrgyzstanProductData;\n\t};\n}\n\nexport interface ProductPrice {\n\t/** Price for 1 product excluding discount but with added ingredients */\n\tPrice: number;\n\t/** Discount for 1 product (excluding the discount for the entire order) */\n\tDiscount: number;\n\tTaxes: Tax[];\n}\n\nexport interface Tax {\n\t/** Type of tax: value added or sales */\n\tType: 'VAT' | 'Sales' | 'Unknown';\n\t/** Rate in percents */\n\tRate: number;\n\t// TODO add later: Value: number\n}\n\nexport interface AddedIngredient {\n\t/** Ingredient name */\n\tName: string;\n\t/** The amount of ingredients added in portions */\n\tQuantity: number;\n\t/** Ingredient price added to the product */\n\tPrice: number;\n}\n\nexport interface Customer {\n\t/** The name of the customer that he gave to the cashier */\n\tName: string;\n\t/** Customer's mailing address, which he set in his personal account */\n\tEmail: string | null;\n\t/** Any additional identifiers, e.g. customer's Tax Identification Number */\n\tIdentifiers: { [index: string]: string };\n}\n\nexport interface CashRegister {\n\t/** Internal cash register identifier */\n\tUUId: string;\n\t/** */\n\tNumber: string;\n\t/** To calculate or not to calculate VAT */\n\tShouldCalculateTax: boolean;\n}\n\nexport interface PreviousReceipt {\n\t/** ID of the receipt returned by the POS printer. `null` if a print error has occurred. It is temporary field. Then it will be removed. Use `Identifier` instead of `Id` */\n\tId: number | null;\n\t/** Printed receipt type: sales receipt or refund receipt */\n\tType: 'Sell' | 'Refund';\n\t/** Date in format ISO 8601 (e.g. 2021-04-30T10:50:00.0000000+04:00) */\n\tPrintDateTime: string;\n\t/** ID of the receipt returned by the POS printer */\n\tIdentifier: string | null;\n\n\tCashboxId: string;\n\n\t/** Data returned by cash register after printing receipt */\n\tCashRegisterOutput?: string;\n\t/** Previous receipt payment type */\n\tPaymentType: PaymentType;\n}\n\nexport interface Organization {\n\t/** Full name of the organization */\n\tName: string;\n\t/** Legal address */\n\tAddress: string;\n\t/** Organization payment details */\n\tRequisites: { [index: string]: string };\n}\n\nexport interface Store {\n\t/** Actual address */\n\tAddress: string;\n}\n\ntype RussiaMarkingCode = {\n\t/** Russian country iso code */\n\tcountry: 643;\n\t/** In Russia it's the string of digits, letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\ntype BelarusMarkingCodes = {\n\t/** Belarus country iso code */\n\tcountry: 112;\n\t/** Маркировка унифицированными контрольными знаками (УКЗ) */\n\tukzCode?: string;\n\t/** Маркировка средствами идентификации (СИ) */\n\tsiCode?: string;\n\t/** Маркировка с использованием штрихкода GTIN */\n\tgtinCode?: string;\n};\n\ntype ArmeniaMarkingCode = {\n\t/** Armenia country iso code */\n\tcountry: 51;\n\t/** In Armenia it's the string of digits letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\ntype UzbekistanMarkingCode = {\n\t/** Uzbekistan country iso code */\n\tcountry: 860;\n\t/** In Uzbekistan it's the string of digits letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\nexport type MarkingCodes =\n\t| RussiaMarkingCode\n\t| BelarusMarkingCodes\n\t| ArmeniaMarkingCode\n\t| UzbekistanMarkingCode\n\t| undefined;\n","export interface PrintParams {\n\t/** Has true value when receipt was sent to plugin in background for building Digital version of receipt */\n\tWithoutPaper: boolean;\n\tDigitalReceiptNotificationPreference: DigitalReceiptNotificationPreference;\n}\n\n/** The way we can notify the client about the receipt for the accepted order. */\nexport enum DigitalReceiptNotificationPreference {\n\t/** Client did not specify how they want to receive digital receipt. Default value. Should be set as `NotSpecified` when the receipt is expected to be NOT digital. */\n\tNotSpecified = `NotSpecified`,\n\t/** Client selected 'I don't want a receipt' */\n\tNone = `None`,\n\t/** Client selected 'I want the receipt on my email' */\n\tEmail = `Email`,\n\t/** Client selected 'I want the receipt link by phone via SMS' */\n\tPhoneSms = `PhoneSms`,\n}\n"],"mappings":";AAGO,IAAK,WAAL,kBAAKA,cAAL;AAINA,YAAA,WAAA,IAAY;AAIZA,YAAA,SAAA,IAAU;AAIVA,YAAA,SAAA,IAAU;AAZC,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;ACSL,IAAK,oBAAL,kBAAKC,uBAAL;AACNA,qBAAAA,mBAAA,SAAA,IAAU,GAAA,IAAV;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AACAA,qBAAAA,mBAAA,QAAA,IAAS,GAAA,IAAT;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AALW,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;ACCL,IAAK,YAAL,kBAAKC,eAAL;AACNA,aAAAA,WAAA,QAAA,IAAS,CAAA,IAAT;AACAA,aAAAA,WAAA,eAAA,IAAgB,CAAA,IAAhB;AACAA,aAAAA,WAAA,SAAA,IAAU,CAAA,IAAV;AAHW,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AKmEL,IAAK,YAAL,kBAAKC,eAAL;AACNA,aAAAA,WAAA,UAAA,IAAW,CAAA,IAAX;AACAA,aAAAA,WAAA,QAAA,IAAS,CAAA,IAAT;AACAA,aAAAA,WAAA,YAAA,IAAa,CAAA,IAAb;AACAA,aAAAA,WAAA,cAAA,IAAe,CAAA,IAAf;AACAA,aAAAA,WAAA,kBAAA,IAAmB,CAAA,IAAnB;AALW,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AASL,IAAK,cAAL,kBAAKC,iBAAL;AACNA,eAAAA,aAAA,WAAA,IAAY,CAAA,IAAZ;AACAA,eAAAA,aAAA,MAAA,IAAO,CAAA,IAAP;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AACAA,eAAAA,aAAA,aAAA,IAAc,CAAA,IAAd;AACAA,eAAAA,aAAA,QAAA,IAAS,CAAA,IAAT;AAEAA,eAAAA,aAAA,UAAA,IAAW,CAAA,IAAX;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AACAA,eAAAA,aAAA,OAAA,IAAQ,CAAA,IAAR;AATW,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAaL,IAAK,cAAL,kBAAKC,iBAAL;AACNA,eAAAA,aAAA,MAAA,IAAO,CAAA,IAAP;AACAA,eAAAA,aAAA,UAAA,IAAW,CAAA,IAAX;AACAA,eAAAA,aAAA,mBAAA,IAAoB,CAAA,IAApB;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AAJW,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;;;AC/FL,IAAK,uCAAL,kBAAKC,0CAAL;AAEN,EAAAA,sCAAA,kBAAe;AAEf,EAAAA,sCAAA,UAAO;AAEP,EAAAA,sCAAA,WAAQ;AAER,EAAAA,sCAAA,cAAW;AARA,SAAAA;AAAA,GAAA;","names":["Business","KnownCountryCodes","OwnerType","OrderType","OrderSource","PaymentType","DigitalReceiptNotificationPreference"]}
|