evatr-api 0.1.1

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.
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Types and interfaces for the eVatR API
3
+ */
4
+ /**
5
+ * Request interface for VAT-ID validation
6
+ */
7
+ export interface ApiRequest {
8
+ /** The requesting German VAT-ID */
9
+ anfragendeUstid: string;
10
+ /** The VAT-ID to be validated */
11
+ angefragteUstid: string;
12
+ /** Company name (optional, required for qualified validation) */
13
+ firmenname?: string;
14
+ /** City (optional, required for qualified validation) */
15
+ ort?: string;
16
+ /** Street address (optional) */
17
+ strasse?: string;
18
+ /** Postal code (optional) */
19
+ plz?: string;
20
+ }
21
+ /**
22
+ * Response interface for VAT-ID validation
23
+ */
24
+ export interface ApiResponse {
25
+ /** Timestamp of the query */
26
+ anfrageZeitpunkt: string;
27
+ /** Status code (e.g., "evatr-0000") */
28
+ status: string;
29
+ /** Valid from date (if applicable) */
30
+ gueltigAb?: string;
31
+ /** Valid until date (if applicable) */
32
+ gueltigBis?: string;
33
+ /** Company name validation result (A/B/C/D) */
34
+ ergFirmenname?: QualifiedResultCode;
35
+ /** Street validation result (A/B/C/D) */
36
+ ergStrasse?: QualifiedResultCode;
37
+ /** Postal code validation result (A/B/C/D) */
38
+ ergPlz?: QualifiedResultCode;
39
+ /** City validation result (A/B/C/D) */
40
+ ergOrt?: QualifiedResultCode;
41
+ }
42
+ export interface Request {
43
+ vatIdOwn: string;
44
+ vatIdForeign: string;
45
+ company?: string;
46
+ location?: string;
47
+ street?: string;
48
+ zip?: string;
49
+ includeRaw?: boolean;
50
+ }
51
+ export type SimpleRequest = {
52
+ vatIdOwn: string;
53
+ vatIdForeign: string;
54
+ includeRaw?: boolean;
55
+ };
56
+ export type QualifiedRequest = {
57
+ vatIdOwn: string;
58
+ vatIdForeign: string;
59
+ company: string;
60
+ location: string;
61
+ street?: string;
62
+ zip?: string;
63
+ includeRaw?: boolean;
64
+ };
65
+ export interface Response {
66
+ timestamp: string;
67
+ status: string;
68
+ vatIdOwn: string;
69
+ vatIdForeign: string;
70
+ validFrom?: string;
71
+ validTill?: string;
72
+ company?: QualifiedResultCode;
73
+ street?: QualifiedResultCode;
74
+ zip?: QualifiedResultCode;
75
+ location?: QualifiedResultCode;
76
+ raw?: string;
77
+ }
78
+ export interface ExtendedResponse {
79
+ timestamp: Date;
80
+ valid: boolean;
81
+ status: string;
82
+ message?: string;
83
+ vatIdOwn: string;
84
+ vatIdForeign: string;
85
+ validFrom?: Date;
86
+ validTill?: Date;
87
+ company?: QualifiedResultCode;
88
+ street?: QualifiedResultCode;
89
+ zip?: QualifiedResultCode;
90
+ location?: QualifiedResultCode;
91
+ raw?: string;
92
+ }
93
+ /**
94
+ * Validation result codes for qualified validation
95
+ */
96
+ export type QualifiedResultCode = 'A' | 'B' | 'C' | 'D';
97
+ /**
98
+ * Configuration options for the EvatrClient
99
+ */
100
+ export interface EvatrClientConfig {
101
+ /** Request timeout in milliseconds */
102
+ timeout?: number;
103
+ /** Custom headers to include with requests */
104
+ headers?: Record<string, string>;
105
+ }
106
+ /**
107
+ * API Error interface
108
+ */
109
+ export interface EvatrApiError extends Error {
110
+ status?: string;
111
+ http?: number;
112
+ field?: string;
113
+ }
114
+ /**
115
+ * Status message interface
116
+ */
117
+ export interface ApiStatusMessage {
118
+ /** Status code (e.g., "evatr-0000") */
119
+ status: string;
120
+ /** Category of the message */
121
+ kategorie: 'Ergebnis' | 'Hinweis' | 'Fehler';
122
+ /** HTTP status code */
123
+ httpcode: number;
124
+ /** Field that caused the error (if applicable) */
125
+ feld?: string;
126
+ /** Human-readable message in German */
127
+ meldung: string;
128
+ }
129
+ export interface StatusMessage {
130
+ status: string;
131
+ category: StatusMessageCategory;
132
+ http?: number;
133
+ field?: string;
134
+ message: string;
135
+ }
136
+ export type StatusMessageCategory = 'Result' | 'Error' | 'Hint';
137
+ /**
138
+ * EU Member State interface
139
+ */
140
+ export interface ApiEUMemberState {
141
+ /** Two-letter country code */
142
+ alpha2: string;
143
+ /** Country name in German */
144
+ name: string;
145
+ /** Whether the VIES system is available for this country */
146
+ verfuegbar: boolean;
147
+ }
148
+ export interface EUMemberState {
149
+ code: string;
150
+ available: boolean;
151
+ }
152
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6BAA6B;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,6BAA6B;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,yCAAyC;IACzC,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,8CAA8C;IAC9C,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,uCAAuC;IACvC,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,M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AA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB"}
package/dist/types.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Types and interfaces for the eVatR API
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Utility functions for the eVatR API wrapper
3
+ */
4
+ import { QualifiedResultCode } from './types';
5
+ /**
6
+ * Utility class with helper functions for eVatR operations
7
+ */
8
+ export declare class EvatrUtils {
9
+ static normalizeVatId(vatId: string): string;
10
+ /**
11
+ * Validate VAT-ID format for a specific country
12
+ * @param vatId VAT-ID to validate
13
+ * @param countryCode Optional country code, if not provided it will be extracted from VAT-ID
14
+ * @returns boolean
15
+ */
16
+ static checkVatIdSyntaxForCountry(vatId: string, countryCode?: string): boolean;
17
+ /**
18
+ * Get country name from country code
19
+ * @param countryCode Two-letter country code
20
+ * @returns string Country name or 'Unknown' if not found
21
+ */
22
+ static getCountryName(countryCode: string): string;
23
+ /**
24
+ * Check if a country code is a valid EU member state
25
+ * @param countryCode Two-letter country code
26
+ * @returns boolean
27
+ */
28
+ static isEUMemberState(countryCode: string): boolean;
29
+ /**
30
+ * Get all supported EU country codes
31
+ * @returns string[] Array of country codes
32
+ */
33
+ static getSupportedCountryCodes(): string[];
34
+ /**
35
+ * Get all supported EU countries with their codes
36
+ * @returns Record<string, string> Object mapping country codes to names
37
+ */
38
+ static getSupportedCountries(): Record<string, string>;
39
+ /**
40
+ * Parse and explain validation result
41
+ * @param result Validation result code (A, B, C, D)
42
+ * @returns string Human-readable explanation
43
+ */
44
+ static explainQualifiedResultCode(result: QualifiedResultCode): string;
45
+ /**
46
+ * Extract numeric part from VAT-ID
47
+ * @param vatId VAT-ID
48
+ * @returns string Numeric part of the VAT-ID
49
+ */
50
+ static getVatIdNumber(vatId: string): string;
51
+ /**
52
+ * Check if VAT-ID appears to be German
53
+ * @param vatId VAT-ID to check
54
+ * @returns boolean
55
+ */
56
+ static isGermanVatId(vatId: string): boolean;
57
+ /**
58
+ * Generate test VAT-IDs for different countries (for testing purposes)
59
+ * @returns Record<string, string> Object mapping country codes to test VAT-IDs
60
+ */
61
+ static getTestVatIds(): Record<string, string>;
62
+ /**
63
+ * Validate that a German VAT-ID can request validation for another VAT-ID
64
+ * @param vatIdOwn German VAT-ID making the request
65
+ * @param vatIdForeign VAT-ID being validated
66
+ * @returns boolean
67
+ */
68
+ static canValidate(vatIdOwn: string, vatIdForeign: string): boolean;
69
+ /**
70
+ * Calculate check digit for German VAT-ID (for validation purposes)
71
+ * @param vatIdNumber Numeric part of German VAT-ID (without DE prefix)
72
+ * @returns number Check digit
73
+ * @TODO fix
74
+ */
75
+ static calculateGermanVatIdCheckDigit(vatIdNumber: string): number;
76
+ }
77
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAG9C;;GAEG;AACH,qBAAa,UAAU;IACrB,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI5C;;;;;OAKG;IACH,MAAM,CAAC,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO;IAY/E;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAIlD;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAIpD;;;OAGG;IACH,MAAM,CAAC,wBAAwB,IAAI,MAAM,EAAE;IAI3C;;;OAGG;IACH,MAAM,CAAC,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAItD;;;;OAIG;IACH,MAAM,CAAC,0BAA0B,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM;IAItE;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK5C;;;;OAIG;IACH,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAK5C;;;OAGG;IACH,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAO9C;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO;IAWnE;;;;;OAKG;IACH,MAAM,CAAC,8BAA8B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;CAoBnE"}
package/dist/utils.js ADDED
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ /**
3
+ * Utility functions for the eVatR API wrapper
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EvatrUtils = void 0;
7
+ const constants_1 = require("./constants");
8
+ /**
9
+ * Utility class with helper functions for eVatR operations
10
+ */
11
+ class EvatrUtils {
12
+ static normalizeVatId(vatId) {
13
+ return vatId.replace(/[^a-zA-Z0-9]/g, '').toUpperCase();
14
+ }
15
+ /**
16
+ * Validate VAT-ID format for a specific country
17
+ * @param vatId VAT-ID to validate
18
+ * @param countryCode Optional country code, if not provided it will be extracted from VAT-ID
19
+ * @returns boolean
20
+ */
21
+ static checkVatIdSyntaxForCountry(vatId, countryCode) {
22
+ const cleanVatId = this.normalizeVatId(vatId);
23
+ const country = countryCode || cleanVatId.substring(0, 2);
24
+ const pattern = constants_1.VATID_PATTERNS[country];
25
+ if (!pattern) {
26
+ return false;
27
+ }
28
+ return pattern.test(cleanVatId);
29
+ }
30
+ /**
31
+ * Get country name from country code
32
+ * @param countryCode Two-letter country code
33
+ * @returns string Country name or 'Unknown' if not found
34
+ */
35
+ static getCountryName(countryCode) {
36
+ return constants_1.EU_MEMBER_STATES[countryCode.toUpperCase()] || 'Unknown';
37
+ }
38
+ /**
39
+ * Check if a country code is a valid EU member state
40
+ * @param countryCode Two-letter country code
41
+ * @returns boolean
42
+ */
43
+ static isEUMemberState(countryCode) {
44
+ return countryCode.toUpperCase() in constants_1.EU_MEMBER_STATES;
45
+ }
46
+ /**
47
+ * Get all supported EU country codes
48
+ * @returns string[] Array of country codes
49
+ */
50
+ static getSupportedCountryCodes() {
51
+ return Object.keys(constants_1.EU_MEMBER_STATES);
52
+ }
53
+ /**
54
+ * Get all supported EU countries with their codes
55
+ * @returns Record<string, string> Object mapping country codes to names
56
+ */
57
+ static getSupportedCountries() {
58
+ return { ...constants_1.EU_MEMBER_STATES };
59
+ }
60
+ /**
61
+ * Parse and explain validation result
62
+ * @param result Validation result code (A, B, C, D)
63
+ * @returns string Human-readable explanation
64
+ */
65
+ static explainQualifiedResultCode(result) {
66
+ return constants_1.QUALIFIED_RESULT_CODES[result] || 'Unknown validation result';
67
+ }
68
+ /**
69
+ * Extract numeric part from VAT-ID
70
+ * @param vatId VAT-ID
71
+ * @returns string Numeric part of the VAT-ID
72
+ */
73
+ static getVatIdNumber(vatId) {
74
+ const cleanVatId = this.normalizeVatId(vatId);
75
+ return cleanVatId.substring(2).replace(/[A-Z]/g, '');
76
+ }
77
+ /**
78
+ * Check if VAT-ID appears to be German
79
+ * @param vatId VAT-ID to check
80
+ * @returns boolean
81
+ */
82
+ static isGermanVatId(vatId) {
83
+ const cleanVatId = this.normalizeVatId(vatId);
84
+ return cleanVatId.startsWith('DE') && this.checkVatIdSyntaxForCountry(cleanVatId, 'DE');
85
+ }
86
+ /**
87
+ * Generate test VAT-IDs for different countries (for testing purposes)
88
+ * @returns Record<string, string> Object mapping country codes to test VAT-IDs
89
+ */
90
+ static getTestVatIds() {
91
+ return {
92
+ 'DE': 'DE123456789',
93
+ 'AT': 'ATU12345678',
94
+ };
95
+ }
96
+ /**
97
+ * Validate that a German VAT-ID can request validation for another VAT-ID
98
+ * @param vatIdOwn German VAT-ID making the request
99
+ * @param vatIdForeign VAT-ID being validated
100
+ * @returns boolean
101
+ */
102
+ static canValidate(vatIdOwn, vatIdForeign) {
103
+ // Own VAT-ID must be German
104
+ if (!this.isGermanVatId(vatIdOwn)) {
105
+ return false;
106
+ }
107
+ // Target VAT-ID must be from an EU member state
108
+ const foreignCountry = this.normalizeVatId(vatIdForeign).substring(0, 2);
109
+ return this.isEUMemberState(foreignCountry);
110
+ }
111
+ /**
112
+ * Calculate check digit for German VAT-ID (for validation purposes)
113
+ * @param vatIdNumber Numeric part of German VAT-ID (without DE prefix)
114
+ * @returns number Check digit
115
+ * @TODO fix
116
+ */
117
+ static calculateGermanVatIdCheckDigit(vatIdNumber) {
118
+ if (vatIdNumber.length !== 9) {
119
+ throw new Error('German VAT-ID number must contain exactly 9 digits after letters DE');
120
+ }
121
+ const digits = vatIdNumber.split('').map(Number);
122
+ let product = 10;
123
+ for (let i = 0; i < 8; i++) {
124
+ const sum = (digits[i] + product) % 10;
125
+ product = (2 * (sum === 0 ? 10 : sum)) % 11;
126
+ }
127
+ let checkDigit = 11 - product;
128
+ if (checkDigit === 10) {
129
+ checkDigit = 0;
130
+ }
131
+ return checkDigit;
132
+ }
133
+ }
134
+ exports.EvatrUtils = EvatrUtils;
135
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,2CAAuF;AAEvF;;GAEG;AACH,MAAa,UAAU;IACrB,MAAM,CAAC,cAAc,CAAC,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MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;YACvC,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QAC9C,CAAC;QAED,IAAI,UAAU,GAAG,EAAE,GAAG,OAAO,CAAC;QAC9B,IAAI,UAAU,KAAK,EAAE,EAAE,CAAC;YACtB,UAAU,GAAG,CAAC,CAAC;QACjB,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AA5ID,gCA4IC"}
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "evatr-api",
3
+ "version": "0.1.1",
4
+ "description": "Checks a VAT-ID using the eVatR REST-API of the German Federal Central Tax Office (Bundeszentralamt für Steuern, BZSt)",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist/**/*",
9
+ "README.md",
10
+ "LICENSE.md"
11
+ ],
12
+ "directories": {
13
+ "doc": "docs"
14
+ },
15
+ "scripts": {
16
+ "build": "tsc",
17
+ "dev": "tsc --watch",
18
+ "example:simple": "ts-node examples/simple.ts",
19
+ "example:migration-helper": "ts-node examples/migration-helper.ts",
20
+ "format:check": "prettier --check src/**/*.ts",
21
+ "format": "prettier --write src/**/*.ts",
22
+ "lint:fix": "eslint src/**/*.ts --fix",
23
+ "lint": "eslint src/**/*.ts",
24
+ "prepublishOnly": "npm run build",
25
+ "test:ci": "jest --coverage --watchAll=false",
26
+ "test:coverage": "jest --coverage",
27
+ "test:external": "jest --testPathPatterns='/*.external.test.ts'",
28
+ "test:smoke": "jest --silent --verbose=false --testPathIgnorePatterns='/*.external.test.ts'",
29
+ "test:watch": "jest --watch",
30
+ "test": "jest --testPathIgnorePatterns='/*.external.test.ts'",
31
+ "type:check": "tsc --noEmit",
32
+ "update:api": "ts-node scripts/update-api.ts"
33
+ },
34
+ "keywords": [
35
+ "rechtlogisch",
36
+ "bzst",
37
+ "evatr",
38
+ "germany",
39
+ "wrapper",
40
+ "vat-id"
41
+ ],
42
+ "author": "Krzysztof Tomasz Zembrowski <zembrowski@users.noreply.github.com>",
43
+ "license": "MIT",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/rechtlogisch/evatr-js.git"
47
+ },
48
+ "bugs": {
49
+ "url": "https://github.com/rechtlogisch/evatr-js/issues"
50
+ },
51
+ "homepage": "https://github.com/rechtlogisch/evatr-js#readme",
52
+ "devDependencies": {
53
+ "@eslint/eslintrc": "^3.3.1",
54
+ "@eslint/js": "^9.32.0",
55
+ "@types/jest": "^30.0.0",
56
+ "@types/node": "^22.0.0",
57
+ "@typescript-eslint/eslint-plugin": "^8.38.0",
58
+ "@typescript-eslint/parser": "^8.38.0",
59
+ "eslint": "^9.32.0",
60
+ "globals": "^16.3.0",
61
+ "jest": "^30.0.0",
62
+ "prettier": "^3.0.0",
63
+ "ts-jest": "^29.1.0",
64
+ "ts-node": "^10.9.0",
65
+ "typescript": "^5.8.0"
66
+ },
67
+ "dependencies": {
68
+ "axios": "^1.6.0"
69
+ },
70
+ "overrides": {
71
+ "glob": "^10.0"
72
+ }
73
+ }