Changelog
Historial de cambios y versiones del SDK.
Changelog
1.0.0
Major Changes
-
94da43d: Breaking changes
- Constants now use direct string values. Replace
Constant.Key.valuewithConstant.Keyeverywhere (e.g.PaymentFormCode.CashPaymentinstead ofPaymentFormCode.CashPayment.value). Human-readable descriptions and abbreviations are available from the new*Infocompanion exports (e.g.PaymentFormCodeInfo). bills.getByNumber()renamed tobills.get().FactusErrorconstructor signature changed to an options object:new FactusError(message, { statusCode, errors?, validationErrors?, cause? }).- Deprecated
InvoiceandCreditNotetypes removed fromtypes/invoice.tsandtypes/credit-note.ts.
New features
listAll()async generator on paginated modules (bills,creditNotes,supportDocuments,adjustmentNotes,reception,numberingRanges) for transparent, automatic pagination.AbortSignalsupport via optionaloptions.signalparameter on every module method.- Automatic 401 retry with silent token refresh — the SDK retries once after refreshing credentials on a 401 response.
- Auth token request deduplication: concurrent calls share a single in-flight token request.
- Runtime validation of required
FactusClientConfigfields (clientId,clientSecret,username,password) at construction time. causeproperty onFactusErrorfor wrapping low-level errors.- New
*Infocompanion exports with human-readable constant descriptions and abbreviations (PaymentFormCodeInfo,IdentityDocumentTypeIdInfo, etc.).
Type improvements
is_excludedtightened to0 | 1union.dvandmunicipality_idstandardized tostring.- All manually duplicated
{ status, message, data }response interfaces replaced withApiResponse<T>type aliases. - New shared types:
EmailContentData,CodeNameObject,CodeNameIdObject.
Package
engines: { "node": ">=18" }added topackage.json.sideEffects: falsefor better tree-shaking.- CI now runs on Node.js 22 LTS with npm provenance enabled on releases.
- Constants now use direct string values. Replace
0.3.0
Minor Changes
-
2a56ba0: Stringify all DIAN catalog constant
valuefields (e.g.IdentityDocumentTypeId,CreditNoteOperationTypeCode,ProductStandardId,OrganizationTypeId, etc.) so runtime values and inferred TypeScript unions arestring, matching the Factus PHP API’s string handling and improving compatibility with Zod, React Hook Form, and similar tooling.Breaking change (TypeScript): code that passed or compared numbers for these codes must use strings (e.g.
"3"instead of3, orSomeConstant.Entry.valuewhich is now a string).RadianEventUpdateInput.identification_document_codeandEmitEventInput.identification_document_codeare now typed asstring; invoice mandateidentification_document_idfields usestringas well.Docs and examples were updated to use
.valuewhere payloads expect scalars.
0.2.0
Minor Changes
- 3c31b65: Add
abbreviationto each entry inIdentityDocumentTypeIdandSupportDocumentIdentityTypeIdfor UI labels and display. Document the mapping in the reference tables catalog page.
0.1.3
Patch Changes
- b8d9a96: Add validation error handling to FactusError and update documentation
- Introduced
validationErrorsproperty inFactusErrorto capture DIAN validation rule violations. - Enhanced error handling in
HttpClientto populatevalidationErrorsfrom API responses. - Updated documentation in
error-handling.mdxto reflect changes and provide examples of validation error handling. - Added unit tests to verify the correct behavior of validation error handling in various scenarios.
- Introduced
0.1.2
Patch Changes
- c92791f: Refactor sandbox tests and error handling:
- Remove deprecated error assertion helper
- Enhance result reporting
- Improve error message handling in HttpClient.
0.1.1
Patch Changes
- 0de24e9: Fix auth request format, race condition, type correctness, and developer experience improvements
- Send OAuth token requests as
application/x-www-form-urlencodedinstead of JSON to match the Factus API documentation - Deduplicate concurrent authentication requests to prevent race conditions when multiple API calls trigger token refresh simultaneously
- Fix response type wrapping for support document and adjustment note download methods to match the invoice/credit note pattern
- Change
CreditNoteOperationTypeCodeconstant values from strings to numbers, matching the API contract and making the constant usable withCreateCreditNoteInput.customization_id - Change
AdjustmentNoteReasonCodeconstant values from numbers to strings, matching the API request format - Add
Object.setPrototypeOftoFactusErrorfor safe prototype chain in CJS environments - Replace unsafe type casts in the catalog module with a generic
toQueryParamshelper - Add
payment_formfield toCreateCreditNoteInput - Replace
any[]with proper types foradjustment_notesin support document types - Widen
RadianEventUpdateInput.identification_document_codefrom narrowIdentityDocumentTypeIdunion tonumberto support additional API codes - Add
@see/{@link}references to deprecated type aliases - Enable sourcemaps in build output
- Mark
HttpClientclass as@internal
- Send OAuth token requests as
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 - 2026-03-19
Added
- Initial public release of the TypeScript/JavaScript SDK for the Factus Colombian e-invoicing API.
FactusClientwith modules for bills, credit notes, adjustment notes, support documents, catalog, company, numbering ranges, reception, and subscription.