@taxora/sdk 1.5.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/CHANGELOG.md +14 -0
- package/README.md +11 -0
- package/dist/index.cjs +46 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -2
- package/dist/index.d.ts +47 -2
- package/dist/index.js +46 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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).
|
|
@@ -1211,6 +1218,24 @@ declare class SmartEnrichmentResource {
|
|
|
1211
1218
|
* pass that found the same number contributes its page. At most 5.
|
|
1212
1219
|
*/
|
|
1213
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;
|
|
1214
1239
|
constructor(status: SmartEnrichmentStatus, vatNumber: string | undefined, vatType: string | undefined, confidence: number | undefined, matchedCompanyName: string | undefined,
|
|
1215
1240
|
/** Official/registered address of the matched company, when available. */
|
|
1216
1241
|
matchedAddress: string | undefined, country: string | undefined, source: string | undefined,
|
|
@@ -1243,7 +1268,27 @@ declare class SmartEnrichmentResource {
|
|
|
1243
1268
|
* Only on `found`: every page the VAT number was read from, `sourceUrl` first — each research
|
|
1244
1269
|
* pass that found the same number contributes its page. At most 5.
|
|
1245
1270
|
*/
|
|
1246
|
-
sourceUrls?: string[]
|
|
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;
|
|
1247
1292
|
/** True when a VAT number was found but rejected by the official check. */
|
|
1248
1293
|
hasRejectedCandidates(): boolean;
|
|
1249
1294
|
static fromArray(data: Record<string, unknown>): SmartEnrichmentResource;
|
|
@@ -1974,4 +2019,4 @@ declare class AuthRetryHttpClient implements HttpClientInterface {
|
|
|
1974
2019
|
private injectAuthHeader;
|
|
1975
2020
|
}
|
|
1976
2021
|
|
|
1977
|
-
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).
|
|
@@ -1211,6 +1218,24 @@ declare class SmartEnrichmentResource {
|
|
|
1211
1218
|
* pass that found the same number contributes its page. At most 5.
|
|
1212
1219
|
*/
|
|
1213
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;
|
|
1214
1239
|
constructor(status: SmartEnrichmentStatus, vatNumber: string | undefined, vatType: string | undefined, confidence: number | undefined, matchedCompanyName: string | undefined,
|
|
1215
1240
|
/** Official/registered address of the matched company, when available. */
|
|
1216
1241
|
matchedAddress: string | undefined, country: string | undefined, source: string | undefined,
|
|
@@ -1243,7 +1268,27 @@ declare class SmartEnrichmentResource {
|
|
|
1243
1268
|
* Only on `found`: every page the VAT number was read from, `sourceUrl` first — each research
|
|
1244
1269
|
* pass that found the same number contributes its page. At most 5.
|
|
1245
1270
|
*/
|
|
1246
|
-
sourceUrls?: string[]
|
|
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;
|
|
1247
1292
|
/** True when a VAT number was found but rejected by the official check. */
|
|
1248
1293
|
hasRejectedCandidates(): boolean;
|
|
1249
1294
|
static fromArray(data: Record<string, unknown>): SmartEnrichmentResource;
|
|
@@ -1974,4 +2019,4 @@ declare class AuthRetryHttpClient implements HttpClientInterface {
|
|
|
1974
2019
|
private injectAuthHeader;
|
|
1975
2020
|
}
|
|
1976
2021
|
|
|
1977
|
-
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 = [], sourceUrl = void 0, registeredOwner = void 0, sourceUrls = []) {
|
|
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;
|
|
@@ -2332,6 +2346,12 @@ var SmartEnrichmentResource = class _SmartEnrichmentResource {
|
|
|
2332
2346
|
this.sourceUrl = sourceUrl;
|
|
2333
2347
|
this.registeredOwner = registeredOwner;
|
|
2334
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;
|
|
2335
2355
|
}
|
|
2336
2356
|
status;
|
|
2337
2357
|
vatNumber;
|
|
@@ -2348,6 +2368,16 @@ var SmartEnrichmentResource = class _SmartEnrichmentResource {
|
|
|
2348
2368
|
sourceUrl;
|
|
2349
2369
|
registeredOwner;
|
|
2350
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
|
+
}
|
|
2351
2381
|
/** True when a VAT number was found but rejected by the official check. */
|
|
2352
2382
|
hasRejectedCandidates() {
|
|
2353
2383
|
return this.rejectedCandidates.length > 0;
|
|
@@ -2385,7 +2415,13 @@ var SmartEnrichmentResource = class _SmartEnrichmentResource {
|
|
|
2385
2415
|
toRejectedCandidates(data["rejectedCandidates"]),
|
|
2386
2416
|
url && isWebUrl(url) ? url : void 0,
|
|
2387
2417
|
text("registeredOwner"),
|
|
2388
|
-
Array.isArray(urls) ? [...new Set(urls.filter(isWebUrl).map((u) => u.trim()))] : []
|
|
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"])
|
|
2389
2425
|
);
|
|
2390
2426
|
}
|
|
2391
2427
|
toArray() {
|
|
@@ -2404,7 +2440,13 @@ var SmartEnrichmentResource = class _SmartEnrichmentResource {
|
|
|
2404
2440
|
rejectedCandidates: this.rejectedCandidates.map((c) => ({ vatNumber: c.vatNumber, reason: c.reason })),
|
|
2405
2441
|
sourceUrl: this.sourceUrl ?? null,
|
|
2406
2442
|
registeredOwner: this.registeredOwner ?? null,
|
|
2407
|
-
sourceUrls: this.sourceUrls
|
|
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
|
|
2408
2450
|
};
|
|
2409
2451
|
}
|
|
2410
2452
|
};
|
|
@@ -3682,7 +3724,7 @@ var AuthRetryHttpClient = class {
|
|
|
3682
3724
|
};
|
|
3683
3725
|
|
|
3684
3726
|
// src/version.ts
|
|
3685
|
-
var SDK_VERSION = "1.
|
|
3727
|
+
var SDK_VERSION = "1.6.0";
|
|
3686
3728
|
|
|
3687
3729
|
// src/http/SdkVersionHttpClient.ts
|
|
3688
3730
|
var SDK_VERSION_HEADER = "X-Taxora-SDK-Version";
|