@cairnkithq/facturkite-cli 0.0.0-stage → 1.0.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/README.md CHANGED
@@ -1,3 +1,62 @@
1
- # Temporary Holding Version
1
+ # @cairnkithq/facturkite-cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Deterministic EN 16931, XRechnung 3.0, ZUGFeRD, Factur-X, and Peppol BIS 3.0 e-invoice validator and converter CLI by CairnKit.
4
+
5
+ ## Quick Start
6
+
7
+ Run directly with `npx` (Node.js 20 or newer):
8
+
9
+ ```bash
10
+ npx @cairnkithq/facturkite-cli validate invoice.xml
11
+ ```
12
+
13
+ Or install globally:
14
+
15
+ ```bash
16
+ npm install -g @cairnkithq/facturkite-cli
17
+ facturkite --help
18
+ ```
19
+
20
+ ## Commands
21
+
22
+ ### Validate an e-invoice (XML or hybrid PDF)
23
+
24
+ ```bash
25
+ facturkite validate invoice.xml
26
+ facturkite validate invoice.xml --profile xrechnung --format json
27
+ facturkite validate invoice.xml --format sarif
28
+ facturkite validate invoice.pdf --profile facturx
29
+ ```
30
+
31
+ Supported `--profile` values:
32
+
33
+ - `xrechnung` (auto-selects `xrechnung-ubl` or `xrechnung-cii`)
34
+ - `xrechnung-ubl`
35
+ - `xrechnung-cii`
36
+ - `facturx` / `facturx-en16931`
37
+ - `zugferd-en16931`
38
+ - `peppol` / `peppol-bis3`
39
+
40
+ Supported `--format` values: `text` (default), `json`, `sarif` (SARIF 2.1.0 for CI code scanning).
41
+
42
+ Exit code is `0` when no `ERROR`-severity findings are reported, and `1` when validation fails or input cannot be processed.
43
+
44
+ ### Convert an invoice (XML, JSON, or CSV)
45
+
46
+ ```bash
47
+ facturkite convert invoice.xml --to facturx-pdf --out invoice-facturx.pdf
48
+ facturkite convert invoice.csv --to xrechnung-ubl --out invoice-xrechnung.xml
49
+ facturkite convert invoice.json --to xrechnung-cii --out invoice-cii.xml
50
+ facturkite convert invoice.xml --to peppol-ubl --out invoice-peppol.xml
51
+ ```
52
+
53
+ Supported `--to` formats: `xrechnung-ubl`, `xrechnung-cii`, `facturx-cii`, `facturx-pdf`, `peppol-ubl`.
54
+
55
+ ## Support and Links
56
+
57
+ - Website: https://facturkite.cairnkithq.com/
58
+ - Support: support@cairnkithq.com
59
+
60
+ ## Disclaimer
61
+
62
+ FacturKite performs deterministic invoice rule and data checks. This is not legal or tax advice.
package/dist/bin.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/bin.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/bin.ts
4
+ import { runCli } from "./index.js";
5
+ process.exitCode = await runCli(process.argv.slice(2));
@@ -0,0 +1,73 @@
1
+ export type CliSupportedProfile = "xrechnung-ubl" | "xrechnung-cii" | "facturx-en16931" | "zugferd-en16931" | "peppol-bis3";
2
+ export interface CliValidationFinding {
3
+ ruleId: string;
4
+ severity: "ERROR" | "WARNING";
5
+ btBg: string;
6
+ field: string;
7
+ title: string;
8
+ message: string;
9
+ fixHint: string;
10
+ actual: string | number | boolean | null;
11
+ expected: string | number | boolean | null;
12
+ }
13
+ export interface CliValidationReport {
14
+ profile: CliSupportedProfile;
15
+ valid: boolean;
16
+ errorCount: number;
17
+ warningCount: number;
18
+ evaluatedRuleCount: number;
19
+ findings: CliValidationFinding[];
20
+ disclaimer: string;
21
+ }
22
+ export interface CliOutput {
23
+ stdout(text: string): void;
24
+ stderr(text: string): void;
25
+ }
26
+ export declare function reportToSarif(report: CliValidationReport, path: string): {
27
+ $schema: string;
28
+ version: string;
29
+ runs: {
30
+ tool: {
31
+ driver: {
32
+ name: string;
33
+ rules: {
34
+ id: string;
35
+ shortDescription: {
36
+ text: string;
37
+ };
38
+ help: {
39
+ text: string;
40
+ };
41
+ }[];
42
+ };
43
+ };
44
+ results: {
45
+ ruleId: string;
46
+ level: string;
47
+ message: {
48
+ text: string;
49
+ };
50
+ locations: {
51
+ physicalLocation: {
52
+ artifactLocation: {
53
+ uri: string;
54
+ };
55
+ };
56
+ logicalLocations: {
57
+ fullyQualifiedName: string;
58
+ kind: string;
59
+ }[];
60
+ }[];
61
+ properties: {
62
+ btBg: string;
63
+ expected: string | number | boolean | null;
64
+ actual: string | number | boolean | null;
65
+ };
66
+ }[];
67
+ properties: {
68
+ profile: CliSupportedProfile;
69
+ disclaimer: string;
70
+ };
71
+ }[];
72
+ };
73
+ export declare function runCli(args: string[], output?: CliOutput): Promise<number>;