@omnizoek/sdk 0.1.3 → 0.1.4
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/dist/index.cjs +96 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +213 -5
- package/dist/index.d.ts +213 -5
- package/dist/index.js +96 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -225,7 +225,7 @@ var GeoModule = class {
|
|
|
225
225
|
* statistics, energy labels and more.
|
|
226
226
|
*
|
|
227
227
|
* @example
|
|
228
|
-
* const result = await omni.geo.enrichAddress({ postcode: "1012LG", houseNumber: 1 });
|
|
228
|
+
* const result = await omni.geo.enrichAddress({ postcode: "1012LG", houseNumber: "1" });
|
|
229
229
|
*/
|
|
230
230
|
async enrichAddress(params) {
|
|
231
231
|
return this.http.get("/v1/geo/address-enrich", {
|
|
@@ -233,6 +233,31 @@ var GeoModule = class {
|
|
|
233
233
|
house_number: params.houseNumber
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Free-text address search via PDOK Locatieserver.
|
|
238
|
+
* Returns coordinates, postcode, BAG ID and more.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* const result = await omni.geo.geocode({ q: "Damrak 1 Amsterdam" });
|
|
242
|
+
*/
|
|
243
|
+
async geocode(params) {
|
|
244
|
+
return this.http.get("/v1/geo/geocode", {
|
|
245
|
+
q: params.q,
|
|
246
|
+
rows: params.rows
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Convert WGS84 coordinates to the nearest Dutch address.
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* const result = await omni.geo.reverseGeocode({ lat: 52.3756, lon: 4.8951 });
|
|
254
|
+
*/
|
|
255
|
+
async reverseGeocode(params) {
|
|
256
|
+
return this.http.get("/v1/geo/reverse-geocode", {
|
|
257
|
+
lat: params.lat,
|
|
258
|
+
lon: params.lon
|
|
259
|
+
});
|
|
260
|
+
}
|
|
236
261
|
};
|
|
237
262
|
|
|
238
263
|
// src/finance.ts
|
|
@@ -263,6 +288,29 @@ var FinanceModule = class {
|
|
|
263
288
|
vat_number: params.vatNumber
|
|
264
289
|
});
|
|
265
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* Daily ECB euro foreign exchange reference rates (~30 currencies).
|
|
293
|
+
* Cached for 4 hours.
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* const result = await omni.finance.exchangeRates();
|
|
297
|
+
* console.log(result.rates.USD);
|
|
298
|
+
*/
|
|
299
|
+
async exchangeRates() {
|
|
300
|
+
return this.http.get("/v1/finance/exchange-rates", {});
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Official VAT rates for any EU/EEA country plus GB, NO, CH.
|
|
304
|
+
* Includes per-category breakdown for NL.
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* const result = await omni.finance.vatRates({ country: "NL" });
|
|
308
|
+
*/
|
|
309
|
+
async vatRates(params) {
|
|
310
|
+
return this.http.get("/v1/finance/vat-rates", {
|
|
311
|
+
country: params?.country
|
|
312
|
+
});
|
|
313
|
+
}
|
|
266
314
|
};
|
|
267
315
|
|
|
268
316
|
// src/compliance.ts
|
|
@@ -296,8 +344,10 @@ var HrModule = class {
|
|
|
296
344
|
* const result = await omni.hr.minimumWage({ age: 21 });
|
|
297
345
|
*/
|
|
298
346
|
async minimumWage(params) {
|
|
347
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
299
348
|
return this.http.get("/v1/hr/minimum-wage", {
|
|
300
|
-
age: params.age
|
|
349
|
+
age: params.age,
|
|
350
|
+
date: params.date ?? today
|
|
301
351
|
});
|
|
302
352
|
}
|
|
303
353
|
/**
|
|
@@ -363,6 +413,18 @@ var LogisticsModule = class {
|
|
|
363
413
|
station_code: params?.stationCode
|
|
364
414
|
});
|
|
365
415
|
}
|
|
416
|
+
/**
|
|
417
|
+
* Full vehicle record by Dutch licence plate, assembled from 4 RDW Open
|
|
418
|
+
* Data datasets: registration, fuel/emissions, APK and recalls.
|
|
419
|
+
*
|
|
420
|
+
* @example
|
|
421
|
+
* const result = await omni.logistics.vehicleHistory({ kenteken: "AB-123-C" });
|
|
422
|
+
*/
|
|
423
|
+
async vehicleHistory(params) {
|
|
424
|
+
return this.http.get("/v1/logistics/vehicle-history", {
|
|
425
|
+
kenteken: params.kenteken
|
|
426
|
+
});
|
|
427
|
+
}
|
|
366
428
|
};
|
|
367
429
|
|
|
368
430
|
// src/energy.ts
|
|
@@ -426,6 +488,37 @@ var WebhooksModule = class {
|
|
|
426
488
|
}
|
|
427
489
|
};
|
|
428
490
|
|
|
491
|
+
// src/business.ts
|
|
492
|
+
var BusinessModule = class {
|
|
493
|
+
constructor(http) {
|
|
494
|
+
this.http = http;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Look up a company by LEI code (exact) or name (fuzzy search) via GLEIF.
|
|
498
|
+
*
|
|
499
|
+
* - Provide `lei` for a single-record lookup.
|
|
500
|
+
* - Provide `name` (and optionally `country`) for a name search.
|
|
501
|
+
*
|
|
502
|
+
* @example
|
|
503
|
+
* // Exact lookup
|
|
504
|
+
* const result = await omni.business.leiLookup({ lei: "5493001KJTIIGC8Y1R12" });
|
|
505
|
+
*
|
|
506
|
+
* // Name search
|
|
507
|
+
* const result = await omni.business.leiLookup({ name: "ING Bank", country: "NL" });
|
|
508
|
+
*/
|
|
509
|
+
async leiLookup(params) {
|
|
510
|
+
return this.http.get(
|
|
511
|
+
"/v1/business/lei-lookup",
|
|
512
|
+
{
|
|
513
|
+
lei: params.lei,
|
|
514
|
+
name: params.name,
|
|
515
|
+
country: params.country,
|
|
516
|
+
rows: params.rows
|
|
517
|
+
}
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
|
|
429
522
|
// src/OmniClient.ts
|
|
430
523
|
var OmniClient = class {
|
|
431
524
|
constructor(options) {
|
|
@@ -437,6 +530,7 @@ var OmniClient = class {
|
|
|
437
530
|
this.realEstate = new RealEstateModule(http);
|
|
438
531
|
this.logistics = new LogisticsModule(http);
|
|
439
532
|
this.energy = new EnergyModule(http);
|
|
533
|
+
this.business = new BusinessModule(http);
|
|
440
534
|
this.webhooks = new WebhooksModule(http);
|
|
441
535
|
}
|
|
442
536
|
};
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts","../src/client.ts","../src/geo.ts","../src/finance.ts","../src/compliance.ts","../src/hr.ts","../src/realEstate.ts","../src/logistics.ts","../src/energy.ts","../src/webhooks.ts","../src/OmniClient.ts","../src/index.ts"],"names":["OmniAuthError","OmniError","OmniNetworkError","OmniNotFoundError","OmniRateLimitError","OmniUpstreamError","OmniValidationError"],"mappings":";;;;;;;;;;;;;AAAA,IAAA,cAAA,GAAA,EAAA;AAAA,QAAA,CAAA,cAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAAA,qBAAA;AAAA,EAAA,SAAA,EAAA,MAAAC,iBAAA;AAAA,EAAA,gBAAA,EAAA,MAAAC,wBAAA;AAAA,EAAA,iBAAA,EAAA,MAAAC,yBAAA;AAAA,EAAA,kBAAA,EAAA,MAAAC,0BAAA;AAAA,EAAA,iBAAA,EAAA,MAAAC,yBAAA;AAAA,EAAA,mBAAA,EAAA,MAAAC;AAAA,CAAA,CAAA;AAIaL,0BAAA,CAAA,CAaAD,8BAAA,CAAA,CAQAG,kCAAA,CAAA,CAQAG,oCAAA,CAAA,CAQAF,qCAaAC,kCAAA,CAAA,CAQAH;AA9Db,IAAA,WAAA,GAAA,KAAA,CAAA;AAAA,EAAA,eAAA,GAAA;AAIO,IAAMD,iBAAA,GAAN,cAAwB,KAAA,CAAM;AAAA,MACnC,WAAA,CACE,OAAA,EACgB,MAAA,EACA,IAAA,EACA,MAAA,EAChB;AACA,QAA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,OAAA,GAAU,IAAI,aAAA,CAAc,IAAI,CAAA;AACrC,IAAA,IAAA,CAAK,UAAA,GAAa,IAAI,gBAAA,CAAiB,IAAI,CAAA;AAC3C,IAAA,IAAA,CAAK,EAAA,GAAK,IAAI,QAAA,CAAS,IAAI,CAAA;AAC3B,IAAA,IAAA,CAAK,UAAA,GAAa,IAAI,gBAAA,CAAiB,IAAI,CAAA;AAC3C,IAAA,IAAA,CAAK,SAAA,GAAY,IAAI,eAAA,CAAgB,IAAI,CAAA;AACzC,IAAA,IAAA,CAAK,MAAA,GAAS,IAAI,YAAA,CAAa,IAAI,CAAA;AACnC,IAAA,IAAA,CAAK,QAAA,GAAW,IAAI,cAAA,CAAe,IAAI,CAAA;AAAA,EACzC;AACF;;;ACjDA,WAAA,EAAA","file":"index.cjs","sourcesContent":["/**\n * errors.ts — Typed error classes for the OmniZoek SDK.\n */\n\nexport class OmniError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly code: string,\n public readonly detail: string,\n ) {\n super(message);\n this.name = \"OmniError\";\n }\n}\n\n/** 401 — API key missing or invalid. */\nexport class OmniAuthError extends OmniError {\n constructor(detail: string) {\n super(`Authentication failed: ${detail}`, 401, \"auth_error\", detail);\n this.name = \"OmniAuthError\";\n }\n}\n\n/** 404 — Requested resource not found (address, label, etc.). */\nexport class OmniNotFoundError extends OmniError {\n constructor(detail: string) {\n super(`Not found: ${detail}`, 404, \"not_found\", detail);\n this.name = \"OmniNotFoundError\";\n }\n}\n\n/** 422 — Request parameters failed validation. */\nexport class OmniValidationError extends OmniError {\n constructor(detail: string) {\n super(`Validation error: ${detail}`, 422, \"validation_error\", detail);\n this.name = \"OmniValidationError\";\n }\n}\n\n/** 429 — Rate limit exceeded. Retried automatically by the client. */\nexport class OmniRateLimitError extends OmniError {\n constructor(public readonly retryAfterMs: number) {\n super(\n `Rate limit exceeded. Retry after ${retryAfterMs}ms.`,\n 429,\n \"rate_limit\",\n `Retry after ${retryAfterMs}ms`,\n );\n this.name = \"OmniRateLimitError\";\n }\n}\n\n/** 503 — Upstream data source unavailable (BAG, EP-Online, RDW, etc.). */\nexport class OmniUpstreamError extends OmniError {\n constructor(detail: string) {\n super(`Upstream error: ${detail}`, 503, \"upstream_error\", detail);\n this.name = \"OmniUpstreamError\";\n }\n}\n\n/** Network-level failure (DNS, timeout, no internet). */\nexport class OmniNetworkError extends Error {\n readonly cause?: Error;\n\n constructor(cause: unknown) {\n super(`Network error: ${cause instanceof Error ? cause.message : String(cause)}`);\n this.name = \"OmniNetworkError\";\n if (cause instanceof Error) this.cause = cause;\n }\n}\n","/**\n * client.ts — Core HTTP client with automatic retry and error mapping.\n */\n\nimport {\n OmniAuthError,\n OmniNetworkError,\n OmniNotFoundError,\n OmniRateLimitError,\n OmniUpstreamError,\n OmniValidationError,\n} from \"./errors.js\";\n\nexport interface OmniClientOptions {\n /** Your OmniZoek API key (omni_live_… or omni_test_…) */\n apiKey: string;\n /** Override the base URL — useful for testing. Default: https://api.omnizoek.nl */\n baseUrl?: string;\n /** Max retries on 429 rate-limit responses. Default: 3 */\n maxRetries?: number;\n /** Base delay in ms for exponential backoff. Default: 500 */\n retryDelayMs?: number;\n /** Request timeout in ms. Default: 20000 */\n timeoutMs?: number;\n}\n\nconst DEFAULT_BASE_URL = \"https://api.omnizoek.nl\";\nconst DEFAULT_MAX_RETRIES = 3;\nconst DEFAULT_RETRY_DELAY_MS = 500;\nconst DEFAULT_TIMEOUT_MS = 20_000;\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport class HttpClient {\n private readonly apiKey: string;\n private readonly baseUrl: string;\n private readonly maxRetries: number;\n private readonly retryDelayMs: number;\n private readonly timeoutMs: number;\n\n constructor(options: OmniClientOptions) {\n this.apiKey = options.apiKey;\n this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/$/, \"\");\n this.maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;\n this.retryDelayMs = options.retryDelayMs ?? DEFAULT_RETRY_DELAY_MS;\n this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n }\n\n async get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T> {\n const url = new URL(this.baseUrl + path);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n let attempt = 0;\n\n while (true) {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(url.toString(), {\n method: \"GET\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"Accept\": \"application/json\",\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n // 429 — retry with exponential backoff\n if (response.status === 429 && attempt < this.maxRetries) {\n const retryAfter = Number(response.headers.get(\"Retry-After\") ?? 0);\n const delay = retryAfter > 0\n ? retryAfter * 1000\n : this.retryDelayMs * Math.pow(2, attempt);\n\n attempt++;\n await sleep(delay);\n continue;\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n\n return response.json() as Promise<T>;\n }\n }\n\n async post<T>(path: string, body?: unknown): Promise<T> {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(this.baseUrl + path, {\n method: \"POST\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n\n return response.json() as Promise<T>;\n }\n\n async delete(path: string): Promise<void> {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(this.baseUrl + path, {\n method: \"DELETE\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n }\n\n private async _throwFromResponse(response: Response): Promise<never> {\n let detail = response.statusText;\n try {\n const body = await response.json() as { detail?: unknown; error?: unknown };\n const raw = body.detail ?? body.error ?? detail;\n // FastAPI 422 returns detail as an array of validation objects; others are strings.\n detail = typeof raw === \"string\"\n ? raw\n : JSON.stringify(raw);\n } catch {\n // non-JSON body — keep statusText\n }\n\n switch (response.status) {\n case 401: throw new OmniAuthError(detail);\n case 404: throw new OmniNotFoundError(detail);\n case 422: throw new OmniValidationError(detail);\n case 429: throw new OmniRateLimitError(0);\n case 503: throw new OmniUpstreamError(detail);\n default: {\n const { OmniError } = await import(\"./errors.js\");\n throw new OmniError(\n `API error ${response.status}: ${detail}`,\n response.status,\n \"api_error\",\n detail,\n );\n }\n }\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { AddressEnrichParams, AddressEnrichResponse } from \"./types.js\";\n\nexport class GeoModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Enrich a Dutch address with BAG data, coordinates, neighbourhood\n * statistics, energy labels and more.\n *\n * @example\n * const result = await omni.geo.enrichAddress({ postcode: \"1012LG\", houseNumber: 1 });\n */\n async enrichAddress(params: AddressEnrichParams): Promise<AddressEnrichResponse> {\n return this.http.get<AddressEnrichResponse>(\"/v1/geo/address-enrich\", {\n postcode: params.postcode,\n house_number: params.houseNumber,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n IbanToBicParams,\n IbanToBicResponse,\n VatVerifyParams,\n VatVerifyResponse,\n} from \"./types.js\";\n\nexport class FinanceModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Resolve an IBAN to its BIC/SWIFT code and bank name.\n *\n * @example\n * const result = await omni.finance.ibanToBic({ iban: \"NL91ABNA0417164300\" });\n */\n async ibanToBic(params: IbanToBicParams): Promise<IbanToBicResponse> {\n return this.http.get<IbanToBicResponse>(\"/v1/finance/iban-to-bic\", {\n iban: params.iban,\n });\n }\n\n /**\n * Verify a Dutch BTW (VAT) number via the EU VIES service and return\n * company metadata.\n *\n * @example\n * const result = await omni.finance.vatVerify({ vatNumber: \"NL123456782B01\" });\n */\n async vatVerify(params: VatVerifyParams): Promise<VatVerifyResponse> {\n return this.http.get<VatVerifyResponse>(\"/v1/finance/vat-verify\", {\n vat_number: params.vatNumber,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { ValidateFinanceParams, FinanceValidationResponse } from \"./types.js\";\n\nexport class ComplianceModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Validate a Dutch BSN or IBAN number using checksum algorithms.\n *\n * @example\n * const result = await omni.compliance.validateFinance({ type: \"iban\", number: \"NL91ABNA0417164300\" });\n */\n async validateFinance(params: ValidateFinanceParams): Promise<FinanceValidationResponse> {\n return this.http.get<FinanceValidationResponse>(\"/v1/compliance/validate-finance\", {\n type: params.type,\n number: params.number,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n MinimumWageParams,\n MinimumWageResponse,\n HolidaySurchargeParams,\n HolidaySurchargeResponse,\n} from \"./types.js\";\n\nexport class HrModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Look up the current Dutch statutory minimum wage for a given age.\n *\n * @example\n * const result = await omni.hr.minimumWage({ age: 21 });\n */\n async minimumWage(params: MinimumWageParams): Promise<MinimumWageResponse> {\n return this.http.get<MinimumWageResponse>(\"/v1/hr/minimum-wage\", {\n age: params.age,\n });\n }\n\n /**\n * Check whether a given date is a public holiday (and get the applicable\n * surcharge multiplier for a given industry).\n *\n * @example\n * const result = await omni.hr.holidaySurcharge({ date: \"2024-12-25\", industry: \"retail\" });\n */\n async holidaySurcharge(params: HolidaySurchargeParams): Promise<HolidaySurchargeResponse> {\n return this.http.get<HolidaySurchargeResponse>(\"/v1/hr/holiday-surcharge\", {\n date: params.date,\n industry: params.industry,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { EnergyLabelParams, EnergyLabelResponse } from \"./types.js\";\n\nexport class RealEstateModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Retrieve the official EP-Online energy label for a Dutch address.\n *\n * @example\n * const result = await omni.realEstate.energyLabel({ postcode: \"1012LG\", houseNumber: 1 });\n */\n async energyLabel(params: EnergyLabelParams): Promise<EnergyLabelResponse> {\n return this.http.get<EnergyLabelResponse>(\"/v1/real-estate/energy-label\", {\n postcode: params.postcode,\n house_number: params.houseNumber,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n EmissionZoneParams,\n EmissionZoneResponse,\n TransitDisruptionsParams,\n TransitDisruptionsResponse,\n} from \"./types.js\";\n\nexport class LogisticsModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Check whether a vehicle (by Dutch licence plate / kenteken) is allowed\n * in a zero-emission zone (ZE-zone).\n *\n * @example\n * const result = await omni.logistics.emissionZone({ kenteken: \"AB123C\" });\n */\n async emissionZone(params: EmissionZoneParams): Promise<EmissionZoneResponse> {\n return this.http.get<EmissionZoneResponse>(\"/v1/logistics/emission-zone\", {\n kenteken: params.kenteken,\n });\n }\n\n /**\n * Retrieve current and upcoming NS train disruptions, optionally filtered\n * by station code.\n *\n * @example\n * const result = await omni.logistics.transitDisruptions({ stationCode: \"ASD\" });\n */\n async transitDisruptions(params?: TransitDisruptionsParams): Promise<TransitDisruptionsResponse> {\n return this.http.get<TransitDisruptionsResponse>(\"/v1/logistics/transit-disruptions\", {\n station_code: params?.stationCode,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { GridTriggerParams, GridTriggerResponse } from \"./types.js\";\n\nexport class EnergyModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Retrieve the current Dutch electricity grid congestion status for a\n * given postal code / province.\n *\n * @example\n * const result = await omni.energy.gridTrigger();\n * const result = await omni.energy.gridTrigger({ countryCode: \"NL\" });\n */\n async gridTrigger(params?: GridTriggerParams): Promise<GridTriggerResponse> {\n return this.http.get<GridTriggerResponse>(\"/v1/energy/grid-trigger\", {\n country_code: params?.countryCode,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n RegisterWebhookParams,\n WebhookCreatedResponse,\n WebhookListResponse,\n} from \"./types.js\";\n\nexport class WebhooksModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Register a new outbound webhook. OmniZoek will POST to `url` whenever\n * any of the specified `events` fire.\n *\n * @example\n * const wh = await omni.webhooks.register({\n * url: \"https://example.com/hook\",\n * events: [\"quota.warning\"],\n * });\n */\n async register(params: RegisterWebhookParams): Promise<WebhookCreatedResponse> {\n return this.http.post<WebhookCreatedResponse>(\"/v1/webhooks\", {\n url: params.url,\n events: params.events,\n });\n }\n\n /**\n * List all registered webhooks for this API key.\n *\n * @example\n * const { webhooks } = await omni.webhooks.list();\n */\n async list(): Promise<WebhookListResponse> {\n return this.http.get<WebhookListResponse>(\"/v1/webhooks\");\n }\n\n /**\n * Delete a webhook by its ID.\n *\n * @example\n * await omni.webhooks.delete(\"wh_abc123\");\n */\n async delete(webhookId: string): Promise<void> {\n return this.http.delete(`/v1/webhooks/${encodeURIComponent(webhookId)}`);\n }\n}\n","import { HttpClient, type OmniClientOptions } from \"./client.js\";\nimport { GeoModule } from \"./geo.js\";\nimport { FinanceModule } from \"./finance.js\";\nimport { ComplianceModule } from \"./compliance.js\";\nimport { HrModule } from \"./hr.js\";\nimport { RealEstateModule } from \"./realEstate.js\";\nimport { LogisticsModule } from \"./logistics.js\";\nimport { EnergyModule } from \"./energy.js\";\nimport { WebhooksModule } from \"./webhooks.js\";\n\nexport { type OmniClientOptions };\n\n/**\n * The main entry point for the OmniZoek SDK.\n *\n * @example\n * ```ts\n * import { OmniClient } from \"@omnizoek/sdk\";\n *\n * const omni = new OmniClient({ apiKey: \"omni_live_…\" });\n *\n * const address = await omni.geo.enrichAddress({ postcode: \"1012LG\", houseNumber: 1 });\n * const wage = await omni.hr.minimumWage({ age: 21 });\n * ```\n */\nexport class OmniClient {\n /** Geographic address enrichment (BAG, CBS, energy labels) */\n readonly geo: GeoModule;\n /** Financial utilities (IBAN → BIC, VAT verification) */\n readonly finance: FinanceModule;\n /** Compliance checks (financial institution registers) */\n readonly compliance: ComplianceModule;\n /** HR calculations (minimum wage, holiday surcharge) */\n readonly hr: HrModule;\n /** Real-estate data (EP-Online energy labels) */\n readonly realEstate: RealEstateModule;\n /** Logistics (ZE-zones, NS disruptions) */\n readonly logistics: LogisticsModule;\n /** Energy (grid congestion triggers) */\n readonly energy: EnergyModule;\n /** Outbound webhooks (register, list, delete) */\n readonly webhooks: WebhooksModule;\n\n constructor(options: OmniClientOptions) {\n const http = new HttpClient(options);\n this.geo = new GeoModule(http);\n this.finance = new FinanceModule(http);\n this.compliance = new ComplianceModule(http);\n this.hr = new HrModule(http);\n this.realEstate = new RealEstateModule(http);\n this.logistics = new LogisticsModule(http);\n this.energy = new EnergyModule(http);\n this.webhooks = new WebhooksModule(http);\n }\n}\n","// Main entry point\nexport { OmniClient } from \"./OmniClient.js\";\nexport type { OmniClientOptions } from \"./OmniClient.js\";\n\n// Typed error classes\nexport {\n OmniError,\n OmniAuthError,\n OmniNotFoundError,\n OmniValidationError,\n OmniRateLimitError,\n OmniUpstreamError,\n OmniNetworkError,\n} from \"./errors.js\";\n\n// All request/response types\nexport type {\n AddressEnrichParams,\n AddressEnrichResponse,\n IbanToBicParams,\n IbanToBicResponse,\n VatVerifyParams,\n VatVerifyResponse,\n ValidateFinanceParams,\n FinanceValidationResponse,\n MinimumWageParams,\n MinimumWageResponse,\n HolidaySurchargeParams,\n HolidaySurchargeResponse,\n EnergyLabelParams,\n EnergyLabelResponse,\n EmissionZoneParams,\n EmissionZoneResponse,\n TransitDisruptionsParams,\n TransitDisruptionsResponse,\n GridTriggerParams,\n GridTriggerResponse,\n RegisterWebhookParams,\n WebhookCreatedResponse,\n WebhookSummary,\n WebhookListResponse,\n} from \"./types.js\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts","../src/client.ts","../src/geo.ts","../src/finance.ts","../src/compliance.ts","../src/hr.ts","../src/realEstate.ts","../src/logistics.ts","../src/energy.ts","../src/webhooks.ts","../src/business.ts","../src/OmniClient.ts","../src/index.ts"],"names":["OmniAuthError","OmniError","OmniNetworkError","OmniNotFoundError","OmniRateLimitError","OmniUpstreamError","OmniValidationError"],"mappings":";;;;;;;;;;;;;AAAA,IAAA,cAAA,GAAA,EAAA;AAAA,QAAA,CAAA,cAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAAA,qBAAA;AAAA,EAAA,SAAA,EAAA,MAAAC,iBAAA;AAAA,EAAA,gBAAA,EAAA,MAAAC,wBAAA;AAAA,EAAA,iBAAA,EAAA,MAAAC,yBAAA;AAAA,EAAA,kBAAA,EAAA,MAAAC,0BAAA;AAAA,EAAA,iBAAA,EAAA,MAAAC,yBAAA;AAAA,EAAA,mBAAA,EAAA,MAAAC;AAAA,CAAA,CAAA;AAIaL,0BAAA,CAAA,CAaAD,8BAAA,CAAA,CAQAG,kCAAA,CAAA,CAQAG,oCAAA,CAAA,CAQAF,qCAaAC,kCAAA,CAAA,CAQAH;AA9Db,IAAA,WAAA,GAAA,KAAA,CAAA;AAAA,EAAA,eAAA,GAAA;AAIO,IAAMD,iBAAA,GAAN,cAAwB,KAAA,CAAM;AAAA,MACnC,WAAA,CACE,OAAA,EACgB,MAAA,EACA,IAAA,EACA,MAAA,EAChB;AACA,QAAA,KAAA,CAAM,OAAO,CAAA;AAJG,QAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AACA,QAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,QAAA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AA,QACZ,MAAM,MAAA,CAAO,IAAA;AAAA,QACb,SAAS,MAAA,CAAO,OAAA;AAAA,QAChB,MAAM,MAAA,CAAO;AAAA;AACf,KACF;AAAA,EACF;AACF,CAAA;;;ACNO,IAAM,aAAN,MAAiB;AAAA,EAoBtB,YAAY,OAAA,EAA4B;AACtC,IAAA,MAAM,IAAA,GAAO,IAAI,UAAA,CAAW,OAAO,CAAA;AACnC,IAAA,IAAA,CAAK,GAAA,GAAM,IAAI,SAAA,CAAU,IAAI,CAAA;AAC7B,IAAA,IAAA,CAAK,OAAA,GAAU,IAAI,aAAA,CAAc,IAAI,CAAA;AACrC,IAAA,IAAA,CAAK,UAAA,GAAa,IAAI,gBAAA,CAAiB,IAAI,CAAA;AAC3C,IAAA,IAAA,CAAK,EAAA,GAAK,IAAI,QAAA,CAAS,IAAI,CAAA;AAC3B,IAAA,IAAA,CAAK,UAAA,GAAa,IAAI,gBAAA,CAAiB,IAAI,CAAA;AAC3C,IAAA,IAAA,CAAK,SAAA,GAAY,IAAI,eAAA,CAAgB,IAAI,CAAA;AACzC,IAAA,IAAA,CAAK,MAAA,GAAS,IAAI,YAAA,CAAa,IAAI,CAAA;AACnC,IAAA,IAAA,CAAK,QAAA,GAAW,IAAI,cAAA,CAAe,IAAI,CAAA;AACvC,IAAA,IAAA,CAAK,QAAA,GAAW,IAAI,cAAA,CAAe,IAAI,CAAA;AAAA,EACzC;AACF;;;ACrDA,WAAA,EAAA","file":"index.cjs","sourcesContent":["/**\n * errors.ts — Typed error classes for the OmniZoek SDK.\n */\n\nexport class OmniError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly code: string,\n public readonly detail: string,\n ) {\n super(message);\n this.name = \"OmniError\";\n }\n}\n\n/** 401 — API key missing or invalid. */\nexport class OmniAuthError extends OmniError {\n constructor(detail: string) {\n super(`Authentication failed: ${detail}`, 401, \"auth_error\", detail);\n this.name = \"OmniAuthError\";\n }\n}\n\n/** 404 — Requested resource not found (address, label, etc.). */\nexport class OmniNotFoundError extends OmniError {\n constructor(detail: string) {\n super(`Not found: ${detail}`, 404, \"not_found\", detail);\n this.name = \"OmniNotFoundError\";\n }\n}\n\n/** 422 — Request parameters failed validation. */\nexport class OmniValidationError extends OmniError {\n constructor(detail: string) {\n super(`Validation error: ${detail}`, 422, \"validation_error\", detail);\n this.name = \"OmniValidationError\";\n }\n}\n\n/** 429 — Rate limit exceeded. Retried automatically by the client. */\nexport class OmniRateLimitError extends OmniError {\n constructor(public readonly retryAfterMs: number) {\n super(\n `Rate limit exceeded. Retry after ${retryAfterMs}ms.`,\n 429,\n \"rate_limit\",\n `Retry after ${retryAfterMs}ms`,\n );\n this.name = \"OmniRateLimitError\";\n }\n}\n\n/** 503 — Upstream data source unavailable (BAG, EP-Online, RDW, etc.). */\nexport class OmniUpstreamError extends OmniError {\n constructor(detail: string) {\n super(`Upstream error: ${detail}`, 503, \"upstream_error\", detail);\n this.name = \"OmniUpstreamError\";\n }\n}\n\n/** Network-level failure (DNS, timeout, no internet). */\nexport class OmniNetworkError extends Error {\n readonly cause?: Error;\n\n constructor(cause: unknown) {\n super(`Network error: ${cause instanceof Error ? cause.message : String(cause)}`);\n this.name = \"OmniNetworkError\";\n if (cause instanceof Error) this.cause = cause;\n }\n}\n","/**\n * client.ts — Core HTTP client with automatic retry and error mapping.\n */\n\nimport {\n OmniAuthError,\n OmniNetworkError,\n OmniNotFoundError,\n OmniRateLimitError,\n OmniUpstreamError,\n OmniValidationError,\n} from \"./errors.js\";\n\nexport interface OmniClientOptions {\n /** Your OmniZoek API key (omni_live_… or omni_test_…) */\n apiKey: string;\n /** Override the base URL — useful for testing. Default: https://api.omnizoek.nl */\n baseUrl?: string;\n /** Max retries on 429 rate-limit responses. Default: 3 */\n maxRetries?: number;\n /** Base delay in ms for exponential backoff. Default: 500 */\n retryDelayMs?: number;\n /** Request timeout in ms. Default: 20000 */\n timeoutMs?: number;\n}\n\nconst DEFAULT_BASE_URL = \"https://api.omnizoek.nl\";\nconst DEFAULT_MAX_RETRIES = 3;\nconst DEFAULT_RETRY_DELAY_MS = 500;\nconst DEFAULT_TIMEOUT_MS = 20_000;\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport class HttpClient {\n private readonly apiKey: string;\n private readonly baseUrl: string;\n private readonly maxRetries: number;\n private readonly retryDelayMs: number;\n private readonly timeoutMs: number;\n\n constructor(options: OmniClientOptions) {\n this.apiKey = options.apiKey;\n this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/$/, \"\");\n this.maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;\n this.retryDelayMs = options.retryDelayMs ?? DEFAULT_RETRY_DELAY_MS;\n this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n }\n\n async get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T> {\n const url = new URL(this.baseUrl + path);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n let attempt = 0;\n\n while (true) {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(url.toString(), {\n method: \"GET\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"Accept\": \"application/json\",\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n // 429 — retry with exponential backoff\n if (response.status === 429 && attempt < this.maxRetries) {\n const retryAfter = Number(response.headers.get(\"Retry-After\") ?? 0);\n const delay = retryAfter > 0\n ? retryAfter * 1000\n : this.retryDelayMs * Math.pow(2, attempt);\n\n attempt++;\n await sleep(delay);\n continue;\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n\n return response.json() as Promise<T>;\n }\n }\n\n async post<T>(path: string, body?: unknown): Promise<T> {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(this.baseUrl + path, {\n method: \"POST\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n\n return response.json() as Promise<T>;\n }\n\n async delete(path: string): Promise<void> {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(this.baseUrl + path, {\n method: \"DELETE\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n }\n\n private async _throwFromResponse(response: Response): Promise<never> {\n let detail = response.statusText;\n try {\n const body = await response.json() as { detail?: unknown; error?: unknown };\n const raw = body.detail ?? body.error ?? detail;\n // FastAPI 422 returns detail as an array of validation objects; others are strings.\n detail = typeof raw === \"string\"\n ? raw\n : JSON.stringify(raw);\n } catch {\n // non-JSON body — keep statusText\n }\n\n switch (response.status) {\n case 401: throw new OmniAuthError(detail);\n case 404: throw new OmniNotFoundError(detail);\n case 422: throw new OmniValidationError(detail);\n case 429: throw new OmniRateLimitError(0);\n case 503: throw new OmniUpstreamError(detail);\n default: {\n const { OmniError } = await import(\"./errors.js\");\n throw new OmniError(\n `API error ${response.status}: ${detail}`,\n response.status,\n \"api_error\",\n detail,\n );\n }\n }\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n AddressEnrichParams,\n AddressEnrichResponse,\n GeocodeParams,\n GeocodeResponse,\n ReverseGeocodeParams,\n ReverseGeocodeResponse,\n} from \"./types.js\";\n\nexport class GeoModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Enrich a Dutch address with BAG data, coordinates, neighbourhood\n * statistics, energy labels and more.\n *\n * @example\n * const result = await omni.geo.enrichAddress({ postcode: \"1012LG\", houseNumber: \"1\" });\n */\n async enrichAddress(params: AddressEnrichParams): Promise<AddressEnrichResponse> {\n return this.http.get<AddressEnrichResponse>(\"/v1/geo/address-enrich\", {\n postcode: params.postcode,\n house_number: params.houseNumber,\n });\n }\n\n /**\n * Free-text address search via PDOK Locatieserver.\n * Returns coordinates, postcode, BAG ID and more.\n *\n * @example\n * const result = await omni.geo.geocode({ q: \"Damrak 1 Amsterdam\" });\n */\n async geocode(params: GeocodeParams): Promise<GeocodeResponse> {\n return this.http.get<GeocodeResponse>(\"/v1/geo/geocode\", {\n q: params.q,\n rows: params.rows,\n });\n }\n\n /**\n * Convert WGS84 coordinates to the nearest Dutch address.\n *\n * @example\n * const result = await omni.geo.reverseGeocode({ lat: 52.3756, lon: 4.8951 });\n */\n async reverseGeocode(params: ReverseGeocodeParams): Promise<ReverseGeocodeResponse> {\n return this.http.get<ReverseGeocodeResponse>(\"/v1/geo/reverse-geocode\", {\n lat: params.lat,\n lon: params.lon,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n IbanToBicParams,\n IbanToBicResponse,\n VatVerifyParams,\n VatVerifyResponse,\n ExchangeRatesResponse,\n VatRatesParams,\n VatRatesResponse,\n} from \"./types.js\";\n\nexport class FinanceModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Resolve an IBAN to its BIC/SWIFT code and bank name.\n *\n * @example\n * const result = await omni.finance.ibanToBic({ iban: \"NL91ABNA0417164300\" });\n */\n async ibanToBic(params: IbanToBicParams): Promise<IbanToBicResponse> {\n return this.http.get<IbanToBicResponse>(\"/v1/finance/iban-to-bic\", {\n iban: params.iban,\n });\n }\n\n /**\n * Verify a Dutch BTW (VAT) number via the EU VIES service and return\n * company metadata.\n *\n * @example\n * const result = await omni.finance.vatVerify({ vatNumber: \"NL123456782B01\" });\n */\n async vatVerify(params: VatVerifyParams): Promise<VatVerifyResponse> {\n return this.http.get<VatVerifyResponse>(\"/v1/finance/vat-verify\", {\n vat_number: params.vatNumber,\n });\n }\n\n /**\n * Daily ECB euro foreign exchange reference rates (~30 currencies).\n * Cached for 4 hours.\n *\n * @example\n * const result = await omni.finance.exchangeRates();\n * console.log(result.rates.USD);\n */\n async exchangeRates(): Promise<ExchangeRatesResponse> {\n return this.http.get<ExchangeRatesResponse>(\"/v1/finance/exchange-rates\", {});\n }\n\n /**\n * Official VAT rates for any EU/EEA country plus GB, NO, CH.\n * Includes per-category breakdown for NL.\n *\n * @example\n * const result = await omni.finance.vatRates({ country: \"NL\" });\n */\n async vatRates(params?: VatRatesParams): Promise<VatRatesResponse> {\n return this.http.get<VatRatesResponse>(\"/v1/finance/vat-rates\", {\n country: params?.country,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { ValidateFinanceParams, FinanceValidationResponse } from \"./types.js\";\n\nexport class ComplianceModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Validate a Dutch BSN or IBAN number using checksum algorithms.\n *\n * @example\n * const result = await omni.compliance.validateFinance({ type: \"iban\", number: \"NL91ABNA0417164300\" });\n */\n async validateFinance(params: ValidateFinanceParams): Promise<FinanceValidationResponse> {\n return this.http.get<FinanceValidationResponse>(\"/v1/compliance/validate-finance\", {\n type: params.type,\n number: params.number,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n MinimumWageParams,\n MinimumWageResponse,\n HolidaySurchargeParams,\n HolidaySurchargeResponse,\n} from \"./types.js\";\n\nexport class HrModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Look up the current Dutch statutory minimum wage for a given age.\n *\n * @example\n * const result = await omni.hr.minimumWage({ age: 21 });\n */\n async minimumWage(params: MinimumWageParams): Promise<MinimumWageResponse> {\n const today = new Date().toISOString().slice(0, 10);\n return this.http.get<MinimumWageResponse>(\"/v1/hr/minimum-wage\", {\n age: params.age,\n date: params.date ?? today,\n });\n }\n\n /**\n * Check whether a given date is a public holiday (and get the applicable\n * surcharge multiplier for a given industry).\n *\n * @example\n * const result = await omni.hr.holidaySurcharge({ date: \"2024-12-25\", industry: \"retail\" });\n */\n async holidaySurcharge(params: HolidaySurchargeParams): Promise<HolidaySurchargeResponse> {\n return this.http.get<HolidaySurchargeResponse>(\"/v1/hr/holiday-surcharge\", {\n date: params.date,\n industry: params.industry,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { EnergyLabelParams, EnergyLabelResponse } from \"./types.js\";\n\nexport class RealEstateModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Retrieve the official EP-Online energy label for a Dutch address.\n *\n * @example\n * const result = await omni.realEstate.energyLabel({ postcode: \"1012LG\", houseNumber: 1 });\n */\n async energyLabel(params: EnergyLabelParams): Promise<EnergyLabelResponse> {\n return this.http.get<EnergyLabelResponse>(\"/v1/real-estate/energy-label\", {\n postcode: params.postcode,\n house_number: params.houseNumber,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n EmissionZoneParams,\n EmissionZoneResponse,\n TransitDisruptionsParams,\n TransitDisruptionsResponse,\n VehicleHistoryParams,\n VehicleHistoryResponse,\n} from \"./types.js\";\n\nexport class LogisticsModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Check whether a vehicle (by Dutch licence plate / kenteken) is allowed\n * in a zero-emission zone (ZE-zone).\n *\n * @example\n * const result = await omni.logistics.emissionZone({ kenteken: \"AB123C\" });\n */\n async emissionZone(params: EmissionZoneParams): Promise<EmissionZoneResponse> {\n return this.http.get<EmissionZoneResponse>(\"/v1/logistics/emission-zone\", {\n kenteken: params.kenteken,\n });\n }\n\n /**\n * Retrieve current and upcoming NS train disruptions, optionally filtered\n * by station code.\n *\n * @example\n * const result = await omni.logistics.transitDisruptions({ stationCode: \"ASD\" });\n */\n async transitDisruptions(params?: TransitDisruptionsParams): Promise<TransitDisruptionsResponse> {\n return this.http.get<TransitDisruptionsResponse>(\"/v1/logistics/transit-disruptions\", {\n station_code: params?.stationCode,\n });\n }\n\n /**\n * Full vehicle record by Dutch licence plate, assembled from 4 RDW Open\n * Data datasets: registration, fuel/emissions, APK and recalls.\n *\n * @example\n * const result = await omni.logistics.vehicleHistory({ kenteken: \"AB-123-C\" });\n */\n async vehicleHistory(params: VehicleHistoryParams): Promise<VehicleHistoryResponse> {\n return this.http.get<VehicleHistoryResponse>(\"/v1/logistics/vehicle-history\", {\n kenteken: params.kenteken,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { GridTriggerParams, GridTriggerResponse } from \"./types.js\";\n\nexport class EnergyModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Retrieve the current Dutch electricity grid congestion status for a\n * given postal code / province.\n *\n * @example\n * const result = await omni.energy.gridTrigger();\n * const result = await omni.energy.gridTrigger({ countryCode: \"NL\" });\n */\n async gridTrigger(params?: GridTriggerParams): Promise<GridTriggerResponse> {\n return this.http.get<GridTriggerResponse>(\"/v1/energy/grid-trigger\", {\n country_code: params?.countryCode,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n RegisterWebhookParams,\n WebhookCreatedResponse,\n WebhookListResponse,\n} from \"./types.js\";\n\nexport class WebhooksModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Register a new outbound webhook. OmniZoek will POST to `url` whenever\n * any of the specified `events` fire.\n *\n * @example\n * const wh = await omni.webhooks.register({\n * url: \"https://example.com/hook\",\n * events: [\"quota.warning\"],\n * });\n */\n async register(params: RegisterWebhookParams): Promise<WebhookCreatedResponse> {\n return this.http.post<WebhookCreatedResponse>(\"/v1/webhooks\", {\n url: params.url,\n events: params.events,\n });\n }\n\n /**\n * List all registered webhooks for this API key.\n *\n * @example\n * const { webhooks } = await omni.webhooks.list();\n */\n async list(): Promise<WebhookListResponse> {\n return this.http.get<WebhookListResponse>(\"/v1/webhooks\");\n }\n\n /**\n * Delete a webhook by its ID.\n *\n * @example\n * await omni.webhooks.delete(\"wh_abc123\");\n */\n async delete(webhookId: string): Promise<void> {\n return this.http.delete(`/v1/webhooks/${encodeURIComponent(webhookId)}`);\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { LeiLookupParams, LeiLookupResponse, LeiSearchResponse } from \"./types.js\";\n\nexport class BusinessModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Look up a company by LEI code (exact) or name (fuzzy search) via GLEIF.\n *\n * - Provide `lei` for a single-record lookup.\n * - Provide `name` (and optionally `country`) for a name search.\n *\n * @example\n * // Exact lookup\n * const result = await omni.business.leiLookup({ lei: \"5493001KJTIIGC8Y1R12\" });\n *\n * // Name search\n * const result = await omni.business.leiLookup({ name: \"ING Bank\", country: \"NL\" });\n */\n async leiLookup(\n params: LeiLookupParams,\n ): Promise<LeiLookupResponse | LeiSearchResponse> {\n return this.http.get<LeiLookupResponse | LeiSearchResponse>(\n \"/v1/business/lei-lookup\",\n {\n lei: params.lei,\n name: params.name,\n country: params.country,\n rows: params.rows,\n },\n );\n }\n}\n","import { HttpClient, type OmniClientOptions } from \"./client.js\";\nimport { GeoModule } from \"./geo.js\";\nimport { FinanceModule } from \"./finance.js\";\nimport { ComplianceModule } from \"./compliance.js\";\nimport { HrModule } from \"./hr.js\";\nimport { RealEstateModule } from \"./realEstate.js\";\nimport { LogisticsModule } from \"./logistics.js\";\nimport { EnergyModule } from \"./energy.js\";\nimport { WebhooksModule } from \"./webhooks.js\";\nimport { BusinessModule } from \"./business.js\";\n\nexport { type OmniClientOptions };\n\n/**\n * The main entry point for the OmniZoek SDK.\n *\n * @example\n * ```ts\n * import { OmniClient } from \"@omnizoek/sdk\";\n *\n * const omni = new OmniClient({ apiKey: \"omni_live_…\" });\n *\n * const address = await omni.geo.enrichAddress({ postcode: \"1012LG\", houseNumber: 1 });\n * const wage = await omni.hr.minimumWage({ age: 21 });\n * ```\n */\nexport class OmniClient {\n /** Geographic address enrichment, geocoding and reverse geocoding */\n readonly geo: GeoModule;\n /** Financial utilities (IBAN → BIC, VAT verification, exchange rates, VAT rates) */\n readonly finance: FinanceModule;\n /** Compliance checks (financial institution registers) */\n readonly compliance: ComplianceModule;\n /** HR calculations (minimum wage, holiday surcharge) */\n readonly hr: HrModule;\n /** Real-estate data (EP-Online energy labels) */\n readonly realEstate: RealEstateModule;\n /** Logistics (ZE-zones, NS disruptions, vehicle history) */\n readonly logistics: LogisticsModule;\n /** Energy (grid congestion triggers) */\n readonly energy: EnergyModule;\n /** Business entity lookup (LEI via GLEIF) */\n readonly business: BusinessModule;\n /** Outbound webhooks (register, list, delete) */\n readonly webhooks: WebhooksModule;\n\n constructor(options: OmniClientOptions) {\n const http = new HttpClient(options);\n this.geo = new GeoModule(http);\n this.finance = new FinanceModule(http);\n this.compliance = new ComplianceModule(http);\n this.hr = new HrModule(http);\n this.realEstate = new RealEstateModule(http);\n this.logistics = new LogisticsModule(http);\n this.energy = new EnergyModule(http);\n this.business = new BusinessModule(http);\n this.webhooks = new WebhooksModule(http);\n }\n}\n","// Main entry point\nexport { OmniClient } from \"./OmniClient.js\";\nexport type { OmniClientOptions } from \"./OmniClient.js\";\n\n// Typed error classes\nexport {\n OmniError,\n OmniAuthError,\n OmniNotFoundError,\n OmniValidationError,\n OmniRateLimitError,\n OmniUpstreamError,\n OmniNetworkError,\n} from \"./errors.js\";\n\n// All request/response types\nexport type {\n AddressEnrichParams,\n AddressEnrichResponse,\n GeocodeParams,\n GeocodeResponse,\n GeocodeResultItem,\n ReverseGeocodeParams,\n ReverseGeocodeResponse,\n IbanToBicParams,\n IbanToBicResponse,\n VatVerifyParams,\n VatVerifyResponse,\n ExchangeRatesResponse,\n VatRatesParams,\n VatRatesResponse,\n VatCategoryItem,\n ValidateFinanceParams,\n FinanceValidationResponse,\n MinimumWageParams,\n MinimumWageResponse,\n HolidaySurchargeParams,\n HolidaySurchargeResponse,\n EnergyLabelParams,\n EnergyLabelResponse,\n EmissionZoneParams,\n EmissionZoneResponse,\n TransitDisruptionsParams,\n TransitDisruptionsResponse,\n VehicleHistoryParams,\n VehicleHistoryResponse,\n RecallItem,\n LeiLookupParams,\n LeiLookupResponse,\n LeiSearchResponse,\n LeiRecord,\n LeiAddress,\n GridTriggerParams,\n GridTriggerResponse,\n RegisterWebhookParams,\n WebhookCreatedResponse,\n WebhookSummary,\n WebhookListResponse,\n} from \"./types.js\";\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -170,6 +170,153 @@ interface GridTriggerResponse {
|
|
|
170
170
|
period_end: string | null;
|
|
171
171
|
retrieved_at: string;
|
|
172
172
|
}
|
|
173
|
+
interface ExchangeRatesResponse {
|
|
174
|
+
base: string;
|
|
175
|
+
date: string;
|
|
176
|
+
rates: Record<string, number>;
|
|
177
|
+
source: string;
|
|
178
|
+
}
|
|
179
|
+
interface VatCategoryItem {
|
|
180
|
+
name: string;
|
|
181
|
+
description: string;
|
|
182
|
+
rate: number;
|
|
183
|
+
examples: string[];
|
|
184
|
+
}
|
|
185
|
+
interface VatRatesParams {
|
|
186
|
+
/** ISO alpha-2 country code (default: "NL") */
|
|
187
|
+
country?: string;
|
|
188
|
+
}
|
|
189
|
+
interface VatRatesResponse {
|
|
190
|
+
country: string;
|
|
191
|
+
currency: string;
|
|
192
|
+
standard_rate: number;
|
|
193
|
+
reduced_rates: number[];
|
|
194
|
+
zero_rate: boolean;
|
|
195
|
+
categories: VatCategoryItem[];
|
|
196
|
+
effective_date: string;
|
|
197
|
+
source: string;
|
|
198
|
+
note: string | null;
|
|
199
|
+
}
|
|
200
|
+
interface GeocodeParams {
|
|
201
|
+
q: string;
|
|
202
|
+
/** Max results 1–10 (default: 5) */
|
|
203
|
+
rows?: number;
|
|
204
|
+
}
|
|
205
|
+
interface GeocodeResultItem {
|
|
206
|
+
display_name: string;
|
|
207
|
+
type: string;
|
|
208
|
+
lat: number | null;
|
|
209
|
+
lon: number | null;
|
|
210
|
+
postcode: string | null;
|
|
211
|
+
city: string | null;
|
|
212
|
+
municipality: string | null;
|
|
213
|
+
province: string | null;
|
|
214
|
+
street: string | null;
|
|
215
|
+
house_number: string | null;
|
|
216
|
+
bag_id: string | null;
|
|
217
|
+
score: number | null;
|
|
218
|
+
}
|
|
219
|
+
interface GeocodeResponse {
|
|
220
|
+
query: string;
|
|
221
|
+
results: GeocodeResultItem[];
|
|
222
|
+
}
|
|
223
|
+
interface ReverseGeocodeParams {
|
|
224
|
+
lat: number;
|
|
225
|
+
lon: number;
|
|
226
|
+
}
|
|
227
|
+
interface ReverseGeocodeResponse {
|
|
228
|
+
lat: number;
|
|
229
|
+
lon: number;
|
|
230
|
+
display_name: string;
|
|
231
|
+
type: string;
|
|
232
|
+
postcode: string | null;
|
|
233
|
+
city: string | null;
|
|
234
|
+
municipality: string | null;
|
|
235
|
+
province: string | null;
|
|
236
|
+
street: string | null;
|
|
237
|
+
house_number: string | null;
|
|
238
|
+
bag_id: string | null;
|
|
239
|
+
}
|
|
240
|
+
interface LeiAddress {
|
|
241
|
+
lines: string[];
|
|
242
|
+
city: string | null;
|
|
243
|
+
region: string | null;
|
|
244
|
+
country: string | null;
|
|
245
|
+
postal_code: string | null;
|
|
246
|
+
}
|
|
247
|
+
interface LeiRecord {
|
|
248
|
+
lei: string;
|
|
249
|
+
legal_name: string;
|
|
250
|
+
other_names: string[];
|
|
251
|
+
legal_form: string | null;
|
|
252
|
+
jurisdiction: string | null;
|
|
253
|
+
status: string;
|
|
254
|
+
registered_address: LeiAddress;
|
|
255
|
+
headquarters_address: LeiAddress;
|
|
256
|
+
registration_date: string | null;
|
|
257
|
+
last_updated: string | null;
|
|
258
|
+
next_renewal: string | null;
|
|
259
|
+
bic_codes: string[];
|
|
260
|
+
parent_lei: string | null;
|
|
261
|
+
}
|
|
262
|
+
interface LeiLookupParams {
|
|
263
|
+
/** 20-character LEI code */
|
|
264
|
+
lei?: string;
|
|
265
|
+
/** Company name for fuzzy search */
|
|
266
|
+
name?: string;
|
|
267
|
+
/** ISO alpha-2 country filter for name search */
|
|
268
|
+
country?: string;
|
|
269
|
+
/** Max name-search results (1–10, default: 5) */
|
|
270
|
+
rows?: number;
|
|
271
|
+
}
|
|
272
|
+
/** Returned when `lei` param is used — single record */
|
|
273
|
+
type LeiLookupResponse = LeiRecord;
|
|
274
|
+
/** Returned when `name` param is used — list of matches */
|
|
275
|
+
interface LeiSearchResponse {
|
|
276
|
+
query: string;
|
|
277
|
+
country_filter: string | null;
|
|
278
|
+
results: LeiRecord[];
|
|
279
|
+
}
|
|
280
|
+
interface RecallItem {
|
|
281
|
+
reference_code: string;
|
|
282
|
+
code_status: string;
|
|
283
|
+
status: string;
|
|
284
|
+
}
|
|
285
|
+
interface VehicleHistoryParams {
|
|
286
|
+
kenteken: string;
|
|
287
|
+
}
|
|
288
|
+
interface VehicleHistoryResponse {
|
|
289
|
+
kenteken: string;
|
|
290
|
+
make: string | null;
|
|
291
|
+
commercial_name: string | null;
|
|
292
|
+
vehicle_type: string | null;
|
|
293
|
+
body_style: string | null;
|
|
294
|
+
eu_vehicle_category: string | null;
|
|
295
|
+
first_admission_date: string | null;
|
|
296
|
+
registration_date: string | null;
|
|
297
|
+
primary_color: string | null;
|
|
298
|
+
secondary_color: string | null;
|
|
299
|
+
seats: number | null;
|
|
300
|
+
doors: number | null;
|
|
301
|
+
cylinders: number | null;
|
|
302
|
+
engine_displacement_cc: number | null;
|
|
303
|
+
curb_weight_kg: number | null;
|
|
304
|
+
max_weight_kg: number | null;
|
|
305
|
+
catalog_price_eur: number | null;
|
|
306
|
+
bruto_bpm_eur: number | null;
|
|
307
|
+
wam_insured: boolean | null;
|
|
308
|
+
fuel_types: string[];
|
|
309
|
+
euro_standard: string | null;
|
|
310
|
+
emission_class: string | null;
|
|
311
|
+
max_power_kw: number | null;
|
|
312
|
+
co2_combined_g_km: number | null;
|
|
313
|
+
fuel_consumption_combined_l100km: number | null;
|
|
314
|
+
noise_level_db: number | null;
|
|
315
|
+
apk_expiry_date: string | null;
|
|
316
|
+
apk_days_remaining: number | null;
|
|
317
|
+
open_recalls: RecallItem[];
|
|
318
|
+
open_recall_count: number;
|
|
319
|
+
}
|
|
173
320
|
type OmniWebhookEvent = "key.created" | "key.test_created" | "quota.warning" | "quota.exceeded";
|
|
174
321
|
interface RegisterWebhookParams {
|
|
175
322
|
url: string;
|
|
@@ -204,9 +351,24 @@ declare class GeoModule {
|
|
|
204
351
|
* statistics, energy labels and more.
|
|
205
352
|
*
|
|
206
353
|
* @example
|
|
207
|
-
* const result = await omni.geo.enrichAddress({ postcode: "1012LG", houseNumber: 1 });
|
|
354
|
+
* const result = await omni.geo.enrichAddress({ postcode: "1012LG", houseNumber: "1" });
|
|
208
355
|
*/
|
|
209
356
|
enrichAddress(params: AddressEnrichParams): Promise<AddressEnrichResponse>;
|
|
357
|
+
/**
|
|
358
|
+
* Free-text address search via PDOK Locatieserver.
|
|
359
|
+
* Returns coordinates, postcode, BAG ID and more.
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
* const result = await omni.geo.geocode({ q: "Damrak 1 Amsterdam" });
|
|
363
|
+
*/
|
|
364
|
+
geocode(params: GeocodeParams): Promise<GeocodeResponse>;
|
|
365
|
+
/**
|
|
366
|
+
* Convert WGS84 coordinates to the nearest Dutch address.
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* const result = await omni.geo.reverseGeocode({ lat: 52.3756, lon: 4.8951 });
|
|
370
|
+
*/
|
|
371
|
+
reverseGeocode(params: ReverseGeocodeParams): Promise<ReverseGeocodeResponse>;
|
|
210
372
|
}
|
|
211
373
|
|
|
212
374
|
declare class FinanceModule {
|
|
@@ -227,6 +389,23 @@ declare class FinanceModule {
|
|
|
227
389
|
* const result = await omni.finance.vatVerify({ vatNumber: "NL123456782B01" });
|
|
228
390
|
*/
|
|
229
391
|
vatVerify(params: VatVerifyParams): Promise<VatVerifyResponse>;
|
|
392
|
+
/**
|
|
393
|
+
* Daily ECB euro foreign exchange reference rates (~30 currencies).
|
|
394
|
+
* Cached for 4 hours.
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* const result = await omni.finance.exchangeRates();
|
|
398
|
+
* console.log(result.rates.USD);
|
|
399
|
+
*/
|
|
400
|
+
exchangeRates(): Promise<ExchangeRatesResponse>;
|
|
401
|
+
/**
|
|
402
|
+
* Official VAT rates for any EU/EEA country plus GB, NO, CH.
|
|
403
|
+
* Includes per-category breakdown for NL.
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* const result = await omni.finance.vatRates({ country: "NL" });
|
|
407
|
+
*/
|
|
408
|
+
vatRates(params?: VatRatesParams): Promise<VatRatesResponse>;
|
|
230
409
|
}
|
|
231
410
|
|
|
232
411
|
declare class ComplianceModule {
|
|
@@ -292,6 +471,14 @@ declare class LogisticsModule {
|
|
|
292
471
|
* const result = await omni.logistics.transitDisruptions({ stationCode: "ASD" });
|
|
293
472
|
*/
|
|
294
473
|
transitDisruptions(params?: TransitDisruptionsParams): Promise<TransitDisruptionsResponse>;
|
|
474
|
+
/**
|
|
475
|
+
* Full vehicle record by Dutch licence plate, assembled from 4 RDW Open
|
|
476
|
+
* Data datasets: registration, fuel/emissions, APK and recalls.
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* const result = await omni.logistics.vehicleHistory({ kenteken: "AB-123-C" });
|
|
480
|
+
*/
|
|
481
|
+
vehicleHistory(params: VehicleHistoryParams): Promise<VehicleHistoryResponse>;
|
|
295
482
|
}
|
|
296
483
|
|
|
297
484
|
declare class EnergyModule {
|
|
@@ -338,6 +525,25 @@ declare class WebhooksModule {
|
|
|
338
525
|
delete(webhookId: string): Promise<void>;
|
|
339
526
|
}
|
|
340
527
|
|
|
528
|
+
declare class BusinessModule {
|
|
529
|
+
private readonly http;
|
|
530
|
+
constructor(http: HttpClient);
|
|
531
|
+
/**
|
|
532
|
+
* Look up a company by LEI code (exact) or name (fuzzy search) via GLEIF.
|
|
533
|
+
*
|
|
534
|
+
* - Provide `lei` for a single-record lookup.
|
|
535
|
+
* - Provide `name` (and optionally `country`) for a name search.
|
|
536
|
+
*
|
|
537
|
+
* @example
|
|
538
|
+
* // Exact lookup
|
|
539
|
+
* const result = await omni.business.leiLookup({ lei: "5493001KJTIIGC8Y1R12" });
|
|
540
|
+
*
|
|
541
|
+
* // Name search
|
|
542
|
+
* const result = await omni.business.leiLookup({ name: "ING Bank", country: "NL" });
|
|
543
|
+
*/
|
|
544
|
+
leiLookup(params: LeiLookupParams): Promise<LeiLookupResponse | LeiSearchResponse>;
|
|
545
|
+
}
|
|
546
|
+
|
|
341
547
|
/**
|
|
342
548
|
* The main entry point for the OmniZoek SDK.
|
|
343
549
|
*
|
|
@@ -352,9 +558,9 @@ declare class WebhooksModule {
|
|
|
352
558
|
* ```
|
|
353
559
|
*/
|
|
354
560
|
declare class OmniClient {
|
|
355
|
-
/** Geographic address enrichment
|
|
561
|
+
/** Geographic address enrichment, geocoding and reverse geocoding */
|
|
356
562
|
readonly geo: GeoModule;
|
|
357
|
-
/** Financial utilities (IBAN → BIC, VAT verification) */
|
|
563
|
+
/** Financial utilities (IBAN → BIC, VAT verification, exchange rates, VAT rates) */
|
|
358
564
|
readonly finance: FinanceModule;
|
|
359
565
|
/** Compliance checks (financial institution registers) */
|
|
360
566
|
readonly compliance: ComplianceModule;
|
|
@@ -362,10 +568,12 @@ declare class OmniClient {
|
|
|
362
568
|
readonly hr: HrModule;
|
|
363
569
|
/** Real-estate data (EP-Online energy labels) */
|
|
364
570
|
readonly realEstate: RealEstateModule;
|
|
365
|
-
/** Logistics (ZE-zones, NS disruptions) */
|
|
571
|
+
/** Logistics (ZE-zones, NS disruptions, vehicle history) */
|
|
366
572
|
readonly logistics: LogisticsModule;
|
|
367
573
|
/** Energy (grid congestion triggers) */
|
|
368
574
|
readonly energy: EnergyModule;
|
|
575
|
+
/** Business entity lookup (LEI via GLEIF) */
|
|
576
|
+
readonly business: BusinessModule;
|
|
369
577
|
/** Outbound webhooks (register, list, delete) */
|
|
370
578
|
readonly webhooks: WebhooksModule;
|
|
371
579
|
constructor(options: OmniClientOptions);
|
|
@@ -407,4 +615,4 @@ declare class OmniNetworkError extends Error {
|
|
|
407
615
|
constructor(cause: unknown);
|
|
408
616
|
}
|
|
409
617
|
|
|
410
|
-
export { type AddressEnrichParams, type AddressEnrichResponse, type EmissionZoneParams, type EmissionZoneResponse, type EnergyLabelParams, type EnergyLabelResponse, type FinanceValidationResponse, type GridTriggerParams, type GridTriggerResponse, type HolidaySurchargeParams, type HolidaySurchargeResponse, type IbanToBicParams, type IbanToBicResponse, type MinimumWageParams, type MinimumWageResponse, OmniAuthError, OmniClient, type OmniClientOptions, OmniError, OmniNetworkError, OmniNotFoundError, OmniRateLimitError, OmniUpstreamError, OmniValidationError, type RegisterWebhookParams, type TransitDisruptionsParams, type TransitDisruptionsResponse, type ValidateFinanceParams, type VatVerifyParams, type VatVerifyResponse, type WebhookCreatedResponse, type WebhookListResponse, type WebhookSummary };
|
|
618
|
+
export { type AddressEnrichParams, type AddressEnrichResponse, type EmissionZoneParams, type EmissionZoneResponse, type EnergyLabelParams, type EnergyLabelResponse, type ExchangeRatesResponse, type FinanceValidationResponse, type GeocodeParams, type GeocodeResponse, type GeocodeResultItem, type GridTriggerParams, type GridTriggerResponse, type HolidaySurchargeParams, type HolidaySurchargeResponse, type IbanToBicParams, type IbanToBicResponse, type LeiAddress, type LeiLookupParams, type LeiLookupResponse, type LeiRecord, type LeiSearchResponse, type MinimumWageParams, type MinimumWageResponse, OmniAuthError, OmniClient, type OmniClientOptions, OmniError, OmniNetworkError, OmniNotFoundError, OmniRateLimitError, OmniUpstreamError, OmniValidationError, type RecallItem, type RegisterWebhookParams, type ReverseGeocodeParams, type ReverseGeocodeResponse, type TransitDisruptionsParams, type TransitDisruptionsResponse, type ValidateFinanceParams, type VatCategoryItem, type VatRatesParams, type VatRatesResponse, type VatVerifyParams, type VatVerifyResponse, type VehicleHistoryParams, type VehicleHistoryResponse, type WebhookCreatedResponse, type WebhookListResponse, type WebhookSummary };
|
package/dist/index.d.ts
CHANGED
|
@@ -170,6 +170,153 @@ interface GridTriggerResponse {
|
|
|
170
170
|
period_end: string | null;
|
|
171
171
|
retrieved_at: string;
|
|
172
172
|
}
|
|
173
|
+
interface ExchangeRatesResponse {
|
|
174
|
+
base: string;
|
|
175
|
+
date: string;
|
|
176
|
+
rates: Record<string, number>;
|
|
177
|
+
source: string;
|
|
178
|
+
}
|
|
179
|
+
interface VatCategoryItem {
|
|
180
|
+
name: string;
|
|
181
|
+
description: string;
|
|
182
|
+
rate: number;
|
|
183
|
+
examples: string[];
|
|
184
|
+
}
|
|
185
|
+
interface VatRatesParams {
|
|
186
|
+
/** ISO alpha-2 country code (default: "NL") */
|
|
187
|
+
country?: string;
|
|
188
|
+
}
|
|
189
|
+
interface VatRatesResponse {
|
|
190
|
+
country: string;
|
|
191
|
+
currency: string;
|
|
192
|
+
standard_rate: number;
|
|
193
|
+
reduced_rates: number[];
|
|
194
|
+
zero_rate: boolean;
|
|
195
|
+
categories: VatCategoryItem[];
|
|
196
|
+
effective_date: string;
|
|
197
|
+
source: string;
|
|
198
|
+
note: string | null;
|
|
199
|
+
}
|
|
200
|
+
interface GeocodeParams {
|
|
201
|
+
q: string;
|
|
202
|
+
/** Max results 1–10 (default: 5) */
|
|
203
|
+
rows?: number;
|
|
204
|
+
}
|
|
205
|
+
interface GeocodeResultItem {
|
|
206
|
+
display_name: string;
|
|
207
|
+
type: string;
|
|
208
|
+
lat: number | null;
|
|
209
|
+
lon: number | null;
|
|
210
|
+
postcode: string | null;
|
|
211
|
+
city: string | null;
|
|
212
|
+
municipality: string | null;
|
|
213
|
+
province: string | null;
|
|
214
|
+
street: string | null;
|
|
215
|
+
house_number: string | null;
|
|
216
|
+
bag_id: string | null;
|
|
217
|
+
score: number | null;
|
|
218
|
+
}
|
|
219
|
+
interface GeocodeResponse {
|
|
220
|
+
query: string;
|
|
221
|
+
results: GeocodeResultItem[];
|
|
222
|
+
}
|
|
223
|
+
interface ReverseGeocodeParams {
|
|
224
|
+
lat: number;
|
|
225
|
+
lon: number;
|
|
226
|
+
}
|
|
227
|
+
interface ReverseGeocodeResponse {
|
|
228
|
+
lat: number;
|
|
229
|
+
lon: number;
|
|
230
|
+
display_name: string;
|
|
231
|
+
type: string;
|
|
232
|
+
postcode: string | null;
|
|
233
|
+
city: string | null;
|
|
234
|
+
municipality: string | null;
|
|
235
|
+
province: string | null;
|
|
236
|
+
street: string | null;
|
|
237
|
+
house_number: string | null;
|
|
238
|
+
bag_id: string | null;
|
|
239
|
+
}
|
|
240
|
+
interface LeiAddress {
|
|
241
|
+
lines: string[];
|
|
242
|
+
city: string | null;
|
|
243
|
+
region: string | null;
|
|
244
|
+
country: string | null;
|
|
245
|
+
postal_code: string | null;
|
|
246
|
+
}
|
|
247
|
+
interface LeiRecord {
|
|
248
|
+
lei: string;
|
|
249
|
+
legal_name: string;
|
|
250
|
+
other_names: string[];
|
|
251
|
+
legal_form: string | null;
|
|
252
|
+
jurisdiction: string | null;
|
|
253
|
+
status: string;
|
|
254
|
+
registered_address: LeiAddress;
|
|
255
|
+
headquarters_address: LeiAddress;
|
|
256
|
+
registration_date: string | null;
|
|
257
|
+
last_updated: string | null;
|
|
258
|
+
next_renewal: string | null;
|
|
259
|
+
bic_codes: string[];
|
|
260
|
+
parent_lei: string | null;
|
|
261
|
+
}
|
|
262
|
+
interface LeiLookupParams {
|
|
263
|
+
/** 20-character LEI code */
|
|
264
|
+
lei?: string;
|
|
265
|
+
/** Company name for fuzzy search */
|
|
266
|
+
name?: string;
|
|
267
|
+
/** ISO alpha-2 country filter for name search */
|
|
268
|
+
country?: string;
|
|
269
|
+
/** Max name-search results (1–10, default: 5) */
|
|
270
|
+
rows?: number;
|
|
271
|
+
}
|
|
272
|
+
/** Returned when `lei` param is used — single record */
|
|
273
|
+
type LeiLookupResponse = LeiRecord;
|
|
274
|
+
/** Returned when `name` param is used — list of matches */
|
|
275
|
+
interface LeiSearchResponse {
|
|
276
|
+
query: string;
|
|
277
|
+
country_filter: string | null;
|
|
278
|
+
results: LeiRecord[];
|
|
279
|
+
}
|
|
280
|
+
interface RecallItem {
|
|
281
|
+
reference_code: string;
|
|
282
|
+
code_status: string;
|
|
283
|
+
status: string;
|
|
284
|
+
}
|
|
285
|
+
interface VehicleHistoryParams {
|
|
286
|
+
kenteken: string;
|
|
287
|
+
}
|
|
288
|
+
interface VehicleHistoryResponse {
|
|
289
|
+
kenteken: string;
|
|
290
|
+
make: string | null;
|
|
291
|
+
commercial_name: string | null;
|
|
292
|
+
vehicle_type: string | null;
|
|
293
|
+
body_style: string | null;
|
|
294
|
+
eu_vehicle_category: string | null;
|
|
295
|
+
first_admission_date: string | null;
|
|
296
|
+
registration_date: string | null;
|
|
297
|
+
primary_color: string | null;
|
|
298
|
+
secondary_color: string | null;
|
|
299
|
+
seats: number | null;
|
|
300
|
+
doors: number | null;
|
|
301
|
+
cylinders: number | null;
|
|
302
|
+
engine_displacement_cc: number | null;
|
|
303
|
+
curb_weight_kg: number | null;
|
|
304
|
+
max_weight_kg: number | null;
|
|
305
|
+
catalog_price_eur: number | null;
|
|
306
|
+
bruto_bpm_eur: number | null;
|
|
307
|
+
wam_insured: boolean | null;
|
|
308
|
+
fuel_types: string[];
|
|
309
|
+
euro_standard: string | null;
|
|
310
|
+
emission_class: string | null;
|
|
311
|
+
max_power_kw: number | null;
|
|
312
|
+
co2_combined_g_km: number | null;
|
|
313
|
+
fuel_consumption_combined_l100km: number | null;
|
|
314
|
+
noise_level_db: number | null;
|
|
315
|
+
apk_expiry_date: string | null;
|
|
316
|
+
apk_days_remaining: number | null;
|
|
317
|
+
open_recalls: RecallItem[];
|
|
318
|
+
open_recall_count: number;
|
|
319
|
+
}
|
|
173
320
|
type OmniWebhookEvent = "key.created" | "key.test_created" | "quota.warning" | "quota.exceeded";
|
|
174
321
|
interface RegisterWebhookParams {
|
|
175
322
|
url: string;
|
|
@@ -204,9 +351,24 @@ declare class GeoModule {
|
|
|
204
351
|
* statistics, energy labels and more.
|
|
205
352
|
*
|
|
206
353
|
* @example
|
|
207
|
-
* const result = await omni.geo.enrichAddress({ postcode: "1012LG", houseNumber: 1 });
|
|
354
|
+
* const result = await omni.geo.enrichAddress({ postcode: "1012LG", houseNumber: "1" });
|
|
208
355
|
*/
|
|
209
356
|
enrichAddress(params: AddressEnrichParams): Promise<AddressEnrichResponse>;
|
|
357
|
+
/**
|
|
358
|
+
* Free-text address search via PDOK Locatieserver.
|
|
359
|
+
* Returns coordinates, postcode, BAG ID and more.
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
* const result = await omni.geo.geocode({ q: "Damrak 1 Amsterdam" });
|
|
363
|
+
*/
|
|
364
|
+
geocode(params: GeocodeParams): Promise<GeocodeResponse>;
|
|
365
|
+
/**
|
|
366
|
+
* Convert WGS84 coordinates to the nearest Dutch address.
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* const result = await omni.geo.reverseGeocode({ lat: 52.3756, lon: 4.8951 });
|
|
370
|
+
*/
|
|
371
|
+
reverseGeocode(params: ReverseGeocodeParams): Promise<ReverseGeocodeResponse>;
|
|
210
372
|
}
|
|
211
373
|
|
|
212
374
|
declare class FinanceModule {
|
|
@@ -227,6 +389,23 @@ declare class FinanceModule {
|
|
|
227
389
|
* const result = await omni.finance.vatVerify({ vatNumber: "NL123456782B01" });
|
|
228
390
|
*/
|
|
229
391
|
vatVerify(params: VatVerifyParams): Promise<VatVerifyResponse>;
|
|
392
|
+
/**
|
|
393
|
+
* Daily ECB euro foreign exchange reference rates (~30 currencies).
|
|
394
|
+
* Cached for 4 hours.
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* const result = await omni.finance.exchangeRates();
|
|
398
|
+
* console.log(result.rates.USD);
|
|
399
|
+
*/
|
|
400
|
+
exchangeRates(): Promise<ExchangeRatesResponse>;
|
|
401
|
+
/**
|
|
402
|
+
* Official VAT rates for any EU/EEA country plus GB, NO, CH.
|
|
403
|
+
* Includes per-category breakdown for NL.
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* const result = await omni.finance.vatRates({ country: "NL" });
|
|
407
|
+
*/
|
|
408
|
+
vatRates(params?: VatRatesParams): Promise<VatRatesResponse>;
|
|
230
409
|
}
|
|
231
410
|
|
|
232
411
|
declare class ComplianceModule {
|
|
@@ -292,6 +471,14 @@ declare class LogisticsModule {
|
|
|
292
471
|
* const result = await omni.logistics.transitDisruptions({ stationCode: "ASD" });
|
|
293
472
|
*/
|
|
294
473
|
transitDisruptions(params?: TransitDisruptionsParams): Promise<TransitDisruptionsResponse>;
|
|
474
|
+
/**
|
|
475
|
+
* Full vehicle record by Dutch licence plate, assembled from 4 RDW Open
|
|
476
|
+
* Data datasets: registration, fuel/emissions, APK and recalls.
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* const result = await omni.logistics.vehicleHistory({ kenteken: "AB-123-C" });
|
|
480
|
+
*/
|
|
481
|
+
vehicleHistory(params: VehicleHistoryParams): Promise<VehicleHistoryResponse>;
|
|
295
482
|
}
|
|
296
483
|
|
|
297
484
|
declare class EnergyModule {
|
|
@@ -338,6 +525,25 @@ declare class WebhooksModule {
|
|
|
338
525
|
delete(webhookId: string): Promise<void>;
|
|
339
526
|
}
|
|
340
527
|
|
|
528
|
+
declare class BusinessModule {
|
|
529
|
+
private readonly http;
|
|
530
|
+
constructor(http: HttpClient);
|
|
531
|
+
/**
|
|
532
|
+
* Look up a company by LEI code (exact) or name (fuzzy search) via GLEIF.
|
|
533
|
+
*
|
|
534
|
+
* - Provide `lei` for a single-record lookup.
|
|
535
|
+
* - Provide `name` (and optionally `country`) for a name search.
|
|
536
|
+
*
|
|
537
|
+
* @example
|
|
538
|
+
* // Exact lookup
|
|
539
|
+
* const result = await omni.business.leiLookup({ lei: "5493001KJTIIGC8Y1R12" });
|
|
540
|
+
*
|
|
541
|
+
* // Name search
|
|
542
|
+
* const result = await omni.business.leiLookup({ name: "ING Bank", country: "NL" });
|
|
543
|
+
*/
|
|
544
|
+
leiLookup(params: LeiLookupParams): Promise<LeiLookupResponse | LeiSearchResponse>;
|
|
545
|
+
}
|
|
546
|
+
|
|
341
547
|
/**
|
|
342
548
|
* The main entry point for the OmniZoek SDK.
|
|
343
549
|
*
|
|
@@ -352,9 +558,9 @@ declare class WebhooksModule {
|
|
|
352
558
|
* ```
|
|
353
559
|
*/
|
|
354
560
|
declare class OmniClient {
|
|
355
|
-
/** Geographic address enrichment
|
|
561
|
+
/** Geographic address enrichment, geocoding and reverse geocoding */
|
|
356
562
|
readonly geo: GeoModule;
|
|
357
|
-
/** Financial utilities (IBAN → BIC, VAT verification) */
|
|
563
|
+
/** Financial utilities (IBAN → BIC, VAT verification, exchange rates, VAT rates) */
|
|
358
564
|
readonly finance: FinanceModule;
|
|
359
565
|
/** Compliance checks (financial institution registers) */
|
|
360
566
|
readonly compliance: ComplianceModule;
|
|
@@ -362,10 +568,12 @@ declare class OmniClient {
|
|
|
362
568
|
readonly hr: HrModule;
|
|
363
569
|
/** Real-estate data (EP-Online energy labels) */
|
|
364
570
|
readonly realEstate: RealEstateModule;
|
|
365
|
-
/** Logistics (ZE-zones, NS disruptions) */
|
|
571
|
+
/** Logistics (ZE-zones, NS disruptions, vehicle history) */
|
|
366
572
|
readonly logistics: LogisticsModule;
|
|
367
573
|
/** Energy (grid congestion triggers) */
|
|
368
574
|
readonly energy: EnergyModule;
|
|
575
|
+
/** Business entity lookup (LEI via GLEIF) */
|
|
576
|
+
readonly business: BusinessModule;
|
|
369
577
|
/** Outbound webhooks (register, list, delete) */
|
|
370
578
|
readonly webhooks: WebhooksModule;
|
|
371
579
|
constructor(options: OmniClientOptions);
|
|
@@ -407,4 +615,4 @@ declare class OmniNetworkError extends Error {
|
|
|
407
615
|
constructor(cause: unknown);
|
|
408
616
|
}
|
|
409
617
|
|
|
410
|
-
export { type AddressEnrichParams, type AddressEnrichResponse, type EmissionZoneParams, type EmissionZoneResponse, type EnergyLabelParams, type EnergyLabelResponse, type FinanceValidationResponse, type GridTriggerParams, type GridTriggerResponse, type HolidaySurchargeParams, type HolidaySurchargeResponse, type IbanToBicParams, type IbanToBicResponse, type MinimumWageParams, type MinimumWageResponse, OmniAuthError, OmniClient, type OmniClientOptions, OmniError, OmniNetworkError, OmniNotFoundError, OmniRateLimitError, OmniUpstreamError, OmniValidationError, type RegisterWebhookParams, type TransitDisruptionsParams, type TransitDisruptionsResponse, type ValidateFinanceParams, type VatVerifyParams, type VatVerifyResponse, type WebhookCreatedResponse, type WebhookListResponse, type WebhookSummary };
|
|
618
|
+
export { type AddressEnrichParams, type AddressEnrichResponse, type EmissionZoneParams, type EmissionZoneResponse, type EnergyLabelParams, type EnergyLabelResponse, type ExchangeRatesResponse, type FinanceValidationResponse, type GeocodeParams, type GeocodeResponse, type GeocodeResultItem, type GridTriggerParams, type GridTriggerResponse, type HolidaySurchargeParams, type HolidaySurchargeResponse, type IbanToBicParams, type IbanToBicResponse, type LeiAddress, type LeiLookupParams, type LeiLookupResponse, type LeiRecord, type LeiSearchResponse, type MinimumWageParams, type MinimumWageResponse, OmniAuthError, OmniClient, type OmniClientOptions, OmniError, OmniNetworkError, OmniNotFoundError, OmniRateLimitError, OmniUpstreamError, OmniValidationError, type RecallItem, type RegisterWebhookParams, type ReverseGeocodeParams, type ReverseGeocodeResponse, type TransitDisruptionsParams, type TransitDisruptionsResponse, type ValidateFinanceParams, type VatCategoryItem, type VatRatesParams, type VatRatesResponse, type VatVerifyParams, type VatVerifyResponse, type VehicleHistoryParams, type VehicleHistoryResponse, type WebhookCreatedResponse, type WebhookListResponse, type WebhookSummary };
|
package/dist/index.js
CHANGED
|
@@ -223,7 +223,7 @@ var GeoModule = class {
|
|
|
223
223
|
* statistics, energy labels and more.
|
|
224
224
|
*
|
|
225
225
|
* @example
|
|
226
|
-
* const result = await omni.geo.enrichAddress({ postcode: "1012LG", houseNumber: 1 });
|
|
226
|
+
* const result = await omni.geo.enrichAddress({ postcode: "1012LG", houseNumber: "1" });
|
|
227
227
|
*/
|
|
228
228
|
async enrichAddress(params) {
|
|
229
229
|
return this.http.get("/v1/geo/address-enrich", {
|
|
@@ -231,6 +231,31 @@ var GeoModule = class {
|
|
|
231
231
|
house_number: params.houseNumber
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* Free-text address search via PDOK Locatieserver.
|
|
236
|
+
* Returns coordinates, postcode, BAG ID and more.
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* const result = await omni.geo.geocode({ q: "Damrak 1 Amsterdam" });
|
|
240
|
+
*/
|
|
241
|
+
async geocode(params) {
|
|
242
|
+
return this.http.get("/v1/geo/geocode", {
|
|
243
|
+
q: params.q,
|
|
244
|
+
rows: params.rows
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Convert WGS84 coordinates to the nearest Dutch address.
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* const result = await omni.geo.reverseGeocode({ lat: 52.3756, lon: 4.8951 });
|
|
252
|
+
*/
|
|
253
|
+
async reverseGeocode(params) {
|
|
254
|
+
return this.http.get("/v1/geo/reverse-geocode", {
|
|
255
|
+
lat: params.lat,
|
|
256
|
+
lon: params.lon
|
|
257
|
+
});
|
|
258
|
+
}
|
|
234
259
|
};
|
|
235
260
|
|
|
236
261
|
// src/finance.ts
|
|
@@ -261,6 +286,29 @@ var FinanceModule = class {
|
|
|
261
286
|
vat_number: params.vatNumber
|
|
262
287
|
});
|
|
263
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Daily ECB euro foreign exchange reference rates (~30 currencies).
|
|
291
|
+
* Cached for 4 hours.
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* const result = await omni.finance.exchangeRates();
|
|
295
|
+
* console.log(result.rates.USD);
|
|
296
|
+
*/
|
|
297
|
+
async exchangeRates() {
|
|
298
|
+
return this.http.get("/v1/finance/exchange-rates", {});
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Official VAT rates for any EU/EEA country plus GB, NO, CH.
|
|
302
|
+
* Includes per-category breakdown for NL.
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* const result = await omni.finance.vatRates({ country: "NL" });
|
|
306
|
+
*/
|
|
307
|
+
async vatRates(params) {
|
|
308
|
+
return this.http.get("/v1/finance/vat-rates", {
|
|
309
|
+
country: params?.country
|
|
310
|
+
});
|
|
311
|
+
}
|
|
264
312
|
};
|
|
265
313
|
|
|
266
314
|
// src/compliance.ts
|
|
@@ -294,8 +342,10 @@ var HrModule = class {
|
|
|
294
342
|
* const result = await omni.hr.minimumWage({ age: 21 });
|
|
295
343
|
*/
|
|
296
344
|
async minimumWage(params) {
|
|
345
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
297
346
|
return this.http.get("/v1/hr/minimum-wage", {
|
|
298
|
-
age: params.age
|
|
347
|
+
age: params.age,
|
|
348
|
+
date: params.date ?? today
|
|
299
349
|
});
|
|
300
350
|
}
|
|
301
351
|
/**
|
|
@@ -361,6 +411,18 @@ var LogisticsModule = class {
|
|
|
361
411
|
station_code: params?.stationCode
|
|
362
412
|
});
|
|
363
413
|
}
|
|
414
|
+
/**
|
|
415
|
+
* Full vehicle record by Dutch licence plate, assembled from 4 RDW Open
|
|
416
|
+
* Data datasets: registration, fuel/emissions, APK and recalls.
|
|
417
|
+
*
|
|
418
|
+
* @example
|
|
419
|
+
* const result = await omni.logistics.vehicleHistory({ kenteken: "AB-123-C" });
|
|
420
|
+
*/
|
|
421
|
+
async vehicleHistory(params) {
|
|
422
|
+
return this.http.get("/v1/logistics/vehicle-history", {
|
|
423
|
+
kenteken: params.kenteken
|
|
424
|
+
});
|
|
425
|
+
}
|
|
364
426
|
};
|
|
365
427
|
|
|
366
428
|
// src/energy.ts
|
|
@@ -424,6 +486,37 @@ var WebhooksModule = class {
|
|
|
424
486
|
}
|
|
425
487
|
};
|
|
426
488
|
|
|
489
|
+
// src/business.ts
|
|
490
|
+
var BusinessModule = class {
|
|
491
|
+
constructor(http) {
|
|
492
|
+
this.http = http;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Look up a company by LEI code (exact) or name (fuzzy search) via GLEIF.
|
|
496
|
+
*
|
|
497
|
+
* - Provide `lei` for a single-record lookup.
|
|
498
|
+
* - Provide `name` (and optionally `country`) for a name search.
|
|
499
|
+
*
|
|
500
|
+
* @example
|
|
501
|
+
* // Exact lookup
|
|
502
|
+
* const result = await omni.business.leiLookup({ lei: "5493001KJTIIGC8Y1R12" });
|
|
503
|
+
*
|
|
504
|
+
* // Name search
|
|
505
|
+
* const result = await omni.business.leiLookup({ name: "ING Bank", country: "NL" });
|
|
506
|
+
*/
|
|
507
|
+
async leiLookup(params) {
|
|
508
|
+
return this.http.get(
|
|
509
|
+
"/v1/business/lei-lookup",
|
|
510
|
+
{
|
|
511
|
+
lei: params.lei,
|
|
512
|
+
name: params.name,
|
|
513
|
+
country: params.country,
|
|
514
|
+
rows: params.rows
|
|
515
|
+
}
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
|
|
427
520
|
// src/OmniClient.ts
|
|
428
521
|
var OmniClient = class {
|
|
429
522
|
constructor(options) {
|
|
@@ -435,6 +528,7 @@ var OmniClient = class {
|
|
|
435
528
|
this.realEstate = new RealEstateModule(http);
|
|
436
529
|
this.logistics = new LogisticsModule(http);
|
|
437
530
|
this.energy = new EnergyModule(http);
|
|
531
|
+
this.business = new BusinessModule(http);
|
|
438
532
|
this.webhooks = new WebhooksModule(http);
|
|
439
533
|
}
|
|
440
534
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts","../src/client.ts","../src/geo.ts","../src/finance.ts","../src/compliance.ts","../src/hr.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classes for the OmniZoek SDK.\n */\n\nexport class OmniError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly code: string,\n public readonly detail: string,\n ) {\n super(message);\n this.name = \"OmniError\";\n }\n}\n\n/** 401 — API key missing or invalid. */\nexport class OmniAuthError extends OmniError {\n constructor(detail: string) {\n super(`Authentication failed: ${detail}`, 401, \"auth_error\", detail);\n this.name = \"OmniAuthError\";\n }\n}\n\n/** 404 — Requested resource not found (address, label, etc.). */\nexport class OmniNotFoundError extends OmniError {\n constructor(detail: string) {\n super(`Not found: ${detail}`, 404, \"not_found\", detail);\n this.name = \"OmniNotFoundError\";\n }\n}\n\n/** 422 — Request parameters failed validation. */\nexport class OmniValidationError extends OmniError {\n constructor(detail: string) {\n super(`Validation error: ${detail}`, 422, \"validation_error\", detail);\n this.name = \"OmniValidationError\";\n }\n}\n\n/** 429 — Rate limit exceeded. Retried automatically by the client. */\nexport class OmniRateLimitError extends OmniError {\n constructor(public readonly retryAfterMs: number) {\n super(\n `Rate limit exceeded. Retry after ${retryAfterMs}ms.`,\n 429,\n \"rate_limit\",\n `Retry after ${retryAfterMs}ms`,\n );\n this.name = \"OmniRateLimitError\";\n }\n}\n\n/** 503 — Upstream data source unavailable (BAG, EP-Online, RDW, etc.). */\nexport class OmniUpstreamError extends OmniError {\n constructor(detail: string) {\n super(`Upstream error: ${detail}`, 503, \"upstream_error\", detail);\n this.name = \"OmniUpstreamError\";\n }\n}\n\n/** Network-level failure (DNS, timeout, no internet). */\nexport class OmniNetworkError extends Error {\n readonly cause?: Error;\n\n constructor(cause: unknown) {\n super(`Network error: ${cause instanceof Error ? cause.message : String(cause)}`);\n this.name = \"OmniNetworkError\";\n if (cause instanceof Error) this.cause = cause;\n }\n}\n","/**\n * client.ts — Core HTTP client with automatic retry and error mapping.\n */\n\nimport {\n OmniAuthError,\n OmniNetworkError,\n OmniNotFoundError,\n OmniRateLimitError,\n OmniUpstreamError,\n OmniValidationError,\n} from \"./errors.js\";\n\nexport interface OmniClientOptions {\n /** Your OmniZoek API key (omni_live_… or omni_test_…) */\n apiKey: string;\n /** Override the base URL — useful for testing. Default: https://api.omnizoek.nl */\n baseUrl?: string;\n /** Max retries on 429 rate-limit responses. Default: 3 */\n maxRetries?: number;\n /** Base delay in ms for exponential backoff. Default: 500 */\n retryDelayMs?: number;\n /** Request timeout in ms. Default: 20000 */\n timeoutMs?: number;\n}\n\nconst DEFAULT_BASE_URL = \"https://api.omnizoek.nl\";\nconst DEFAULT_MAX_RETRIES = 3;\nconst DEFAULT_RETRY_DELAY_MS = 500;\nconst DEFAULT_TIMEOUT_MS = 20_000;\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport class HttpClient {\n private readonly apiKey: string;\n private readonly baseUrl: string;\n private readonly maxRetries: number;\n private readonly retryDelayMs: number;\n private readonly timeoutMs: number;\n\n constructor(options: OmniClientOptions) {\n this.apiKey = options.apiKey;\n this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/$/, \"\");\n this.maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;\n this.retryDelayMs = options.retryDelayMs ?? DEFAULT_RETRY_DELAY_MS;\n this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n }\n\n async get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T> {\n const url = new URL(this.baseUrl + path);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n let attempt = 0;\n\n while (true) {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(url.toString(), {\n method: \"GET\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"Accept\": \"application/json\",\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n // 429 — retry with exponential backoff\n if (response.status === 429 && attempt < this.maxRetries) {\n const retryAfter = Number(response.headers.get(\"Retry-After\") ?? 0);\n const delay = retryAfter > 0\n ? retryAfter * 1000\n : this.retryDelayMs * Math.pow(2, attempt);\n\n attempt++;\n await sleep(delay);\n continue;\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n\n return response.json() as Promise<T>;\n }\n }\n\n async post<T>(path: string, body?: unknown): Promise<T> {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(this.baseUrl + path, {\n method: \"POST\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n\n return response.json() as Promise<T>;\n }\n\n async delete(path: string): Promise<void> {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(this.baseUrl + path, {\n method: \"DELETE\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n }\n\n private async _throwFromResponse(response: Response): Promise<never> {\n let detail = response.statusText;\n try {\n const body = await response.json() as { detail?: unknown; error?: unknown };\n const raw = body.detail ?? body.error ?? detail;\n // FastAPI 422 returns detail as an array of validation objects; others are strings.\n detail = typeof raw === \"string\"\n ? raw\n : JSON.stringify(raw);\n } catch {\n // non-JSON body — keep statusText\n }\n\n switch (response.status) {\n case 401: throw new OmniAuthError(detail);\n case 404: throw new OmniNotFoundError(detail);\n case 422: throw new OmniValidationError(detail);\n case 429: throw new OmniRateLimitError(0);\n case 503: throw new OmniUpstreamError(detail);\n default: {\n const { OmniError } = await import(\"./errors.js\");\n throw new OmniError(\n `API error ${response.status}: ${detail}`,\n response.status,\n \"api_error\",\n detail,\n );\n }\n }\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { AddressEnrichParams, AddressEnrichResponse } from \"./types.js\";\n\nexport class GeoModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Enrich a Dutch address with BAG data, coordinates, neighbourhood\n * statistics, energy labels and more.\n *\n * @example\n * const result = await omni.geo.enrichAddress({ postcode: \"1012LG\", houseNumber: 1 });\n */\n async enrichAddress(params: AddressEnrichParams): Promise<AddressEnrichResponse> {\n return this.http.get<AddressEnrichResponse>(\"/v1/geo/address-enrich\", {\n postcode: params.postcode,\n house_number: params.houseNumber,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n IbanToBicParams,\n IbanToBicResponse,\n VatVerifyParams,\n VatVerifyResponse,\n} from \"./types.js\";\n\nexport class FinanceModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Resolve an IBAN to its BIC/SWIFT code and bank name.\n *\n * @example\n * const result = await omni.finance.ibanToBic({ iban: \"NL91ABNA0417164300\" });\n */\n async ibanToBic(params: IbanToBicParams): Promise<IbanToBicResponse> {\n return this.http.get<IbanToBicResponse>(\"/v1/finance/iban-to-bic\", {\n iban: params.iban,\n });\n }\n\n /**\n * Verify a Dutch BTW (VAT) number via the EU VIES service and return\n * company metadata.\n *\n * @example\n * const result = await omni.finance.vatVerify({ vatNumber: \"NL123456782B01\" });\n */\n async vatVerify(params: VatVerifyParams): Promise<VatVerifyResponse> {\n return this.http.get<VatVerifyResponse>(\"/v1/finance/vat-verify\", {\n vat_number: params.vatNumber,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { ValidateFinanceParams, FinanceValidationResponse } from \"./types.js\";\n\nexport class ComplianceModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Validate a Dutch BSN or IBAN number using checksum algorithms.\n *\n * @example\n * const result = await omni.compliance.validateFinance({ type: \"iban\", number: \"NL91ABNA0417164300\" });\n */\n async validateFinance(params: ValidateFinanceParams): Promise<FinanceValidationResponse> {\n return this.http.get<FinanceValidationResponse>(\"/v1/compliance/validate-finance\", {\n type: params.type,\n number: params.number,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n MinimumWageParams,\n MinimumWageResponse,\n HolidaySurchargeParams,\n HolidaySurchargeResponse,\n} from \"./types.js\";\n\nexport class HrModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Look up the current Dutch statutory minimum wage for a given age.\n *\n * @example\n * const result = await omni.hr.minimumWage({ age: 21 });\n */\n async minimumWage(params: MinimumWageParams): Promise<MinimumWageResponse> {\n return this.http.get<MinimumWageResponse>(\"/v1/hr/minimum-wage\", {\n age: params.age,\n });\n }\n\n /**\n * Check whether a given date is a public holiday (and get the applicable\n * surcharge multiplier for a given industry).\n *\n * @example\n * const result = await omni.hr.holidaySurcharge({ date: \"2024-12-25\", industry: \"retail\" });\n */\n async holidaySurcharge(params: HolidaySurchargeParams): Promise<HolidaySurchargeResponse> {\n return this.http.get<HolidaySurchargeResponse>(\"/v1/hr/holiday-surcharge\", {\n date: params.date,\n industry: params.industry,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { EnergyLabelParams, EnergyLabelResponse } from \"./types.js\";\n\nexport class RealEstateModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Retrieve the official EP-Online energy label for a Dutch address.\n *\n * @example\n * const result = await omni.realEstate.energyLabel({ postcode: \"1012LG\", houseNumber: 1 });\n */\n async energyLabel(params: EnergyLabelParams): Promise<EnergyLabelResponse> {\n return this.http.get<EnergyLabelResponse>(\"/v1/real-estate/energy-label\", {\n postcode: params.postcode,\n house_number: params.houseNumber,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n EmissionZoneParams,\n EmissionZoneResponse,\n TransitDisruptionsParams,\n TransitDisruptionsResponse,\n} from \"./types.js\";\n\nexport class LogisticsModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Check whether a vehicle (by Dutch licence plate / kenteken) is allowed\n * in a zero-emission zone (ZE-zone).\n *\n * @example\n * const result = await omni.logistics.emissionZone({ kenteken: \"AB123C\" });\n */\n async emissionZone(params: EmissionZoneParams): Promise<EmissionZoneResponse> {\n return this.http.get<EmissionZoneResponse>(\"/v1/logistics/emission-zone\", {\n kenteken: params.kenteken,\n });\n }\n\n /**\n * Retrieve current and upcoming NS train disruptions, optionally filtered\n * by station code.\n *\n * @example\n * const result = await omni.logistics.transitDisruptions({ stationCode: \"ASD\" });\n */\n async transitDisruptions(params?: TransitDisruptionsParams): Promise<TransitDisruptionsResponse> {\n return this.http.get<TransitDisruptionsResponse>(\"/v1/logistics/transit-disruptions\", {\n station_code: params?.stationCode,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { GridTriggerParams, GridTriggerResponse } from \"./types.js\";\n\nexport class EnergyModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Retrieve the current Dutch electricity grid congestion status for a\n * given postal code / province.\n *\n * @example\n * const result = await omni.energy.gridTrigger();\n * const result = await omni.energy.gridTrigger({ countryCode: \"NL\" });\n */\n async gridTrigger(params?: GridTriggerParams): Promise<GridTriggerResponse> {\n return this.http.get<GridTriggerResponse>(\"/v1/energy/grid-trigger\", {\n country_code: params?.countryCode,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n RegisterWebhookParams,\n WebhookCreatedResponse,\n WebhookListResponse,\n} from \"./types.js\";\n\nexport class WebhooksModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Register a new outbound webhook. OmniZoek will POST to `url` whenever\n * any of the specified `events` fire.\n *\n * @example\n * const wh = await omni.webhooks.register({\n * url: \"https://example.com/hook\",\n * events: [\"quota.warning\"],\n * });\n */\n async register(params: RegisterWebhookParams): Promise<WebhookCreatedResponse> {\n return this.http.post<WebhookCreatedResponse>(\"/v1/webhooks\", {\n url: params.url,\n events: params.events,\n });\n }\n\n /**\n * List all registered webhooks for this API key.\n *\n * @example\n * const { webhooks } = await omni.webhooks.list();\n */\n async list(): Promise<WebhookListResponse> {\n return this.http.get<WebhookListResponse>(\"/v1/webhooks\");\n }\n\n /**\n * Delete a webhook by its ID.\n *\n * @example\n * await omni.webhooks.delete(\"wh_abc123\");\n */\n async delete(webhookId: string): Promise<void> {\n return this.http.delete(`/v1/webhooks/${encodeURIComponent(webhookId)}`);\n }\n}\n","import { HttpClient, type OmniClientOptions } from \"./client.js\";\nimport { GeoModule } from \"./geo.js\";\nimport { FinanceModule } from \"./finance.js\";\nimport { ComplianceModule } from \"./compliance.js\";\nimport { HrModule } from \"./hr.js\";\nimport { RealEstateModule } from \"./realEstate.js\";\nimport { LogisticsModule } from \"./logistics.js\";\nimport { EnergyModule } from \"./energy.js\";\nimport { WebhooksModule } from \"./webhooks.js\";\n\nexport { type OmniClientOptions };\n\n/**\n * The main entry point for the OmniZoek SDK.\n *\n * @example\n * ```ts\n * import { OmniClient } from \"@omnizoek/sdk\";\n *\n * const omni = new OmniClient({ apiKey: \"omni_live_…\" });\n *\n * const address = await omni.geo.enrichAddress({ postcode: \"1012LG\", houseNumber: 1 });\n * const wage = await omni.hr.minimumWage({ age: 21 });\n * ```\n */\nexport class OmniClient {\n /** Geographic address enrichment (BAG, CBS, energy labels) */\n readonly geo: GeoModule;\n /** Financial utilities (IBAN → BIC, VAT verification) */\n readonly finance: FinanceModule;\n /** Compliance checks (financial institution registers) */\n readonly compliance: ComplianceModule;\n /** HR calculations (minimum wage, holiday surcharge) */\n readonly hr: HrModule;\n /** Real-estate data (EP-Online energy labels) */\n readonly realEstate: RealEstateModule;\n /** Logistics (ZE-zones, NS disruptions) */\n readonly logistics: LogisticsModule;\n /** Energy (grid congestion triggers) */\n readonly energy: EnergyModule;\n /** Outbound webhooks (register, list, delete) */\n readonly webhooks: WebhooksModule;\n\n constructor(options: OmniClientOptions) {\n const http = new HttpClient(options);\n this.geo = new GeoModule(http);\n this.finance = new FinanceModule(http);\n this.compliance = new ComplianceModule(http);\n this.hr = new HrModule(http);\n this.realEstate = new RealEstateModule(http);\n this.logistics = new LogisticsModule(http);\n this.energy = new EnergyModule(http);\n this.webhooks = new WebhooksModule(http);\n }\n}\n","// Main entry point\nexport { OmniClient } from \"./OmniClient.js\";\nexport type { OmniClientOptions } from \"./OmniClient.js\";\n\n// Typed error classes\nexport {\n OmniError,\n OmniAuthError,\n OmniNotFoundError,\n OmniValidationError,\n OmniRateLimitError,\n OmniUpstreamError,\n OmniNetworkError,\n} from \"./errors.js\";\n\n// All request/response types\nexport type {\n AddressEnrichParams,\n AddressEnrichResponse,\n IbanToBicParams,\n IbanToBicResponse,\n VatVerifyParams,\n VatVerifyResponse,\n ValidateFinanceParams,\n FinanceValidationResponse,\n MinimumWageParams,\n MinimumWageResponse,\n HolidaySurchargeParams,\n HolidaySurchargeResponse,\n EnergyLabelParams,\n EnergyLabelResponse,\n EmissionZoneParams,\n EmissionZoneResponse,\n TransitDisruptionsParams,\n TransitDisruptionsResponse,\n GridTriggerParams,\n GridTriggerResponse,\n RegisterWebhookParams,\n WebhookCreatedResponse,\n WebhookSummary,\n WebhookListResponse,\n} from \"./types.js\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts","../src/client.ts","../src/geo.ts","../src/finance.ts","../src/compliance.ts","../src/hr.ts","../src/realEstate.ts","../src/logistics.ts","../src/energy.ts","../src/webhooks.ts","../src/business.ts","../src/OmniClient.ts","../src/index.ts"],"names":["OmniError"],"mappings":";;;;;;;;;;;AAAA,IAAA,cAAA,GAAA,EAAA;AAAA,QAAA,CAAA,cAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA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CAAgB,IAAI,CAAA;AACzC,IAAA,IAAA,CAAK,MAAA,GAAS,IAAI,YAAA,CAAa,IAAI,CAAA;AACnC,IAAA,IAAA,CAAK,QAAA,GAAW,IAAI,cAAA,CAAe,IAAI,CAAA;AACvC,IAAA,IAAA,CAAK,QAAA,GAAW,IAAI,cAAA,CAAe,IAAI,CAAA;AAAA,EACzC;AACF;;;ACrDA,WAAA,EAAA","file":"index.js","sourcesContent":["/**\n * errors.ts — Typed error classes for the OmniZoek SDK.\n */\n\nexport class OmniError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly code: string,\n public readonly detail: string,\n ) {\n super(message);\n this.name = \"OmniError\";\n }\n}\n\n/** 401 — API key missing or invalid. */\nexport class OmniAuthError extends OmniError {\n constructor(detail: string) {\n super(`Authentication failed: ${detail}`, 401, \"auth_error\", detail);\n this.name = \"OmniAuthError\";\n }\n}\n\n/** 404 — Requested resource not found (address, label, etc.). */\nexport class OmniNotFoundError extends OmniError {\n constructor(detail: string) {\n super(`Not found: ${detail}`, 404, \"not_found\", detail);\n this.name = \"OmniNotFoundError\";\n }\n}\n\n/** 422 — Request parameters failed validation. */\nexport class OmniValidationError extends OmniError {\n constructor(detail: string) {\n super(`Validation error: ${detail}`, 422, \"validation_error\", detail);\n this.name = \"OmniValidationError\";\n }\n}\n\n/** 429 — Rate limit exceeded. Retried automatically by the client. */\nexport class OmniRateLimitError extends OmniError {\n constructor(public readonly retryAfterMs: number) {\n super(\n `Rate limit exceeded. Retry after ${retryAfterMs}ms.`,\n 429,\n \"rate_limit\",\n `Retry after ${retryAfterMs}ms`,\n );\n this.name = \"OmniRateLimitError\";\n }\n}\n\n/** 503 — Upstream data source unavailable (BAG, EP-Online, RDW, etc.). */\nexport class OmniUpstreamError extends OmniError {\n constructor(detail: string) {\n super(`Upstream error: ${detail}`, 503, \"upstream_error\", detail);\n this.name = \"OmniUpstreamError\";\n }\n}\n\n/** Network-level failure (DNS, timeout, no internet). */\nexport class OmniNetworkError extends Error {\n readonly cause?: Error;\n\n constructor(cause: unknown) {\n super(`Network error: ${cause instanceof Error ? cause.message : String(cause)}`);\n this.name = \"OmniNetworkError\";\n if (cause instanceof Error) this.cause = cause;\n }\n}\n","/**\n * client.ts — Core HTTP client with automatic retry and error mapping.\n */\n\nimport {\n OmniAuthError,\n OmniNetworkError,\n OmniNotFoundError,\n OmniRateLimitError,\n OmniUpstreamError,\n OmniValidationError,\n} from \"./errors.js\";\n\nexport interface OmniClientOptions {\n /** Your OmniZoek API key (omni_live_… or omni_test_…) */\n apiKey: string;\n /** Override the base URL — useful for testing. Default: https://api.omnizoek.nl */\n baseUrl?: string;\n /** Max retries on 429 rate-limit responses. Default: 3 */\n maxRetries?: number;\n /** Base delay in ms for exponential backoff. Default: 500 */\n retryDelayMs?: number;\n /** Request timeout in ms. Default: 20000 */\n timeoutMs?: number;\n}\n\nconst DEFAULT_BASE_URL = \"https://api.omnizoek.nl\";\nconst DEFAULT_MAX_RETRIES = 3;\nconst DEFAULT_RETRY_DELAY_MS = 500;\nconst DEFAULT_TIMEOUT_MS = 20_000;\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport class HttpClient {\n private readonly apiKey: string;\n private readonly baseUrl: string;\n private readonly maxRetries: number;\n private readonly retryDelayMs: number;\n private readonly timeoutMs: number;\n\n constructor(options: OmniClientOptions) {\n this.apiKey = options.apiKey;\n this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/$/, \"\");\n this.maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;\n this.retryDelayMs = options.retryDelayMs ?? DEFAULT_RETRY_DELAY_MS;\n this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n }\n\n async get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T> {\n const url = new URL(this.baseUrl + path);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n let attempt = 0;\n\n while (true) {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(url.toString(), {\n method: \"GET\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"Accept\": \"application/json\",\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n // 429 — retry with exponential backoff\n if (response.status === 429 && attempt < this.maxRetries) {\n const retryAfter = Number(response.headers.get(\"Retry-After\") ?? 0);\n const delay = retryAfter > 0\n ? retryAfter * 1000\n : this.retryDelayMs * Math.pow(2, attempt);\n\n attempt++;\n await sleep(delay);\n continue;\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n\n return response.json() as Promise<T>;\n }\n }\n\n async post<T>(path: string, body?: unknown): Promise<T> {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(this.baseUrl + path, {\n method: \"POST\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n\n return response.json() as Promise<T>;\n }\n\n async delete(path: string): Promise<void> {\n let response: Response;\n\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);\n\n response = await fetch(this.baseUrl + path, {\n method: \"DELETE\",\n headers: {\n \"X-API-Key\": this.apiKey,\n \"User-Agent\": \"@omnizoek/sdk/0.1.0\",\n },\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n } catch (err) {\n throw new OmniNetworkError(err);\n }\n\n if (!response.ok) {\n await this._throwFromResponse(response);\n }\n }\n\n private async _throwFromResponse(response: Response): Promise<never> {\n let detail = response.statusText;\n try {\n const body = await response.json() as { detail?: unknown; error?: unknown };\n const raw = body.detail ?? body.error ?? detail;\n // FastAPI 422 returns detail as an array of validation objects; others are strings.\n detail = typeof raw === \"string\"\n ? raw\n : JSON.stringify(raw);\n } catch {\n // non-JSON body — keep statusText\n }\n\n switch (response.status) {\n case 401: throw new OmniAuthError(detail);\n case 404: throw new OmniNotFoundError(detail);\n case 422: throw new OmniValidationError(detail);\n case 429: throw new OmniRateLimitError(0);\n case 503: throw new OmniUpstreamError(detail);\n default: {\n const { OmniError } = await import(\"./errors.js\");\n throw new OmniError(\n `API error ${response.status}: ${detail}`,\n response.status,\n \"api_error\",\n detail,\n );\n }\n }\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n AddressEnrichParams,\n AddressEnrichResponse,\n GeocodeParams,\n GeocodeResponse,\n ReverseGeocodeParams,\n ReverseGeocodeResponse,\n} from \"./types.js\";\n\nexport class GeoModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Enrich a Dutch address with BAG data, coordinates, neighbourhood\n * statistics, energy labels and more.\n *\n * @example\n * const result = await omni.geo.enrichAddress({ postcode: \"1012LG\", houseNumber: \"1\" });\n */\n async enrichAddress(params: AddressEnrichParams): Promise<AddressEnrichResponse> {\n return this.http.get<AddressEnrichResponse>(\"/v1/geo/address-enrich\", {\n postcode: params.postcode,\n house_number: params.houseNumber,\n });\n }\n\n /**\n * Free-text address search via PDOK Locatieserver.\n * Returns coordinates, postcode, BAG ID and more.\n *\n * @example\n * const result = await omni.geo.geocode({ q: \"Damrak 1 Amsterdam\" });\n */\n async geocode(params: GeocodeParams): Promise<GeocodeResponse> {\n return this.http.get<GeocodeResponse>(\"/v1/geo/geocode\", {\n q: params.q,\n rows: params.rows,\n });\n }\n\n /**\n * Convert WGS84 coordinates to the nearest Dutch address.\n *\n * @example\n * const result = await omni.geo.reverseGeocode({ lat: 52.3756, lon: 4.8951 });\n */\n async reverseGeocode(params: ReverseGeocodeParams): Promise<ReverseGeocodeResponse> {\n return this.http.get<ReverseGeocodeResponse>(\"/v1/geo/reverse-geocode\", {\n lat: params.lat,\n lon: params.lon,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n IbanToBicParams,\n IbanToBicResponse,\n VatVerifyParams,\n VatVerifyResponse,\n ExchangeRatesResponse,\n VatRatesParams,\n VatRatesResponse,\n} from \"./types.js\";\n\nexport class FinanceModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Resolve an IBAN to its BIC/SWIFT code and bank name.\n *\n * @example\n * const result = await omni.finance.ibanToBic({ iban: \"NL91ABNA0417164300\" });\n */\n async ibanToBic(params: IbanToBicParams): Promise<IbanToBicResponse> {\n return this.http.get<IbanToBicResponse>(\"/v1/finance/iban-to-bic\", {\n iban: params.iban,\n });\n }\n\n /**\n * Verify a Dutch BTW (VAT) number via the EU VIES service and return\n * company metadata.\n *\n * @example\n * const result = await omni.finance.vatVerify({ vatNumber: \"NL123456782B01\" });\n */\n async vatVerify(params: VatVerifyParams): Promise<VatVerifyResponse> {\n return this.http.get<VatVerifyResponse>(\"/v1/finance/vat-verify\", {\n vat_number: params.vatNumber,\n });\n }\n\n /**\n * Daily ECB euro foreign exchange reference rates (~30 currencies).\n * Cached for 4 hours.\n *\n * @example\n * const result = await omni.finance.exchangeRates();\n * console.log(result.rates.USD);\n */\n async exchangeRates(): Promise<ExchangeRatesResponse> {\n return this.http.get<ExchangeRatesResponse>(\"/v1/finance/exchange-rates\", {});\n }\n\n /**\n * Official VAT rates for any EU/EEA country plus GB, NO, CH.\n * Includes per-category breakdown for NL.\n *\n * @example\n * const result = await omni.finance.vatRates({ country: \"NL\" });\n */\n async vatRates(params?: VatRatesParams): Promise<VatRatesResponse> {\n return this.http.get<VatRatesResponse>(\"/v1/finance/vat-rates\", {\n country: params?.country,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { ValidateFinanceParams, FinanceValidationResponse } from \"./types.js\";\n\nexport class ComplianceModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Validate a Dutch BSN or IBAN number using checksum algorithms.\n *\n * @example\n * const result = await omni.compliance.validateFinance({ type: \"iban\", number: \"NL91ABNA0417164300\" });\n */\n async validateFinance(params: ValidateFinanceParams): Promise<FinanceValidationResponse> {\n return this.http.get<FinanceValidationResponse>(\"/v1/compliance/validate-finance\", {\n type: params.type,\n number: params.number,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n MinimumWageParams,\n MinimumWageResponse,\n HolidaySurchargeParams,\n HolidaySurchargeResponse,\n} from \"./types.js\";\n\nexport class HrModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Look up the current Dutch statutory minimum wage for a given age.\n *\n * @example\n * const result = await omni.hr.minimumWage({ age: 21 });\n */\n async minimumWage(params: MinimumWageParams): Promise<MinimumWageResponse> {\n const today = new Date().toISOString().slice(0, 10);\n return this.http.get<MinimumWageResponse>(\"/v1/hr/minimum-wage\", {\n age: params.age,\n date: params.date ?? today,\n });\n }\n\n /**\n * Check whether a given date is a public holiday (and get the applicable\n * surcharge multiplier for a given industry).\n *\n * @example\n * const result = await omni.hr.holidaySurcharge({ date: \"2024-12-25\", industry: \"retail\" });\n */\n async holidaySurcharge(params: HolidaySurchargeParams): Promise<HolidaySurchargeResponse> {\n return this.http.get<HolidaySurchargeResponse>(\"/v1/hr/holiday-surcharge\", {\n date: params.date,\n industry: params.industry,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { EnergyLabelParams, EnergyLabelResponse } from \"./types.js\";\n\nexport class RealEstateModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Retrieve the official EP-Online energy label for a Dutch address.\n *\n * @example\n * const result = await omni.realEstate.energyLabel({ postcode: \"1012LG\", houseNumber: 1 });\n */\n async energyLabel(params: EnergyLabelParams): Promise<EnergyLabelResponse> {\n return this.http.get<EnergyLabelResponse>(\"/v1/real-estate/energy-label\", {\n postcode: params.postcode,\n house_number: params.houseNumber,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n EmissionZoneParams,\n EmissionZoneResponse,\n TransitDisruptionsParams,\n TransitDisruptionsResponse,\n VehicleHistoryParams,\n VehicleHistoryResponse,\n} from \"./types.js\";\n\nexport class LogisticsModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Check whether a vehicle (by Dutch licence plate / kenteken) is allowed\n * in a zero-emission zone (ZE-zone).\n *\n * @example\n * const result = await omni.logistics.emissionZone({ kenteken: \"AB123C\" });\n */\n async emissionZone(params: EmissionZoneParams): Promise<EmissionZoneResponse> {\n return this.http.get<EmissionZoneResponse>(\"/v1/logistics/emission-zone\", {\n kenteken: params.kenteken,\n });\n }\n\n /**\n * Retrieve current and upcoming NS train disruptions, optionally filtered\n * by station code.\n *\n * @example\n * const result = await omni.logistics.transitDisruptions({ stationCode: \"ASD\" });\n */\n async transitDisruptions(params?: TransitDisruptionsParams): Promise<TransitDisruptionsResponse> {\n return this.http.get<TransitDisruptionsResponse>(\"/v1/logistics/transit-disruptions\", {\n station_code: params?.stationCode,\n });\n }\n\n /**\n * Full vehicle record by Dutch licence plate, assembled from 4 RDW Open\n * Data datasets: registration, fuel/emissions, APK and recalls.\n *\n * @example\n * const result = await omni.logistics.vehicleHistory({ kenteken: \"AB-123-C\" });\n */\n async vehicleHistory(params: VehicleHistoryParams): Promise<VehicleHistoryResponse> {\n return this.http.get<VehicleHistoryResponse>(\"/v1/logistics/vehicle-history\", {\n kenteken: params.kenteken,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { GridTriggerParams, GridTriggerResponse } from \"./types.js\";\n\nexport class EnergyModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Retrieve the current Dutch electricity grid congestion status for a\n * given postal code / province.\n *\n * @example\n * const result = await omni.energy.gridTrigger();\n * const result = await omni.energy.gridTrigger({ countryCode: \"NL\" });\n */\n async gridTrigger(params?: GridTriggerParams): Promise<GridTriggerResponse> {\n return this.http.get<GridTriggerResponse>(\"/v1/energy/grid-trigger\", {\n country_code: params?.countryCode,\n });\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type {\n RegisterWebhookParams,\n WebhookCreatedResponse,\n WebhookListResponse,\n} from \"./types.js\";\n\nexport class WebhooksModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Register a new outbound webhook. OmniZoek will POST to `url` whenever\n * any of the specified `events` fire.\n *\n * @example\n * const wh = await omni.webhooks.register({\n * url: \"https://example.com/hook\",\n * events: [\"quota.warning\"],\n * });\n */\n async register(params: RegisterWebhookParams): Promise<WebhookCreatedResponse> {\n return this.http.post<WebhookCreatedResponse>(\"/v1/webhooks\", {\n url: params.url,\n events: params.events,\n });\n }\n\n /**\n * List all registered webhooks for this API key.\n *\n * @example\n * const { webhooks } = await omni.webhooks.list();\n */\n async list(): Promise<WebhookListResponse> {\n return this.http.get<WebhookListResponse>(\"/v1/webhooks\");\n }\n\n /**\n * Delete a webhook by its ID.\n *\n * @example\n * await omni.webhooks.delete(\"wh_abc123\");\n */\n async delete(webhookId: string): Promise<void> {\n return this.http.delete(`/v1/webhooks/${encodeURIComponent(webhookId)}`);\n }\n}\n","import type { HttpClient } from \"./client.js\";\nimport type { LeiLookupParams, LeiLookupResponse, LeiSearchResponse } from \"./types.js\";\n\nexport class BusinessModule {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Look up a company by LEI code (exact) or name (fuzzy search) via GLEIF.\n *\n * - Provide `lei` for a single-record lookup.\n * - Provide `name` (and optionally `country`) for a name search.\n *\n * @example\n * // Exact lookup\n * const result = await omni.business.leiLookup({ lei: \"5493001KJTIIGC8Y1R12\" });\n *\n * // Name search\n * const result = await omni.business.leiLookup({ name: \"ING Bank\", country: \"NL\" });\n */\n async leiLookup(\n params: LeiLookupParams,\n ): Promise<LeiLookupResponse | LeiSearchResponse> {\n return this.http.get<LeiLookupResponse | LeiSearchResponse>(\n \"/v1/business/lei-lookup\",\n {\n lei: params.lei,\n name: params.name,\n country: params.country,\n rows: params.rows,\n },\n );\n }\n}\n","import { HttpClient, type OmniClientOptions } from \"./client.js\";\nimport { GeoModule } from \"./geo.js\";\nimport { FinanceModule } from \"./finance.js\";\nimport { ComplianceModule } from \"./compliance.js\";\nimport { HrModule } from \"./hr.js\";\nimport { RealEstateModule } from \"./realEstate.js\";\nimport { LogisticsModule } from \"./logistics.js\";\nimport { EnergyModule } from \"./energy.js\";\nimport { WebhooksModule } from \"./webhooks.js\";\nimport { BusinessModule } from \"./business.js\";\n\nexport { type OmniClientOptions };\n\n/**\n * The main entry point for the OmniZoek SDK.\n *\n * @example\n * ```ts\n * import { OmniClient } from \"@omnizoek/sdk\";\n *\n * const omni = new OmniClient({ apiKey: \"omni_live_…\" });\n *\n * const address = await omni.geo.enrichAddress({ postcode: \"1012LG\", houseNumber: 1 });\n * const wage = await omni.hr.minimumWage({ age: 21 });\n * ```\n */\nexport class OmniClient {\n /** Geographic address enrichment, geocoding and reverse geocoding */\n readonly geo: GeoModule;\n /** Financial utilities (IBAN → BIC, VAT verification, exchange rates, VAT rates) */\n readonly finance: FinanceModule;\n /** Compliance checks (financial institution registers) */\n readonly compliance: ComplianceModule;\n /** HR calculations (minimum wage, holiday surcharge) */\n readonly hr: HrModule;\n /** Real-estate data (EP-Online energy labels) */\n readonly realEstate: RealEstateModule;\n /** Logistics (ZE-zones, NS disruptions, vehicle history) */\n readonly logistics: LogisticsModule;\n /** Energy (grid congestion triggers) */\n readonly energy: EnergyModule;\n /** Business entity lookup (LEI via GLEIF) */\n readonly business: BusinessModule;\n /** Outbound webhooks (register, list, delete) */\n readonly webhooks: WebhooksModule;\n\n constructor(options: OmniClientOptions) {\n const http = new HttpClient(options);\n this.geo = new GeoModule(http);\n this.finance = new FinanceModule(http);\n this.compliance = new ComplianceModule(http);\n this.hr = new HrModule(http);\n this.realEstate = new RealEstateModule(http);\n this.logistics = new LogisticsModule(http);\n this.energy = new EnergyModule(http);\n this.business = new BusinessModule(http);\n this.webhooks = new WebhooksModule(http);\n }\n}\n","// Main entry point\nexport { OmniClient } from \"./OmniClient.js\";\nexport type { OmniClientOptions } from \"./OmniClient.js\";\n\n// Typed error classes\nexport {\n OmniError,\n OmniAuthError,\n OmniNotFoundError,\n OmniValidationError,\n OmniRateLimitError,\n OmniUpstreamError,\n OmniNetworkError,\n} from \"./errors.js\";\n\n// All request/response types\nexport type {\n AddressEnrichParams,\n AddressEnrichResponse,\n GeocodeParams,\n GeocodeResponse,\n GeocodeResultItem,\n ReverseGeocodeParams,\n ReverseGeocodeResponse,\n IbanToBicParams,\n IbanToBicResponse,\n VatVerifyParams,\n VatVerifyResponse,\n ExchangeRatesResponse,\n VatRatesParams,\n VatRatesResponse,\n VatCategoryItem,\n ValidateFinanceParams,\n FinanceValidationResponse,\n MinimumWageParams,\n MinimumWageResponse,\n HolidaySurchargeParams,\n HolidaySurchargeResponse,\n EnergyLabelParams,\n EnergyLabelResponse,\n EmissionZoneParams,\n EmissionZoneResponse,\n TransitDisruptionsParams,\n TransitDisruptionsResponse,\n VehicleHistoryParams,\n VehicleHistoryResponse,\n RecallItem,\n LeiLookupParams,\n LeiLookupResponse,\n LeiSearchResponse,\n LeiRecord,\n LeiAddress,\n GridTriggerParams,\n GridTriggerResponse,\n RegisterWebhookParams,\n WebhookCreatedResponse,\n WebhookSummary,\n WebhookListResponse,\n} from \"./types.js\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnizoek/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Official TypeScript/JavaScript SDK for the OmniZoek API — Dutch government data APIs (BAG, EP-Online, RDW, VIES, NS, WML, ENTSO-E).",
|
|
5
5
|
"author": "OmniZoek <support@omnizoek.nl>",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
7
|
"homepage": "https://omnizoek.nl/docs",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|