@kreiseck/kasseneck-api 1.6.0 → 1.7.0
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/CHANGELOG.md +12 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/models/cashregister.d.ts +21 -0
- package/dist/cjs/models/cashregister.js +20 -0
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/models/cashregister.d.ts +21 -0
- package/dist/esm/models/cashregister.js +20 -0
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/invoice-api.schema.json +1 -1
- package/fixtures/invoice-texts.json +1 -1
- package/fixtures/pos-texts.json +1 -1
- package/fixtures/surface.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ Was vor 0.7.0 geschah, steht in der Commit-Historie (`git log`); ab hier wird
|
|
|
4
4
|
es hier geführt. Ein Eintrag nennt die Änderung **und ihren Grund** —
|
|
5
5
|
nur der Grund überlebt den nächsten Umbau.
|
|
6
6
|
|
|
7
|
+
## 1.7.0
|
|
8
|
+
|
|
9
|
+
Register auto-logout: `Cashregister` gains the optional `autoLogout`
|
|
10
|
+
(`{ autoLogoutMinutes?: 0 | 1 | 5 | 15 | 30, logoutAfterSale?: boolean }`),
|
|
11
|
+
read from `listMyCashregisters`. Reason: the backend now reports a register's
|
|
12
|
+
own sign-out settings; a client that ignored them showed the operator's
|
|
13
|
+
defaults on a register that had its own. The field is absent when the register
|
|
14
|
+
has no values of its own (then the operator's values apply); a minutes value
|
|
15
|
+
outside 0/1/5/15/30 is dropped rather than passed on. Additive, no breaking
|
|
16
|
+
change; `fixtures/v3/` is the vendored contract at the backend state that
|
|
17
|
+
carries the field.
|
|
18
|
+
|
|
7
19
|
## 1.6.0
|
|
8
20
|
|
|
9
21
|
Inventory API, variants: `./inventory` gains the five endpoints of backend
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ReceiptType, type ReceiptTypeKey, VatRate, type VatRateKey, KeckPaymentMethod, type KeckPaymentMethodKey, CreditCardProvider, type CreditCardProviderKey, VoucherType, type VoucherTypeKey, VoucherAction, type VoucherActionKey, StripeLinkMode, type StripeLinkModeKey, } from './enums/index.js';
|
|
2
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
2
|
+
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
3
|
export { type AuthCredentials, type KasseneckAuth, type ApiKeyAuthOptions, type RegisterUserAuthOptions, apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, type HttpResponseLike, type HttpRequestInit, type FetchLike, type TransportOptions, type TransportBodyFields, type TransportCallOptions, type KasseneckTransport, type KasseneckBinaryTransport, ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, type PublicCall, type PosCall, createTransport, createBinaryTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, type ValidationScope, type KasseneckError, type HttpFailureReason, type CauseDigest, type ErrorOutcome, CLIENT_ERROR_CODES, type ClientErrorCode, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type CancelReceiptResult, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, listMyCashregisters, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, downloadDailyReport, downloadMonthlyReport, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { type ReceiptDueTip, type ReceiptDueTipRecipient, type ReceiptDueOptions, type ReceiptDueBuckets, type ReceiptDueBreakdown, type ReceiptDueErrorReason, receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock, type ViennaWallClock } from './vienna-time.js';
|
|
@@ -38,8 +38,23 @@ export interface Cashregister {
|
|
|
38
38
|
signatureId?: string;
|
|
39
39
|
/** Lager-Standort der Kasse (Lager-Kern Stufe 2); fehlt = Standard-Standort des Betriebs. */
|
|
40
40
|
stockLocationId?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Eigene Abmelde-Werte dieser Kasse; fehlt, wenn die Kasse keine eigenen hat
|
|
43
|
+
* (dann gelten die Werte des Betriebs).
|
|
44
|
+
*/
|
|
45
|
+
autoLogout?: CashregisterAutoLogout;
|
|
41
46
|
onboarding: CashregisterOnboarding;
|
|
42
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Automatisches Abmelden an der Kasse. Beide Felder sind einzeln optional: der
|
|
50
|
+
* Server sendet nur, was die Kasse selbst gesetzt hat.
|
|
51
|
+
*/
|
|
52
|
+
export interface CashregisterAutoLogout {
|
|
53
|
+
/** Abmeldung nach Leerlauf in Minuten; `0` = aus. */
|
|
54
|
+
autoLogoutMinutes?: 0 | 1 | 5 | 15 | 30;
|
|
55
|
+
/** Nach jedem Verkauf abmelden. */
|
|
56
|
+
logoutAfterSale?: boolean;
|
|
57
|
+
}
|
|
43
58
|
/**
|
|
44
59
|
* Stand der Inbetriebnahme (RKSV): Kasse bei FinanzOnline registriert,
|
|
45
60
|
* Startbeleg erzeugt, Startbeleg uebermittelt. Die drei Kennzeichen entscheiden
|
|
@@ -61,9 +76,15 @@ export interface CashregisterPayload {
|
|
|
61
76
|
create_time?: string | null;
|
|
62
77
|
signature_id?: string | null;
|
|
63
78
|
stockLocationId?: string | null;
|
|
79
|
+
autoLogout?: CashregisterAutoLogoutPayload | null;
|
|
64
80
|
token?: string | null;
|
|
65
81
|
onboarding?: CashregisterOnboardingPayload | null;
|
|
66
82
|
}
|
|
83
|
+
/** `autoLogout` am Draht `/v3`; die Namen sind dieselben wie am Modell. */
|
|
84
|
+
export interface CashregisterAutoLogoutPayload {
|
|
85
|
+
autoLogoutMinutes?: number | null;
|
|
86
|
+
logoutAfterSale?: boolean | null;
|
|
87
|
+
}
|
|
67
88
|
/**
|
|
68
89
|
* `onboarding` am Draht `/v3` (fixtures/v3/antworten/kasse.json): der
|
|
69
90
|
* Startbeleg heisst dort `start_receipt_*`. Die inneren Namen
|
|
@@ -17,6 +17,7 @@ function fromCashregisterPayload(payload, id) {
|
|
|
17
17
|
...(payload.token ? { token: payload.token } : {}),
|
|
18
18
|
...(payload.signature_id ? { signatureId: payload.signature_id } : {}),
|
|
19
19
|
...(payload.stockLocationId ? { stockLocationId: payload.stockLocationId } : {}),
|
|
20
|
+
...autoLogoutFeld(payload.autoLogout),
|
|
20
21
|
onboarding: {
|
|
21
22
|
cashboxRegistered: ob.cashbox_registered === true,
|
|
22
23
|
startReceiptCreated: ob.start_receipt_created === true,
|
|
@@ -27,6 +28,25 @@ function fromCashregisterPayload(payload, id) {
|
|
|
27
28
|
},
|
|
28
29
|
};
|
|
29
30
|
}
|
|
31
|
+
const AUTO_LOGOUT_MINUTEN = new Set([0, 1, 5, 15, 30]);
|
|
32
|
+
/**
|
|
33
|
+
* `autoLogout` gibt es nur, wenn die Nutzlast mindestens einen lesbaren Wert
|
|
34
|
+
* traegt. Eine Minutenzahl ausserhalb von 0/1/5/15/30 wird verworfen statt
|
|
35
|
+
* durchgereicht (ein neuer Server-Wert soll die Kasse nicht unlesbar machen).
|
|
36
|
+
*/
|
|
37
|
+
function autoLogoutFeld(roh) {
|
|
38
|
+
if (roh === null || roh === undefined || typeof roh !== 'object') {
|
|
39
|
+
return {};
|
|
40
|
+
}
|
|
41
|
+
const wert = {};
|
|
42
|
+
if (typeof roh.autoLogoutMinutes === 'number' && AUTO_LOGOUT_MINUTEN.has(roh.autoLogoutMinutes)) {
|
|
43
|
+
wert.autoLogoutMinutes = roh.autoLogoutMinutes;
|
|
44
|
+
}
|
|
45
|
+
if (typeof roh.logoutAfterSale === 'boolean') {
|
|
46
|
+
wert.logoutAfterSale = roh.logoutAfterSale;
|
|
47
|
+
}
|
|
48
|
+
return Object.keys(wert).length === 0 ? {} : { autoLogout: wert };
|
|
49
|
+
}
|
|
30
50
|
/**
|
|
31
51
|
* Ein Zeitfeld, das es nur gibt, wenn die Nutzlast einen lesbaren Zeitstempel
|
|
32
52
|
* traegt. `null` (der Normalfall aus `isoTs`) und unlesbarer Unsinn ergeben
|
|
@@ -7,7 +7,7 @@ export { type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, payment
|
|
|
7
7
|
export { type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, } from './receipt-email.js';
|
|
8
8
|
export { type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, } from './receipt-errors.js';
|
|
9
9
|
export { type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, } from './receipt-company.js';
|
|
10
|
-
export { type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, fromCashregisterPayload, } from './cashregister.js';
|
|
10
|
+
export { type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, } from './cashregister.js';
|
|
11
11
|
export { type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind } from './receipt-summary.js';
|
|
12
12
|
export { type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, } from './report-month.js';
|
|
13
13
|
export { type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, } from './stripe-url-session.js';
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ReceiptType, type ReceiptTypeKey, VatRate, type VatRateKey, KeckPaymentMethod, type KeckPaymentMethodKey, CreditCardProvider, type CreditCardProviderKey, VoucherType, type VoucherTypeKey, VoucherAction, type VoucherActionKey, StripeLinkMode, type StripeLinkModeKey, } from './enums/index.js';
|
|
2
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
2
|
+
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
3
|
export { type AuthCredentials, type KasseneckAuth, type ApiKeyAuthOptions, type RegisterUserAuthOptions, apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, type HttpResponseLike, type HttpRequestInit, type FetchLike, type TransportOptions, type TransportBodyFields, type TransportCallOptions, type KasseneckTransport, type KasseneckBinaryTransport, ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, type PublicCall, type PosCall, createTransport, createBinaryTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, type ValidationScope, type KasseneckError, type HttpFailureReason, type CauseDigest, type ErrorOutcome, CLIENT_ERROR_CODES, type ClientErrorCode, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type CancelReceiptResult, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, listMyCashregisters, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, downloadDailyReport, downloadMonthlyReport, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { type ReceiptDueTip, type ReceiptDueTipRecipient, type ReceiptDueOptions, type ReceiptDueBuckets, type ReceiptDueBreakdown, type ReceiptDueErrorReason, receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock, type ViennaWallClock } from './vienna-time.js';
|
|
@@ -38,8 +38,23 @@ export interface Cashregister {
|
|
|
38
38
|
signatureId?: string;
|
|
39
39
|
/** Lager-Standort der Kasse (Lager-Kern Stufe 2); fehlt = Standard-Standort des Betriebs. */
|
|
40
40
|
stockLocationId?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Eigene Abmelde-Werte dieser Kasse; fehlt, wenn die Kasse keine eigenen hat
|
|
43
|
+
* (dann gelten die Werte des Betriebs).
|
|
44
|
+
*/
|
|
45
|
+
autoLogout?: CashregisterAutoLogout;
|
|
41
46
|
onboarding: CashregisterOnboarding;
|
|
42
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Automatisches Abmelden an der Kasse. Beide Felder sind einzeln optional: der
|
|
50
|
+
* Server sendet nur, was die Kasse selbst gesetzt hat.
|
|
51
|
+
*/
|
|
52
|
+
export interface CashregisterAutoLogout {
|
|
53
|
+
/** Abmeldung nach Leerlauf in Minuten; `0` = aus. */
|
|
54
|
+
autoLogoutMinutes?: 0 | 1 | 5 | 15 | 30;
|
|
55
|
+
/** Nach jedem Verkauf abmelden. */
|
|
56
|
+
logoutAfterSale?: boolean;
|
|
57
|
+
}
|
|
43
58
|
/**
|
|
44
59
|
* Stand der Inbetriebnahme (RKSV): Kasse bei FinanzOnline registriert,
|
|
45
60
|
* Startbeleg erzeugt, Startbeleg uebermittelt. Die drei Kennzeichen entscheiden
|
|
@@ -61,9 +76,15 @@ export interface CashregisterPayload {
|
|
|
61
76
|
create_time?: string | null;
|
|
62
77
|
signature_id?: string | null;
|
|
63
78
|
stockLocationId?: string | null;
|
|
79
|
+
autoLogout?: CashregisterAutoLogoutPayload | null;
|
|
64
80
|
token?: string | null;
|
|
65
81
|
onboarding?: CashregisterOnboardingPayload | null;
|
|
66
82
|
}
|
|
83
|
+
/** `autoLogout` am Draht `/v3`; die Namen sind dieselben wie am Modell. */
|
|
84
|
+
export interface CashregisterAutoLogoutPayload {
|
|
85
|
+
autoLogoutMinutes?: number | null;
|
|
86
|
+
logoutAfterSale?: boolean | null;
|
|
87
|
+
}
|
|
67
88
|
/**
|
|
68
89
|
* `onboarding` am Draht `/v3` (fixtures/v3/antworten/kasse.json): der
|
|
69
90
|
* Startbeleg heisst dort `start_receipt_*`. Die inneren Namen
|
|
@@ -14,6 +14,7 @@ export function fromCashregisterPayload(payload, id) {
|
|
|
14
14
|
...(payload.token ? { token: payload.token } : {}),
|
|
15
15
|
...(payload.signature_id ? { signatureId: payload.signature_id } : {}),
|
|
16
16
|
...(payload.stockLocationId ? { stockLocationId: payload.stockLocationId } : {}),
|
|
17
|
+
...autoLogoutFeld(payload.autoLogout),
|
|
17
18
|
onboarding: {
|
|
18
19
|
cashboxRegistered: ob.cashbox_registered === true,
|
|
19
20
|
startReceiptCreated: ob.start_receipt_created === true,
|
|
@@ -24,6 +25,25 @@ export function fromCashregisterPayload(payload, id) {
|
|
|
24
25
|
},
|
|
25
26
|
};
|
|
26
27
|
}
|
|
28
|
+
const AUTO_LOGOUT_MINUTEN = new Set([0, 1, 5, 15, 30]);
|
|
29
|
+
/**
|
|
30
|
+
* `autoLogout` gibt es nur, wenn die Nutzlast mindestens einen lesbaren Wert
|
|
31
|
+
* traegt. Eine Minutenzahl ausserhalb von 0/1/5/15/30 wird verworfen statt
|
|
32
|
+
* durchgereicht (ein neuer Server-Wert soll die Kasse nicht unlesbar machen).
|
|
33
|
+
*/
|
|
34
|
+
function autoLogoutFeld(roh) {
|
|
35
|
+
if (roh === null || roh === undefined || typeof roh !== 'object') {
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
const wert = {};
|
|
39
|
+
if (typeof roh.autoLogoutMinutes === 'number' && AUTO_LOGOUT_MINUTEN.has(roh.autoLogoutMinutes)) {
|
|
40
|
+
wert.autoLogoutMinutes = roh.autoLogoutMinutes;
|
|
41
|
+
}
|
|
42
|
+
if (typeof roh.logoutAfterSale === 'boolean') {
|
|
43
|
+
wert.logoutAfterSale = roh.logoutAfterSale;
|
|
44
|
+
}
|
|
45
|
+
return Object.keys(wert).length === 0 ? {} : { autoLogout: wert };
|
|
46
|
+
}
|
|
27
47
|
/**
|
|
28
48
|
* Ein Zeitfeld, das es nur gibt, wenn die Nutzlast einen lesbaren Zeitstempel
|
|
29
49
|
* traegt. `null` (der Normalfall aus `isoTs`) und unlesbarer Unsinn ergeben
|
|
@@ -7,7 +7,7 @@ export { type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, payment
|
|
|
7
7
|
export { type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, } from './receipt-email.js';
|
|
8
8
|
export { type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, } from './receipt-errors.js';
|
|
9
9
|
export { type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, } from './receipt-company.js';
|
|
10
|
-
export { type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, fromCashregisterPayload, } from './cashregister.js';
|
|
10
|
+
export { type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, } from './cashregister.js';
|
|
11
11
|
export { type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind } from './receipt-summary.js';
|
|
12
12
|
export { type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, } from './report-month.js';
|
|
13
13
|
export { type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, } from './stripe-url-session.js';
|
package/dist/esm/version.d.ts
CHANGED
package/dist/esm/version.js
CHANGED
package/fixtures/pos-texts.json
CHANGED
package/fixtures/surface.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kreiseck/kasseneck-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Austrian fiscal cash register (RKSV) client for JavaScript and TypeScript: signed receipts, cancellations, card payments, receipt printing (ESC/POS), invoices, inventory. RKSV-Registrierkasse für JavaScript und TypeScript.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Kreiseck",
|