@kreiseck/kasseneck-api 0.14.0 → 0.16.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +75 -0
  3. package/dist/cjs/client/aufrufe.d.ts +1 -1
  4. package/dist/cjs/client/aufrufe.js +12 -0
  5. package/dist/cjs/rechnung/api.d.ts +45 -0
  6. package/dist/cjs/rechnung/api.js +36 -0
  7. package/dist/cjs/rechnung/auth.d.ts +21 -0
  8. package/dist/cjs/rechnung/auth.js +36 -0
  9. package/dist/cjs/rechnung/endpunkte.d.ts +54 -0
  10. package/dist/cjs/rechnung/endpunkte.js +147 -0
  11. package/dist/cjs/rechnung/fehler.d.ts +21 -0
  12. package/dist/cjs/rechnung/fehler.js +44 -0
  13. package/dist/cjs/rechnung/index.d.ts +18 -0
  14. package/dist/cjs/rechnung/index.js +54 -0
  15. package/dist/cjs/rechnung/typen.d.ts +238 -0
  16. package/dist/cjs/rechnung/typen.js +9 -0
  17. package/dist/cjs/rechnung/vertrag.d.ts +113 -0
  18. package/dist/cjs/rechnung/vertrag.js +218 -0
  19. package/dist/esm/client/aufrufe.d.ts +1 -1
  20. package/dist/esm/client/aufrufe.js +12 -0
  21. package/dist/esm/rechnung/api.d.ts +45 -0
  22. package/dist/esm/rechnung/api.js +33 -0
  23. package/dist/esm/rechnung/auth.d.ts +21 -0
  24. package/dist/esm/rechnung/auth.js +33 -0
  25. package/dist/esm/rechnung/endpunkte.d.ts +54 -0
  26. package/dist/esm/rechnung/endpunkte.js +133 -0
  27. package/dist/esm/rechnung/fehler.d.ts +21 -0
  28. package/dist/esm/rechnung/fehler.js +39 -0
  29. package/dist/esm/rechnung/index.d.ts +18 -0
  30. package/dist/esm/rechnung/index.js +17 -0
  31. package/dist/esm/rechnung/typen.d.ts +238 -0
  32. package/dist/esm/rechnung/typen.js +8 -0
  33. package/dist/esm/rechnung/vertrag.d.ts +113 -0
  34. package/dist/esm/rechnung/vertrag.js +215 -0
  35. package/fixtures/hobex-hps-codes.json +1 -1
  36. package/fixtures/kasse-texte.json +1 -1
  37. package/fixtures/oberflaeche.json +101 -1
  38. package/fixtures/rechnung-api-beispiele/credit-fehler-grund.json +24 -0
  39. package/fixtures/rechnung-api-beispiele/credit-ok.json +20 -0
  40. package/fixtures/rechnung-api-beispiele/customer-fehler-uid.json +25 -0
  41. package/fixtures/rechnung-api-beispiele/customer-get-fehler-beide.json +15 -0
  42. package/fixtures/rechnung-api-beispiele/customer-ok.json +20 -0
  43. package/fixtures/rechnung-api-beispiele/customer-search-fehler-leer.json +14 -0
  44. package/fixtures/rechnung-api-beispiele/issue-brutto-20.json +27 -0
  45. package/fixtures/rechnung-api-beispiele/issue-fehler-cent.json +26 -0
  46. package/fixtures/rechnung-api-beispiele/issue-fehler-menge.json +26 -0
  47. package/fixtures/rechnung-api-beispiele/issue-fehler-negativ.json +26 -0
  48. package/fixtures/rechnung-api-beispiele/issue-fehler-satz.json +26 -0
  49. package/fixtures/rechnung-api-beispiele/issue-fehler-unbekannt.json +27 -0
  50. package/fixtures/rechnung-api-beispiele/issue-gemischt.json +33 -0
  51. package/fixtures/rechnung-api-beispiele/issue-kleinunternehmer.json +27 -0
  52. package/fixtures/rechnung-api-beispiele/issue-netto-20.json +28 -0
  53. package/fixtures/rechnung-api-beispiele/issue-rabatt.json +28 -0
  54. package/fixtures/rechnung-api-beispiele/setup-status-fehler-feld.json +14 -0
  55. package/fixtures/rechnung-api-beispiele/setup-status-ok.json +8 -0
  56. package/fixtures/rechnung-api.schema.json +681 -0
  57. package/package.json +12 -1
