@taxora/sdk 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1166,6 +1166,13 @@ interface SmartEnrichmentRejectedCandidate {
1166
1166
  vatNumber: string;
1167
1167
  reason: SmartEnrichmentRejectionReason;
1168
1168
  }
1169
+ /** The registered address the official VAT check returned, field by field. */
1170
+ interface SmartEnrichmentOfficialAddress {
1171
+ street?: string;
1172
+ postal_code?: string;
1173
+ city?: string;
1174
+ country?: string;
1175
+ }
1169
1176
  /**
1170
1177
  * Result of resolving one reverse-VAT lookup (company name + address → VAT + confidence).
1171
1178
  * Mirrors the API response item shape (camelCase keys).
@@ -1195,6 +1202,40 @@ declare class SmartEnrichmentResource {
1195
1202
  * apart from "found nothing". Empty for every other status.
1196
1203
  */
1197
1204
  readonly rejectedCandidates: SmartEnrichmentRejectedCandidate[];
1205
+ /**
1206
+ * Only on `found`: the web page the VAT number was read from — usually the company's own
1207
+ * Impressum / legal notice. Undefined when it came from Taxora's own data or a register.
1208
+ */
1209
+ readonly sourceUrl: string | undefined;
1210
+ /**
1211
+ * Only on `found`: the PERSON the tax authority has the VAT ID under, when that is not the
1212
+ * trading name — typical for a German sole proprietorship (e.K.). `matchedCompanyName` stays
1213
+ * the trading name.
1214
+ */
1215
+ readonly registeredOwner: string | undefined;
1216
+ /**
1217
+ * Only on `found`: every page the VAT number was read from, `sourceUrl` first — each research
1218
+ * pass that found the same number contributes its page. At most 5.
1219
+ */
1220
+ readonly sourceUrls: string[];
1221
+ /**
1222
+ * A domestic tax number (e.g. a German Steuernummer, digits only) the company's own page shows
1223
+ * INSTEAD of a VAT ID — often under the VAT ID heading by mistake. Not a VAT ID.
1224
+ */
1225
+ readonly taxNumber: string | undefined;
1226
+ /** Only on `found`: the tax authority's verdict on the number; undefined when no official check ran. */
1227
+ readonly vatValid: boolean | undefined;
1228
+ /** Only on `found`: 0–100, the requested name against the register's; undefined when no name was disclosed. */
1229
+ readonly aiScore: number | undefined;
1230
+ /**
1231
+ * Only on `found`: 'ok' (name matches the register) or 'mismatch' (it does not — another company,
1232
+ * unless `registeredOwner` is set: then update your record).
1233
+ */
1234
+ readonly nameMatch: 'ok' | 'mismatch' | undefined;
1235
+ /** Only on `found`: the name the register has the number under. */
1236
+ readonly officialName: string | undefined;
1237
+ /** Only on `found`: the registered address, field by field. */
1238
+ readonly officialAddress: SmartEnrichmentOfficialAddress | undefined;
1198
1239
  constructor(status: SmartEnrichmentStatus, vatNumber: string | undefined, vatType: string | undefined, confidence: number | undefined, matchedCompanyName: string | undefined,
1199
1240
  /** Official/registered address of the matched company, when available. */
1200
1241
  matchedAddress: string | undefined, country: string | undefined, source: string | undefined,
@@ -1211,7 +1252,43 @@ declare class SmartEnrichmentResource {
1211
1252
  * e.g. one the tax authority reports as invalid. Lets you tell "found one, it is invalid"
1212
1253
  * apart from "found nothing". Empty for every other status.
1213
1254
  */
1214
- rejectedCandidates?: SmartEnrichmentRejectedCandidate[]);
1255
+ rejectedCandidates?: SmartEnrichmentRejectedCandidate[],
1256
+ /**
1257
+ * Only on `found`: the web page the VAT number was read from — usually the company's own
1258
+ * Impressum / legal notice. Undefined when it came from Taxora's own data or a register.
1259
+ */
1260
+ sourceUrl?: string | undefined,
1261
+ /**
1262
+ * Only on `found`: the PERSON the tax authority has the VAT ID under, when that is not the
1263
+ * trading name — typical for a German sole proprietorship (e.K.). `matchedCompanyName` stays
1264
+ * the trading name.
1265
+ */
1266
+ registeredOwner?: string | undefined,
1267
+ /**
1268
+ * Only on `found`: every page the VAT number was read from, `sourceUrl` first — each research
1269
+ * pass that found the same number contributes its page. At most 5.
1270
+ */
1271
+ sourceUrls?: string[],
1272
+ /**
1273
+ * A domestic tax number (e.g. a German Steuernummer, digits only) the company's own page shows
1274
+ * INSTEAD of a VAT ID — often under the VAT ID heading by mistake. Not a VAT ID.
1275
+ */
1276
+ taxNumber?: string | undefined,
1277
+ /** Only on `found`: the tax authority's verdict on the number; undefined when no official check ran. */
1278
+ vatValid?: boolean | undefined,
1279
+ /** Only on `found`: 0–100, the requested name against the register's; undefined when no name was disclosed. */
1280
+ aiScore?: number | undefined,
1281
+ /**
1282
+ * Only on `found`: 'ok' (name matches the register) or 'mismatch' (it does not — another company,
1283
+ * unless `registeredOwner` is set: then update your record).
1284
+ */
1285
+ nameMatch?: 'ok' | 'mismatch' | undefined,
1286
+ /** Only on `found`: the name the register has the number under. */
1287
+ officialName?: string | undefined,
1288
+ /** Only on `found`: the registered address, field by field. */
1289
+ officialAddress?: SmartEnrichmentOfficialAddress | undefined);
1290
+ /** True when the register knows the number under a different name than the one requested. */
1291
+ nameMismatch(): boolean;
1215
1292
  /** True when a VAT number was found but rejected by the official check. */
