diff --git a/CHANGELOG.md b/CHANGELOG.md index c0cc9eb..d039064 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [4.14.3] 2026-04-13 +## [4.15.0] 2026-04-13 +### Added +- Add `organizations.updateDefaultSeries` to set an organization default series by type. + ### Fixed - Return blob if content-type is octet-stream. This is the coverage for zip files diff --git a/package-lock.json b/package-lock.json index 2f65861..e4b40da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "facturapi", - "version": "4.14.2", + "version": "4.15.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "facturapi", - "version": "4.14.2", + "version": "4.15.0", "license": "MIT", "devDependencies": { "@eslint/js": "^10.0.1", diff --git a/package.json b/package.json index eaea0d4..f2190c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "facturapi", - "version": "4.14.2", + "version": "4.15.0", "description": "SDK oficial de Facturapi para Node.js y navegadores. Integra facturación electrónica en México (CFDI) de forma simple y obtén una perspectiva fiscal completa de tu operación, con búsquedas indexadas, envío de documentos y trazabilidad.", "main": "dist/index.cjs.js", "module": "dist/index.es.js", @@ -95,4 +95,4 @@ "vite": "^8.0.3", "vitest": "^4.1.2" } -} \ No newline at end of file +} diff --git a/src/resources/organizations.ts b/src/resources/organizations.ts index 264fde2..56bb6c7 100644 --- a/src/resources/organizations.ts +++ b/src/resources/organizations.ts @@ -10,6 +10,7 @@ import type { OrganizationTeamRoleTemplate, OrganizationTeamRoleUpdateInput, OrganizationUserAccess, + OrganizationDefaultSeriesUpdateInput, Series, } from '../types/organization'; import type { BinaryInput, NodeLikeReadableStream } from '../types'; @@ -347,6 +348,24 @@ export default class Organizations { ); } + /** + * Sets default series for an organization + * @param organization_id Organization Id + * @param data Default series input + * @returns Organization object + */ + updateDefaultSeries( + organization_id: string, + data: OrganizationDefaultSeriesUpdateInput, + ): Promise { + return this.client.put( + `/organizations/${organization_id}/series-group/default-series`, + { + body: data, + }, + ); + } + /** * Update a Series Organization * @param organization_id Organization Id diff --git a/src/types/organization.ts b/src/types/organization.ts index cbf3a6d..fd90841 100644 --- a/src/types/organization.ts +++ b/src/types/organization.ts @@ -7,6 +7,11 @@ export interface Series { next_folio_test: number; } +export interface OrganizationDefaultSeriesUpdateInput { + type: 'I' | 'E' | 'P' | 'N' | 'T'; + series: string; +} + export interface ApiKeys { id: string; first_12: string;