Changelog
Historial de cambios y versiones del SDK.
Changelog
2.0.0
Major Changes
-
f705557: Migrate
factus-jsfrom Factus API v1 to Factus API v2.This major release aligns the SDK with the full v2 platform, including breaking changes to modules, endpoints, payloads, response shapes, and constants.
- Update the client surface to the v2 API across bills, credit notes, support documents, adjustment notes, company, numbering ranges, reception, subscription, acquirer, and documents.
- Replace the old
catalogruntime module with the v2acquirermodule, and move reference data usage toward typed exported constants and reference tables. - Add and document the new v2 flows for attached-document XML downloads, generic
documents.downloadXml()lookups by global identifier, and numbering range status toggles. - Reshape public types to match v2 payloads and responses, including
CreateCreditNoteInput.bill_id,EmailContentData.attached_document, RADIANclaim_concept_code, restricted manual reception event codes, andbills.emitRadianEvent()returningApiResponse<BillEvent[]>. - Refresh the quick start, module guides, endpoint references, response examples, and docs navigation so the published package and its documentation consistently reflect the v2 migration end to end.
1.1.0
Minor Changes
- e0b9497: Align bill naming across types, constants, module docs, and examples while keeping backwards compatibility.
- Add canonical
Bill*public types and keepInvoice*aliases as deprecated. - Add canonical
BillDocumentTypeandBillDocumentTypeInfo, and deprecateInvoiceDocumentTypeandInvoiceDocumentTypeInfo. - Rename canonical type entrypoint to
types/billand keeptypes/invoiceas a compatibility re-export. - Update docs/comments/examples to use bill terminology consistently.
- Add canonical
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.