@jars-lt/sdk 1.0.2 → 1.1.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/.turbo/turbo-build.log +5 -0
- package/dist/index.d.ts +176 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +140 -15
- package/dist/index.js.map +1 -1
- package/example.ts +55 -1
- package/package.json +13 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Company, SubscriptionPlan, WorkdayCheckResponse, AddWorkdaysResponse } from '@jars-lt/types';
|
|
1
|
+
import { Company, SubscriptionPlan, WorkdayCheckResponse, AddWorkdaysResponse, NormalizeAddressResponse, Invoice } from '@jars-lt/types';
|
|
2
2
|
/**
|
|
3
3
|
* Configuration options for JARS.LT client
|
|
4
4
|
*/
|
|
@@ -94,6 +94,50 @@ export interface UsageResponse {
|
|
|
94
94
|
rateLimit: number;
|
|
95
95
|
webhooksEnabled: boolean;
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Company financial report data
|
|
99
|
+
*/
|
|
100
|
+
export interface CompanyFinancialsData {
|
|
101
|
+
companyCode: string;
|
|
102
|
+
year: number;
|
|
103
|
+
periodStart: string;
|
|
104
|
+
periodEnd: string;
|
|
105
|
+
reportDate?: string;
|
|
106
|
+
balance?: {
|
|
107
|
+
equity?: number;
|
|
108
|
+
longTermAssets?: number;
|
|
109
|
+
shortTermAssets?: number;
|
|
110
|
+
liabilities?: number;
|
|
111
|
+
totalAssets?: number;
|
|
112
|
+
};
|
|
113
|
+
profitLoss?: {
|
|
114
|
+
revenue?: number;
|
|
115
|
+
profitBeforeTax?: number;
|
|
116
|
+
netProfit?: number;
|
|
117
|
+
};
|
|
118
|
+
templateId?: string;
|
|
119
|
+
templateName?: string;
|
|
120
|
+
standardId?: string;
|
|
121
|
+
standardName?: string;
|
|
122
|
+
dataDate: string;
|
|
123
|
+
createdAt: string;
|
|
124
|
+
updatedAt: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Company financials response
|
|
128
|
+
*/
|
|
129
|
+
export interface CompanyFinancialsResponse {
|
|
130
|
+
companyCode: string;
|
|
131
|
+
companyName: string;
|
|
132
|
+
financials: CompanyFinancialsData[];
|
|
133
|
+
availableYears: number[];
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Invoices list response
|
|
137
|
+
*/
|
|
138
|
+
export interface InvoicesListResponse {
|
|
139
|
+
invoices: Invoice[];
|
|
140
|
+
}
|
|
97
141
|
/**
|
|
98
142
|
* API Error
|
|
99
143
|
*/
|
|
@@ -105,6 +149,10 @@ export declare class JarsAPIError extends Error {
|
|
|
105
149
|
/**
|
|
106
150
|
* Official JARS.LT API Client
|
|
107
151
|
*
|
|
152
|
+
* Supports both Lithuanian and Estonian company registries.
|
|
153
|
+
* Default country depends on the base URL: api.jars.lt defaults to Lithuania,
|
|
154
|
+
* api.jars.ee defaults to Estonia.
|
|
155
|
+
*
|
|
108
156
|
* @example
|
|
109
157
|
* ```typescript
|
|
110
158
|
* import { JarsClient } from '@jars-lt/sdk';
|
|
@@ -113,11 +161,17 @@ export declare class JarsAPIError extends Error {
|
|
|
113
161
|
* apiKey: 'your_api_key_here'
|
|
114
162
|
* });
|
|
115
163
|
*
|
|
116
|
-
* // Search companies
|
|
117
|
-
* const
|
|
164
|
+
* // Search Lithuanian companies
|
|
165
|
+
* const ltCompanies = await client.searchCompanies({ q: 'UAB Maxima' });
|
|
118
166
|
*
|
|
119
|
-
* //
|
|
120
|
-
* const
|
|
167
|
+
* // Search Estonian companies
|
|
168
|
+
* const eeCompanies = await client.searchCompanies({ q: 'Bolt', country: 'ee' });
|
|
169
|
+
*
|
|
170
|
+
* // Or use api.jars.ee as base URL for Estonian defaults
|
|
171
|
+
* const eeClient = new JarsClient({
|
|
172
|
+
* apiKey: 'your_api_key_here',
|
|
173
|
+
* baseURL: 'https://api.jars.ee/api/v1'
|
|
174
|
+
* });
|
|
121
175
|
* ```
|
|
122
176
|
*/
|
|
123
177
|
export declare class JarsClient {
|
|
@@ -130,37 +184,71 @@ export declare class JarsClient {
|
|
|
130
184
|
* @param params.q - Search query (company name or code)
|
|
131
185
|
* @param params.limit - Number of results (max: 100, default: 20)
|
|
132
186
|
* @param params.offset - Skip results (default: 0)
|
|
187
|
+
* @param params.country - Country: "lt" (Lithuania) or "ee" (Estonia). Default depends on base URL domain.
|
|
133
188
|
* @returns Search results with companies
|
|
134
189
|
*
|
|
135
190
|
* @example
|
|
136
191
|
* ```typescript
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* console.log(results.results); // Array of companies
|
|
192
|
+
* // Search Lithuanian companies
|
|
193
|
+
* const results = await client.searchCompanies({ q: 'Maxima', limit: 10 });
|
|
194
|
+
*
|
|
195
|
+
* // Search Estonian companies
|
|
196
|
+
* const eeResults = await client.searchCompanies({ q: 'Bolt', country: 'ee' });
|
|
143
197
|
* ```
|
|
144
198
|
*/
|
|
145
199
|
searchCompanies(params: {
|
|
146
200
|
q: string;
|
|
147
201
|
limit?: number;
|
|
148
202
|
offset?: number;
|
|
203
|
+
country?: 'lt' | 'ee';
|
|
149
204
|
}): Promise<SearchCompaniesResponse>;
|
|
150
205
|
/**
|
|
151
206
|
* Get company details by company code
|
|
152
207
|
*
|
|
153
|
-
* @param code - Company code
|
|
208
|
+
* @param code - Company registration code
|
|
209
|
+
* @param options - Optional parameters
|
|
210
|
+
* @param options.country - Country: "lt" (Lithuania) or "ee" (Estonia). Default depends on base URL domain.
|
|
154
211
|
* @returns Company details
|
|
155
212
|
*
|
|
156
213
|
* @example
|
|
157
214
|
* ```typescript
|
|
215
|
+
* // Lithuanian company
|
|
158
216
|
* const company = await client.getCompany('111111111');
|
|
159
|
-
*
|
|
160
|
-
*
|
|
217
|
+
*
|
|
218
|
+
* // Estonian company
|
|
219
|
+
* const eeCompany = await client.getCompany('14532901', { country: 'ee' });
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
getCompany(code: string, options?: {
|
|
223
|
+
country?: 'lt' | 'ee';
|
|
224
|
+
}): Promise<Company>;
|
|
225
|
+
/**
|
|
226
|
+
* Get company financial reports (balance sheet + P&L)
|
|
227
|
+
*
|
|
228
|
+
* @param code - Company registration code
|
|
229
|
+
* @param params - Optional parameters
|
|
230
|
+
* @param params.year - Specific year to fetch (optional, returns all years if not specified)
|
|
231
|
+
* @param params.limit - Maximum number of years to return (default: 10, max: 50)
|
|
232
|
+
* @param params.country - Country: "lt" (Lithuania) or "ee" (Estonia). Default depends on base URL domain.
|
|
233
|
+
* @returns Financial reports with balance sheet and P&L data
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```typescript
|
|
237
|
+
* // Get all available financial reports
|
|
238
|
+
* const financials = await client.getCompanyFinancials('111111111');
|
|
239
|
+
*
|
|
240
|
+
* // Get specific year
|
|
241
|
+
* const financials2024 = await client.getCompanyFinancials('111111111', { year: 2024 });
|
|
242
|
+
*
|
|
243
|
+
* // Estonian company financials
|
|
244
|
+
* const eeFinancials = await client.getCompanyFinancials('14532901', { country: 'ee' });
|
|
161
245
|
* ```
|
|
162
246
|
*/
|
|
163
|
-
|
|
247
|
+
getCompanyFinancials(code: string, params?: {
|
|
248
|
+
year?: number;
|
|
249
|
+
limit?: number;
|
|
250
|
+
country?: 'lt' | 'ee';
|
|
251
|
+
}): Promise<CompanyFinancialsResponse>;
|
|
164
252
|
/**
|
|
165
253
|
* Search for addresses (streets, settlements, municipalities)
|
|
166
254
|
* Supports multi-word search (e.g., "kaunas basanavi")
|
|
@@ -247,6 +335,79 @@ export declare class JarsClient {
|
|
|
247
335
|
* ```
|
|
248
336
|
*/
|
|
249
337
|
addWorkdays(date: string, days: number): Promise<AddWorkdaysResponse>;
|
|
338
|
+
/**
|
|
339
|
+
* Normalize an arbitrary address string to structured components
|
|
340
|
+
* Supports fuzzy matching for typos (1-2 character edits)
|
|
341
|
+
*
|
|
342
|
+
* @param address - Address string in any format (e.g., "vilnus gedimino 15")
|
|
343
|
+
* @param limit - Maximum number of results (default: 5, max: 20)
|
|
344
|
+
* @returns Normalized address results with confidence scores
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* ```typescript
|
|
348
|
+
* // Normalize with typos
|
|
349
|
+
* const result = await client.normalizeAddress('gedimno pr 28 vilnus');
|
|
350
|
+
* console.log(result.results[0].formatted); // "Gedimino pr. 28, Vilnius, Vilniaus m. sav., LT-01103"
|
|
351
|
+
* console.log(result.results[0].confidence); // 0.87
|
|
352
|
+
* console.log(result.results[0].components.street); // { code: 105641, name: "Gedimino", ... }
|
|
353
|
+
*
|
|
354
|
+
* // With building number
|
|
355
|
+
* const result2 = await client.normalizeAddress('kaunas laisves al 20a');
|
|
356
|
+
* console.log(result2.results[0].components.building); // { number: "20A", postalCode: "LT-44291" }
|
|
357
|
+
* ```
|
|
358
|
+
*/
|
|
359
|
+
normalizeAddress(address: string, limit?: number): Promise<NormalizeAddressResponse>;
|
|
360
|
+
/**
|
|
361
|
+
* List all invoices for the authenticated user
|
|
362
|
+
* Note: Invoice requests do not count towards your monthly API quota
|
|
363
|
+
*
|
|
364
|
+
* @returns List of invoices
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* ```typescript
|
|
368
|
+
* const { invoices } = await client.listInvoices();
|
|
369
|
+
* for (const invoice of invoices) {
|
|
370
|
+
* console.log(invoice.number, invoice.status, invoice.total / 100);
|
|
371
|
+
* }
|
|
372
|
+
* ```
|
|
373
|
+
*/
|
|
374
|
+
listInvoices(): Promise<InvoicesListResponse>;
|
|
375
|
+
/**
|
|
376
|
+
* Get a specific invoice by ID
|
|
377
|
+
* Note: Invoice requests do not count towards your monthly API quota
|
|
378
|
+
*
|
|
379
|
+
* @param invoiceId - Stripe invoice ID (e.g., "in_1abc123")
|
|
380
|
+
* @returns Invoice details
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```typescript
|
|
384
|
+
* const invoice = await client.getInvoice('in_1abc123');
|
|
385
|
+
* console.log(invoice.number); // "INV-0091"
|
|
386
|
+
* console.log(invoice.total / 100); // 9.99
|
|
387
|
+
* console.log(invoice.customerName); // "UAB Example"
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
390
|
+
getInvoice(invoiceId: string): Promise<Invoice>;
|
|
391
|
+
/**
|
|
392
|
+
* Download invoice in UBL XML format (Peppol BIS Billing 3.0)
|
|
393
|
+
* The UBL format is compliant with European e-invoicing standard EN 16931
|
|
394
|
+
* Note: Invoice requests do not count towards your monthly API quota
|
|
395
|
+
*
|
|
396
|
+
* @param invoiceId - Stripe invoice ID (e.g., "in_1abc123")
|
|
397
|
+
* @returns UBL XML string
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* ```typescript
|
|
401
|
+
* const xml = await client.getInvoiceUbl('in_1abc123');
|
|
402
|
+
* // Save to file
|
|
403
|
+
* fs.writeFileSync('invoice.xml', xml);
|
|
404
|
+
*
|
|
405
|
+
* // Or parse for processing
|
|
406
|
+
* const parser = new DOMParser();
|
|
407
|
+
* const doc = parser.parseFromString(xml, 'text/xml');
|
|
408
|
+
* ```
|
|
409
|
+
*/
|
|
410
|
+
getInvoiceUbl(invoiceId: string): Promise<string>;
|
|
250
411
|
}
|
|
251
412
|
export * from '@jars-lt/types';
|
|
252
413
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,oBAA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AC,wBAAwB,CAAC;IAK1F;;;;;;;;;;;;;OAaG;IACG,YAAY,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAKnD;;;;;;;;;;;;;;OAcG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKrD;;;;;;;;;;;;;;;;;;OAkBG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAIxD;AAGD,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,10 @@ exports.JarsAPIError = JarsAPIError;
|
|
|
34
34
|
/**
|
|
35
35
|
* Official JARS.LT API Client
|
|
36
36
|
*
|
|
37
|
+
* Supports both Lithuanian and Estonian company registries.
|
|
38
|
+
* Default country depends on the base URL: api.jars.lt defaults to Lithuania,
|
|
39
|
+
* api.jars.ee defaults to Estonia.
|
|
40
|
+
*
|
|
37
41
|
* @example
|
|
38
42
|
* ```typescript
|
|
39
43
|
* import { JarsClient } from '@jars-lt/sdk';
|
|
@@ -42,11 +46,17 @@ exports.JarsAPIError = JarsAPIError;
|
|
|
42
46
|
* apiKey: 'your_api_key_here'
|
|
43
47
|
* });
|
|
44
48
|
*
|
|
45
|
-
* // Search companies
|
|
46
|
-
* const
|
|
49
|
+
* // Search Lithuanian companies
|
|
50
|
+
* const ltCompanies = await client.searchCompanies({ q: 'UAB Maxima' });
|
|
51
|
+
*
|
|
52
|
+
* // Search Estonian companies
|
|
53
|
+
* const eeCompanies = await client.searchCompanies({ q: 'Bolt', country: 'ee' });
|
|
47
54
|
*
|
|
48
|
-
* //
|
|
49
|
-
* const
|
|
55
|
+
* // Or use api.jars.ee as base URL for Estonian defaults
|
|
56
|
+
* const eeClient = new JarsClient({
|
|
57
|
+
* apiKey: 'your_api_key_here',
|
|
58
|
+
* baseURL: 'https://api.jars.ee/api/v1'
|
|
59
|
+
* });
|
|
50
60
|
* ```
|
|
51
61
|
*/
|
|
52
62
|
class JarsClient {
|
|
@@ -78,16 +88,16 @@ class JarsClient {
|
|
|
78
88
|
* @param params.q - Search query (company name or code)
|
|
79
89
|
* @param params.limit - Number of results (max: 100, default: 20)
|
|
80
90
|
* @param params.offset - Skip results (default: 0)
|
|
91
|
+
* @param params.country - Country: "lt" (Lithuania) or "ee" (Estonia). Default depends on base URL domain.
|
|
81
92
|
* @returns Search results with companies
|
|
82
93
|
*
|
|
83
94
|
* @example
|
|
84
95
|
* ```typescript
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* console.log(results.results); // Array of companies
|
|
96
|
+
* // Search Lithuanian companies
|
|
97
|
+
* const results = await client.searchCompanies({ q: 'Maxima', limit: 10 });
|
|
98
|
+
*
|
|
99
|
+
* // Search Estonian companies
|
|
100
|
+
* const eeResults = await client.searchCompanies({ q: 'Bolt', country: 'ee' });
|
|
91
101
|
* ```
|
|
92
102
|
*/
|
|
93
103
|
async searchCompanies(params) {
|
|
@@ -97,18 +107,48 @@ class JarsClient {
|
|
|
97
107
|
/**
|
|
98
108
|
* Get company details by company code
|
|
99
109
|
*
|
|
100
|
-
* @param code - Company code
|
|
110
|
+
* @param code - Company registration code
|
|
111
|
+
* @param options - Optional parameters
|
|
112
|
+
* @param options.country - Country: "lt" (Lithuania) or "ee" (Estonia). Default depends on base URL domain.
|
|
101
113
|
* @returns Company details
|
|
102
114
|
*
|
|
103
115
|
* @example
|
|
104
116
|
* ```typescript
|
|
117
|
+
* // Lithuanian company
|
|
105
118
|
* const company = await client.getCompany('111111111');
|
|
106
|
-
*
|
|
107
|
-
*
|
|
119
|
+
*
|
|
120
|
+
* // Estonian company
|
|
121
|
+
* const eeCompany = await client.getCompany('14532901', { country: 'ee' });
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
async getCompany(code, options) {
|
|
125
|
+
const response = await this.client.get(`/companies/${code}`, { params: options });
|
|
126
|
+
return response.data;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Get company financial reports (balance sheet + P&L)
|
|
130
|
+
*
|
|
131
|
+
* @param code - Company registration code
|
|
132
|
+
* @param params - Optional parameters
|
|
133
|
+
* @param params.year - Specific year to fetch (optional, returns all years if not specified)
|
|
134
|
+
* @param params.limit - Maximum number of years to return (default: 10, max: 50)
|
|
135
|
+
* @param params.country - Country: "lt" (Lithuania) or "ee" (Estonia). Default depends on base URL domain.
|
|
136
|
+
* @returns Financial reports with balance sheet and P&L data
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```typescript
|
|
140
|
+
* // Get all available financial reports
|
|
141
|
+
* const financials = await client.getCompanyFinancials('111111111');
|
|
142
|
+
*
|
|
143
|
+
* // Get specific year
|
|
144
|
+
* const financials2024 = await client.getCompanyFinancials('111111111', { year: 2024 });
|
|
145
|
+
*
|
|
146
|
+
* // Estonian company financials
|
|
147
|
+
* const eeFinancials = await client.getCompanyFinancials('14532901', { country: 'ee' });
|
|
108
148
|
* ```
|
|
109
149
|
*/
|
|
110
|
-
async
|
|
111
|
-
const response = await this.client.get(`/companies/${code}
|
|
150
|
+
async getCompanyFinancials(code, params) {
|
|
151
|
+
const response = await this.client.get(`/companies/${code}/financials`, { params });
|
|
112
152
|
return response.data;
|
|
113
153
|
}
|
|
114
154
|
/**
|
|
@@ -208,6 +248,91 @@ class JarsClient {
|
|
|
208
248
|
const response = await this.client.get('/workdays/add', { params: { date, days } });
|
|
209
249
|
return response.data;
|
|
210
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* Normalize an arbitrary address string to structured components
|
|
253
|
+
* Supports fuzzy matching for typos (1-2 character edits)
|
|
254
|
+
*
|
|
255
|
+
* @param address - Address string in any format (e.g., "vilnus gedimino 15")
|
|
256
|
+
* @param limit - Maximum number of results (default: 5, max: 20)
|
|
257
|
+
* @returns Normalized address results with confidence scores
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```typescript
|
|
261
|
+
* // Normalize with typos
|
|
262
|
+
* const result = await client.normalizeAddress('gedimno pr 28 vilnus');
|
|
263
|
+
* console.log(result.results[0].formatted); // "Gedimino pr. 28, Vilnius, Vilniaus m. sav., LT-01103"
|
|
264
|
+
* console.log(result.results[0].confidence); // 0.87
|
|
265
|
+
* console.log(result.results[0].components.street); // { code: 105641, name: "Gedimino", ... }
|
|
266
|
+
*
|
|
267
|
+
* // With building number
|
|
268
|
+
* const result2 = await client.normalizeAddress('kaunas laisves al 20a');
|
|
269
|
+
* console.log(result2.results[0].components.building); // { number: "20A", postalCode: "LT-44291" }
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
async normalizeAddress(address, limit) {
|
|
273
|
+
const response = await this.client.post('/addresses/normalize', { address, limit });
|
|
274
|
+
return response.data;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* List all invoices for the authenticated user
|
|
278
|
+
* Note: Invoice requests do not count towards your monthly API quota
|
|
279
|
+
*
|
|
280
|
+
* @returns List of invoices
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* const { invoices } = await client.listInvoices();
|
|
285
|
+
* for (const invoice of invoices) {
|
|
286
|
+
* console.log(invoice.number, invoice.status, invoice.total / 100);
|
|
287
|
+
* }
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
async listInvoices() {
|
|
291
|
+
const response = await this.client.get('/invoices');
|
|
292
|
+
return response.data;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Get a specific invoice by ID
|
|
296
|
+
* Note: Invoice requests do not count towards your monthly API quota
|
|
297
|
+
*
|
|
298
|
+
* @param invoiceId - Stripe invoice ID (e.g., "in_1abc123")
|
|
299
|
+
* @returns Invoice details
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* ```typescript
|
|
303
|
+
* const invoice = await client.getInvoice('in_1abc123');
|
|
304
|
+
* console.log(invoice.number); // "INV-0091"
|
|
305
|
+
* console.log(invoice.total / 100); // 9.99
|
|
306
|
+
* console.log(invoice.customerName); // "UAB Example"
|
|
307
|
+
* ```
|
|
308
|
+
*/
|
|
309
|
+
async getInvoice(invoiceId) {
|
|
310
|
+
const response = await this.client.get(`/invoices/${invoiceId}`);
|
|
311
|
+
return response.data;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Download invoice in UBL XML format (Peppol BIS Billing 3.0)
|
|
315
|
+
* The UBL format is compliant with European e-invoicing standard EN 16931
|
|
316
|
+
* Note: Invoice requests do not count towards your monthly API quota
|
|
317
|
+
*
|
|
318
|
+
* @param invoiceId - Stripe invoice ID (e.g., "in_1abc123")
|
|
319
|
+
* @returns UBL XML string
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* ```typescript
|
|
323
|
+
* const xml = await client.getInvoiceUbl('in_1abc123');
|
|
324
|
+
* // Save to file
|
|
325
|
+
* fs.writeFileSync('invoice.xml', xml);
|
|
326
|
+
*
|
|
327
|
+
* // Or parse for processing
|
|
328
|
+
* const parser = new DOMParser();
|
|
329
|
+
* const doc = parser.parseFromString(xml, 'text/xml');
|
|
330
|
+
* ```
|
|
331
|
+
*/
|
|
332
|
+
async getInvoiceUbl(invoiceId) {
|
|
333
|
+
const response = await this.client.get(`/invoices/${invoiceId}/ubl`);
|
|
334
|
+
return response.data;
|
|
335
|
+
}
|
|
211
336
|
}
|
|
212
337
|
exports.JarsClient = JarsClient;
|
|
213
338
|
// Re-export types from @jars-lt/types for convenience
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kDAAyD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kDAAyD;AAgJzD;;GAEG;AACH,MAAa,YAAa,SAA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,CAAC,aAAa,SAAS,EAAE,CAAC,CAAC;QACjE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,aAAa,CAAC,SAAiB;QACnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,SAAS,MAAM,CAAC,CAAC;QACrE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AArTD,gCAqTC;AAED,sDAAsD;AACtD,iDAA+B"}
|
package/example.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* 2. Run: tsx example.ts
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { JarsClient, JarsAPIError } from './src/index';
|
|
9
|
+
import { JarsClient, JarsAPIError, NormalizedAddress } from './src/index';
|
|
10
10
|
|
|
11
11
|
async function main() {
|
|
12
12
|
// Initialize client with API key from environment
|
|
@@ -78,6 +78,60 @@ async function main() {
|
|
|
78
78
|
console.log(` ... and ${location.streets.length - 3} more`);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
+
console.log();
|
|
82
|
+
|
|
83
|
+
// Example 6: Check if a date is a workday
|
|
84
|
+
console.log('📅 Checking workdays...');
|
|
85
|
+
const today = new Date().toISOString().split('T')[0];
|
|
86
|
+
const workdayCheck = await client.checkWorkday(today);
|
|
87
|
+
console.log(`Date: ${workdayCheck.date} (${workdayCheck.dayOfWeek})`);
|
|
88
|
+
console.log(`Is workday: ${workdayCheck.isWorkday}`);
|
|
89
|
+
console.log(`Is weekend: ${workdayCheck.isWeekend}`);
|
|
90
|
+
console.log(`Is holiday: ${workdayCheck.isHoliday}`);
|
|
91
|
+
if (workdayCheck.holidayName) {
|
|
92
|
+
console.log(`Holiday: ${workdayCheck.holidayName}`);
|
|
93
|
+
}
|
|
94
|
+
console.log();
|
|
95
|
+
|
|
96
|
+
// Example 7: Check a Lithuanian holiday (Christmas)
|
|
97
|
+
console.log('🎄 Checking Christmas 2024...');
|
|
98
|
+
const christmas = await client.checkWorkday('2024-12-25');
|
|
99
|
+
console.log(`Date: ${christmas.date} (${christmas.dayOfWeek})`);
|
|
100
|
+
console.log(`Is workday: ${christmas.isWorkday}`);
|
|
101
|
+
console.log(`Is holiday: ${christmas.isHoliday}`);
|
|
102
|
+
if (christmas.holidayName) {
|
|
103
|
+
console.log(`Holiday: ${christmas.holidayName}`);
|
|
104
|
+
}
|
|
105
|
+
console.log();
|
|
106
|
+
|
|
107
|
+
// Example 8: Add workdays to a date
|
|
108
|
+
console.log('➕ Adding workdays...');
|
|
109
|
+
const addResult = await client.addWorkdays(today, 5);
|
|
110
|
+
console.log(`Start date: ${addResult.startDate}`);
|
|
111
|
+
console.log(`Workdays added: ${addResult.workdaysAdded}`);
|
|
112
|
+
console.log(`Result date: ${addResult.resultDate}`);
|
|
113
|
+
console.log(`Result is workday: ${addResult.resultIsWorkday}`);
|
|
114
|
+
console.log();
|
|
115
|
+
|
|
116
|
+
// Example 9: Normalize address with fuzzy matching
|
|
117
|
+
console.log('🏠 Normalizing address (with typos)...');
|
|
118
|
+
const normalized = await client.normalizeAddress('gedimno pr 28 vilnus', 3);
|
|
119
|
+
console.log(`Query: "${normalized.query}"`);
|
|
120
|
+
console.log(`Parsed tokens: ${normalized.parsed.tokens.join(', ')}`);
|
|
121
|
+
if (normalized.parsed.building) {
|
|
122
|
+
console.log(`Detected building: ${normalized.parsed.building}`);
|
|
123
|
+
}
|
|
124
|
+
console.log(`Found ${normalized.results.length} results:`);
|
|
125
|
+
normalized.results.forEach((result: NormalizedAddress, i: number) => {
|
|
126
|
+
console.log(` ${i + 1}. ${result.formatted}`);
|
|
127
|
+
console.log(` Confidence: ${(result.confidence * 100).toFixed(0)}%`);
|
|
128
|
+
if (result.components.building) {
|
|
129
|
+
console.log(` Building: ${result.components.building.number}`);
|
|
130
|
+
}
|
|
131
|
+
if (result.components.postalCode) {
|
|
132
|
+
console.log(` Postal: ${result.components.postalCode}`);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
81
135
|
} catch (error) {
|
|
82
136
|
if (error instanceof JarsAPIError) {
|
|
83
137
|
console.error('❌ API Error:', error.message);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jars-lt/sdk",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "Official Node.js SDK for JARS.LT API - Lithuanian Company Registry",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Official Node.js SDK for JARS.LT API - Lithuanian and Estonian Company Registry",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -11,15 +11,11 @@
|
|
|
11
11
|
"require": "./dist/index.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsc",
|
|
16
|
-
"dev": "tsc --watch",
|
|
17
|
-
"clean": "rm -rf dist",
|
|
18
|
-
"prepublishOnly": "pnpm build"
|
|
19
|
-
},
|
|
20
14
|
"keywords": [
|
|
21
15
|
"jars",
|
|
22
16
|
"lithuania",
|
|
17
|
+
"estonia",
|
|
18
|
+
"baltic",
|
|
23
19
|
"company-registry",
|
|
24
20
|
"api",
|
|
25
21
|
"sdk",
|
|
@@ -29,11 +25,16 @@
|
|
|
29
25
|
"license": "MIT",
|
|
30
26
|
"homepage": "https://jars.lt",
|
|
31
27
|
"dependencies": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
28
|
+
"axios": "^1.13.5",
|
|
29
|
+
"@jars-lt/types": "^1.1.0"
|
|
34
30
|
},
|
|
35
31
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^20.
|
|
32
|
+
"@types/node": "^20.19.33",
|
|
37
33
|
"typescript": "^5.3.3"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc",
|
|
37
|
+
"dev": "tsc --watch",
|
|
38
|
+
"clean": "rm -rf dist"
|
|
38
39
|
}
|
|
39
|
-
}
|
|
40
|
+
}
|