1216
1293
  hasRejectedCandidates(): boolean;
1217
1294
  static fromArray(data: Record<string, unknown>): SmartEnrichmentResource;
@@ -1942,4 +2019,4 @@ declare class AuthRetryHttpClient implements HttpClientInterface {
1942
2019
  private injectAuthHeader;
1943
2020
  }
1944
2021
 
1945
- export { ApiVersion, AuthEndpoint, AuthRetryHttpClient, AuthenticationException, CompanyAddress, CompanyEndpoint, type CompanyResource, ComplianceDocumentType, ComplianceEnrollment, ComplianceEnrollmentPage, ComplianceEnrollmentStatus, type ComplianceEnterpriseSize, type ComplianceInvoiceLineInput, type ComplianceInvoiceTaxInput, type ComplianceLedgerStateChangedEvent, type ComplianceLedgerWebhookObject, type ComplianceRequestService, ComplianceService, ComplianceTaxReport, ComplianceTaxReportPage, type ComplianceTaxReportRequestState, ComplianceTaxReportState, ComplianceTransaction, type ComplianceTransactionBuyerInput, type ComplianceTransactionFilters, type ComplianceTransactionInvoiceLine, type ComplianceTransactionInvoiceLineTax, ComplianceTransactionPage, type ComplianceTransactionRequestState, type ComplianceTransactionRequestType, ComplianceTransactionState, type ComplianceTransactionStateChangedEvent, ComplianceTransactionType, type ComplianceTransactionWebhookObject, type ComplianceTypeOperation, type CreateComplianceEnrollmentInput, type CreateComplianceTransactionInput, type CreateNorwayEnrollmentInput, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, type EReportingAccessRequestInput, EReportingEndpoint, type EReportingInterval, type EnrichmentCompletedEvent, type EnrichmentCompletedWebhookObject, type EnrichmentUpdatedEvent, type EnrichmentUpdatedWebhookObject, Environment, Environment as EnvironmentType, FetchHttpClient, type HttpClientInterface, HttpException, ImportResult, InMemoryTokenStorage, Language, LoginIdentifier, type NorwayEnrollmentInput, NorwegianOrgNumber, type ParsedWebhookSignatureHeader, PeppolLookupResult, PeppolLookupStatus, ProviderDocument, ProviderDocumentLine, RegistryCompany, RetryPolicy, type RetryPolicyOptions, type RevenueCountryBreakdown, type RevenueCurrencyBreakdown, type RevenueStateBreakdown, RevenueStatistics, type RevenueStatisticsFilters, type RevenueTimeBucket, type RevenueTotals, type RevenueTypeBreakdown, ScoreBreakdown, SireneLookupResult, type SmartEnrichmentAddressQuality, type SmartEnrichmentConfidenceBucket, SmartEnrichmentEndpoint, type SmartEnrichmentExportOptions, type SmartEnrichmentHistoryInput, SmartEnrichmentHistoryPage, SmartEnrichmentHistoryRow, type SmartEnrichmentHistoryStats, type SmartEnrichmentInput, SmartEnrichmentJob, SmartEnrichmentMode, type SmartEnrichmentOutcomeBreakdown, type SmartEnrichmentProviderVerdict, type SmartEnrichmentRejectedCandidate, SmartEnrichmentRejectionReason, SmartEnrichmentResource, type SmartEnrichmentSourceBreakdown, SmartEnrichmentStatistics, type SmartEnrichmentStatisticsInterval, type SmartEnrichmentStatisticsOptions, type SmartEnrichmentStatisticsRange, type SmartEnrichmentStatisticsTotals, SmartEnrichmentStatus, type SmartEnrichmentTimeBucket, type SmartEnrichmentUsage, type SmartEnrichmentUsageHistoryEntry, type SmartEnrichmentWaitOptions, TaxoraClient, TaxoraClientFactory, type TaxoraClientOptions, TaxoraException, type TaxoraWebhookEvent, type TestWebhookObject, Token, type TokenStorageInterface, type UpdateComplianceTransactionInput, ValidationException, VatCertificateExport, VatCollection, VatEndpoint, type VatRate, VatRates, VatResource, VatState, type VatStateChangedEvent, type VatValidatedEvent, VatValidationAddressInput, type VatWebhookObject, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebhookEventEnvelope, type WebhookEventType, type WebhookRawBody, type WebhookSignatureErrorReason, type WebhookSignatureHeaderInput, WebhookSignatureVerificationError, type WebhookTestEvent, type WebhookVerifyOptions, computeWebhookSignature, constructWebhookEvent, describeApiError, describeComplianceDocumentType, describeComplianceEnrollmentStatus, describeComplianceService, describeComplianceTaxReportState, describeComplianceTransactionState, describeComplianceTransactionType, describePeppolLookupStatus, describeSmartEnrichmentMode, describeSmartEnrichmentRejectionReason, describeSmartEnrichmentStatus, describeVatState, generateWebhookSignatureHeader, getBaseUrl, getFailedVatStates, parseWebhookSignatureHeader, toComplianceDocumentType, toComplianceEnrollmentStatus, toComplianceService, toComplianceTaxReportState, toComplianceTransactionState, toComplianceTransactionType, toPeppolLookupStatus, toSmartEnrichmentMode, toSmartEnrichmentRejectionReason, toSmartEnrichmentStatus, verifyWebhookSignature };
2022
+ export { ApiVersion, AuthEndpoint, AuthRetryHttpClient, AuthenticationException, CompanyAddress, CompanyEndpoint, type CompanyResource, ComplianceDocumentType, ComplianceEnrollment, ComplianceEnrollmentPage, ComplianceEnrollmentStatus, type ComplianceEnterpriseSize, type ComplianceInvoiceLineInput, type ComplianceInvoiceTaxInput, type ComplianceLedgerStateChangedEvent, type ComplianceLedgerWebhookObject, type ComplianceRequestService, ComplianceService, ComplianceTaxReport, ComplianceTaxReportPage, type ComplianceTaxReportRequestState, ComplianceTaxReportState, ComplianceTransaction, type ComplianceTransactionBuyerInput, type ComplianceTransactionFilters, type ComplianceTransactionInvoiceLine, type ComplianceTransactionInvoiceLineTax, ComplianceTransactionPage, type ComplianceTransactionRequestState, type ComplianceTransactionRequestType, ComplianceTransactionState, type ComplianceTransactionStateChangedEvent, ComplianceTransactionType, type ComplianceTransactionWebhookObject, type ComplianceTypeOperation, type CreateComplianceEnrollmentInput, type CreateComplianceTransactionInput, type CreateNorwayEnrollmentInput, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, type EReportingAccessRequestInput, EReportingEndpoint, type EReportingInterval, type EnrichmentCompletedEvent, type EnrichmentCompletedWebhookObject, type EnrichmentUpdatedEvent, type EnrichmentUpdatedWebhookObject, Environment, Environment as EnvironmentType, FetchHttpClient, type HttpClientInterface, HttpException, ImportResult, InMemoryTokenStorage, Language, LoginIdentifier, type NorwayEnrollmentInput, NorwegianOrgNumber, type ParsedWebhookSignatureHeader, PeppolLookupResult, PeppolLookupStatus, ProviderDocument, ProviderDocumentLine, RegistryCompany, RetryPolicy, type RetryPolicyOptions, type RevenueCountryBreakdown, type RevenueCurrencyBreakdown, type RevenueStateBreakdown, RevenueStatistics, type RevenueStatisticsFilters, type RevenueTimeBucket, type RevenueTotals, type RevenueTypeBreakdown, ScoreBreakdown, SireneLookupResult, type SmartEnrichmentAddressQuality, type SmartEnrichmentConfidenceBucket, SmartEnrichmentEndpoint, type SmartEnrichmentExportOptions, type SmartEnrichmentHistoryInput, SmartEnrichmentHistoryPage, SmartEnrichmentHistoryRow, type SmartEnrichmentHistoryStats, type SmartEnrichmentInput, SmartEnrichmentJob, SmartEnrichmentMode, type SmartEnrichmentOfficialAddress, type SmartEnrichmentOutcomeBreakdown, type SmartEnrichmentProviderVerdict, type SmartEnrichmentRejectedCandidate, SmartEnrichmentRejectionReason, SmartEnrichmentResource, type SmartEnrichmentSourceBreakdown, SmartEnrichmentStatistics, type SmartEnrichmentStatisticsInterval, type SmartEnrichmentStatisticsOptions, type SmartEnrichmentStatisticsRange, type SmartEnrichmentStatisticsTotals, SmartEnrichmentStatus, type SmartEnrichmentTimeBucket, type SmartEnrichmentUsage, type SmartEnrichmentUsageHistoryEntry, type SmartEnrichmentWaitOptions, TaxoraClient, TaxoraClientFactory, type TaxoraClientOptions, TaxoraException, type TaxoraWebhookEvent, type TestWebhookObject, Token, type TokenStorageInterface, type UpdateComplianceTransactionInput, ValidationException, VatCertificateExport, VatCollection, VatEndpoint, type VatRate, VatRates, VatResource, VatState, type VatStateChangedEvent, type VatValidatedEvent, VatValidationAddressInput, type VatWebhookObject, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebhookEventEnvelope, type WebhookEventType, type WebhookRawBody, type WebhookSignatureErrorReason, type WebhookSignatureHeaderInput, WebhookSignatureVerificationError, type WebhookTestEvent, type WebhookVerifyOptions, computeWebhookSignature, constructWebhookEvent, describeApiError, describeComplianceDocumentType, describeComplianceEnrollmentStatus, describeComplianceService, describeComplianceTaxReportState, describeComplianceTransactionState, describeComplianceTransactionType, describePeppolLookupStatus, describeSmartEnrichmentMode, describeSmartEnrichmentRejectionReason, describeSmartEnrichmentStatus, describeVatState, generateWebhookSignatureHeader, getBaseUrl, getFailedVatStates, parseWebhookSignatureHeader, toComplianceDocumentType, toComplianceEnrollmentStatus, toComplianceService, toComplianceTaxReportState, toComplianceTransactionState, toComplianceTransactionType, toPeppolLookupStatus, toSmartEnrichmentMode, toSmartEnrichmentRejectionReason, toSmartEnrichmentStatus, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -1166,6 +1166,13 @@ interface SmartEnrichmentRejectedCandidate {
1166
1166
  vatNumber: string;
1167
1167
  reason: SmartEnrichmentRejectionReason;
1168
1168
  }
1169
+ /** The registered address the official VAT check returned, field by field. */
1170
+ interface SmartEnrichmentOfficialAddress {
1171
+ street?: string;
1172
+ postal_code?: string;
1173
+ city?: string;
1174
+ country?: string;
1175
+ }
1169
1176
  /**
1170
1177
  * Result of resolving one reverse-VAT lookup (company name + address → VAT + confidence).
1171
1178
  * Mirrors the API response item shape (camelCase keys).
@@ -1195,6 +1202,40 @@ declare class SmartEnrichmentResource {
1195
1202
  * apart from "found nothing". Empty for every other status.
1196
1203
  */
1197
1204
  readonly rejectedCandidates: SmartEnrichmentRejectedCandidate[];
1205
+ /**
1206
+ * Only on `found`: the web page the VAT number was read from — usually the company's own
1207
+ * Impressum / legal notice. Undefined when it came from Taxora's own data or a register.
1208
+ */
1209
+ readonly sourceUrl: string | undefined;
1210
+ /**
1211
+ * Only on `found`: the PERSON the tax authority has the VAT ID under, when that is not the
1212
+ * trading name — typical for a German sole proprietorship (e.K.). `matchedCompanyName` stays
1213
+ * the trading name.
1214
+ */
1215
+ readonly registeredOwner: string | undefined;
1216
+ /**
1217
+ * Only on `found`: every page the VAT number was read from, `sourceUrl` first — each research
1218
+ * pass that found the same number contributes its page. At most 5.
1219
+ */
1220
+ readonly sourceUrls: string[];
1221
+ /**
1222
+ * A domestic tax number (e.g. a German Steuernummer, digits only) the company's own page shows
1223
+ * INSTEAD of a VAT ID — often under the VAT ID heading by mistake. Not a VAT ID.
1224
+ */
1225
+ readonly taxNumber: string | undefined;
1226
+ /** Only on `found`: the tax authority's verdict on the number; undefined when no official check ran. */
1227
+ readonly vatValid: boolean | undefined;
1228
+ /** Only on `found`: 0–100, the requested name against the register's; undefined when no name was disclosed. */
1229
+ readonly aiScore: number | undefined;
1230
+ /**
1231
+ * Only on `found`: 'ok' (name matches the register) or 'mismatch' (it does not — another company,
1232
+ * unless `registeredOwner` is set: then update your record).
1233
+ */
1234
+ readonly nameMatch: 'ok' | 'mismatch' | undefined;
1235
+ /** Only on `found`: the name the register has the number under. */
1236
+ readonly officialName: string | undefined;
1237
+ /** Only on `found`: the registered address, field by field. */
1238
+ readonly officialAddress: SmartEnrichmentOfficialAddress | undefined;
1198
1239
  constructor(status: SmartEnrichmentStatus, vatNumber: string | undefined, vatType: string | undefined, confidence: number | undefined, matchedCompanyName: string | undefined,
1199
1240
  /** Official/registered address of the matched company, when available. */
1200
1241
  matchedAddress: string | undefined, country: string | undefined, source: string | undefined,
@@ -1211,7 +1252,43 @@ declare class SmartEnrichmentResource {
1211
1252
  * e.g. one the tax authority reports as invalid. Lets you tell "found one, it is invalid"
1212
1253
  * apart from "found nothing". Empty for every other status.
1213
1254
  */
1214
- rejectedCandidates?: SmartEnrichmentRejectedCandidate[]);
1255
+ rejectedCandidates?: SmartEnrichmentRejectedCandidate[],
1256
+ /**
1257
+ * Only on `found`: the web page the VAT number was read from — usually the company's own
1258
+ * Impressum / legal notice. Undefined when it came from Taxora's own data or a register.
1259
+ */
1260
+ sourceUrl?: string | undefined,
1261
+ /**
1262
+ * Only on `found`: the PERSON the tax authority has the VAT ID under, when that is not the
1263
+ * trading name — typical for a German sole proprietorship (e.K.). `matchedCompanyName` stays
1264
+ * the trading name.
1265
+ */
1266
+ registeredOwner?: string | undefined,
1267
+ /**
1268
+ * Only on `found`: every page the VAT number was read from, `sourceUrl` first — each research
1269
+ * pass that found the same number contributes its page. At most 5.
1270
+ */
1271
+ sourceUrls?: string[],
1272
+ /**
1273
+ * A domestic tax number (e.g. a German Steuernummer, digits only) the company's own page shows
1274
+ * INSTEAD of a VAT ID — often under the VAT ID heading by mistake. Not a VAT ID.
1275
+ */
1276
+ taxNumber?: string | undefined,
1277
+ /** Only on `found`: the tax authority's verdict on the number; undefined when no official check ran. */
1278
+ vatValid?: boolean | undefined,
1279
+ /** Only on `found`: 0–100, the requested name against the register's; undefined when no name was disclosed. */
1280
+ aiScore?: number | undefined,
1281
+ /**
1282
+ * Only on `found`: 'ok' (name matches the register) or 'mismatch' (it does not — another company,
1283
+ * unless `registeredOwner` is set: then update your record).
1284
+ */
1285
+ nameMatch?: 'ok' | 'mismatch' | undefined,
1286
+ /** Only on `found`: the name the register has the number under. */
1287
+ officialName?: string | undefined,
1288
+ /** Only on `found`: the registered address, field by field. */
1289
+ officialAddress?: SmartEnrichmentOfficialAddress | undefined);
1290
+ /** True when the register knows the number under a different name than the one requested. */
1291
+ nameMismatch(): boolean;
1215
1292
  /** True when a VAT number was found but rejected by the official check. */
1216
1293
  hasRejectedCandidates(): boolean;
1217
1294
  static fromArray(data: Record<string, unknown>): SmartEnrichmentResource;
@@ -1942,4 +2019,4 @@ declare class AuthRetryHttpClient implements HttpClientInterface {
1942
2019
  private injectAuthHeader;
1943
2020
  }
1944
2021
 
1945
- export { ApiVersion, AuthEndpoint, AuthRetryHttpClient, AuthenticationException, CompanyAddress, CompanyEndpoint, type CompanyResource, ComplianceDocumentType, ComplianceEnrollment, ComplianceEnrollmentPage, ComplianceEnrollmentStatus, type ComplianceEnterpriseSize, type ComplianceInvoiceLineInput, type ComplianceInvoiceTaxInput, type ComplianceLedgerStateChangedEvent, type ComplianceLedgerWebhookObject, type ComplianceRequestService, ComplianceService, ComplianceTaxReport, ComplianceTaxReportPage, type ComplianceTaxReportRequestState, ComplianceTaxReportState, ComplianceTransaction, type ComplianceTransactionBuyerInput, type ComplianceTransactionFilters, type ComplianceTransactionInvoiceLine, type ComplianceTransactionInvoiceLineTax, ComplianceTransactionPage, type ComplianceTransactionRequestState, type ComplianceTransactionRequestType, ComplianceTransactionState, type ComplianceTransactionStateChangedEvent, ComplianceTransactionType, type ComplianceTransactionWebhookObject, type ComplianceTypeOperation, type CreateComplianceEnrollmentInput, type CreateComplianceTransactionInput, type CreateNorwayEnrollmentInput, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, type EReportingAccessRequestInput, EReportingEndpoint, type EReportingInterval, type EnrichmentCompletedEvent, type EnrichmentCompletedWebhookObject, type EnrichmentUpdatedEvent, type EnrichmentUpdatedWebhookObject, Environment, Environment as EnvironmentType, FetchHttpClient, type HttpClientInterface, HttpException, ImportResult, InMemoryTokenStorage, Language, LoginIdentifier, type NorwayEnrollmentInput, NorwegianOrgNumber, type ParsedWebhookSignatureHeader, PeppolLookupResult, PeppolLookupStatus, ProviderDocument, ProviderDocumentLine, RegistryCompany, RetryPolicy, type RetryPolicyOptions, type RevenueCountryBreakdown, type RevenueCurrencyBreakdown, type RevenueStateBreakdown, RevenueStatistics, type RevenueStatisticsFilters, type RevenueTimeBucket, type RevenueTotals, type RevenueTypeBreakdown, ScoreBreakdown, SireneLookupResult, type SmartEnrichmentAddressQuality, type SmartEnrichmentConfidenceBucket, SmartEnrichmentEndpoint, type SmartEnrichmentExportOptions, type SmartEnrichmentHistoryInput, SmartEnrichmentHistoryPage, SmartEnrichmentHistoryRow, type SmartEnrichmentHistoryStats, type SmartEnrichmentInput, SmartEnrichmentJob, SmartEnrichmentMode, type SmartEnrichmentOutcomeBreakdown, type SmartEnrichmentProviderVerdict, type SmartEnrichmentRejectedCandidate, SmartEnrichmentRejectionReason, SmartEnrichmentResource, type SmartEnrichmentSourceBreakdown, SmartEnrichmentStatistics, type SmartEnrichmentStatisticsInterval, type SmartEnrichmentStatisticsOptions, type SmartEnrichmentStatisticsRange, type SmartEnrichmentStatisticsTotals, SmartEnrichmentStatus, type SmartEnrichmentTimeBucket, type SmartEnrichmentUsage, type SmartEnrichmentUsageHistoryEntry, type SmartEnrichmentWaitOptions, TaxoraClient, TaxoraClientFactory, type TaxoraClientOptions, TaxoraException, type TaxoraWebhookEvent, type TestWebhookObject, Token, type TokenStorageInterface, type UpdateComplianceTransactionInput, ValidationException, VatCertificateExport, VatCollection, VatEndpoint, type VatRate, VatRates, VatResource, VatState, type VatStateChangedEvent, type VatValidatedEvent, VatValidationAddressInput, type VatWebhookObject, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebhookEventEnvelope, type WebhookEventType, type WebhookRawBody, type WebhookSignatureErrorReason, type WebhookSignatureHeaderInput, WebhookSignatureVerificationError, type WebhookTestEvent, type WebhookVerifyOptions, computeWebhookSignature, constructWebhookEvent, describeApiError, describeComplianceDocumentType, describeComplianceEnrollmentStatus, describeComplianceService, describeComplianceTaxReportState, describeComplianceTransactionState, describeComplianceTransactionType, describePeppolLookupStatus, describeSmartEnrichmentMode, describeSmartEnrichmentRejectionReason, describeSmartEnrichmentStatus, describeVatState, generateWebhookSignatureHeader, getBaseUrl, getFailedVatStates, parseWebhookSignatureHeader, toComplianceDocumentType, toComplianceEnrollmentStatus, toComplianceService, toComplianceTaxReportState, toComplianceTransactionState, toComplianceTransactionType, toPeppolLookupStatus, toSmartEnrichmentMode, toSmartEnrichmentRejectionReason, toSmartEnrichmentStatus, verifyWebhookSignature };
2022
+ export { ApiVersion, AuthEndpoint, AuthRetryHttpClient, AuthenticationException, CompanyAddress, CompanyEndpoint, type CompanyResource, ComplianceDocumentType, ComplianceEnrollment, ComplianceEnrollmentPage, ComplianceEnrollmentStatus, type ComplianceEnterpriseSize, type ComplianceInvoiceLineInput, type ComplianceInvoiceTaxInput, type ComplianceLedgerStateChangedEvent, type ComplianceLedgerWebhookObject, type ComplianceRequestService, ComplianceService, ComplianceTaxReport, ComplianceTaxReportPage, type ComplianceTaxReportRequestState, ComplianceTaxReportState, ComplianceTransaction, type ComplianceTransactionBuyerInput, type ComplianceTransactionFilters, type ComplianceTransactionInvoiceLine, type ComplianceTransactionInvoiceLineTax, ComplianceTransactionPage, type ComplianceTransactionRequestState, type ComplianceTransactionRequestType, ComplianceTransactionState, type ComplianceTransactionStateChangedEvent, ComplianceTransactionType, type ComplianceTransactionWebhookObject, type ComplianceTypeOperation, type CreateComplianceEnrollmentInput, type CreateComplianceTransactionInput, type CreateNorwayEnrollmentInput, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, type EReportingAccessRequestInput, EReportingEndpoint, type EReportingInterval, type EnrichmentCompletedEvent, type EnrichmentCompletedWebhookObject, type EnrichmentUpdatedEvent, type EnrichmentUpdatedWebhookObject, Environment, Environment as EnvironmentType, FetchHttpClient, type HttpClientInterface, HttpException, ImportResult, InMemoryTokenStorage, Language, LoginIdentifier, type NorwayEnrollmentInput, NorwegianOrgNumber, type ParsedWebhookSignatureHeader, PeppolLookupResult, PeppolLookupStatus, ProviderDocument, ProviderDocumentLine, RegistryCompany, RetryPolicy, type RetryPolicyOptions, type RevenueCountryBreakdown, type RevenueCurrencyBreakdown, type RevenueStateBreakdown, RevenueStatistics, type RevenueStatisticsFilters, type RevenueTimeBucket, type RevenueTotals, type RevenueTypeBreakdown, ScoreBreakdown, SireneLookupResult, type SmartEnrichmentAddressQuality, type SmartEnrichmentConfidenceBucket, SmartEnrichmentEndpoint, type SmartEnrichmentExportOptions, type SmartEnrichmentHistoryInput, SmartEnrichmentHistoryPage, SmartEnrichmentHistoryRow, type SmartEnrichmentHistoryStats, type SmartEnrichmentInput, SmartEnrichmentJob, SmartEnrichmentMode, type SmartEnrichmentOfficialAddress, type SmartEnrichmentOutcomeBreakdown, type SmartEnrichmentProviderVerdict, type SmartEnrichmentRejectedCandidate, SmartEnrichmentRejectionReason, SmartEnrichmentResource, type SmartEnrichmentSourceBreakdown, SmartEnrichmentStatistics, type SmartEnrichmentStatisticsInterval, type SmartEnrichmentStatisticsOptions, type SmartEnrichmentStatisticsRange, type SmartEnrichmentStatisticsTotals, SmartEnrichmentStatus, type SmartEnrichmentTimeBucket, type SmartEnrichmentUsage, type SmartEnrichmentUsageHistoryEntry, type SmartEnrichmentWaitOptions, TaxoraClient, TaxoraClientFactory, type TaxoraClientOptions, TaxoraException, type TaxoraWebhookEvent, type TestWebhookObject, Token, type TokenStorageInterface, type UpdateComplianceTransactionInput, ValidationException, VatCertificateExport, VatCollection, VatEndpoint, type VatRate, VatRates, VatResource, VatState, type VatStateChangedEvent, type VatValidatedEvent, VatValidationAddressInput, type VatWebhookObject, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebhookEventEnvelope, type WebhookEventType, type WebhookRawBody, type WebhookSignatureErrorReason, type WebhookSignatureHeaderInput, WebhookSignatureVerificationError, type WebhookTestEvent, type WebhookVerifyOptions, computeWebhookSignature, constructWebhookEvent, describeApiError, describeComplianceDocumentType, describeComplianceEnrollmentStatus, describeComplianceService, describeComplianceTaxReportState, describeComplianceTransactionState, describeComplianceTransactionType, describePeppolLookupStatus, describeSmartEnrichmentMode, describeSmartEnrichmentRejectionReason, describeSmartEnrichmentStatus, describeVatState, generateWebhookSignatureHeader, getBaseUrl, getFailedVatStates, parseWebhookSignatureHeader, toComplianceDocumentType, toComplianceEnrollmentStatus, toComplianceService, toComplianceTaxReportState, toComplianceTransactionState, toComplianceTransactionType, toPeppolLookupStatus, toSmartEnrichmentMode, toSmartEnrichmentRejectionReason, toSmartEnrichmentStatus, verifyWebhookSignature };
package/dist/index.js CHANGED
@@ -2315,8 +2315,22 @@ function toRejectedCandidates(value) {
2315
2315
  }
2316
2316
  return candidates;
2317
2317
  }
