@kreiseck/kasseneck-api 1.35.1 → 1.37.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 +45 -10
- package/dist/cjs/client/api.d.ts +15 -1
- package/dist/cjs/client/api.js +4 -0
- package/dist/cjs/client/aufrufe.d.ts +3 -3
- package/dist/cjs/client/aufrufe.js +15 -0
- package/dist/cjs/client/auth.d.ts +9 -3
- package/dist/cjs/client/auth.js +5 -4
- package/dist/cjs/client/ewp.d.ts +125 -0
- package/dist/cjs/client/ewp.js +95 -0
- package/dist/cjs/client/index.d.ts +1 -0
- package/dist/cjs/client/index.js +4 -1
- package/dist/cjs/client/list-deposit-types.d.ts +3 -0
- package/dist/cjs/client/list-deposit-types.js +3 -0
- package/dist/cjs/client/receipts.d.ts +4 -4
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/invoice/index.d.ts +2 -2
- package/dist/cjs/invoice/index.js +2 -1
- package/dist/cjs/invoice/texte.d.ts +5 -0
- package/dist/cjs/invoice/texte.js +10 -0
- package/dist/cjs/invoice/typen.d.ts +34 -1
- package/dist/cjs/invoice/vertrag.d.ts +13 -4
- package/dist/cjs/invoice/vertrag.js +29 -6
- package/dist/cjs/payments/hobex-hps/index.d.ts +2 -1
- package/dist/cjs/payments/hobex-hps/index.js +3 -1
- package/dist/cjs/payments/hobex-hps/outcome.d.ts +10 -0
- package/dist/cjs/payments/hobex-hps/payments.d.ts +54 -0
- package/dist/cjs/payments/hobex-hps/payments.js +157 -1
- package/dist/cjs/payments/hobex-hps/support.d.ts +19 -0
- package/dist/cjs/payments/hobex-hps/support.js +22 -0
- package/dist/cjs/payments/hobex-hps/transaction-response.js +1 -1
- package/dist/cjs/payments/index.d.ts +1 -1
- package/dist/cjs/payments/index.js +2 -1
- package/dist/cjs/pos/errors.d.ts +1 -1
- package/dist/cjs/pos/errors.js +1 -0
- package/dist/cjs/pos/index.d.ts +4 -4
- package/dist/cjs/pos/index.js +13 -5
- package/dist/cjs/pos/schicht-lesen.d.ts +3 -1
- package/dist/cjs/pos/schicht-lesen.js +23 -1
- package/dist/cjs/pos/schicht-typen.d.ts +39 -4
- package/dist/cjs/pos/schicht-typen.js +7 -2
- package/dist/cjs/pos/schicht.d.ts +6 -4
- package/dist/cjs/pos/schicht.js +6 -3
- package/dist/cjs/pos/settings.d.ts +37 -8
- package/dist/cjs/pos/settings.js +34 -10
- package/dist/cjs/pos/texte.d.ts +249 -2
- package/dist/cjs/pos/texte.js +139 -4
- package/dist/cjs/pos/trinkgeld.d.ts +30 -0
- package/dist/cjs/pos/trinkgeld.js +30 -0
- package/dist/cjs/receipt/shift-sheet.js +6 -1
- package/dist/cjs/register/pairing.d.ts +4 -0
- package/dist/cjs/register/pairing.js +2 -0
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +12 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/api.d.ts +15 -1
- package/dist/esm/client/api.js +4 -0
- package/dist/esm/client/aufrufe.d.ts +3 -3
- package/dist/esm/client/aufrufe.js +15 -0
- package/dist/esm/client/auth.d.ts +9 -3
- package/dist/esm/client/auth.js +5 -4
- package/dist/esm/client/ewp.d.ts +125 -0
- package/dist/esm/client/ewp.js +89 -0
- package/dist/esm/client/index.d.ts +1 -0
- package/dist/esm/client/index.js +1 -0
- package/dist/esm/client/list-deposit-types.d.ts +3 -0
- package/dist/esm/client/list-deposit-types.js +3 -0
- package/dist/esm/client/receipts.d.ts +4 -4
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/invoice/index.d.ts +2 -2
- package/dist/esm/invoice/index.js +1 -1
- package/dist/esm/invoice/texte.d.ts +5 -0
- package/dist/esm/invoice/texte.js +10 -0
- package/dist/esm/invoice/typen.d.ts +34 -1
- package/dist/esm/invoice/vertrag.d.ts +13 -4
- package/dist/esm/invoice/vertrag.js +28 -5
- package/dist/esm/payments/hobex-hps/index.d.ts +2 -1
- package/dist/esm/payments/hobex-hps/index.js +1 -0
- package/dist/esm/payments/hobex-hps/outcome.d.ts +10 -0
- package/dist/esm/payments/hobex-hps/payments.d.ts +54 -0
- package/dist/esm/payments/hobex-hps/payments.js +158 -2
- package/dist/esm/payments/hobex-hps/support.d.ts +19 -0
- package/dist/esm/payments/hobex-hps/support.js +19 -0
- package/dist/esm/payments/hobex-hps/transaction-response.js +1 -1
- package/dist/esm/payments/index.d.ts +1 -1
- package/dist/esm/payments/index.js +1 -1
- package/dist/esm/pos/errors.d.ts +1 -1
- package/dist/esm/pos/errors.js +1 -0
- package/dist/esm/pos/index.d.ts +4 -4
- package/dist/esm/pos/index.js +5 -5
- package/dist/esm/pos/schicht-lesen.d.ts +3 -1
- package/dist/esm/pos/schicht-lesen.js +22 -1
- package/dist/esm/pos/schicht-typen.d.ts +39 -4
- package/dist/esm/pos/schicht-typen.js +6 -1
- package/dist/esm/pos/schicht.d.ts +6 -4
- package/dist/esm/pos/schicht.js +6 -3
- package/dist/esm/pos/settings.d.ts +37 -8
- package/dist/esm/pos/settings.js +30 -9
- package/dist/esm/pos/texte.d.ts +249 -2
- package/dist/esm/pos/texte.js +138 -3
- package/dist/esm/pos/trinkgeld.d.ts +30 -0
- package/dist/esm/pos/trinkgeld.js +28 -0
- package/dist/esm/receipt/shift-sheet.js +6 -1
- package/dist/esm/register/pairing.d.ts +4 -0
- package/dist/esm/register/pairing.js +2 -0
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +12 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/duplicate-cases.json +1 -1
- package/fixtures/expected/duplicate.shift-close.hex +1 -1
- package/fixtures/expected/shift-close-card-tips.grid32.txt +44 -0
- package/fixtures/expected/shift-close-card-tips.grid48.txt +40 -0
- package/fixtures/expected/shift-close-card-tips.lines.json +479 -0
- package/fixtures/expected/shift-close-put-in.grid32.txt +1 -1
- package/fixtures/expected/shift-close-put-in.grid48.txt +1 -1
- package/fixtures/expected/shift-close-put-in.lines.json +1 -1
- package/fixtures/expected/shift-close-take-out.grid32.txt +1 -1
- package/fixtures/expected/shift-close-take-out.grid48.txt +1 -1
- package/fixtures/expected/shift-close-take-out.lines.json +1 -1
- package/fixtures/expected/shift-close.grid32.txt +1 -1
- package/fixtures/expected/shift-close.grid48.txt +1 -1
- package/fixtures/expected/shift-close.lines.json +1 -1
- package/fixtures/expected/shift-interim-card-tips.grid32.txt +34 -0
- package/fixtures/expected/shift-interim-card-tips.grid48.txt +31 -0
- package/fixtures/expected/shift-interim-card-tips.lines.json +344 -0
- package/fixtures/hobex-hps-codes.json +2 -2
- package/fixtures/invoice-api-examples/issue-error-deposit.json +39 -0
- package/fixtures/invoice-api-examples/issue-invoice-deposit.json +55 -0
- package/fixtures/invoice-api.schema.json +65 -2
- package/fixtures/invoice-texts.json +11 -1
- package/fixtures/pos-texts.json +300 -3
- package/fixtures/renames-1.0.json +10 -0
- package/fixtures/shift-ablauf-cases.json +4 -4
- package/fixtures/shift-cases.json +4 -2
- package/fixtures/shift-receipts-card-tips.json +73 -0
- package/fixtures/shift-receipts.json +9 -9
- package/fixtures/stored/card-tip-cases.json +132 -0
- package/fixtures/surface.json +33 -8
- package/fixtures/v3/antworten/belege.json +1 -1
- package/fixtures/v3/antworten/belegmail.json +1 -1
- package/fixtures/v3/antworten/berichte.json +1 -1
- package/fixtures/v3/antworten/kasse-belege.json +1 -1
- package/fixtures/v3/antworten/kasse.json +240 -3
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +1 -1
- package/fixtures/v3/antworten/storno.json +1 -1
- package/fixtures/v3/stored/belege.json +1 -1
- package/fixtures/v3/stored/kasse.json +2 -2
- package/fixtures/v3/stored/rechnungen.json +1 -1
- package/fixtures/v3/v3-vokabular.json +459 -17
- package/fixtures/v3/zahlbetrag-faelle.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,42 @@ 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
|
+
## 1.37.0 - unveröffentlicht
|
|
8
|
+
|
|
9
|
+
Late terminal query for a card payment with an open outcome (`HpsPayments.clarifyPayment` in `./payments`). Additive; `pay`, `refund` and `cancel` behave as before. Card tips at the register (backend spec 2026-11-11-kartentrinkgeld, stages 1 and 2). Additive; every existing call, golden and text behaves as before, except the wording changes named below.
|
|
10
|
+
|
|
11
|
+
- **`clarifyPayment({ transactionId, previous })`:** asks the terminal LATER whether a payment went through – when the cashier clarifies an unclear card, possibly minutes after the payment or after a page reload. Read-only: only status queries, never an abort, never a reversal, never a new transaction. Budget a sixth of `resolveBudgetMs` (15 s by default); two answers without a statement in a row end it as `unresolved` at once (the payment is long finished, the terminal will not know later either). What an answer may decide depends on `previous` – the `unresolved` result of `pay` (only `reason` counts), `'beforeResolve'` when the clarification of `pay` never started (the page died during the card flow, so no reversal was sent), or `null` when the history is unknown: after a host fault (`hostFault`, `hostTimeout`, `internalError`, `approvedWithCondition`) a reversal may have been sent, so `'0'` never means "charged" there; `9011` means "nothing charged" only without a host fault or when a reversal was surely attempted (every code with that reason carries `sendReversal`, computed from the table); any other conclusive decline decides only without a host fault; with unknown history nothing decides and the cashier decides by the terminal receipt as before. Reason: until now the register could only offer two blind buttons ("was charged" / "not charged") – the terminal knows better, and a wrong click costs a double charge or a receipt without money.
|
|
12
|
+
- `HpsClarifyOptions` exported from `./payments`.
|
|
13
|
+
- **Texts for a new version of the browser register** (`only: ['web']`): the message `version.new_available` („Neue Fassung verfügbar – bei Gelegenheit neu laden.“) and the label `version.reload` („Neu laden“). The browser register shows the line when the deploy delivers a different build than the open tab runs, and only while nothing is running at the register; it never reloads by itself. Reason: a register tab stays open all day and otherwise keeps running the old bundle until someone reloads.
|
|
14
|
+
- **Short texts for clarifying an unclear card payment** (both sides): the clarify window shows the label `split.clarify_title` („Karte klären · {amount}“), one line on the state – `split.clarify_asking` („Das Terminal wird gefragt …“), `split.clarify_open` („Das Terminal weiß es nicht. hobex kann die Zahlung nachsehen.“), `split.clarify_not_asked` („Das Terminal konnte nicht gefragt werden ({reason}). Bitte später erneut klären.“), the new `split.clarify_busy` („Das Terminal ist gerade belegt. Bitte gleich erneut klären.“) and `split.clarify_no_answer` („Das Terminal hat nicht geantwortet. Bitte später erneut klären.“) or the new `split.clarify_manual` („Das Terminal kann es nicht sicher sagen. hobex kann die Zahlung nachsehen.“) when the terminal was not asked at all – and the full reference as the label `split.clarify_reference` („Kennung {reference}“); `split.clarify_charged` and `split.clarify_not_charged` report the terminal's answer. New message `card_payment.unclear_short` („Kartenzahlung {amount} unklar – bitte klären. Kennung {reference}.“) for a card that already stands in the list to be clarified (warning corner, a new payment blocked by it); the reference may be shortened there, the window and the list carry it in full. `card_payment.unknown` and `card_payment.unknown_with_id` are unchanged and remain the sentence for a card that is not in such a list. Reason: the long sentence stood in the window, in the warning corner and in the blocking message at once; the owner chose „short with reference“ (11.11.2026).
|
|
15
|
+
- **Reason line in the clarify window** (both sides): one short message per reason with a fault at or after the hobex host (`isHostUncertainReason`; key = reason in snake_case) – `split.clarify_reason_host_fault` („Grund: Störung zwischen Terminal und hobex.“), `split.clarify_reason_host_timeout`, `split.clarify_reason_internal_error`, `split.clarify_reason_approved_with_condition` – and `split.clarify_reason_terminal` („Grund: Das Terminal meldete „{text}“ (Code {code}).“) for a code without a fixed meaning. The register shows it as a grey line under the state line; the warning corner keeps only `card_payment.unclear_short`. Reason: the owner chose one sentence for the corner, but the cashier must not lose why the outcome stayed open.
|
|
16
|
+
- **hobex support** (`./payments`): `HOBEX_SUPPORT` (`phone` `+43 662 2255-88`, `display` `0662 2255-88`, `availability` `24/7`; the owner's statement of 11.11.2026, extension 88 of the hobex head office +43 662 2255-0) and the labels `hobex_help.*` (both sides) for a window of its own: the number to tap with its availability („24/7“ from `HOBEX_SUPPORT.availability`), and under „Das fragt hobex“ what hobex asks on the phone – TID, reference, amount, time, message, protocol, address, serial number (only what the register knows; a row without a value is left out) – plus „Angaben kopieren“. Meant only where hobex can help (fault at the hobex host, terminal not in operation, wrong TID, the terminal answered and does not know the outcome), never for errors in the own network or at Kasseneck Connect. Reason: the owner wanted the number in a clean window with the data support asks for, not as a bare line (12.11.2026).
|
|
17
|
+
- **HPS texts without the terminal receipt** (both sides): the hobex HPS terminal prints no receipt the cashier could check (owner, 12.11.2026). New messages `card_payment.unknown_hps`, `card_payment.unknown_with_id_hps` („… Die Karte kann belastet sein: erst klären, dann neu kassieren.“), `split.card_reverse_failed_hps`, `split.card_reverse_unknown_hps`, `split.card_already_reversed_hps` say what to do instead of where to look; the clarify lines above name hobex or a later retry. `HPS_REASON_HINTS.approvedWithCondition` now says „weiß hobex“ instead of the terminal receipt. The texts without `_hps` stay for other terminals and keep their 1.0 wording (rename guard).
|
|
18
|
+
- **Card tips in three stages:** `PosBusinessSettings.tipCardKeptMode` (`ask` | `always` | `never`, optional like `tipKeptMode`), `tipCardKeptByDefault` (the switch's default at stage `ask`) and `tipSelfPayout` (emergency off switch, missing = on). Readers `posTipCardKeptMode`, `posTipCardKeptByDefault`, `posTipSelfPayout`; `tipKeptFor(business, wanted, method)` takes a third argument `'cash' | 'card'` (default `'cash'`, unchanged behaviour) and decides the card stage from the card fields. "Kept" means for a card tip: the employee takes the amount in cash out of the drawer. The settings only take effect at accounts the backend has switched to card tips via the register (`cashregister.cardTips` at login). Reason: the owner chose the same three stages for card tips as for cash tips; the register says in one line what happens to the money.
|
|
19
|
+
- **`tipStatus(method, kept)`** (`./pos`): the one line at checkout and on the done page, keyed by payment kind and outcome (`tip.line_cash_kept` "{amount} gleich einstecken", `tip.line_cash_open` "{amount} in der Lade lassen", `tip.line_card_kept` "{amount} aus der Lade nehmen", `tip.line_card_open` "{amount} später auszahlen"); the text comes from `labelText(key, { amount })`. Reason: both registers must say the same words, and the line says what really happens, not the stage.
|
|
20
|
+
- **`getMyTipBalance({ drawerId? | cashregisterId? })`** (register path `/api/v3`, read without effect): "Mein Trinkgeld" of the logged-in person — `openCents` (negative when paid out too much), `keptTodayCents`, `claimScope` (`per_drawer` | `per_person`, `TIP_CLAIM_SCOPES`), `currency` and `otherDrawers[]`; type `TipBalance`. Only a personal login; a shared device login or the owner gets `not_a_person_login` (appended to `POS_ERROR_CODES`). Reason: every employee sees her own stand and pays herself out.
|
|
21
|
+
- **`ShiftTipTotals.cardTipsTakenCents`** (optional, sent only when not 0, part of `paidOutCents`), `shiftTipLines` prints the line `shift_receipt.tip_card_taken` "davon Kartentrinkgeld" after "schon genommen", `EXPECTED_PART_KEYS` gains `card_tips_taken` (`shift.part_card_tips_taken` "Kartentrinkgeld bar genommen", expected = … − card tips taken) and the Z-/X-receipt data carry `cardTipsTakenCents` (sum) when there is any. Shared cases in `fixtures/shift-cases.json` (two new) and the new contract file `fixtures/stored/card-tip-cases.json` (drawer arithmetic per receipt, replayed by the backend; here `tipLines` and `tipStatus`). Reason: the drawer's expected cash drops by the card tips taken in cash, and the receipt must show why.
|
|
22
|
+
- **Texts** for the done page (`done.tip_*`), "Mein Trinkgeld" (`my_tips.*`), the cancellation line `cancellation.tip_deducted` "{amount} Trinkgeld werden vom Guthaben von {name} abgezogen", the settings (`tip_card_kept_mode.title`, `tip.card_kept_setting`, `tip_self_payout.title`) and the hints `tip.card_kept_setting_hint`, `tip.self_payout_hint`, `tip.overpaid_hint`, `tip.terminal_hint`. Same wording as the backend spec.
|
|
23
|
+
- **Z-/X-receipt line for card tips taken:** `shiftReceiptLayout` prints `shift.part_card_tips_taken` "Kartentrinkgeld bar genommen" with the negative sum (`ShiftSummaryReceipt.cardTipsTakenCents`) right after "Bar aus Verkäufen", also blind (like the movements); without the field or with 0 the receipt stays byte-identical (all existing goldens unchanged). The per-person line `shift_receipt.tip_card_taken` is shortened to "davon Kartentrinkgeld" so it fits one line on 80 mm. New goldens `expected/shift-{interim,close}-card-tips.*` with their own manifest `fixtures/shift-receipts-card-tips.json` (contract case + shallow `overlay`), so `shift-receipts.json` stays byte-identical. New label `tip_payout.nothing_open` "nichts offen" (instead of "erledigt" at accounts with card tips through the register). `tip.card_kept_setting_hint` now says when "kept" works for a card tip at all (open shift, enough cash in the drawer, employee sees the drawer balance; otherwise it stays open). Reason: start + cash + movements must add up to the expected cash on the receipt, too.
|
|
24
|
+
- **Stage 3 (register surfaces):** `RegisterDeviceUsers.cashregister.cardTips` (`true` only when the account runs card tips through the register; missing otherwise, then the register stays exactly as before). `TIP_CLAIM_SCOPE_LABELS` (`per_drawer` | `per_person` -> `tip_claim_scope.*`, also in `fixtures/pos-texts.json` as `tipClaimScopeLabels`) with the title `tip_claim_scope.title` and the hint `tip_claim_scope.hint` for the customer area, and `my_tips.payout_not_allowed` for "Mein Trinkgeld" without the right to pay out. Reason: the register needs to know whether the account is switched over before it shows the card stage, the done-page line and "Mein Trinkgeld"; the customer area sets where the open claim is kept (F2).
|
|
25
|
+
- **Contract:** `fixtures/v3/*` taken over from the backend (vocabulary entries `getMyTipBalance`, `tipCardKeptMode`, `tipCardKeptByDefault`, `tipSelfPayout`, catalogs `KASSE_BETRIEB_WERTE.tipCardKeptMode`, `TRINKGELD_ANSPRUCH`, expected part `card_tips_taken`, error code `not_a_person_login`), `fixtures/surface.json` lists the call.
|
|
26
|
+
- **„genommen“ instead of „schon genommen“** (both sides, owner 12.11.2026): `shift_receipt.tip_paid_out` (X/Z receipt, cash status) now reads „genommen“, `my_tips.kept_today` „Heute genommen“, and the two keep-setting hints say „gilt als genommen“. Shorter, and the same word on the receipt, in the register, the panel and the shift PDF. Shift receipt fixtures, print goldens and the two twin byte digests of the Z receipt with take-out are redrawn; the Dart twin pulls them with the texts.
|
|
27
|
+
- `fixtures/surface.json`, `pos-texts.json`, `invoice-texts.json`, `hobex-hps-codes.json` and `invoice-api.schema.json` regenerated for the version.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.36.0 - 2026-11-11
|
|
31
|
+
|
|
32
|
+
Deposit on invoice and credit-note positions, and the EWP report (single-use deposit report) through the API key. Additive; every existing call, invoice and golden behaves as before.
|
|
33
|
+
|
|
34
|
+
- **`items[].deposit` on `issueInvoice` and `createCreditNote`:** a position that carries `deposit` is a deposit line for the position `depositFor` (index in `items`, 0 to 499). Types `InvoiceItemDepositInput` (`depositTypeId`, `depositFor`, optional `gtin` of 8 to 14 digits, optional `ownFilling`) at `IssueInvoiceItemInput.deposit` and `CreditNoteItemInput.deposit`; `InvoiceItemDeposit` (the same plus `depositKind`, `single_use | reusable`, set by the server) at `InvoiceItem.deposit`, read with `getInvoice` and absent on every position without deposit. The contract field `DEPOSIT_ITEM_FIELD` (`./invoice`) equals the backend field field by field; the string field type of the contract knows `pattern` now (the GTIN), written to `fixtures/invoice-api.schema.json` as `pattern`. The five error codes `deposit_not_enabled`, `deposit_type_not_found`, `deposit_set_by_server`, `invalid_deposit_quantity` and `invalid_deposit` are appended to `INVOICE_ERROR_CODES`; the existing order is unchanged. New examples `issue-invoice-deposit.json` and `issue-error-deposit.json`. Reason: a merchandise system that invoices beverages must be able to bill the deposit as its own lines, and the server prints and reports them.
|
|
35
|
+
- **Texts for the invoice with single-use deposit** (`fixtures/invoice-texts.json`, de and en): `pdf.totals.single_use_deposit`, `pdf.totals.head_rate`, `pdf.totals.head_net`, `pdf.totals.head_vat` (head of the tax table, which gets a 0 % row for single-use deposit) and `einvoice.exemption.single_use_deposit` (UStR Rz 8). Same wording as the backend.
|
|
36
|
+
- **EWP report** (`/v3`, API key, only for businesses with the filler role; no cash-register token needed): `getEwpReport({ month })` returns the report of a month `YYYY-MM` (`dueDate`, `provisional`, `test`, `lines[]` per GTIN with `domestic`, `foreign` and `sources` of the quantity, `warnings[]`, `extraQuantities[]`, `downloadedAt`); `downloadEwpReport({ month })` returns the CSV for the upload (`{ csv, filename, contentType }`, calls `getEwpReport` with `format: 'csv'`; a closed month counts as downloaded afterwards); `setEwpExtraQuantities({ month, extraQuantities })` replaces the extra quantities of the month (own consumption, sampling, donation ...; an empty list clears them) and returns the new report. Types `EwpReport`, `EwpLine`, `EwpWarning` (`code`: `gtin_not_registered`, `foreign_not_reportable`, `master_data_missing`, `negative_quantity`, `invalid_posting`; `country` is `null` for an extra quantity without a country), `EwpExtraQuantity` (`by` is the uid of the login or `'api'`), `EwpExtraQuantityInput`, and the lists `EWP_REASONS` (`own_consumption`, `sampling`, `donation`, `theft`, `free_goods`, `stocktake`, `return`, `external_system`, `other`) and `EWP_WARNING_CODES`. An answer that is not a report throws `KasseneckValidationError` (scope `response`), an empty or missing month and an `extraQuantities` that is not a list throw before sending (scope `request`). Both calls are repeatable (`CALLS_WITHOUT_EFFECT`, `'repeatable'`), not "unknown outcome". Reason: the report is due on the 5th of the following month, and a merchandise system that fills the beverages itself reports from its own data.
|
|
37
|
+
- **`apiKeyAuth` needs no cash-register token for calls without a register (listDepositTypes, EWP report):** `cashregisterToken` is optional; without it the header `cashregister-token` is not sent, an empty or blank text still throws `KasseneckAuthError`, and a call that needs a cash register answers `cashregister_token_missing`. Reason: an integrator with only an API key and no register must be able to use the deposit and EWP calls. A token that is passed behaves as before.
|
|
38
|
+
- **Corrections of doc comments (no change of behavior):** The server derives deposit from the articles only when `autoDeposits` is `true`, not by default (the comment said the opposite). `listDepositTypes` and `apiKeyAuth` say that those calls need no cash-register token.
|
|
39
|
+
- **Contract:** `fixtures/v3/*` taken over from the backend (vocabulary entries `getEwpReport`, `setEwpExtraQuantities`, the five deposit error codes), `fixtures/surface.json` lists both calls. In the tests, the deposit types of `listDepositTypes` have the shape the server sends (`active`, no container type and rate 0 for single-use).
|
|
40
|
+
- `fixtures/surface.json`, `pos-texts.json`, `invoice-texts.json`, `hobex-hps-codes.json` and `invoice-api.schema.json` regenerated for the version.
|
|
41
|
+
|
|
42
|
+
## 1.35.1 - 2026-11-10
|
|
8
43
|
|
|
9
44
|
Fixes in the hobex HPS card payment through Kasseneck Connect (`./payments`). The first two were measured at the test terminal 3600335 (HPS 1.14.4, firmware 7.3.6, `tecstest.hobex.at`) on 10.11.2026; the reversal fix follows from the same lesson.
|
|
10
45
|
|
|
@@ -14,7 +49,7 @@ Fixes in the hobex HPS card payment through Kasseneck Connect (`./payments`). Th
|
|
|
14
49
|
- **Contract:** new file `fixtures/hobex-hps-cases.json` with the TID cases, receipt cases (`hobexReceiptFromHps` + `hobexReceiptToCardPaymentData` on the full measured payment answer and on a status answer in the v2 form from the shortened 10.11. notes: `aid`, `cvm` as number, `currency: null`; whether `transactionId` is missing there is assumed, not measured, so it is checked with and without) and the clarification cases built from the measured answers, among them the reversal cases (and `reversalAnswers`: every listed answer to the void, once with an approval and once with `9011` in the status), a later approval after two `9027`, a till abort answered with `100002` and an abort answered with HTTP 404; the Dart twin computes the same cases. Card data in the contract and in the tests is a test card (`541333******0021`, expiry `2912`); the real card data of the test terminal (number, expiry, cryptogram, VU) is removed from `fixtures/` and `test/`, in `fixtures/receipts/card-hobex-hps.json` the expiry only (the printed bon and all goldens are unchanged, only its input hash in `manifest.json` moves); real approval and receipt numbers of the test terminal in the tests and doc comments are replaced by invented ones or dropped.
|
|
15
50
|
- `fixtures/surface.json`, `pos-texts.json`, `invoice-texts.json`, `hobex-hps-codes.json` and `invoice-api.schema.json` regenerated for the version.
|
|
16
51
|
|
|
17
|
-
## 1.35.0 -
|
|
52
|
+
## 1.35.0 - 2026-11-10
|
|
18
53
|
|
|
19
54
|
Printer catalog for setting up a receipt printer through Kasseneck Connect with one click. Additive; every existing call, receipt and golden behaves as before.
|
|
20
55
|
|
|
@@ -26,7 +61,7 @@ Printer catalog for setting up a receipt printer through Kasseneck Connect with
|
|
|
26
61
|
- **Values only from the device settings:** `cut` is `partial` or `none` (what the till offers), `qrMode` `escpos` or `raster` (`auto` means "not decided" and says nothing about a model), and `charsPerLine` must match the factory paper size (`CHARS_PER_PAPER_SIZE`: 32 for `mm58`, 48 for `mm80`).
|
|
27
62
|
- **Contract:** new file `fixtures/printer-catalog.json` with the entries, the value sets and the test cases (normalization, lookup with the shipped catalog, with every entry approved, with some approved and with a catalog of its own with overlapping manufacturers, proposals, catalog problems such as a match name in two entries, a paper size wider than the printer or an incomplete device test). The Dart twin computes the same cases. The catalog itself is checked only by the tests; at run time nothing is repaired or dropped silently.
|
|
28
63
|
|
|
29
|
-
## 1.34.0 -
|
|
64
|
+
## 1.34.0 - 2026-11-09
|
|
30
65
|
|
|
31
66
|
Read the deposit types of a business with the API key: new `listDepositTypes()` on the API client (`/v3` only, right `read`, no effect). Additive; every existing call, receipt and golden behaves as before.
|
|
32
67
|
|
|
@@ -34,7 +69,7 @@ Read the deposit types of a business with the API key: new `listDepositTypes()`
|
|
|
34
69
|
- **Contract:** `unfixTerminal` and the codes `terminal_fixed`, `terminal_device_fixed` (fixed TID per device) are known by name (call lists, `TERMINAL_ERROR_CODES`); a typed method follows. `listDepositTypes` needs no till token.
|
|
35
70
|
- `fixtures/v3/*` taken over from the backend (vocabulary entry `listDepositTypes`), `fixtures/surface.json` lists the call.
|
|
36
71
|
|
|
37
|
-
## 1.33.0 -
|
|
72
|
+
## 1.33.0 - 2026-11-09
|
|
38
73
|
|
|
39
74
|
Card terminal and the browser till on a Mac (Chrome as an installed app, Hobex HPS and printer through Kasseneck Connect). Additive; receipts, bons and every existing call behave as before (all goldens unchanged).
|
|
40
75
|
|
|
@@ -43,13 +78,13 @@ Card terminal and the browser till on a Mac (Chrome as an installed app, Hobex H
|
|
|
43
78
|
- **Texts (browser till only):** message `connect.local_network_blocked` (Chrome's "Local network access" denied for the till: the till finds no Connect, and installing does not help; the sentence gives the way to allow it), messages `terminal.several_found` (placeholder `hosts`) and `terminal.tid_not_found` (`hosts`, `tid`) for a terminal search with several hits where no single one confirms the TID of the device.
|
|
44
79
|
- `fixtures/surface.json`, `pos-texts.json`, `invoice-texts.json`, `hobex-hps-codes.json` and `invoice-api.schema.json` regenerated for the version.
|
|
45
80
|
|
|
46
|
-
## 1.32.1 -
|
|
81
|
+
## 1.32.1 - 2026-11-09
|
|
47
82
|
|
|
48
83
|
Fix: a deposit payout (a receipt whose amount due is negative because of returned empties) is no longer refused before sending. `sellReceipt`/`createReceipt` accept one negative cash payment when the items contain a `deposit_return` line, with no `tenderedCents` and no `tipCents`, and at most the sum of the return lines. Reason: the server allows this payout (`istLeergutAuszahlung`) but the client check demanded `amountCents > 0` unless the receipt was a voucher payout. Without empties a negative payment is still refused; empties with a positive amount stay an ordinary sale.
|
|
49
84
|
|
|
50
85
|
Fix: an article marked as external voucher with a non-empty deposit list is refused (`article_external_voucher_invalid`, reason `deposit`), like the backend; an empty or missing list stays allowed. Reason: the client check did not know the deposit rule of `pruefeArtikel`.
|
|
51
86
|
|
|
52
|
-
## 1.32.0 -
|
|
87
|
+
## 1.32.0 - 2026-11-09
|
|
53
88
|
|
|
54
89
|
Deposit and returnable empties at the till (backend November 2026): the server adds the deposit lines, the till previews them, takes empties back, and the bon prints them. Additive; articles, groups, settings and receipts without the new fields read, send and print exactly as before (all existing goldens unchanged).
|
|
55
90
|
|
|
@@ -65,7 +100,7 @@ Deposit and returnable empties at the till (backend November 2026): the server a
|
|
|
65
100
|
- **Texts:** `DEPOSIT_ERROR_MESSAGES` (code -> message key) / `depositErrorMessage(code)` (returns the message key, `undefined` for any other code; resolve it with `messageText`; eight codes, short sentences without legal language; also `depositErrors` in `pos-texts.json`), message `deposit.changed`, labels `deposit.return`, `.payout`, `.offset`, `.unknown_code`, `.over_usual`, `.on_premises`, `.takeaway`, `.sum`.
|
|
66
101
|
- Contract `v3` re-fetched (deposit blocks, fields, catalogs and codes), `fixtures/surface.json`, `pos-texts.json`, `invoice-texts.json` and `hobex-hps-codes.json` regenerated for the version.
|
|
67
102
|
|
|
68
|
-
## 1.31.0 -
|
|
103
|
+
## 1.31.0 - 2026-11-08
|
|
69
104
|
|
|
70
105
|
External vouchers at the till: a tile sells an external voucher, the payment screen redeems one through the same code field, the payout sheet switches between own and external, the cancellation flow warns. Additive; articles, groups and receipts without the new field read, print and send exactly as before (all existing goldens unchanged).
|
|
71
106
|
|
|
@@ -109,7 +144,7 @@ Card terminal on the phone: Kasseneck keeps the terminal app's accounts, the ter
|
|
|
109
144
|
- **`TERMINAL_ERROR_CODES`** equal to `errorCodes.terminal` of the contract (order included, pinned by a test): `terminal_not_enabled`, `terminal_test_environment`, `terminal_device_unknown`, `terminal_device_blocked`, `invalid_terminal_device`, `too_many_terminal_devices`, `terminal_not_in_business`, `terminal_code_manual`, `terminal_code_rate_limited`, `terminal_not_assigned`, `server_error`. Lists `TERMINAL_PLATFORMS`, `TERMINAL_SETUP_STATES`, `TERMINAL_CODE_STATUSES`, `TERMINAL_CODE_SOURCES`.
|
|
110
145
|
- Contract `v3` re-fetched from the backend (the seven endpoints, `errorCodes.terminal`).
|
|
111
146
|
|
|
112
|
-
## 1.28.0 - 2026-11-
|
|
147
|
+
## 1.28.0 - 2026-11-07
|
|
113
148
|
|
|
114
149
|
Shift flow of the till: start a shift, count in between, close in steps, tip kinds, column width. Additive; every field below is sent by the server only when it applies, a reader without them behaves as before (all existing goldens unchanged).
|
|
115
150
|
|
|
@@ -172,7 +207,7 @@ Kasseneck Connect inventory: the register reports which Connect version runs at
|
|
|
172
207
|
- **`POS_CALLS` gains `reportConnectState`** (now 49; only on the register path), classified as unknown outcome on a timeout like `logReceiptOutputs`. `reportConnectState(transport, report)` (`./pos`) sends exactly `deviceId`, `version`, `os`, `osVersion`, `arch`, `features`, `httpsTrusted` and `bluetooth` (`ConnectStateReport`); `osVersion`, `arch`, `httpsTrusted` and `bluetooth` may be `null`, `features` may be empty (older Connect versions know none of them). The form is checked before sending (`KasseneckValidationError`, `scope: 'request'`; an unknown field is rejected, so nothing that names the computer or a person slips in); what the server does not accept it rejects with `invalid_connect_report`. Answer: nothing. Reason: Connect itself never talks to Kasseneck; the register knows account and device and reads Connect's status anyway.
|
|
173
208
|
- **`getKasseSettings`** (`/v3`) now carries `connect { minimumVersion, deadline }` (both `null` without a requirement); read by the register to show the update hint. Contract v3 fetched again from the backend.
|
|
174
209
|
|
|
175
|
-
## 1.23.0 - 2026-
|
|
210
|
+
## 1.23.0 - 2026-11-01
|
|
176
211
|
|
|
177
212
|
The tab *Prüfung* at the register (*Kassennachschau*, stage 2b): the register info for the inspector on screen and as a printout, the words of the tab (register info, zero receipt, DEP) and two DEP sentences without legal wording. Additive.
|
|
178
213
|
|
|
@@ -298,7 +333,7 @@ Receipt lists page by page: `listReceipts` and `listAllReceipts` for the new pub
|
|
|
298
333
|
- **`LIST_RECEIPTS_ERROR_CODES`**: `invalid_date`, `invalid_range`, `range_too_long`, `invalid_limit`, `invalid_order`, `invalid_view`, `invalid_cursor`, `server_error` (plus the codes of sign-in and edge). `listReceipts` is a read (`outcome: 'rejected'` after a timeout), in `PUBLIC_CALLS` (now 108) and in the contract `surface.json`.
|
|
299
334
|
- Contract re-fetched from the backend (`listReceipts` in `endpoints.public`, schema with `cancellationStatus`/`cancellationReason` catalogues). Also from it: `idempotency_conflict` in `RECEIPT_ERROR_CODES` (readable only; this package sends no `idempotencyKey` on receipts yet), `invoice_number_taken` at the end of `INVOICE_ERROR_CODES` (`fixtures/invoice-api.schema.json` rewritten), and the old settings field `vouchers.label`, which the package does not read (registers before voucher stage 4b).
|
|
300
335
|
|
|
301
|
-
## 1.14.0 - 2026-10-
|
|
336
|
+
## 1.14.0 - 2026-10-24
|
|
302
337
|
|
|
303
338
|
Vouchers at the register, catch-up: the receipt rules of the voucher form, words for the register navigation, the drawer reason of a voucher payout and three shortcut actions; in addition the line `Duplikat am:` on every reprint (`markAsDuplicate`) and the receipt outputs (`logReceiptOutputs`, `outputs` from `getReceipt`, words for the receipt detail). Additive, with one type narrowing (see below).
|
|
304
339
|
|
package/dist/cjs/client/api.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { type CashregisterReportPeriod, type ReportV2, type ReportV2Options } fr
|
|
|
6
6
|
import { type CashboxStatus, type SignatureStatus } from './status.js';
|
|
7
7
|
import { type CreateDepExportOptions, type CreateDepExportResult, type DepExport, type DepExportFile, type DepHandoverLink, type GetDepExportFileOptions, type RevokedDepHandoverLink, type WaitForDepExportOptions } from './dep-export.js';
|
|
8
8
|
import { type ClaimTerminalOptions, type GetTerminalAccessOptions, type RegisteredTerminalDevice, type RegisterTerminalDeviceOptions, type ReportTerminalLoginOptions, type RequestTerminalCodeOptions, type TerminalAccess, type TerminalAccessResult, type TerminalCode, type TerminalCodeRequest, type TerminalDeviceCredentials } from './terminal.js';
|
|
9
|
+
import { type EwpExtraQuantityInput, type EwpReport, type EwpReportFile } from './ewp.js';
|
|
9
10
|
import type { DepositSettings } from '../pos/pfand.js';
|
|
10
11
|
import { type ListedReceipt, type ListReceiptsOptions, type ListReceiptsPage, type ListReceiptsView } from './list-receipts.js';
|
|
11
12
|
import { type SendReceiptEmailOptions, type SendReceiptEmailResult, type LogReceiptOutputsOptions, type LogReceiptOutputsResult, type ListMyReceiptsOptions, type ReceiptList, type ReceiptWithCompany, type SellReceiptOptions, type CancelReceiptOptions, type CancelReceiptResult } from './receipts.js';
|
|
@@ -64,8 +65,21 @@ export interface KasseneckApi {
|
|
|
64
65
|
listReceipts<V extends ListReceiptsView = 'summary'>(options: ListReceiptsOptions<V>): Promise<ListReceiptsPage<V>>;
|
|
65
66
|
/** Alle Belege eines Tages oder Zeitraums, Seite fuer Seite geholt (hoechstens 100 Seiten). */
|
|
66
67
|
listAllReceipts<V extends ListReceiptsView = 'summary'>(options: ListReceiptsOptions<V>): AsyncGenerator<ListedReceipt<V>, void, undefined>;
|
|
67
|
-
/** Pfandarten des Betriebs (`listDepositTypes`, nur /v3
|
|
68
|
+
/** Pfandarten des Betriebs (`listDepositTypes`, nur /v3; braucht kein Kassen-Token); `null` = Pfand aus, dann keine Pfandzeilen senden. */
|
|
68
69
|
listDepositTypes(): Promise<DepositSettings | null>;
|
|
70
|
+
/** EWP-Meldung eines Monats (`getEwpReport`, nur /v3, Abfueller-Betrieb, ohne Kassen-Token): Zeilen je GTIN, Warnungen, Zusatzmengen. */
|
|
71
|
+
getEwpReport(options: {
|
|
72
|
+
month: string;
|
|
73
|
+
}): Promise<EwpReport>;
|
|
74
|
+
/** CSV der EWP-Meldung eines Monats (`getEwpReport` mit `format: 'csv'`); ein abgeschlossener Monat gilt danach als heruntergeladen. */
|
|
75
|
+
downloadEwpReport(options: {
|
|
76
|
+
month: string;
|
|
77
|
+
}): Promise<EwpReportFile>;
|
|
78
|
+
/** Zusatzmengen eines Monats ersetzen (`setEwpExtraQuantities`); eine leere Liste leert sie. Antwort ist die neue Meldung. */
|
|
79
|
+
setEwpExtraQuantities(options: {
|
|
80
|
+
month: string;
|
|
81
|
+
extraQuantities: EwpExtraQuantityInput[];
|
|
82
|
+
}): Promise<EwpReport>;
|
|
69
83
|
/** DEP-Export fuer die Kassennachschau einstellen (`createDepExport`, nur /v3); antwortet sofort, der Export laeuft im Hintergrund. */
|
|
70
84
|
createDepExport(options?: CreateDepExportOptions): Promise<CreateDepExportResult>;
|
|
71
85
|
/** Zustand, Kennzahlen, Befund und Pruefer-Links eines Exports (`getDepExport`). */
|
package/dist/cjs/client/api.js
CHANGED
|
@@ -9,6 +9,7 @@ const status_js_1 = require("./status.js");
|
|
|
9
9
|
const dep_export_js_1 = require("./dep-export.js");
|
|
10
10
|
const terminal_js_1 = require("./terminal.js");
|
|
11
11
|
const list_deposit_types_js_1 = require("./list-deposit-types.js");
|
|
12
|
+
const ewp_js_1 = require("./ewp.js");
|
|
12
13
|
const list_receipts_js_1 = require("./list-receipts.js");
|
|
13
14
|
const receipts_js_1 = require("./receipts.js");
|
|
14
15
|
const cashregisters_js_1 = require("./cashregisters.js");
|
|
@@ -46,6 +47,9 @@ function createKasseneckApi(options) {
|
|
|
46
47
|
listReceipts: (o) => (0, list_receipts_js_1.listReceipts)(rufen, o),
|
|
47
48
|
listAllReceipts: (o) => (0, list_receipts_js_1.listAllReceipts)(rufen, o),
|
|
48
49
|
listDepositTypes: () => (0, list_deposit_types_js_1.listDepositTypes)(rufen),
|
|
50
|
+
getEwpReport: (o) => (0, ewp_js_1.getEwpReport)(rufen, o),
|
|
51
|
+
downloadEwpReport: (o) => (0, ewp_js_1.downloadEwpReport)(rufen, o),
|
|
52
|
+
setEwpExtraQuantities: (o) => (0, ewp_js_1.setEwpExtraQuantities)(rufen, o),
|
|
49
53
|
createDepExport: (o) => (0, dep_export_js_1.createDepExport)(rufen, o),
|
|
50
54
|
getDepExport: (o) => (0, dep_export_js_1.getDepExport)(rufen, o),
|
|
51
55
|
waitForDepExport: (o) => (0, dep_export_js_1.waitForDepExport)(rufen, o),
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* umhuellt, muss ihn weiterhin absetzen koennen.
|
|
14
14
|
*/
|
|
15
15
|
import type { FileOrData, FileOrDataCallOptions, PdfOrData, TransportBodyFields, TransportCallOptions } from './transport.js';
|
|
16
|
-
export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createDepExport", "createDepHandoverLink", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCashregisterReport", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getDepExport", "getDepExportFile", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "getReportV2", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listBrands", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyStock", "listMyStockLocations", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listReceipts", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "revokeDepHandoverLink", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook", "getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries", "createArticle", "updateArticle", "deactivateArticle", "receiveGoods", "transferStock", "recordStockLoss", "changeStockCondition", "reverseStockMovement", "createReservation", "extendReservation", "releaseReservation", "getReservation", "listReservations", "createVariantGroup", "updateVariantGroup", "getVariantGroup", "listVariantGroups", "addVariant", "createStocktake", "listStocktakes", "getStocktake", "listStocktakeItems", "recordStocktakeCount", "voidStocktakeCount", "listStocktakeCounts", "reviewStocktake", "recountStocktake", "closeStocktake", "cancelStocktake", "getStocktakePdf", "orderSignatureCard", "getSignatureCardOrder", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "recordMyShiftCount", "logReceiptOutputs", "getRegisterInspectionInfo", "reportConnectState", "learnMyLeergutCode", "listMyLeergutCodes", "registerTerminalDevice", "getTerminalAccess", "claimTerminal", "requestTerminalCode", "getTerminalCode", "reportTerminalLogin", "reportTerminalReady", "unfixTerminal", "listDepositTypes"];
|
|
16
|
+
export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createDepExport", "createDepHandoverLink", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCashregisterReport", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getDepExport", "getDepExportFile", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "getReportV2", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listBrands", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyStock", "listMyStockLocations", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listReceipts", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "revokeDepHandoverLink", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook", "getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries", "createArticle", "updateArticle", "deactivateArticle", "receiveGoods", "transferStock", "recordStockLoss", "changeStockCondition", "reverseStockMovement", "createReservation", "extendReservation", "releaseReservation", "getReservation", "listReservations", "createVariantGroup", "updateVariantGroup", "getVariantGroup", "listVariantGroups", "addVariant", "createStocktake", "listStocktakes", "getStocktake", "listStocktakeItems", "recordStocktakeCount", "voidStocktakeCount", "listStocktakeCounts", "reviewStocktake", "recountStocktake", "closeStocktake", "cancelStocktake", "getStocktakePdf", "orderSignatureCard", "getSignatureCardOrder", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "recordMyShiftCount", "logReceiptOutputs", "getRegisterInspectionInfo", "reportConnectState", "learnMyLeergutCode", "listMyLeergutCodes", "getMyTipBalance", "registerTerminalDevice", "getTerminalAccess", "claimTerminal", "requestTerminalCode", "getTerminalCode", "reportTerminalLogin", "reportTerminalReady", "unfixTerminal", "listDepositTypes", "getEwpReport", "setEwpExtraQuantities"];
|
|
17
17
|
export type ApiCall = typeof ALL_CALLS[number];
|
|
18
18
|
/**
|
|
19
19
|
* Die oeffentlichen Endpunkte unter `/v3` (`https://api.kasseneck.at/v3/<name>`),
|
|
@@ -21,7 +21,7 @@ export type ApiCall = typeof ALL_CALLS[number];
|
|
|
21
21
|
* (`fixtures/v3/v3-vokabular.json`, `endpoints.public`, umbenannt nach
|
|
22
22
|
* `names`). Ein Test haelt beide Listen deckungsgleich.
|
|
23
23
|
*/
|
|
24
|
-
export declare const PUBLIC_CALLS: readonly ["createReceipt", "getReceipt", "cancelReceipt", "sendReceiptEmail", "generateFullReceiptId", "downloadReceipt", "getFirstReceiptDate", "getReportV2", "downloadReport", "downloadDailyReport", "getCashregisterReport", "createPaymentLinkStripe", "stripeCaptureIntent", "hobexPayApi", "hobexRefundApi", "hobexGetStatus", "financeWebService", "listMyTipRecipients", "getPartnerInfo", "createPartnerCustomer", "checkPartnerCustomerEmail", "listPartnerCustomers", "getPartnerCustomer", "sendPartnerCustomerFonLink", "createPartnerWebhook", "updatePartnerWebhook", "deletePartnerWebhook", "listPartnerWebhooks", "sendPartnerWebhookTest", "rotatePartnerWebhookSecret", "listPartnerWebhookDeliveries", "requestCustomerSignature", "getCustomerSignatureStatus", "createCustomerCashregister", "activateCashregister", "listCustomerCashregisters", "getCustomerCredentials", "reportCustomerContract", "getPartnerBilling", "getPartnerBillingMonth", "createCustomer", "getCustomer", "updateCustomer", "searchCustomers", "issueInvoice", "cancelInvoice", "createCreditNote", "getInvoice", "listInvoices", "getInvoicePdf", "getInvoiceXml", "getInvoiceSetupStatus", "listBrands", "recordInvoicePayment", "createInvoiceItem", "updateInvoiceItem", "withdrawInvoiceItem", "getInvoiceItem", "listInvoiceItems", "setCustomerMandate", "revokeCustomerMandate", "getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries", "createArticle", "updateArticle", "deactivateArticle", "receiveGoods", "transferStock", "recordStockLoss", "changeStockCondition", "reverseStockMovement", "createReservation", "extendReservation", "releaseReservation", "getReservation", "listReservations", "createVariantGroup", "updateVariantGroup", "getVariantGroup", "listVariantGroups", "addVariant", "createStocktake", "listStocktakes", "getStocktake", "listStocktakeItems", "recordStocktakeCount", "voidStocktakeCount", "listStocktakeCounts", "reviewStocktake", "recountStocktake", "closeStocktake", "cancelStocktake", "getStocktakePdf", "orderSignatureCard", "getSignatureCardOrder", "listReceipts", "createDepExport", "getDepExport", "getDepExportFile", "createDepHandoverLink", "revokeDepHandoverLink", "registerTerminalDevice", "getTerminalAccess", "claimTerminal", "requestTerminalCode", "getTerminalCode", "reportTerminalLogin", "reportTerminalReady", "unfixTerminal", "listDepositTypes"];
|
|
24
|
+
export declare const PUBLIC_CALLS: readonly ["createReceipt", "getReceipt", "cancelReceipt", "sendReceiptEmail", "generateFullReceiptId", "downloadReceipt", "getFirstReceiptDate", "getReportV2", "downloadReport", "downloadDailyReport", "getCashregisterReport", "createPaymentLinkStripe", "stripeCaptureIntent", "hobexPayApi", "hobexRefundApi", "hobexGetStatus", "financeWebService", "listMyTipRecipients", "getPartnerInfo", "createPartnerCustomer", "checkPartnerCustomerEmail", "listPartnerCustomers", "getPartnerCustomer", "sendPartnerCustomerFonLink", "createPartnerWebhook", "updatePartnerWebhook", "deletePartnerWebhook", "listPartnerWebhooks", "sendPartnerWebhookTest", "rotatePartnerWebhookSecret", "listPartnerWebhookDeliveries", "requestCustomerSignature", "getCustomerSignatureStatus", "createCustomerCashregister", "activateCashregister", "listCustomerCashregisters", "getCustomerCredentials", "reportCustomerContract", "getPartnerBilling", "getPartnerBillingMonth", "createCustomer", "getCustomer", "updateCustomer", "searchCustomers", "issueInvoice", "cancelInvoice", "createCreditNote", "getInvoice", "listInvoices", "getInvoicePdf", "getInvoiceXml", "getInvoiceSetupStatus", "listBrands", "recordInvoicePayment", "createInvoiceItem", "updateInvoiceItem", "withdrawInvoiceItem", "getInvoiceItem", "listInvoiceItems", "setCustomerMandate", "revokeCustomerMandate", "getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries", "createArticle", "updateArticle", "deactivateArticle", "receiveGoods", "transferStock", "recordStockLoss", "changeStockCondition", "reverseStockMovement", "createReservation", "extendReservation", "releaseReservation", "getReservation", "listReservations", "createVariantGroup", "updateVariantGroup", "getVariantGroup", "listVariantGroups", "addVariant", "createStocktake", "listStocktakes", "getStocktake", "listStocktakeItems", "recordStocktakeCount", "voidStocktakeCount", "listStocktakeCounts", "reviewStocktake", "recountStocktake", "closeStocktake", "cancelStocktake", "getStocktakePdf", "orderSignatureCard", "getSignatureCardOrder", "listReceipts", "createDepExport", "getDepExport", "getDepExportFile", "createDepHandoverLink", "revokeDepHandoverLink", "registerTerminalDevice", "getTerminalAccess", "claimTerminal", "requestTerminalCode", "getTerminalCode", "reportTerminalLogin", "reportTerminalReady", "unfixTerminal", "listDepositTypes", "getEwpReport", "setEwpExtraQuantities"];
|
|
25
25
|
/**
|
|
26
26
|
* Die Endpunkte des Kassenwegs (`https://kasse.kasseneck.at/api/v3/<name>`,
|
|
27
27
|
* Web-Kasse: gleicher Ursprung `/api/v3`), in der Reihenfolge von
|
|
@@ -29,7 +29,7 @@ export declare const PUBLIC_CALLS: readonly ["createReceipt", "getReceipt", "can
|
|
|
29
29
|
* die fuenf DEP-Aufrufe); die Kasse ruft sie trotzdem ueber diesen Weg (ein Dialekt
|
|
30
30
|
* je Client, Nachtrag §5.2).
|
|
31
31
|
*/
|
|
32
|
-
export declare const POS_CALLS: readonly ["pairRegisterDevice", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "registerUserLogin", "registerPinLogin", "renewRegisterSession", "endRegisterSession", "unpairRegisterDevice", "listMyCashregisters", "listMyReceipts", "getReceipt", "createReceipt", "generateFullReceiptId", "cancelReceipt", "sendReceiptEmail", "listMyArticleGroups", "listMyArticles", "getKasseSettings", "setMyKasseSettings", "setMyKasseLogo", "setMyRegisterDeviceSettings", "listMyPrinters", "createPrintJob", "getPrintJob", "listMyTipRecipients", "listMyStockLocations", "listMyStock", "setMyCashregisterStockLocation", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "recordMyShiftCount", "logReceiptOutputs", "createDepExport", "getDepExport", "getDepExportFile", "createDepHandoverLink", "revokeDepHandoverLink", "getRegisterInspectionInfo", "reportConnectState", "learnMyLeergutCode", "listMyLeergutCodes"];
|
|
32
|
+
export declare const POS_CALLS: readonly ["pairRegisterDevice", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "registerUserLogin", "registerPinLogin", "renewRegisterSession", "endRegisterSession", "unpairRegisterDevice", "listMyCashregisters", "listMyReceipts", "getReceipt", "createReceipt", "generateFullReceiptId", "cancelReceipt", "sendReceiptEmail", "listMyArticleGroups", "listMyArticles", "getKasseSettings", "setMyKasseSettings", "setMyKasseLogo", "setMyRegisterDeviceSettings", "listMyPrinters", "createPrintJob", "getPrintJob", "listMyTipRecipients", "listMyStockLocations", "listMyStock", "setMyCashregisterStockLocation", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "recordMyShiftCount", "logReceiptOutputs", "createDepExport", "getDepExport", "getDepExportFile", "createDepHandoverLink", "revokeDepHandoverLink", "getRegisterInspectionInfo", "reportConnectState", "learnMyLeergutCode", "listMyLeergutCodes", "getMyTipBalance"];
|
|
33
33
|
export type PublicCall = typeof PUBLIC_CALLS[number];
|
|
34
34
|
export type PosCall = typeof POS_CALLS[number];
|
|
35
35
|
/**
|
|
@@ -160,6 +160,8 @@ exports.ALL_CALLS = [
|
|
|
160
160
|
// Leergut-Codes (Pfand, ./pos): Codes lernen und lesen; nur ueber den Kassenweg.
|
|
161
161
|
'learnMyLeergutCode',
|
|
162
162
|
'listMyLeergutCodes',
|
|
163
|
+
// „Mein Trinkgeld“ (./pos): Stand der angemeldeten Person; nur ueber den Kassenweg.
|
|
164
|
+
'getMyTipBalance',
|
|
163
165
|
// Kartenterminal am Handy: Geraet, Zugang, TID und Code (nur /v3).
|
|
164
166
|
'registerTerminalDevice',
|
|
165
167
|
'getTerminalAccess',
|
|
@@ -172,6 +174,9 @@ exports.ALL_CALLS = [
|
|
|
172
174
|
'unfixTerminal',
|
|
173
175
|
// Pfandarten des Betriebs lesen, nur unter /v3.
|
|
174
176
|
'listDepositTypes',
|
|
177
|
+
// EWP-Meldung (Einwegpfand) lesen und Zusatzmengen setzen, nur unter /v3.
|
|
178
|
+
'getEwpReport',
|
|
179
|
+
'setEwpExtraQuantities',
|
|
175
180
|
];
|
|
176
181
|
/**
|
|
177
182
|
* Die oeffentlichen Endpunkte unter `/v3` (`https://api.kasseneck.at/v3/<name>`),
|
|
@@ -314,6 +319,9 @@ exports.PUBLIC_CALLS = [
|
|
|
314
319
|
'unfixTerminal',
|
|
315
320
|
// Pfandarten des Betriebs lesen, nur unter /v3.
|
|
316
321
|
'listDepositTypes',
|
|
322
|
+
// EWP-Meldung (Einwegpfand) lesen und Zusatzmengen setzen, nur unter /v3.
|
|
323
|
+
'getEwpReport',
|
|
324
|
+
'setEwpExtraQuantities',
|
|
317
325
|
];
|
|
318
326
|
/**
|
|
319
327
|
* Die Endpunkte des Kassenwegs (`https://kasse.kasseneck.at/api/v3/<name>`,
|
|
@@ -384,6 +392,8 @@ exports.POS_CALLS = [
|
|
|
384
392
|
// Leergut-Codes lernen und lesen: Kassen-Benutzer mit dem Recht depositReturn.
|
|
385
393
|
'learnMyLeergutCode',
|
|
386
394
|
'listMyLeergutCodes',
|
|
395
|
+
// „Mein Trinkgeld“: nur ueber den Kassenweg, nur persoenliche Anmeldung.
|
|
396
|
+
'getMyTipBalance',
|
|
387
397
|
];
|
|
388
398
|
/**
|
|
389
399
|
* Die Aufrufe **mit Wirkung**, alphabetisch: sie legen etwas an, aendern oder
|
|
@@ -517,6 +527,10 @@ exports.CALLS_WITHOUT_EFFECT = Object.freeze({
|
|
|
517
527
|
endRegisterSession: 'repeatable',
|
|
518
528
|
generateFullReceiptId: 'read',
|
|
519
529
|
getCashregisterReport: 'read',
|
|
530
|
+
// EWP-Meldung: Lesen vermerkt bei der CSV eines abgeschlossenen Monats nur den Abruf (`downloadedAt`); Setzen ersetzt die
|
|
531
|
+
// ganze Liste der Zusatzmengen, eine Wiederholung aendert nichts mehr.
|
|
532
|
+
getEwpReport: 'repeatable',
|
|
533
|
+
setEwpExtraQuantities: 'repeatable',
|
|
520
534
|
getArticle: 'read',
|
|
521
535
|
listMyLeergutCodes: 'read',
|
|
522
536
|
getCustomer: 'read',
|
|
@@ -539,6 +553,7 @@ exports.CALLS_WITHOUT_EFFECT = Object.freeze({
|
|
|
539
553
|
getInvoiceXml: 'read',
|
|
540
554
|
getKasseSettings: 'read',
|
|
541
555
|
getMyDrawerState: 'read',
|
|
556
|
+
getMyTipBalance: 'read',
|
|
542
557
|
getMyShiftReport: 'read',
|
|
543
558
|
getPartnerBilling: 'read',
|
|
544
559
|
getPartnerBillingMonth: 'read',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* keiner ist der bevorzugte:
|
|
4
4
|
*
|
|
5
5
|
* - `apiKeyAuth` — der Weg der Geraete, POS-Apps und Dritten: der `api_key` als
|
|
6
|
-
* Bearer plus die Kopfzeile `cashregister-token` (wie im Flutter-Zwilling
|
|
6
|
+
* Bearer plus (fuer Aufrufe an einer Kasse) die Kopfzeile `cashregister-token` (wie im Flutter-Zwilling
|
|
7
7
|
* `kasseneck_api`).
|
|
8
8
|
* - `registerUserAuth` — der Weg der Browser-Kasse: ein Kassen-Benutzer, per
|
|
9
9
|
* PIN an einem gekoppelten Geraet angemeldet. ID-Token als Bearer,
|
|
@@ -35,8 +35,14 @@ export type KasseneckAuth = () => AuthCredentials | Promise<AuthCredentials>;
|
|
|
35
35
|
export interface ApiKeyAuthOptions {
|
|
36
36
|
/** API-Schluessel im Format `kr_<env>_<...>` (opak). */
|
|
37
37
|
apiKey: string;
|
|
38
|
-
/**
|
|
39
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Kassen-Token der Kasse, an der gearbeitet wird (`cb_<env>_<...>`). Optional: Aufrufe, die dem
|
|
40
|
+
* Betrieb statt einer Kasse gelten, brauchen ihn nicht (`listDepositTypes`, `getEwpReport`,
|
|
41
|
+
* `setEwpExtraQuantities`); ohne Token geht die Kopfzeile `cashregister-token` nicht mit.
|
|
42
|
+
* Ein Aufruf, der eine Kasse braucht, antwortet ohne Token mit `cashregister_token_missing`.
|
|
43
|
+
* Ein leerer Text oder nur Leerraum wirft sofort.
|
|
44
|
+
*/
|
|
45
|
+
cashregisterToken?: string;
|
|
40
46
|
}
|
|
41
47
|
export interface RegisterUserAuthOptions {
|
|
42
48
|
/** Liefert ein gueltiges ID-Token des Anmeldediensts; wird pro Anfrage befragt. */
|
package/dist/cjs/client/auth.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* keiner ist der bevorzugte:
|
|
5
5
|
*
|
|
6
6
|
* - `apiKeyAuth` — der Weg der Geraete, POS-Apps und Dritten: der `api_key` als
|
|
7
|
-
* Bearer plus die Kopfzeile `cashregister-token` (wie im Flutter-Zwilling
|
|
7
|
+
* Bearer plus (fuer Aufrufe an einer Kasse) die Kopfzeile `cashregister-token` (wie im Flutter-Zwilling
|
|
8
8
|
* `kasseneck_api`).
|
|
9
9
|
* - `registerUserAuth` — der Weg der Browser-Kasse: ein Kassen-Benutzer, per
|
|
10
10
|
* PIN an einem gekoppelten Geraet angemeldet. ID-Token als Bearer,
|
|
@@ -33,8 +33,9 @@ function apiKeyAuth(options) {
|
|
|
33
33
|
if (!options.apiKey) {
|
|
34
34
|
throw new errors_js_1.KasseneckAuthError('apiKeyAuth: apiKey fehlt');
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
const gegeben = options.cashregisterToken !== undefined && options.cashregisterToken !== null;
|
|
37
|
+
if (gegeben && (typeof options.cashregisterToken !== 'string' || options.cashregisterToken.trim() === '')) {
|
|
38
|
+
throw new errors_js_1.KasseneckAuthError('apiKeyAuth: cashregisterToken ist leer');
|
|
38
39
|
}
|
|
39
40
|
const { apiKey, cashregisterToken } = options;
|
|
40
41
|
// Pro Aufruf ein frisches Objekt: der Transport (oder ein Aufrufer) darf
|
|
@@ -42,7 +43,7 @@ function apiKeyAuth(options) {
|
|
|
42
43
|
return () => ({
|
|
43
44
|
headers: {
|
|
44
45
|
Authorization: `Bearer ${apiKey}`,
|
|
45
|
-
'cashregister-token': cashregisterToken,
|
|
46
|
+
...(cashregisterToken ? { 'cashregister-token': cashregisterToken } : {}),
|
|
46
47
|
},
|
|
47
48
|
params: {},
|
|
48
49
|
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { InternerTransport } from './aufrufe.js';
|
|
2
|
+
/**
|
|
3
|
+
* EWP-Meldung (Einwegpfand-Meldung, Pfand Teil 5): die Monatsmeldung der
|
|
4
|
+
* Einweg-Verpackungen je GTIN, die ein Abfuellbetrieb dem Pfandsystem meldet
|
|
5
|
+
* (Faelligkeit der 5. des Folgemonats). Nur unter `/v3`, API-Schluessel, nur
|
|
6
|
+
* Betriebe mit der Rolle Abfueller (sonst `filler_role_required`).
|
|
7
|
+
*
|
|
8
|
+
* Die Meldung entsteht aus drei Quellen (`sources`): den Belegen der Kassen,
|
|
9
|
+
* den Rechnungen und den Lieferscheinen, dazu die Zusatzmengen, die das
|
|
10
|
+
* Fremdsystem selbst nachtraegt (Haustrunk, Muster, Spende ...). Der laufende
|
|
11
|
+
* Monat ist vorlaeufig (`provisional`).
|
|
12
|
+
*
|
|
13
|
+
* Mengen sind ganze Stueck. `downloadEwpReport` liefert die CSV fuer den Upload
|
|
14
|
+
* beim Pfandsystem; erst der Abruf eines abgeschlossenen Monats wird als
|
|
15
|
+
* heruntergeladen vermerkt (`downloadedAt`).
|
|
16
|
+
*/
|
|
17
|
+
/** Gruende einer Zusatzmenge, in der Reihenfolge des Backends. */
|
|
18
|
+
export declare const EWP_REASONS: readonly ["own_consumption", "sampling", "donation", "theft", "free_goods", "stocktake", "return", "external_system", "other"];
|
|
19
|
+
export type EwpReason = (typeof EWP_REASONS)[number];
|
|
20
|
+
/** Warnungen der Meldung; welche Angaben eine Warnung traegt, steht an [EwpWarning]. */
|
|
21
|
+
export declare const EWP_WARNING_CODES: readonly ["gtin_not_registered", "foreign_not_reportable", "master_data_missing", "negative_quantity", "invalid_posting"];
|
|
22
|
+
export type EwpWarningCode = (typeof EWP_WARNING_CODES)[number];
|
|
23
|
+
/** Stammdaten einer GTIN fuer die Meldung; fehlende Angaben kommen als leerer Text. */
|
|
24
|
+
export interface EwpMasterData {
|
|
25
|
+
barcodeType: string;
|
|
26
|
+
productOrigin: string;
|
|
27
|
+
depositFee: string;
|
|
28
|
+
producerFee: string;
|
|
29
|
+
ecoImpact: string;
|
|
30
|
+
intBarcodeUsage: string;
|
|
31
|
+
}
|
|
32
|
+
/** Woher die Menge einer Zeile kommt (Stueck): Kasse, Rechnungen, Lieferscheine, Zusatzmengen. */
|
|
33
|
+
export interface EwpLineSources {
|
|
34
|
+
register: number;
|
|
35
|
+
invoices: number;
|
|
36
|
+
deliveryNotes: number;
|
|
37
|
+
extra: number;
|
|
38
|
+
}
|
|
39
|
+
/** Eine Zeile der Meldung: eine registrierte GTIN mit ihren Mengen im Inland und Ausland. */
|
|
40
|
+
export interface EwpLine {
|
|
41
|
+
gtin: string;
|
|
42
|
+
name: string;
|
|
43
|
+
masterData?: EwpMasterData;
|
|
44
|
+
domestic: number;
|
|
45
|
+
foreign: number;
|
|
46
|
+
sources: EwpLineSources;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Eine Warnung zur Meldung; sie sperrt nichts. Welche Angaben dabei stehen:
|
|
50
|
+
* - `gtin_not_registered`: `gtin`, `quantity` (die GTIN ist nicht registriert, ihre Menge steht nicht in `lines`)
|
|
51
|
+
* - `foreign_not_reportable`: `gtin`, `country`, `quantity` (Auslandsmenge, die nicht gemeldet wird: an eine oesterreichische GTIN
|
|
52
|
+
* oder in ein Land ausserhalb des relevanten Auslands; `country` ist `null` bei einer Zusatzmenge ohne Land)
|
|
53
|
+
* - `master_data_missing`: `gtin`, `fields` (die fehlenden Stammdaten)
|
|
54
|
+
* - `negative_quantity`: `gtin`, `column` (`domestic` oder `foreign`), `amount`
|
|
55
|
+
* - `invalid_posting`: `count` (nicht lesbare Posten)
|
|
56
|
+
*/
|
|
57
|
+
export interface EwpWarning {
|
|
58
|
+
code: EwpWarningCode;
|
|
59
|
+
gtin?: string;
|
|
60
|
+
country?: string | null;
|
|
61
|
+
quantity?: number;
|
|
62
|
+
fields?: string[];
|
|
63
|
+
count?: number;
|
|
64
|
+
column?: 'domestic' | 'foreign';
|
|
65
|
+
amount?: number;
|
|
66
|
+
}
|
|
67
|
+
/** Eine Zusatzmenge, wie die Meldung sie fuehrt. */
|
|
68
|
+
export interface EwpExtraQuantity {
|
|
69
|
+
gtin: string;
|
|
70
|
+
domestic: number;
|
|
71
|
+
foreign: number;
|
|
72
|
+
reason: EwpReason;
|
|
73
|
+
text: string | null;
|
|
74
|
+
/** Zeitpunkt des Eintrags (Millisekunden). */
|
|
75
|
+
at: number;
|
|
76
|
+
/** Kennung des Absenders: die uid der Anmeldung im Panel, `'api'` fuer einen API-Schluessel; bei Altbestand `null`. */
|
|
77
|
+
by: string | null;
|
|
78
|
+
}
|
|
79
|
+
/** Eine Zusatzmenge beim Setzen. `text` hoechstens 200 Zeichen. */
|
|
80
|
+
export interface EwpExtraQuantityInput {
|
|
81
|
+
gtin: string;
|
|
82
|
+
domestic: number;
|
|
83
|
+
foreign: number;
|
|
84
|
+
reason: EwpReason;
|
|
85
|
+
text?: string | null;
|
|
86
|
+
}
|
|
87
|
+
/** Die Meldung eines Monats (`getEwpReport`). */
|
|
88
|
+
export interface EwpReport {
|
|
89
|
+
/** Meldemonat `YYYY-MM`. */
|
|
90
|
+
month: string;
|
|
91
|
+
/** Faelligkeit `YYYY-MM-DD` (der 5. des Folgemonats). */
|
|
92
|
+
dueDate: string;
|
|
93
|
+
/** Der Monat laeuft noch. */
|
|
94
|
+
provisional: boolean;
|
|
95
|
+
/** Die Meldung stammt aus der Test-Umgebung (`kr_test_`-Schluessel). */
|
|
96
|
+
test: boolean;
|
|
97
|
+
lines: EwpLine[];
|
|
98
|
+
warnings: EwpWarning[];
|
|
99
|
+
extraQuantities: EwpExtraQuantity[];
|
|
100
|
+
/** Zeitpunkt (Millisekunden) des letzten CSV-Abrufs eines abgeschlossenen Monats, sonst `null`. */
|
|
101
|
+
downloadedAt: number | null;
|
|
102
|
+
}
|
|
103
|
+
/** Die CSV der Meldung (`downloadEwpReport`). */
|
|
104
|
+
export interface EwpReportFile {
|
|
105
|
+
csv: string;
|
|
106
|
+
filename: string;
|
|
107
|
+
contentType: string;
|
|
108
|
+
}
|
|
109
|
+
/** Meldung eines Monats lesen (`getEwpReport`). */
|
|
110
|
+
export declare function getEwpReport(transport: InternerTransport, options: {
|
|
111
|
+
month: string;
|
|
112
|
+
}): Promise<EwpReport>;
|
|
113
|
+
/** CSV der Meldung laden (`getEwpReport` mit `format: 'csv'`). */
|
|
114
|
+
export declare function downloadEwpReport(transport: InternerTransport, options: {
|
|
115
|
+
month: string;
|
|
116
|
+
}): Promise<EwpReportFile>;
|
|
117
|
+
/**
|
|
118
|
+
* Zusatzmengen eines Monats ersetzen (`setEwpExtraQuantities`): die gesendete Liste
|
|
119
|
+
* ist die ganze Liste, eine leere leert sie. Unveraenderte Eintraege behalten
|
|
120
|
+
* `at` und `by`. Antwort ist die neu gerechnete Meldung.
|
|
121
|
+
*/
|
|
122
|
+
export declare function setEwpExtraQuantities(transport: InternerTransport, options: {
|
|
123
|
+
month: string;
|
|
124
|
+
extraQuantities: EwpExtraQuantityInput[];
|
|
125
|
+
}): Promise<EwpReport>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EWP_WARNING_CODES = exports.EWP_REASONS = void 0;
|
|
4
|
+
exports.getEwpReport = getEwpReport;
|
|
5
|
+
exports.downloadEwpReport = downloadEwpReport;
|
|
6
|
+
exports.setEwpExtraQuantities = setEwpExtraQuantities;
|
|
7
|
+
const errors_js_1 = require("./errors.js");
|
|
8
|
+
/**
|
|
9
|
+
* EWP-Meldung (Einwegpfand-Meldung, Pfand Teil 5): die Monatsmeldung der
|
|
10
|
+
* Einweg-Verpackungen je GTIN, die ein Abfuellbetrieb dem Pfandsystem meldet
|
|
11
|
+
* (Faelligkeit der 5. des Folgemonats). Nur unter `/v3`, API-Schluessel, nur
|
|
12
|
+
* Betriebe mit der Rolle Abfueller (sonst `filler_role_required`).
|
|
13
|
+
*
|
|
14
|
+
* Die Meldung entsteht aus drei Quellen (`sources`): den Belegen der Kassen,
|
|
15
|
+
* den Rechnungen und den Lieferscheinen, dazu die Zusatzmengen, die das
|
|
16
|
+
* Fremdsystem selbst nachtraegt (Haustrunk, Muster, Spende ...). Der laufende
|
|
17
|
+
* Monat ist vorlaeufig (`provisional`).
|
|
18
|
+
*
|
|
19
|
+
* Mengen sind ganze Stueck. `downloadEwpReport` liefert die CSV fuer den Upload
|
|
20
|
+
* beim Pfandsystem; erst der Abruf eines abgeschlossenen Monats wird als
|
|
21
|
+
* heruntergeladen vermerkt (`downloadedAt`).
|
|
22
|
+
*/
|
|
23
|
+
/** Gruende einer Zusatzmenge, in der Reihenfolge des Backends. */
|
|
24
|
+
exports.EWP_REASONS = Object.freeze([
|
|
25
|
+
'own_consumption',
|
|
26
|
+
'sampling',
|
|
27
|
+
'donation',
|
|
28
|
+
'theft',
|
|
29
|
+
'free_goods',
|
|
30
|
+
'stocktake',
|
|
31
|
+
'return',
|
|
32
|
+
'external_system',
|
|
33
|
+
'other',
|
|
34
|
+
]);
|
|
35
|
+
/** Warnungen der Meldung; welche Angaben eine Warnung traegt, steht an [EwpWarning]. */
|
|
36
|
+
exports.EWP_WARNING_CODES = Object.freeze([
|
|
37
|
+
'gtin_not_registered',
|
|
38
|
+
'foreign_not_reportable',
|
|
39
|
+
'master_data_missing',
|
|
40
|
+
'negative_quantity',
|
|
41
|
+
'invalid_posting',
|
|
42
|
+
]);
|
|
43
|
+
/** Meldung eines Monats lesen (`getEwpReport`). */
|
|
44
|
+
async function getEwpReport(transport, options) {
|
|
45
|
+
const month = monat('getEwpReport', options);
|
|
46
|
+
return meldung('getEwpReport', await transport('getEwpReport', { month }));
|
|
47
|
+
}
|
|
48
|
+
/** CSV der Meldung laden (`getEwpReport` mit `format: 'csv'`). */
|
|
49
|
+
async function downloadEwpReport(transport, options) {
|
|
50
|
+
const month = monat('downloadEwpReport', options);
|
|
51
|
+
const daten = await transport('getEwpReport', { month, format: 'csv' });
|
|
52
|
+
if (!istObjekt(daten))
|
|
53
|
+
throw antwortfehler('downloadEwpReport', 'Antwort ist kein Objekt');
|
|
54
|
+
const { csv, filename, contentType } = daten;
|
|
55
|
+
if (typeof csv !== 'string' || typeof filename !== 'string' || typeof contentType !== 'string') {
|
|
56
|
+
throw antwortfehler('downloadEwpReport', 'Antwort ohne csv, filename und contentType');
|
|
57
|
+
}
|
|
58
|
+
return { csv, filename, contentType };
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Zusatzmengen eines Monats ersetzen (`setEwpExtraQuantities`): die gesendete Liste
|
|
62
|
+
* ist die ganze Liste, eine leere leert sie. Unveraenderte Eintraege behalten
|
|
63
|
+
* `at` und `by`. Antwort ist die neu gerechnete Meldung.
|
|
64
|
+
*/
|
|
65
|
+
async function setEwpExtraQuantities(transport, options) {
|
|
66
|
+
const month = monat('setEwpExtraQuantities', options);
|
|
67
|
+
if (!Array.isArray(options.extraQuantities)) {
|
|
68
|
+
throw new errors_js_1.KasseneckValidationError('setEwpExtraQuantities', 'extraQuantities muss eine Liste sein', 'request');
|
|
69
|
+
}
|
|
70
|
+
return meldung('setEwpExtraQuantities', await transport('setEwpExtraQuantities', { month, extraQuantities: options.extraQuantities }));
|
|
71
|
+
}
|
|
72
|
+
function monat(aufruf, options) {
|
|
73
|
+
const month = options?.month;
|
|
74
|
+
if (typeof month !== 'string' || month === '')
|
|
75
|
+
throw new errors_js_1.KasseneckValidationError(aufruf, 'month fehlt (Monat als JJJJ-MM)', 'request');
|
|
76
|
+
return month;
|
|
77
|
+
}
|
|
78
|
+
function istObjekt(wert) {
|
|
79
|
+
return wert !== null && typeof wert === 'object' && !Array.isArray(wert);
|
|
80
|
+
}
|
|
81
|
+
function antwortfehler(aufruf, grund) {
|
|
82
|
+
return new errors_js_1.KasseneckValidationError(aufruf, grund, 'response');
|
|
83
|
+
}
|
|
84
|
+
/** Prueft die Form, die der Aufrufer braucht, und reicht die Antwort sonst unveraendert durch. */
|
|
85
|
+
function meldung(aufruf, daten) {
|
|
86
|
+
if (!istObjekt(daten))
|
|
87
|
+
throw antwortfehler(aufruf, 'Antwort ist kein Objekt');
|
|
88
|
+
if (typeof daten['month'] !== 'string')
|
|
89
|
+
throw antwortfehler(aufruf, 'Antwort ohne month');
|
|
90
|
+
for (const feld of ['lines', 'warnings', 'extraQuantities']) {
|
|
91
|
+
if (!Array.isArray(daten[feld]))
|
|
92
|
+
throw antwortfehler(aufruf, `Antwort ohne Liste ${feld}`);
|
|
93
|
+
}
|
|
94
|
+
return daten;
|
|
95
|
+
}
|
|
@@ -7,6 +7,7 @@ export { listMyCashregisters } from './cashregisters.js';
|
|
|
7
7
|
export { listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, listedReceiptWithCompany, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, type ListReceiptsErrorCode, type ListReceiptsView, type ListReceiptsOrder, type ListReceiptsOptions, type ListReceiptsWindow, type ListReceiptsGrossByRate, type ListReceiptsSummary, type ListReceiptsDaySummary, type ListReceiptsPage, type ListedReceipt, type ListedFullReceipt, type ListReceiptsHeader, } from './list-receipts.js';
|
|
8
8
|
export { createDepExport, getDepExport, waitForDepExport, getDepExportFile, createDepHandoverLink, revokeDepHandoverLink, DepExportTimeoutError, DepExportChecksumError, DEP_EXPORT_STATUSES, DEP_EXPORT_FILES, DEP_EXPORT_ERROR_CODES, DEP_EXPORT_FAILURES, DEP_EXPORT_POLL_START_MS, DEP_EXPORT_POLL_FACTOR, DEP_EXPORT_POLL_MAX_MS, DEP_EXPORT_WAIT_TIMEOUT_MS, DEP_EXPORT_DOWNLOAD_TIMEOUT_MS, type DepExportStatus, type DepExportFileKind, type DepExportErrorCode, type DepExportFailure, type CreateDepExportOptions, type CreateDepExportResult, type DepExportGap, type DepExportChainBreak, type DepExportFindings, type DepExportItems, type DepHandoverLinkInfo, type DepExport, type WaitForDepExportOptions, type GetDepExportFileOptions, type DepExportFile, type DepHandoverLink, type RevokedDepHandoverLink, } from './dep-export.js';
|
|
9
9
|
export { registerTerminalDevice, getTerminalAccess, claimTerminal, requestTerminalCode, getTerminalCode, reportTerminalLogin, reportTerminalReady, TERMINAL_PLATFORMS, TERMINAL_SETUP_STATES, TERMINAL_CODE_STATUSES, TERMINAL_CODE_SOURCES, TERMINAL_ERROR_CODES, TERMINAL_LABEL_MAX, TERMINAL_APP_MAX, TERMINAL_REQUESTED_BY_MAX, type TerminalPlatform, type TerminalSetupState, type TerminalCodeStatus, type TerminalCodeSource, type TerminalErrorCode, type TerminalDeviceCredentials, type RegisterTerminalDeviceOptions, type RegisteredTerminalDevice, type GetTerminalAccessOptions, type ClaimTerminalOptions, type RequestTerminalCodeOptions, type ReportTerminalLoginOptions, type TerminalSetup, type TerminalCodeFormat, type TerminalAccess, type TerminalListEntry, type TerminalAccessUnavailable, type TerminalAccessResult, type TerminalCodeRequest, type TerminalCode, } from './terminal.js';
|
|
10
|
+
export { EWP_REASONS, EWP_WARNING_CODES, type EwpReason, type EwpWarningCode, type EwpMasterData, type EwpLineSources, type EwpLine, type EwpWarning, type EwpExtraQuantity, type EwpExtraQuantityInput, type EwpReport, type EwpReportFile, } from './ewp.js';
|
|
10
11
|
export { downloadDailyReport, downloadMonthlyReport, getCashregisterReport, getReportV2, type CashregisterReportPeriod, type ReportV2, type ReportV2Metadata, type ReportV2Options } from './reports.js';
|
|
11
12
|
export { type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, } from './status.js';
|
|
12
13
|
export { type KasseneckApi, createKasseneckApi } from './api.js';
|