@@ -0,0 +1,681 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Kasseneck Rechnungs-API",
4
+ "version": 1,
5
+ "paket": "0.16.0",
6
+ "aufrufe": {
7
+ "createCustomer": {
8
+ "anfrage": {
9
+ "type": "object",
10
+ "properties": {
11
+ "customer": {
12
+ "type": "object",
13
+ "properties": {
14
+ "type": {
15
+ "enum": [
16
+ "private",
17
+ "company"
18
+ ]
19
+ },
20
+ "name": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "maxLength": 200
24
+ },
25
+ "legalForm": {
26
+ "type": "string",
27
+ "maxLength": 40
28
+ },
29
+ "email": {
30
+ "type": "string",
31
+ "maxLength": 254,
32
+ "format": "email"
33
+ },
34
+ "phone": {
35
+ "type": "string",
36
+ "maxLength": 40,
37
+ "format": "phone"
38
+ },
39
+ "street": {
40
+ "type": "string",
41
+ "maxLength": 200
42
+ },
43
+ "houseNumber": {
44
+ "type": "string",
45
+ "maxLength": 20
46
+ },
47
+ "zip": {
48
+ "type": "string",
49
+ "maxLength": 10
50
+ },
51
+ "city": {
52
+ "type": "string",
53
+ "maxLength": 100
54
+ },
55
+ "country": {
56
+ "type": "string",
57
+ "minLength": 2,
58
+ "maxLength": 2,
59
+ "format": "country"
60
+ },
61
+ "vatId": {
62
+ "type": "string",
63
+ "maxLength": 20,
64
+ "format": "vatId"
65
+ },
66
+ "shortCode": {
67
+ "type": "string",
68
+ "maxLength": 8,
69
+ "format": "shortCode"
70
+ },
71
+ "isAuthority": {
72
+ "type": "boolean"
73
+ },
74
+ "note": {
75
+ "type": "string",
76
+ "maxLength": 1000
77
+ },
78
+ "externalId": {
79
+ "type": "string",
80
+ "minLength": 1,
81
+ "maxLength": 120
82
+ }
83
+ },
84
+ "required": [
85
+ "type",
86
+ "name",
87
+ "country"
88
+ ],
89
+ "additionalProperties": false
90
+ },
91
+ "idempotencyKey": {
92
+ "type": "string",
93
+ "minLength": 1,
94
+ "maxLength": 120
95
+ }
96
+ },
97
+ "required": [
98
+ "customer"
99
+ ],
100
+ "additionalProperties": false
101
+ }
102
+ },
103
+ "getCustomer": {
104
+ "anfrage": {
105
+ "type": "object",
106
+ "properties": {
107
+ "customerId": {
108
+ "type": "string",
109
+ "minLength": 1,
110
+ "maxLength": 128
111
+ },
112
+ "externalId": {
113
+ "type": "string",
114
+ "minLength": 1,
115
+ "maxLength": 120
116
+ }
117
+ },
118
+ "additionalProperties": false
119
+ },
120
+ "genauEins": [
121
+ [
122
+ "customerId",
123
+ "externalId"
124
+ ]
125
+ ]
126
+ },
127
+ "updateCustomer": {
128
+ "anfrage": {
129
+ "type": "object",
130
+ "properties": {
131
+ "customerId": {
132
+ "type": "string",
133
+ "minLength": 1,
134
+ "maxLength": 128
135
+ },
136
+ "customer": {
137
+ "type": "object",
138
+ "properties": {
139
+ "type": {
140
+ "enum": [
141
+ "private",
142
+ "company"
143
+ ]
144
+ },
145
+ "name": {
146
+ "type": "string",
147
+ "minLength": 1,
148
+ "maxLength": 200
149
+ },
150
+ "legalForm": {
151
+ "type": "string",
152
+ "maxLength": 40
153
+ },
154
+ "email": {
155
+ "type": "string",
156
+ "maxLength": 254,
157
+ "format": "email"
158
+ },
159
+ "phone": {
160
+ "type": "string",
161
+ "maxLength": 40,
162
+ "format": "phone"
163
+ },
164
+ "street": {
165
+ "type": "string",
166
+ "maxLength": 200
167
+ },
168
+ "houseNumber": {
169
+ "type": "string",
170
+ "maxLength": 20
171
+ },
172
+ "zip": {
173
+ "type": "string",
174
+ "maxLength": 10
175
+ },
176
+ "city": {
177
+ "type": "string",
178
+ "maxLength": 100
179
+ },
180
+ "country": {
181
+ "type": "string",
182
+ "minLength": 2,
183
+ "maxLength": 2,
184
+ "format": "country"
185
+ },
186
+ "vatId": {
187
+ "type": "string",
188
+ "maxLength": 20,
189
+ "format": "vatId"
190
+ },
191
+ "shortCode": {
192
+ "type": "string",
193
+ "maxLength": 8,
194
+ "format": "shortCode"
195
+ },
196
+ "isAuthority": {
197
+ "type": "boolean"
198
+ },
199
+ "note": {
200
+ "type": "string",
201
+ "maxLength": 1000
202
+ },
203
+ "externalId": {
204
+ "type": "string",
205
+ "minLength": 1,
206
+ "maxLength": 120
207
+ }
208
+ },
209
+ "additionalProperties": false
210
+ }
211
+ },
212
+ "required": [
213
+ "customerId",
214
+ "customer"
215
+ ],
216
+ "additionalProperties": false
217
+ }
218
+ },
219
+ "searchCustomers": {
220
+ "anfrage": {
221
+ "type": "object",
222
+ "properties": {
223
+ "externalId": {
224
+ "type": "string",
225
+ "minLength": 1,
226
+ "maxLength": 120
227
+ },
228
+ "vatId": {
229
+ "type": "string",
230
+ "maxLength": 20
231
+ },
232
+ "email": {
233
+ "type": "string",
234
+ "maxLength": 254
235
+ },
236
+ "name": {
237
+ "type": "string",
238
+ "maxLength": 200
239
+ },
240
+ "limit": {
241
+ "type": "integer",
242
+ "minimum": 1,
243
+ "maximum": 100
244
+ },
245
+ "cursor": {
246
+ "type": "string",
247
+ "minLength": 1,
248
+ "maxLength": 500
249
+ }
250
+ },
251
+ "additionalProperties": false
252
+ },
253
+ "mindestensEins": [
254
+ [
255
+ "externalId",
256
+ "vatId",
257
+ "email",
258
+ "name"
259
+ ]
260
+ ]
261
+ },
262
+ "issueInvoice": {
263
+ "anfrage": {
264
+ "type": "object",
265
+ "properties": {
266
+ "idempotencyKey": {
267
+ "type": "string",
268
+ "minLength": 1,
269
+ "maxLength": 120
270
+ },
271
+ "customerId": {
272
+ "type": "string",
273
+ "minLength": 1,
274
+ "maxLength": 128
275
+ },
276
+ "taxScheme": {
277
+ "enum": [
278
+ "normal",
279
+ "smallBusiness",
280
+ "reverseCharge",
281
+ "igLieferung",
282
+ "exportThirdCountry"
283
+ ]
284
+ },
285
+ "priceMode": {
286
+ "enum": [
287
+ "net",
288
+ "gross"
289
+ ]
290
+ },
291
+ "serviceStart": {
292
+ "type": "string",
293
+ "minLength": 10,
294
+ "maxLength": 10,
295
+ "format": "date"
296
+ },
297
+ "serviceEnd": {
298
+ "type": "string",
299
+ "minLength": 10,
300
+ "maxLength": 10,
301
+ "format": "date"
302
+ },
303
+ "paymentTermDays": {
304
+ "type": "integer",
305
+ "minimum": 0,
306
+ "maximum": 365
307
+ },
308
+ "orderReference": {
309
+ "type": "string",
310
+ "maxLength": 200
311
+ },
312
+ "intro": {
313
+ "type": "string",
314
+ "maxLength": 2000
315
+ },
316
+ "note": {
317
+ "type": "string",
318
+ "maxLength": 2000
319
+ },
320
+ "paymentReference": {
321
+ "type": "string",
322
+ "maxLength": 140
323
+ },
324
+ "girocode": {
325
+ "type": "boolean"
326
+ },
327
+ "tracking": {
328
+ "type": "boolean"
329
+ },
330
+ "items": {
331
+ "type": "array",
332
+ "minItems": 1,
333
+ "maxItems": 500,
334
+ "items": {
335
+ "type": "object",
336
+ "properties": {
337
+ "description": {
338
+ "type": "string",
339
+ "minLength": 1,
340
+ "maxLength": 300
341
+ },
342
+ "subtitle": {
343
+ "type": "string",
344
+ "maxLength": 1000
345
+ },
346
+ "quantity": {
347
+ "type": "number",
348
+ "exclusiveMinimum": 0,
349
+ "maximum": 1000000,
350
+ "x-decimals": 3
351
+ },
352
+ "unit": {
353
+ "type": "string",
354
+ "maxLength": 20
355
+ },
356
+ "unitPriceCents": {
357
+ "type": "integer",
358
+ "minimum": 0,
359
+ "maximum": 100000000
360
+ },
361
+ "vatRate": {
362
+ "enum": [
363
+ 0,
364
+ 10,
365
+ 13,
366
+ 20
367
+ ]
368
+ },
369
+ "discountPct": {
370
+ "type": "number",
371
+ "minimum": 0,
372
+ "maximum": 100,
373
+ "x-decimals": 2
374
+ }
375
+ },
376
+ "required": [
377
+ "description",
378
+ "quantity",
379
+ "unitPriceCents",
380
+ "vatRate"
381
+ ],
382
+ "additionalProperties": false
383
+ }
384
+ },
385
+ "metadata": {
386
+ "type": "object",
387
+ "maxProperties": 20,
388
+ "propertyNames": {
389
+ "pattern": "^[a-zA-Z0-9_]{1,40}$"
390
+ },
391
+ "additionalProperties": {
392
+ "type": "string",
393
+ "maxLength": 500
394
+ }
395
+ }
396
+ },
397
+ "required": [
398
+ "idempotencyKey",
399
+ "taxScheme",
400
+ "priceMode",
401
+ "serviceStart",
402
+ "items"
403
+ ],
404
+ "additionalProperties": false
405
+ }
406
+ },
407
+ "cancelInvoice": {
408
+ "anfrage": {
409
+ "type": "object",
410
+ "properties": {
411
+ "idempotencyKey": {
412
+ "type": "string",
413
+ "minLength": 1,
414
+ "maxLength": 120
415
+ },
416
+ "invoiceId": {
417
+ "type": "string",
418
+ "minLength": 1,
419
+ "maxLength": 128
420
+ },
421
+ "reason": {
422
+ "enum": [
423
+ "cancellation",
424
+ "price_reduction",
425
+ "return",
426
+ "incorrect_invoice",
427
+ "other"
428
+ ]
429
+ },
430
+ "note": {
431
+ "type": "string",
432
+ "maxLength": 2000
433
+ }
434
+ },
435
+ "required": [
436
+ "idempotencyKey",
437
+ "invoiceId",
438
+ "reason"
439
+ ],
440
+ "additionalProperties": false
441
+ }
442
+ },
443
+ "createCreditNote": {
444
+ "anfrage": {
445
+ "type": "object",
446
+ "properties": {
447
+ "idempotencyKey": {
448
+ "type": "string",
449
+ "minLength": 1,
450
+ "maxLength": 120
451
+ },
452
+ "invoiceId": {
453
+ "type": "string",
454
+ "minLength": 1,
455
+ "maxLength": 128
456
+ },
457
+ "reason": {
458
+ "enum": [
459
+ "cancellation",
460
+ "price_reduction",
461
+ "return",
462
+ "incorrect_invoice",
463
+ "other"
464
+ ]
465
+ },
466
+ "note": {
467
+ "type": "string",
468
+ "maxLength": 2000
469
+ },
470
+ "items": {
471
+ "type": "array",
472
+ "minItems": 1,
473
+ "maxItems": 500,
474
+ "items": {
475
+ "type": "object",
476
+ "properties": {
477
+ "description": {
478
+ "type": "string",
479
+ "minLength": 1,
480
+ "maxLength": 300
481
+ },
482
+ "subtitle": {
483
+ "type": "string",
484
+ "maxLength": 1000
485
+ },
486
+ "quantity": {
487
+ "type": "number",
488
+ "exclusiveMinimum": 0,
489
+ "maximum": 1000000,
490
+ "x-decimals": 3
491
+ },
492
+ "unit": {
493
+ "type": "string",
494
+ "maxLength": 20
495
+ },
496
+ "unitPriceCents": {
497
+ "type": "integer",
498
+ "minimum": 0,
499
+ "maximum": 100000000
500
+ },
501
+ "vatRate": {
502
+ "enum": [
503
+ 0,
504
+ 10,
505
+ 13,
506
+ 20
507
+ ]
508
+ },
509
+ "discountPct": {
510
+ "type": "number",
511
+ "minimum": 0,
512
+ "maximum": 100,
513
+ "x-decimals": 2
514
+ }
515
+ },
516
+ "required": [
517
+ "description",
518
+ "quantity",
519
+ "unitPriceCents",
520
+ "vatRate"
521
+ ],
522
+ "additionalProperties": false
523
+ }
524
+ }
525
+ },
526
+ "required": [
527
+ "idempotencyKey",
528
+ "invoiceId",
529
+ "reason",
530
+ "items"
531
+ ],
532
+ "additionalProperties": false
533
+ }
534
+ },
535
+ "getInvoice": {
536
+ "anfrage": {
537
+ "type": "object",
538
+ "properties": {
539
+ "invoiceId": {
540
+ "type": "string",
541
+ "minLength": 1,
542
+ "maxLength": 128
543
+ },
544
+ "number": {
545
+ "type": "string",
546
+ "minLength": 1,
547
+ "maxLength": 100
548
+ }
549
+ },
550
+ "additionalProperties": false
551
+ },
552
+ "genauEins": [
553
+ [
554
+ "invoiceId",
555
+ "number"
556
+ ]
557
+ ]
558
+ },
559
+ "listInvoices": {
560
+ "anfrage": {
561
+ "type": "object",
562
+ "properties": {
563
+ "from": {
564
+ "type": "string",
565
+ "minLength": 10,
566
+ "maxLength": 10,
567
+ "format": "date"
568
+ },
569
+ "to": {
570
+ "type": "string",
571
+ "minLength": 10,
572
+ "maxLength": 10,
573
+ "format": "date"
574
+ },
575
+ "status": {
576
+ "enum": [
577
+ "final",
578
+ "paid",
579
+ "cancelled",
580
+ "open",
581
+ "overdue"
582
+ ]
583
+ },
584
+ "docType": {
585
+ "enum": [
586
+ "RE",
587
+ "GU"
588
+ ]
589
+ },
590
+ "customerId": {
591
+ "type": "string",
592
+ "minLength": 1,
593
+ "maxLength": 128
594
+ },
595
+ "limit": {
596
+ "type": "integer",
597
+ "minimum": 1,
598
+ "maximum": 100
599
+ },
600
+ "cursor": {
601
+ "type": "string",
602
+ "minLength": 1,
603
+ "maxLength": 500
604
+ }
605
+ },
606
+ "additionalProperties": false
607
+ }
608
+ },
609
+ "getInvoicePdf": {
610
+ "anfrage": {
611
+ "type": "object",
612
+ "properties": {
613
+ "invoiceId": {
614
+ "type": "string",
615
+ "minLength": 1,
616
+ "maxLength": 128
617
+ }
618
+ },
619
+ "required": [
620
+ "invoiceId"
621
+ ],
622
+ "additionalProperties": false
623
+ }
624
+ },
625
+ "getInvoiceXml": {
626
+ "anfrage": {
627
+ "type": "object",
628
+ "properties": {
629
+ "invoiceId": {
630
+ "type": "string",
631
+ "minLength": 1,
632
+ "maxLength": 128
633
+ },
634
+ "format": {
635
+ "enum": [
636
+ "ubl",
637
+ "cii"
638
+ ]
639
+ }
640
+ },
641
+ "required": [
642
+ "invoiceId"
643
+ ],
644
+ "additionalProperties": false
645
+ }
646
+ },
647
+ "getInvoiceSetupStatus": {
648
+ "anfrage": {
649
+ "type": "object",
650
+ "properties": {},
651
+ "additionalProperties": false
652
+ }
653
+ }
654
+ },
655
+ "codes": [
656
+ "validation",
657
+ "idempotency_conflict",
658
+ "module_inactive",
659
+ "customer_not_found",
660
+ "customer_exists",
661
+ "short_code_taken",
662
+ "short_code_immutable",
663
+ "recipient_required",
664
+ "invoice_requirements_missing",
665
+ "invoice_not_found",
666
+ "invoice_ambiguous",
667
+ "not_cancellable",
668
+ "partial_credit_exists",
669
+ "credit_exceeds_invoice",
670
+ "einvoice_incomplete",
671
+ "invoice_api_not_enabled",
672
+ "invoice_setup_incomplete"
673
+ ],
674
+ "gruende": [
675
+ "cancellation",
676
+ "price_reduction",
677
+ "return",
678
+ "incorrect_invoice",
679
+ "other"
680
+ ]
681
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kreiseck/kasseneck-api",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "RKSV-Registrierkasse fuer JavaScript und TypeScript: signierte Belege, Storno, Kartenzahlung, Bondruck. Austrian fiscal cash register (RKSV) API client.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Kreiseck",
@@ -119,6 +119,16 @@
119
119
  "default": "./dist/cjs/partner/index.js"
120
120
  }
121
121
  },
122
+ "./rechnung": {
123
+ "import": {
124
+ "types": "./dist/esm/rechnung/index.d.ts",
125
+ "default": "./dist/esm/rechnung/index.js"
126
+ },
127
+ "require": {
128
+ "types": "./dist/cjs/rechnung/index.d.ts",
129
+ "default": "./dist/cjs/rechnung/index.js"
130
+ }
131
+ },
122
132
  "./fixtures/*": "./fixtures/*"
123
133
  },
124
134
  "files": [
@@ -144,6 +154,7 @@
144
154
  "fixtures:erneuern": "npm run build && node scripts/belege-fixtures.mjs",
145
155
  "fixtures:kasse": "npm run build && node scripts/kasse-settings-fixture.mjs",
146
156
  "fixtures:oberflaeche": "npm run build && node scripts/oberflaeche.mjs",
157
+ "fixtures:rechnung": "npm run build && node scripts/rechnung-vertrag.mjs",
147
158
  "fixtures:hobex-hps-codes": "npm run build && node scripts/hobex-hps-codes.mjs",
148
159
  "fixtures:texte": "npm run build && node scripts/texte.mjs"
149
160
  },