2318
+ function toOfficialAddress(value) {
2319
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
2320
+ return void 0;
2321
+ }
2322
+ const record = value;
2323
+ const address = {};
2324
+ for (const key of ["street", "postal_code", "city", "country"]) {
2325
+ const part = typeof record[key] === "string" ? record[key].trim() : "";
2326
+ if (part !== "") {
2327
+ address[key] = part;
2328
+ }
2329
+ }
2330
+ return Object.keys(address).length > 0 ? address : void 0;
2331
+ }
2318
2332
  var SmartEnrichmentResource = class _SmartEnrichmentResource {
2319
- constructor(status, vatNumber, vatType, confidence, matchedCompanyName, matchedAddress, country, source, mode = void 0, providerVerdicts = [], addressQuality = void 0, rejectedCandidates = []) {
2333
+ constructor(status, vatNumber, vatType, confidence, matchedCompanyName, matchedAddress, country, source, mode = void 0, providerVerdicts = [], addressQuality = void 0, rejectedCandidates = [], sourceUrl = void 0, registeredOwner = void 0, sourceUrls = [], taxNumber = void 0, vatValid = void 0, aiScore = void 0, nameMatch = void 0, officialName = void 0, officialAddress = void 0) {
2320
2334
  this.status = status;
2321
2335
  this.vatNumber = vatNumber;
2322
2336
  this.vatType = vatType;
@@ -2329,6 +2343,15 @@ var SmartEnrichmentResource = class _SmartEnrichmentResource {
2329
2343
  this.providerVerdicts = providerVerdicts;
2330
2344
  this.addressQuality = addressQuality;
2331
2345
  this.rejectedCandidates = rejectedCandidates;
2346
+ this.sourceUrl = sourceUrl;
2347
+ this.registeredOwner = registeredOwner;
2348
+ this.sourceUrls = sourceUrls;
2349
+ this.taxNumber = taxNumber;
2350
+ this.vatValid = vatValid;
2351
+ this.aiScore = aiScore;
2352
+ this.nameMatch = nameMatch;
2353
+ this.officialName = officialName;
2354
+ this.officialAddress = officialAddress;
2332
2355
  }
2333
2356
  status;
2334
2357
  vatNumber;
@@ -2342,6 +2365,19 @@ var SmartEnrichmentResource = class _SmartEnrichmentResource {
2342
2365
  providerVerdicts;
2343
2366
  addressQuality;
2344
2367
  rejectedCandidates;
2368
+ sourceUrl;
2369
+ registeredOwner;
2370
+ sourceUrls;
2371
+ taxNumber;
2372
+ vatValid;
2373
+ aiScore;
2374
+ nameMatch;
2375
+ officialName;
2376
+ officialAddress;
2377
+ /** True when the register knows the number under a different name than the one requested. */
2378
+ nameMismatch() {
2379
+ return this.nameMatch === "mismatch";
2380
+ }
2345
2381
  /** True when a VAT number was found but rejected by the official check. */
2346
2382
  hasRejectedCandidates() {
2347
2383
  return this.rejectedCandidates.length > 0;
@@ -2351,6 +2387,13 @@ var SmartEnrichmentResource = class _SmartEnrichmentResource {
2351
2387
  const v = data[key];
2352
2388
  return typeof v === "string" ? v : void 0;
2353
2389
  };
2390
+ const text = (key) => {
2391
+ const v = str(key)?.trim();
2392
+ return v ? v : void 0;
2393
+ };
2394
+ const isWebUrl = (value) => typeof value === "string" && /^https?:\/\/\S+$/i.test(value.trim());
2395
+ const url = text("sourceUrl");
2396
+ const urls = data["sourceUrls"];
2354
2397
  const num = (key) => {
2355
2398
  const v = data[key];
2356
2399
  return typeof v === "number" ? v : void 0;
@@ -2369,7 +2412,16 @@ var SmartEnrichmentResource = class _SmartEnrichmentResource {
2369
2412
  toSmartEnrichmentMode(data["mode"]),
2370
2413
  Array.isArray(verdicts) ? verdicts.filter((v) => typeof v === "object" && v !== null) : [],
2371
2414
  typeof quality === "object" && quality !== null ? quality : void 0,
2372
- toRejectedCandidates(data["rejectedCandidates"])
2415
+ toRejectedCandidates(data["rejectedCandidates"]),
2416
+ url && isWebUrl(url) ? url : void 0,
2417
+ text("registeredOwner"),
2418
+ Array.isArray(urls) ? [...new Set(urls.filter(isWebUrl).map((u) => u.trim()))] : [],
2419
+ text("taxNumber"),
2420
+ typeof data["vatValid"] === "boolean" ? data["vatValid"] : void 0,
2421
+ num("aiScore"),
2422
+ data["nameMatch"] === "ok" || data["nameMatch"] === "mismatch" ? data["nameMatch"] : void 0,
2423
+ text("officialName"),
2424
+ toOfficialAddress(data["officialAddress"])
2373
2425
  );
2374
2426
  }
2375
2427
  toArray() {
@@ -2385,7 +2437,16 @@ var SmartEnrichmentResource = class _SmartEnrichmentResource {
2385
2437
  mode: this.mode ?? null,
2386
2438
  providerVerdicts: this.providerVerdicts,
2387
2439
  addressQuality: this.addressQuality ?? null,
2388
- rejectedCandidates: this.rejectedCandidates.map((c) => ({ vatNumber: c.vatNumber, reason: c.reason }))
2440
+ rejectedCandidates: this.rejectedCandidates.map((c) => ({ vatNumber: c.vatNumber, reason: c.reason })),
2441
+ sourceUrl: this.sourceUrl ?? null,
2442
+ registeredOwner: this.registeredOwner ?? null,
2443
+ sourceUrls: this.sourceUrls,
2444
+ taxNumber: this.taxNumber ?? null,
2445
+ vatValid: this.vatValid ?? null,
2446
+ aiScore: this.aiScore ?? null,
2447
+ nameMatch: this.nameMatch ?? null,
2448
+ officialName: this.officialName ?? null,
2449
+ officialAddress: this.officialAddress ?? null
2389
2450
  };
2390
2451
  }
2391
2452
  };
@@ -3663,7 +3724,7 @@ var AuthRetryHttpClient = class {
3663
3724
  };
3664
3725
 
3665
3726
  // src/version.ts
3666
- var SDK_VERSION = "1.4.0";
3727
+ var SDK_VERSION = "1.6.0";
3667
3728
 
3668
3729
  // src/http/SdkVersionHttpClient.ts
3669
3730
  var SDK_VERSION_HEADER = "X-Taxora-SDK-Version";